chain-insights 0.2.16 → 0.2.18

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 (130) hide show
  1. package/README.md +29 -18
  2. package/dist/{active-Dv7Tu-O4.cjs → active-BVr55kvW.cjs} +1 -1
  3. package/dist/{active-BSrxLKwn.mjs → active-ByNgjuAg.mjs} +2 -2
  4. package/dist/{active-BSrxLKwn.mjs.map → active-ByNgjuAg.mjs.map} +1 -1
  5. package/dist/{app-BjjuQM0B.mjs → app-DdWQF_zb.mjs} +4 -4
  6. package/dist/{app-BjjuQM0B.mjs.map → app-DdWQF_zb.mjs.map} +1 -1
  7. package/dist/{app-Dq1TdB6p.cjs → app-DxlQE_P5.cjs} +4 -4
  8. package/dist/{artifact-server-Dxz5YbuQ.mjs → artifact-server-4DiMvwhC.mjs} +2 -2
  9. package/dist/{artifact-server-Dxz5YbuQ.mjs.map → artifact-server-4DiMvwhC.mjs.map} +1 -1
  10. package/dist/{artifact-server-DoxJ7fCx.cjs → artifact-server-B-3ho4bk.cjs} +1 -2
  11. package/dist/{call-args-Lk_wOJxd.mjs → call-args-DPXdX3_D.mjs} +1 -1
  12. package/dist/{call-args-Lk_wOJxd.mjs.map → call-args-DPXdX3_D.mjs.map} +1 -1
  13. package/dist/{capabilities-DliMBim-.mjs → capabilities-BShqspb-.mjs} +2 -2
  14. package/dist/{capabilities-DliMBim-.mjs.map → capabilities-BShqspb-.mjs.map} +1 -1
  15. package/dist/{capabilities-CB97WMA5.cjs → capabilities-Bm0JDbV7.cjs} +1 -1
  16. package/dist/cases-c0iV-XLI.cjs +9 -0
  17. package/dist/cases-qjPtbnUd.mjs +6 -0
  18. package/dist/cli.cjs +64 -64
  19. package/dist/cli.mjs +63 -63
  20. package/dist/cli.mjs.map +1 -1
  21. package/dist/{client-D4Bq0rp9.mjs → client-D4_hd4AP.mjs} +23 -9
  22. package/dist/client-D4_hd4AP.mjs.map +1 -0
  23. package/dist/{client-D4fZgIaO.cjs → client-DPc2eyVN.cjs} +27 -7
  24. package/dist/{config-BwrBYmiC.mjs → config-9KYXaAv-.mjs} +3 -3
  25. package/dist/{config-BwrBYmiC.mjs.map → config-9KYXaAv-.mjs.map} +1 -1
  26. package/dist/{config-Bmdl5hdk.cjs → config-BhYbhLDI.cjs} +2 -2
  27. package/dist/{dossier-BsroDgD3.mjs → dossier-Bl0NkJKC.mjs} +3 -3
  28. package/dist/{dossier-BsroDgD3.mjs.map → dossier-Bl0NkJKC.mjs.map} +1 -1
  29. package/dist/{dossier-DtxREpPm.cjs → dossier-Br62hCG7.cjs} +3 -3
  30. package/dist/{evidence-BGcdKxuV.cjs → evidence-CvEesemA.cjs} +3 -3
  31. package/dist/{evidence-BhvFW-y_.mjs → evidence-D96PTzOQ.mjs} +3 -3
  32. package/dist/{evidence-BhvFW-y_.mjs.map → evidence-D96PTzOQ.mjs.map} +1 -1
  33. package/dist/{format-Ce1RObVl.mjs → format-Bq94jSyw.mjs} +1 -1
  34. package/dist/{format-Ce1RObVl.mjs.map → format-Bq94jSyw.mjs.map} +1 -1
  35. package/dist/{frontmatter-D8wWCeOa.mjs → frontmatter-D0ccQnUM.mjs} +1 -1
  36. package/dist/{frontmatter-D8wWCeOa.mjs.map → frontmatter-D0ccQnUM.mjs.map} +1 -1
  37. package/dist/{graph-normalizer-Cv9yK9Pg.mjs → graph-normalizer-CXP06jKh.mjs} +1 -1
  38. package/dist/{graph-normalizer-Cv9yK9Pg.mjs.map → graph-normalizer-CXP06jKh.mjs.map} +1 -1
  39. package/dist/{graph-reports-DU05YCei.cjs → graph-reports-B3mkLP8Z.cjs} +3 -3
  40. package/dist/{graph-reports-C4TBjCkM.mjs → graph-reports-BDELxmpi.mjs} +3 -3
  41. package/dist/{graph-reports-C4TBjCkM.mjs.map → graph-reports-BDELxmpi.mjs.map} +1 -1
  42. package/dist/{html-generator-V6Bp0uRb.mjs → html-generator-AowOmzyi.mjs} +2 -2
  43. package/dist/{html-generator-V6Bp0uRb.mjs.map → html-generator-AowOmzyi.mjs.map} +1 -1
  44. package/dist/{html-generator-CAv81IWH.cjs → html-generator-Bx3UcLTB.cjs} +1 -1
  45. package/dist/index.cjs +8 -8
  46. package/dist/index.d.cts.map +1 -1
  47. package/dist/index.d.mts.map +1 -1
  48. package/dist/index.mjs +8 -8
  49. package/dist/{init-BjuFt54X.cjs → init-BvpZtFiT.cjs} +4 -5
  50. package/dist/{init-CaOsHTIo.mjs → init-CZbZegIW.mjs} +4 -5
  51. package/dist/init-CZbZegIW.mjs.map +1 -0
  52. package/dist/mcp-proxy.cjs +75 -38
  53. package/dist/mcp-proxy.d.cts.map +1 -1
  54. package/dist/mcp-proxy.d.mts.map +1 -1
  55. package/dist/mcp-proxy.mjs +74 -37
  56. package/dist/mcp-proxy.mjs.map +1 -1
  57. package/dist/{output-root-CmWM7aV2.mjs → output-root-BRhzhhXZ.mjs} +3 -3
  58. package/dist/{output-root-CmWM7aV2.mjs.map → output-root-BRhzhhXZ.mjs.map} +1 -1
  59. package/dist/{output-root-CFYms3ad.cjs → output-root-YIbl6PwF.cjs} +2 -2
  60. package/dist/{parser-BUIWW1OH.cjs → parser-BXLAHYnZ.cjs} +1 -1
  61. package/dist/{parser-DO0_SssG.mjs → parser-CJfMsOl6.mjs} +1 -1
  62. package/dist/{parser-DO0_SssG.mjs.map → parser-CJfMsOl6.mjs.map} +1 -1
  63. package/dist/{public-tools-D4UI-Zb0.mjs → public-tools-D6Q5MTcO.mjs} +7 -7
  64. package/dist/{public-tools-D4UI-Zb0.mjs.map → public-tools-D6Q5MTcO.mjs.map} +1 -1
  65. package/dist/{public-tools-XSpkz2ky.cjs → public-tools-V7ON7goq.cjs} +7 -7
  66. package/dist/{resolver-zYbu4wDV.cjs → resolver-BUU7ZgW-.cjs} +1 -1
  67. package/dist/{resolver-C2ZS7oC8.mjs → resolver-D7VBb0uB.mjs} +1 -1
  68. package/dist/{resolver-C2ZS7oC8.mjs.map → resolver-D7VBb0uB.mjs.map} +1 -1
  69. package/dist/{runner-BhUHbiHG.mjs → runner-BatyCxv7.mjs} +7 -7
  70. package/dist/{runner-BhUHbiHG.mjs.map → runner-BatyCxv7.mjs.map} +1 -1
  71. package/dist/{runner-1Eq55OYb.cjs → runner-CCA7SJ7X.cjs} +6 -7
  72. package/dist/{schema-8d0rVIdZ.mjs → schema-BbQVXp36.mjs} +2 -2
  73. package/dist/{schema-8d0rVIdZ.mjs.map → schema-BbQVXp36.mjs.map} +1 -1
  74. package/dist/{schema-4XpzDFQM.cjs → schema-DN-KLkYN.cjs} +1 -1
  75. package/dist/{schema-cache-CgWRCN2N.cjs → schema-cache-CJk1EL3L.cjs} +1 -1
  76. package/dist/{schema-cache-9CksD7tX.mjs → schema-cache-DwDvPy4e.mjs} +1 -1
  77. package/dist/{schema-cache-9CksD7tX.mjs.map → schema-cache-DwDvPy4e.mjs.map} +1 -1
  78. package/dist/{selector-xjm6NTHI.mjs → selector-CTUiQrzI.mjs} +2 -2
  79. package/dist/{selector-xjm6NTHI.mjs.map → selector-CTUiQrzI.mjs.map} +1 -1
  80. package/dist/{selector-CkFcTXzz.cjs → selector-DBS2jYH4.cjs} +1 -1
  81. package/dist/{server-BkM5xrXb.mjs → server-BDlbmGbL.mjs} +3 -3
  82. package/dist/{server-BkM5xrXb.mjs.map → server-BDlbmGbL.mjs.map} +1 -1
  83. package/dist/{server-DXowbpfi.cjs → server-C3y1gQmZ.cjs} +2 -2
  84. package/dist/{session-CcTgYxsj.mjs → session-Bha3zFrx.mjs} +3 -3
  85. package/dist/{session-CcTgYxsj.mjs.map → session-Bha3zFrx.mjs.map} +1 -1
  86. package/dist/{session-BpNylyuJ.cjs → session-DwyikazY.cjs} +3 -3
  87. package/dist/{setup-DOpKPrlx.cjs → setup-CDha4B9s.cjs} +1 -1
  88. package/dist/{setup-DyrWHuwQ.mjs → setup-yXK8agdn.mjs} +1 -1
  89. package/dist/{setup-DyrWHuwQ.mjs.map → setup-yXK8agdn.mjs.map} +1 -1
  90. package/dist/{store-BoWE-Gtl.mjs → store-BT2SCcQr.mjs} +5 -5
  91. package/dist/{store-BoWE-Gtl.mjs.map → store-BT2SCcQr.mjs.map} +1 -1
  92. package/dist/{store-BiUhQOIf.cjs → store-DogLawSj.cjs} +5 -5
  93. package/dist/{tool-visibility-3Z_KvO9Q.mjs → tool-visibility-BHRFLXuU.mjs} +2 -2
  94. package/dist/{tool-visibility-3Z_KvO9Q.mjs.map → tool-visibility-BHRFLXuU.mjs.map} +1 -1
  95. package/dist/{tool-visibility-CwgY205r.cjs → tool-visibility-iAVQV3t0.cjs} +1 -1
  96. package/dist/{tools-f_vJUZAF.cjs → tools-DY8h0WbE.cjs} +2 -2
  97. package/dist/{tools-Cp2jAAAb.mjs → tools-Py6SXg6J.mjs} +3 -3
  98. package/dist/{tools-Cp2jAAAb.mjs.map → tools-Py6SXg6J.mjs.map} +1 -1
  99. package/dist/{topup-server-DUjyFftI.mjs → topup-server-6MH7q73X.mjs} +5 -5
  100. package/dist/{topup-server-DUjyFftI.mjs.map → topup-server-6MH7q73X.mjs.map} +1 -1
  101. package/dist/{topup-server-BZuQifvh.cjs → topup-server-DjUjhNjv.cjs} +4 -4
  102. package/dist/{version-1gP19Lhi.mjs → version-BA3J8hu4.mjs} +1 -1
  103. package/dist/{version-1gP19Lhi.mjs.map → version-BA3J8hu4.mjs.map} +1 -1
  104. package/dist/{version-BNGtdpmH.cjs → version-CO9Or_YV.cjs} +0 -1
  105. package/dist/{data-extractor-BNGj7ECT.cjs → viz-Da9YWN_I.cjs} +37 -8
  106. package/dist/{data-extractor-DFzsa5CS.mjs → viz-DkJyqlUu.mjs} +35 -6
  107. package/dist/viz-DkJyqlUu.mjs.map +1 -0
  108. package/dist/{wallet-BMelXBYP.mjs → wallet-D8IqFRKY.mjs} +2 -2
  109. package/dist/{wallet-BMelXBYP.mjs.map → wallet-D8IqFRKY.mjs.map} +1 -1
  110. package/dist/{wallet-RnvvSpV2.cjs → wallet-TAlNMvIM.cjs} +1 -1
  111. package/docs/architecture.md +1 -2
  112. package/docs/graph-tools.md +3 -3
  113. package/package.json +24 -4
  114. package/skills/chain-insights-investigation/SKILL.md +9 -9
  115. package/skills/chain-insights-trace-funds/SKILL.md +3 -3
  116. package/skills/test-chain-insights-graphrag-mcp/SKILL.md +1 -1
  117. package/dist/cases-By7INiOa.mjs +0 -6
  118. package/dist/cases-CDcNU91B.cjs +0 -9
  119. package/dist/client-D4Bq0rp9.mjs.map +0 -1
  120. package/dist/data-extractor-DFzsa5CS.mjs.map +0 -1
  121. package/dist/init-CaOsHTIo.mjs.map +0 -1
  122. package/dist/viz-BlCJe6Tk.mjs +0 -35
  123. package/dist/viz-BlCJe6Tk.mjs.map +0 -1
  124. package/dist/viz-ClezVXrJ.cjs +0 -44
  125. /package/dist/{call-args-DQA2QcRA.cjs → call-args-CcUV6gFS.cjs} +0 -0
  126. /package/dist/{chunk-CZWwpsFl.cjs → chunk-DakpK96I.cjs} +0 -0
  127. /package/dist/{format-DOrPvXEr.cjs → format-9NLBykEL.cjs} +0 -0
  128. /package/dist/{frontmatter-DgAuai7E.cjs → frontmatter-Dvqa5HX6.cjs} +0 -0
  129. /package/dist/{graph-normalizer-DeIj6Ses.cjs → graph-normalizer-DbjlbMpz.cjs} +0 -0
  130. /package/dist/{rolldown-runtime-wcPFST8Q.mjs → rolldown-runtime-D7D4PA-g.mjs} +0 -0
