chain-insights 0.74.1 → 0.76.0

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 (144) hide show
  1. package/README.md +3 -2
  2. package/dist/{action-log-D49Par9P.mjs → action-log-Byv9Ln_6.mjs} +4 -10
  3. package/dist/{action-log-D49Par9P.mjs.map → action-log-Byv9Ln_6.mjs.map} +1 -1
  4. package/dist/{action-log-HniMMF7f.cjs → action-log-WMW6xFMx.cjs} +3 -9
  5. package/dist/{active-Dkf8AB1R.mjs → active-D2aabYRF.mjs} +3 -4
  6. package/dist/{active-Dkf8AB1R.mjs.map → active-D2aabYRF.mjs.map} +1 -1
  7. package/dist/{active-Bc13hJIm.cjs → active-q3yViZhc.cjs} +2 -3
  8. package/dist/answer-hint-BlYEBq_Y.cjs +57 -0
  9. package/dist/answer-hint-vOE1O6Lf.mjs +48 -0
  10. package/dist/answer-hint-vOE1O6Lf.mjs.map +1 -0
  11. package/dist/{buy-_mpdRieG.mjs → buy-B2luUbWF.mjs} +5 -6
  12. package/dist/{buy-_mpdRieG.mjs.map → buy-B2luUbWF.mjs.map} +1 -1
  13. package/dist/{buy-97M6dtEu.cjs → buy-DEoGITbT.cjs} +4 -5
  14. package/dist/{cache-location-CBVzUIxq.cjs → cache-location-C09AE55j.cjs} +2 -3
  15. package/dist/{cache-location-BO2XkfgI.mjs → cache-location-DxTTqBwk.mjs} +2 -3
  16. package/dist/{cache-location-BO2XkfgI.mjs.map → cache-location-DxTTqBwk.mjs.map} +1 -1
  17. package/dist/{call-args-B0oMK1-J.mjs → call-args-CBqbYfOE.mjs} +15 -4
  18. package/dist/{call-args-B0oMK1-J.mjs.map → call-args-CBqbYfOE.mjs.map} +1 -1
  19. package/dist/{call-args-C8Gp5gco.cjs → call-args-DXEmPeE-.cjs} +14 -2
  20. package/dist/{capabilities-DxojbX4D.mjs → capabilities-BRNHcabF.mjs} +5 -11
  21. package/dist/{capabilities-DxojbX4D.mjs.map → capabilities-BRNHcabF.mjs.map} +1 -1
  22. package/dist/{capabilities-Ds3320iS.cjs → capabilities-DalimVY2.cjs} +4 -10
  23. package/dist/{claude-desktop-Jmm4PlBZ.cjs → claude-desktop-3OksQZVE.cjs} +2 -3
  24. package/dist/{claude-desktop-6jwX0Lux.mjs → claude-desktop-C1SDYAP2.mjs} +2 -3
  25. package/dist/{claude-desktop-6jwX0Lux.mjs.map → claude-desktop-C1SDYAP2.mjs.map} +1 -1
  26. package/dist/cli.cjs +95 -76
  27. package/dist/cli.mjs +94 -75
  28. package/dist/cli.mjs.map +1 -1
  29. package/dist/{client-7qOfAdpH.mjs → client-BaHAIidE.mjs} +10 -21
  30. package/dist/{client-7qOfAdpH.mjs.map → client-BaHAIidE.mjs.map} +1 -1
  31. package/dist/{client-C9uwHnBS.cjs → client-Ddk4X9Ko.cjs} +9 -20
  32. package/dist/{config-BxtMoo9c.cjs → config-BdE8LcF-.cjs} +3 -5
  33. package/dist/{config-9MabJh5R.mjs → config-BkLIqOYq.mjs} +4 -6
  34. package/dist/{config-9MabJh5R.mjs.map → config-BkLIqOYq.mjs.map} +1 -1
  35. package/dist/{create-CpfZq2fx.mjs → create-CluDZkuF.mjs} +3 -4
  36. package/dist/{create-CpfZq2fx.mjs.map → create-CluDZkuF.mjs.map} +1 -1
  37. package/dist/{create-DdggkF04.cjs → create-DvBumvHn.cjs} +2 -3
  38. package/dist/{dex-registry-Chs79Ukc.cjs → dex-registry-CZQB2YhU.cjs} +4 -26
  39. package/dist/{dex-registry-rziydXYq.mjs → dex-registry-D6Xxi_vr.mjs} +5 -27
  40. package/dist/{dex-registry-rziydXYq.mjs.map → dex-registry-D6Xxi_vr.mjs.map} +1 -1
  41. package/dist/{dex-tool-DsaAIa-a.mjs → dex-tool-BoAYqhZO.mjs} +13 -67
  42. package/dist/dex-tool-BoAYqhZO.mjs.map +1 -0
  43. package/dist/{dex-tool-DLWnff1n.cjs → dex-tool-DsM-pSku.cjs} +17 -77
  44. package/dist/{format-CSesEBvS.mjs → format-CsnW5M4D.mjs} +2 -3
  45. package/dist/{format-CSesEBvS.mjs.map → format-CsnW5M4D.mjs.map} +1 -1
  46. package/dist/{format-DfhRQq4L.cjs → format-DUzmoeaE.cjs} +1 -2
  47. package/dist/{graph-schema-BGbJumCY.cjs → graph-schema-C8Pi6r7c.cjs} +12 -29
  48. package/dist/{graph-schema-ClqjzgrM.mjs → graph-schema-D4LAefGf.mjs} +13 -30
  49. package/dist/graph-schema-D4LAefGf.mjs.map +1 -0
  50. package/dist/index.cjs +7 -7
  51. package/dist/index.d.cts +0 -16
  52. package/dist/index.d.cts.map +1 -1
  53. package/dist/index.d.mts +0 -16
  54. package/dist/index.d.mts.map +1 -1
  55. package/dist/index.mjs +7 -7
  56. package/dist/{known-keys-B87ZqOgE.mjs → known-keys-BbuzCZOW.mjs} +4 -7
  57. package/dist/{known-keys-B87ZqOgE.mjs.map → known-keys-BbuzCZOW.mjs.map} +1 -1
  58. package/dist/{known-keys-PKZF5GYd.cjs → known-keys-Cy8lKDOA.cjs} +3 -6
  59. package/dist/mcp-proxy.cjs +83 -57
  60. package/dist/mcp-proxy.d.cts +2 -2
  61. package/dist/mcp-proxy.d.cts.map +1 -1
  62. package/dist/mcp-proxy.d.mts +2 -2
  63. package/dist/mcp-proxy.d.mts.map +1 -1
  64. package/dist/mcp-proxy.mjs +81 -56
  65. package/dist/mcp-proxy.mjs.map +1 -1
  66. package/dist/{print-result-Cyqrlx8P.cjs → print-result-BYppJlUi.cjs} +20 -20
  67. package/dist/{print-result-C3YazZBw.mjs → print-result-IFARsMnL.mjs} +10 -22
  68. package/dist/print-result-IFARsMnL.mjs.map +1 -0
  69. package/dist/{public-tools-Bl_l_rKK.cjs → public-tools-Cfc1OPNS.cjs} +16 -21
  70. package/dist/{public-tools-CQjGt7_q.mjs → public-tools-DXlZcanX.mjs} +16 -21
  71. package/dist/public-tools-DXlZcanX.mjs.map +1 -0
  72. package/dist/{quote-DfTut0cx.mjs → quote-41CbMc37.mjs} +2 -3
  73. package/dist/{quote-DfTut0cx.mjs.map → quote-41CbMc37.mjs.map} +1 -1
  74. package/dist/{quote-B9sYNOiv.cjs → quote-pFKcSvMv.cjs} +1 -2
  75. package/dist/{request-timeout-CYmQF8N7.cjs → request-timeout-DxwNijQD.cjs} +1 -2
  76. package/dist/{request-timeout-lBBe0mGf.mjs → request-timeout-K3ljP0pa.mjs} +2 -3
  77. package/dist/{request-timeout-lBBe0mGf.mjs.map → request-timeout-K3ljP0pa.mjs.map} +1 -1
  78. package/dist/{robinhood-CCTMagwM.mjs → robinhood-0NZsA6ZW.mjs} +2 -3
  79. package/dist/robinhood-0NZsA6ZW.mjs.map +1 -0
  80. package/dist/{robinhood-ChiT69sc.cjs → robinhood-DumTxvlA.cjs} +1 -2
  81. package/dist/{rolldown-runtime-8H4AJuhK.mjs → rolldown-runtime-BJohB4LM.mjs} +1 -2
  82. package/dist/{rolldown-runtime-C0BPl7ul.cjs → rolldown-runtime-BW-eSwOZ.cjs} +1 -2
  83. package/dist/{rules-BWdbOtHi.mjs → rules-B3w9pCeQ.mjs} +2 -3
  84. package/dist/{rules-BWdbOtHi.mjs.map → rules-B3w9pCeQ.mjs.map} +1 -1
  85. package/dist/{rules-BD-cNHMX.cjs → rules-BKwfmNsJ.cjs} +1 -2
  86. package/dist/{schema-KjZqCHbu.mjs → schema-CKnQsdw9.mjs} +6 -13
  87. package/dist/{schema-KjZqCHbu.mjs.map → schema-CKnQsdw9.mjs.map} +1 -1
  88. package/dist/{schema-tX0U0-VI.cjs → schema-CSESfCvA.cjs} +5 -12
  89. package/dist/{schema-cache-DRObKUvS.mjs → schema-cache-BfKHodDY.mjs} +3 -4
  90. package/dist/{schema-cache-DRObKUvS.mjs.map → schema-cache-BfKHodDY.mjs.map} +1 -1
  91. package/dist/{schema-cache-C7v9ml6S.cjs → schema-cache-NLgJmh4X.cjs} +3 -4
  92. package/dist/{skill-refresh-xYWZ_hua.mjs → skill-refresh-BchIsODN.mjs} +2 -3
  93. package/dist/{skill-refresh-xYWZ_hua.mjs.map → skill-refresh-BchIsODN.mjs.map} +1 -1
  94. package/dist/{skill-refresh-Be2D5FrX.cjs → skill-refresh-DaCTxhhy.cjs} +2 -3
  95. package/dist/{subscription-status-DIuH84fM.mjs → subscription-status-5WfPhSep.mjs} +3 -4
  96. package/dist/{subscription-status-DIuH84fM.mjs.map → subscription-status-5WfPhSep.mjs.map} +1 -1
  97. package/dist/{subscription-status-9tMfD90J.cjs → subscription-status-w4zI2KCK.cjs} +2 -3
  98. package/dist/token-lookup-BJ00JO9A.cjs +342 -0
  99. package/dist/token-lookup-XnyisLQW.mjs +303 -0
  100. package/dist/token-lookup-XnyisLQW.mjs.map +1 -0
  101. package/dist/{tool-visibility-BNwvcuVx.cjs → tool-visibility-DIpgPULN.cjs} +5 -10
  102. package/dist/{tool-visibility-B6983rxo.mjs → tool-visibility-Dy3psowS.mjs} +6 -11
  103. package/dist/tool-visibility-Dy3psowS.mjs.map +1 -0
  104. package/dist/{tools-D9ep9E7Q.mjs → tools-6pZo4h_p.mjs} +6 -21
  105. package/dist/{tools-D9ep9E7Q.mjs.map → tools-6pZo4h_p.mjs.map} +1 -1
  106. package/dist/{tools-Cmnq7yip.cjs → tools-DZLizem9.cjs} +5 -20
  107. package/dist/{topup-B6gZbTmv.mjs → topup--7JTo4UQ.mjs} +6 -7
  108. package/dist/{topup-B6gZbTmv.mjs.map → topup--7JTo4UQ.mjs.map} +1 -1
  109. package/dist/{topup-DVTCU2le.cjs → topup-BgI9OcUd.cjs} +5 -6
  110. package/dist/{topup-server-ShuYSyBY.cjs → topup-server-D9Uk1Th3.cjs} +7 -24
  111. package/dist/{topup-server-KQDviFXG.mjs → topup-server-DR0HaUcR.mjs} +8 -25
  112. package/dist/{topup-server-KQDviFXG.mjs.map → topup-server-DR0HaUcR.mjs.map} +1 -1
  113. package/dist/{topup-server-BcT7DIpd.mjs → topup-server-DlwzFEF1.mjs} +5 -12
  114. package/dist/{topup-server-BcT7DIpd.mjs.map → topup-server-DlwzFEF1.mjs.map} +1 -1
  115. package/dist/{topup-server-f4Gx0vji.cjs → topup-server-H1M_7PJK.cjs} +4 -11
  116. package/dist/{transport-error-D4hmpkqL.mjs → transport-error-68G35VPH.mjs} +3 -4
  117. package/dist/{transport-error-D4hmpkqL.mjs.map → transport-error-68G35VPH.mjs.map} +1 -1
  118. package/dist/{transport-error-CgISST8l.cjs → transport-error-DXy1iTpS.cjs} +2 -3
  119. package/dist/{update-CZDHSi_u.mjs → update-BH8F4cQ2.mjs} +3 -4
  120. package/dist/{update-CZDHSi_u.mjs.map → update-BH8F4cQ2.mjs.map} +1 -1
  121. package/dist/{update-DGyRlm3J.cjs → update-DUDdQSEU.cjs} +2 -3
  122. package/dist/{usage-status-Frot6fPG.mjs → usage-status-BUZgRl4r.mjs} +3 -5
  123. package/dist/{usage-status-Frot6fPG.mjs.map → usage-status-BUZgRl4r.mjs.map} +1 -1
  124. package/dist/{usage-status-DonwoLR3.cjs → usage-status-DnV3I3gX.cjs} +2 -4
  125. package/dist/{wallet-QTo5YCFR.mjs → wallet-B1M0HdQh.mjs} +4 -8
  126. package/dist/{wallet-QTo5YCFR.mjs.map → wallet-B1M0HdQh.mjs.map} +1 -1
  127. package/dist/{wallet-CgIAfdxL.cjs → wallet-BubGd_sG.cjs} +3 -7
  128. package/docs/graph-query-compatibility.md +13 -13
  129. package/docs/graph-tools.md +22 -22
  130. package/docs/mcp-proxy.md +35 -1
  131. package/docs/stability.md +3 -2
  132. package/package.json +1 -1
  133. package/skills/chain-insights-cypher/SKILL.md +30 -27
  134. package/skills/chain-insights-dex/SKILL.md +2 -2
  135. package/skills/chain-insights-dex/reference.md +1 -1
  136. package/skills/chain-insights-dex-gauge/SKILL.md +4 -4
  137. package/skills/chain-insights-dex-launchpad/SKILL.md +2 -2
  138. package/skills/chain-insights-virtuals/reference.md +5 -5
  139. package/dist/dex-tool-DsaAIa-a.mjs.map +0 -1
  140. package/dist/graph-schema-ClqjzgrM.mjs.map +0 -1
  141. package/dist/print-result-C3YazZBw.mjs.map +0 -1
  142. package/dist/public-tools-CQjGt7_q.mjs.map +0 -1
  143. package/dist/robinhood-CCTMagwM.mjs.map +0 -1
  144. package/dist/tool-visibility-B6983rxo.mjs.map +0 -1
