agentcash 0.14.1 → 0.14.2

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.
Files changed (55) hide show
  1. package/dist/cjs/run-server.cjs +21 -11
  2. package/dist/esm/{add-skill-JHBOH5SG.js → add-skill-CDIK57A3.js} +4 -4
  3. package/dist/esm/{bridge-YU2PE54M.js → bridge-6WMUV3ML.js} +3 -3
  4. package/dist/esm/{check-ITXJS2Z6.js → check-D5DZ6Y3T.js} +4 -4
  5. package/dist/esm/{chunk-ICTY7IIE.js → chunk-3SEI5AS3.js} +2 -2
  6. package/dist/esm/{chunk-Y2J274RB.js → chunk-CFSSHSBN.js} +2 -2
  7. package/dist/esm/{chunk-Y4BYJBYU.js → chunk-FV6DADHO.js} +2 -2
  8. package/dist/esm/{chunk-6I5J7IHC.js → chunk-K627XZI4.js} +2 -2
  9. package/dist/esm/{chunk-JWU363NX.js → chunk-KMS4TVJY.js} +2 -2
  10. package/dist/esm/{chunk-V3HBA7NZ.js → chunk-KSW2MGQR.js} +12 -4
  11. package/dist/esm/chunk-KSW2MGQR.js.map +1 -0
  12. package/dist/esm/{chunk-GZ5DKXKY.js → chunk-RYEE6W2Y.js} +2 -2
  13. package/dist/esm/{chunk-XU3KTFR5.js → chunk-SCBLFGL2.js} +3 -3
  14. package/dist/esm/{chunk-CR2YGI3I.js → chunk-SFESERJN.js} +9 -4
  15. package/dist/esm/chunk-SFESERJN.js.map +1 -0
  16. package/dist/esm/{chunk-PAVGIVNI.js → chunk-VR7LHQKH.js} +2 -2
  17. package/dist/esm/{discover-654M2PZ3.js → discover-X557BWGS.js} +6 -4
  18. package/dist/esm/discover-X557BWGS.js.map +1 -0
  19. package/dist/esm/{fetch-GPYZNSPB.js → fetch-45YPD37H.js} +4 -4
  20. package/dist/esm/index.js +28 -18
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/{install-6W2Z2CWU.js → install-LTQYCDBA.js} +3 -3
  23. package/dist/esm/{onboard-HONVULXC.js → onboard-MAZZ4UDV.js} +3 -3
  24. package/dist/esm/{origins-JAC2K5A4.js → origins-XG6O5K27.js} +4 -4
  25. package/dist/esm/{report-error-D44QKQHM.js → report-error-UPPBICH6.js} +3 -3
  26. package/dist/esm/{search-WV2FO7OG.js → search-VYYPNNIU.js} +9 -4
  27. package/dist/esm/search-VYYPNNIU.js.map +1 -0
  28. package/dist/esm/{server-G7SXDQJD.js → server-T2RYRCCO.js} +2 -2
  29. package/dist/esm/{server-GZG3KSPG.js → server-Z6OTHKZR.js} +10 -13
  30. package/dist/esm/{server-GZG3KSPG.js.map → server-Z6OTHKZR.js.map} +1 -1
  31. package/dist/esm/{try-36SR5JEG.js → try-UYLQPTBJ.js} +6 -4
  32. package/dist/esm/try-UYLQPTBJ.js.map +1 -0
  33. package/package.json +2 -2
  34. package/dist/esm/chunk-CR2YGI3I.js.map +0 -1
  35. package/dist/esm/chunk-V3HBA7NZ.js.map +0 -1
  36. package/dist/esm/discover-654M2PZ3.js.map +0 -1
  37. package/dist/esm/search-WV2FO7OG.js.map +0 -1
  38. package/dist/esm/try-36SR5JEG.js.map +0 -1
  39. /package/dist/esm/{add-skill-JHBOH5SG.js.map → add-skill-CDIK57A3.js.map} +0 -0
  40. /package/dist/esm/{bridge-YU2PE54M.js.map → bridge-6WMUV3ML.js.map} +0 -0
  41. /package/dist/esm/{check-ITXJS2Z6.js.map → check-D5DZ6Y3T.js.map} +0 -0
  42. /package/dist/esm/{chunk-ICTY7IIE.js.map → chunk-3SEI5AS3.js.map} +0 -0
  43. /package/dist/esm/{chunk-Y2J274RB.js.map → chunk-CFSSHSBN.js.map} +0 -0
  44. /package/dist/esm/{chunk-Y4BYJBYU.js.map → chunk-FV6DADHO.js.map} +0 -0
  45. /package/dist/esm/{chunk-6I5J7IHC.js.map → chunk-K627XZI4.js.map} +0 -0
  46. /package/dist/esm/{chunk-JWU363NX.js.map → chunk-KMS4TVJY.js.map} +0 -0
  47. /package/dist/esm/{chunk-GZ5DKXKY.js.map → chunk-RYEE6W2Y.js.map} +0 -0
  48. /package/dist/esm/{chunk-XU3KTFR5.js.map → chunk-SCBLFGL2.js.map} +0 -0
  49. /package/dist/esm/{chunk-PAVGIVNI.js.map → chunk-VR7LHQKH.js.map} +0 -0
  50. /package/dist/esm/{fetch-GPYZNSPB.js.map → fetch-45YPD37H.js.map} +0 -0
  51. /package/dist/esm/{install-6W2Z2CWU.js.map → install-LTQYCDBA.js.map} +0 -0
  52. /package/dist/esm/{onboard-HONVULXC.js.map → onboard-MAZZ4UDV.js.map} +0 -0
  53. /package/dist/esm/{origins-JAC2K5A4.js.map → origins-XG6O5K27.js.map} +0 -0
  54. /package/dist/esm/{report-error-D44QKQHM.js.map → report-error-UPPBICH6.js.map} +0 -0
  55. /package/dist/esm/{server-G7SXDQJD.js.map → server-T2RYRCCO.js.map} +0 -0
