Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Commit f730cec

Browse files
plur9claude
andcommitted
feat: Autonomous agent commands — watch, scan-bounties, batch sell
Phase 0 — MCP compatibility fixes: - Align Base mainnet contract to 0x69Aa385686AEdA505013a775ddE7A59d045cb30d - Fix ECDH commit-reveal: commit against encrypted key when buyer pubkey known - Add marketplace publishing to sell command - Bridge MCP JSON key storage (~/.datafund/escrow-keys/) bidirectionally - Extend CLIError with retryAfterSeconds, suggestedCommand, 10 new error codes - Add HTTPS enforcement for API and RPC URLs Phase 1 — New commands: - `ade watch` — escrow automation daemon with NDJSON event protocol, three-tier spending limits, HMAC-SHA256 state integrity, PID-based locking - `ade scan-bounties` — match local files to open bounties via keyword overlap, security filters for sensitive files, optional auto-respond mode - `ade sell --dir` — batch sell files from directory with rate limiting, --skip-existing, --max-files, partial error reporting Schema v1.1.0 with auth levels, credentials, protocols, error formats. Version bumped to 0.2.0. 213 tests pass. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e9bdf22 commit f730cec

23 files changed

Lines changed: 2850 additions & 100 deletions

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "ade",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"type": "module",
55
"scripts": {
66
"test": "bun test",
77
"test:watch": "bun test --watch",
8-
"test:unit": "bun test tests/errors.test.ts tests/format.test.ts tests/api.test.ts tests/routing.test.ts tests/help.test.ts tests/escrow-keys.test.ts tests/commands.test.ts tests/addresses.test.ts tests/secrets.test.ts tests/keychain/keychain.test.ts tests/update.test.ts tests/integration.test.ts",
8+
"test:unit": "bun test tests/errors.test.ts tests/format.test.ts tests/api.test.ts tests/routing.test.ts tests/help.test.ts tests/escrow-keys.test.ts tests/commands.test.ts tests/addresses.test.ts tests/secrets.test.ts tests/keychain/keychain.test.ts tests/update.test.ts tests/integration.test.ts tests/watch.test.ts tests/scan.test.ts tests/batch-sell.test.ts",
99
"test:chain": "bun test tests/chain-view.test.ts",
1010
"test:integration": "bun test tests/keychain/integration.test.ts",
1111
"review": "bun scripts/review.ts",

src/addresses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const CHAINS: Record<string, ChainConfig> = {
4242
explorer: 'https://basescan.org',
4343
defaultRpc: 'https://mainnet.base.org',
4444
contracts: {
45-
dataEscrow: getAddress('0xDd4396d4F28d2b513175ae17dE11e56a898d19c3'),
45+
dataEscrow: getAddress('0x69Aa385686AEdA505013a775ddE7A59d045cb30d'),
4646
...ERC8004_MAINNET,
4747
usdc: getAddress('0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'),
4848
usdt: getAddress('0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2'),

src/api.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,25 @@ export function getBaseUrl(): string {
1111
return (process.env.SX_API || 'https://agents.datafund.io').trim()
1212
}
1313

14+
function validateApiUrl(url: string): void {
15+
try {
16+
const parsed = new URL(url)
17+
const isLocalhost = parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1' || parsed.hostname === '::1'
18+
if (parsed.protocol !== 'https:' && !isLocalhost) {
19+
throw new CLIError('ERR_INVALID_ARGUMENT',
20+
`API URL must use HTTPS: ${url}`,
21+
'Set a secure URL: ade set SX_API https://agents.datafund.io')
22+
}
23+
} catch (err) {
24+
if (err instanceof CLIError) throw err
25+
throw new CLIError('ERR_INVALID_ARGUMENT', `Invalid API URL: ${url}`)
26+
}
27+
}
28+
1429
export async function apiFetch<T = unknown>(path: string, opts?: RequestInit): Promise<T> {
15-
const url = `${getBaseUrl()}/api/v1${path}`
30+
const baseUrl = getBaseUrl()
31+
validateApiUrl(baseUrl)
32+
const url = `${baseUrl}/api/v1${path}`
1633

1734
let res: Response
1835
try {

0 commit comments

Comments
 (0)