Skip to content

Commit 1b1fdb9

Browse files
treewide: rename blue-agent-connect → blue-js-sdk/ai-path
The agent-facing SDK is published as 'blue-js-sdk', with the AI-path surface exported from 'blue-js-sdk/ai-path'. The old 'blue-agent-connect' name does not exist on npm — every agent that copy-pasted our examples got MODULE_NOT_FOUND. This commit aligns the live runtime with the docs that were just shipped. Surface area: - README.md, MANIFESTO.md, server/README.md — public-facing examples - server/src/sentinel.ts — provisioning response 'instructions' field - fresh-test/test-ai-agent.mjs — live E2E test that imports the SDK by name - server/test/test-agent-connect.mjs — header comment server/test/test-fresh-agent.mjs is also updated to drop the now-unneeded ETH gas funding step (EIP-3009 means the agent's EVM key never broadcasts). Deprecated 'sdk/' directory and the E2E-TEST-RESULTS.txt log artifact are left untouched (per CLAUDE.md, sdk/ is unpublished legacy).
1 parent 4f04835 commit 1b1fdb9

7 files changed

Lines changed: 34 additions & 66 deletions

File tree

MANIFESTO.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ To compete, someone would need: a working decentralized VPN network (years to bu
152152
```typescript
153153
import { x402Client, wrapFetchWithPayment } from '@x402/fetch';
154154
import { ExactEvmScheme } from '@x402/evm/exact/client';
155-
import { createWallet, connect } from 'blue-agent-connect';
155+
import { createWallet, connect } from 'blue-js-sdk/ai-path';
156156

157157
// 1. Sentinel wallet (one-time — persist the mnemonic)
158158
const wallet = await createWallet();
@@ -220,7 +220,7 @@ This is a flywheel. Every agent that connects makes the network more valuable fo
220220
| **Live** | Self-hosted facilitator (`server/src/facilitator.ts`) — no Coinbase dependency required |
221221
| **Live** | Subscription pool manager — handles 8-allocation-per-sub chain limit |
222222
| **Live** | Fee-grant flow — agent's `MsgStartSession` pays zero gas |
223-
| **Live** | Reference agent example using `@x402/fetch` + `blue-agent-connect` |
223+
| **Live** | Reference agent example using `@x402/fetch` + `blue-js-sdk/ai-path` |
224224
| **Pending** | Solana support (code written, env wiring not enabled) |
225225
| **Pending** | MCP server — Claude/GPT/Gemini tool integration |
226226

@@ -229,7 +229,7 @@ This is a flywheel. Every agent that connects makes the network more valuable fo
229229
- Fee grant module
230230
- MsgShareSubscription
231231
- blue-js-sdk (Sentinel chain operations)
232-
- blue-agent-connect (WireGuard + V2Ray E2E)
232+
- blue-js-sdk/ai-path (WireGuard + V2Ray E2E)
233233
- Node tester (Sentinel nodes validated)
234234
- P2P treasury (funded)
235235

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ One HTTP request. No KYC. No accounts. No P2P tokens. No custom contract to depl
99
```typescript
1010
import { x402Client, wrapFetchWithPayment } from '@x402/fetch';
1111
import { ExactEvmScheme } from '@x402/evm/exact/client';
12-
import { createWallet, connect } from 'blue-agent-connect';
12+
import { createWallet, connect } from 'blue-js-sdk/ai-path';
1313

1414
const wallet = await createWallet();
1515

@@ -121,7 +121,7 @@ You need:
121121
### Connect as an agent
122122

123123
```bash
124-
npm install @x402/fetch @x402/evm blue-agent-connect viem
124+
npm install @x402/fetch @x402/evm blue-js-sdk viem
125125
```
126126

127127
```typescript
@@ -130,7 +130,7 @@ import { ExactEvmScheme } from '@x402/evm/exact/client';
130130
import { createWalletClient, http } from 'viem';
131131
import { privateKeyToAccount } from 'viem/accounts';
132132
import { base } from 'viem/chains';
133-
import { createWallet, connect, disconnect } from 'blue-agent-connect';
133+
import { createWallet, connect, disconnect } from 'blue-js-sdk/ai-path';
134134

135135
// 1. Sentinel wallet (one-time — persist the mnemonic)
136136
const wallet = await createWallet();

fresh-test/test-ai-agent.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* The page says (Managed Plan flow):
99
* 1. npm install @x402/fetch @x402/evm blue-js-sdk viem
10-
* 2. Create Sentinel wallet via createWallet() from blue-agent-connect
10+
* 2. Create Sentinel wallet via createWallet() from blue-js-sdk/ai-path
1111
* 3. Set up x402Client + ExactEvmScheme + wrapFetchWithPayment
1212
* 4. POST /vpn/connect/1day with { sentinelAddr }
1313
* 5. connect({ mnemonic, nodeAddress: provision.nodeAddress, subscriptionId, feeGranter })
@@ -116,7 +116,7 @@ console.log('\n--- PHASE 2: PACKAGE INSTALL ---\n');
116116
// Page says: npm install @x402/fetch @x402/evm blue-js-sdk viem
117117
// Verify all packages are importable
118118
let installOk = true;
119-
const requiredPackages = ['@x402/fetch', '@x402/evm/exact/client', 'blue-agent-connect', 'viem'];
119+
const requiredPackages = ['@x402/fetch', '@x402/evm/exact/client', 'blue-js-sdk/ai-path', 'viem'];
120120

121121
for (const pkg of requiredPackages) {
122122
try {
@@ -141,9 +141,9 @@ console.log('\n--- PHASE 3: WALLET CREATION ---\n');
141141
let sentWallet;
142142
let evmWallet;
143143

144-
// Page says: import { createWallet } from 'blue-agent-connect'
144+
// Page says: import { createWallet } from 'blue-js-sdk/ai-path'
145145
try {
146-
const { createWallet } = await import('blue-agent-connect');
146+
const { createWallet } = await import('blue-js-sdk/ai-path');
147147
sentWallet = await createWallet();
148148
note('Wallet', `Sentinel wallet created: ${sentWallet.address}`);
149149
if (sentWallet.mnemonic) note('Wallet', 'Mnemonic returned — agent can persist it');
@@ -269,7 +269,7 @@ try {
269269
if (provision.instructions) note('Payment', `Instructions present: "${provision.instructions.slice(0, 80)}..."`);
270270
else note('Payment', 'MISSING instructions — agent has no guidance for next step', 5);
271271

272-
// Verify instructions reference blue-agent-connect (not old packages)
272+
// Verify instructions reference blue-js-sdk/ai-path (not old packages)
273273
if (provision.instructions && provision.instructions.includes('sentinel-ai-connect')) {
274274
note('Payment', 'Instructions reference deprecated sentinel-ai-connect package', 3);
275275
}
@@ -291,15 +291,15 @@ console.log('\n--- PHASE 6: VPN CONNECTION ---\n');
291291

292292
let connect, disconnect, status;
293293

294-
// Page says: import { connect, disconnect } from 'blue-agent-connect'
294+
// Page says: import { connect, disconnect } from 'blue-js-sdk/ai-path'
295295
try {
296-
const agentConnect = await import('blue-agent-connect');
296+
const agentConnect = await import('blue-js-sdk/ai-path');
297297
connect = agentConnect.connect;
298298
disconnect = agentConnect.disconnect;
299299
status = agentConnect.status;
300-
note('Connect', 'Imported connect/disconnect from blue-agent-connect');
300+
note('Connect', 'Imported connect/disconnect from blue-js-sdk/ai-path');
301301
} catch (err) {
302-
note('Connect', `Cannot import from blue-agent-connect: ${err.message}`, 10);
302+
note('Connect', `Cannot import from blue-js-sdk/ai-path: ${err.message}`, 10);
303303
writeResults();
304304
process.exit(1);
305305
}

server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Response (after payment):
105105
"sentinelTxHash": "ABC123...",
106106
"expiresAt": "2026-04-15T18:50:48Z",
107107
"operatorAddress": "0xCC689D...",
108-
"instructions": "import { connect } from 'blue-agent-connect'; await connect({ mnemonic, subscriptionId: 1192288, feeGranter: 'sent12e03...' })"
108+
"instructions": "import { connect } from 'blue-js-sdk/ai-path'; await connect({ mnemonic, subscriptionId: 1192288, feeGranter: 'sent12e03...' })"
109109
}
110110
```
111111

server/src/sentinel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export async function provisionAgent(
254254
sentinelTxHash: result.transactionHash,
255255
expiresAt: expirationDate.toISOString(),
256256
operatorAddress,
257-
instructions: `import { connect } from 'blue-agent-connect'; await connect({ mnemonic, nodeAddress: '${recommended}', subscriptionId: '${slot.id}', feeGranter: '${operatorAddress}' })`,
257+
instructions: `import { connect } from 'blue-js-sdk/ai-path'; await connect({ mnemonic, nodeAddress: '${recommended}', subscriptionId: '${slot.id}', feeGranter: '${operatorAddress}' })`,
258258
};
259259
}
260260

@@ -313,7 +313,7 @@ export async function provisionAgent(
313313
sentinelTxHash: result.transactionHash,
314314
expiresAt: expirationDate.toISOString(),
315315
operatorAddress,
316-
instructions: `import { connect } from 'blue-agent-connect'; await connect({ mnemonic, nodeAddress: '${recommended}', subscriptionId: '${subscriptionId}', feeGranter: '${operatorAddress}' })`,
316+
instructions: `import { connect } from 'blue-js-sdk/ai-path'; await connect({ mnemonic, nodeAddress: '${recommended}', subscriptionId: '${subscriptionId}', feeGranter: '${operatorAddress}' })`,
317317
};
318318
}
319319