@@ -146828,8 +146828,10 @@ ${PRIMARY_ORIGINS.flatMap((o3) => ORIGIN_METADATA[o3] ? [` ${o3} \u2014 ${ORIGI
146828
146828
  search: {
146829
146829
  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.
146830
146830
 
146831
- Only 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 \u2192 StableEnrich, image generation \u2192 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.`,
146832
- cli: `Search for paid API services by natural language query. Returns matching origins with endpoints and pricing. Use this to find APIs before calling discover or fetch.`
146831
+ Only 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 \u2192 StableEnrich, image generation \u2192 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.
146832
+
146833
+ Set 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.`,
146834
+ 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.`
146833
146835
  },
146834
146836
  reportError: {
146835
146837
  mcp: `EMERGENCY ONLY. Report critical MCP tool bugs. Do NOT use for normal errors (balance, network, 4xx) \u2014 those are recoverable.`,
@@ -146925,7 +146927,10 @@ var TOOL_PARAMS = {
146925
146927
  }
146926
146928
  },
146927
146929
  search: {
146928
- query: 'Natural language description of what you need (e.g. "send physical mail", "generate music", "flight prices")'
146930
+ query: 'Natural language description of what you need (e.g. "send physical mail", "generate music", "flight prices")',
146931
+ broad: "Include broader results that may contain newer, unvetted tools. Default is false.",
146932
+ limit: "Maximum number of results to return (1-50). Default is 10.",
146933
+ page: "Page number for pagination. Default is 1."
146929
146934
  },
146930
146935
  discoverApiEndpoints: {
146931
146936
  url: "The origin URL to discover endpoints on (e.g. https://stableenrich.dev)",
@@ -162336,7 +162341,7 @@ var import_path2 = require("path");
162336
162341
  var import_url2 = require("url");
162337
162342
  function getVersion3() {
162338
162343
  if (true) {
162339
- return "0.14.1";
162344
+ return "0.14.2";
162340
162345
  }
162341
162346
  const __dirname2 = (0, import_path2.dirname)((0, import_url2.fileURLToPath)(importMetaUrl));
162342
162347
  const pkg2 = JSON.parse(
@@ -162543,10 +162548,7 @@ async function fetchScanEndpoints(origin2, dev) {
162543
162548
  // src/server/tools/discover-resources.ts
162544
162549
  var toolName3 = "discover_api_endpoints";
162545
162550
  var OPENAPI_TRIED_PATHS = "/openapi.json, /.well-known/x402";
162546
- var registerDiscoveryTools = ({
162547
- server,
162548
- flags
162549
- }) => {
162551
+ var registerDiscoveryTools = ({ server, flags }) => {
162550
162552
  server.registerTool(
162551
162553
  toolName3,
162552
162554
  {
@@ -169741,7 +169743,10 @@ init_cjs_shims();
169741
169743
  init_cjs_shims();
169742
169744
  var AGENTCASH_SEARCH_URL = process.env.AGENTCASH_SEARCH_URL ?? "https://agentcash.dev/api/search";
169743
169745
  var searchSchema = zod_default.object({
169744
- query: zod_default.string().min(1).describe(TOOL_PARAMS.search.query)
169746
+ query: zod_default.string().min(1).describe(TOOL_PARAMS.search.query),
169747
+ broad: zod_default.boolean().optional().describe(TOOL_PARAMS.search.broad),
169748
+ limit: zod_default.number().int().min(1).max(50).optional().describe(TOOL_PARAMS.search.limit),
169749
+ page: zod_default.number().int().min(1).optional().describe(TOOL_PARAMS.search.page)
169745
169750
  });
169746
169751
  async function search(args, options) {
169747
169752
  const parsed = searchSchema.safeParse(args);
@@ -169759,7 +169764,12 @@ async function search(args, options) {
169759
169764
  url: AGENTCASH_SEARCH_URL,
169760
169765
  method: "POST" /* POST */,
169761
169766
  headers: { "Content-Type": "application/json" },
169762
- body: JSON.stringify({ query: parsed.data.query })
169767
+ body: JSON.stringify({
169768
+ query: parsed.data.query,
169769
+ ...parsed.data.broad ? { broad: true } : {},
169770
+ ...parsed.data.limit ? { limit: parsed.data.limit } : {},
169771
+ ...parsed.data.page ? { page: parsed.data.page } : {}
169772
+ })
169763
169773
  },
169764
169774
  {
169765
169775
  surface,
@@ -169860,7 +169870,7 @@ var import_path3 = require("path");
169860
169870
  var import_url5 = require("url");
169861
169871
  function getVersion4() {
169862
169872
  if (true) {
169863
- return "0.14.1";
169873
+ return "0.14.2";
169864
169874
  }
169865
169875
  const __dirname2 = (0, import_path3.dirname)((0, import_url5.fileURLToPath)(importMetaUrl));
169866
169876
  const pkg2 = JSON.parse(
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  resolveOrigin
3
- } from "./chunk-6I5J7IHC.js";
3
+ } from "./chunk-K627XZI4.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-Y2J274RB.js";
11
- import "./chunk-CR2YGI3I.js";
10
+ import "./chunk-CFSSHSBN.js";
11
+ import "./chunk-SFESERJN.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-JHBOH5SG.js.map
100
+ //# sourceMappingURL=add-skill-CDIK57A3.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  bridge,
3
3
  bridgeSchema
4
- } from "./chunk-Y4BYJBYU.js";
4
+ } from "./chunk-FV6DADHO.js";
5
5
  import {
6
6
  DESCRIPTIONS
7
- } from "./chunk-CR2YGI3I.js";
7
+ } from "./chunk-SFESERJN.js";
8
8
  import "./chunk-BFOYXXLG.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-YU2PE54M.js.map
57
+ //# sourceMappingURL=bridge-6WMUV3ML.js.map
@@ -3,9 +3,9 @@ import {
3
3
  } from "./chunk-5CMVFNXO.js";
4
4
  import {
5
5
  cliRequestSchema
6
- } from "./chunk-XU3KTFR5.js";
7
- import "./chunk-JWU363NX.js";
8
- import "./chunk-CR2YGI3I.js";
6
+ } from "./chunk-SCBLFGL2.js";
7
+ import "./chunk-KMS4TVJY.js";
8
+ import "./chunk-SFESERJN.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-ITXJS2Z6.js.map
72
+ //# sourceMappingURL=check-D5DZ6Y3T.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.14.1";
7
+ return "0.14.2";
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-ICTY7IIE.js.map
26
+ //# sourceMappingURL=chunk-3SEI5AS3.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TOOL_PARAMS
3
- } from "./chunk-CR2YGI3I.js";
3
+ } from "./chunk-SFESERJN.js";
4
4
  import {
5
5
  zodUrl
6
6
  } from "./chunk-FB5CMO3J.js";
@@ -106,4 +106,4 @@ export {
106
106
  discoverResourcesSchema,
107
107
  discoverResources
108
108
  };
109
- //# sourceMappingURL=chunk-Y2J274RB.js.map
109
+ //# sourceMappingURL=chunk-CFSSHSBN.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TOOL_PARAMS
3
- } from "./chunk-CR2YGI3I.js";
3
+ } from "./chunk-SFESERJN.js";
4
4
  import {
5
5
  safeFetchJson
6
6
  } from "./chunk-BFOYXXLG.js";
@@ -541,4 +541,4 @@ export {
541
541
  bridgeSchema,
542
542
  bridge
543
543
  };
544
- //# sourceMappingURL=chunk-Y4BYJBYU.js.map
544
+ //# sourceMappingURL=chunk-FV6DADHO.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  discoverResources
3
- } from "./chunk-Y2J274RB.js";
3
+ } from "./chunk-CFSSHSBN.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-6I5J7IHC.js.map
55
+ //# sourceMappingURL=chunk-K627XZI4.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  REQUEST_FETCH_PARAMS,
3
3
  REQUEST_PARAMS
4
- } from "./chunk-CR2YGI3I.js";
4
+ } from "./chunk-SFESERJN.js";
5
5
  import {
6
6
  RequestMethod
7
7
  } from "./chunk-LNJIXYCU.js";
