@agentwonderland/mcp 0.1.53 → 0.1.54
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 +40 -0
- package/dist/core/api-client.js +18 -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 +2043 -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 +880 -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 +44 -0
- package/src/core/api-client.ts +18 -0
- package/src/core/version.ts +1 -1
- package/src/index.ts +8 -5
- package/src/tools/__tests__/playbooks.test.ts +2285 -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 +1100 -0
- package/src/tools/run.ts +3 -17
- package/src/tools/solve.ts +3 -17
- package/src/tools/wallet.ts +9 -12
|
@@ -219,9 +219,9 @@ describe("wallet_setup tool", () => {
|
|
|
219
219
|
const walletSetup = await getWalletSetupTool();
|
|
220
220
|
const result = await walletSetup({ action: "start" });
|
|
221
221
|
const text = flattenText(result);
|
|
222
|
-
expect(text).toContain("Choose a payment method to set up:");
|
|
223
|
-
expect(text).toContain("Link card or bank account (recommended)");
|
|
224
|
-
expect(text).toContain('wallet_setup({ action: "add-link" })');
|
|
222
|
+
expect(text).toContain("Choose a launch payment method to set up:");
|
|
223
|
+
expect(text).not.toContain("Link card or bank account (recommended)");
|
|
224
|
+
expect(text).not.toContain('wallet_setup({ action: "add-link" })');
|
|
225
225
|
expect(text).toContain('wallet_setup({ action: "create", chain: "tempo" })');
|
|
226
226
|
expect(text).toContain('wallet_setup({ action: "create", chain: "base" })');
|
|
227
227
|
expect(text).toContain('wallet_setup({ action: "create", chain: "solana" })');
|
|
@@ -241,7 +241,8 @@ describe("wallet_setup tool", () => {
|
|
|
241
241
|
const result = await walletStatus({});
|
|
242
242
|
const text = flattenText(result);
|
|
243
243
|
expect(text).toContain("No payment methods configured.");
|
|
244
|
-
expect(text).toContain("
|
|
244
|
+
expect(text).toContain("Choose a launch payment method to set up:");
|
|
245
|
+
expect(text).not.toContain("Link card or bank account (recommended)");
|
|
245
246
|
});
|
|
246
247
|
it("imports a wallet into OWS encrypted storage with Base as the default chain", async () => {
|
|
247
248
|
const walletSetup = await getWalletSetupTool();
|
package/dist/tools/index.d.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/dist/tools/index.js
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/dist/tools/passes.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { apiGet, apiPostWithPayment } from "../core/api-client.js";
|
|
3
3
|
import { formatCreditPack, formatCreditPackOffer, getCreditPackInventory, getCreditPackProgram, } from "../core/passes.js";
|
|
4
|
-
import { getCompatiblePaymentMethods, getConfiguredMethods, hasWalletConfigured, normalizePaymentMethod,
|
|
4
|
+
import { getCompatiblePaymentMethods, getConfiguredMethods, hasWalletConfigured, normalizePaymentMethod, } from "../core/payments.js";
|
|
5
5
|
import { requiresSpendConfirmation } from "../core/config.js";
|
|
6
6
|
import { ensureConsumerPrincipalForMethod } from "../core/principal.js";
|
|
7
|
-
import { getOrCreatePendingCardSetup, formatCardSetupBlocks } from "../core/card-setup.js";
|
|
8
7
|
import { formatPaymentChoicePrompt, formatPaymentLabel, resolveConfirmationMethod, } from "./_payment-confirmation.js";
|
|
9
8
|
const pendingCreditPackPurchases = new Map();
|
|
10
9
|
function text(t) {
|
|
11
10
|
return { content: [{ type: "text", text: t }] };
|
|
12
11
|
}
|
|
13
|
-
function multiText(...blocks) {
|
|
14
|
-
return { content: blocks.map((t) => ({ type: "text", text: t })) };
|
|
15
|
-
}
|
|
16
12
|
async function getAgent(agentId) {
|
|
17
13
|
return apiGet(`/agents/${agentId}`);
|
|
18
14
|
}
|
|
@@ -35,30 +31,17 @@ export function registerPassTools(server) {
|
|
|
35
31
|
server.tool("buy_agent_credit_pack", "Purchase a discounted prepaid credit pack for an agent. Credit packs are agent-specific and automatically cover future runs until the included units run out.", {
|
|
36
32
|
agent_id: z.string().describe("Agent ID (UUID, slug, or name)"),
|
|
37
33
|
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."),
|
|
38
|
-
pay_with: z.string().optional().describe("
|
|
34
|
+
pay_with: z.string().optional().describe("Launch payment method — wallet ID or chain name (tempo, base, solana). Auto-detected if omitted."),
|
|
39
35
|
confirmed: z.boolean().optional().describe("Set to true to confirm the purchase after seeing the quote."),
|
|
40
36
|
}, async ({ agent_id, pack_id, pay_with, confirmed }) => {
|
|
41
37
|
if (!hasWalletConfigured()) {
|
|
42
|
-
if (isCardPaymentEnabled()) {
|
|
43
|
-
try {
|
|
44
|
-
const { url } = await getOrCreatePendingCardSetup();
|
|
45
|
-
return multiText(...formatCardSetupBlocks(url));
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// Fall through to the setup message below.
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
38
|
const setupLines = [
|
|
52
39
|
"No payment method configured.",
|
|
53
40
|
"",
|
|
54
|
-
"
|
|
55
|
-
"You can also run wallet_setup({ action: \"start\" }) to see all payment options.",
|
|
41
|
+
"Run wallet_setup({ action: \"start\" }) to configure a launch USDC payment method.",
|
|
56
42
|
"",
|
|
57
|
-
"
|
|
43
|
+
"Launch options: Tempo USDC, Base USDC, or Solana USDC.",
|
|
58
44
|
];
|
|
59
|
-
if (isCardPaymentEnabled()) {
|
|
60
|
-
setupLines.push("", "Or wallet_setup({ action: \"add-card\" }) to connect a credit card.");
|
|
61
|
-
}
|
|
62
45
|
return text(setupLines.join("\n"));
|
|
63
46
|
}
|
|
64
47
|
const agent = await getAgent(agent_id);
|