@@ -1,7 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_chunk = require("./chunk-CZWwpsFl.cjs");
3
- const require_version = require("./version-BNGtdpmH.cjs");
4
- const require_tool_visibility = require("./tool-visibility-CwgY205r.cjs");
2
+ const require_chunk = require("./chunk-DakpK96I.cjs");
3
+ const require_version = require("./version-CO9Or_YV.cjs");
4
+ const require_client = require("./client-DPc2eyVN.cjs");
5
+ const require_tool_visibility = require("./tool-visibility-iAVQV3t0.cjs");
5
6
  let node_url = require("node:url");
6
7
  let node_path = require("node:path");
7
8
  node_path = require_chunk.__toESM(node_path, 1);
@@ -58,7 +59,7 @@ const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
58
59
  address_risk: "Screen one full blockchain address for AML risk, behavior patterns, neighborhood context, exchange exposure, and optional comparison with compare_address. This includes the exchange-behavior analysis formerly covered by money_flows_between_exchanges. Use this as the first tool for a single-address investigation. The tool returns an investigator-ready summary; preserve full addresses exactly.",
59
60
  scam_topology: "Build victim-incident laundering topology from one victim/source address and the earliest known incident timestamp. Traversal uses one explicit activity policy: node_relative_only by default, or global_incident_only when requested. Repeated targets are kept as non-expanding convergence edges. Returns ML-ready scam_labels plus review context and a track_funds-compatible graph report: primary flows, deposits, reverse_leads. Victims, exchange endpoints, and generic labeled context nodes are not automatic scam labels; preserve full addresses exactly.",