@@ -40,4 +40,4 @@ export {
40
40
  paymentProtocols,
41
41
  fetchShape
42
42
  };
43
- //# sourceMappingURL=chunk-JWU363NX.js.map
43
+ //# sourceMappingURL=chunk-KMS4TVJY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TOOL_PARAMS
3
- } from "./chunk-CR2YGI3I.js";
3
+ } from "./chunk-SFESERJN.js";
4
4
  import {
5
5
  executeFetch
6
6
  } from "./chunk-G5FHPXQL.js";
@@ -15,7 +15,10 @@ import {
15
15
  import z from "zod";
16
16
  var AGENTCASH_SEARCH_URL = process.env.AGENTCASH_SEARCH_URL ?? "https://agentcash.dev/api/search";
17
17
  var searchSchema = z.object({
18
- query: z.string().min(1).describe(TOOL_PARAMS.search.query)
18
+ query: z.string().min(1).describe(TOOL_PARAMS.search.query),
19
+ broad: z.boolean().optional().describe(TOOL_PARAMS.search.broad),
20
+ limit: z.number().int().min(1).max(50).optional().describe(TOOL_PARAMS.search.limit),
21
+ page: z.number().int().min(1).optional().describe(TOOL_PARAMS.search.page)
19
22
  });
20
23
  async function search(args, options) {
21
24
  const parsed = searchSchema.safeParse(args);
@@ -33,7 +36,12 @@ async function search(args, options) {
33
36
  url: AGENTCASH_SEARCH_URL,
34
37
  method: "POST" /* POST */,
35
38
  headers: { "Content-Type": "application/json" },
36
- body: JSON.stringify({ query: parsed.data.query })
39
+ body: JSON.stringify({
40
+ query: parsed.data.query,
41
+ ...parsed.data.broad ? { broad: true } : {},
42
+ ...parsed.data.limit ? { limit: parsed.data.limit } : {},
43
+ ...parsed.data.page ? { page: parsed.data.page } : {}
44
+ })
37
45
  },
38
46
  {
39
47
  surface,
@@ -81,4 +89,4 @@ export {
81
89
  searchSchema,
82
90
  search
83
91
  };
84
- //# sourceMappingURL=chunk-V3HBA7NZ.js.map
92
+ //# sourceMappingURL=chunk-KSW2MGQR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/operations/search.ts"],"sourcesContent":["import z from 'zod';\n\nimport { log } from '@/shared/log';\nimport { executeFetch } from './fetch';\nimport { safeParseResponse } from '@/shared/neverthrow/fetch';\nimport { TOOL_PARAMS } from '@/shared/descriptions';\nimport { RequestMethod } from '@/shared/request/types';\n\nimport type { JsonStringifyValue } from '@/shared/neverthrow/json/types';\nimport type { Wallets } from '@/wallet';\nimport type { GlobalFlags } from '@/types';\n\nconst AGENTCASH_SEARCH_URL =\n process.env.AGENTCASH_SEARCH_URL ?? 'https://agentcash.dev/api/search';\n\nexport const searchSchema = z.object({\n query: z.string().min(1).describe(TOOL_PARAMS.search.query),\n broad: z.boolean().optional().describe(TOOL_PARAMS.search.broad),\n limit: z\n .number()\n .int()\n .min(1)\n .max(50)\n .optional()\n .describe(TOOL_PARAMS.search.limit),\n page: z.number().int().min(1).optional().describe(TOOL_PARAMS.search.page),\n});\n\nexport type SearchInput = z.input<typeof searchSchema>;\n\nexport interface SearchOptions {\n surface: string;\n wallets: Wallets;\n flags: GlobalFlags;\n}\n\nexport type SearchResult =\n | { success: true; results: JsonStringifyValue }\n | {\n success: false;\n cause: string;\n message: string;\n details?: JsonStringifyValue;\n };\n\n/**\n * Search for relevant paid API services by natural language query.\n * Calls the agentcash search API with SIWX auth via executeFetch.\n */\nexport async function search(\n args: SearchInput,\n options: SearchOptions\n): Promise<SearchResult> {\n const parsed = searchSchema.safeParse(args);\n if (!parsed.success) {\n return {\n success: false,\n cause: 'invalid_input',\n message: parsed.error.message,\n };\n }\n\n const { surface, wallets, flags } = options;\n\n log.info(`[search] Searching for: ${parsed.data.query}`);\n\n const fetchResult = await executeFetch(\n {\n url: AGENTCASH_SEARCH_URL,\n method: RequestMethod.POST,\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n query: parsed.data.query,\n ...(parsed.data.broad ? { broad: true } : {}),\n ...(parsed.data.limit ? { limit: parsed.data.limit } : {}),\n ...(parsed.data.page ? { page: parsed.data.page } : {}),\n }),\n },\n {\n surface,\n wallets,\n flags,\n params: {},\n }\n );\n\n if (fetchResult.isErr()) {\n return {\n success: false,\n cause: fetchResult.error.cause,\n message: fetchResult.error.message,\n };\n }\n\n const { response } = fetchResult.value;\n\n if (!response.ok) {\n const parseResult = await safeParseResponse(surface, response);\n return {\n success: false,\n cause: 'http',\n message: `Search API returned ${response.status}: ${response.statusText}`,\n details: parseResult.match(\n data =>\n data.type === 'json' || data.type === 'text'\n ? (data.data as JsonStringifyValue)\n : undefined,\n () => undefined\n ),\n };\n }\n\n const parseResult = await safeParseResponse(surface, response);\n\n if (parseResult.isErr()) {\n return {\n success: false,\n cause: parseResult.error.cause,\n message: parseResult.error.message,\n };\n }\n\n const parsedResponse = parseResult.value;\n\n return {\n success: true,\n results:\n parsedResponse.type === 'json' || parsedResponse.type === 'text'\n ? (parsedResponse.data as JsonStringifyValue)\n : { type: parsedResponse.type },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAO,OAAO;AAYd,IAAM,uBACJ,QAAQ,IAAI,wBAAwB;AAE/B,IAAM,eAAe,EAAE,OAAO;AAAA,EACnC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,YAAY,OAAO,KAAK;AAAA,EAC1D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,YAAY,OAAO,KAAK;AAAA,EAC/D,OAAO,EACJ,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,IAAI,EAAE,EACN,SAAS,EACT,SAAS,YAAY,OAAO,KAAK;AAAA,EACpC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,YAAY,OAAO,IAAI;AAC3E,CAAC;AAuBD,eAAsB,OACpB,MACA,SACuB;AACvB,QAAM,SAAS,aAAa,UAAU,IAAI;AAC1C,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,MACP,SAAS,OAAO,MAAM;AAAA,IACxB;AAAA,EACF;AAEA,QAAM,EAAE,SAAS,SAAS,MAAM,IAAI;AAEpC,MAAI,KAAK,2BAA2B,OAAO,KAAK,KAAK,E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,SAAO;AAAA,IACL,SAAS;AAAA,IACT,SACE,eAAe,SAAS,UAAU,eAAe,SAAS,SACrD,eAAe,OAChB,EAAE,MAAM,eAAe,KAAK;AAAA,EACpC;AACF;","names":["parseResult"]}
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-27DZCYDB.js";
7
7
  import {
8
8
  INSTALL_PACKAGE_SPECIFIER
9
- } from "./chunk-ICTY7IIE.js";
9
+ } from "./chunk-3SEI5AS3.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-GZ5DKXKY.js.map
631
+ //# sourceMappingURL=chunk-RYEE6W2Y.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  coreRequestSchema,
3
3
  fetchShape
4
- } from "./chunk-JWU363NX.js";
4
+ } from "./chunk-KMS4TVJY.js";
5
5
  import {
6
6
  REQUEST_PARAMS
7
- } from "./chunk-CR2YGI3I.js";
7
+ } from "./chunk-SFESERJN.js";
8
8
 
