agentcash 0.14.2 → 0.14.3

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.
@@ -147207,7 +147207,7 @@ init_cjs_shims();
147207
147207
  // src/operations/check-endpoint.ts
147208
147208
  init_cjs_shims();
147209
147209
 
147210
- // ../../../node_modules/.pnpm/@agentcash+discovery@1.6.2/node_modules/@agentcash/discovery/dist/index.js
147210
+ // ../../../node_modules/.pnpm/@agentcash+discovery@1.6.3/node_modules/@agentcash/discovery/dist/index.js
147211
147211
  init_cjs_shims();
147212
147212
  var import_dereference_json_schema = __toESM(require_dereference_json_schema(), 1);
147213
147213
  var __defProp2 = Object.defineProperty;
@@ -160838,8 +160838,8 @@ var FixedPriceSchema = external_exports5.object({
160838
160838
  var DynamicPriceSchema = external_exports5.object({
160839
160839
  currency: Iso4217Schema,
160840
160840
  mode: external_exports5.literal("dynamic"),
160841
- min: external_exports5.string(),
160842
- max: external_exports5.string()
160841
+ min: external_exports5.string().optional(),
160842
+ max: external_exports5.string().optional()
160843
160843
  });
160844
160844
  var PriceSchema = external_exports5.union([FixedPriceSchema, DynamicPriceSchema]);
160845
160845
  var X402ProtocolSchema = external_exports5.object({
@@ -160938,7 +160938,12 @@ function normalizeLegacy(raw) {
160938
160938
  function formatPrice(price) {
160939
160939
  const sym = price.currency ?? "USD";
160940
160940
  if (price.mode === "fixed") return `${price.amount} ${sym}`;
160941
- return `${price.min}-${price.max} ${sym}`;
160941
+ if (price.min !== void 0 && price.max !== void 0) {
160942
+ return `${price.min}-${price.max} ${sym}`;
160943
+ }
160944
+ if (price.min !== void 0) return `>=${price.min} ${sym}`;
160945
+ if (price.max !== void 0) return `<=${price.max} ${sym}`;
160946
+ return `dynamic ${sym}`;
160942
160947
  }
160943
160948
  function extractProtocolNames(protocols) {
160944
160949
  return protocols.map((p) => {
@@ -160988,10 +160993,13 @@ var OpenApiOperationSchema = external_exports5.object({
160988
160993
  description: external_exports5.string().optional(),
160989
160994
  tags: external_exports5.array(external_exports5.string()).optional(),
160990
160995
  security: external_exports5.array(external_exports5.record(external_exports5.string(), external_exports5.array(external_exports5.string()))).optional(),
160996
+ // `in` / `name` are spec-required, but a single malformed parameter must not
160997
+ // abort the whole spec — keep them optional so discovery is resilient to
160998
+ // non-conformant OpenAPI documents in the wild.
160991
160999
  parameters: external_exports5.array(
160992
161000
  external_exports5.object({
160993
- in: external_exports5.string(),
160994
- name: external_exports5.string(),
161001
+ in: external_exports5.string().optional(),
161002
+ name: external_exports5.string().optional(),
160995
161003
  schema: external_exports5.unknown().optional(),
160996
161004
  required: external_exports5.boolean().optional()
160997
161005
  })
@@ -161001,7 +161009,8 @@ var OpenApiOperationSchema = external_exports5.object({
161001
161009
  content: external_exports5.record(external_exports5.string(), external_exports5.object({ schema: external_exports5.unknown().optional() }))
161002
161010
  }).optional(),
161003
161011
  responses: external_exports5.record(external_exports5.string(), external_exports5.unknown()).optional(),
161004
- "x-payment-info": OpenApiPaymentInfoSchema.optional()
161012
+ // Permissive: vendor extension shape is validated at runtime, never at parse time.
161013
+ "x-payment-info": external_exports5.unknown().optional()
161005
161014
  });
161006
161015
  var OpenApiPathItemSchema = external_exports5.object({
161007
161016
  get: OpenApiOperationSchema.optional(),
@@ -161134,20 +161143,27 @@ function toFetchError(err3) {
161134
161143
  function fetchSafe(url22, init) {
161135
161144
  return ResultAsync.fromPromise(fetch(url22, init), toFetchError);
161136
161145
  }
161137
- function resolvePricingHint(p) {
161138
- const raw = p;
161139
- const info = resolvePaymentInfo(raw);
161146
+ function toRecord(raw) {
161147
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return void 0;
161148
+ return raw;
161149
+ }
161150
+ function resolvePricingHint(raw) {
161151
+ const record22 = toRecord(raw);
161152
+ if (!record22) return void 0;
161153
+ const info = resolvePaymentInfo(record22);
161140
161154
  if (!info) return void 0;
161141
161155
  return {
161142
161156
  pricingMode: info.price.mode,
161143
161157
  ...info.price.mode === "fixed" ? { price: info.price.amount } : {},
161144
- ...info.price.mode === "dynamic" ? { minPrice: info.price.min, maxPrice: info.price.max } : {},
161158
+ ...info.price.mode === "dynamic" && info.price.min !== void 0 ? { minPrice: info.price.min } : {},
161159
+ ...info.price.mode === "dynamic" && info.price.max !== void 0 ? { maxPrice: info.price.max } : {},
161145
161160
  ...info.price.currency ? { currency: info.price.currency } : {}
161146
161161
  };
161147
161162
  }
161148
- function resolveProtocols(p) {
161149
- const raw = p;
161150
- const info = resolvePaymentInfo(raw);
161163
+ function resolveProtocols(raw) {
161164
+ const record22 = toRecord(raw);
161165
+ if (!record22) return [];
161166
+ const info = resolvePaymentInfo(record22);
161151
161167
  if (!info) return [];
161152
161168
  return extractProtocolNames(info.protocols);
161153
161169
  }
@@ -161160,8 +161176,8 @@ var OpenApiParsedSchema = OpenApiDocSchema.transform((doc) => {
161160
161176
  if (!operation) continue;
161161
161177
  const authMode = inferAuthMode(operation, doc.security, doc.components?.securitySchemes) ?? void 0;
161162
161178
  const p = operation["x-payment-info"];
161163
- const protocols = resolveProtocols(p ?? {});
161164
- const pricing = (authMode === "paid" || authMode === "apiKey+paid") && p ? resolvePricingHint(p) : void 0;
161179
+ const protocols = resolveProtocols(p);
161180
+ const pricing = (authMode === "paid" || authMode === "apiKey+paid") && p !== void 0 ? resolvePricingHint(p) : void 0;
161165
161181
  const summary = operation.summary ?? operation.description;
161166
161182
  routes.push({
161167
161183
  path: normalizePath(serverBasePath + rawPath),
@@ -161389,28 +161405,29 @@ function getWellKnown(origin2, headers, signal) {
161389
161405
  }
161390
161406
  function formatPrice2(pricing) {
161391
161407
  const sym = pricing.currency ?? "USD";
161392
- if (pricing.pricingMode === "fixed") return `${pricing.price} ${sym}`;
161408
+ if (pricing.pricingMode === "fixed" && pricing.price) return `${pricing.price} ${sym}`;
161393
161409
  if (pricing.pricingMode === "dynamic") {
161394
161410
  if (pricing.minPrice && pricing.maxPrice)
161395
161411
  return `${pricing.minPrice}-${pricing.maxPrice} ${sym}`;
161396
161412
  if (pricing.maxPrice) return `up to ${pricing.maxPrice} ${sym}`;
161397
- return "dynamic";
161413
+ if (pricing.minPrice) return `from ${pricing.minPrice} ${sym}`;
161398
161414
  }
161399
- return `unknown pricing mode: ${pricing.pricingMode}`;
161415
+ return void 0;
161400
161416
  }
161401
161417
  function checkL2ForOpenAPI(openApi) {
161402
- const routes = openApi.routes.map((route) => ({
161403
- path: route.path,
161404
- method: route.method,
161405
- summary: route.summary ?? `${route.method} ${route.path}`,
161406
- ...route.authMode ? { authMode: route.authMode } : {},
161407
- ...route.pricing ? {
161408
- price: formatPrice2(route.pricing),
161409
- pricingMode: route.pricing.pricingMode,
161410
- ...route.pricing.currency ? { currency: route.pricing.currency } : {}
161411
- } : {},
161412
- ...route.protocols?.length ? { protocols: route.protocols } : {}
161413
- }));
161418
+ const routes = openApi.routes.map((route) => {
161419
+ const priceHint = route.pricing ? formatPrice2(route.pricing) : void 0;
161420
+ return {
161421
+ path: route.path,
161422
+ method: route.method,
161423
+ summary: route.summary ?? `${route.method} ${route.path}`,
161424
+ ...route.authMode ? { authMode: route.authMode } : {},
161425
+ ...priceHint ? { price: priceHint } : {},
161426
+ ...route.pricing?.pricingMode ? { pricingMode: route.pricing.pricingMode } : {},
161427
+ ...route.pricing?.currency ? { currency: route.pricing.currency } : {},
161428
+ ...route.protocols?.length ? { protocols: route.protocols } : {}
161429
+ };
161430
+ });
161414
161431
  return {
161415
161432
  ...openApi.info.title ? { title: openApi.info.title } : {},
161416
161433
  ...openApi.info.description ? { description: openApi.info.description } : {},
@@ -162341,7 +162358,7 @@ var import_path2 = require("path");
162341
162358
  var import_url2 = require("url");
162342
162359
  function getVersion3() {
162343
162360
  if (true) {
162344
- return "0.14.2";
162361
+ return "0.14.3";
162345
162362
  }
162346
162363
  const __dirname2 = (0, import_path2.dirname)((0, import_url2.fileURLToPath)(importMetaUrl));
162347
162364
  const pkg2 = JSON.parse(
@@ -169870,7 +169887,7 @@ var import_path3 = require("path");
169870
169887
  var import_url5 = require("url");
169871
169888
  function getVersion4() {
169872
169889
  if (true) {
169873
- return "0.14.2";
169890
+ return "0.14.3";
169874
169891
  }
169875
169892
  const __dirname2 = (0, import_path3.dirname)((0, import_url5.fileURLToPath)(importMetaUrl));
169876
169893
  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-3SEI5AS3.js";
9
+ } from "./chunk-NP7CKLI4.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-RYEE6W2Y.js.map
631
+ //# sourceMappingURL=chunk-IL2CNAJY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MCP_VERSION
3
- } from "./chunk-3SEI5AS3.js";
3
+ } from "./chunk-NP7CKLI4.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-VR7LHQKH.js.map
54
+ //# sourceMappingURL=chunk-LGFUHPDL.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.2";
7
+ return "0.14.3";
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-3SEI5AS3.js.map
26
+ //# sourceMappingURL=chunk-NP7CKLI4.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-3SEI5AS3.js";
10
+ } from "./chunk-NP7CKLI4.js";
11
11
  import {
12
12
  paymentNetworks,
13
13
  paymentProtocols,
@@ -283,7 +283,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
283
283
  description: "The invite code to redeem (optional)"
284
284
  }),
285
285
  async (args) => {
286
- const { onboardCommand } = await import("./onboard-MAZZ4UDV.js");
286
+ const { onboardCommand } = await import("./onboard-M5C6TFWE.js");
287
287
  await onboardCommand({ ...args, code: args.code ?? args.invite });
288
288
  }
289
289
  ).command(
@@ -412,7 +412,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
412
412
  description: TOOL_PARAMS.reportError.fullReport
413
413
  }),
414
414
  async (args) => {
415
- const { reportErrorCommand } = await import("./report-error-UPPBICH6.js");
415
+ const { reportErrorCommand } = await import("./report-error-FDDNOZAD.js");
416
416
  await reportErrorCommand(args);
417
417
  }
418
418
  ).command(
@@ -442,7 +442,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
442
442
  "Start the MCP server (default when no command specified)",
443
443
  (yargs2) => yargs2,
444
444
  async (args) => {
445
- const { serverCommand } = await import("./server-T2RYRCCO.js");
445
+ const { serverCommand } = await import("./server-Q4W2J7OE.js");
446
446
  await serverCommand(args);
447
447
  }
448
448
  ).command(
@@ -456,7 +456,7 @@ void yargs(hideBin(process.argv)).scriptName("agentcash").usage("$0 [command] [o
456
456
  default: isClaudeCode ? "claude-code" /* ClaudeCode */ : void 0
457
457
  }),
458
458
  async (args) => {
459
- const { installMcpServer } = await import("./install-LTQYCDBA.js");
459
+ const { installMcpServer } = await import("./install-KJOAEIZF.js");
460
460
  await installMcpServer(args);
461
461
  }
462
462
  ).command(
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BNFMFAEF.js";
4
4
  import {
5
5
  addServer
6
- } from "./chunk-RYEE6W2Y.js";
6
+ } from "./chunk-IL2CNAJY.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-3SEI5AS3.js";
17
+ import "./chunk-NP7CKLI4.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-LTQYCDBA.js.map
179
+ //# sourceMappingURL=install-KJOAEIZF.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getPlatformPath,
3
3
  tryAddServer
4
- } from "./chunk-RYEE6W2Y.js";
4
+ } from "./chunk-IL2CNAJY.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-3SEI5AS3.js";
16
+ import "./chunk-NP7CKLI4.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-MAZZ4UDV.js.map
384
+ //# sourceMappingURL=onboard-M5C6TFWE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  submitErrorReport
3
- } from "./chunk-VR7LHQKH.js";
4
- import "./chunk-3SEI5AS3.js";
3
+ } from "./chunk-LGFUHPDL.js";
4
+ import "./chunk-NP7CKLI4.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-UPPBICH6.js.map
36
+ //# sourceMappingURL=report-error-FDDNOZAD.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MSNAPI5G.js";
4
4
  import {
5
5
  submitErrorReport
6
- } from "./chunk-VR7LHQKH.js";
6
+ } from "./chunk-LGFUHPDL.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-3SEI5AS3.js";
14
+ import "./chunk-NP7CKLI4.js";
15
15
  import {
16
16
  checkEndpoint
17
17
  } from "./chunk-5CMVFNXO.js";
@@ -673,7 +673,7 @@ import { dirname, join } from "path";
673
673
  import { fileURLToPath } from "url";
674
674
  function getVersion() {
675
675
  if (true) {
676
- return "0.14.2";
676
+ return "0.14.3";
677
677
  }
678
678
  const __dirname2 = dirname(fileURLToPath(import.meta.url));
679
679
  const pkg = JSON.parse(
@@ -739,4 +739,4 @@ var startServer = async (flags) => {
739
739
  export {
740
740
  startServer
741
741
  };
742
- //# sourceMappingURL=server-Z6OTHKZR.js.map
742
+ //# sourceMappingURL=server-6FQ4UZMS.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-Z6OTHKZR.js");
8
+ const { startServer } = await import("./server-6FQ4UZMS.js");
9
9
  await startServer(args);
10
10
  };
11
11
  export {
12
12
  serverCommand
13
13
  };
14
- //# sourceMappingURL=server-T2RYRCCO.js.map
14
+ //# sourceMappingURL=server-Q4W2J7OE.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentcash",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
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.6.2",
16
+ "@agentcash/discovery": "1.6.3",
17
17
  "@clack/prompts": "^0.11.0",
18
18
  "@iarna/toml": "^2.2.5",
19
19
  "@modelcontextprotocol/sdk": "^1.27.0",
@@ -47,11 +47,11 @@
47
47
  "tsx": "^4.21.0",
48
48
  "typescript": "^5.9.3",
49
49
  "vitest": "^4.0.18",
50
- "@agentcash/balance": "0.0.3",
51
50
  "@agentcash/bridge": "0.0.2",
51
+ "@agentcash/balance": "0.0.3",
52
52
  "@agentcash/eslint-config": "0.0.1",
53
- "@agentcash/neverthrow": "1.0.1",
54
53
  "@agentcash/networks": "0.0.3",
54
+ "@agentcash/neverthrow": "1.0.1",
55
55
  "@agentcash/typescript-config": "0.0.1"
56
56
  },
57
57
  "engines": {