agentcash 0.14.0 → 0.14.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.
@@ -147202,7 +147202,7 @@ init_cjs_shims();
147202
147202
  // src/operations/check-endpoint.ts
147203
147203
  init_cjs_shims();
147204
147204
 
147205
- // ../../../node_modules/.pnpm/@agentcash+discovery@1.5.0/node_modules/@agentcash/discovery/dist/index.js
147205
+ // ../../../node_modules/.pnpm/@agentcash+discovery@1.6.2/node_modules/@agentcash/discovery/dist/index.js
147206
147206
  init_cjs_shims();
147207
147207
  var import_dereference_json_schema = __toESM(require_dereference_json_schema(), 1);
147208
147208
  var __defProp2 = Object.defineProperty;
@@ -160847,7 +160847,7 @@ var MppProtocolSchema = external_exports5.object({
160847
160847
  currency: external_exports5.string()
160848
160848
  })
160849
160849
  });
160850
- var PaymentProtocolSchema = external_exports5.union([MppProtocolSchema, X402ProtocolSchema]);
160850
+ var PaymentProtocolSchema = external_exports5.record(external_exports5.string(), external_exports5.unknown());
160851
160851
  var PaymentInfoSchema = external_exports5.object({
160852
160852
  price: PriceSchema,
160853
160853
  protocols: external_exports5.array(PaymentProtocolSchema)
@@ -161122,9 +161122,9 @@ function toAbsoluteUrl(origin2, value) {
161122
161122
  return null;
161123
161123
  }
161124
161124
  }
161125
- function toFetchError(err22) {
161126
- const cause = err22 instanceof DOMException && (err22.name === "TimeoutError" || err22.name === "AbortError") ? "timeout" : "network";
161127
- return { cause, message: String(err22) };
161125
+ function toFetchError(err3) {
161126
+ const cause = err3 instanceof DOMException && (err3.name === "TimeoutError" || err3.name === "AbortError") ? "timeout" : "network";
161127
+ return { cause, message: String(err3) };
161128
161128
  }
161129
161129
  function fetchSafe(url22, init) {
161130
161130
  return ResultAsync.fromPromise(fetch(url22, init), toFetchError);
@@ -161148,6 +161148,7 @@ function resolveProtocols(p) {
161148
161148
  }
161149
161149
  var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
161150
161150
  const routes = [];
161151
+ const serverBasePath = extractServerBasePath(doc.servers).unwrapOr("");
161151
161152
  for (const [rawPath, pathItem] of Object.entries(doc.paths)) {
161152
161153
  for (const httpMethod of [...HTTP_METHODS]) {
161153
161154
  const operation = pathItem[httpMethod.toLowerCase()];
@@ -161158,7 +161159,7 @@ var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
161158
161159
  const pricing = (authMode === "paid" || authMode === "apiKey+paid") && p ? resolvePricingHint(p) : void 0;
161159
161160
  const summary = operation.summary ?? operation.description;
161160
161161
  routes.push({
161161
- path: normalizePath(rawPath),
161162
+ path: normalizePath(serverBasePath + rawPath),
161162
161163
  method: httpMethod.toUpperCase(),
161163
161164
  ...summary ? { summary } : {},
161164
161165
  authMode,
@@ -161177,6 +161178,16 @@ var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
161177
161178
  ...resolveGuidance(doc.info) ? { guidance: resolveGuidance(doc.info) } : {}
161178
161179
  };
161179
161180
  });
161181
+ function extractServerBasePath(servers) {
161182
+ const serverUrl = servers?.[0]?.url;
161183
+ if (!serverUrl) return err("no_servers");
161184
+ try {
161185
+ const pathname = normalizePath(new URL(serverUrl).pathname);
161186
+ return ok(pathname === "/" ? "" : pathname);
161187
+ } catch {
161188
+ return err("malformed_url");
161189
+ }
161190
+ }
161180
161191
  function resolveGuidance(info) {
161181
161192
  if (info["x-guidance"]) return info["x-guidance"];
161182
161193
  if (info.guidance) return info.guidance;
@@ -162325,7 +162336,7 @@ var import_path2 = require("path");
162325
162336
  var import_url2 = require("url");
162326
162337
  function getVersion3() {
162327
162338
  if (true) {
162328
- return "0.14.0";
162339
+ return "0.14.1";
162329
162340
  }
162330
162341
  const __dirname2 = (0, import_path2.dirname)((0, import_url2.fileURLToPath)(importMetaUrl));
162331
162342
  const pkg2 = JSON.parse(
@@ -169849,7 +169860,7 @@ var import_path3 = require("path");
169849
169860
  var import_url5 = require("url");
169850
169861
  function getVersion4() {
169851
169862
  if (true) {
169852
- return "0.14.0";
169863
+ return "0.14.1";
169853
169864
  }
169854
169865
  const __dirname2 = (0, import_path3.dirname)((0, import_url5.fileURLToPath)(importMetaUrl));
169855
169866
  const pkg2 = JSON.parse(
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-27DZCYDB.js";
7
7
  import {
8
8
  INSTALL_PACKAGE_SPECIFIER
9
- } from "./chunk-XC5JT2NQ.js";
9
+ } from "./chunk-ICTY7IIE.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-7ZLVTQTS.js.map
631
+ //# sourceMappingURL=chunk-GZ5DKXKY.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.0";
7
+ return "0.14.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-XC5JT2NQ.js.map
26
+ //# sourceMappingURL=chunk-ICTY7IIE.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MCP_VERSION
3
- } from "./chunk-XC5JT2NQ.js";
3
+ } from "./chunk-ICTY7IIE.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-E52LAD7Z.js.map
54
+ //# sourceMappingURL=chunk-PAVGIVNI.js.map
package/dist/esm/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YIU364NZ.js";
8
8
  import {
9
9
  MCP_VERSION
10
- } from "./chunk-XC5JT2NQ.js";
10
+ } from "./chunk-ICTY7IIE.js";
11
11
  import {
12
12
  paymentNetworks,
13
13
  paymentProtocols,
@@ -273,7 +273,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
273
273
  description: "The invite code to redeem (optional)"
274
274
  }),
275
275
  async (args) => {
276
- const { onboardCommand } = await import("./onboard-5SZ6ZCM5.js");
276
+ const { onboardCommand } = await import("./onboard-HONVULXC.js");
277
277
  await onboardCommand({ ...args, code: args.code ?? args.invite });
278
278
  }
279
279
  ).command(
@@ -402,7 +402,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
402
402
  description: TOOL_PARAMS.reportError.fullReport
403
403
  }),
404
404
  async (args) => {
405
- const { reportErrorCommand } = await import("./report-error-V2J7LNUZ.js");
405
+ const { reportErrorCommand } = await import("./report-error-D44QKQHM.js");
406
406
  await reportErrorCommand(args);
407
407
  }
408
408
  ).command(
@@ -432,7 +432,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
432
432
  "Start the MCP server (default when no command specified)",
433
433
  (yargs2) => yargs2,
434
434
  async (args) => {
435
- const { serverCommand } = await import("./server-RHVPZZ4R.js");
435
+ const { serverCommand } = await import("./server-G7SXDQJD.js");
436
436
  await serverCommand(args);
437
437
  }
438
438
  ).command(
@@ -446,7 +446,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
446
446
  default: isClaudeCode ? "claude-code" /* ClaudeCode */ : void 0
447
447
  }),