9
9
  // src/shared/request/schemas/cli.ts
10
10
  import z from "zod";
@@ -46,4 +46,4 @@ export {
46
46
  cliRequestSchema,
47
47
  cliFetchRequestSchema
48
48
  };
49
- //# sourceMappingURL=chunk-XU3KTFR5.js.map
49
+ //# sourceMappingURL=chunk-SCBLFGL2.js.map
@@ -117,8 +117,10 @@ ${PRIMARY_ORIGINS.flatMap((o) => ORIGIN_METADATA[o] ? [` ${o} \u2014 ${ORIGIN_M
117
117
  search: {
118
118
  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.
119
119
 
120
- Only 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 \u2192 StableEnrich, image generation \u2192 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.`,
121
- cli: `Search for paid API services by natural language query. Returns matching origins with endpoints and pricing. Use this to find APIs before calling discover or fetch.`
120
+ Only 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 \u2192 StableEnrich, image generation \u2192 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.
121
+
122
+ Set 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.`,
123
+ 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.`
122
124
  },
123
125
  reportError: {
124
126
  mcp: `EMERGENCY ONLY. Report critical MCP tool bugs. Do NOT use for normal errors (balance, network, 4xx) \u2014 those are recoverable.`,
@@ -214,7 +216,10 @@ var TOOL_PARAMS = {
214
216
  }
215
217
  },
216
218
  search: {
217
- query: 'Natural language description of what you need (e.g. "send physical mail", "generate music", "flight prices")'
219
+ query: 'Natural language description of what you need (e.g. "send physical mail", "generate music", "flight prices")',
220
+ broad: "Include broader results that may contain newer, unvetted tools. Default is false.",
221
+ limit: "Maximum number of results to return (1-50). Default is 10.",
222
+ page: "Page number for pagination. Default is 1."
218
223
  },
219
224
  discoverApiEndpoints: {
220
225
  url: "The origin URL to discover endpoints on (e.g. https://stableenrich.dev)",
@@ -243,4 +248,4 @@ export {
243
248
  REQUEST_FETCH_PARAMS,
244
249
  TOOL_PARAMS
245
250
  };
246
- //# sourceMappingURL=chunk-CR2YGI3I.js.map
251
+ //# sourceMappingURL=chunk-SFESERJN.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:\n 'Social media data for Twitter, Instagram, TikTok, YouTube, 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};\n\nexport const PRIMARY_ORIGINS = [\n Origin.StableEnrich,\n Origin.StableSocial,\n Origin.StableStudio,\n Origin.StableUpload,\n Origin.StableEmail,\n Origin.StableMerch,\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 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. 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} 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} 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 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,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,4CAAmB,GAAG;AAAA,IACpB,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,sCAAgB,GAAG;AAAA,IACjB,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,+BAAa,GAAG;AAAA,IACd,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA,0CAAkB,GAAG;AAAA,IACnB,OAAO;AAAA,IACP,aAAa;A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,IACJ,QAAQ;AAAA,EACV;AAAA,EACA,OAAO;AAAA,EACP,eAAe;AAAA,EACf,qBAAqB;AAAA,IACnB,GAAG;AAAA,IACH,QACE;AAAA,IACF,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,EACP;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,EACP;AAAA,EAEA,cAAc;AAAA,IACZ,QAAQ;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,SAAS;AAAA,MACT,aAAa;AAAA,MACb,aACE;AAAA,MACF,eACE;AAAA,MACF,0BAA0B;AAAA,MAC1B,0BAA0B;AAAA,MAC1B,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EAEA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,OACE;AAAA,IACF,OACE;AAAA,IACF,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EAEA,sBAAsB;AAAA,IACpB,KAAK;AAAA,IACL,iBACE;AAAA,EACJ;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,6 +1,6 @@
1
1
  import {
2
2
  MCP_VERSION
3
- } from "./chunk-ICTY7IIE.js";
3
+ } from "./chunk-3SEI5AS3.js";
4
4
  import {
5
5
  safeFetchJson
6
6
  } from "./chunk-BFOYXXLG.js";
@@ -51,4 +51,4 @@ async function submitErrorReport(surface, input, address, dev) {
51
51
  export {
52
52
  submitErrorReport
53
53
  };
54
- //# sourceMappingURL=chunk-PAVGIVNI.js.map
54
+ //# sourceMappingURL=chunk-VR7LHQKH.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  discoverResources
3
- } from "./chunk-Y2J274RB.js";
4
- import "./chunk-CR2YGI3I.js";
3
+ } from "./chunk-CFSSHSBN.js";
4
+ import "./chunk-SFESERJN.js";
5
5
  import "./chunk-FB5CMO3J.js";
6
6
  import "./chunk-U6FRXL3X.js";
7
7
  import {
@@ -16,7 +16,9 @@ import "./chunk-ITCDZXBZ.js";
16
16
 
17
17
  // src/cli/commands/discover.ts
18
18
  var discoverCommand = async (input) => {
19
- const result = await discoverResources("cli:discover", input, { flags: input });
19
+ const result = await discoverResources("cli:discover", input, {
20
+ flags: input
21
+ });
20
22
  if (result.found) {
21
23
  return outputAndExit(successResponse(result), input);
22
24
  }
@@ -35,4 +37,4 @@ var discoverCommand = async (input) => {
35
37
  export {
36
38
  discoverCommand
37
39
  };
38
- //# sourceMappingURL=discover-654M2PZ3.js.map
40
+ //# sourceMappingURL=discover-X557BWGS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/commands/discover.ts"],"sourcesContent":["import { successResponse, errorResponse, outputAndExit } from '@/cli/output';\n\nimport { discoverResources } from '@/operations/discover';\n\nimport type { Command } from '@/types';\nimport type { DiscoverResourcesInput } from '@/operations/discover';\n\nexport const discoverCommand: Command<DiscoverResourcesInput> = async input => {\n const result = await discoverResources('cli:discover', input, {\n flags: input,\n });\n\n if (result.found) {\n return outputAndExit(successResponse(result), input);\n }\n\n const origin = 'origin' in result ? result.origin : input.url;\n return outputAndExit(\n errorResponse({\n code: 'GENERAL_ERROR',\n message:\n result.message ??\n `No OpenAPI spec found for ${origin}. Tried: /openapi.json, /.well-known/x402`,\n surface: 'cli:discover',\n cause: result.cause,\n details: { origin },\n }),\n input\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAOO,IAAM,kBAAmD,OAAM,UAAS;AAC7E,QAAM,SAAS,MAAM,kBAAkB,gBAAgB,OAAO;AAAA,IAC5D,OAAO;AAAA,EACT,CAAC;AAED,MAAI,OAAO,OAAO;AAChB,WAAO,cAAc,gBAAgB,MAAM,GAAG,KAAK;AAAA,EACrD;AAEA,QAAM,SAAS,YAAY,SAAS,OAAO,SAAS,MAAM;AAC1D,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SACE,OAAO,WACP,6BAA6B,MAAM;AAAA,MACrC,SAAS;AAAA,MACT,OAAO,OAAO;AAAA,MACd,SAAS,EAAE,OAAO;AAAA,IACpB,CAAC;AAAA,IACD;AAAA,EACF;AACF;","names":[]}
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  cliFetchRequestSchema
3
- } from "./chunk-XU3KTFR5.js";
4
- import "./chunk-JWU363NX.js";
5
- import "./chunk-CR2YGI3I.js";
3
+ } from "./chunk-SCBLFGL2.js";
4
+ import "./chunk-KMS4TVJY.js";
5
+ import "./chunk-SFESERJN.js";
6
6
  import {
7
7
  executeFetch
8
8
  } from "./chunk-G5FHPXQL.js";
@@ -89,4 +89,4 @@ var fetchCommand = async (input) => {
89
89
  export {
90
90
  fetchCommand
91
91
  };
92
- //# sourceMappingURL=fetch-GPYZNSPB.js.map
92
+ //# sourceMappingURL=fetch-45YPD37H.js.map
package/dist/esm/index.js CHANGED
@@ -7,17 +7,17 @@ import {
7
7
  } from "./chunk-YIU364NZ.js";
8
8
  import {
9
9
  MCP_VERSION
10
- } from "./chunk-ICTY7IIE.js";
10
+ } from "./chunk-3SEI5AS3.js";
11
11
  import {
12
12
  paymentNetworks,
13
13
  paymentProtocols,
14
14
  requestMethodValues
15
- } from "./chunk-JWU363NX.js";
15
+ } from "./chunk-KMS4TVJY.js";
16
16
  import {
17
17
  DESCRIPTIONS,
18
18
  TOOL_PARAMS,
19
19
  buildServerInstructions
20
- } from "./chunk-CR2YGI3I.js";
20
+ } from "./chunk-SFESERJN.js";
21
21
  import "./chunk-LNJIXYCU.js";