60
61
  track_funds: "Trace funds from trusted victim/source addresses through intermediaries to exchange deposit addresses. Use this when the user has a victim/source address or known untrusted/scammer addresses. The tool returns an investigator-ready fund-flow report and recommended next actions.",
61
- graph_query: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts. Cross-backend correlated joins are limited by current MemGQL behavior; preserve full addresses exactly.",
62
+ graph_query: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Cross-layer correlated joins may be limited by the active graph endpoint; preserve full addresses exactly.",
62
63
  graph_query_batch: "Run multiple read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch. Prefer this for related topology/facts reads."
63
64
  };
64
65
  const NETWORK_DESCRIPTION = "Required network to query. Do not guess; use network_capabilities or ask the user if missing.";
@@ -80,12 +81,12 @@ const GRAPH_SCHEMA_HINTS = [
80
81
  "- Risk and ML properties may appear as live hints, but source-of-truth risk rows are RiskScore facts.",
81
82
  "- Common relationships include FLOWS_TO, OPERATED_FROM, SERVED_FROM, REGISTERED_NEURON, BELONGS_TO, SYBIL_CLUSTER, LAYERING_HOP, BURST_ACTIVITY, CYCLE_PARTICIPANT, SMURFING_CLUSTER.",
82
83
  "- FLOWS_TO properties are scoped to the selected topology graph and commonly carry amount_sum, amount_usd_sum, tx_count, first_seen_timestamp, last_seen_timestamp, first_tx_id, last_tx_id. Confirm available fields through runtime schema before relying on them.",
83
- "- Start schema discovery with MemGQL-safe property reads: MATCH (n:Address) WHERE n.address IS NOT NULL RETURN n.labels AS labels, n.address AS address LIMIT 20",
84
+ "- Start schema discovery with endpoint-safe property reads: MATCH (n:Address) WHERE n.address IS NOT NULL RETURN n.labels AS labels, n.address AS address LIMIT 20",
84
85
  "- Relationship discovery: MATCH (:Address)-[r:FLOWS_TO]->(:Address) RETURN r.amount_sum AS amount_sum, r.amount_usd_sum AS amount_usd_sum LIMIT 20",
85
- "- graph_query uses Memgraph Zero / MemGQL when available. Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts.",
86
+ "- graph_query uses the active Chain Insights graph endpoint. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment.",
86
87
  "- Archive topology labels include Address and TopologySnapshot. Archived money-flow topology is represented as (:Address)-[:FLOWS_TO]->(:Address) relationships with period_granularity, period_start_date, and period_end_date.",
87
88
  "- All graph_query calls are read-only. Never use CREATE, INSERT, MERGE, SET, DELETE, REMOVE, DROP, DETACH, ADD, CONNECT, DISCONNECT, ALTER, TRUNCATE, GRANT, or REVOKE.",
88
- "- Warehouse facts live behind facts_*_view StarRocks views and are reached through USE facts graph patterns. Do not query core_*, ml_*, analyzers_*, synthetics_*, or _* tables directly."
89
+ "- Use USE facts graph patterns for fact and enrichment reads. Do not query internal table namespaces directly."
89
90
  ].join("\n");
