@agentwonderland/mcp 0.1.53 → 0.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/__tests__/api-client.test.js +65 -1
- package/dist/core/__tests__/link-cli.test.js +95 -0
- package/dist/core/api-client.d.ts +3 -1
- package/dist/core/api-client.js +39 -2
- package/dist/core/link-cli.d.ts +17 -0
- package/dist/core/link-cli.js +165 -0
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +8 -5
- package/dist/tools/__tests__/playbooks.test.d.ts +1 -0
- package/dist/tools/__tests__/playbooks.test.js +2123 -0
- package/dist/tools/__tests__/wallet.test.js +5 -4
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -0
- package/dist/tools/passes.js +4 -21
- package/dist/tools/playbooks.d.ts +2 -0
- package/dist/tools/playbooks.js +984 -0
- package/dist/tools/run.js +4 -18
- package/dist/tools/solve.js +4 -18
- package/dist/tools/wallet.js +9 -12
- package/package.json +1 -1
- package/src/core/__tests__/api-client.test.ts +77 -0
- package/src/core/__tests__/link-cli.test.ts +110 -0
- package/src/core/api-client.ts +43 -1
- package/src/core/link-cli.ts +189 -0
- package/src/core/version.ts +1 -1
- package/src/index.ts +8 -5
- package/src/tools/__tests__/playbooks.test.ts +2364 -0
- package/src/tools/__tests__/wallet.test.ts +5 -4
- package/src/tools/index.ts +1 -0
- package/src/tools/passes.ts +3 -21
- package/src/tools/playbooks.ts +1221 -0
- package/src/tools/run.ts +3 -17
- package/src/tools/solve.ts +3 -17
- package/src/tools/wallet.ts +9 -12
|
@@ -287,9 +287,9 @@ describe("wallet_setup tool", () => {
|
|
|
287
287
|
const result = await walletSetup({ action: "start" });
|
|
288
288
|
const text = flattenText(result);
|
|
289
289
|
|
|
290
|
-
expect(text).toContain("Choose a payment method to set up:");
|
|
291
|
-
expect(text).toContain("Link card or bank account (recommended)");
|
|
292
|
-
expect(text).toContain('wallet_setup({ action: "add-link" })');
|
|
290
|
+
expect(text).toContain("Choose a launch payment method to set up:");
|
|
291
|
+
expect(text).not.toContain("Link card or bank account (recommended)");
|
|
292
|
+
expect(text).not.toContain('wallet_setup({ action: "add-link" })');
|
|
293
293
|
expect(text).toContain('wallet_setup({ action: "create", chain: "tempo" })');
|
|
294
294
|
expect(text).toContain('wallet_setup({ action: "create", chain: "base" })');
|
|
295
295
|
expect(text).toContain('wallet_setup({ action: "create", chain: "solana" })');
|
|
@@ -317,7 +317,8 @@ describe("wallet_setup tool", () => {
|
|
|
317
317
|
const text = flattenText(result);
|
|
318
318
|
|
|
319
319
|
expect(text).toContain("No payment methods configured.");
|
|
320
|
-
expect(text).toContain("
|
|
320
|
+
expect(text).toContain("Choose a launch payment method to set up:");
|
|
321
|
+
expect(text).not.toContain("Link card or bank account (recommended)");
|
|
321
322
|
});
|
|
322
323
|
|
|
323
324
|
it("imports a wallet into OWS encrypted storage with Base as the default chain", async () => {
|
package/src/tools/index.ts
CHANGED
|
@@ -12,3 +12,4 @@ export { registerRebateTools } from "./rebates.js";
|
|
|
12
12
|
export { registerUploadTools } from "./upload.js";
|
|
13
13
|
export { registerProbeTools } from "./probe.js";
|
|
14
14
|
export { registerProviderTools } from "./providers.js";
|
|
15
|
+
export { registerPlaybookTools } from "./playbooks.js";
|
package/src/tools/passes.ts
CHANGED
|
@@ -12,11 +12,9 @@ import {
|
|
|
12
12
|
getConfiguredMethods,
|
|
13
13
|
hasWalletConfigured,
|
|
14
14
|
normalizePaymentMethod,
|
|
15
|
-
isCardPaymentEnabled,
|
|
16
15
|
} from "../core/payments.js";
|
|
17
16
|
import { requiresSpendConfirmation } from "../core/config.js";
|
|
18
17
|
import { ensureConsumerPrincipalForMethod } from "../core/principal.js";
|
|
19
|
-
import { getOrCreatePendingCardSetup, formatCardSetupBlocks } from "../core/card-setup.js";
|
|
20
18
|
import {
|
|
21
19
|
formatPaymentChoicePrompt,
|
|
22
20
|
formatPaymentLabel,
|
|
@@ -36,10 +34,6 @@ function text(t: string) {
|
|
|
36
34
|
return { content: [{ type: "text" as const, text: t }] };
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
function multiText(...blocks: string[]) {
|
|
40
|
-
return { content: blocks.map((t) => ({ type: "text" as const, text: t })) };
|
|
41
|
-
}
|
|
42
|
-
|
|
43
37
|
async function getAgent(agentId: string): Promise<AgentRecord> {
|
|
44
38
|
return apiGet<AgentRecord>(`/agents/${agentId}`);
|
|
45
39
|
}
|
|
@@ -67,30 +61,18 @@ export function registerPassTools(server: McpServer): void {
|
|
|
67
61
|
{
|
|
68
62
|
agent_id: z.string().describe("Agent ID (UUID, slug, or name)"),
|
|
69
63
|
pack_id: z.string().optional().describe("Specific pack key to buy, like 'starter' or 'growth'. If omitted and only one pack exists, it is selected automatically."),
|
|
70
|
-
pay_with: z.string().optional().describe("
|
|
64
|
+
pay_with: z.string().optional().describe("Launch payment method — wallet ID or chain name (tempo, base, solana). Auto-detected if omitted."),
|
|
71
65
|
confirmed: z.boolean().optional().describe("Set to true to confirm the purchase after seeing the quote."),
|
|
72
66
|
},
|
|
73
67
|
async ({ agent_id, pack_id, pay_with, confirmed }) => {
|
|
74
68
|
if (!hasWalletConfigured()) {
|
|
75
|
-
if (isCardPaymentEnabled()) {
|
|
76
|
-
try {
|
|
77
|
-
const { url } = await getOrCreatePendingCardSetup();
|
|
78
|
-
return multiText(...formatCardSetupBlocks(url));
|
|
79
|
-
} catch {
|
|
80
|
-
// Fall through to the setup message below.
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
69
|
const setupLines = [
|
|
84
70
|
"No payment method configured.",
|
|
85
71
|
"",
|
|
86
|
-
"
|
|
87
|
-
"You can also run wallet_setup({ action: \"start\" }) to see all payment options.",
|
|
72
|
+
"Run wallet_setup({ action: \"start\" }) to configure a launch USDC payment method.",
|
|
88
73
|
"",
|
|
89
|
-
"
|
|
74
|
+
"Launch options: Tempo USDC, Base USDC, or Solana USDC.",
|
|
90
75
|
];
|
|
91
|
-
if (isCardPaymentEnabled()) {
|
|
92
|
-
setupLines.push("", "Or wallet_setup({ action: \"add-card\" }) to connect a credit card.");
|
|
93
|
-
}
|
|
94
76
|
return text(setupLines.join("\n"));
|
|
95
77
|
}
|
|
96
78
|
|