22
22
  import "./chunk-NPJV7AMV.js";
23
23
  import "./chunk-KVSTJRSJ.js";
@@ -117,7 +117,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
117
117
  DESCRIPTIONS.fetch.epilogue
118
118
  ),
119
119
  async (args) => {
120
- const { fetchCommand } = await import("./fetch-GPYZNSPB.js");
120
+ const { fetchCommand } = await import("./fetch-45YPD37H.js");
121
121
  await fetchCommand(args);
122
122
  }
123
123
  ).command(
@@ -129,7 +129,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
129
129
  DESCRIPTIONS.fetchWithAuth.epilogue
130
130
  ),
131
131
  async (args) => {
132
- const { fetchCommand } = await import("./fetch-GPYZNSPB.js");
132
+ const { fetchCommand } = await import("./fetch-45YPD37H.js");
133
133
  await fetchCommand(args);
134
134
  }
135
135
  ).command(
@@ -155,7 +155,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
155
155
  description: TOOL_PARAMS.checkEndpointSchema.headers
156
156
  }).epilogue(DESCRIPTIONS.checkEndpointSchema.epilogue),
157
157
  async (args) => {
158
- const { checkCommand } = await import("./check-ITXJS2Z6.js");
158
+ const { checkCommand } = await import("./check-D5DZ6Y3T.js");
159
159
  await checkCommand({
160
160
  ...args,
161
161
  url: args.url,
@@ -173,7 +173,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
173
173
  demandOption: true
174
174
  }),
175
175
  async (args) => {
176
- const { tryCommand } = await import("./try-36SR5JEG.js");
176
+ const { tryCommand } = await import("./try-UYLQPTBJ.js");
177
177
  await tryCommand(args);
178
178
  }
179
179
  ).command(
@@ -183,9 +183,19 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
183
183
  type: "string",
184
184
  description: TOOL_PARAMS.search.query,
185
185
  demandOption: true
186
+ }).option("broad", {
187
+ type: "boolean",
188
+ description: TOOL_PARAMS.search.broad,
189
+ default: false
190
+ }).option("limit", {
191
+ type: "number",
192
+ description: TOOL_PARAMS.search.limit
193
+ }).option("page", {
194
+ type: "number",
195
+ description: TOOL_PARAMS.search.page
186
196
  }),