448
448
  async (args) => {
449
- const { installMcpServer } = await import("./install-D2IVOSIS.js");
449
+ const { installMcpServer } = await import("./install-6W2Z2CWU.js");
450
450
  await installMcpServer(args);
451
451
  }
452
452
  ).command(
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BNFMFAEF.js";
4
4
  import {
5
5
  addServer
6
- } from "./chunk-7ZLVTQTS.js";
6
+ } from "./chunk-GZ5DKXKY.js";
7
7
  import {
8
8
  wait
9
9
  } from "./chunk-DZNSJ2BA.js";
@@ -14,7 +14,7 @@ import {
14
14
  Clients,
15
15
  clientMetadata
16
16
  } from "./chunk-27DZCYDB.js";
17
- import "./chunk-XC5JT2NQ.js";
17
+ import "./chunk-ICTY7IIE.js";
18
18
  import "./chunk-ISF2WVEZ.js";
19
19
  import {
20
20
  getBalance
@@ -176,4 +176,4 @@ var installMcpServer = async (args) => {
176
176
  export {
177
177
  installMcpServer
178
178
  };
179
- //# sourceMappingURL=install-D2IVOSIS.js.map
179
+ //# sourceMappingURL=install-6W2Z2CWU.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getPlatformPath,
3
3
  tryAddServer
4
- } from "./chunk-7ZLVTQTS.js";
4
+ } from "./chunk-GZ5DKXKY.js";
5
5
  import "./chunk-DZNSJ2BA.js";
