chain-insights 0.22.2 → 0.23.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.
- package/README.md +29 -50
- package/dist/cli.cjs +21 -83
- package/dist/cli.mjs +21 -83
- package/dist/cli.mjs.map +1 -1
- package/dist/{config-BVFf3v8-.cjs → config-B542AM4w.cjs} +2 -3
- package/dist/{config-CnNMdt4M.mjs → config-DbbPiGk0.mjs} +2 -3
- package/dist/{config-CnNMdt4M.mjs.map → config-DbbPiGk0.mjs.map} +1 -1
- package/dist/html-generator-BCDtYcGs.mjs +16 -0
- package/dist/{html-generator-D2BDzLED.mjs.map → html-generator-BCDtYcGs.mjs.map} +1 -1
- package/dist/html-generator-DFwMRWN3.cjs +16 -0
- package/dist/index.cjs +2 -8
- package/dist/index.d.cts +1 -99
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -99
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -6
- package/dist/mcp-proxy.cjs +35 -156
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +35 -156
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{public-tools-BFs_7U_Z.cjs → public-tools-Bou25cki.cjs} +153 -5
- package/dist/{public-tools-BjqZGGAC.mjs → public-tools-CpOLkME5.mjs} +152 -4
- package/dist/public-tools-CpOLkME5.mjs.map +1 -0
- package/dist/{schema-DOJA2nNi.mjs → schema-B0OuHW_l.mjs} +64 -5
- package/dist/schema-B0OuHW_l.mjs.map +1 -0
- package/dist/{schema-BpeV3xDV.cjs → schema-CtFWYoJz.cjs} +72 -7
- package/dist/{tool-visibility-DZBAP62b.cjs → tool-visibility-C8F9Yoxy.cjs} +1 -2
- package/dist/{tool-visibility-C0ALejXI.mjs → tool-visibility-CXbwfKhv.mjs} +2 -3
- package/dist/tool-visibility-CXbwfKhv.mjs.map +1 -0
- package/dist/{topup-server-rqI7bqem.mjs → topup-server-BLdF1SFQ.mjs} +2 -2
- package/dist/topup-server-BLdF1SFQ.mjs.map +1 -0
- package/dist/{topup-server-DAqmAuu1.cjs → topup-server-YN3iHrHW.cjs} +1 -1
- package/dist/{update-CJUfGCxs.mjs → update-MsoEFbhn.mjs} +2 -36
- package/dist/{update-CJUfGCxs.mjs.map → update-MsoEFbhn.mjs.map} +1 -1
- package/dist/{update-BJoXYucO.cjs → update-RKd0UW90.cjs} +0 -35
- package/docs/architecture.md +16 -46
- package/docs/contributing.md +0 -3
- package/docs/development.md +3 -5
- package/docs/graph-tools.md +4 -29
- package/docs/mcp-proxy.md +10 -36
- package/docs/stability.md +0 -12
- package/package.json +3 -4
- package/skills/chain-insights-address-risk/SKILL.md +0 -1
- package/dist/app-7NRCqx_Q.mjs +0 -140
- package/dist/app-7NRCqx_Q.mjs.map +0 -1
- package/dist/app-l9JE6bt3.cjs +0 -145
- package/dist/artifact-server-CH-asxF5.cjs +0 -47
- package/dist/artifact-server-DoxJr0z8.mjs +0 -49
- package/dist/artifact-server-DoxJr0z8.mjs.map +0 -1
- package/dist/graph-normalizer-B2Q2lgVy.cjs +0 -130
- package/dist/graph-normalizer-BA3Rbd6l.mjs +0 -127
- package/dist/graph-normalizer-BA3Rbd6l.mjs.map +0 -1
- package/dist/graph-reports-B6yoYbPq.mjs +0 -63
- package/dist/graph-reports-B6yoYbPq.mjs.map +0 -1
- package/dist/graph-reports-_gqzxvvs.cjs +0 -64
- package/dist/html-generator-B9f_GIi2.cjs +0 -86
- package/dist/html-generator-D2BDzLED.mjs +0 -70
- package/dist/init-Djhml4ih.mjs +0 -319
- package/dist/init-Djhml4ih.mjs.map +0 -1
- package/dist/init-DvrKxK15.cjs +0 -319
- package/dist/limits-D3Mn-gig.mjs +0 -94
- package/dist/limits-D3Mn-gig.mjs.map +0 -1
- package/dist/limits-km3pmmL3.cjs +0 -115
- package/dist/mcp-endpoint-BIWrUOFG.cjs +0 -56
- package/dist/mcp-endpoint-DbWtLcba.mjs +0 -41
- package/dist/mcp-endpoint-DbWtLcba.mjs.map +0 -1
- package/dist/output-root-BK4pdjyz.mjs +0 -36
- package/dist/output-root-BK4pdjyz.mjs.map +0 -1
- package/dist/output-root-BewoQaTx.cjs +0 -46
- package/dist/public-tools-BjqZGGAC.mjs.map +0 -1
- package/dist/resolve-port-CbaEoODz.cjs +0 -18
- package/dist/resolve-port-DxPK7Ipx.mjs +0 -20
- package/dist/resolve-port-DxPK7Ipx.mjs.map +0 -1
- package/dist/schema-DOJA2nNi.mjs.map +0 -1
- package/dist/server-CmvzYu7v.cjs +0 -55
- package/dist/server-mDSRgk1X.mjs +0 -46
- package/dist/server-mDSRgk1X.mjs.map +0 -1
- package/dist/templates/graph.html +0 -1450
- package/dist/tool-visibility-C0ALejXI.mjs.map +0 -1
- package/dist/topup-server-rqI7bqem.mjs.map +0 -1
- package/dist/viz-BJ_kyRjI.cjs +0 -217
- package/dist/viz-Uh_EF-qB.mjs +0 -206
- package/dist/viz-Uh_EF-qB.mjs.map +0 -1
- package/docs/images/graph-mcp-iframe.png +0 -0
- package/docs/images/graph-visualization.png +0 -0
- package/docs/images/quickstart-demo.svg +0 -1
- package/docs/investigation-workspaces.md +0 -108
- package/docs/search-limits.md +0 -73
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { Hono } from "hono";
|
|
3
2
|
import { Address, Hex } from "viem";
|
|
4
3
|
//#region src/config/schema.d.ts
|
|
5
4
|
declare const ConfigSchema: z.ZodObject<{
|
|
@@ -26,12 +25,6 @@ declare function loadConfig(): Promise<InvestigatorConfig>;
|
|
|
26
25
|
declare function saveConfig(updates: Partial<InvestigatorConfig>): Promise<void>;
|
|
27
26
|
declare function resetConfigCache(): Promise<void>;
|
|
28
27
|
//#endregion
|
|
29
|
-
//#region src/server/app.d.ts
|
|
30
|
-
declare function createApp(): Hono;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/server/index.d.ts
|
|
33
|
-
declare function startServer(port?: number): () => void;
|
|
34
|
-
//#endregion
|
|
35
28
|
//#region src/wallet/index.d.ts
|
|
36
29
|
declare function normalizeWalletPrivateKey(value: string): Hex;
|
|
37
30
|
declare function walletAddressFromPrivateKey(privateKey: string): Address;
|
|
@@ -177,96 +170,5 @@ interface MergedResult {
|
|
|
177
170
|
}
|
|
178
171
|
declare function mergeShardRows(rows: ShardRow[], opts?: MergeOptions): MergedResult;
|
|
179
172
|
//#endregion
|
|
180
|
-
|
|
181
|
-
declare const GraphNode: z.ZodObject<{
|
|
182
|
-
id: z.ZodString;
|
|
183
|
-
label: z.ZodOptional<z.ZodString>;
|
|
184
|
-
entityType: z.ZodDefault<z.ZodEnum<{
|
|
185
|
-
contract: "contract";
|
|
186
|
-
eoa: "eoa";
|
|
187
|
-
exchange: "exchange";
|
|
188
|
-
hub: "hub";
|
|
189
|
-
mixer: "mixer";
|
|
190
|
-
unknown: "unknown";
|
|
191
|
-
}>>;
|
|
192
|
-
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
193
|
-
critical: "critical";
|
|
194
|
-
high: "high";
|
|
195
|
-
low: "low";
|
|
196
|
-
medium: "medium";
|
|
197
|
-
unknown: "unknown";
|
|
198
|
-
unscored: "unscored";
|
|
199
|
-
}>>;
|
|
200
|
-
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
201
|
-
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
202
|
-
txCount: z.ZodDefault<z.ZodNumber>;
|
|
203
|
-
firstSeen: z.ZodOptional<z.ZodString>;
|
|
204
|
-
lastSeen: z.ZodOptional<z.ZodString>;
|
|
205
|
-
}, z.core.$strip>;
|
|
206
|
-
type GraphNode = z.infer<typeof GraphNode>;
|
|
207
|
-
declare const GraphEdge: z.ZodObject<{
|
|
208
|
-
source: z.ZodString;
|
|
209
|
-
target: z.ZodString;
|
|
210
|
-
value: z.ZodNumber;
|
|
211
|
-
edgeType: z.ZodDefault<z.ZodString>;
|
|
212
|
-
txHash: z.ZodOptional<z.ZodString>;
|
|
213
|
-
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
214
|
-
timestamp: z.ZodOptional<z.ZodString>;
|
|
215
|
-
}, z.core.$strip>;
|
|
216
|
-
type GraphEdge = z.infer<typeof GraphEdge>;
|
|
217
|
-
declare const GraphData: z.ZodObject<{
|
|
218
|
-
nodes: z.ZodArray<z.ZodObject<{
|
|
219
|
-
id: z.ZodString;
|
|
220
|
-
label: z.ZodOptional<z.ZodString>;
|
|
221
|
-
entityType: z.ZodDefault<z.ZodEnum<{
|
|
222
|
-
contract: "contract";
|
|
223
|
-
eoa: "eoa";
|
|
224
|
-
exchange: "exchange";
|
|
225
|
-
hub: "hub";
|
|
226
|
-
mixer: "mixer";
|
|
227
|
-
unknown: "unknown";
|
|
228
|
-
}>>;
|
|
229
|
-
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
230
|
-
critical: "critical";
|
|
231
|
-
high: "high";
|
|
232
|
-
low: "low";
|
|
233
|
-
medium: "medium";
|
|
234
|
-
unknown: "unknown";
|
|
235
|
-
unscored: "unscored";
|
|
236
|
-
}>>;
|
|
237
|
-
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
238
|
-
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
239
|
-
txCount: z.ZodDefault<z.ZodNumber>;
|
|
240
|
-
firstSeen: z.ZodOptional<z.ZodString>;
|
|
241
|
-
lastSeen: z.ZodOptional<z.ZodString>;
|
|
242
|
-
}, z.core.$strip>>;
|
|
243
|
-
edges: z.ZodArray<z.ZodObject<{
|
|
244
|
-
source: z.ZodString;
|
|
245
|
-
target: z.ZodString;
|
|
246
|
-
value: z.ZodNumber;
|
|
247
|
-
edgeType: z.ZodDefault<z.ZodString>;
|
|
248
|
-
txHash: z.ZodOptional<z.ZodString>;
|
|
249
|
-
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
250
|
-
timestamp: z.ZodOptional<z.ZodString>;
|
|
251
|
-
}, z.core.$strip>>;
|
|
252
|
-
metadata: z.ZodObject<{
|
|
253
|
-
title: z.ZodDefault<z.ZodString>;
|
|
254
|
-
generatedAt: z.ZodString;
|
|
255
|
-
truncated: z.ZodDefault<z.ZodBoolean>;
|
|
256
|
-
totalNodes: z.ZodOptional<z.ZodNumber>;
|
|
257
|
-
hiddenNodes: z.ZodOptional<z.ZodNumber>;
|
|
258
|
-
}, z.core.$strip>;
|
|
259
|
-
}, z.core.$strip>;
|
|
260
|
-
type GraphData = z.infer<typeof GraphData>;
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region src/viz/index.d.ts
|
|
263
|
-
declare function generateVisualization(opts: {
|
|
264
|
-
sourceId?: string;
|
|
265
|
-
dataFile?: string;
|
|
266
|
-
}): Promise<{
|
|
267
|
-
vizId: string;
|
|
268
|
-
htmlPath: string;
|
|
269
|
-
}>;
|
|
270
|
-
//#endregion
|
|
271
|
-
export { type GraphData as GraphDataType, type GraphEdge as GraphEdgeType, type GraphNode as GraphNodeType, type InvestigatorConfig, type MergeOptions, type MergedResult, type ShardRow, buildTopupInfo, createApp, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, formatWalletBalanceResult, generateArtifactHtml, generateVisualization, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceResult, getWalletBalanceText, isWalletConfigured, loadConfig, mergeShardRows, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startServer, startTopupServer, walletAddressFromPrivateKey };
|
|
173
|
+
export { type InvestigatorConfig, type MergeOptions, type MergedResult, type ShardRow, buildTopupInfo, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, formatWalletBalanceResult, generateArtifactHtml, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceResult, getWalletBalanceText, isWalletConfigured, loadConfig, mergeShardRows, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startTopupServer, walletAddressFromPrivateKey };
|
|
272
174
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/wallet/index.ts","../src/wallet/tools.ts","../src/wallet/mcp-proxy/topup-server.ts","../src/wallet/topup-server.ts","../src/mcp/client.ts","../src/federation/merge.ts"],"mappings":";;;cA4Da,cAAY,EAAA;;;;;;;;;;;;;;;;GAcvB,EAAA,KAAA;KAEU,qBAAqB,EAAE,aAAa;;;iBC3B1B,cAAc,QAAQ;iBAMtB,WAAW,SAAS,QAAQ,sBAAsB;iBAclD,oBAAoB;;;iBC5C1B,0BAA0B,gBAAgB;iBAO1C,4BAA4B,qBAAqB;;;;;;;;iBAW3C,WAAW,qBAAqB;UAwBrC;;EAEf;;;;;;;;iBAuCoB,oBACpB,oBACA,UAAS,6BACR,QAAQ;;;;;;;iBA2BW,cAAc;;;;;iBAwCd,sBAAsB;;;cCpK/B;cACA;UAgDI;EACf,SAAS;EACT,YAAY;;UAGG;EACf;EACA;EACA,iBAAiB;EACjB;EACA,uBAAuB;EACvB;;UAoDe;EACf,SAAS;EACT;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;IACE,QAAQ;;;iBAIU,oBAAoB,QAAQ;iBAa5B,eACpB,SAAS,kBACT,8BACC;iBAsBmB,cACpB,SAAS,kBACT,8BACC;iBAsQa,oBACd,iBACA,qBACA;iBAaoB,uBACpB,UAAU,uBACT,QAAQ;iBAyBK,0BAA0B,QAAQ;iBAK5B,qBAAqB,UAAU,uBAAuB;iBAI5D,eAAe,iBAAiB,oBAAoB;;;iBCvWpD,qBAAqB,4BAA4B;;;iBCpCjD;iBAcM,iBAAiB,SAAS,gCAAgC;;;;;;;;;;;;;;;iBC4JhE,qBAAqB,2BAA2B,4BAAkB;;;;;;;;;;;;;;KCxQtE,WAAW;EAA4B;;UAElC;EACf;IAAY;IAAa;;EACzB;EACA,WAAW,MAAM;;;;;;;;EAQjB;;;;EAIA;;UAGe;EACf,MAAM,MAAM;;;;;EAKZ,UAAU,eAAe,MAAM;EAC/B;;iBA8Jc,eAAe,MAAM,YAAY,OAAM,eAAoB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { Hono } from "hono";
|
|
3
2
|
import { Address, Hex } from "viem";
|
|
4
3
|
//#region src/config/schema.d.ts
|
|
5
4
|
declare const ConfigSchema: z.ZodObject<{
|
|
@@ -26,12 +25,6 @@ declare function loadConfig(): Promise<InvestigatorConfig>;
|
|
|
26
25
|
declare function saveConfig(updates: Partial<InvestigatorConfig>): Promise<void>;
|
|
27
26
|
declare function resetConfigCache(): Promise<void>;
|
|
28
27
|
//#endregion
|
|
29
|
-
//#region src/server/app.d.ts
|
|
30
|
-
declare function createApp(): Hono;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/server/index.d.ts
|
|
33
|
-
declare function startServer(port?: number): () => void;
|
|
34
|
-
//#endregion
|
|
35
28
|
//#region src/wallet/index.d.ts
|
|
36
29
|
declare function normalizeWalletPrivateKey(value: string): Hex;
|
|
37
30
|
declare function walletAddressFromPrivateKey(privateKey: string): Address;
|
|
@@ -177,96 +170,5 @@ interface MergedResult {
|
|
|
177
170
|
}
|
|
178
171
|
declare function mergeShardRows(rows: ShardRow[], opts?: MergeOptions): MergedResult;
|
|
179
172
|
//#endregion
|
|
180
|
-
|
|
181
|
-
declare const GraphNode: z.ZodObject<{
|
|
182
|
-
id: z.ZodString;
|
|
183
|
-
label: z.ZodOptional<z.ZodString>;
|
|
184
|
-
entityType: z.ZodDefault<z.ZodEnum<{
|
|
185
|
-
contract: "contract";
|
|
186
|
-
eoa: "eoa";
|
|
187
|
-
exchange: "exchange";
|
|
188
|
-
hub: "hub";
|
|
189
|
-
mixer: "mixer";
|
|
190
|
-
unknown: "unknown";
|
|
191
|
-
}>>;
|
|
192
|
-
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
193
|
-
critical: "critical";
|
|
194
|
-
high: "high";
|
|
195
|
-
low: "low";
|
|
196
|
-
medium: "medium";
|
|
197
|
-
unknown: "unknown";
|
|
198
|
-
unscored: "unscored";
|
|
199
|
-
}>>;
|
|
200
|
-
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
201
|
-
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
202
|
-
txCount: z.ZodDefault<z.ZodNumber>;
|
|
203
|
-
firstSeen: z.ZodOptional<z.ZodString>;
|
|
204
|
-
lastSeen: z.ZodOptional<z.ZodString>;
|
|
205
|
-
}, z.core.$strip>;
|
|
206
|
-
type GraphNode = z.infer<typeof GraphNode>;
|
|
207
|
-
declare const GraphEdge: z.ZodObject<{
|
|
208
|
-
source: z.ZodString;
|
|
209
|
-
target: z.ZodString;
|
|
210
|
-
value: z.ZodNumber;
|
|
211
|
-
edgeType: z.ZodDefault<z.ZodString>;
|
|
212
|
-
txHash: z.ZodOptional<z.ZodString>;
|
|
213
|
-
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
214
|
-
timestamp: z.ZodOptional<z.ZodString>;
|
|
215
|
-
}, z.core.$strip>;
|
|
216
|
-
type GraphEdge = z.infer<typeof GraphEdge>;
|
|
217
|
-
declare const GraphData: z.ZodObject<{
|
|
218
|
-
nodes: z.ZodArray<z.ZodObject<{
|
|
219
|
-
id: z.ZodString;
|
|
220
|
-
label: z.ZodOptional<z.ZodString>;
|
|
221
|
-
entityType: z.ZodDefault<z.ZodEnum<{
|
|
222
|
-
contract: "contract";
|
|
223
|
-
eoa: "eoa";
|
|
224
|
-
exchange: "exchange";
|
|
225
|
-
hub: "hub";
|
|
226
|
-
mixer: "mixer";
|
|
227
|
-
unknown: "unknown";
|
|
228
|
-
}>>;
|
|
229
|
-
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
230
|
-
critical: "critical";
|
|
231
|
-
high: "high";
|
|
232
|
-
low: "low";
|
|
233
|
-
medium: "medium";
|
|
234
|
-
unknown: "unknown";
|
|
235
|
-
unscored: "unscored";
|
|
236
|
-
}>>;
|
|
237
|
-
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
238
|
-
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
239
|
-
txCount: z.ZodDefault<z.ZodNumber>;
|
|
240
|
-
firstSeen: z.ZodOptional<z.ZodString>;
|
|
241
|
-
lastSeen: z.ZodOptional<z.ZodString>;
|
|
242
|
-
}, z.core.$strip>>;
|
|
243
|
-
edges: z.ZodArray<z.ZodObject<{
|
|
244
|
-
source: z.ZodString;
|
|
245
|
-
target: z.ZodString;
|
|
246
|
-
value: z.ZodNumber;
|
|
247
|
-
edgeType: z.ZodDefault<z.ZodString>;
|
|
248
|
-
txHash: z.ZodOptional<z.ZodString>;
|
|
249
|
-
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
250
|
-
timestamp: z.ZodOptional<z.ZodString>;
|
|
251
|
-
}, z.core.$strip>>;
|
|
252
|
-
metadata: z.ZodObject<{
|
|
253
|
-
title: z.ZodDefault<z.ZodString>;
|
|
254
|
-
generatedAt: z.ZodString;
|
|
255
|
-
truncated: z.ZodDefault<z.ZodBoolean>;
|
|
256
|
-
totalNodes: z.ZodOptional<z.ZodNumber>;
|
|
257
|
-
hiddenNodes: z.ZodOptional<z.ZodNumber>;
|
|
258
|
-
}, z.core.$strip>;
|
|
259
|
-
}, z.core.$strip>;
|
|
260
|
-
type GraphData = z.infer<typeof GraphData>;
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region src/viz/index.d.ts
|
|
263
|
-
declare function generateVisualization(opts: {
|
|
264
|
-
sourceId?: string;
|
|
265
|
-
dataFile?: string;
|
|
266
|
-
}): Promise<{
|
|
267
|
-
vizId: string;
|
|
268
|
-
htmlPath: string;
|
|
269
|
-
}>;
|
|
270
|
-
//#endregion
|
|
271
|
-
export { type GraphData as GraphDataType, type GraphEdge as GraphEdgeType, type GraphNode as GraphNodeType, type InvestigatorConfig, type MergeOptions, type MergedResult, type ShardRow, buildTopupInfo, createApp, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, formatWalletBalanceResult, generateArtifactHtml, generateVisualization, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceResult, getWalletBalanceText, isWalletConfigured, loadConfig, mergeShardRows, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startServer, startTopupServer, walletAddressFromPrivateKey };
|
|
173
|
+
export { type InvestigatorConfig, type MergeOptions, type MergedResult, type ShardRow, buildTopupInfo, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, formatWalletBalanceResult, generateArtifactHtml, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceResult, getWalletBalanceText, isWalletConfigured, loadConfig, mergeShardRows, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startTopupServer, walletAddressFromPrivateKey };
|
|
272
174
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/wallet/index.ts","../src/wallet/tools.ts","../src/wallet/mcp-proxy/topup-server.ts","../src/wallet/topup-server.ts","../src/mcp/client.ts","../src/federation/merge.ts"],"mappings":";;;cA4Da,cAAY,EAAA;;;;;;;;;;;;;;;;GAcvB,EAAA,KAAA;KAEU,qBAAqB,EAAE,aAAa;;;iBC3B1B,cAAc,QAAQ;iBAMtB,WAAW,SAAS,QAAQ,sBAAsB;iBAclD,oBAAoB;;;iBC5C1B,0BAA0B,gBAAgB;iBAO1C,4BAA4B,qBAAqB;;;;;;;;iBAW3C,WAAW,qBAAqB;UAwBrC;;EAEf;;;;;;;;iBAuCoB,oBACpB,oBACA,UAAS,6BACR,QAAQ;;;;;;;iBA2BW,cAAc;;;;;iBAwCd,sBAAsB;;;cCpK/B;cACA;UAgDI;EACf,SAAS;EACT,YAAY;;UAGG;EACf;EACA;EACA,iBAAiB;EACjB;EACA,uBAAuB;EACvB;;UAoDe;EACf,SAAS;EACT;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;IACE,QAAQ;;;iBAIU,oBAAoB,QAAQ;iBAa5B,eACpB,SAAS,kBACT,8BACC;iBAsBmB,cACpB,SAAS,kBACT,8BACC;iBAsQa,oBACd,iBACA,qBACA;iBAaoB,uBACpB,UAAU,uBACT,QAAQ;iBAyBK,0BAA0B,QAAQ;iBAK5B,qBAAqB,UAAU,uBAAuB;iBAI5D,eAAe,iBAAiB,oBAAoB;;;iBCvWpD,qBAAqB,4BAA4B;;;iBCpCjD;iBAcM,iBAAiB,SAAS,gCAAgC;;;;;;;;;;;;;;;iBC4JhE,qBAAqB,2BAA2B,4BAAkB;;;;;;;;;;;;;;KCxQtE,WAAW;EAA4B;;UAElC;EACf;IAAY;IAAa;;EACzB;EACA,WAAW,MAAM;;;;;;;;EAQjB;;;;EAIA;;UAGe;EACf,MAAM,MAAM;;;;;EAKZ,UAAU,eAAe,MAAM;EAC/B;;iBA8Jc,eAAe,MAAM,YAAY,OAAM,eAAoB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { i as saveConfig, n as loadConfig, r as resetConfigCache } from "./config-
|
|
2
|
-
import { t as createApp } from "./app-7NRCqx_Q.mjs";
|
|
3
|
-
import { n as startServer } from "./server-mDSRgk1X.mjs";
|
|
1
|
+
import { i as saveConfig, n as loadConfig, r as resetConfigCache } from "./config-DbbPiGk0.mjs";
|
|
4
2
|
import { a as setWalletPrivateKey, i as normalizeWalletPrivateKey, n as encryptKey, o as walletAddressFromPrivateKey, r as isWalletConfigured, t as decryptKey } from "./wallet-fMbhvKXT.mjs";
|
|
5
3
|
import { a as formatWalletBalanceResult, c as getWalletAccount, i as formatWalletBalance, l as getWalletBalanceResult, o as getBalanceEth, r as buildTopupInfo, s as getBalanceUsdc, u as getWalletBalanceText } from "./tools-BKLnlBG1.mjs";
|
|
6
|
-
import { i as generateArtifactHtml, n as startTopupServer, t as getTopupUrl } from "./topup-server-
|
|
4
|
+
import { i as generateArtifactHtml, n as startTopupServer, t as getTopupUrl } from "./topup-server-BLdF1SFQ.mjs";
|
|
7
5
|
import { i as createMcpFetchClient } from "./client-D4aM4bzP.mjs";
|
|
8
6
|
import { t as mergeShardRows } from "./merge-BZw-pMPN.mjs";
|
|
9
|
-
|
|
10
|
-
export { buildTopupInfo, createApp, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, formatWalletBalanceResult, generateArtifactHtml, generateVisualization, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceResult, getWalletBalanceText, isWalletConfigured, loadConfig, mergeShardRows, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startServer, startTopupServer, walletAddressFromPrivateKey };
|
|
7
|
+
export { buildTopupInfo, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, formatWalletBalanceResult, generateArtifactHtml, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceResult, getWalletBalanceText, isWalletConfigured, loadConfig, mergeShardRows, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startTopupServer, walletAddressFromPrivateKey };
|
package/dist/mcp-proxy.cjs
CHANGED
|
@@ -2,14 +2,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
3
3
|
const require_version = require("./version-CO9Or_YV.cjs");
|
|
4
4
|
const require_client = require("./client-CqAzD519.cjs");
|
|
5
|
-
const require_tool_visibility = require("./tool-visibility-
|
|
5
|
+
const require_tool_visibility = require("./tool-visibility-C8F9Yoxy.cjs");
|
|
6
6
|
const require_usage_status = require("./usage-status-BdwwgYsu.cjs");
|
|
7
7
|
const require_capabilities = require("./capabilities-CPcrxodx.cjs");
|
|
8
8
|
const require_action_log = require("./action-log-HniMMF7f.cjs");
|
|
9
|
-
let node_url = require("node:url");
|
|
10
9
|
let node_path = require("node:path");
|
|
11
10
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
12
|
-
let node_fs = require("node:fs");
|
|
13
11
|
let node_fs_promises = require("node:fs/promises");
|
|
14
12
|
let zod = require("zod");
|
|
15
13
|
zod = require_rolldown_runtime.__toESM(zod, 1);
|
|
@@ -17,7 +15,6 @@ let _modelcontextprotocol_sdk_server_mcp_js = require("@modelcontextprotocol/sdk
|
|
|
17
15
|
let _modelcontextprotocol_sdk_server_stdio_js = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
18
16
|
let _modelcontextprotocol_sdk_client_index_js = require("@modelcontextprotocol/sdk/client/index.js");
|
|
19
17
|
let _modelcontextprotocol_sdk_client_streamableHttp_js = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
20
|
-
let _modelcontextprotocol_ext_apps_server = require("@modelcontextprotocol/ext-apps/server");
|
|
21
18
|
//#region src/mcp/proxy.ts
|
|
22
19
|
const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
23
20
|
"meta_network_capabilities",
|
|
@@ -25,19 +22,17 @@ const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
25
22
|
"meta_help",
|
|
26
23
|
"wallet_balance"
|
|
27
24
|
]);
|
|
28
|
-
const GRAPH_RESOURCE_URI = "ui://chain-insights/graph";
|
|
29
|
-
const GRAPH_APP_TOOL_NAMES = /* @__PURE__ */ new Set(["aml_address_risk"]);
|
|
30
25
|
const GRAPH_ARRAY_KEYS = [
|
|
31
26
|
"nodes",
|
|
32
27
|
"edges",
|
|
33
28
|
"flows",
|
|
34
29
|
"edge_anchors"
|
|
35
30
|
];
|
|
36
|
-
const __dirname$1 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
37
31
|
function resolveMcpProxyMode(env = process.env) {
|
|
38
32
|
const raw = env["CHAIN_INSIGHTS_MCP_PROXY_MODE"]?.trim().toLowerCase();
|
|
39
|
-
if (!raw || raw === "
|
|
40
|
-
if (raw === "
|
|
33
|
+
if (!raw || raw === "stateless") return "stateless";
|
|
34
|
+
if (raw === "workspace") return "workspace";
|
|
35
|
+
if (raw === "no-workspace" || raw === "workspace-less") return "stateless";
|
|
41
36
|
throw new Error(`CHAIN_INSIGHTS_MCP_PROXY_MODE must be workspace or stateless; got "${raw}"`);
|
|
42
37
|
}
|
|
43
38
|
const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
|
|
@@ -55,11 +50,9 @@ const EMPTY_INPUT_SCHEMA = zod.strictObject({});
|
|
|
55
50
|
const REMOTE_GRAPH_TOOL_REQUEST_TIMEOUT_MS = 9e5;
|
|
56
51
|
const CHAIN_INSIGHTS_WORKFLOW = [
|
|
57
52
|
"Workflow:",
|
|
58
|
-
"1.
|
|
59
|
-
"2.
|
|
60
|
-
"3.
|
|
61
|
-
"4. Persisted outputs belong in the initialized workspace under reports/, reports/graphs/, reports/tables/, artifacts/, entities/, sessions/, and published/.",
|
|
62
|
-
"5. For local review, inspect the generated Markdown and graph/table artifacts directly in the workspace."
|
|
53
|
+
"1. Do not call investigation tools until required arguments are known. Network is required; use meta_network_capabilities to check supported networks and available tools, or ask the user if missing.",
|
|
54
|
+
"2. Use aml_address_risk for single-address enrichment. Use graph_query(_batch) for graph-level questions that aml_address_risk does not answer.",
|
|
55
|
+
"3. Preserve tool summaries and structured facts as returned. Keep full blockchain addresses intact."
|
|
63
56
|
].join("\n");
|
|
64
57
|
const GRAPH_SCHEMA_HINTS = [
|
|
65
58
|
"Graph query hints:",
|
|
@@ -80,67 +73,25 @@ const GRAPH_SCHEMA_HINTS = [
|
|
|
80
73
|
"- 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.",
|
|
81
74
|
"- Use USE facts graph patterns for fact and enrichment reads. Do not query internal table namespaces directly."
|
|
82
75
|
].join("\n");
|
|
83
|
-
const GRAPH_REPORT_HINTS = [
|
|
84
|
-
"Graph visualization behavior:",
|
|
85
|
-
"- Graph-backed tools return the investigator report as text content and keep raw graph data out of LLM-visible structuredContent.",
|
|
86
|
-
"- Chain Insights prepares the graph view automatically from local workspace report files when graph metadata is available.",
|
|
87
|
-
"- If the graph view cannot load a report, retry the graph-backed tool call so Chain Insights can recreate the local graph report."
|
|
88
|
-
].join("\n");
|
|
89
76
|
const SERVER_INSTRUCTIONS = [
|
|
90
|
-
"Chain Insights is
|
|
77
|
+
"Chain Insights is an AML and graph-analysis MCP server for AI agents.",
|
|
91
78
|
CHAIN_INSIGHTS_WORKFLOW,
|
|
92
|
-
GRAPH_REPORT_HINTS,
|
|
93
79
|
GRAPH_SCHEMA_HINTS,
|
|
94
80
|
"Presentation rules: preserve tool summaries as returned; never truncate blockchain addresses or identity_resolution audit mappings."
|
|
95
81
|
].join("\n\n");
|
|
96
82
|
const STATELESS_SERVER_INSTRUCTIONS = [
|
|
97
83
|
"Chain Insights is running as a stateless AML proxy for a host application.",
|
|
98
|
-
"Do not use local workspace persistence, wallet, or graph report workflows in this mode.",
|
|
99
84
|
"Use meta_network_capabilities first when network support is unknown, then call aml_address_risk, graph_query, or graph_query_batch as needed.",
|
|
85
|
+
"Use wallet_balance to inspect the local payment wallet when payment setup is needed.",
|
|
100
86
|
GRAPH_SCHEMA_HINTS,
|
|
101
87
|
"Presentation rules: preserve tool summaries as returned; never truncate blockchain addresses or identity_resolution audit mappings."
|
|
102
88
|
].join("\n\n");
|
|
103
|
-
function readGraphAppHtml() {
|
|
104
|
-
const candidates = [
|
|
105
|
-
node_path.default.resolve(__dirname$1, "templates", "graph.html"),
|
|
106
|
-
node_path.default.resolve(__dirname$1, "..", "templates", "graph.html"),
|
|
107
|
-
node_path.default.resolve(__dirname$1, "..", "viz", "templates", "graph.html")
|
|
108
|
-
];
|
|
109
|
-
for (const candidate of candidates) try {
|
|
110
|
-
return (0, node_fs.readFileSync)(candidate, "utf8");
|
|
111
|
-
} catch (err) {
|
|
112
|
-
if (err.code !== "ENOENT") throw err;
|
|
113
|
-
}
|
|
114
|
-
throw new Error(`Chain Insights Graph app template not found. Tried: ${candidates.join(", ")}`);
|
|
115
|
-
}
|
|
116
|
-
function graphArtifactOrigins(config) {
|
|
117
|
-
return [`http://127.0.0.1:${config.serverPort}`, `http://localhost:${config.serverPort}`];
|
|
118
|
-
}
|
|
119
|
-
function hasGraphApp(tool) {
|
|
120
|
-
const configuredUri = tool._meta?.ui;
|
|
121
|
-
if (configuredUri && typeof configuredUri === "object" && "resourceUri" in configuredUri && configuredUri.resourceUri === GRAPH_RESOURCE_URI) return true;
|
|
122
|
-
if (tool._meta?.["ui/resourceUri"] === GRAPH_RESOURCE_URI) return true;
|
|
123
|
-
if (GRAPH_APP_TOOL_NAMES.has(tool.name)) return true;
|
|
124
|
-
return JSON.stringify(tool.outputSchema ?? {}).includes("\"app_data\"");
|
|
125
|
-
}
|
|
126
|
-
function graphToolMeta(tool) {
|
|
127
|
-
const meta = { ...tool._meta ?? {} };
|
|
128
|
-
const ui = meta.ui && typeof meta.ui === "object" && !Array.isArray(meta.ui) ? { ...meta.ui } : {};
|
|
129
|
-
return {
|
|
130
|
-
...meta,
|
|
131
|
-
ui: {
|
|
132
|
-
...ui,
|
|
133
|
-
resourceUri: GRAPH_RESOURCE_URI
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
89
|
function knownPublicToolInputSchema(toolName) {
|
|
138
90
|
switch (toolName) {
|
|
139
91
|
case "aml_address_risk": return {
|
|
140
92
|
address: zod.string().min(1).describe("Blockchain address to screen."),
|
|
141
93
|
network: NETWORK_SCHEMA,
|
|
142
|
-
compare_address: zod.string().optional().describe("Optional address to compare against the screened address.")
|
|
143
|
-
include_attachments: zod.boolean().optional().describe("Include graph app report metadata")
|
|
94
|
+
compare_address: zod.string().optional().describe("Optional address to compare against the screened address.")
|
|
144
95
|
};
|
|
145
96
|
case "graph_query": return {
|
|
146
97
|
query: zod.string().min(1).describe("Read-only GQL/Cypher query. Use USE topology for topology (address/FLOWS_TO/LINKED graph, unified recent+historical, plus the node risk_score/risk_level verdict) and USE facts for bounded TRANSFER rows and enrichment."),
|
|
@@ -439,14 +390,9 @@ function registerLocalPrompts(server) {
|
|
|
439
390
|
}, async () => promptResult("Use Chain Insights wallet_balance. Show the wallet address, payment network, token, and amount exactly as returned.", "Wallet balance"));
|
|
440
391
|
server.registerPrompt("meta-help", {
|
|
441
392
|
title: "Chain Insights Help",
|
|
442
|
-
description: "Show available Chain Insights tools and
|
|
393
|
+
description: "Show available Chain Insights tools and workflow guidance.",
|
|
443
394
|
argsSchema: {}
|
|
444
|
-
}, async () => promptResult("Use Chain Insights meta_help. Summarize the available tools and
|
|
445
|
-
}
|
|
446
|
-
function hasGraphArrayFields(value) {
|
|
447
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
448
|
-
const record = value;
|
|
449
|
-
return GRAPH_ARRAY_KEYS.some((key) => Array.isArray(record[key]));
|
|
395
|
+
}, async () => promptResult("Use Chain Insights meta_help. Summarize the available tools and workflow guidance without inventing capabilities.", "Chain Insights help"));
|
|
450
396
|
}
|
|
451
397
|
function sanitizeStructuredContentForGraphPayload(structuredContent) {
|
|
452
398
|
if (!structuredContent) return void 0;
|
|
@@ -462,67 +408,27 @@ function sanitizeStructuredValue(value) {
|
|
|
462
408
|
}
|
|
463
409
|
return sanitized;
|
|
464
410
|
}
|
|
465
|
-
function
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (
|
|
474
|
-
|
|
411
|
+
function sanitizeRemoteMeta(metaValue) {
|
|
412
|
+
if (!metaValue || typeof metaValue !== "object" || Array.isArray(metaValue)) return void 0;
|
|
413
|
+
const meta = { ...metaValue };
|
|
414
|
+
delete meta.ui;
|
|
415
|
+
delete meta["ui/resourceUri"];
|
|
416
|
+
const chainInsights = meta.chainInsights;
|
|
417
|
+
if (chainInsights && typeof chainInsights === "object" && !Array.isArray(chainInsights)) {
|
|
418
|
+
const { graph: _graph, ...withoutGraph } = chainInsights;
|
|
419
|
+
if (Object.keys(withoutGraph).length > 0) meta.chainInsights = withoutGraph;
|
|
420
|
+
else delete meta.chainInsights;
|
|
475
421
|
}
|
|
476
|
-
|
|
477
|
-
if (!data || typeof data !== "object" || Array.isArray(data)) throw new Error("Invalid remote graph payload");
|
|
478
|
-
return data;
|
|
422
|
+
return Object.keys(meta).length > 0 ? meta : void 0;
|
|
479
423
|
}
|
|
480
|
-
|
|
481
|
-
const graphPayload = getRemoteGraphPayload(result);
|
|
482
|
-
const meta = { ...result._meta ?? {} };
|
|
483
|
-
if (graphPayload && includeAttachments) {
|
|
484
|
-
const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-_gqzxvvs.cjs"));
|
|
485
|
-
const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-CH-asxF5.cjs"));
|
|
486
|
-
const report = await writeGraphReport(graphPayload, {
|
|
487
|
-
serverPort: config.serverPort,
|
|
488
|
-
slug: toolName || "remote-graph"
|
|
489
|
-
});
|
|
490
|
-
await ensureArtifactServer(config.serverPort);
|
|
491
|
-
meta.chainInsights = {
|
|
492
|
-
...meta.chainInsights ?? {},
|
|
493
|
-
graph: {
|
|
494
|
-
schema: report.schema,
|
|
495
|
-
url: report.url
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
}
|
|
424
|
+
function normalizeRemoteToolResult(result) {
|
|
499
425
|
return {
|
|
500
426
|
content: result.content ?? [],
|
|
501
427
|
structuredContent: sanitizeStructuredContentForGraphPayload(result.structuredContent),
|
|
502
|
-
_meta:
|
|
428
|
+
_meta: sanitizeRemoteMeta(result._meta),
|
|
503
429
|
isError: result.isError
|
|
504
430
|
};
|
|
505
431
|
}
|
|
506
|
-
function shouldIncludeAttachments(args, workspaceArtifactsEnabled) {
|
|
507
|
-
return workspaceArtifactsEnabled && args["include_attachments"] !== false;
|
|
508
|
-
}
|
|
509
|
-
async function writeLocalGraphMeta(graphData, config, slug, includeAttachments) {
|
|
510
|
-
if (!includeAttachments) return void 0;
|
|
511
|
-
const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-_gqzxvvs.cjs"));
|
|
512
|
-
const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-CH-asxF5.cjs"));
|
|
513
|
-
const report = await writeGraphReport(graphData, {
|
|
514
|
-
serverPort: config.serverPort,
|
|
515
|
-
slug
|
|
516
|
-
});
|
|
517
|
-
await ensureArtifactServer(config.serverPort);
|
|
518
|
-
return {
|
|
519
|
-
schema: report.schema,
|
|
520
|
-
url: report.url
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
function graphMetaResult(graph) {
|
|
524
|
-
return graph ? { chainInsights: { graph } } : void 0;
|
|
525
|
-
}
|
|
526
432
|
function cleanNetworkCapabilities(value) {
|
|
527
433
|
const structuredContent = isRecord(value) ? value.structuredContent : void 0;
|
|
528
434
|
const facts = isRecord(structuredContent) ? structuredContent.facts : void 0;
|
|
@@ -553,7 +459,7 @@ function jsonTextResult(structuredContent) {
|
|
|
553
459
|
* All diagnostic output goes to console.error() or process.stderr.write().
|
|
554
460
|
*/
|
|
555
461
|
async function createProxy() {
|
|
556
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
462
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
557
463
|
const { activeDataDir, findActiveWorkspace } = await Promise.resolve().then(() => require("./active-Bc13hJIm.cjs")).then((n) => n.active_exports);
|
|
558
464
|
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-CqAzD519.cjs")).then((n) => n.client_exports);
|
|
559
465
|
const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-n7Gbhvsj.cjs"));
|
|
@@ -732,7 +638,7 @@ async function createProxy() {
|
|
|
732
638
|
};
|
|
733
639
|
}
|
|
734
640
|
});
|
|
735
|
-
|
|
641
|
+
server.registerTool("wallet_balance", {
|
|
736
642
|
title: "Wallet Balance",
|
|
737
643
|
description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS.wallet_balance,
|
|
738
644
|
inputSchema: EMPTY_INPUT_SCHEMA,
|
|
@@ -764,38 +670,21 @@ async function createProxy() {
|
|
|
764
670
|
};
|
|
765
671
|
}
|
|
766
672
|
});
|
|
767
|
-
(
|
|
768
|
-
description: "Interactive fund-flow and pattern graph for Chain Insights investigation reports.",
|
|
769
|
-
_meta: { ui: { csp: {
|
|
770
|
-
resourceDomains: graphArtifactOrigins(config),
|
|
771
|
-
connectDomains: graphArtifactOrigins(config)
|
|
772
|
-
} } }
|
|
773
|
-
}, async () => ({ contents: [{
|
|
774
|
-
uri: GRAPH_RESOURCE_URI,
|
|
775
|
-
mimeType: _modelcontextprotocol_ext_apps_server.RESOURCE_MIME_TYPE,
|
|
776
|
-
text: readGraphAppHtml(),
|
|
777
|
-
_meta: { ui: { csp: {
|
|
778
|
-
resourceDomains: graphArtifactOrigins(config),
|
|
779
|
-
connectDomains: graphArtifactOrigins(config)
|
|
780
|
-
} } }
|
|
781
|
-
}] }));
|
|
782
|
-
if (!remoteToolNames.has("aml_address_risk")) (0, _modelcontextprotocol_ext_apps_server.registerAppTool)(server, "aml_address_risk", {
|
|
673
|
+
if (!remoteToolNames.has("aml_address_risk")) server.registerTool("aml_address_risk", {
|
|
783
674
|
title: "Address Risk",
|
|
784
675
|
description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS.aml_address_risk,
|
|
785
676
|
inputSchema: {
|
|
786
677
|
address: zod.string().min(1).describe("Blockchain address to screen"),
|
|
787
678
|
network: NETWORK_SCHEMA,
|
|
788
|
-
compare_address: zod.string().optional().describe("Optional address to compare against the screened address")
|
|
789
|
-
include_attachments: zod.boolean().optional().describe("Include graph app report metadata")
|
|
679
|
+
compare_address: zod.string().optional().describe("Optional address to compare against the screened address")
|
|
790
680
|
},
|
|
791
|
-
_meta: { ui: { resourceUri: GRAPH_RESOURCE_URI } },
|
|
792
681
|
annotations: {
|
|
793
682
|
readOnlyHint: true,
|
|
794
683
|
destructiveHint: false,
|
|
795
684
|
idempotentHint: true,
|
|
796
685
|
openWorldHint: true
|
|
797
686
|
}
|
|
798
|
-
}, async ({ address, network, compare_address
|
|
687
|
+
}, async ({ address, network, compare_address }) => {
|
|
799
688
|
try {
|
|
800
689
|
if (!remoteConnected) return {
|
|
801
690
|
content: [{
|
|
@@ -804,21 +693,19 @@ async function createProxy() {
|
|
|
804
693
|
}],
|
|
805
694
|
isError: true
|
|
806
695
|
};
|
|
807
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
696
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-Bou25cki.cjs"));
|
|
808
697
|
const result = await addressRisk(remoteClient, {
|
|
809
698
|
address,
|
|
810
699
|
network,
|
|
811
700
|
compareAddress: compare_address,
|
|
812
701
|
writeArtifacts: workspaceArtifactsEnabled
|
|
813
702
|
});
|
|
814
|
-
const graph = await writeLocalGraphMeta(result.graphData, config, `address-risk-${network}-${address}`, shouldIncludeAttachments({ include_attachments }, workspaceArtifactsEnabled));
|
|
815
703
|
return {
|
|
816
704
|
content: [{
|
|
817
705
|
type: "text",
|
|
818
706
|
text: result.summaryText
|
|
819
707
|
}],
|
|
820
708
|
structuredContent: result.structuredContent,
|
|
821
|
-
_meta: graphMetaResult(graph),
|
|
822
709
|
isError: false
|
|
823
710
|
};
|
|
824
711
|
} catch (err) {
|
|
@@ -852,7 +739,7 @@ async function createProxy() {
|
|
|
852
739
|
content: [{
|
|
853
740
|
type: "text",
|
|
854
741
|
text: workspaceArtifactsEnabled ? [
|
|
855
|
-
"Chain Insights helps AI agents run AML investigation workflows
|
|
742
|
+
"Chain Insights helps AI agents run AML investigation workflows.",
|
|
856
743
|
"",
|
|
857
744
|
CHAIN_INSIGHTS_WORKFLOW,
|
|
858
745
|
"",
|
|
@@ -865,14 +752,10 @@ async function createProxy() {
|
|
|
865
752
|
"",
|
|
866
753
|
"Wallet tools:",
|
|
867
754
|
"- wallet_balance: show the local payment wallet address, payment network, token, and amount.",
|
|
868
|
-
"- meta_help: show this overview."
|
|
869
|
-
"",
|
|
870
|
-
GRAPH_REPORT_HINTS
|
|
755
|
+
"- meta_help: show this overview."
|
|
871
756
|
].join("\n") : [
|
|
872
757
|
"Chain Insights stateless AML proxy for host applications.",
|
|
873
758
|
"",
|
|
874
|
-
"Local workspace persistence, wallet, and graph report attachment tools are disabled in this mode.",
|
|
875
|
-
"",
|
|
876
759
|
"Available graph-backed tools:",
|
|
877
760
|
"- meta_network_capabilities: inspect supported networks and available tools.",
|
|
878
761
|
"- meta_usage_status: check the caller public free graph_query quota.",
|
|
@@ -910,7 +793,7 @@ async function createProxy() {
|
|
|
910
793
|
arguments: normalizedArgs
|
|
911
794
|
};
|
|
912
795
|
const requestOptions = remoteToolRequestOptions(tool.name);
|
|
913
|
-
return
|
|
796
|
+
return normalizeRemoteToolResult(requestOptions ? await remoteClient.callTool(request, void 0, requestOptions) : await remoteClient.callTool(request));
|
|
914
797
|
} catch (err) {
|
|
915
798
|
if (err instanceof require_client.PaymentRequiredError) return {
|
|
916
799
|
content: [{
|
|
@@ -942,11 +825,7 @@ async function createProxy() {
|
|
|
942
825
|
inputSchema,
|
|
943
826
|
...knownPublicToolAnnotations(tool.name) ? { annotations: knownPublicToolAnnotations(tool.name) } : {}
|
|
944
827
|
};
|
|
945
|
-
|
|
946
|
-
...toolConfig,
|
|
947
|
-
_meta: graphToolMeta(tool)
|
|
948
|
-
}, handler);
|
|
949
|
-
else server.registerTool(tool.name, toolConfig, handler);
|
|
828
|
+
server.registerTool(tool.name, toolConfig, handler);
|
|
950
829
|
}
|
|
951
830
|
const transport = new _modelcontextprotocol_sdk_server_stdio_js.StdioServerTransport();
|
|
952
831
|
await server.connect(transport);
|
package/dist/mcp-proxy.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;KA6BY;iBAEI,oBAAoB,MAAK,OAAO,aAA2B;KAuBtE,iBAAiB,eAAe,EAAE;iBA6DvB,2BAA2B,mBAAmB;;;;;;;;iBAwjBxC,eAAe"}
|
package/dist/mcp-proxy.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;KA6BY;iBAEI,oBAAoB,MAAK,OAAO,aAA2B;KAuBtE,iBAAiB,eAAe,EAAE;iBA6DvB,2BAA2B,mBAAmB;;;;;;;;iBAwjBxC,eAAe"}
|