187
197
  async (args) => {
188
- const { searchCommand } = await import("./search-WV2FO7OG.js");
198
+ const { searchCommand } = await import("./search-VYYPNNIU.js");
189
199
  await searchCommand(args);
190
200
  }
191
201
  ).command(
@@ -200,7 +210,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
200
210
  description: TOOL_PARAMS.discoverApiEndpoints.includeGuidance
201
211
  }).epilogue(DESCRIPTIONS.discoverApiEndpoints.epilogue),
202
212
  async (args) => {
203
- const { discoverCommand } = await import("./discover-654M2PZ3.js");
213
+ const { discoverCommand } = await import("./discover-X557BWGS.js");
204
214
  await discoverCommand(args);
205
215
  }
206
216
  ).command(
@@ -224,7 +234,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
224
234
  demandOption: true
225
235
  }),
226
236
  async (args) => {
227
- const { addSkillCommand } = await import("./add-skill-JHBOH5SG.js");
237
+ const { addSkillCommand } = await import("./add-skill-CDIK57A3.js");
228
238
  await addSkillCommand(args);
229
239
  }
230
240
  ).command(
@@ -239,7 +249,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
239
249
  demandOption: true
240
250
  }),
241
251
  async (args) => {
242
- const { originsAddCommand } = await import("./origins-JAC2K5A4.js");
252
+ const { originsAddCommand } = await import("./origins-XG6O5K27.js");
243
253
  await originsAddCommand(args);
244
254
  }