6
6
  import {
7
7
  installGitHubSkill
@@ -13,7 +13,7 @@ import {
13
13
  redeemInviteCode
14
14
  } from "./chunk-MSNAPI5G.js";
15
15
  import "./chunk-27DZCYDB.js";
16
- import "./chunk-XC5JT2NQ.js";
16
+ import "./chunk-ICTY7IIE.js";
17
17
  import {
18
18
  getOnboardingCta,
19
19
  getWalletInfo
@@ -381,4 +381,4 @@ var onboardCommand = async (args) => {
381
381
  export {
382
382
  onboardCommand
383
383
  };
384
- //# sourceMappingURL=onboard-5SZ6ZCM5.js.map
384
+ //# sourceMappingURL=onboard-HONVULXC.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  submitErrorReport
3
- } from "./chunk-E52LAD7Z.js";
4
- import "./chunk-XC5JT2NQ.js";
3
+ } from "./chunk-PAVGIVNI.js";
4
+ import "./chunk-ICTY7IIE.js";
5
5
  import "./chunk-BFOYXXLG.js";
6
6
  import {
7
7
  getWalletOrExit
@@ -33,4 +33,4 @@ var reportErrorCommand = async (args) => {
33
33
  export {
34
34
  reportErrorCommand
35
35
  };
36
- //# sourceMappingURL=report-error-V2J7LNUZ.js.map
36
+ //# sourceMappingURL=report-error-D44QKQHM.js.map
@@ -5,10 +5,10 @@ var serverCommand = async (args) => {
5
5
  "MCP server started. If you meant to explore the CLI, run: npx agentcash --help\n"
6
6
  );
7
7
  }
8
- const { startServer } = await import("./server-ADTFQX5M.js");
8
+ const { startServer } = await import("./server-GZG3KSPG.js");
9
9
  await startServer(args);
10
10
  };
11
11
  export {
12
12
  serverCommand
13
13
  };
14
- //# sourceMappingURL=server-RHVPZZ4R.js.map
14
+ //# sourceMappingURL=server-G7SXDQJD.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MSNAPI5G.js";
4
4
  import {
5
5
  submitErrorReport
6
- } from "./chunk-E52LAD7Z.js";
6
+ } from "./chunk-PAVGIVNI.js";
7
7
  import {
8
8
  bridge,
9
9
  bridgeSchema
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  loadUserOrigins
13
13
  } from "./chunk-YIU364NZ.js";
14
- import "./chunk-XC5JT2NQ.js";
14
+ import "./chunk-ICTY7IIE.js";
15
15
  import {
16
16
  checkEndpoint
17
17
  } from "./chunk-5CMVFNXO.js";
@@ -676,7 +676,7 @@ import { dirname, join } from "path";
676
676
  import { fileURLToPath } from "url";
677
677
  function getVersion() {
678
678
  if (true) {
679
- return "0.14.0";
679
+ return "0.14.1";
680
680
  }
681
681
  const __dirname2 = dirname(fileURLToPath(import.meta.url));
682
682
  const pkg = JSON.parse(
@@ -742,4 +742,4 @@ var startServer = async (flags) => {
742
742
  export {
743
743
  startServer
744
744
  };
745
- //# sourceMappingURL=server-ADTFQX5M.js.map
745
+ //# sourceMappingURL=server-GZG3KSPG.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentcash",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "mcpName": "io.github.Merit-Systems/agentcash",
5
5
  "description": "Generic MCP server for calling x402-protected APIs with automatic payment handling",
6
6
  "type": "module",
@@ -13,7 +13,7 @@
13
13
  "dist"
14
14
  ],
15
15
  "dependencies": {
16
- "@agentcash/discovery": "1.5.0",
16
+ "@agentcash/discovery": "1.6.2",
17
17
  "@clack/prompts": "^0.11.0",
18
18
  "@iarna/toml": "^2.2.5",
19
19
  "@modelcontextprotocol/sdk": "^1.27.0",