@@ -1,16 +1,18 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
3
- const require_print_result = require("./print-result-Cyqrlx8P.cjs");
4
- const require_rules = require("./rules-BD-cNHMX.cjs");
5
- const require_client = require("./client-C9uwHnBS.cjs");
6
- const require_tool_visibility = require("./tool-visibility-BNwvcuVx.cjs");
7
- const require_usage_status = require("./usage-status-DonwoLR3.cjs");
8
- const require_subscription_status = require("./subscription-status-9tMfD90J.cjs");
9
- const require_capabilities = require("./capabilities-Ds3320iS.cjs");
10
- const require_graph_schema = require("./graph-schema-BGbJumCY.cjs");
11
- const require_action_log = require("./action-log-HniMMF7f.cjs");
12
- const require_dex_tool = require("./dex-tool-DLWnff1n.cjs");
13
- const require_dex_registry = require("./dex-registry-Chs79Ukc.cjs");
2
+ const require_rolldown_runtime = require("./rolldown-runtime-BW-eSwOZ.cjs");
3
+ const require_print_result = require("./print-result-BYppJlUi.cjs");
4
+ const require_tool_visibility = require("./tool-visibility-DIpgPULN.cjs");
5
+ const require_client = require("./client-Ddk4X9Ko.cjs");
6
+ const require_usage_status = require("./usage-status-DnV3I3gX.cjs");
7
+ const require_subscription_status = require("./subscription-status-w4zI2KCK.cjs");
8
+ const require_rules = require("./rules-BKwfmNsJ.cjs");
9
+ const require_capabilities = require("./capabilities-DalimVY2.cjs");
10
+ const require_graph_schema = require("./graph-schema-C8Pi6r7c.cjs");
11
+ const require_action_log = require("./action-log-WMW6xFMx.cjs");
12
+ const require_answer_hint = require("./answer-hint-BlYEBq_Y.cjs");
13
+ const require_dex_tool = require("./dex-tool-DsM-pSku.cjs");
14
+ const require_dex_registry = require("./dex-registry-CZQB2YhU.cjs");
15
+ const require_token_lookup = require("./token-lookup-BJ00JO9A.cjs");
14
16
  let node_url = require("node:url");
15
17
  let node_path = require("node:path");