server/test/test-agent-connect.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Tests the FULL agent flow after x402 provisioning:
55
* Agent has: subscription 1192288 on Plan 42, fee grant from operator, 0 P2P
6-
* Agent does: connect via blue-agent-connect → session → handshake → tunnel
6+
* Agent does: connect via blue-js-sdk/ai-path → session → handshake → tunnel
77
*
88
* This validates both SDK bug fixes:
99
* Bug 1: node-connect.js balance check now skips when feeGranter is set

server/test/test-fresh-agent.mjs

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -186,39 +186,13 @@ async function main() {
186186
});
187187

188188
// ════════════════════════════════════════════════════════════════════
189-
// STEP 4: Fund agent ETH gas on Base
189+
// STEP 4: Verify agent funded (no ETH needed — EIP-3009 = 0 gas)
190190
// ════════════════════════════════════════════════════════════════════
191-
const s4 = step('Fund agent: send ETH on Base', {
192-
from: opWallet.address,
193-
to: evmWallet.address,
194-
amount: '0.00005 ETH',
195-
});
196-
197-
const ethTx = await opWallet.sendTransaction({ to: evmWallet.address, value: ethers.parseEther('0.00005') });
198-
console.log(` TX submitted: ${ethTx.hash}`);
199-
const ethRcpt = await ethTx.wait(1);
200-
s4.confirmed = ts();
201-
s4.block = ethRcpt.blockNumber;
202-
console.log(` Confirmed block ${ethRcpt.blockNumber}`);
203-
204-
tx('Base — ETH gas funding (operator → agent)', 'Base', ethTx.hash, {
205-
block: ethRcpt.blockNumber,
206-
from: opWallet.address,
207-
to: evmWallet.address,
208-
amount: '0.00005 ETH',
209-
});
210-
211-
// ════════════════════════════════════════════════════════════════════
212-
// STEP 5: Verify agent funded
213-
// ════════════════════════════════════════════════════════════════════
214-
const [aEth, aUsdc] = await Promise.all([
215-
provider.getBalance(evmWallet.address),
216-
usdc.balanceOf(evmWallet.address),
217-
]);
218-
balances.postFunding = { usdc: ethers.formatUnits(aUsdc, 6), eth: ethers.formatEther(aEth) };
191+
const aUsdc = await usdc.balanceOf(evmWallet.address);
192+
balances.postFunding = { usdc: ethers.formatUnits(aUsdc, 6), eth: '0' };
219193
step('Verify agent funded', {
220194
agentUSDC: `${balances.postFunding.usdc} USDC`,
221-
agentETH: `${balances.postFunding.eth} ETH`,
195+
agentETH: '0 ETH — agent never needs gas (EIP-3009 = facilitator pays)',
222196
agentP2P: '0.00 P2P (fee-granted — no tokens needed)',
223197
onChain: 'read-only',
224198
});
@@ -337,16 +311,13 @@ async function main() {
337311
// ════════════════════════════════════════════════════════════════════
338312
// STEP 9: Check post-payment balance on Base
339313
// ════════════════════════════════════════════════════════════════════
340-
const [postEth, postUsdc] = await Promise.all([
341-
provider.getBalance(evmWallet.address),
342-
usdc.balanceOf(evmWallet.address),
343-
]);
344-
balances.postPayment = { usdc: ethers.formatUnits(postUsdc, 6), eth: ethers.formatEther(postEth) };
314+
const postUsdc = await usdc.balanceOf(evmWallet.address);
315+
balances.postPayment = { usdc: ethers.formatUnits(postUsdc, 6) };
345316
const paid = (parseFloat(balances.postFunding.usdc) - parseFloat(balances.postPayment.usdc)).toFixed(6);
346317

347318
step('Post-payment agent balance', {
348319
agentUSDC: `${balances.postPayment.usdc} USDC (was ${balances.postFunding.usdc}, paid ${paid})`,
349-
agentETH: `${balances.postPayment.eth} ETH (unchanged — EIP-3009 = 0 agent gas)`,
320+
agentGas: 'ZERO — EIP-3009 means agent never sends a TX on Base',
350321
onChain: 'read-only',
351322
});
352323

@@ -553,20 +524,17 @@ async function main() {
553524
// ════════════════════════════════════════════════════════════════════
554525
// STEP 18: Query final balances
555526
// ════════════════════════════════════════════════════════════════════
556-
const [fEth, fUsdc, oEth, oUsdc] = await Promise.all([
557-
provider.getBalance(evmWallet.address),
527+
const [fUsdc, oUsdc] = await Promise.all([
558528
usdc.balanceOf(evmWallet.address),
559-
provider.getBalance(opWallet.address),
560529
usdc.balanceOf(opWallet.address),
561530
]);
562-
balances.final = { usdc: ethers.formatUnits(fUsdc, 6), eth: ethers.formatEther(fEth) };
563-
balances.operator = { usdc: ethers.formatUnits(oUsdc, 6), eth: ethers.formatEther(oEth) };
531+
balances.final = { usdc: ethers.formatUnits(fUsdc, 6) };
532+
balances.operator = { usdc: ethers.formatUnits(oUsdc, 6) };
564533

565534
step('Final balances', {
566535
agentUSDC: `${balances.final.usdc} USDC`,
567-
agentETH: `${balances.final.eth} ETH`,
536+
agentGas: 'ZERO on both chains (EIP-3009 on Base, fee grant on Sentinel)',
568537
operatorUSDC: `${balances.operator.usdc} USDC`,
569-
operatorETH: `${balances.operator.eth} ETH`,
570538
});
571539

572540
// Cleanup RPC
@@ -684,16 +652,16 @@ function writeResults(testStart, wallets, balances, provision, conn, feeGrantDat
684652
L.push(HR);
685653
L.push('');
686654
L.push('Agent (Base):');
687-
L.push(` After funding: ${balances.postFunding?.usdc || '?'} USDC / ${balances.postFunding?.eth || '?'} ETH`);
688-
L.push(` After payment: ${balances.postPayment?.usdc || '?'} USDC / ${balances.postPayment?.eth || '?'} ETH`);
689-
L.push(` Final: ${balances.final?.usdc || '?'} USDC / ${balances.final?.eth || '?'} ETH`);
655+
L.push(` After funding: ${balances.postFunding?.usdc || '?'} USDC`);
656+
L.push(` After x402: ${balances.postPayment?.usdc || '?'} USDC`);
657+
L.push(` Final: ${balances.final?.usdc || '?'} USDC`);
658+
L.push(' ETH: 0 — agent never needs gas (EIP-3009 = facilitator pays)');
690659
L.push('');
691660
L.push('Agent (Sentinel):');
692661
L.push(' P2P: 0.00 (all TXs covered by fee grant)');
693662
L.push('');
694663
L.push('Operator:');
695664
L.push(` USDC: ${balances.operator?.usdc || '?'}`);
696-
L.push(` ETH: ${balances.operator?.eth || '?'}`);
697665
L.push('');
698666
L.push('');
699667

0 commit comments

Comments
 (0)