245
255
  ).command(
@@ -247,7 +257,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
247
257
  "List all registered origins",
248
258
  (yargs3) => yargs3,
249
259
  async (args) => {
250
- const { originsListCommand } = await import("./origins-JAC2K5A4.js");
260
+ const { originsListCommand } = await import("./origins-XG6O5K27.js");
251
261
  await originsListCommand(args);
252
262
  }
253
263
  ).command(
@@ -259,7 +269,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
259
269
  demandOption: true
260
270
  }),
261
271
  async (args) => {
262
- const { originsRemoveCommand } = await import("./origins-JAC2K5A4.js");
272
+ const { originsRemoveCommand } = await import("./origins-XG6O5K27.js");
263
273
  await originsRemoveCommand(args);
264
274
  }
265
275
  ).demandCommand(1, "You must specify an origins subcommand").strict(),
@@ -273,7 +283,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
273
283
  description: "The invite code to redeem (optional)"
274
284
  }),
275
285
  async (args) => {
276
- const { onboardCommand } = await import("./onboard-HONVULXC.js");
286
+ const { onboardCommand } = await import("./onboard-MAZZ4UDV.js");
277
287
  await onboardCommand({ ...args, code: args.code ?? args.invite });
278
288
  }
279
289
  ).command(
@@ -402,7 +412,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
402
412
  description: TOOL_PARAMS.reportError.fullReport
403
413
  }),
