agentcash 0.7.3 → 0.7.4
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 +247 -152
- package/dist/esm/{chunk-2TZTTTIV.js → chunk-DBDSS3CQ.js} +11 -8
- package/dist/esm/chunk-DBDSS3CQ.js.map +1 -0
- package/dist/esm/{chunk-L6FT4XVY.js → chunk-HXRJ5ES4.js} +2 -2
- package/dist/esm/{chunk-Q36ALLOZ.js → chunk-MQLBI77V.js} +2 -2
- package/dist/esm/{chunk-A3AHACXX.js → chunk-NFKU5GQE.js} +3 -3
- package/dist/esm/chunk-OW3UV227.js +7 -0
- package/dist/esm/chunk-RY34EBJ4.js +182 -0
- package/dist/esm/chunk-RY34EBJ4.js.map +1 -0
- package/dist/esm/{commands-CVVQU55P.js → commands-M66YQJM7.js} +8 -7
- package/dist/esm/{commands-CVVQU55P.js.map → commands-M66YQJM7.js.map} +1 -1
- package/dist/esm/index.js +26 -23
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{install-FGWA5K3W.js → install-4YDF4G6T.js} +3 -3
- package/dist/esm/{server-GGPRVDHK.js → server-GJVD7VNR.js} +49 -144
- package/dist/esm/server-GJVD7VNR.js.map +1 -0
- package/dist/esm/shared/operations/index.js +3 -3
- package/package.json +5 -5
- package/dist/esm/chunk-2TZTTTIV.js.map +0 -1
- package/dist/esm/chunk-TBIW54SA.js +0 -7
- package/dist/esm/server-GGPRVDHK.js.map +0 -1
- /package/dist/esm/{chunk-L6FT4XVY.js.map → chunk-HXRJ5ES4.js.map} +0 -0
- /package/dist/esm/{chunk-Q36ALLOZ.js.map → chunk-MQLBI77V.js.map} +0 -0
- /package/dist/esm/{chunk-A3AHACXX.js.map → chunk-NFKU5GQE.js.map} +0 -0
- /package/dist/esm/{chunk-TBIW54SA.js.map → chunk-OW3UV227.js.map} +0 -0
- /package/dist/esm/{install-FGWA5K3W.js.map → install-4YDF4G6T.js.map} +0 -0
package/dist/cjs/run-server.cjs
CHANGED
|
@@ -113816,7 +113816,7 @@ var import_path2 = require("path");
|
|
|
113816
113816
|
var import_url = require("url");
|
|
113817
113817
|
function getVersion2() {
|
|
113818
113818
|
if (true) {
|
|
113819
|
-
return "0.7.
|
|
113819
|
+
return "0.7.4";
|
|
113820
113820
|
}
|
|
113821
113821
|
const __dirname3 = (0, import_path2.dirname)((0, import_url.fileURLToPath)(importMetaUrl));
|
|
113822
113822
|
const pkg = JSON.parse(
|
|
@@ -113979,7 +113979,7 @@ var TEMPO_TOKEN_ADDRESS = "0x20c0000000000000000000000000000000000000";
|
|
|
113979
113979
|
|
|
113980
113980
|
// src/shared/mpp-enabled.ts
|
|
113981
113981
|
init_cjs_shims();
|
|
113982
|
-
var isMppEnabled = () => "0.7.
|
|
113982
|
+
var isMppEnabled = () => "0.7.4".includes("-mpp");
|
|
113983
113983
|
|
|
113984
113984
|
// src/shared/operations/fetch-with-payment.ts
|
|
113985
113985
|
init_cjs_shims();
|
|
@@ -115278,12 +115278,192 @@ function safeHandler(handler) {
|
|
|
115278
115278
|
|
|
115279
115279
|
// src/server/tools/lib/request.ts
|
|
115280
115280
|
init_cjs_shims();
|
|
115281
|
+
|
|
115282
|
+
// src/shared/descriptions.ts
|
|
115283
|
+
init_cjs_shims();
|
|
115284
|
+
|
|
115285
|
+
// src/shared/origins.ts
|
|
115286
|
+
init_cjs_shims();
|
|
115287
|
+
var ORIGINS = [
|
|
115288
|
+
"https://stableenrich.dev" /* StableEnrich */,
|
|
115289
|
+
"https://stablesocial.dev" /* StableSocial */,
|
|
115290
|
+
"https://stablestudio.dev" /* StableStudio */,
|
|
115291
|
+
"https://stableupload.dev" /* StableUpload */,
|
|
115292
|
+
"https://stableemail.dev" /* StableEmail */,
|
|
115293
|
+
"https://x402scan.com" /* X402Scan */,
|
|
115294
|
+
"https://shirt.sh" /* Shirt */,
|
|
115295
|
+
"https://x402puppet.com" /* X402Puppet */
|
|
115296
|
+
];
|
|
115297
|
+
|
|
115298
|
+
// src/shared/descriptions.ts
|
|
115299
|
+
var ORIGIN_METADATA = {
|
|
115300
|
+
["https://stableenrich.dev" /* StableEnrich */]: {
|
|
115301
|
+
title: "StableEnrich",
|
|
115302
|
+
description: "People/org search, Google Maps, Grok twitter search, Exa web search, LinkedIn data, Firecrawl scrape, WhitePages, email enrichment"
|
|
115303
|
+
},
|
|
115304
|
+
["https://stablesocial.dev" /* StableSocial */]: {
|
|
115305
|
+
title: "StableSocial",
|
|
115306
|
+
description: "Social media data for Twitter, Instagram, TikTok, YouTube, Facebook, Reddit"
|
|
115307
|
+
},
|
|
115308
|
+
["https://stablestudio.dev" /* StableStudio */]: {
|
|
115309
|
+
title: "StableStudio",
|
|
115310
|
+
description: "Generate and edit images and videos"
|
|
115311
|
+
},
|
|
115312
|
+
["https://stableupload.dev" /* StableUpload */]: {
|
|
115313
|
+
title: "StableUpload",
|
|
115314
|
+
description: "Pay to upload files, get a permanent download URL."
|
|
115315
|
+
},
|
|
115316
|
+
["https://stableemail.dev" /* StableEmail */]: {
|
|
115317
|
+
title: "StableEmail",
|
|
115318
|
+
description: "Send emails"
|
|
115319
|
+
},
|
|
115320
|
+
["https://x402scan.com" /* X402Scan */]: {
|
|
115321
|
+
title: "X402 Scan",
|
|
115322
|
+
description: "x402 protocol explorer"
|
|
115323
|
+
},
|
|
115324
|
+
["https://shirt.sh" /* Shirt */]: {
|
|
115325
|
+
title: "Shirt",
|
|
115326
|
+
description: "Shirt.sh"
|
|
115327
|
+
},
|
|
115328
|
+
["https://x402puppet.com" /* X402Puppet */]: {
|
|
115329
|
+
title: "X402 Puppet",
|
|
115330
|
+
description: "Browser automation"
|
|
115331
|
+
},
|
|
115332
|
+
["https://x402facilitator.com" /* X402Facilitator */]: {
|
|
115333
|
+
title: "X402 Facilitator",
|
|
115334
|
+
description: "Payment facilitation"
|
|
115335
|
+
}
|
|
115336
|
+
};
|
|
115337
|
+
var PRIMARY_ORIGINS = [
|
|
115338
|
+
"https://stableenrich.dev" /* StableEnrich */,
|
|
115339
|
+
"https://stablesocial.dev" /* StableSocial */,
|
|
115340
|
+
"https://stablestudio.dev" /* StableStudio */,
|
|
115341
|
+
"https://stableupload.dev" /* StableUpload */,
|
|
115342
|
+
"https://stableemail.dev" /* StableEmail */
|
|
115343
|
+
];
|
|
115344
|
+
var DESCRIPTIONS = {
|
|
115345
|
+
fetch: {
|
|
115346
|
+
mcp: `HTTP fetch with automatic x402 payment handling. Makes the request and, if the endpoint returns 402, signs payment and retries with payment headers. Returns response data along with payment details (price, tx hash) if a payment was made.
|
|
115347
|
+
|
|
115348
|
+
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.`,
|
|
115349
|
+
cli: `HTTP fetch with automatic x402 payment handling.`
|
|
115350
|
+
},
|
|
115351
|
+
fetchWithAuth: {
|
|
115352
|
+
mcp: `HTTP fetch with automatic SIWX (Sign-In With X) authentication. Sends an authenticated request to a SIWX-protected endpoint. Returns response data gated by the endpoint's authentication requirements.
|
|
115353
|
+
|
|
115354
|
+
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.`,
|
|
115355
|
+
cli: `HTTP fetch with automatic SIWX (Sign-In With X) authentication`
|
|
115356
|
+
},
|
|
115357
|
+
getWalletInfo: {
|
|
115358
|
+
mcp: `Get wallet address and USDC balance. Auto-creates wallet on first use (~/.agentcash/wallet.json). Returns a deposit link if funding is needed.`,
|
|
115359
|
+
cli: `Get wallet address, balance, and deposit link`
|
|
115360
|
+
},
|
|
115361
|
+
checkEndpointSchema: {
|
|
115362
|
+
mcp: [
|
|
115363
|
+
`Get the input/output schema and auth mode (paid or SIWX) for a single endpoint.`,
|
|
115364
|
+
`Call this to see exactly what fields the request body expects and what the response contains.`,
|
|
115365
|
+
`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 \u2014 do this when pricing is range-based or quote-based, or when you're unsure about the input schema.`
|
|
115366
|
+
].join("\n\n"),
|
|
115367
|
+
cli: `Check endpoint for schema and pricing without making payment`
|
|
115368
|
+
},
|
|
115369
|
+
discoverApiEndpoints: {
|
|
115370
|
+
mcp: [
|
|
115371
|
+
`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.`,
|
|
115372
|
+
`Call this when you need to see what routes are available at an origin \u2014 whether it's one of the registered origins or any other origin you've identified as useful.`,
|
|
115373
|
+
`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.`
|
|
115374
|
+
].join("\n\n"),
|
|
115375
|
+
cli: `Discover x402-protected or SIWX-protected endpoints on an origin`
|
|
115376
|
+
},
|
|
115377
|
+
redeemInvite: {
|
|
115378
|
+
mcp: `Redeem an invite code for free USDC on Base. One-time use per code. Returns amount received and transaction hash. Use get_wallet_info after to verify balance.`,
|
|
115379
|
+
cli: `Redeem an invite code for free USDC`
|
|
115380
|
+
},
|
|
115381
|
+
reportError: {
|
|
115382
|
+
mcp: `EMERGENCY ONLY. Report critical MCP tool bugs. Do NOT use for normal errors (balance, network, 4xx) \u2014 those are recoverable.`,
|
|
115383
|
+
cli: `Report a critical bug to the agentcash team (emergency only)`
|
|
115384
|
+
},
|
|
115385
|
+
serverInstructions: [
|
|
115386
|
+
`AgentCash lets you call protected APIs \u2014 handling both x402 micropayments and SIWX authentication seamlessly. It manages a USDC wallet for paid endpoints (fetch) and signs wallet proofs for identity-gated endpoints (fetch_with_auth).`,
|
|
115387
|
+
`The user has installed agentcash because they want to use paid and SIWX-protected APIs as their preferred way to accomplish related tasks.`,
|
|
115388
|
+
`Paid endpoints require a wallet balance. SIWX endpoints are free \u2014 they only require a wallet identity.`,
|
|
115389
|
+
[
|
|
115390
|
+
`If a task could be accomplished by one of these registered origins, run the workflow below:`,
|
|
115391
|
+
...PRIMARY_ORIGINS.flatMap(
|
|
115392
|
+
(o) => ORIGIN_METADATA[o] ? [` - ${o} \u2014 ${ORIGIN_METADATA[o].description}`] : []
|
|
115393
|
+
)
|
|
115394
|
+
].join("\n"),
|
|
115395
|
+
`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.`,
|
|
115396
|
+
[
|
|
115397
|
+
`Workflow:`,
|
|
115398
|
+
`1. If you don't already know your balance, call get_wallet_info. You need a balance for paid endpoints \u2014 if it's zero, share the deposit link with the user. SIWX endpoints don't require a balance. You don't need to call this every turn, just before your first paid call or whenever you're unsure.`,
|
|
115399
|
+
`2. Call discover_api_endpoints() to get the endpoint index \u2014 a list of available routes with descriptions and auth modes. The auth mode for each endpoint tells you whether to use fetch (paid) or fetch_with_auth (SIWX).`,
|
|
115400
|
+
`3. 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.`,
|
|
115401
|
+
`4. Call fetch (paid) or fetch_with_auth (SIWX) based on the auth mode, and with the correct input schema.`
|
|
115402
|
+
].join("\n"),
|
|
115403
|
+
`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.`
|
|
115404
|
+
].join("\n\n")
|
|
115405
|
+
};
|
|
115406
|
+
var REQUEST_PARAMS = {
|
|
115407
|
+
url: "The endpoint URL",
|
|
115408
|
+
method: "HTTP method. Defaults to GET for fetch operations.",
|
|
115409
|
+
body: "Request body for POST/PUT/PATCH methods",
|
|
115410
|
+
headers: "Additional headers to include",
|
|
115411
|
+
timeout: "Request timeout in milliseconds"
|
|
115412
|
+
};
|
|
115413
|
+
var TOOL_PARAMS = {
|
|
115414
|
+
fetch: {
|
|
115415
|
+
paymentMethod: "Payment protocol to use. Defaults to auto-detect."
|
|
115416
|
+
},
|
|
115417
|
+
checkEndpointSchema: {
|
|
115418
|
+
url: "Full URL of the endpoint to inspect",
|
|
115419
|
+
method: "HTTP method to check. If omitted, all methods declared in the spec are returned.",
|
|
115420
|
+
sampleInputBody: "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.",
|
|
115421
|
+
headers: "Additional headers to include in the probe request"
|
|
115422
|
+
},
|
|
115423
|
+
getWalletInfo: {
|
|
115424
|
+
output: {
|
|
115425
|
+
address: "Wallet address (0x...)",
|
|
115426
|
+
balance: "Total USDC balance across all chains",
|
|
115427
|
+
chains: "Balance breakdown by chain",
|
|
115428
|
+
isNewWallet: "Whether the wallet is new and needs to be funded",
|
|
115429
|
+
depositLink: "Link to fund the wallet",
|
|
115430
|
+
message: "Warning if balance is low",
|
|
115431
|
+
chain: "Chain name",
|
|
115432
|
+
chainBalance: "USDC balance on this chain"
|
|
115433
|
+
}
|
|
115434
|
+
},
|
|
115435
|
+
redeemInvite: {
|
|
115436
|
+
code: "The invite code",
|
|
115437
|
+
output: {
|
|
115438
|
+
amount: 'Amount with unit (e.g., "5 USDC")',
|
|
115439
|
+
txHash: "Transaction hash on Base"
|
|
115440
|
+
}
|
|
115441
|
+
},
|
|
115442
|
+
discoverApiEndpoints: {
|
|
115443
|
+
url: "The origin URL to discover endpoints on (e.g. https://stableenrich.dev)",
|
|
115444
|
+
includeGuidance: "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."
|
|
115445
|
+
},
|
|
115446
|
+
reportError: {
|
|
115447
|
+
tool: "MCP tool name",
|
|
115448
|
+
resource: "Resource URL",
|
|
115449
|
+
summary: "1-2 sentence summary",
|
|
115450
|
+
errorMessage: "Error message",
|
|
115451
|
+
stack: "Stack trace",
|
|
115452
|
+
fullReport: "Detailed report with context, logs, repro steps",
|
|
115453
|
+
output: {
|
|
115454
|
+
reportId: "Unique report ID for tracking",
|
|
115455
|
+
message: "Confirmation message"
|
|
115456
|
+
}
|
|
115457
|
+
}
|
|
115458
|
+
};
|
|
115459
|
+
|
|
115460
|
+
// src/server/tools/lib/request.ts
|
|
115281
115461
|
var requestSchema = zod_default.object({
|
|
115282
|
-
url: zod_default.string().describe(
|
|
115283
|
-
method: zod_default.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().describe(
|
|
115284
|
-
body: zod_default.unknown().optional().describe(
|
|
115285
|
-
headers: zod_default.record(zod_default.string(), zod_default.string()).optional().describe(
|
|
115286
|
-
timeout: zod_default.number().int().positive().optional().describe(
|
|
115462
|
+
url: zod_default.string().describe(REQUEST_PARAMS.url),
|
|
115463
|
+
method: zod_default.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().describe(REQUEST_PARAMS.method),
|
|
115464
|
+
body: zod_default.unknown().optional().describe(REQUEST_PARAMS.body),
|
|
115465
|
+
headers: zod_default.record(zod_default.string(), zod_default.string()).optional().describe(REQUEST_PARAMS.headers).default({}),
|
|
115466
|
+
timeout: zod_default.number().int().positive().optional().describe(REQUEST_PARAMS.timeout)
|
|
115287
115467
|
});
|
|
115288
115468
|
var buildRequest2 = ({
|
|
115289
115469
|
input,
|
|
@@ -115393,7 +115573,7 @@ Insufficient Tempo balance for this payment.`
|
|
|
115393
115573
|
var toolName = "fetch";
|
|
115394
115574
|
var paymentMethodEnum = isMppEnabled() ? external_exports3.enum(["x402", "mpp", "auto"]) : external_exports3.enum(["x402", "auto"]);
|
|
115395
115575
|
var fetchInputSchema = requestSchema.extend({
|
|
115396
|
-
paymentMethod: paymentMethodEnum.default("auto").optional().describe(
|
|
115576
|
+
paymentMethod: paymentMethodEnum.default("auto").optional().describe(TOOL_PARAMS.fetch.paymentMethod)
|
|
115397
115577
|
});
|
|
115398
115578
|
var registerFetchTool = ({
|
|
115399
115579
|
server,
|
|
@@ -115405,7 +115585,7 @@ var registerFetchTool = ({
|
|
|
115405
115585
|
toolName,
|
|
115406
115586
|
{
|
|
115407
115587
|
title: "Fetch",
|
|
115408
|
-
description:
|
|
115588
|
+
description: DESCRIPTIONS.fetch.mcp,
|
|
115409
115589
|
inputSchema: fetchInputSchema,
|
|
115410
115590
|
annotations: {
|
|
115411
115591
|
readOnlyHint: true,
|
|
@@ -115593,7 +115773,7 @@ var registerAuthTools = ({
|
|
|
115593
115773
|
toolName2,
|
|
115594
115774
|
{
|
|
115595
115775
|
title: "Fetch with Authentication",
|
|
115596
|
-
description:
|
|
115776
|
+
description: DESCRIPTIONS.fetchWithAuth.mcp,
|
|
115597
115777
|
inputSchema: requestSchema,
|
|
115598
115778
|
annotations: {
|
|
115599
115779
|
readOnlyHint: true,
|
|
@@ -115669,8 +115849,8 @@ async function getWalletInfo(surface2, address, flags) {
|
|
|
115669
115849
|
|
|
115670
115850
|
// src/server/tools/wallet.ts
|
|
115671
115851
|
var chainBalanceSchema = external_exports3.object({
|
|
115672
|
-
chain: external_exports3.string().describe(
|
|
115673
|
-
balance: external_exports3.number().describe(
|
|
115852
|
+
chain: external_exports3.string().describe(TOOL_PARAMS.getWalletInfo.output.chain),
|
|
115853
|
+
balance: external_exports3.number().describe(TOOL_PARAMS.getWalletInfo.output.chainBalance)
|
|
115674
115854
|
});
|
|
115675
115855
|
var registerWalletTools = ({
|
|
115676
115856
|
server,
|
|
@@ -115681,14 +115861,14 @@ var registerWalletTools = ({
|
|
|
115681
115861
|
"get_wallet_info",
|
|
115682
115862
|
{
|
|
115683
115863
|
title: "Get Wallet Info",
|
|
115684
|
-
description:
|
|
115864
|
+
description: DESCRIPTIONS.getWalletInfo.mcp,
|
|
115685
115865
|
outputSchema: external_exports3.object({
|
|
115686
|
-
address: external_exports3.string().describe(
|
|
115687
|
-
balance: external_exports3.number().describe(
|
|
115688
|
-
chains: external_exports3.array(chainBalanceSchema).describe(
|
|
115689
|
-
isNewWallet: external_exports3.boolean().describe(
|
|
115690
|
-
depositLink: external_exports3.string().url().describe(
|
|
115691
|
-
message: external_exports3.string().optional().describe(
|
|
115866
|
+
address: external_exports3.string().describe(TOOL_PARAMS.getWalletInfo.output.address),
|
|
115867
|
+
balance: external_exports3.number().describe(TOOL_PARAMS.getWalletInfo.output.balance),
|
|
115868
|
+
chains: external_exports3.array(chainBalanceSchema).describe(TOOL_PARAMS.getWalletInfo.output.chains),
|
|
115869
|
+
isNewWallet: external_exports3.boolean().describe(TOOL_PARAMS.getWalletInfo.output.isNewWallet),
|
|
115870
|
+
depositLink: external_exports3.string().url().describe(TOOL_PARAMS.getWalletInfo.output.depositLink),
|
|
115871
|
+
message: external_exports3.string().optional().describe(TOOL_PARAMS.getWalletInfo.output.message)
|
|
115692
115872
|
}),
|
|
115693
115873
|
annotations: {
|
|
115694
115874
|
readOnlyHint: true,
|
|
@@ -115720,7 +115900,7 @@ init_cjs_shims();
|
|
|
115720
115900
|
// src/shared/operations/check-endpoint.ts
|
|
115721
115901
|
init_cjs_shims();
|
|
115722
115902
|
|
|
115723
|
-
// ../../../node_modules/.pnpm/@agentcash+discovery@1.0.
|
|
115903
|
+
// ../../../node_modules/.pnpm/@agentcash+discovery@1.0.1/node_modules/@agentcash/discovery/dist/index.js
|
|
115724
115904
|
init_cjs_shims();
|
|
115725
115905
|
|
|
115726
115906
|
// ../../../node_modules/.pnpm/@x402+core@2.6.0/node_modules/@x402/core/dist/esm/schemas/index.mjs
|
|
@@ -115799,7 +115979,7 @@ var PaymentPayloadSchema = external_exports4.discriminatedUnion("x402Version", [
|
|
|
115799
115979
|
PaymentPayloadV2Schema
|
|
115800
115980
|
]);
|
|
115801
115981
|
|
|
115802
|
-
// ../../../node_modules/.pnpm/@agentcash+discovery@1.0.
|
|
115982
|
+
// ../../../node_modules/.pnpm/@agentcash+discovery@1.0.1/node_modules/@agentcash/discovery/dist/index.js
|
|
115803
115983
|
var OpenApiPaymentInfoSchema = external_exports3.object({
|
|
115804
115984
|
pricingMode: external_exports3.enum(["fixed", "range", "quote"]),
|
|
115805
115985
|
price: external_exports3.string().optional(),
|
|
@@ -115940,7 +116120,7 @@ function toFetchError(err3) {
|
|
|
115940
116120
|
function fetchSafe(url3, init) {
|
|
115941
116121
|
return ResultAsync.fromPromise(fetch(url3, init), toFetchError);
|
|
115942
116122
|
}
|
|
115943
|
-
var isMmmEnabled = () => "1.0.
|
|
116123
|
+
var isMmmEnabled = () => "1.0.1".includes("-mmm");
|
|
115944
116124
|
var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
|
|
115945
116125
|
const routes = [];
|
|
115946
116126
|
for (const [rawPath, pathItem] of Object.entries(doc.paths)) {
|
|
@@ -116265,10 +116445,12 @@ function extractSchemas3(payload) {
|
|
|
116265
116445
|
return {};
|
|
116266
116446
|
}
|
|
116267
116447
|
function parseInputSchema(payload) {
|
|
116268
|
-
|
|
116448
|
+
const schema = extractSchemas3(payload).inputSchema;
|
|
116449
|
+
return schema;
|
|
116269
116450
|
}
|
|
116270
116451
|
function parseOutputSchema(payload) {
|
|
116271
|
-
|
|
116452
|
+
const schema = extractSchemas3(payload).outputSchema;
|
|
116453
|
+
return schema;
|
|
116272
116454
|
}
|
|
116273
116455
|
async function parsePaymentRequiredBody(response) {
|
|
116274
116456
|
const payload = await response.clone().json();
|
|
@@ -116486,6 +116668,20 @@ function extractRequestBodySchema(operationSchema) {
|
|
|
116486
116668
|
}
|
|
116487
116669
|
return void 0;
|
|
116488
116670
|
}
|
|
116671
|
+
function extractOutputSchema(operationSchema) {
|
|
116672
|
+
const responses = operationSchema.responses;
|
|
116673
|
+
if (!isRecord(responses)) return void 0;
|
|
116674
|
+
const candidate = responses["200"] ?? responses["201"] ?? Object.entries(responses).find(([k]) => k.startsWith("2"))?.[1];
|
|
116675
|
+
if (!isRecord(candidate)) return void 0;
|
|
116676
|
+
const content = candidate.content;
|
|
116677
|
+
if (!isRecord(content)) return void 0;
|
|
116678
|
+
const json3 = content["application/json"];
|
|
116679
|
+
if (isRecord(json3) && isRecord(json3.schema)) return json3.schema;
|
|
116680
|
+
for (const mediaType of Object.values(content)) {
|
|
116681
|
+
if (isRecord(mediaType) && isRecord(mediaType.schema)) return mediaType.schema;
|
|
116682
|
+
}
|
|
116683
|
+
return void 0;
|
|
116684
|
+
}
|
|
116489
116685
|
function extractParameters(operationSchema) {
|
|
116490
116686
|
const params = operationSchema.parameters;
|
|
116491
116687
|
if (!Array.isArray(params)) return [];
|
|
@@ -116544,7 +116740,7 @@ function getL3ForOpenAPI(openApi, path2, method) {
|
|
|
116544
116740
|
estimatedPrice: parseOperationPrice(resolvedOperation),
|
|
116545
116741
|
protocols: parseOperationProtocols(resolvedOperation),
|
|
116546
116742
|
inputSchema: extractInputSchema(resolvedOperation),
|
|
116547
|
-
outputSchema: resolvedOperation
|
|
116743
|
+
outputSchema: extractOutputSchema(resolvedOperation)
|
|
116548
116744
|
};
|
|
116549
116745
|
}
|
|
116550
116746
|
function getL3ForProbe(probe, path2, method) {
|
|
@@ -116663,23 +116859,12 @@ var registerCheckEndpointTool = ({
|
|
|
116663
116859
|
toolName3,
|
|
116664
116860
|
{
|
|
116665
116861
|
title: "Check Endpoint Schema",
|
|
116666
|
-
description:
|
|
116667
|
-
|
|
116668
|
-
Two-phase workflow:
|
|
116669
|
-
1. Call without sample_input_body to get the input schema and advisory pricing from the OpenAPI spec (no live request to the endpoint).
|
|
116670
|
-
2. Once you know what body you intend to send, call again with sample_input_body set to that body. The endpoint will be probed live with that payload and exact paymentOptions (priced for your specific body) are returned in each advisory.
|
|
116671
|
-
|
|
116672
|
-
Checks the OpenAPI spec first, then falls back to a live 402 probe if no spec is found.
|
|
116673
|
-
Use before fetch to understand what an endpoint requires. No payment is made.`,
|
|
116862
|
+
description: DESCRIPTIONS.checkEndpointSchema.mcp,
|
|
116674
116863
|
inputSchema: zod_default.object({
|
|
116675
|
-
url: zod_default.string().describe(
|
|
116676
|
-
method: zod_default.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().describe(
|
|
116677
|
-
|
|
116678
|
-
),
|
|
116679
|
-
sample_input_body: zod_default.record(zod_default.string(), zod_default.unknown()).optional().describe(
|
|
116680
|
-
"A sample request body you plan to send. When provided, the endpoint is probed live with this payload and exact paymentOptions priced for that body are returned. Use this after phase 1 has given you the input schema."
|
|
116681
|
-
),
|
|
116682
|
-
headers: zod_default.record(zod_default.string(), zod_default.string()).optional().describe("Additional headers to include in the probe request").default({})
|
|
116864
|
+
url: zod_default.string().describe(TOOL_PARAMS.checkEndpointSchema.url),
|
|
116865
|
+
method: zod_default.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().describe(TOOL_PARAMS.checkEndpointSchema.method),
|
|
116866
|
+
sample_input_body: zod_default.record(zod_default.string(), zod_default.unknown()).optional().describe(TOOL_PARAMS.checkEndpointSchema.sampleInputBody),
|
|
116867
|
+
headers: zod_default.record(zod_default.string(), zod_default.string()).optional().describe(TOOL_PARAMS.checkEndpointSchema.headers).default({})
|
|
116683
116868
|
}),
|
|
116684
116869
|
annotations: {
|
|
116685
116870
|
readOnlyHint: true,
|
|
@@ -116832,14 +117017,14 @@ var registerRedeemInviteTool = ({
|
|
|
116832
117017
|
"redeem_invite",
|
|
116833
117018
|
{
|
|
116834
117019
|
title: "Redeem Invite",
|
|
116835
|
-
description:
|
|
117020
|
+
description: DESCRIPTIONS.redeemInvite.mcp,
|
|
116836
117021
|
inputSchema: zod_default.object({
|
|
116837
|
-
code: zod_default.string().min(1).describe(
|
|
117022
|
+
code: zod_default.string().min(1).describe(TOOL_PARAMS.redeemInvite.code)
|
|
116838
117023
|
}),
|
|
116839
117024
|
outputSchema: zod_default.object({
|
|
116840
117025
|
redeemed: zod_default.literal(true),
|
|
116841
|
-
amount: zod_default.string().describe(
|
|
116842
|
-
txHash: zod_default.string().describe(
|
|
117026
|
+
amount: zod_default.string().describe(TOOL_PARAMS.redeemInvite.output.amount),
|
|
117027
|
+
txHash: zod_default.string().describe(TOOL_PARAMS.redeemInvite.output.txHash)
|
|
116843
117028
|
}),
|
|
116844
117029
|
annotations: {
|
|
116845
117030
|
readOnlyHint: false,
|
|
@@ -116922,19 +117107,19 @@ var registerTelemetryTools = ({
|
|
|
116922
117107
|
toolName4,
|
|
116923
117108
|
{
|
|
116924
117109
|
title: "Report Error",
|
|
116925
|
-
description:
|
|
117110
|
+
description: DESCRIPTIONS.reportError.mcp,
|
|
116926
117111
|
inputSchema: zod_default.object({
|
|
116927
|
-
tool: zod_default.string().describe(
|
|
116928
|
-
resource: zod_default.string().optional().describe(
|
|
116929
|
-
summary: zod_default.string().describe(
|
|
116930
|
-
errorMessage: zod_default.string().describe(
|
|
116931
|
-
stack: zod_default.string().optional().describe(
|
|
116932
|
-
fullReport: zod_default.string().optional().describe(
|
|
117112
|
+
tool: zod_default.string().describe(TOOL_PARAMS.reportError.tool),
|
|
117113
|
+
resource: zod_default.string().optional().describe(TOOL_PARAMS.reportError.resource),
|
|
117114
|
+
summary: zod_default.string().describe(TOOL_PARAMS.reportError.summary),
|
|
117115
|
+
errorMessage: zod_default.string().describe(TOOL_PARAMS.reportError.errorMessage),
|
|
117116
|
+
stack: zod_default.string().optional().describe(TOOL_PARAMS.reportError.stack),
|
|
117117
|
+
fullReport: zod_default.string().optional().describe(TOOL_PARAMS.reportError.fullReport)
|
|
116933
117118
|
}),
|
|
116934
117119
|
outputSchema: zod_default.object({
|
|
116935
117120
|
submitted: zod_default.literal(true),
|
|
116936
|
-
reportId: zod_default.string().describe(
|
|
116937
|
-
message: zod_default.string().describe(
|
|
117121
|
+
reportId: zod_default.string().describe(TOOL_PARAMS.reportError.output.reportId),
|
|
117122
|
+
message: zod_default.string().describe(TOOL_PARAMS.reportError.output.message)
|
|
116938
117123
|
}),
|
|
116939
117124
|
annotations: {
|
|
116940
117125
|
readOnlyHint: false,
|
|
@@ -116981,19 +117166,6 @@ var registerTelemetryTools = ({
|
|
|
116981
117166
|
// src/server/tools/discover-resources.ts
|
|
116982
117167
|
init_cjs_shims();
|
|
116983
117168
|
|
|
116984
|
-
// src/shared/origins.ts
|
|
116985
|
-
init_cjs_shims();
|
|
116986
|
-
var ORIGINS = [
|
|
116987
|
-
"https://stableenrich.dev" /* StableEnrich */,
|
|
116988
|
-
"https://stablesocial.dev" /* StableSocial */,
|
|
116989
|
-
"https://stablestudio.dev" /* StableStudio */,
|
|
116990
|
-
"https://stableupload.dev" /* StableUpload */,
|
|
116991
|
-
"https://stableemail.dev" /* StableEmail */,
|
|
116992
|
-
"https://x402scan.com" /* X402Scan */,
|
|
116993
|
-
"https://shirt.sh" /* Shirt */,
|
|
116994
|
-
"https://x402puppet.com" /* X402Puppet */
|
|
116995
|
-
];
|
|
116996
|
-
|
|
116997
117169
|
// src/shared/operations/discover.ts
|
|
116998
117170
|
init_cjs_shims();
|
|
116999
117171
|
async function discoverResources(surface2, url3, options = {}) {
|
|
@@ -117018,34 +117190,10 @@ function registerDiscoveryTools(server) {
|
|
|
117018
117190
|
toolName5,
|
|
117019
117191
|
{
|
|
117020
117192
|
title: "Discover API Endpoints",
|
|
117021
|
-
description:
|
|
117022
|
-
Use check_endpoint_schema separately to get detailed pricing/schema info for specific resources.
|
|
117023
|
-
Guidance contract: responses always include guidanceAvailable. guidance is auto-included when compact.
|
|
117024
|
-
Use include_guidance=true to force-include larger guidance when needed.
|
|
117025
|
-
Known default origins with resource packs. Discover if more needed:
|
|
117026
|
-
- ${"https://stableenrich.dev" /* StableEnrich */} ->
|
|
117027
|
-
People + Org search
|
|
117028
|
-
Google Maps (places + locations)
|
|
117029
|
-
Grok twitter search
|
|
117030
|
-
Exa web search
|
|
117031
|
-
Clado linkedin data
|
|
117032
|
-
Firecrawl web scrape
|
|
117033
|
-
WhitePages (business directory)
|
|
117034
|
-
Email enrichment
|
|
117035
|
-
Influencer email/username enrichment
|
|
117036
|
-
Hunter email verifier
|
|
117037
|
-
- ${"https://stablesocial.dev" /* StableSocial */} -> social media data for twitter, instagram, tiktok, youtube, facebook, reddit.
|
|
117038
|
-
- ${"https://stablestudio.dev" /* StableStudio */} -> generate and edit images / videos
|
|
117039
|
-
- ${"https://stableupload.dev" /* StableUpload */} -> upload and share files with others.
|
|
117040
|
-
- ${"https://stableemail.dev" /* StableEmail */} -> send emails.
|
|
117041
|
-
`,
|
|
117193
|
+
description: DESCRIPTIONS.discoverApiEndpoints.mcp,
|
|
117042
117194
|
inputSchema: external_exports3.object({
|
|
117043
|
-
url: external_exports3.string().describe(
|
|
117044
|
-
|
|
117045
|
-
),
|
|
117046
|
-
include_guidance: external_exports3.boolean().optional().describe(
|
|
117047
|
-
"Guidance override: true=always include llms.txt, false=never include, omitted=auto by threshold"
|
|
117048
|
-
)
|
|
117195
|
+
url: external_exports3.string().describe(TOOL_PARAMS.discoverApiEndpoints.url),
|
|
117196
|
+
include_guidance: external_exports3.boolean().optional().describe(TOOL_PARAMS.discoverApiEndpoints.includeGuidance)
|
|
117049
117197
|
}),
|
|
117050
117198
|
annotations: {
|
|
117051
117199
|
readOnlyHint: true,
|
|
@@ -117112,44 +117260,6 @@ function registerDiscoveryTools(server) {
|
|
|
117112
117260
|
|
|
117113
117261
|
// src/server/resources/origins.ts
|
|
117114
117262
|
init_cjs_shims();
|
|
117115
|
-
var ORIGIN_METADATA = {
|
|
117116
|
-
["https://stableenrich.dev" /* StableEnrich */]: {
|
|
117117
|
-
title: "StableEnrich",
|
|
117118
|
-
description: "People/org search, Google Maps, Grok twitter search, Exa web search, LinkedIn data, Firecrawl scrape, WhitePages, email enrichment"
|
|
117119
|
-
},
|
|
117120
|
-
["https://stablesocial.dev" /* StableSocial */]: {
|
|
117121
|
-
title: "StableSocial",
|
|
117122
|
-
description: "Social media data for Twitter, Instagram, TikTok, YouTube, Facebook, Reddit"
|
|
117123
|
-
},
|
|
117124
|
-
["https://stablestudio.dev" /* StableStudio */]: {
|
|
117125
|
-
title: "StableStudio",
|
|
117126
|
-
description: "Generate and edit images and videos"
|
|
117127
|
-
},
|
|
117128
|
-
["https://stableupload.dev" /* StableUpload */]: {
|
|
117129
|
-
title: "AgentUpload",
|
|
117130
|
-
description: "Upload and share files"
|
|
117131
|
-
},
|
|
117132
|
-
["https://stableemail.dev" /* StableEmail */]: {
|
|
117133
|
-
title: "StableEmail",
|
|
117134
|
-
description: "Send emails"
|
|
117135
|
-
},
|
|
117136
|
-
["https://x402scan.com" /* X402Scan */]: {
|
|
117137
|
-
title: "X402 Scan",
|
|
117138
|
-
description: "x402 protocol explorer"
|
|
117139
|
-
},
|
|
117140
|
-
["https://shirt.sh" /* Shirt */]: {
|
|
117141
|
-
title: "Shirt",
|
|
117142
|
-
description: "Shirt.sh"
|
|
117143
|
-
},
|
|
117144
|
-
["https://x402puppet.com" /* X402Puppet */]: {
|
|
117145
|
-
title: "X402 Puppet",
|
|
117146
|
-
description: "Browser automation"
|
|
117147
|
-
},
|
|
117148
|
-
["https://x402facilitator.com" /* X402Facilitator */]: {
|
|
117149
|
-
title: "X402 Facilitator",
|
|
117150
|
-
description: "Payment facilitation"
|
|
117151
|
-
}
|
|
117152
|
-
};
|
|
117153
117263
|
var surface = "registerOrigins";
|
|
117154
117264
|
var wellKnownResourceItem = zod_default.union([
|
|
117155
117265
|
zod_default.string(),
|
|
@@ -117592,7 +117702,7 @@ var import_path3 = require("path");
|
|
|
117592
117702
|
var import_url2 = require("url");
|
|
117593
117703
|
function getVersion3() {
|
|
117594
117704
|
if (true) {
|
|
117595
|
-
return "0.7.
|
|
117705
|
+
return "0.7.4";
|
|
117596
117706
|
}
|
|
117597
117707
|
const __dirname3 = (0, import_path3.dirname)((0, import_url2.fileURLToPath)(importMetaUrl));
|
|
117598
117708
|
const pkg = JSON.parse(
|
|
@@ -117603,22 +117713,6 @@ function getVersion3() {
|
|
|
117603
117713
|
var MCP_VERSION2 = getVersion3();
|
|
117604
117714
|
var DIST_TAG2 = MCP_VERSION2.includes("-beta") ? "beta" : "latest";
|
|
117605
117715
|
|
|
117606
|
-
// src/server/lib/instructions.ts
|
|
117607
|
-
init_cjs_shims();
|
|
117608
|
-
function buildServerInstructions() {
|
|
117609
|
-
return `Known API origins:
|
|
117610
|
-
- ${"https://stableenrich.dev" /* StableEnrich */} \u2014 People/org search, Google Maps, Grok twitter search, Exa web search, LinkedIn data, Firecrawl scrape, WhitePages, email enrichment, Hunter email verifier
|
|
117611
|
-
- ${"https://stablesocial.dev" /* StableSocial */} \u2014 Social media data (Twitter, Instagram, TikTok, YouTube, Facebook, Reddit)
|
|
117612
|
-
- ${"https://stablestudio.dev" /* StableStudio */} \u2014 Generate and edit images/videos
|
|
117613
|
-
- ${"https://stableupload.dev" /* StableUpload */} \u2014 Upload and share files
|
|
117614
|
-
- ${"https://stableemail.dev" /* StableEmail */} \u2014 Send emails
|
|
117615
|
-
|
|
117616
|
-
Workflow:
|
|
117617
|
-
1. Use discover_api_endpoints to find available endpoints on an origin.
|
|
117618
|
-
2. Use check_endpoint_schema to get the full input schema + pricing for an endpoint.
|
|
117619
|
-
3. Use fetch to make the request (handles payment automatically).`;
|
|
117620
|
-
}
|
|
117621
|
-
|
|
117622
117716
|
// src/shared/wallet.ts
|
|
117623
117717
|
init_cjs_shims();
|
|
117624
117718
|
var import_fs7 = require("fs");
|
|
@@ -117797,14 +117891,14 @@ var startServer = async (flags) => {
|
|
|
117797
117891
|
surface: "startServer"
|
|
117798
117892
|
});
|
|
117799
117893
|
}
|
|
117800
|
-
const instructions = buildServerInstructions();
|
|
117801
117894
|
const server = new McpServer(
|
|
117802
117895
|
{
|
|
117803
117896
|
name: "agentcash",
|
|
117897
|
+
title: "AgentCash",
|
|
117804
117898
|
version: MCP_VERSION2,
|
|
117805
117899
|
websiteUrl: "https://x402scan.com/mcp",
|
|
117806
117900
|
icons: [{ src: "https://x402scan.com/logo.svg" }],
|
|
117807
|
-
|
|
117901
|
+
description: DESCRIPTIONS.serverInstructions
|
|
117808
117902
|
},
|
|
117809
117903
|
{
|
|
117810
117904
|
capabilities: {
|
|
@@ -117815,7 +117909,8 @@ var startServer = async (flags) => {
|
|
|
117815
117909
|
prompts: {
|
|
117816
117910
|
listChanged: true
|
|
117817
117911
|
}
|
|
117818
|
-
}
|
|
117912
|
+
},
|
|
117913
|
+
instructions: DESCRIPTIONS.serverInstructions
|
|
117819
117914
|
}
|
|
117820
117915
|
);
|
|
117821
117916
|
const props = {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
REQUEST_PARAMS
|
|
3
|
+
} from "./chunk-RY34EBJ4.js";
|
|
1
4
|
import {
|
|
2
5
|
getTempoBalance
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NFKU5GQE.js";
|
|
4
7
|
import {
|
|
5
8
|
isMppEnabled
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OW3UV227.js";
|
|
7
10
|
import {
|
|
8
11
|
getBalance
|
|
9
12
|
} from "./chunk-YUCA2PQT.js";
|
|
@@ -22,11 +25,11 @@ import {
|
|
|
22
25
|
// src/server/tools/lib/request.ts
|
|
23
26
|
import z from "zod";
|
|
24
27
|
var requestSchema = z.object({
|
|
25
|
-
url: z.string().describe(
|
|
26
|
-
method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().describe(
|
|
27
|
-
body: z.unknown().optional().describe(
|
|
28
|
-
headers: z.record(z.string(), z.string()).optional().describe(
|
|
29
|
-
timeout: z.number().int().positive().optional().describe(
|
|
28
|
+
url: z.string().describe(REQUEST_PARAMS.url),
|
|
29
|
+
method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().describe(REQUEST_PARAMS.method),
|
|
30
|
+
body: z.unknown().optional().describe(REQUEST_PARAMS.body),
|
|
31
|
+
headers: z.record(z.string(), z.string()).optional().describe(REQUEST_PARAMS.headers).default({}),
|
|
32
|
+
timeout: z.number().int().positive().optional().describe(REQUEST_PARAMS.timeout)
|
|
30
33
|
});
|
|
31
34
|
var buildRequest = ({
|
|
32
35
|
input,
|
|
@@ -513,4 +516,4 @@ export {
|
|
|
513
516
|
getInputSchema,
|
|
514
517
|
createFetchWithAuth
|
|
515
518
|
};
|
|
516
|
-
//# sourceMappingURL=chunk-
|
|
519
|
+
//# sourceMappingURL=chunk-DBDSS3CQ.js.map
|