agentcash 0.17.0 → 0.17.1
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/cjs/run-server.cjs +11951 -24158
- package/dist/esm/{add-skill-DPQR466Y.js → add-skill-CFGMBWS4.js} +4 -4
- package/dist/esm/{bridge-JNIOVDD3.js → bridge-4SWPSBWP.js} +3 -3
- package/dist/esm/{check-LR3CSSJF.js → check-PGUEDKO5.js} +4 -4
- package/dist/esm/{chunk-O4R5W5G4.js → chunk-574342U7.js} +2 -2
- package/dist/esm/{chunk-7WQMJKJR.js → chunk-6IYTF6NV.js} +2 -2
- package/dist/esm/{chunk-7YQDCZ3N.js → chunk-6YIG64RH.js} +2 -2
- package/dist/esm/{chunk-H5V6L7NG.js → chunk-CCWBMXQT.js} +3 -3
- package/dist/esm/chunk-CCWBMXQT.js.map +1 -0
- package/dist/esm/{chunk-ORF2OXB7.js → chunk-G6MIWS35.js} +3 -3
- package/dist/esm/{chunk-WPCEYCCK.js → chunk-H7ES5FU5.js} +2 -2
- package/dist/esm/{chunk-Q5YKPVXL.js → chunk-MCJ446SE.js} +2 -2
- package/dist/esm/{chunk-7VILIGSP.js → chunk-QFYKR3H3.js} +2 -2
- package/dist/esm/{chunk-RT7PTEMC.js → chunk-XU7NVHOY.js} +2 -2
- package/dist/esm/{chunk-6M7F5KOU.js → chunk-YIECO2O4.js} +9 -2
- package/dist/esm/{chunk-6M7F5KOU.js.map → chunk-YIECO2O4.js.map} +1 -1
- package/dist/esm/{chunk-M3YTSL6T.js → chunk-YOY6D3SX.js} +3 -3
- package/dist/esm/{discover-EIFUI6QT.js → discover-OGK3JBEU.js} +3 -3
- package/dist/esm/{fetch-BO4HOM62.js → fetch-SC43UYLV.js} +17 -10
- package/dist/esm/fetch-SC43UYLV.js.map +1 -0
- package/dist/esm/index.js +21 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{install-UWNAPNKE.js → install-ONQHFNPS.js} +3 -3
- package/dist/esm/{onboard-PBXGWWPK.js → onboard-VZ4MNINC.js} +3 -3
- package/dist/esm/{origins-ZXQOPPWV.js → origins-YOHZN3QI.js} +4 -4
- package/dist/esm/{register-KCAOKKJC.js → register-NMKUVK6Z.js} +2 -2
- package/dist/esm/{report-error-PBDX2ATE.js → report-error-HQBVDKDU.js} +3 -3
- package/dist/esm/{search-PQ7AGO6O.js → search-H32FUHXO.js} +4 -4
- package/dist/esm/{server-XRYGME55.js → server-MKLACHXU.js} +23 -20
- package/dist/esm/server-MKLACHXU.js.map +1 -0
- package/dist/esm/{server-N6J25ZGU.js → server-YVMRCPCF.js} +2 -2
- package/dist/esm/{try-3CZ3JFD2.js → try-NEU56CHG.js} +3 -3
- package/package.json +4 -4
- package/dist/esm/chunk-H5V6L7NG.js.map +0 -1
- package/dist/esm/fetch-BO4HOM62.js.map +0 -1
- package/dist/esm/server-XRYGME55.js.map +0 -1
- /package/dist/esm/{add-skill-DPQR466Y.js.map → add-skill-CFGMBWS4.js.map} +0 -0
- /package/dist/esm/{bridge-JNIOVDD3.js.map → bridge-4SWPSBWP.js.map} +0 -0
- /package/dist/esm/{check-LR3CSSJF.js.map → check-PGUEDKO5.js.map} +0 -0
- /package/dist/esm/{chunk-O4R5W5G4.js.map → chunk-574342U7.js.map} +0 -0
- /package/dist/esm/{chunk-7WQMJKJR.js.map → chunk-6IYTF6NV.js.map} +0 -0
- /package/dist/esm/{chunk-7YQDCZ3N.js.map → chunk-6YIG64RH.js.map} +0 -0
- /package/dist/esm/{chunk-ORF2OXB7.js.map → chunk-G6MIWS35.js.map} +0 -0
- /package/dist/esm/{chunk-WPCEYCCK.js.map → chunk-H7ES5FU5.js.map} +0 -0
- /package/dist/esm/{chunk-Q5YKPVXL.js.map → chunk-MCJ446SE.js.map} +0 -0
- /package/dist/esm/{chunk-7VILIGSP.js.map → chunk-QFYKR3H3.js.map} +0 -0
- /package/dist/esm/{chunk-RT7PTEMC.js.map → chunk-XU7NVHOY.js.map} +0 -0
- /package/dist/esm/{chunk-M3YTSL6T.js.map → chunk-YOY6D3SX.js.map} +0 -0
- /package/dist/esm/{discover-EIFUI6QT.js.map → discover-OGK3JBEU.js.map} +0 -0
- /package/dist/esm/{install-UWNAPNKE.js.map → install-ONQHFNPS.js.map} +0 -0
- /package/dist/esm/{onboard-PBXGWWPK.js.map → onboard-VZ4MNINC.js.map} +0 -0
- /package/dist/esm/{origins-ZXQOPPWV.js.map → origins-YOHZN3QI.js.map} +0 -0
- /package/dist/esm/{register-KCAOKKJC.js.map → register-NMKUVK6Z.js.map} +0 -0
- /package/dist/esm/{report-error-PBDX2ATE.js.map → report-error-HQBVDKDU.js.map} +0 -0
- /package/dist/esm/{search-PQ7AGO6O.js.map → search-H32FUHXO.js.map} +0 -0
- /package/dist/esm/{server-N6J25ZGU.js.map → server-YVMRCPCF.js.map} +0 -0
- /package/dist/esm/{try-3CZ3JFD2.js.map → try-NEU56CHG.js.map} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveOrigin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6IYTF6NV.js";
|
|
4
4
|
import {
|
|
5
5
|
installSkills
|
|
6
6
|
} from "./chunk-FVVSNDQR.js";
|
|
7
7
|
import {
|
|
8
8
|
addUserOrigin
|
|
9
9
|
} from "./chunk-YIU364NZ.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-H7ES5FU5.js";
|
|
11
|
+
import "./chunk-CCWBMXQT.js";
|
|
12
12
|
import "./chunk-KVSTJRSJ.js";
|
|
13
13
|
import "./chunk-FB5CMO3J.js";
|
|
14
14
|
import "./chunk-U6FRXL3X.js";
|
|
@@ -97,4 +97,4 @@ var addSkillCommand = async (input) => {
|
|
|
97
97
|
export {
|
|
98
98
|
addSkillCommand
|
|
99
99
|
};
|
|
100
|
-
//# sourceMappingURL=add-skill-
|
|
100
|
+
//# sourceMappingURL=add-skill-CFGMBWS4.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bridge,
|
|
3
3
|
bridgeSchema
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QFYKR3H3.js";
|
|
5
5
|
import {
|
|
6
6
|
DESCRIPTIONS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CCWBMXQT.js";
|
|
8
8
|
import "./chunk-RAS5DZPQ.js";
|
|
9
9
|
import {
|
|
10
10
|
getWalletOrExit
|
|
@@ -54,4 +54,4 @@ var bridgeCommand = async (args) => {
|
|
|
54
54
|
export {
|
|
55
55
|
bridgeCommand
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=bridge-
|
|
57
|
+
//# sourceMappingURL=bridge-4SWPSBWP.js.map
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
} from "./chunk-5CMVFNXO.js";
|
|
4
4
|
import {
|
|
5
5
|
cliRequestSchema
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-YOY6D3SX.js";
|
|
7
|
+
import "./chunk-MCJ446SE.js";
|
|
8
|
+
import "./chunk-CCWBMXQT.js";
|
|
9
9
|
import "./chunk-IKPLMFAK.js";
|
|
10
10
|
import {
|
|
11
11
|
RequestMethod
|
|
@@ -69,4 +69,4 @@ var checkCommand = async (args) => {
|
|
|
69
69
|
export {
|
|
70
70
|
checkCommand
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=check-
|
|
72
|
+
//# sourceMappingURL=check-PGUEDKO5.js.map
|
|
@@ -4,7 +4,7 @@ import { dirname, join } from "path";
|
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
5
|
function getVersion() {
|
|
6
6
|
if (true) {
|
|
7
|
-
return "0.17.
|
|
7
|
+
return "0.17.1";
|
|
8
8
|
}
|
|
9
9
|
const __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
const pkg = JSON.parse(
|
|
@@ -23,4 +23,4 @@ export {
|
|
|
23
23
|
MCP_VERSION,
|
|
24
24
|
INSTALL_PACKAGE_SPECIFIER
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-574342U7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
discoverResources
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H7ES5FU5.js";
|
|
4
4
|
import {
|
|
5
5
|
errorResponse
|
|
6
6
|
} from "./chunk-7EBJ4BCH.js";
|
|
@@ -52,4 +52,4 @@ function resolveDescription(result) {
|
|
|
52
52
|
export {
|
|
53
53
|
resolveOrigin
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-6IYTF6NV.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-27DZCYDB.js";
|
|
7
7
|
import {
|
|
8
8
|
INSTALL_PACKAGE_SPECIFIER
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-574342U7.js";
|
|
10
10
|
import {
|
|
11
11
|
log,
|
|
12
12
|
safeReadFile,
|
|
@@ -628,4 +628,4 @@ export {
|
|
|
628
628
|
tryAddServer,
|
|
629
629
|
addServer
|
|
630
630
|
};
|
|
631
|
-
//# sourceMappingURL=chunk-
|
|
631
|
+
//# sourceMappingURL=chunk-6YIG64RH.js.map
|
|
@@ -84,10 +84,10 @@ var DESCRIPTIONS = {
|
|
|
84
84
|
cli: `Get your total USDC balance across all supported networks. Creates the wallet on first use (~/.agentcash/wallet.json). Use this before paid API calls to confirm you have funds available.`
|
|
85
85
|
},
|
|
86
86
|
fetch: {
|
|
87
|
-
mcp: `HTTP fetch with automatic authentication and payment handling. Makes the request, retries with SIGN-IN-WITH-X when the route exposes a SIWX challenge, and only pays if the route still returns 402. Returns response data along with payment details (price, tx hash) if a payment was made.
|
|
87
|
+
mcp: `HTTP fetch with automatic authentication and payment handling. Makes the request, retries with SIGN-IN-WITH-X when the route exposes a SIWX challenge, and only pays if the route still returns 402. Returns response data and the final response headers, including raw payment receipt proof when supplied by the server, along with payment details (price, tx hash) if a payment was made.
|
|
88
88
|
|
|
89
89
|
For endpoints you haven't called before in this session, you MUST call check_endpoint_schema first to confirm the request body schema. Skipping this causes 400 errors from wrong field names.`,
|
|
90
|
-
cli: `HTTP fetch with automatic authentication and payment handling. If the endpoint returns 402, agentcash attempts authentication first and only falls back to payment if the route still requires it. Run 'check <url>' first to confirm the request body schema; skipping this causes 400 errors from wrong field names.`,
|
|
90
|
+
cli: `HTTP fetch with automatic authentication and payment handling. If the endpoint returns 402, agentcash attempts authentication first and only falls back to payment if the route still requires it. Returns the final response headers in result metadata, including raw payment receipt proof when supplied by the server. Run 'check <url>' first to confirm the request body schema; skipping this causes 400 errors from wrong field names.`,
|
|
91
91
|
epilogue: `Workflow: check <url> \u2192 fetch <url> -m POST -b '{"field":"value"}'
|
|
92
92
|
Auth mode is advisory only; fetch handles both SIWX and paid routes.`
|
|
93
93
|
},
|
|
@@ -285,4 +285,4 @@ export {
|
|
|
285
285
|
REQUEST_FETCH_PARAMS,
|
|
286
286
|
TOOL_PARAMS
|
|
287
287
|
};
|
|
288
|
-
//# sourceMappingURL=chunk-
|
|
288
|
+
//# sourceMappingURL=chunk-CCWBMXQT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shared/descriptions.ts"],"sourcesContent":["/**\n * Single source of truth for all LLM-facing text in the MCP package.\n *\n * `DESCRIPTIONS` covers every tool with both an `mcp` variant (detailed,\n * AI-audience) and a `cli` variant (concise, human-readable for --help).\n * `serverInstructions` is shared across both surfaces.\n *\n * Additional exports cover parameter/output schema descriptions, origin\n * metadata, and prompt content — all LLM-facing text in one place.\n */\n\nimport type { UserOrigin } from './user-origins';\nimport { Origin } from './origins';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Origin metadata (used for MCP resource registration descriptions)\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const ORIGIN_METADATA: Record<\n string,\n { title: string; description: string }\n> = {\n [Origin.StableEnrich]: {\n title: 'StableEnrich',\n description:\n 'People/org search, Google Maps, Exa web search, LinkedIn data, Firecrawl scrape, WhitePages, email enrichment',\n },\n [Origin.StableSocial]: {\n title: 'StableSocial',\n description: 'Social media data for TikTok, Instagram, Facebook, Reddit',\n },\n [Origin.StableStudio]: {\n title: 'StableStudio',\n description: 'Generate and edit images and videos',\n },\n [Origin.StableUpload]: {\n title: 'StableUpload',\n description: 'Pay to upload files, get a permanent download URL.',\n },\n [Origin.StableEmail]: {\n title: 'StableEmail',\n description: 'Send emails',\n },\n [Origin.X402Scan]: {\n title: 'X402 Scan',\n description: 'x402 protocol explorer',\n },\n [Origin.Shirt]: {\n title: 'Shirt',\n description: 'Shirt.sh',\n },\n [Origin.X402Puppet]: {\n title: 'X402 Puppet',\n description: 'Browser automation',\n },\n [Origin.X402Facilitator]: {\n title: 'X402 Facilitator',\n description: 'Payment facilitation',\n },\n [Origin.StableMerch]: {\n title: 'StableMerch',\n description:\n 'Create shirts and mugs with custom images and have them shipped to your address.',\n },\n [Origin.StableVoice]: {\n title: 'StableVoice',\n description:\n 'Text-to-speech with 20+ bundled voices, custom voice cloning, multi-language support (23 languages), mp3/wav output',\n },\n [Origin.StableTube]: {\n title: 'StableTube',\n description:\n 'YouTube video downloads — POST a URL, get a direct CDN download link (expires ~6h)',\n },\n [Origin.StableKey]: {\n title: 'StableKey',\n description:\n 'VFX-grade neural green-screen unmixing (CorridorKey) — submit a green-screen plate, get alpha + foreground + RGBA outputs',\n },\n [Origin.StableMemes]: {\n title: 'StableMemes',\n description:\n 'Generate memes — caption templates, search 1M+ memes, auto-caption, AI meme generation',\n },\n};\n\nexport const PRIMARY_ORIGINS = [\n Origin.StableEnrich,\n Origin.StableSocial,\n Origin.StableStudio,\n Origin.StableUpload,\n Origin.StableEmail,\n Origin.StableMerch,\n Origin.StableVoice,\n Origin.StableTube,\n Origin.StableKey,\n Origin.StableMemes,\n] as const;\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tool descriptions — { mcp, cli } per tool + shared serverInstructions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const DESCRIPTIONS = {\n bridge: {\n toolNames: {\n cli: 'bridge',\n mcp: 'bridge',\n },\n title: 'Bridge Between Networks',\n mcp: `Bridge USDC between supported networks using the current wallet. Requires a source network, destination network, and amount. Use this when funds are on one supported network and the user needs them moved to another. Bridging is subject to fees.`,\n cli: `Bridge USDC between supported networks using the current wallet. Requires --from, --to, and --amount. Bridging is subject to fees.`,\n },\n\n getBalance: {\n mcp: `Get your total USDC balance across all supported networks. Auto-creates the wallet on first use (~/.agentcash/wallet.json). Use this before paid API calls to confirm you have funds available.`,\n cli: `Get your total USDC balance across all supported networks. Creates the wallet on first use (~/.agentcash/wallet.json). Use this before paid API calls to confirm you have funds available.`,\n },\n\n fetch: {\n mcp: `HTTP fetch with automatic authentication and payment handling. Makes the request, retries with SIGN-IN-WITH-X when the route exposes a SIWX challenge, and only pays if the route still returns 402. Returns response data and the final response headers, including raw payment receipt proof when supplied by the server, along with payment details (price, tx hash) if a payment was made.\\n\\nFor endpoints you haven't called before in this session, you MUST call check_endpoint_schema first to confirm the request body schema. Skipping this causes 400 errors from wrong field names.`,\n cli: `HTTP fetch with automatic authentication and payment handling. If the endpoint returns 402, agentcash attempts authentication first and only falls back to payment if the route still requires it. Returns the final response headers in result metadata, including raw payment receipt proof when supplied by the server. Run 'check <url>' first to confirm the request body schema; skipping this causes 400 errors from wrong field names.`,\n epilogue: `Workflow: check <url> → fetch <url> -m POST -b '{\"field\":\"value\"}'\\nAuth mode is advisory only; fetch handles both SIWX and paid routes.`,\n },\n\n fetchWithAuth: {\n mcp: `Deprecated alias for fetch. Uses the same unified flow: probe the route, attempt SIWX when available, and only pay if the route still returns 402.\\n\\nFor new integrations, prefer fetch.`,\n cli: `Deprecated alias for fetch. Uses the same unified auth-and-payment flow, but new integrations should call 'fetch' directly.`,\n epilogue: `Deprecated: use agentcash fetch <url>. This alias is kept for compatibility.`,\n },\n\n listAccounts: {\n mcp: `List wallet accounts for each supported network. Returns the network, address, balance, and deposit link for every supported network so you can see where to fund the wallet. Auto-creates the wallet on first use (~/.agentcash/wallet.json). If onboardingCta is present, show its message to the user — it means they haven't onboarded yet and need to either visit the onboard link or deposit directly.`,\n cli: `List wallet accounts for each supported network, including network, address, balance, and deposit link. Creates the wallet on first use (~/.agentcash/wallet.json). Use this when you need the per-network funding addresses and deposit links.`,\n },\n\n getWalletInfo: {\n mcp: `Legacy combined wallet view. Returns both the total balance and the per-network account list. Prefer calling get_balance for available funds and list_accounts when you need network-specific addresses or deposit links.`,\n cli: `Legacy combined wallet view. Returns both the total balance and the per-network account list. Prefer 'balance' for available funds and 'accounts' for network-specific addresses or deposit links.`,\n },\n\n checkEndpointSchema: {\n mcp: [\n `Get the input/output schema and auth mode (paid or SIWX) for a single endpoint.`,\n `Call this to see exactly what fields the request body expects and what the response contains.`,\n `Returns the schema from the origin's OpenAPI spec. Optionally pass sample_input_body to probe the endpoint live (without payment) for an exact price quote — do this when pricing is dynamic (range-based or variable), or when you're unsure about the input schema. Treat auth mode as advisory: fetch handles both SIWX and paid routes.`,\n ].join('\\n\\n'),\n cli: `Get the input/output schema and auth mode (paid or SIWX) for an endpoint. Returns exact field names from the OpenAPI spec — call this before 'fetch' to avoid 400 errors. Pass --body to probe the endpoint live for an exact price quote when pricing is dynamic or unclear.`,\n epilogue: `Auth mode is advisory:\\n paid → agentcash fetch <url>\\n SIWX → agentcash fetch <url>`,\n },\n\n discoverApiEndpoints: {\n mcp: [\n `List available endpoints at an API origin. Returns endpoint URLs with descriptions of what each does and the auth mode for each (paid or SIWX). Works with any origin, not just the registered ones.`,\n `Call this when you need to see what routes are available at an origin — whether it's one of the registered origins or any other origin you've identified as useful. Treat the auth mode as guidance for what the route may require; fetch handles both SIWX and payment.`,\n `The response always indicates whether guidance is available. Guidance is documentation published by the API provider explaining how endpoints work together, edge cases, and usage tips. compact guidance is included automatically; set include_guidance=true to force-include full usage documentation when you need to compose two or more endpoints or need clarification on how the origin works.`,\n ].join('\\n\\n'),\n cli: `List available endpoints at an API origin with descriptions and auth modes (paid or SIWX). Works with any origin, not just registered ones. Add --include-guidance for full provider docs when composing multiple endpoints or when usage is unclear. Fetch handles both auth modes.`,\n epilogue: `Registered origins:\\n${PRIMARY_ORIGINS.flatMap(o => (ORIGIN_METADATA[o] ? [` ${o} — ${ORIGIN_METADATA[o].description}`] : [])).join('\\n')}`,\n },\n\n redeemInvite: {\n mcp: `Redeem an invite code for free USDC on Base. One-time use per code. Returns amount received and transaction hash. Use get_balance after to verify funds, or list_accounts if you need the per-network deposit links as well.`,\n cli: `Redeem an invite code for free USDC on Base. One-time use per code. Run 'balance' after to verify the balance landed.`,\n },\n\n try: {\n cli: `Fetch a new origin for its resources and return a prompt guiding the user through the process of calling the first endpoint.`,\n },\n\n search: {\n mcp: `Search for relevant paid API services by describing what you need in natural language. Returns the best matching origins with endpoint details and pricing. The top result includes the full input/output schema so you can call it immediately via fetch.\n\nOnly use this when you DON'T already know which registered origin to use. If the task clearly maps to a registered origin (e.g. people search → StableEnrich, image generation → StableStudio), skip search and go straight to discover_api_endpoints on that origin. Search is for discovering NEW or UNKNOWN capabilities outside the registered origins.\n\nSet broad=true to widen the search to include newer, unvetted tools that may not have established trust. Use this if the default results don't cover what you need.`,\n cli: `Search for paid API services by natural language query. Returns matching origins with endpoints and pricing. Use --broad to include newer, unvetted tools that may not have established trust.`,\n },\n\n reportError: {\n mcp: `EMERGENCY ONLY. Report critical MCP tool bugs. Do NOT use for normal errors (balance, network, 4xx) — those are recoverable.`,\n cli: `Report a critical bug to the agentcash team (emergency only). Do NOT use for normal errors like low balance, network timeouts, or 4xx responses — those are recoverable without filing a report.`,\n },\n\n updateSettings: {\n mcp: `Update user settings (persisted to ~/.agentcash/settings.json). Currently supports maxAmount — the maximum USD amount allowed per fetch request. If a fetch response requests more than this, the payment is rejected. Returns the current settings after applying changes.`,\n cli: `Update user settings (persisted to ~/.agentcash/settings.json). Currently supports maxAmount, which caps how much a single fetch request can spend.`,\n },\n\n getSettings: {\n mcp: `Get current user settings. Returns persisted values from ~/.agentcash/settings.json with defaults applied.`,\n cli: `Get current user settings from ~/.agentcash/settings.json, with defaults applied.`,\n },\n\n closeSession: {\n mcp: `Close an MPP \\`tempo:session\\` payment channel. Pass the channelId surfaced in a prior fetch's paymentInfo together with the same URL you originally fetched. Signs a close credential with the on-chain settled cumulative amount and POSTs it to the server, returning the on-chain settlement transaction hash when available. Use this when you want to finalize a channel rather than leaving it open for the server to settle on its own schedule.`,\n cli: `Close an MPP session payment channel. Provide the channelId (printed in a prior fetch's paymentInfo) and the endpoint URL the channel was opened against. Reads on-chain channel state for the cumulative settled amount, signs a close credential, and POSTs it to the server.`,\n epilogue: `agentcash sessions close 0xabc... --url https://example.dev/api/stream\\nPass --cumulative-amount-raw <atomic-units> only when the server reports vouchers above the on-chain cumulative.`,\n },\n} as const;\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Dynamic server instructions (includes user-added origins at runtime)\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst WORKFLOW = [\n `Workflow:`,\n `1. If you don't already know your balance, call get_balance. You need a balance for paid endpoints. SIWX endpoints don't require one. You don't need to call this every turn, just before your first paid call or whenever you're unsure.`,\n `2. If the balance is zero, or if the user needs a funding link or wallet addresses, call list_accounts and share the relevant deposit link. If onboardingCta is present, show it to the user.`,\n `3. If the task doesn't clearly map to any registered origin above, call search() to find relevant APIs. Skip this step when you already know the right origin — go straight to step 4.`,\n `4. Call discover_api_endpoints() to get the endpoint index — a list of available routes with descriptions and auth modes. The auth mode is advisory and tells you what the route may require.`,\n `5. Call check_endpoint_schema() to get the exact input/output schema and auth mode for the endpoint you want to call, so you know what fields to pass and what the response contains. Both discover_api_endpoints and check_endpoint_schema return the auth mode.`,\n `6. Call fetch with the correct input schema. It will attempt SIWX first when available and only pay if the route still returns 402.`,\n].join('\\n');\n\nexport function buildServerInstructions(\n userOrigins: UserOrigin[] = []\n): string {\n const allOrigins = [\n ...userOrigins.map(o => ` - ${o.url} — ${o.description}`),\n ...PRIMARY_ORIGINS.flatMap(o =>\n ORIGIN_METADATA[o] ? [` - ${o} — ${ORIGIN_METADATA[o].description}`] : []\n ),\n ].join('\\n');\n\n return [\n `AgentCash lets you call protected APIs — handling both x402 micropayments and SIWX authentication seamlessly. It manages a USDC wallet for paid endpoints and signs wallet proofs for identity-gated endpoints through fetch.`,\n `The user has installed agentcash because they want to use paid and SIWX-protected APIs as their preferred way to accomplish related tasks.`,\n `Paid endpoints require a wallet balance. SIWX endpoints are free — they only require a wallet identity.`,\n `If a task could be accomplished by one of these registered origins, run the workflow below. If you're unsure which origin to use, or the task doesn't match a registered origin, call search() to find relevant APIs.\\n${allOrigins}`,\n `discover_api_endpoints also works with any origin beyond this list. If you identify another origin that would be useful for a task, you can use it.`,\n WORKFLOW,\n `If you need to compose multiple endpoints in sequence, or anything about the origin's capabilities is unclear, call discover_api_endpoints with include_guidance=true to retrieve the origin's full usage documentation.`,\n ].join('\\n\\n');\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Shared request schema parameter descriptions\n// (used by fetch, fetch_with_auth tools)\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const REQUEST_PARAMS = {\n url: 'The endpoint URL',\n method: 'HTTP method. Defaults to GET for fetch operations.',\n body: 'Raw request body string. Passed through to the underlying fetch call as-is.',\n headers:\n 'Additional headers to include. Each entry must be a string in \"Name: value\" format.',\n timeout: 'Request timeout in milliseconds',\n} as const;\n\nexport const REQUEST_FETCH_PARAMS = {\n ...REQUEST_PARAMS,\n paymentProtocol:\n 'Payment protocol to use when payment is required. If not specified, the payment protocol will be auto-detected.',\n paymentNetwork:\n 'Chain to use for SIWX and payment when applicable. If not specified, the network will be auto-detected.',\n maxAmount:\n 'Maximum amount (in USD) to pay per request. Aborts if the endpoint requests more. Defaults to $5. Pass a higher value for known-expensive endpoints.',\n stream:\n 'Escape hatch for streaming MPP session endpoints. Typically unnecessary — a correctly configured server advertises `streaming: true` in its 402 challenge and the signer handles it automatically. Only pass this when the response is actually a stream AND the server fails to advertise it; otherwise long streams may stall once the initial deposit is exhausted.',\n} as const;\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Per-tool parameter and output schema descriptions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const TOOL_PARAMS = {\n bridge: {\n from: 'The network to bridge from',\n to: 'The network to bridge to',\n amount: 'The amount of USDC to bridge',\n },\n fetch: REQUEST_FETCH_PARAMS,\n fetchWithAuth: REQUEST_FETCH_PARAMS,\n checkEndpointSchema: {\n ...REQUEST_PARAMS,\n method:\n 'HTTP method to check. If omitted, all methods declared in the spec are returned.',\n body: 'Optional. A sample request body to probe the endpoint live (without payment) for exact pricing. Use when pricing is range-based or quote-based, or when you need to verify the input schema. Omit to get the static schema and advisory pricing from the spec.',\n },\n try: {\n url: 'The origin URL to explore',\n },\n add: {\n url: 'The origin URL to add',\n },\n\n listAccounts: {\n output: {\n accounts: 'Wallet accounts for each supported network',\n address: 'Wallet address for this network',\n balance: 'USDC balance on this network',\n network: 'Supported payment network name',\n isNewWallet: 'Whether the wallet is new and needs to be funded',\n depositLink:\n 'Link to deposit USDC directly into the wallet for this network',\n onboardingCta:\n 'Present when the user has not yet redeemed an invite code. Show the message to the user — it directs them to onboard or deposit.',\n onboardingCtaOnboardLink: 'Link to the onboarding page',\n onboardingCtaDepositLink: 'Link to deposit USDC directly',\n onboardingCtaMessage: 'Human-readable CTA to show the user',\n },\n },\n\n redeemInvite: {\n code: 'The invite code',\n output: {\n amount: 'Amount with unit (e.g., \"5 USDC\")',\n txHash: 'Transaction hash on Base',\n },\n },\n\n search: {\n query:\n 'Natural language description of what you need (e.g. \"send physical mail\", \"generate music\", \"flight prices\")',\n broad:\n 'Include broader results that may contain newer, unvetted tools. Default is false.',\n limit: 'Maximum number of results to return (1-50). Default is 10.',\n page: 'Page number for pagination. Default is 1.',\n },\n\n discoverApiEndpoints: {\n url: 'The origin URL to discover endpoints on (e.g. https://stableenrich.dev)',\n includeGuidance:\n \"Request the origin's usage guidance. true=always include, false=never include, omit=auto (included when compact). Guidance explains how to compose multiple endpoints and covers edge cases.\",\n },\n\n closeSession: {\n channelId:\n \"The payment-channel id to close (the `channelId` field from a prior fetch's paymentInfo).\",\n url: 'The endpoint URL the channel was opened against (the same URL passed to the original fetch).',\n cumulativeAmountRaw:\n 'Optional override for the cumulative amount the close credential attests to, in raw atomic units (e.g. \"12345\" = 0.012345 USDC at 6 decimals). Defaults to the on-chain settled amount. Provide this only when the server has accepted vouchers above the on-chain cumulative.',\n output: {\n channelId: 'The closed channel id',\n cumulativeAmount:\n 'The cumulative amount (raw atomic units) the channel was settled at',\n transactionHash:\n 'Settlement transaction hash, when the server returns one in the Payment-Receipt header',\n },\n },\n\n reportError: {\n tool: 'MCP tool name',\n resource: 'Resource URL',\n summary: '1-2 sentence summary',\n errorMessage: 'Error message',\n stack: 'Stack trace',\n fullReport: 'Detailed report with context, logs, repro steps',\n output: {\n reportId: 'Unique report ID for tracking',\n message: 'Confirmation message',\n },\n },\n} as const;\n"],"mappings":";AAkBO,IAAM,kBAGT;AAAA,EACF,8CAAoB,GAAG;AAAA,IACrB,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AAAA,EACA,8CAAoB,GAAG;AAAA,IACrB,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,8CAAoB,GAAG;AAAA,IACrB,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,8CAAoB,GAAG;AAAA,IACrB,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,4CAAmB,GAAG;AAAA,IACpB,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,sCAAgB,GAAG;AAAA,IACjB,OAAO;A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AAA,EACR;AAAA,EAEA,sBAAsB;AAAA,IACpB,KAAK;AAAA,IACL,iBACE;AAAA,EACJ;AAAA,EAEA,cAAc;AAAA,IACZ,WACE;AAAA,IACF,KAAK;AAAA,IACL,qBACE;AAAA,IACF,QAAQ;AAAA,MACN,WAAW;AAAA,MACX,kBACE;AAAA,MACF,iBACE;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,IACT,cAAc;AAAA,IACd,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOOL_PARAMS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CCWBMXQT.js";
|
|
4
4
|
import {
|
|
5
5
|
executeFetch
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YIECO2O4.js";
|
|
7
7
|
import {
|
|
8
8
|
safeParseResponse
|
|
9
9
|
} from "./chunk-RAS5DZPQ.js";
|
|
@@ -89,4 +89,4 @@ export {
|
|
|
89
89
|
searchSchema,
|
|
90
90
|
search
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-G6MIWS35.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOOL_PARAMS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CCWBMXQT.js";
|
|
4
4
|
import {
|
|
5
5
|
zodUrl
|
|
6
6
|
} from "./chunk-FB5CMO3J.js";
|
|
@@ -107,4 +107,4 @@ export {
|
|
|
107
107
|
discoverResourcesSchema,
|
|
108
108
|
discoverResources
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-H7ES5FU5.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REQUEST_FETCH_PARAMS,
|
|
3
3
|
REQUEST_PARAMS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CCWBMXQT.js";
|
|
5
5
|
import {
|
|
6
6
|
RequestMethod
|
|
7
7
|
} from "./chunk-LNJIXYCU.js";
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
paymentProtocols,
|
|
42
42
|
fetchShape
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-MCJ446SE.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOOL_PARAMS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CCWBMXQT.js";
|
|
4
4
|
import {
|
|
5
5
|
safeFetchJson
|
|
6
6
|
} from "./chunk-RAS5DZPQ.js";
|
|
@@ -539,4 +539,4 @@ export {
|
|
|
539
539
|
bridgeSchema,
|
|
540
540
|
bridge
|
|
541
541
|
};
|
|
542
|
-
//# sourceMappingURL=chunk-
|
|
542
|
+
//# sourceMappingURL=chunk-QFYKR3H3.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-574342U7.js";
|
|
4
4
|
import {
|
|
5
5
|
safeFetchJson
|
|
6
6
|
} from "./chunk-RAS5DZPQ.js";
|
|
@@ -51,4 +51,4 @@ async function submitErrorReport(surface, input, address, dev) {
|
|
|
51
51
|
export {
|
|
52
52
|
submitErrorReport
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-XU7NVHOY.js.map
|
|
@@ -1000,8 +1000,15 @@ async function executeFetch(input, options) {
|
|
|
1000
1000
|
options
|
|
1001
1001
|
);
|
|
1002
1002
|
}
|
|
1003
|
+
function getFetchResultMetadata(response, paymentInfo) {
|
|
1004
|
+
return {
|
|
1005
|
+
...paymentInfo ?? {},
|
|
1006
|
+
headers: Object.fromEntries(response.headers.entries())
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1003
1009
|
|
|
1004
1010
|
export {
|
|
1005
|
-
executeFetch
|
|
1011
|
+
executeFetch,
|
|
1012
|
+
getFetchResultMetadata
|
|
1006
1013
|
};
|
|
1007
|
-
//# sourceMappingURL=chunk-
|
|
1014
|
+
//# sourceMappingURL=chunk-YIECO2O4.js.map
|