404
414
  async (args) => {
405
- const { reportErrorCommand } = await import("./report-error-D44QKQHM.js");
415
+ const { reportErrorCommand } = await import("./report-error-UPPBICH6.js");
406
416
  await reportErrorCommand(args);
407
417
  }
408
418
  ).command(
@@ -424,7 +434,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
424
434
  required: true
425
435
  }),
426
436
  async (args) => {
427
- const { bridgeCommand } = await import("./bridge-YU2PE54M.js");
437
+ const { bridgeCommand } = await import("./bridge-6WMUV3ML.js");
428
438
  await bridgeCommand(args);
429
439
  }
430
440
  ).command(
@@ -432,7 +442,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
432
442
  "Start the MCP server (default when no command specified)",
433
443
  (yargs2) => yargs2,
434
444
  async (args) => {
435
- const { serverCommand } = await import("./server-G7SXDQJD.js");
445
+ const { serverCommand } = await import("./server-T2RYRCCO.js");
436
446
  await serverCommand(args);
437
447
  }
438
448
  ).command(
@@ -446,7 +456,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
446
456
  default: isClaudeCode ? "claude-code" /* ClaudeCode */ : void 0
447
457
  }),
448
458
  async (args) => {
449
- const { installMcpServer } = await import("./install-6W2Z2CWU.js");
459
+ const { installMcpServer } = await import("./install-LTQYCDBA.js");
450
460
  await installMcpServer(args);
451
461
  }
452
462
  ).command(