16
18
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
@@ -24,7 +26,7 @@ let _modelcontextprotocol_sdk_server_mcp_js = require("@modelcontextprotocol/sdk
24
26
  let _modelcontextprotocol_sdk_server_stdio_js = require("@modelcontextprotocol/sdk/server/stdio.js");
25
27
  let _modelcontextprotocol_sdk_client_index_js = require("@modelcontextprotocol/sdk/client/index.js");
26
28
  let _modelcontextprotocol_sdk_client_streamableHttp_js = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
27
- //#region src/mcp/rate-limit.ts
29
+ // src/mcp/rate-limit.ts
28
30
  /**
29
31
  * The graph endpoint limits requests per address. Its refusal arrives as a
30
32
  * thrown HTTP error, "too many requests from this address; retry after 3
@@ -102,8 +104,7 @@ function rateLimitedResult(toolName, err) {
102
104
  isError: true
103
105
  };
104
106
  }
105
- //#endregion
106
- //#region src/mcp/batch-busy-retry.ts
107
+ // src/mcp/batch-busy-retry.ts
107
108
  /**
108
109
  * A graph_query_batch member that reads the chain node costs several node
109
110
  * calls (an Address read costs four), and the graph server caps node calls
@@ -220,8 +221,7 @@ async function withBusyRetry(args, call, sleep = defaultSleep) {
220
221
  }
221
222
  return result;
222
223
  }
223
- //#endregion
224
- //#region src/mcp/layer-routing.ts
224
+ // src/mcp/layer-routing.ts
225
225
  /** The routing rule, in one sentence. The server states it in the same words. */
226
226
  const ROUTING_RULE = "Route by what the question names: an address, a pair with a day, a transaction or a block. Topology searches outward from an address, while facts and chain look up one known thing.";
227
227
  /** The rule in three lines, one for each layer. */
@@ -240,7 +240,7 @@ const ROUTING_HANDOFF = "The layers hand each other keys, and each key keeps its
240
240
  * A whole-chain question is a time-bounded topology search, sent only when the
241
241
  * family of its link type is close to the head; a refusal names the family.
242
242
  */
243
- const ROUTING_NOT_SERVED = "A question about the whole chain (recent activity, the biggest senders, a top list) is a `USE topology` search: bound it by time with `f.last_seen_timestamp >= <epoch ms>` on the `FLOWS_TO` link, then sort and `LIMIT`. A search has 10 s. Read `Head` first (`USE chain MATCH (h:Head) RETURN h.behind_money, h.behind_dex, h.behind_transfers`, under a second): a `FLOWS_TO` search is sent when `behind_money` is at most 100000; a `SWAPPED`, `ADDED_LIQUIDITY` or `REMOVED_LIQUIDITY` search when `behind_dex` is at most 100000; a `TRANSFERRED` search when `behind_transfers` is at most 100000 (100000 blocks is a few hours: a robinhood block is about a tenth of a second apart from the next). When the family is further behind, the search cannot finish, so do not send it: say which family, how many blocks, and ask for an address. On a server whose Head has no `behind_money`, read `h.graph_blocks_behind` and hold it to the same limit. On a server whose Head has no `behind_transfers`, it serves no `TRANSFERRED` link: send no `TRANSFERRED` search. Never turn the block count into days or hours by head. To say how fresh the data is, give the newest `_utc` time you read on the layer you used: a family's lag counts its slowest layer, and the links of an address and the facts rows are often newer than it. If the server refuses the search with `anchor_missing` or `family_behind`, or stops it with `query_timeout`, it cannot search the whole chain now: say so in one line, name the family the refusal names, and ask for an address or drop the link type that is behind. A narrower window times out the same way, so do not send it again.";
243
+ const ROUTING_NOT_SERVED = "A question about the whole chain (recent activity, the biggest senders, a top list) is a `USE topology` search: bound it by time with `f.last_seen_timestamp >= <epoch ms>` on the `FLOWED_TO` link, then sort and `LIMIT`. A search has 10 s. Read `Head` first (`USE chain MATCH (h:Head) RETURN h.behind_money, h.behind_dex, h.behind_transfers`, under a second): a `FLOWED_TO` search is sent when `behind_money` is at most 100000; a `SWAPPED`, `ADDED_LIQUIDITY` or `REMOVED_LIQUIDITY` search when `behind_dex` is at most 100000; a `TRANSFERRED` search when `behind_transfers` is at most 100000 (100000 blocks is a few hours: a robinhood block is about a tenth of a second apart from the next). When the family is further behind, the search cannot finish, so do not send it: say which family, how many blocks, and ask for an address. On a server whose Head has no `behind_money`, read `h.graph_blocks_behind` and hold it to the same limit. On a server whose Head has no `behind_transfers`, it serves no `TRANSFERRED` link: send no `TRANSFERRED` search. Never turn the block count into days or hours by head. To say how fresh the data is, give the newest `_utc` time you read on the layer you used: a family's lag counts its slowest layer, and the links of an address and the facts rows are often newer than it. If the server refuses the search with `anchor_missing` or `family_behind`, or stops it with `query_timeout`, it cannot search the whole chain now: say so in one line, name the family the refusal names, and ask for an address or drop the link type that is behind. A narrower window times out the same way, so do not send it again.";
244
244
  /** What a refusal carries, and which part of it decides the move. */
245
245
  const MOVE_INTRO = "A refused, killed, busy or failed query comes back with `error_detail`: `code`, `rule`, `class`, `fix` and `example`. The `class` decides your next move.";
246
246
  /** The move for each class of the refusal envelope. */
@@ -288,8 +288,7 @@ function routingHead() {
288
288
  function routingHintLines() {
289
289
  return [`- Pick the layer first. ${ROUTING_RULE} 1. ${ROUTING_LINES[0]} 2. ${ROUTING_LINES[1]} 3. ${ROUTING_LINES[2]} ${ROUTING_NOT_SERVED} ${ROUTING_ADDRESS_ON_CHAIN} ${ROUTING_TWO_FIT} ${ROUTING_HANDOFF} The lookups that USE chain serves are listed in chain_admission.lookups of meta_network_capabilities. Read every limit that the server publishes from meta_network_capabilities (chain_admission and, when the server sends them, topology_admission and facts_admission). Never write a limit down.`, `- Act on a refusal by its class. ${moveLines().join(" ")}`];
290
290
  }
291
- //#endregion
292
- //#region src/mcp/view-server.ts
291
+ // src/mcp/view-server.ts
293
292
  /**
294
293
  * The Chain Insights view as a browser page on the user's own PC.
295
294
  *
@@ -511,7 +510,7 @@ async function startViewServer(options) {
511
510
  };
512
511
  }
513
512
  Object.freeze(["from_address", "to_address"]);
514
- /** What a FLOWS_TO link carries: the link panel of the view shows each one. */
513
+ /** What a FLOWED_TO link carries: the link panel of the view shows each one. */
515
514
  const GRAPH_LINK_COLUMNS = Object.freeze([
516
515
  "amount_usd_sum",
517
516
  "tx_count",
@@ -534,12 +533,11 @@ const GRAPH_OPTIONAL_COLUMNS = Object.freeze([
534
533
  ...GRAPH_NODE_COLUMNS
535
534
  ]);
536
535
  Object.freeze([...GRAPH_LINK_COLUMNS, ...GRAPH_NODE_COLUMNS]);
537
- /** The `RETURN` tail of a FLOWS_TO recipe over link `f` between `from` and `to`. */
536
+ /** The `RETURN` tail of a FLOWED_TO recipe over link `f` between `from` and `to`. */
538
537
  function flowsRecipeReturn(from, to, link = "f") {
539
538
  return `${from}.address AS from_address, ${to}.address AS to_address, ${link}.amount_usd_sum AS amount_usd_sum, ${link}.tx_count AS tx_count, ${link}.first_seen_timestamp AS first_seen_timestamp, ${link}.last_seen_timestamp AS last_seen_timestamp, ${from}.labels AS from_labels, ${to}.labels AS to_labels, ${from}.is_exchange AS from_is_exchange, ${to}.is_exchange AS to_is_exchange`;
540
539
  }
541
- //#endregion
542
- //#region src/mcp/remote-connect.ts
540
+ // src/mcp/remote-connect.ts
543
541
  /**
544
542
  * Connects a client to a fresh transport. The SDK leaves a transport attached
545
543
  * when `connect` fails after `start` (an initialize answered 429), and the
@@ -649,8 +647,7 @@ async function connectRemote(options) {
649
647
  message: describeRemoteFailure(options.endpoint, lastErr, lastStatus)
650
648
  };
651
649
  }
652
- //#endregion
653
- //#region src/mcp/proxy.ts
650
+ // src/mcp/proxy.ts
654
651
  const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
655
652
  "meta_network_capabilities",
656
653
  "meta_schema",
@@ -659,6 +656,7 @@ const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
659
656
  "meta_help",
660
657
  "meta_rules",
661
658
  require_dex_tool.META_DEX_LOOKUP_TOOL,
659
+ require_token_lookup.META_TOKEN_LOOKUP_TOOL,
662
660
  "wallet_balance",
663
661
  "wallet_topup",
664
662
  require_rules.SUBSCRIPTION_TOPUP_TOOL,
@@ -717,20 +715,22 @@ function resolveMcpProxyMode(env = process.env) {
717
715
  if (raw === "no-workspace" || raw === "workspace-less") return "stateless";
718
716
  throw new Error(`CHAIN_INSIGHTS_MCP_PROXY_MODE must be workspace or stateless; got "${raw}"`);
719
717
  }
720
- const GRAPH_LAYERS_TEXT = "Use USE topology for topology (address/FLOWS_TO/OPERATED_BY/LINKED graph with SWAPPED, ADDED_LIQUIDITY, REMOVED_LIQUIDITY, BRIDGED and the Pool, Token and NFT labels, unified recent+historical) and USE facts for bounded TRANSFER, SWAP, LIQUIDITY_ADD, LIQUIDITY_REMOVE and BRIDGE_CROSSING rows and enrichment, and USE chain for the chain node's own record of one known transaction, block, address or the head.";
718
+ const GRAPH_LAYERS_TEXT = "Use USE topology for topology (address/FLOWED_TO/OPERATED_BY/LINKED graph with SWAPPED, ADDED_LIQUIDITY, REMOVED_LIQUIDITY, BRIDGED and the Pool, Token and NFT labels, unified recent+historical) and USE facts for bounded TRANSFER, SWAP, LIQUIDITY_ADD, LIQUIDITY_REMOVE and BRIDGE_CROSSING rows and enrichment, and USE chain for the chain node's own record of one known transaction, block, address or the head.";
721
719
  const TOOL_RULES_FIRST = "Rules first: if the chain-insights-cypher skill is not loaded in this chat, call meta_rules once before this tool. For a graph, alias the columns from_address and to_address; the host draws the picture from the answer itself. Never draw it again with another tool, such as a visualize or widget tool.";
722
720
  const GRAPH_QUERY_DEX_DOOR_SENTENCE = "A question that names an exchange and no address starts with meta_dex_lookup, never with a scan of :Protocol, :Pool or labels.";
721
+ const GRAPH_QUERY_TOKEN_DOOR_SENTENCE = "A question that names a token by its ticker or name and gives no contract starts with meta_token_lookup: tickers collide, so never guess the contract.";
723
722
  const GRAPH_QUERY_ROLE_MARKS_SENTENCE = ":Sanctioned (is_sanctioned) means the address is on a sanctions list. :IssuerFrozen (is_issuer_frozen) means an issuer froze this wallet; the token in labels says which. Neither is :Scam.";
724
723
  const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
725
724
  meta_network_capabilities: "Return the current Chain Insights network and tool support matrix. Takes no arguments: send {}.",
726
725
  meta_schema: require_graph_schema.META_SCHEMA_DESCRIPTION,
727
726
  [require_dex_tool.META_DEX_LOOKUP_TOOL]: require_dex_tool.META_DEX_LOOKUP_DESCRIPTION,
727
+ [require_token_lookup.META_TOKEN_LOOKUP_TOOL]: require_token_lookup.META_TOKEN_LOOKUP_DESCRIPTION,
728
728
  meta_usage_status: "Return the caller's public free graph_query quota for the current UTC day.",
729
729
  meta_subscription_status: require_rules.META_SUBSCRIPTION_STATUS_DESCRIPTION,
730
730
  meta_help: "Show a short guide to Chain Insights tools and workflow.",
731
731
  meta_rules: "Return the Chain Insights rules: how to write graph_query and graph_query_batch reads that are served, how to name columns so the answer is drawn as a graph, a time series or a table, and how to write the answer. Call it once per chat, before the first graph query, when the chain-insights-cypher skill is not loaded. Takes no arguments: send {}.",
732
732
  wallet_balance: "Show the local Chain Insights payment wallet address, payment network, token, and amount.",
733
- graph_query: `${TOOL_RULES_FIRST} Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. ${GRAPH_LAYERS_TEXT} ${GRAPH_QUERY_DEX_DOOR_SENTENCE} ${GRAPH_QUERY_ROLE_MARKS_SENTENCE} ${ROUTING_NOT_SERVED} Preserve full addresses exactly, and write every address in full, all 42 characters, in your answer: never shorten one with ... or ….`,
733
+ graph_query: `${TOOL_RULES_FIRST} Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. ${GRAPH_LAYERS_TEXT} ${GRAPH_QUERY_DEX_DOOR_SENTENCE} ${GRAPH_QUERY_TOKEN_DOOR_SENTENCE} ${GRAPH_QUERY_ROLE_MARKS_SENTENCE} ${ROUTING_NOT_SERVED} Preserve full addresses exactly, and write every address in full, all 42 characters, in your answer: never shorten one with ... or ….`,
734
734
  graph_query_batch: `${TOOL_RULES_FIRST} Run multiple read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch. Prefer this for related topology/facts reads. For a time series across days, send one USE facts total per day with the query id set to the day, "YYYY-MM-DD": the view joins them into one series. Write every address in full in your answer, all 42 characters.`
735
735
  };
736
736
  const KNOWN_PUBLIC_TOOL_TITLES = {
@@ -743,7 +743,7 @@ const EMPTY_INPUT_SCHEMA = zod.strictObject({});
743
743
  const REMOTE_GRAPH_TOOL_REQUEST_TIMEOUT_MS = 9e5;
744
744
  const PICTURE_RULES = [
745
745
  "Pictures: hosts that draw views, such as Claude Desktop and the Codex app, draw a graph_query answer from its column names. No other tool is needed. Choose the picture by the question: who sent to whom, flows and routes are a graph; how something changed over time is a time series; a list, a lookup or the details of one thing is a table.",
746
- `- Rows with from_address and to_address columns draw a graph of at most 5,000 addresses. Optional columns: ${GRAPH_OPTIONAL_COLUMNS.join(", ")}. A recipe that draws a graph returns all of them; a column it leaves out shows as Unavailable in the drawn link. Example: USE topology MATCH (a:Address {address: $addr})-[f:FLOWS_TO]->(b:Address) WHERE NOT a:Pool RETURN ${flowsRecipeReturn("a", "b")} ORDER BY f.last_seen_timestamp DESC LIMIT 25`,
746
+ `- Rows with from_address and to_address columns draw a graph of at most 5,000 addresses. Optional columns: ${GRAPH_OPTIONAL_COLUMNS.join(", ")}. A recipe that draws a graph returns all of them; a column it leaves out shows as Unavailable in the drawn link. Example: USE topology MATCH (a:Address {address: $addr})-[f:FLOWED_TO]->(b:Address) WHERE NOT a:Pool RETURN ${flowsRecipeReturn("a", "b")} ORDER BY f.last_seen_timestamp DESC LIMIT 25`,
747
747
  "- Rows with a day, date, hour, week, month or *_timestamp column, number columns, no address in any value and at least 3 distinct times draw a time series. Within one day, the transfers of a known pair: USE facts MATCH (a:Address {address: $from})-[t:TRANSFER]->(b:Address {address: $to}) WHERE t.block_date = \"YYYY-MM-DD\" RETURN t.block_timestamp AS block_timestamp, t.amount_usd AS amount_usd LIMIT 200",
748
748
  "- Across days: facts reads one day at a time, so send graph_query_batch with one query per day (3 to 20 days), each query id the day as \"YYYY-MM-DD\", each returning one total row: USE facts MATCH (a:Address {address: $from})-[t:TRANSFER]->(b:Address {address: $to}) WHERE t.block_date = \"YYYY-MM-DD\" RETURN count(t) AS tx_count, sum(t.amount_usd) AS amount_usd_sum. The view joins the days into one time series. Do not group by day or name several days in one read: both are refused.",
749
749
  "- The balance of one address over time is a USE chain read, never topology or facts. a.balance is the native coin, ETH, in wei (10^18 wei is one ETH), as decimal text; no layer serves a token balance. A batch holds at most chain_admission.batch_max chain reads, so one chart holds at least 3 points and at most that many: days spread over the user's window, or with no window one day a week back from today, today last. First read the head: USE chain MATCH (h:Head) RETURN h.block_height, h.block_timestamp (H and T). Then read one block near the oldest day, guessed at H minus 864000 blocks a day: USE chain MATCH (b:Block {block_height: N}) RETURN b.block_height, b.block_timestamp (h0 and T0). Blocks per day B = (H - h0) x 86400000 / (T - T0). The block of a day is H - (T - E) x B / 86400000, where E is the last millisecond of that UTC day. Then send one graph_query_batch, each query id the day as \"YYYY-MM-DD\", each returning only the balance: USE chain MATCH (a:Address {address: $addr, at_block: N}) RETURN a.balance. For today, or a block nearer the head than chain_admission.at_block_min_depth, leave at_block out. The view joins the days into one time series. Answer in ETH and say only ETH is shown.",
@@ -775,28 +775,28 @@ const GRAPH_SCHEMA_HINTS = [
775
775
  "- An Address carries a kind from chain facts. topology carries :Account or :Contract as a second label on an Address (:Contract:SmartAccount for a contract wallet), with is_contract kept beside :Contract, and an address that only received has none. facts serves no kind, and a facts read that names :Account or :Contract is refused: ask USE topology or USE chain. chain Address returns is_contract, nonce and delegated_to at the newest block, or at the block named by at_block. block_timestamp is epoch milliseconds on every layer.",
776
776
  "- Address nodes carry address, network, labels, and the role flags is_exchange, is_scam, is_victim, is_sanctioned and is_issuer_frozen. (:Address)-[:LINKED]-(:Address) is an undirected ownership-overlay edge (basis derived/associated, plus confidence, source_event, declared_owner, owner_state) asserting the two addresses are controlled by the same actor. LINKED is served on the topology graph only. Enumerate LINKED neighbors with MATCH (a:Address {address: $addr})-[l:LINKED]-(b:Address) RETURN b.address, b.network, l.basis, l.confidence LIMIT 25.",
777
777
  "- Labels hold role words, never detector names: Exchange (plus the exchange name), Scam, Victim, Sanctioned (plus the entity name) and IssuerFrozen (plus the token symbol). Each role is also a node label and a flag on the Address: :Exchange and is_exchange follow the exchange label, :Scam and is_scam the risk label, :Victim and is_victim the protection label, :Sanctioned and is_sanctioned the sanctioned label, :IssuerFrozen and is_issuer_frozen the issuer_frozen label: an issuer froze this wallet; the token in labels says which. Each flag is present only when true and absent otherwise, never false: test IS NOT NULL or IS NULL, not = false. A withdrawn label removes its node label and its flag.",
778
- "- Address nodes carry base activity rollups: degree_in/degree_out/degree_total (distinct counterparty addresses), tx_in_count/tx_out_count/tx_total_count, total_in_usd/total_out_usd/total_volume_usd, net_flow_usd (in minus out; positive = net receiver) — all computed from external flows only — and first_activity_timestamp/last_activity_timestamp/activity_span_days, which include all flows (self-loops included). FLOWS_TO edges carry exactly tx_count, amount_usd_sum (total money flow, token and native value merged), first_seen_timestamp, last_seen_timestamp. Lifetime aggregates are the only serving window. Averages are computed inline (amount_usd_sum / toFloat(tx_count)). tx_count counts token and native transfers plus internal native transfers (a contract sending ETH during a call), and amount_usd_sum prices them all. USE facts TRANSFER lists all three, so the rows of a pair are the transfers its link counts, up to the height the link was built to. A link covers all time and a USE facts read covers one day: read the transfers of a pair one day at a time. A transaction anchor of a pair resolves through USE facts, on the UTC day of the first_seen_timestamp or last_seen_timestamp of the link: MATCH (a:Address {address: $from})-[t:TRANSFER]->(b:Address {address: $to}) WHERE t.block_date = \"YYYY-MM-DD\" RETURN t.tx_id, t.block_timestamp LIMIT 1.",
779
- "- For actor-level exposure (AC11), UNION FLOWS_TO and SWAPPED reachability over one visible LINKED hop instead of expanding through the LINKED edge itself: MATCH (a:Address {address: $addr})-[:LINKED]-(owned:Address)-[r:FLOWS_TO|SWAPPED]-(b:Address) WHERE NOT a:Pool AND NOT a:Protocol AND NOT a:System AND NOT a.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"] AND NOT owned:Pool AND NOT owned:Protocol AND NOT owned:System AND NOT owned.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"] AND owned.address <> b.address AND a.address <> b.address RETURN owned.address, b.address, type(r), coalesce(r.amount_usd_sum, r.bought_usd) LIMIT 50.",
778
+ "- Address nodes carry base activity rollups: degree_in/degree_out/degree_total (distinct counterparty addresses), tx_in_count/tx_out_count/tx_total_count, total_in_usd/total_out_usd/total_volume_usd, net_flow_usd (in minus out; positive = net receiver) — all computed from external flows only — and first_activity_timestamp/last_activity_timestamp/activity_span_days, which include all flows (self-loops included). FLOWED_TO edges carry exactly tx_count, amount_usd_sum (total money flow, token and native value merged), first_seen_timestamp, last_seen_timestamp. Lifetime aggregates are the only serving window. Averages are computed inline (amount_usd_sum / toFloat(tx_count)). tx_count counts token and native transfers plus internal native transfers (a contract sending ETH during a call), and amount_usd_sum prices them all. USE facts TRANSFER lists all three, so the rows of a pair are the transfers its link counts, up to the height the link was built to. A link covers all time and a USE facts read covers one day: read the transfers of a pair one day at a time. A transaction anchor of a pair resolves through USE facts, on the UTC day of the first_seen_timestamp or last_seen_timestamp of the link: MATCH (a:Address {address: $from})-[t:TRANSFER]->(b:Address {address: $to}) WHERE t.block_date = \"YYYY-MM-DD\" RETURN t.tx_id, t.block_timestamp LIMIT 1.",
779
+ "- For actor-level exposure (AC11), UNION FLOWED_TO and SWAPPED reachability over one visible LINKED hop instead of expanding through the LINKED edge itself: MATCH (a:Address {address: $addr})-[:LINKED]-(owned:Address)-[r:FLOWED_TO|SWAPPED]-(b:Address) WHERE NOT a:Pool AND NOT a:Protocol AND NOT a:System AND NOT a.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"] AND NOT owned:Pool AND NOT owned:Protocol AND NOT owned:System AND NOT owned.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"] AND owned.address <> b.address AND a.address <> b.address RETURN owned.address, b.address, type(r), coalesce(r.amount_usd_sum, r.bought_usd) LIMIT 50.",
780
780
  "- Labels and per-label risk live on the address node: the labels array plus three parallel lists, label_risk_labels, label_risk_levels and label_risk_updated_timestamps, where entry i of each list is one label row. No overall risk score is served. USE facts serves bounded single-event rows (TRANSFER, SWAP, LIQUIDITY_ADD, LIQUIDITY_REMOVE and BRIDGE_CROSSING edges) only; lifetime address metrics (degrees, totals, activity window) are node properties on USE topology.",
781
781
  "- (from:Address)-[t:TRANSFER]->(to:Address) on USE facts returns individual transfer rows, not aggregates, with properties amount, amount_usd, asset_symbol, asset_contract, tx_id, block_height, block_timestamp, event_index, edge_index, kind, price_usd, and price_missing. Every TRANSFER row has a kind: token, native or internal. An internal row is ETH a contract sends while it runs a call, such as the ETH leg of a wrap. Add t.kind = \"internal\" to the pair and the day to read only the internal rows. A facts read names an address pair with one day, whether it is a TRANSFER row-select or a count()/sum() aggregate: both endpoint addresses as {address: \"...\"} on from and to, with WHERE t.block_date = \"YYYY-MM-DD\". A transaction is read on USE chain by its tx_id, not on facts. t.block_timestamp bounds in epoch milliseconds may narrow the day to a time window. One address, a day alone, a window of days, a block range or a bare LIMIT is not enough. A facts read holds at most 200 rows in a reply, has one relationship and no hop, and takes no ORDER BY: sort the page yourself.",
782
782
  "- Facts graph labels include Address; the TRANSFER, SWAP, LIQUIDITY_ADD, LIQUIDITY_REMOVE and BRIDGE_CROSSING relationships each connect two Address nodes. Facts address keys match topology address values exactly.",
783
- "- Topology relationships include FLOWS_TO, SWAPPED, OPERATED_BY, LINKED, and RISK_PROXIMITY between Address nodes, ADDED_LIQUIDITY and REMOVED_LIQUIDITY to and from Pool nodes, and BRIDGED to and from Chain nodes.",
783
+ "- Topology relationships include FLOWED_TO, SWAPPED, OPERATED_BY, LINKED, and RISK_PROXIMITY between Address nodes, ADDED_LIQUIDITY and REMOVED_LIQUIDITY to and from Pool nodes, and BRIDGED to and from Chain nodes.",
784
784
  "- (:Address)-[:OPERATED_BY]->(:Address) is the directed owner-to-operator edge: the transaction sender that moved the owner's tokens (ERC-20/721), or the event operator (ERC-1155); not the approved spender. Aggregate properties: tx_count, amount_usd_sum, first_seen_timestamp, last_seen_timestamp, and optional token_standard (ERC20/ERC721/ERC1155; absent when the pair is mixed-standard). Valuation fields: valuation_tracked_count, valued_count and the reason counters missing_valuation_price_count, unknown_quantity_count, unrepresentable_quantity_count and usd_range_count. valuation_complete is true when valued_count equals valuation_tracked_count, valuation_coverage_ratio is valued_count divided by valuation_tracked_count, and amount_usd_sum counts a transfer with no USD value as 0, so it is a floor unless valuation_complete is true. One edge per owner/operator pair; direct transfers with no operator create none; an owner never operates for itself. Topology-only, and a topology fact — not a risk label. Probe: MATCH (owner:Address)-[operation:OPERATED_BY]->(operator:Address {address: $addr}) RETURN owner.address AS owner, operation.tx_count AS tx_count ORDER BY operation.tx_count DESC LIMIT 10.",
785
- "- FLOWS_TO properties are tx_count, amount_usd_sum, first_seen_timestamp, last_seen_timestamp. pair_key and synced_through_height are internal sync bookkeeping, not to be queried. synced_through_height is also on the other summed links (SWAPPED, OPERATED_BY, ADDED_LIQUIDITY, REMOVED_LIQUIDITY, BRIDGED, APPROVED, SPONSORED, BUNDLED, SIGNED_FOR) and pair_key on SWAPPED, ADDED_LIQUIDITY, REMOVED_LIQUIDITY and BRIDGED: bookkeeping there too. Tx ids of every transfer, internal ones included, come from USE facts TRANSFER. Averages come from inline arithmetic. FLOWS_TO into and out of pools is kept; the pool trace rule below governs a trace that reaches one.",
786
- "- Swaps, liquidity and bridges on USE topology are lifetime totals per pair; single events are USE facts rows. (:Address)-[:SWAPPED]->(:Address) joins a swap payer to a different recipient, one edge per payer, recipient, sold_asset and bought_asset, with swap_count, sold_amount_raw, bought_amount_raw, sold_usd, bought_usd, pools, families, strength, first_seen_height and last_seen_height. sold_usd and bought_usd sum the routes on the edge at the day price: a route side with no price adds 0, so 0 can mean no price. Do not read 0 as worth nothing. The USE facts SWAP row says which side had no price (sold_price_missing, bought_price_missing). strength is swap (the whole route is proven: payer, recipient, assets, exact raw amounts and conservation) or swap_like (the shape is a swap but the pool code is not proven). Today no route is swap: the swap reader reads transaction receipts only, with no execution trace, so every served route is swap_like, with reason unknown_pool_code and families unknown. A Uniswap V2 or V3 swap reads this way, and unknown does not mean the protocol is unsupported. A filter on strength = \"swap\" or on a known family matches nothing. A route that could not be paired (swap_unsplit) is never served: it has no payer, recipient or pool, makes no SWAPPED edge and no SWAP row, and exists in the warehouse only. Every Uniswap v4 swap is swap_unsplit today, by design, so v4 swaps are hidden. A self swap makes no edge, and a missing SWAPPED edge is not proof that no swap happened. Swap attribution is read from SWAPPED, the aggregate (strength, pools, families), or from the USE facts SWAP row, one route. FLOWS_TO carries value only.",
785
+ "- FLOWED_TO properties are tx_count, amount_usd_sum, first_seen_timestamp, last_seen_timestamp. pair_key and synced_through_height are internal sync bookkeeping, not to be queried. synced_through_height is also on the other summed links (SWAPPED, OPERATED_BY, ADDED_LIQUIDITY, REMOVED_LIQUIDITY, BRIDGED, APPROVED, SPONSORED, BUNDLED, SIGNED_FOR) and pair_key on SWAPPED, ADDED_LIQUIDITY, REMOVED_LIQUIDITY and BRIDGED: bookkeeping there too. Tx ids of every transfer, internal ones included, come from USE facts TRANSFER. Averages come from inline arithmetic. FLOWED_TO into and out of pools is kept; the pool trace rule below governs a trace that reaches one.",
786
+ "- Swaps, liquidity and bridges on USE topology are lifetime totals per pair; single events are USE facts rows. (:Address)-[:SWAPPED]->(:Address) joins a swap payer to a different recipient, one edge per payer, recipient, sold_asset and bought_asset, with swap_count, sold_amount_raw, bought_amount_raw, sold_usd, bought_usd, pools, families, strength, first_seen_height and last_seen_height. sold_usd and bought_usd sum the routes on the edge at the day price: a route side with no price adds 0, so 0 can mean no price. Do not read 0 as worth nothing. The USE facts SWAP row says which side had no price (sold_price_missing, bought_price_missing). strength is swap (the whole route is proven: payer, recipient, assets, exact raw amounts and conservation) or swap_like (the shape is a swap but the pool code is not proven). Today no route is swap: the swap reader reads transaction receipts only, with no execution trace, so every served route is swap_like, with reason unknown_pool_code and families unknown. A Uniswap V2 or V3 swap reads this way, and unknown does not mean the protocol is unsupported. A filter on strength = \"swap\" or on a known family matches nothing. A route that could not be paired (swap_unsplit) is never served: it has no payer, recipient or pool, makes no SWAPPED edge and no SWAP row, and exists in the warehouse only. Every Uniswap v4 swap is swap_unsplit today, by design, so v4 swaps are hidden. A self swap makes no edge, and a missing SWAPPED edge is not proof that no swap happened. Swap attribution is read from SWAPPED, the aggregate (strength, pools, families), or from the USE facts SWAP row, one route. FLOWED_TO carries value only.",
787
787
  "- Pool is a second label on an Address: a pool contract the DEX indexer knows, traded or not (a bonding curve or an empty pair is a Pool too; a singleton pool manager never is). Once there is liquidity, it also carries liquidity_added_usd, liquidity_removed_usd, liquidity_net_usd, provider_count and receiver_count; a pool known only to the DEX indexer has none of them. (:Address)-[:ADDED_LIQUIDITY]->(:Pool) and (:Pool)-[:REMOVED_LIQUIDITY]->(:Address) join named providers and receivers to the pool, one link per party, pool and asset, with asset (the token contract in full, or NATIVE for the coin), event_count, amount_raw_sum (the exact total of that asset in base units, as text), usd, unpriced_count, first_seen_height and last_seen_height; REMOVED_LIQUIDITY adds fees_raw_sum (exact, that asset only), receiver_added_usd (USD the receiver itself added to the same pool, over every asset) and receiver_provided. asset_key is bookkeeping, never named in a query. A party with two assets in one pool has two links: sum usd over them for the pool total, and take receiver_added_usd once, as max(). A receiver's profit from a pool is that sum minus receiver_added_usd: receiver_provided false is a drain by a stranger, true with a large profit is the creator's rug pull.",
788
788
  "- Token and NFT are second labels on an Address that mark a token contract: Token for every ERC20, ERC721, ERC1155 and ERC6909 contract the asset scan knows, NFT for the ERC721 and ERC1155 ones, and token_standard on the node says which. A token name from an explorer gives Token, not Protocol. They are marks, not stops: the pool trace rule and the guards below do not change.",
789
- "- (:Address)-[:BRIDGED]->(:Chain) is outbound bridge use and (:Chain)-[:BRIDGED]->(:Address) inbound, one link per address, Chain node, direction, event kind and asset, with kind, asset (the token contract in full, NATIVE for the coin, or UNKNOWN when the bridge named no local contract), events, amount_raw_sum (the exact total of that kind and asset in base units, as text), first_height, last_height and last_bridge_event_id. asset_key is bookkeeping, never named in a query. There is no kinds list and no totals_raw map: an address that used two kinds or two assets has one link for each. A Chain node (network, address) is the remote bridge endpoint, never an Address, so no FLOWS_TO walk passes through it.",
790
- "- Pool trace rule, for every trace: 1. Enter a `:Pool` on any edge. 2. Leave a `:Pool` only on `REMOVED_LIQUIDITY`, to the address the liquidity was paid to. 3. Never leave a `:Pool` on `FLOWS_TO`. 4. Across a swap, follow `SWAPPED` from payer to recipient, between two different addresses. Do not walk through the pool. Rug-pull probe: MATCH (victim:Address {address: $addr})-[paid:FLOWS_TO]->(pool:Pool)-[removal:REMOVED_LIQUIDITY]->(receiver:Address) WHERE NOT victim:Pool AND NOT victim:Protocol AND NOT victim:System AND NOT victim.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"] AND receiver.address <> victim.address RETURN pool.address AS pool_address, receiver.address AS receiver_address, sum(removal.usd) AS removed_usd, max(removal.receiver_added_usd) AS receiver_added_usd, max(removal.receiver_provided) AS receiver_provided LIMIT 25.",
789
+ "- (:Address)-[:BRIDGED]->(:Chain) is outbound bridge use and (:Chain)-[:BRIDGED]->(:Address) inbound, one link per address, Chain node, direction, event kind and asset, with kind, asset (the token contract in full, NATIVE for the coin, or UNKNOWN when the bridge named no local contract), events, amount_raw_sum (the exact total of that kind and asset in base units, as text), first_height, last_height and last_bridge_event_id. asset_key is bookkeeping, never named in a query. There is no kinds list and no totals_raw map: an address that used two kinds or two assets has one link for each. A Chain node (network, address) is the remote bridge endpoint, never an Address, so no FLOWED_TO walk passes through it.",
790
+ "- Pool trace rule, for every trace: 1. Enter a `:Pool` on any edge. 2. Leave a `:Pool` only on `REMOVED_LIQUIDITY`, to the address the liquidity was paid to. 3. Never leave a `:Pool` on `FLOWED_TO`. 4. Across a swap, follow `SWAPPED` from payer to recipient, between two different addresses. Do not walk through the pool. Rug-pull probe: MATCH (victim:Address {address: $addr})-[paid:FLOWED_TO]->(pool:Pool)-[removal:REMOVED_LIQUIDITY]->(receiver:Address) WHERE NOT victim:Pool AND NOT victim:Protocol AND NOT victim:System AND NOT victim.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"] AND receiver.address <> victim.address RETURN pool.address AS pool_address, receiver.address AS receiver_address, sum(removal.usd) AS removed_usd, max(removal.receiver_added_usd) AS receiver_added_usd, max(removal.receiver_provided) AS receiver_provided LIMIT 25.",
791
791
  "- USE facts serves the single events. (payer:Address)-[s:SWAP]->(recipient:Address) is one row per swap route, self swaps included, with strength, reason, route_id and the sold_ and bought_ asset, amount and usd columns. (provider:Address)-[:LIQUIDITY_ADD]->(pool:Address) and (pool:Address)-[:LIQUIDITY_REMOVE]->(receiver:Address) are one row per liquidity event, with party_state and evidence_state. (sender:Address)-[c:BRIDGE_CROSSING]->(recipient:Address) is one row per bridge event. SWAP, LIQUIDITY_* and BRIDGE_CROSSING take the same rule as TRANSFER: an address pair with one day. USD comes from the daily price services, never from a swap: with no price, USD is empty and the matching price_missing column is true (price_missing on TRANSFER, sold_price_missing and bought_price_missing on SWAP, amount0_price_missing and amount1_price_missing on LIQUIDITY_*). block_timestamp on TRANSFER, SWAP and LIQUIDITY_* rows is epoch milliseconds, in filters and in results; BRIDGE_CROSSING has none.",
792
792
  "- A USE facts SWAP row carries no route: it has no pools and no families column. A read that names one of them, to return it, to filter on it or to order by it, is refused. The route of a swap stays a topology question. For the pools of the swaps of an address, read SWAPPED.pools and SWAPPED.families on USE topology, anchored on the payer or the recipient. SWAPPED has one link per payer, recipient, sold asset and bought asset, so its pools cover every route on the link, not one route.",
793
- "- Traversal rule: for BFS, fixed-hop fallback, shortest-path, or manual FLOWS_TO traversal, exchange hot wallets are terminal endpoints only. Do not expand from, through, or classify exchange nodes as deposit, suspect, or intermediate candidates; filter every non-terminal node with is_exchange IS NULL. is_exchange is absent unless true, so a labelled node with no is_exchange is walked through, and is_scam, is_victim and is_sanctioned do not end a walk. At a Pool, follow the pool trace rule above.",
794
- "- Pool guard: a trace walks FLOWS_TO and SWAPPED, so it crosses a swap from payer to recipient without passing through the pool. A walk may end at a Pool, but never starts at one or passes through one: its start and every address in its middle stay off a Pool. A walk of two or more hops also never starts at or passes through a Protocol contract or a System address. System is the kind of the mint and burn addresses 0x0000000000000000000000000000000000000000 and 0x000000000000000000000000000000000000dead; Protocol is shared infrastructure such as a PoolManager, a router or a bridge (the PoolManager 0x8366a39cc670b4001a1121b8f6a443a643e40951 is one, and it is no Pool). Each links millions of unrelated wallets, so a route through one connects nothing. Its start and every address in its middle carry NOT x:Pool AND NOT x:Protocol AND NOT x:System AND NOT x.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"], each its own AND term, never inside an OR. The graph does not write the System kind yet, so keep the address test too; it becomes redundant once System is written. A one-hop read of such an address needs no guard. A fixed-hop walk adds these terms for src and mid in its WHERE. A quantified or shortest-path walk puts the guards inside the path pattern, on the start and on up to 4 guarded hops before one last hop: MATCH p = SHORTEST 1 (a:Address {address: $from} WHERE NOT a:Pool AND NOT a:Protocol AND NOT a:System AND NOT a.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]) (()-[:FLOWS_TO|SWAPPED]-(via:Address) WHERE NOT via:Pool AND NOT via:Protocol AND NOT via:System AND NOT via.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]){0,4} ()-[:FLOWS_TO|SWAPPED]-(b:Address {address: $to}) RETURN [n IN nodes(p) | n.address] AS route LIMIT 5. ANY SHORTEST takes the same pattern. A route search asks for one path. An open target from one address: MATCH SHORTEST 1 (a:Address {address: $addr} WHERE NOT a:Pool AND NOT a:Protocol AND NOT a:System AND NOT a.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]) (()-[:FLOWS_TO|SWAPPED]-(via:Address) WHERE NOT via:Pool AND NOT via:Protocol AND NOT via:System AND NOT via.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]){0,4} ()-[:FLOWS_TO|SWAPPED]-(b:Address) RETURN b.address LIMIT 50. Use these shapes as written, changing only the addresses and the RETURN. A WHERE placed after a SHORTEST pattern runs after the shortest route is chosen, so it drops a route that crosses a pool or a system address instead of finding the route that avoids it.",
793
+ "- Traversal rule: for BFS, fixed-hop fallback, shortest-path, or manual FLOWED_TO traversal, exchange hot wallets are terminal endpoints only. Do not expand from, through, or classify exchange nodes as deposit, suspect, or intermediate candidates; filter every non-terminal node with is_exchange IS NULL. is_exchange is absent unless true, so a labelled node with no is_exchange is walked through, and is_scam, is_victim and is_sanctioned do not end a walk. At a Pool, follow the pool trace rule above.",
794
+ "- Pool guard: a trace walks FLOWED_TO and SWAPPED, so it crosses a swap from payer to recipient without passing through the pool. A walk may end at a Pool, but never starts at one or passes through one: its start and every address in its middle stay off a Pool. A walk of two or more hops also never starts at or passes through a Protocol contract or a System address. System is the kind of the mint and burn addresses 0x0000000000000000000000000000000000000000 and 0x000000000000000000000000000000000000dead; Protocol is shared infrastructure such as a PoolManager, a router or a bridge (the PoolManager 0x8366a39cc670b4001a1121b8f6a443a643e40951 is one, and it is no Pool). Each links millions of unrelated wallets, so a route through one connects nothing. Its start and every address in its middle carry NOT x:Pool AND NOT x:Protocol AND NOT x:System AND NOT x.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"], each its own AND term, never inside an OR. The graph does not write the System kind yet, so keep the address test too; it becomes redundant once System is written. A one-hop read of such an address needs no guard. A fixed-hop walk adds these terms for src and mid in its WHERE. A quantified or shortest-path walk puts the guards inside the path pattern, on the start and on up to 4 guarded hops before one last hop: MATCH p = SHORTEST 1 (a:Address {address: $from} WHERE NOT a:Pool AND NOT a:Protocol AND NOT a:System AND NOT a.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]) (()-[:FLOWED_TO|SWAPPED]-(via:Address) WHERE NOT via:Pool AND NOT via:Protocol AND NOT via:System AND NOT via.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]){0,4} ()-[:FLOWED_TO|SWAPPED]-(b:Address {address: $to}) RETURN [n IN nodes(p) | n.address] AS route LIMIT 5. ANY SHORTEST takes the same pattern. A route search asks for one path. An open target from one address: MATCH SHORTEST 1 (a:Address {address: $addr} WHERE NOT a:Pool AND NOT a:Protocol AND NOT a:System AND NOT a.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]) (()-[:FLOWED_TO|SWAPPED]-(via:Address) WHERE NOT via:Pool AND NOT via:Protocol AND NOT via:System AND NOT via.address IN [\"0x0000000000000000000000000000000000000000\", \"0x000000000000000000000000000000000000dead\"]){0,4} ()-[:FLOWED_TO|SWAPPED]-(b:Address) RETURN b.address LIMIT 50. Use these shapes as written, changing only the addresses and the RETURN. A WHERE placed after a SHORTEST pattern runs after the shortest route is chosen, so it drops a route that crosses a pool or a system address instead of finding the route that avoids it.",
795
795
  "- Call meta_schema {network} first when you need field names; it is cached for 24 hours. The two discovery reads below are the fallback.",
796
796
  "- Start schema discovery with endpoint-safe property reads: MATCH (n:Address) RETURN n.address AS address, n.network AS network, n.labels AS labels, n.last_activity_timestamp AS last_activity_timestamp LIMIT 20",
797
- "- Relationship discovery: MATCH (:Address)-[r:FLOWS_TO]->(:Address) RETURN r.amount_usd_sum AS amount_usd_sum, r.tx_count AS tx_count LIMIT 20",
797
+ "- Relationship discovery: MATCH (:Address)-[r:FLOWED_TO]->(:Address) RETURN r.amount_usd_sum AS amount_usd_sum, r.tx_count AS tx_count LIMIT 20",
798
798
  "- Anchor every topology read that filters on a link property: put an address in its pattern. Without one, a read starts from every link of the type it names, and you should not count on the filter to narrow that: WHERE x.strength = 'swap' on SWAPPED checks every SWAPPED link, LIMIT stops the read only after enough rows match, and a filter that matches few or none can run to the 60 s topology limit and fail with query_timeout. Example: MATCH (a:Address {address: $addr})-[x:SWAPPED]->(b:Address) WHERE x.swap_count >= 2 RETURN b.address, x.swap_count LIMIT 25. Pick an address with few links: degree_out and degree_in are a rough guide, because they count neighbours, not links, and an address with hundreds of thousands of neighbours can fail the same way. Discovery probes with LIMIT and no filter stay valid. The queries of one batch share a 100 s budget; USE facts queries stop at 30 s.",
799
- "- graph_query uses the active Chain Insights graph endpoint. Select the graph with USE topology for topology (address/FLOWS_TO/OPERATED_BY/LINKED graph with SWAPPED, ADDED_LIQUIDITY, REMOVED_LIQUIDITY, BRIDGED and the Pool, Token and NFT labels, unified recent+historical) and USE facts for bounded TRANSFER, SWAP, LIQUIDITY_ADD, LIQUIDITY_REMOVE and BRIDGE_CROSSING rows and enrichment, and USE chain for one keyed lookup on the chain node: a transaction by tx_id, a block by block_height or block_hash, an address at one block, or the head. On topology, address is the node grain, not the topology name.",
799
+ "- graph_query uses the active Chain Insights graph endpoint. Select the graph with USE topology for topology (address/FLOWED_TO/OPERATED_BY/LINKED graph with SWAPPED, ADDED_LIQUIDITY, REMOVED_LIQUIDITY, BRIDGED and the Pool, Token and NFT labels, unified recent+historical) and USE facts for bounded TRANSFER, SWAP, LIQUIDITY_ADD, LIQUIDITY_REMOVE and BRIDGE_CROSSING rows and enrichment, and USE chain for one keyed lookup on the chain node: a transaction by tx_id, a block by block_height or block_hash, an address at one block, or the head. On topology, address is the node grain, not the topology name.",
800
800
  "- 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.",
801
801
  "- Use USE facts graph patterns for fact and enrichment reads. Do not query internal table namespaces directly."
802
802
  ].join("\n");
@@ -851,12 +851,12 @@ function fallbackGraphPrimitiveTools() {
851
851
  * public. Reads the address only; nothing is signed or sent.
852
852
  */
853
853
  async function localTopupWalletAddress() {
854
- const { isWalletConfigured } = await Promise.resolve().then(() => require("./wallet-CgIAfdxL.cjs")).then((n) => n.wallet_exports);
854
+ const { isWalletConfigured } = await Promise.resolve().then(() => require("./wallet-BubGd_sG.cjs")).then((n) => n.wallet_exports);
855
855
  if (!await isWalletConfigured()) return null;
856
- const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-Cmnq7yip.cjs")).then((n) => n.tools_exports);
856
+ const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-DZLizem9.cjs")).then((n) => n.tools_exports);
857
857
  const account = await getWalletAccount();
858
858
  if (account.keyIsPublic === true) {
859
- const { PUBLIC_KEY_WALLET_TEXT } = await Promise.resolve().then(() => require("./known-keys-PKZF5GYd.cjs")).then((n) => n.known_keys_exports);
859
+ const { PUBLIC_KEY_WALLET_TEXT } = await Promise.resolve().then(() => require("./known-keys-Cy8lKDOA.cjs")).then((n) => n.known_keys_exports);
860
860
  throw new Error(PUBLIC_KEY_WALLET_TEXT);
861
861
  }
862
862
  return account.address;
@@ -864,7 +864,7 @@ async function localTopupWalletAddress() {
864
864
  /** The local wallet address for an older server that still asks for it; null when none. */
865
865
  async function localSubscriptionWalletAddress() {
866
866
  try {
867
- const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-Cmnq7yip.cjs")).then((n) => n.tools_exports);
867
+ const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-DZLizem9.cjs")).then((n) => n.tools_exports);
868
868
  return (await getWalletAccount()).address;
869
869
  } catch {
870
870
  return null;
@@ -1124,7 +1124,7 @@ function registerLocalPrompts(server) {
1124
1124
  query,
1125
1125
  "```",
1126
1126
  "",
1127
- `${GRAPH_LAYERS_TEXT} If you need schema context, first run small discovery queries such as MATCH (a:Address) RETURN a.address AS address, keys(a) AS address_properties LIMIT 5 and MATCH (:Address)-[r:FLOWS_TO]->(:Address) RETURN keys(r) AS flow_properties LIMIT 5. Return the full address when available; never shorten addresses with ellipses.`
1127
+ `${GRAPH_LAYERS_TEXT} If you need schema context, first run small discovery queries such as MATCH (a:Address) RETURN a.address AS address, keys(a) AS address_properties LIMIT 5 and MATCH (:Address)-[r:FLOWED_TO]->(:Address) RETURN keys(r) AS flow_properties LIMIT 5. Return the full address when available; never shorten addresses with ellipses.`
1128
1128
  ].join("\n"), "Graph query"));
1129
1129
  server.registerPrompt("graph-query-batch", {
1130
1130
  title: "Graph Query Batch",
@@ -1142,7 +1142,7 @@ function registerLocalPrompts(server) {
1142
1142
  "```",
1143
1143
  per_query_timeout_seconds ? `per_query_timeout_seconds: ${per_query_timeout_seconds}` : "",
1144
1144
  "",
1145
- `${GRAPH_LAYERS_TEXT} If you need schema context, first run small discovery queries such as MATCH (a:Address) RETURN a.address AS address, keys(a) AS address_properties LIMIT 5 and MATCH (:Address)-[r:FLOWS_TO]->(:Address) RETURN keys(r) AS flow_properties LIMIT 5. Return the full address when available; never shorten addresses with ellipses.`
1145
+ `${GRAPH_LAYERS_TEXT} If you need schema context, first run small discovery queries such as MATCH (a:Address) RETURN a.address AS address, keys(a) AS address_properties LIMIT 5 and MATCH (:Address)-[r:FLOWED_TO]->(:Address) RETURN keys(r) AS flow_properties LIMIT 5. Return the full address when available; never shorten addresses with ellipses.`
1146
1146
  ].filter(Boolean).join("\n"), "Graph query batch"));
1147
1147
  server.registerPrompt("wallet-balance", {
1148
1148
  title: "Wallet Balance",
@@ -1190,7 +1190,7 @@ function normalizeRemoteToolResult(toolName, result) {
1190
1190
  _meta: sanitizeRemoteMeta(result._meta),
1191
1191
  isError: result.isError
1192
1192
  };
1193
- return toolName === "graph_query" || toolName === "graph_query_batch" ? require_print_result.withTimestampTextResult(require_dex_tool.withAnswerHintResult(normalized)) : normalized;
1193
+ return toolName === "graph_query" || toolName === "graph_query_batch" ? require_print_result.withTimestampTextResult(require_answer_hint.withAnswerHintResult(normalized)) : normalized;
1194
1194
  }
1195
1195
  function cleanNetworkCapabilities(value) {
1196
1196
  const structuredContent = isRecord(value) ? value.structuredContent : void 0;
@@ -1222,10 +1222,10 @@ function jsonTextResult(structuredContent) {
1222
1222
  * All diagnostic output goes to console.error() or process.stderr.write().
1223
1223
  */
1224
1224
  async function createProxy() {
1225
- const { loadConfig } = await Promise.resolve().then(() => require("./config-BxtMoo9c.cjs")).then((n) => n.config_exports);
1226
- const { activeDataDir, findActiveWorkspace } = await Promise.resolve().then(() => require("./active-Bc13hJIm.cjs")).then((n) => n.active_exports);
1227
- const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-C9uwHnBS.cjs")).then((n) => n.client_exports);
1228
- const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-C7v9ml6S.cjs"));
1225
+ const { loadConfig } = await Promise.resolve().then(() => require("./config-BdE8LcF-.cjs")).then((n) => n.config_exports);
1226
+ const { activeDataDir, findActiveWorkspace } = await Promise.resolve().then(() => require("./active-q3yViZhc.cjs")).then((n) => n.active_exports);
1227
+ const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-Ddk4X9Ko.cjs")).then((n) => n.client_exports);
1228
+ const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-NLgJmh4X.cjs"));
1229
1229
  const proxyMode = resolveMcpProxyMode();
1230
1230
  const workspaceArtifactsEnabled = proxyMode === "workspace";
1231
1231
  const loadedConfig = await loadConfig();
@@ -1244,7 +1244,7 @@ async function createProxy() {
1244
1244
  log_path: logger.filePath
1245
1245
  });
1246
1246
  const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
1247
- const { defersToClaudeDesktop, DEFERRED_SERVER_INSTRUCTIONS } = await Promise.resolve().then(() => require("./claude-desktop-Jmm4PlBZ.cjs"));
1247
+ const { defersToClaudeDesktop, DEFERRED_SERVER_INSTRUCTIONS } = await Promise.resolve().then(() => require("./claude-desktop-3OksQZVE.cjs"));
1248
1248
  if (defersToClaudeDesktop()) {
1249
1249
  await logger.info("proxy.deferred_to_claude_desktop", { version: require_print_result.PACKAGE_VERSION });
1250
1250
  await new _modelcontextprotocol_sdk_server_mcp_js.McpServer({
@@ -1254,7 +1254,7 @@ async function createProxy() {
1254
1254
  return;
1255
1255
  }
1256
1256
  if (process.env["CHAIN_INSIGHTS_SKILL_REFRESH"] !== "0") try {
1257
- const { refreshInstalledSkills } = await Promise.resolve().then(() => require("./skill-refresh-Be2D5FrX.cjs"));
1257
+ const { refreshInstalledSkills } = await Promise.resolve().then(() => require("./skill-refresh-DaCTxhhy.cjs"));
1258
1258
  const refresh = refreshInstalledSkills(require_print_result.PACKAGE_VERSION);
1259
1259
  if (refresh.refreshed.length > 0 || refresh.installed.length > 0 || refresh.failed.length > 0) await logger.info("skills.refresh", {
1260
1260
  version: require_print_result.PACKAGE_VERSION,
@@ -1493,6 +1493,30 @@ async function createProxy() {
1493
1493
  },
1494
1494
  annotations: require_dex_tool.META_DEX_LOOKUP_ANNOTATIONS
1495
1495
  }, async (args) => require_dex_tool.handleMetaDexLookup(args, dexDependencies));
1496
+ const tokenDependencies = {
1497
+ graphQuery: async (args) => {
1498
+ const options = remoteToolRequestOptions("graph_query");
1499
+ return await withRateLimitRetry(() => options ? remoteClient.callTool({
1500
+ name: "graph_query",
1501
+ arguments: args
1502
+ }, void 0, options) : remoteClient.callTool({
1503
+ name: "graph_query",
1504
+ arguments: args
1505
+ }));
1506
+ },
1507
+ graphQueryBatch: dexDependencies.graphQueryBatch,
1508
+ unavailable: dexDependencies.unavailable,
1509
+ describeFailure: (err) => remoteCallFailureText("graph_query", err)
1510
+ };
1511
+ server.registerTool(require_token_lookup.META_TOKEN_LOOKUP_TOOL, {
1512
+ title: require_token_lookup.META_TOKEN_LOOKUP_TITLE,
1513
+ description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS[require_token_lookup.META_TOKEN_LOOKUP_TOOL],
1514
+ inputSchema: {
1515
+ network: NETWORK_SCHEMA,
1516
+ symbol: zod.string().min(1).max(require_token_lookup.SYMBOL_MAX).describe("The ticker or the token name as the user wrote it: TCITY, USDG, Tcity. Never a contract address: an address is already an anchor.")
1517
+ },
1518
+ annotations: require_token_lookup.META_TOKEN_LOOKUP_ANNOTATIONS
1519
+ }, async (args) => require_token_lookup.handleMetaTokenLookup(args, tokenDependencies));
1496
1520
  const readUsageStatus = async () => {
1497
1521
  try {
1498
1522
  await ensureRemote();
@@ -1599,7 +1623,7 @@ async function createProxy() {
1599
1623
  }
1600
1624
  }, async () => {
1601
1625
  try {
1602
- const { formatWalletBalanceResult, getWalletAccount, getWalletBalanceResult } = await Promise.resolve().then(() => require("./tools-Cmnq7yip.cjs")).then((n) => n.tools_exports);
1626
+ const { formatWalletBalanceResult, getWalletAccount, getWalletBalanceResult } = await Promise.resolve().then(() => require("./tools-DZLizem9.cjs")).then((n) => n.tools_exports);
1603
1627
  const structuredContent = await getWalletBalanceResult(await getWalletAccount());
1604
1628
  return {
1605
1629
  content: [{
@@ -1709,7 +1733,7 @@ async function createProxy() {
1709
1733
  openWorldHint: false
1710
1734
  }
1711
1735
  }, async () => {
1712
- const { readPackagedSkillRules } = await Promise.resolve().then(() => require("./skill-refresh-Be2D5FrX.cjs"));
1736
+ const { readPackagedSkillRules } = await Promise.resolve().then(() => require("./skill-refresh-DaCTxhhy.cjs"));
1713
1737
  return {
1714
1738
  content: [{
1715
1739
  type: "text",
@@ -1740,6 +1764,7 @@ async function createProxy() {
1740
1764
  "- meta_network_capabilities: supported networks and available tools. Takes no arguments.",
1741
1765
  "- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
1742
1766
  "- meta_dex_lookup: turn an exchange name (Aero, Uniswap, Virtuals) into its factories, routers, pools and first reads. Call it first when a question names an exchange and gives no address.",
1767
+ "- meta_token_lookup: turn a ticker or a token name (TCITY, USDG) into every contract that carries it, with its creator. Call it first when a question names a token and gives no contract; tickers collide.",
1743
1768
  "- meta_usage_status: check the caller public free graph_query quota.",
1744
1769
  "- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
1745
1770
  "- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
@@ -1760,6 +1785,7 @@ async function createProxy() {
1760
1785
  "- meta_network_capabilities: supported networks and available tools. Takes no arguments.",
1761
1786
  "- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
1762
1787
  "- meta_dex_lookup: turn an exchange name (Aero, Uniswap, Virtuals) into its factories, routers, pools and first reads. Call it first when a question names an exchange and gives no address.",
1788
+ "- meta_token_lookup: turn a ticker or a token name (TCITY, USDG) into every contract that carries it, with its creator. Call it first when a question names a token and gives no contract; tickers collide.",
1763
1789
  "- meta_usage_status: check the caller public free graph_query quota.",
1764
1790
  "- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
1765
1791
  "- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
@@ -1834,7 +1860,7 @@ async function createProxy() {
1834
1860
  };
1835
1861
  server.registerTool(tool.name, toolConfig, handler);
1836
1862
  }
1837
- const { registerTopupView, TOPUP_VIEW_URI } = await Promise.resolve().then(() => require("./topup-server-ShuYSyBY.cjs")).then((n) => n.topup_server_exports);
1863
+ const { registerTopupView, TOPUP_VIEW_URI } = await Promise.resolve().then(() => require("./topup-server-D9Uk1Th3.cjs")).then((n) => n.topup_server_exports);
1838
1864
  await registerTopupView(server, { walletAddress: localTopupWalletAddress });
1839
1865
  server.registerResource("Chain Insights view", CLAUDE_VIEW_URI, {
1840
1866
  title: "Chain Insights view",
@@ -1869,11 +1895,11 @@ if (process.argv[1] && require("url").pathToFileURL(__filename).href.includes(pr
1869
1895
  process.stderr.write(`Chain Insights MCP proxy startup failed: ${err.message}\n`);
1870
1896
  process.exit(1);
1871
1897
  });
1872
- //#endregion
1873
1898
  exports.APP_ONLY_LOCAL_TOOL_NAMES = APP_ONLY_LOCAL_TOOL_NAMES;
1874
1899
  exports.CLAUDE_VIEW_URI = CLAUDE_VIEW_URI;
1875
1900
  exports.GRAPH_QUERY_DEX_DOOR_SENTENCE = GRAPH_QUERY_DEX_DOOR_SENTENCE;
1876
1901
  exports.GRAPH_QUERY_ROLE_MARKS_SENTENCE = GRAPH_QUERY_ROLE_MARKS_SENTENCE;
1902
+ exports.GRAPH_QUERY_TOKEN_DOOR_SENTENCE = GRAPH_QUERY_TOKEN_DOOR_SENTENCE;
1877
1903
  exports.KNOWN_PUBLIC_TOOL_DESCRIPTIONS = KNOWN_PUBLIC_TOOL_DESCRIPTIONS;
1878
1904
  exports.LOCAL_TOOL_NAMES = LOCAL_TOOL_NAMES;
1879
1905
  exports.MCP_APP_MIME_TYPE = MCP_APP_MIME_TYPE;
@@ -1,5 +1,4 @@
1
1
  import * as z from "zod";
2
- //#region src/mcp/proxy.d.ts
3
2
  export declare const LOCAL_TOOL_NAMES: Set<string>;
4
3
  export declare const APP_ONLY_LOCAL_TOOL_NAMES: Set<string>;
5
4
  /** The structured refusal of a click refused for money; the view reads it (chain-insights-ui apps/claude-view/credits.ts). */
@@ -14,6 +13,7 @@ export declare function readClaudeViewHtml(): string;
14
13
  export type McpProxyMode = 'workspace' | 'stateless';
15
14
  export declare function resolveMcpProxyMode(env?: NodeJS.ProcessEnv): McpProxyMode;
16
15
  export declare const GRAPH_QUERY_DEX_DOOR_SENTENCE = "A question that names an exchange and no address starts with meta_dex_lookup, never with a scan of :Protocol, :Pool or labels.";
16
+ export declare const GRAPH_QUERY_TOKEN_DOOR_SENTENCE = "A question that names a token by its ticker or name and gives no contract starts with meta_token_lookup: tickers collide, so never guess the contract.";
17
17
  export declare const GRAPH_QUERY_ROLE_MARKS_SENTENCE = ":Sanctioned (is_sanctioned) means the address is on a sanctions list. :IssuerFrozen (is_issuer_frozen) means an issuer froze this wallet; the token in labels says which. Neither is :Scam.";
18
18
  export declare const KNOWN_PUBLIC_TOOL_DESCRIPTIONS: Record<string, string>;
19
19
  type ToolInputShape = Record<string, z.ZodTypeAny>;
@@ -27,5 +27,5 @@ export declare function knownPublicToolInputSchema(toolName: string): ToolInputS
27
27
  * All diagnostic output goes to console.error() or process.stderr.write().
28
28
  */
29
29
  export declare function createProxy(): Promise<void>;
30
- //#endregion
30
+ export {};
31
31
  //# sourceMappingURL=mcp-proxy.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;qBAkEa,kBAAgB;qBAchB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAKA;qBAGA,gCAAgC;KAsBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,eAAe"}
1
+ {"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";qBA4Ea,kBAAgB;qBAehB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAIA;qBAKA;qBAGA,gCAAgC;KAuBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,eAAe"}
@@ -1,5 +1,4 @@
1
1
  import * as z from "zod";
2
- //#region src/mcp/proxy.d.ts
3
2
  export declare const LOCAL_TOOL_NAMES: Set<string>;
4
3
  export declare const APP_ONLY_LOCAL_TOOL_NAMES: Set<string>;
5
4
  /** The structured refusal of a click refused for money; the view reads it (chain-insights-ui apps/claude-view/credits.ts). */
@@ -14,6 +13,7 @@ export declare function readClaudeViewHtml(): string;
14
13
  export type McpProxyMode = 'workspace' | 'stateless';
15
14
  export declare function resolveMcpProxyMode(env?: NodeJS.ProcessEnv): McpProxyMode;
16
15
  export declare const GRAPH_QUERY_DEX_DOOR_SENTENCE = "A question that names an exchange and no address starts with meta_dex_lookup, never with a scan of :Protocol, :Pool or labels.";
16
+ export declare const GRAPH_QUERY_TOKEN_DOOR_SENTENCE = "A question that names a token by its ticker or name and gives no contract starts with meta_token_lookup: tickers collide, so never guess the contract.";
17
17
  export declare const GRAPH_QUERY_ROLE_MARKS_SENTENCE = ":Sanctioned (is_sanctioned) means the address is on a sanctions list. :IssuerFrozen (is_issuer_frozen) means an issuer froze this wallet; the token in labels says which. Neither is :Scam.";
18
18
  export declare const KNOWN_PUBLIC_TOOL_DESCRIPTIONS: Record<string, string>;
19
19
  type ToolInputShape = Record<string, z.ZodTypeAny>;
@@ -27,5 +27,5 @@ export declare function knownPublicToolInputSchema(toolName: string): ToolInputS
27
27
  * All diagnostic output goes to console.error() or process.stderr.write().
28
28
  */
29
29
  export declare function createProxy(): Promise<void>;
30
- //#endregion
30
+ export {};
31
31
  //# sourceMappingURL=mcp-proxy.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;qBAkEa,kBAAgB;qBAchB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAKA;qBAGA,gCAAgC;KAsBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,eAAe"}
1
+ {"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";qBA4Ea,kBAAgB;qBAehB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAIA;qBAKA;qBAGA,gCAAgC;KAuBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,eAAe"}