90
91
  const GRAPH_REPORT_HINTS = [
91
92
  "Graph visualization behavior:",
@@ -158,7 +159,7 @@ function knownPublicToolInputSchema(toolName) {
158
159
  case_id: zod.string().optional().describe("Optional Chain Insights case ID. When provided, compact evidence is appended to the case manifest.")
159
160
  };
160
161
  case "graph_query": return {
161
- query: zod.string().min(1).describe("Read-only GQL/Cypher query. Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts."),
162
+ query: zod.string().min(1).describe("Read-only GQL/Cypher query. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment."),
162
163
  network: zod.string().min(1).describe(NETWORK_DESCRIPTION)
163
164
  };
164
165
  case "graph_query_batch": return {
@@ -414,7 +415,7 @@ function registerLocalPrompts(server, remotePromptNames) {
414
415
  });
415
416
  server.registerPrompt("graph-query", {
416
417
  title: "Federated Graph Query",
417
- description: "Run a read-only GQL/Cypher query through Chain Insights Memgraph Zero.",
418
+ description: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint.",
418
419
  argsSchema: {
419
420
  query: zod.string().describe("Read-only GQL/Cypher query"),
420
421
  network: zod.string().describe(NETWORK_DESCRIPTION)
@@ -426,11 +427,11 @@ function registerLocalPrompts(server, remotePromptNames) {
426
427
  query,
427
428
  "```",
428
429
  "",
429
- "Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts. Return full address properties; never shorten addresses with ellipses."
430
+ "Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Return full address properties; never shorten addresses with ellipses."
430
431
  ].join("\n"), "Federated graph query"));
431
432
  server.registerPrompt("graph-query-batch", {
432
433
  title: "Federated Graph Query Batch",
433
- description: "Run related read-only GQL/Cypher queries through Chain Insights Memgraph Zero in one paid batch.",
434
+ description: "Run related read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch.",
434
435
  argsSchema: {
435
436
  queries: zod.string().describe("JSON array of query objects with optional id and required query fields"),
436
437
  network: zod.string().describe(NETWORK_DESCRIPTION),
@@ -444,7 +445,7 @@ function registerLocalPrompts(server, remotePromptNames) {
444
445
  "```",
445
446
  per_query_timeout_seconds ? `per_query_timeout_seconds: ${per_query_timeout_seconds}` : "",
446
447
  "",
447
- "Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts. Return full address properties; never shorten addresses with ellipses."
448
+ "Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Return full address properties; never shorten addresses with ellipses."
448
449
  ].filter(Boolean).join("\n"), "Federated graph batch query"));
449
450
  server.registerPrompt("balance", {
450
451
  title: "Wallet Balance",
@@ -529,8 +530,8 @@ async function normalizeRemoteToolResult(result, config, toolName = "remote-grap
529
530
  const graphPayload = getRemoteGraphPayload(result);
530
531
  const meta = { ...result._meta ?? {} };
531
532
  if (graphPayload) {
532
- const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-DU05YCei.cjs"));
533
- const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-DoxJ7fCx.cjs"));
533
+ const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
534
+ const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-B-3ho4bk.cjs"));
534
535
  const report = await writeGraphReport(graphPayload, {
535
536
  serverPort: config.serverPort,
536
537
  slug: toolName || "remote-graph"
@@ -559,10 +560,10 @@ async function normalizeRemoteToolResult(result, config, toolName = "remote-grap
559
560
  * All diagnostic output goes to console.error() or process.stderr.write().
560
561
  */
561
562
  async function createProxy() {
562
- const { loadConfig } = await Promise.resolve().then(() => require("./config-Bmdl5hdk.cjs")).then((n) => n.config_exports);
563
- const { activeDataDir, findActiveWorkspace } = await Promise.resolve().then(() => require("./active-Dv7Tu-O4.cjs")).then((n) => n.active_exports);
564
- const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-D4fZgIaO.cjs")).then((n) => n.client_exports);
565
- const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-CgWRCN2N.cjs"));
563
+ const { loadConfig } = await Promise.resolve().then(() => require("./config-BhYbhLDI.cjs")).then((n) => n.config_exports);
564
+ const { activeDataDir, findActiveWorkspace } = await Promise.resolve().then(() => require("./active-BVr55kvW.cjs")).then((n) => n.active_exports);
565
+ const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-DPc2eyVN.cjs")).then((n) => n.client_exports);
566
+ const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-CJk1EL3L.cjs"));
566
567
  const loadedConfig = await loadConfig();
567
568
  const activeWorkspace = findActiveWorkspace();
568
569
  const config = {
@@ -672,7 +673,7 @@ async function createProxy() {
672
673
  inputSchema: zod.object({}).passthrough()
673
674
  }, async () => {
674
675
  try {
675
- const { getWalletAccount, getWalletBalanceText } = await Promise.resolve().then(() => require("./tools-f_vJUZAF.cjs")).then((n) => n.tools_exports);
676
+ const { getWalletAccount, getWalletBalanceText } = await Promise.resolve().then(() => require("./tools-DY8h0WbE.cjs")).then((n) => n.tools_exports);
676
677
  return {
677
678
  content: [{
678
679
  type: "text",
@@ -720,13 +721,13 @@ async function createProxy() {
720
721
  }
721
722
  }, async ({ name, tags, description }) => {
722
723
  try {
723
- const { CaseStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
724
+ const { CaseStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
724
725
  const created = await CaseStore.create({
725
726
  name,
726
727
  tags: parseTags(tags),
727
728
  description: description ?? ""
728
729
  });
729
- const { casesRoot } = await Promise.resolve().then(() => require("./store-BiUhQOIf.cjs"));
730
+ const { casesRoot } = await Promise.resolve().then(() => require("./store-DogLawSj.cjs"));
730
731
  return {
731
732
  content: [{
732
733
  type: "text",
@@ -760,7 +761,7 @@ async function createProxy() {
760
761
  }
761
762
  }, async ({ status }) => {
762
763
  try {
763
- const { CaseStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
764
+ const { CaseStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
764
765
  const cases = await CaseStore.list();
765
766
  const filtered = status ? cases.filter((entry) => entry.status === status) : cases;
766
767
  return {
@@ -785,7 +786,7 @@ async function createProxy() {
785
786
  }
786
787
  }, async ({ case_id }) => {
787
788
  try {
788
- const { CaseStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
789
+ const { CaseStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
789
790
  const context = await CaseStore.loadContext(case_id);
790
791
  return {
791
792
  content: [{
@@ -814,7 +815,7 @@ async function createProxy() {
814
815
  }
815
816
  }, async ({ case_id, source, content, query_params }) => {
816
817
  try {
817
- const { EvidenceStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
818
+ const { EvidenceStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
818
819
  const saved = await EvidenceStore.append(case_id, {
819
820
  source,
820
821
  content,
@@ -842,7 +843,7 @@ async function createProxy() {
842
843
  }
843
844
  }, async ({ case_id }) => {
844
845
  try {
845
- const { EvidenceStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
846
+ const { EvidenceStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
846
847
  const result = await EvidenceStore.verifyManifest(case_id);
847
848
  return {
848
849
  content: [{
@@ -877,7 +878,7 @@ async function createProxy() {
877
878
  }
878
879
  }, async ({ case_id, address, finding, entity_type }) => {
879
880
  try {
880
- const { DossierStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
881
+ const { DossierStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
881
882
  await DossierStore.appendFinding(case_id, address, finding, entity_type ?? "unknown");
882
883
  return {
883
884
  content: [{
@@ -905,7 +906,7 @@ async function createProxy() {
905
906
  }
906
907
  }, async ({ case_id }) => {
907
908
  try {
908
- const { SessionStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
909
+ const { SessionStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
909
910
  const session = await SessionStore.start(case_id);
910
911
  return {
911
912
  content: [{
@@ -933,7 +934,7 @@ async function createProxy() {
933
934
  }
934
935
  }, async ({ case_id, findings, next_steps }) => {
935
936
  try {
936
- const { SessionStore } = await Promise.resolve().then(() => require("./cases-CDcNU91B.cjs"));
937
+ const { SessionStore } = await Promise.resolve().then(() => require("./cases-c0iV-XLI.cjs"));
937
938
  await SessionStore.end(case_id, {
938
939
  findings: findings ?? "",
939
940
  nextSteps: next_steps ?? ""
@@ -978,9 +979,9 @@ async function createProxy() {
978
979
  }],
979
980
  isError: true
980
981
  };
981
- const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-XSpkz2ky.cjs"));
982
- const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-DU05YCei.cjs"));
983
- const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-DoxJ7fCx.cjs"));
982
+ const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-V7ON7goq.cjs"));
983
+ const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
984
+ const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-B-3ho4bk.cjs"));
984
985
  const result = await addressRisk(remoteClient, {
985
986
  address,
986
987
  network,
@@ -1004,6 +1005,13 @@ async function createProxy() {
1004
1005
  isError: false
1005
1006
  };
1006
1007
  } catch (err) {
1008
+ if (err instanceof require_client.PaymentRequiredError) return {
1009
+ content: [{
1010
+ type: "text",
1011
+ text: err.message
1012
+ }],
1013
+ isError: true
1014
+ };
1007
1015
  return {
1008
1016
  content: [{
1009
1017
  type: "text",
@@ -1042,9 +1050,9 @@ async function createProxy() {
1042
1050
  }],
1043
1051
  isError: true
1044
1052
  };
1045
- const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-XSpkz2ky.cjs"));
1046
- const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-DU05YCei.cjs"));
1047
- const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-DoxJ7fCx.cjs"));
1053
+ const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-V7ON7goq.cjs"));
1054
+ const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
1055
+ const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-B-3ho4bk.cjs"));
1048
1056
  const result = await trackFunds(remoteClient, config, {
1049
1057
  trustedAddresses: trusted_addresses,
1050
1058
  untrustedAddresses: untrusted_addresses,
@@ -1072,6 +1080,13 @@ async function createProxy() {
1072
1080
  isError: false
1073
1081
  };
1074
1082
  } catch (err) {
1083
+ if (err instanceof require_client.PaymentRequiredError) return {
1084
+ content: [{
1085
+ type: "text",
1086
+ text: err.message
1087
+ }],
1088
+ isError: true
1089
+ };
1075
1090
  return {
1076
1091
  content: [{
1077
1092
  type: "text",
@@ -1108,9 +1123,9 @@ async function createProxy() {
1108
1123
  }],
1109
1124
  isError: true
1110
1125
  };
1111
- const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-XSpkz2ky.cjs"));
1112
- const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-DU05YCei.cjs"));
1113
- const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-DoxJ7fCx.cjs"));
1126
+ const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-V7ON7goq.cjs"));
1127
+ const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
1128
+ const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-B-3ho4bk.cjs"));
1114
1129
  const result = await scamTopology(remoteClient, config, {
1115
1130
  victimAddress: victim_address,
1116
1131
  network,
@@ -1137,6 +1152,13 @@ async function createProxy() {
1137
1152
  isError: false
1138
1153
  };
1139
1154
  } catch (err) {
1155
+ if (err instanceof require_client.PaymentRequiredError) return {
1156
+ content: [{
1157
+ type: "text",
1158
+ text: err.message
1159
+ }],
1160
+ isError: true
1161
+ };
1140
1162
  return {
1141
1163
  content: [{
1142
1164
  type: "text",
@@ -1214,10 +1236,25 @@ async function createProxy() {
1214
1236
  const requestOptions = remoteToolRequestOptions(tool.name);
1215
1237
  return await normalizeRemoteToolResult(requestOptions ? await remoteClient.callTool(request, void 0, requestOptions) : await remoteClient.callTool(request), config, tool.name);
1216
1238
  } catch (err) {
1239
+ if (err instanceof require_client.PaymentRequiredError) return {
1240
+ content: [{
1241
+ type: "text",
1242
+ text: err.message
1243
+ }],
1244
+ isError: true
1245
+ };
1246
+ const msg = err.message ?? String(err);
1247
+ if (/\b402\b/.test(msg) || msg.toLowerCase().includes("payment")) return {
1248
+ content: [{
1249
+ type: "text",
1250
+ text: `Payment required for ${tool.name}. This tool costs USDC on Base via x402 micropayments. Next steps: run \`chain-insights wallet topup\` to fund your wallet with USDC on Base, or \`chain-insights access-key set <key>\` if you have been given test access.`
1251
+ }],
1252
+ isError: true
1253
+ };
1217
1254
  return {
1218
1255
  content: [{
1219
1256
  type: "text",
1220
- text: `MCP call failed: ${err.message}`
1257
+ text: `MCP call failed: ${msg}`
1221
1258
  }],
1222
1259
  isError: true
1223
1260
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;AA2wBA;;;;;;iBAAsB,WAAA,CAAA,GAAe,OAAA"}
1
+ {"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;AA4wBA;;;;AAA4C;;iBAAtB,WAAA,CAAA,GAAe,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;AA2wBA;;;;;;iBAAsB,WAAA,CAAA,GAAe,OAAA"}
1
+ {"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;AA4wBA;;;;AAA4C;;iBAAtB,WAAA,CAAA,GAAe,OAAO"}
@@ -1,5 +1,6 @@
1
- import { n as PACKAGE_VERSION } from "./version-1gP19Lhi.mjs";
2
- import { t as HIDDEN_REMOTE_TOOL_NAMES } from "./tool-visibility-3Z_KvO9Q.mjs";
1
+ import { n as PACKAGE_VERSION } from "./version-BA3J8hu4.mjs";
2
+ import { t as PaymentRequiredError } from "./client-D4_hd4AP.mjs";
3
+ import { t as HIDDEN_REMOTE_TOOL_NAMES } from "./tool-visibility-BHRFLXuU.mjs";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import path from "node:path";
5
6
  import { readFileSync } from "node:fs";
@@ -54,7 +55,7 @@ const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
54
55
  address_risk: "Screen one full blockchain address for AML risk, behavior patterns, neighborhood context, exchange exposure, and optional comparison with compare_address. This includes the exchange-behavior analysis formerly covered by money_flows_between_exchanges. Use this as the first tool for a single-address investigation. The tool returns an investigator-ready summary; preserve full addresses exactly.",
55
56
  scam_topology: "Build victim-incident laundering topology from one victim/source address and the earliest known incident timestamp. Traversal uses one explicit activity policy: node_relative_only by default, or global_incident_only when requested. Repeated targets are kept as non-expanding convergence edges. Returns ML-ready scam_labels plus review context and a track_funds-compatible graph report: primary flows, deposits, reverse_leads. Victims, exchange endpoints, and generic labeled context nodes are not automatic scam labels; preserve full addresses exactly.",
56
57
  track_funds: "Trace funds from trusted victim/source addresses through intermediaries to exchange deposit addresses. Use this when the user has a victim/source address or known untrusted/scammer addresses. The tool returns an investigator-ready fund-flow report and recommended next actions.",
57
- graph_query: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts. Cross-backend correlated joins are limited by current MemGQL behavior; preserve full addresses exactly.",
58
+ graph_query: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Cross-layer correlated joins may be limited by the active graph endpoint; preserve full addresses exactly.",
58
59
  graph_query_batch: "Run multiple read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch. Prefer this for related topology/facts reads."
59
60
  };
60
61
  const NETWORK_DESCRIPTION = "Required network to query. Do not guess; use network_capabilities or ask the user if missing.";
@@ -76,12 +77,12 @@ const GRAPH_SCHEMA_HINTS = [
76
77
  "- Risk and ML properties may appear as live hints, but source-of-truth risk rows are RiskScore facts.",
77
78
  "- Common relationships include FLOWS_TO, OPERATED_FROM, SERVED_FROM, REGISTERED_NEURON, BELONGS_TO, SYBIL_CLUSTER, LAYERING_HOP, BURST_ACTIVITY, CYCLE_PARTICIPANT, SMURFING_CLUSTER.",
78
79
  "- FLOWS_TO properties are scoped to the selected topology graph and commonly carry amount_sum, amount_usd_sum, tx_count, first_seen_timestamp, last_seen_timestamp, first_tx_id, last_tx_id. Confirm available fields through runtime schema before relying on them.",
79
- "- Start schema discovery with MemGQL-safe property reads: MATCH (n:Address) WHERE n.address IS NOT NULL RETURN n.labels AS labels, n.address AS address LIMIT 20",
80
+ "- Start schema discovery with endpoint-safe property reads: MATCH (n:Address) WHERE n.address IS NOT NULL RETURN n.labels AS labels, n.address AS address LIMIT 20",
80
81
  "- Relationship discovery: MATCH (:Address)-[r:FLOWS_TO]->(:Address) RETURN r.amount_sum AS amount_sum, r.amount_usd_sum AS amount_usd_sum LIMIT 20",
81
- "- graph_query uses Memgraph Zero / MemGQL when available. Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts.",
82
+ "- graph_query uses the active Chain Insights graph endpoint. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment.",
82
83
  "- Archive topology labels include Address and TopologySnapshot. Archived money-flow topology is represented as (:Address)-[:FLOWS_TO]->(:Address) relationships with period_granularity, period_start_date, and period_end_date.",
83
84
  "- All graph_query calls are read-only. Never use CREATE, INSERT, MERGE, SET, DELETE, REMOVE, DROP, DETACH, ADD, CONNECT, DISCONNECT, ALTER, TRUNCATE, GRANT, or REVOKE.",
84
- "- Warehouse facts live behind facts_*_view StarRocks views and are reached through USE facts graph patterns. Do not query core_*, ml_*, analyzers_*, synthetics_*, or _* tables directly."
85
+ "- Use USE facts graph patterns for fact and enrichment reads. Do not query internal table namespaces directly."
85
86
  ].join("\n");
86
87
  const GRAPH_REPORT_HINTS = [
87
88
  "Graph visualization behavior:",
@@ -154,7 +155,7 @@ function knownPublicToolInputSchema(toolName) {
154
155
  case_id: z.string().optional().describe("Optional Chain Insights case ID. When provided, compact evidence is appended to the case manifest.")
155
156
  };
156
157
  case "graph_query": return {
157
- query: z.string().min(1).describe("Read-only GQL/Cypher query. Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts."),
158
+ query: z.string().min(1).describe("Read-only GQL/Cypher query. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment."),
158
159
  network: z.string().min(1).describe(NETWORK_DESCRIPTION)
159
160
  };
160
161
  case "graph_query_batch": return {
@@ -410,7 +411,7 @@ function registerLocalPrompts(server, remotePromptNames) {
410
411
  });
411
412
  server.registerPrompt("graph-query", {
412
413
  title: "Federated Graph Query",
413
- description: "Run a read-only GQL/Cypher query through Chain Insights Memgraph Zero.",
414
+ description: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint.",
414
415
  argsSchema: {
415
416
  query: z.string().describe("Read-only GQL/Cypher query"),
416
417
  network: z.string().describe(NETWORK_DESCRIPTION)
@@ -422,11 +423,11 @@ function registerLocalPrompts(server, remotePromptNames) {
422
423
  query,
423
424
  "```",
424
425
  "",
425
- "Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts. Return full address properties; never shorten addresses with ellipses."
426
+ "Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Return full address properties; never shorten addresses with ellipses."
426
427
  ].join("\n"), "Federated graph query"));
427
428
  server.registerPrompt("graph-query-batch", {
428
429
  title: "Federated Graph Query Batch",
429
- description: "Run related read-only GQL/Cypher queries through Chain Insights Memgraph Zero in one paid batch.",
430
+ description: "Run related read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch.",
430
431
  argsSchema: {
431
432
  queries: z.string().describe("JSON array of query objects with optional id and required query fields"),
432
433
  network: z.string().describe(NETWORK_DESCRIPTION),
@@ -440,7 +441,7 @@ function registerLocalPrompts(server, remotePromptNames) {
440
441
  "```",
441
442
  per_query_timeout_seconds ? `per_query_timeout_seconds: ${per_query_timeout_seconds}` : "",
442
443
  "",
443
- "Use USE live_topology for Memgraph RAM topology, USE archive_topology for StarRocks historical topology, and USE facts for StarRocks facts. Return full address properties; never shorten addresses with ellipses."
444
+ "Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Return full address properties; never shorten addresses with ellipses."
444
445
  ].filter(Boolean).join("\n"), "Federated graph batch query"));
445
446
  server.registerPrompt("balance", {
446
447
  title: "Wallet Balance",
@@ -525,8 +526,8 @@ async function normalizeRemoteToolResult(result, config, toolName = "remote-grap
525
526
  const graphPayload = getRemoteGraphPayload(result);
526
527
  const meta = { ...result._meta ?? {} };
527
528
  if (graphPayload) {
528
- const { writeGraphReport } = await import("./graph-reports-C4TBjCkM.mjs");
529
- const { ensureArtifactServer } = await import("./artifact-server-Dxz5YbuQ.mjs");
529
+ const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
530
+ const { ensureArtifactServer } = await import("./artifact-server-4DiMvwhC.mjs");
530
531
  const report = await writeGraphReport(graphPayload, {
531
532
  serverPort: config.serverPort,
532
533
  slug: toolName || "remote-graph"
@@ -555,10 +556,10 @@ async function normalizeRemoteToolResult(result, config, toolName = "remote-grap
555
556
  * All diagnostic output goes to console.error() or process.stderr.write().
556
557
  */
557
558
  async function createProxy() {
558
- const { loadConfig } = await import("./config-BwrBYmiC.mjs").then((n) => n.t);
559
- const { activeDataDir, findActiveWorkspace } = await import("./active-BSrxLKwn.mjs").then((n) => n.n);
560
- const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-D4Bq0rp9.mjs").then((n) => n.t);
561
- const { loadSchema, saveSchema } = await import("./schema-cache-9CksD7tX.mjs");
559
+ const { loadConfig } = await import("./config-9KYXaAv-.mjs").then((n) => n.t);
560
+ const { activeDataDir, findActiveWorkspace } = await import("./active-ByNgjuAg.mjs").then((n) => n.n);
561
+ const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-D4_hd4AP.mjs").then((n) => n.n);
562
+ const { loadSchema, saveSchema } = await import("./schema-cache-DwDvPy4e.mjs");
562
563
  const loadedConfig = await loadConfig();
563
564
  const activeWorkspace = findActiveWorkspace();
564
565
  const config = {
@@ -668,7 +669,7 @@ async function createProxy() {
668
669
  inputSchema: z.object({}).passthrough()
669
670
  }, async () => {
670
671
  try {
671
- const { getWalletAccount, getWalletBalanceText } = await import("./tools-Cp2jAAAb.mjs").then((n) => n.s);
672
+ const { getWalletAccount, getWalletBalanceText } = await import("./tools-Py6SXg6J.mjs").then((n) => n.s);
672
673
  return {
673
674
  content: [{
674
675
  type: "text",
@@ -716,13 +717,13 @@ async function createProxy() {
716
717
  }
717
718
  }, async ({ name, tags, description }) => {
718
719
  try {
719
- const { CaseStore } = await import("./cases-By7INiOa.mjs");
720
+ const { CaseStore } = await import("./cases-qjPtbnUd.mjs");
720
721
  const created = await CaseStore.create({
721
722
  name,
722
723
  tags: parseTags(tags),
723
724
  description: description ?? ""
724
725
  });
725
- const { casesRoot } = await import("./store-BoWE-Gtl.mjs");
726
+ const { casesRoot } = await import("./store-BT2SCcQr.mjs");
726
727
  return {
727
728
  content: [{
728
729
  type: "text",
@@ -756,7 +757,7 @@ async function createProxy() {
756
757
  }
757
758
  }, async ({ status }) => {
758
759
  try {
759
- const { CaseStore } = await import("./cases-By7INiOa.mjs");
760
+ const { CaseStore } = await import("./cases-qjPtbnUd.mjs");
760
761
  const cases = await CaseStore.list();
761
762
  const filtered = status ? cases.filter((entry) => entry.status === status) : cases;
762
763
  return {
@@ -781,7 +782,7 @@ async function createProxy() {
781
782
  }
782
783
  }, async ({ case_id }) => {
783
784
  try {
784
- const { CaseStore } = await import("./cases-By7INiOa.mjs");
785
+ const { CaseStore } = await import("./cases-qjPtbnUd.mjs");
785
786
  const context = await CaseStore.loadContext(case_id);
786
787
  return {
787
788
  content: [{
@@ -810,7 +811,7 @@ async function createProxy() {
810
811
  }
811
812
  }, async ({ case_id, source, content, query_params }) => {
812
813
  try {
813
- const { EvidenceStore } = await import("./cases-By7INiOa.mjs");
814
+ const { EvidenceStore } = await import("./cases-qjPtbnUd.mjs");
814
815
  const saved = await EvidenceStore.append(case_id, {
815
816
  source,
816
817
  content,
@@ -838,7 +839,7 @@ async function createProxy() {
838
839
  }
839
840
  }, async ({ case_id }) => {
840
841
  try {
841
- const { EvidenceStore } = await import("./cases-By7INiOa.mjs");
842
+ const { EvidenceStore } = await import("./cases-qjPtbnUd.mjs");
842
843
  const result = await EvidenceStore.verifyManifest(case_id);
843
844
  return {
844
845
  content: [{
@@ -873,7 +874,7 @@ async function createProxy() {
873
874
  }
874
875
  }, async ({ case_id, address, finding, entity_type }) => {
875
876
  try {
876
- const { DossierStore } = await import("./cases-By7INiOa.mjs");
877
+ const { DossierStore } = await import("./cases-qjPtbnUd.mjs");
877
878
  await DossierStore.appendFinding(case_id, address, finding, entity_type ?? "unknown");
878
879
  return {
879
880
  content: [{
@@ -901,7 +902,7 @@ async function createProxy() {
901
902
  }
902
903
  }, async ({ case_id }) => {
903
904
  try {
904
- const { SessionStore } = await import("./cases-By7INiOa.mjs");
905
+ const { SessionStore } = await import("./cases-qjPtbnUd.mjs");
905
906
  const session = await SessionStore.start(case_id);
906
907
  return {
907
908
  content: [{
@@ -929,7 +930,7 @@ async function createProxy() {
929
930
  }
930
931
  }, async ({ case_id, findings, next_steps }) => {
931
932
  try {
932
- const { SessionStore } = await import("./cases-By7INiOa.mjs");
933
+ const { SessionStore } = await import("./cases-qjPtbnUd.mjs");
933
934
  await SessionStore.end(case_id, {
934
935
  findings: findings ?? "",
935
936
  nextSteps: next_steps ?? ""
@@ -974,9 +975,9 @@ async function createProxy() {
974
975
  }],
975
976
  isError: true
976
977
  };
977
- const { addressRisk } = await import("./public-tools-D4UI-Zb0.mjs");
978
- const { writeGraphReport } = await import("./graph-reports-C4TBjCkM.mjs");
979
- const { ensureArtifactServer } = await import("./artifact-server-Dxz5YbuQ.mjs");
978
+ const { addressRisk } = await import("./public-tools-D6Q5MTcO.mjs");
979
+ const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
980
+ const { ensureArtifactServer } = await import("./artifact-server-4DiMvwhC.mjs");
980
981
  const result = await addressRisk(remoteClient, {
981
982
  address,
982
983
  network,
@@ -1000,6 +1001,13 @@ async function createProxy() {
1000
1001
  isError: false
1001
1002
  };
1002
1003
  } catch (err) {
1004
+ if (err instanceof PaymentRequiredError) return {
1005
+ content: [{
1006
+ type: "text",
1007
+ text: err.message
1008
+ }],
1009
+ isError: true
1010
+ };
1003
1011
  return {
1004
1012
  content: [{
1005
1013
  type: "text",
@@ -1038,9 +1046,9 @@ async function createProxy() {
1038
1046
  }],
1039
1047
  isError: true
1040
1048
  };
1041
- const { trackFunds } = await import("./public-tools-D4UI-Zb0.mjs");
1042
- const { writeGraphReport } = await import("./graph-reports-C4TBjCkM.mjs");
1043
- const { ensureArtifactServer } = await import("./artifact-server-Dxz5YbuQ.mjs");
1049
+ const { trackFunds } = await import("./public-tools-D6Q5MTcO.mjs");
1050
+ const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
1051
+ const { ensureArtifactServer } = await import("./artifact-server-4DiMvwhC.mjs");
1044
1052
  const result = await trackFunds(remoteClient, config, {
1045
1053
  trustedAddresses: trusted_addresses,
1046
1054
  untrustedAddresses: untrusted_addresses,
@@ -1068,6 +1076,13 @@ async function createProxy() {
1068
1076
  isError: false
1069
1077
  };
1070
1078
  } catch (err) {
1079
+ if (err instanceof PaymentRequiredError) return {
1080
+ content: [{
1081
+ type: "text",
1082
+ text: err.message
1083
+ }],
1084
+ isError: true
1085
+ };
1071
1086
  return {
1072
1087
  content: [{
1073
1088
  type: "text",
@@ -1104,9 +1119,9 @@ async function createProxy() {
1104
1119
  }],
1105
1120
  isError: true
1106
1121
  };
1107
- const { scamTopology } = await import("./public-tools-D4UI-Zb0.mjs");
1108
- const { writeGraphReport } = await import("./graph-reports-C4TBjCkM.mjs");
1109
- const { ensureArtifactServer } = await import("./artifact-server-Dxz5YbuQ.mjs");
1122
+ const { scamTopology } = await import("./public-tools-D6Q5MTcO.mjs");
1123
+ const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
1124
+ const { ensureArtifactServer } = await import("./artifact-server-4DiMvwhC.mjs");
1110
1125
  const result = await scamTopology(remoteClient, config, {
1111
1126
  victimAddress: victim_address,
1112
1127
  network,
@@ -1133,6 +1148,13 @@ async function createProxy() {
1133
1148
  isError: false
1134
1149
  };
1135
1150
  } catch (err) {
1151
+ if (err instanceof PaymentRequiredError) return {
1152
+ content: [{
1153
+ type: "text",
1154
+ text: err.message
1155
+ }],
1156
+ isError: true
1157
+ };
1136
1158
  return {
1137
1159
  content: [{
1138
1160
  type: "text",
@@ -1210,10 +1232,25 @@ async function createProxy() {
1210
1232
  const requestOptions = remoteToolRequestOptions(tool.name);
1211
1233
  return await normalizeRemoteToolResult(requestOptions ? await remoteClient.callTool(request, void 0, requestOptions) : await remoteClient.callTool(request), config, tool.name);
1212
1234
  } catch (err) {
1235
+ if (err instanceof PaymentRequiredError) return {
1236
+ content: [{
1237
+ type: "text",
1238
+ text: err.message
1239
+ }],
1240
+ isError: true
1241
+ };
1242
+ const msg = err.message ?? String(err);
1243
+ if (/\b402\b/.test(msg) || msg.toLowerCase().includes("payment")) return {
1244
+ content: [{
1245
+ type: "text",
1246
+ text: `Payment required for ${tool.name}. This tool costs USDC on Base via x402 micropayments. Next steps: run \`chain-insights wallet topup\` to fund your wallet with USDC on Base, or \`chain-insights access-key set <key>\` if you have been given test access.`
1247
+ }],
1248
+ isError: true
1249
+ };
1213
1250
  return {
1214
1251
  content: [{
1215
1252
  type: "text",
1216
- text: `MCP call failed: ${err.message}`
1253
+ text: `MCP call failed: ${msg}`
1217
1254
  }],
1218
1255
  isError: true
1219
1256
  };