chain-insights 0.78.0 → 0.79.2
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 +1 -0
- package/dist/cli.cjs +36 -12
- package/dist/cli.mjs +36 -12
- package/dist/cli.mjs.map +1 -1
- package/dist/deployer-screen-4AxZhsrO.cjs +446 -0
- package/dist/deployer-screen-eix6pvW7.mjs +413 -0
- package/dist/deployer-screen-eix6pvW7.mjs.map +1 -0
- package/dist/mcp-proxy.cjs +16 -2
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +16 -2
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{token-lookup-sH2DesLS.mjs → token-lookup-Bv_Fviis.mjs} +4 -3
- package/dist/token-lookup-Bv_Fviis.mjs.map +1 -0
- package/dist/{token-lookup-DvgEyqcC.cjs → token-lookup-DBN3Lxl7.cjs} +14 -1
- package/dist/{tool-visibility-Dy3psowS.mjs → tool-visibility-DlxA8R00.mjs} +3 -2
- package/dist/tool-visibility-DlxA8R00.mjs.map +1 -0
- package/dist/{tool-visibility-DIpgPULN.cjs → tool-visibility-DwNr6Rp9.cjs} +2 -1
- package/docs/contributing.md +4 -2
- package/docs/development.md +3 -2
- package/docs/graph-tools.md +7 -2
- package/docs/mcp-proxy.md +49 -3
- package/docs/stability.md +3 -2
- package/package.json +2 -2
- package/registry/README.md +5 -5
- package/registry/robinhood.json +7 -4
- package/registry/robinhood.md +9 -5
- package/skills/chain-insights-dex/SKILL.md +2 -2
- package/skills/chain-insights-dex-launchpad/SKILL.md +7 -10
- package/skills/chain-insights-virtuals/SKILL.md +1 -1
- package/dist/token-lookup-sH2DesLS.mjs.map +0 -1
- package/dist/tool-visibility-Dy3psowS.mjs.map +0 -1
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.mjs";
|
|
2
|
+
import { t as ANSWER_HINT } from "./answer-hint-vOE1O6Lf.mjs";
|
|
3
|
+
import { a as normalizeDexNetwork, t as DexRegistryError } from "./dex-registry-sPTFuCrP.mjs";
|
|
4
|
+
import { i as isEpochMs, o as utcText } from "./print-result-IFARsMnL.mjs";
|
|
5
|
+
import { c as refusalOf, s as membersOf } from "./token-lookup-Bv_Fviis.mjs";
|
|
6
|
+
// src/mcp/deployer-screen.ts
|
|
7
|
+
/**
|
|
8
|
+
* aml_deployer_screen: who is behind a token or a wallet, as facts.
|
|
9
|
+
*
|
|
10
|
+
* A local tool of the proxy. It sends one graph_query_batch with two reads on
|
|
11
|
+
* USE topology, both anchored on the address:
|
|
12
|
+
*
|
|
13
|
+
* token the address as a contract: its first creation (DEPLOYED_CONTRACT),
|
|
14
|
+
* the launcher (the transaction's sender), the launcher's first funder
|
|
15
|
+
* of all time and its first inbound bridge deposit;
|
|
16
|
+
* wallet the address as the launcher itself: the same funder and bridge reads.
|
|
17
|
+
*
|
|
18
|
+
* The token read answers first when it holds a row; the wallet read answers
|
|
19
|
+
* otherwise. The tool returns facts and never a score, a level or a verdict:
|
|
20
|
+
* the description below is the contract with every host, Claude Desktop chat
|
|
21
|
+
* included, which reads no skill.
|
|
22
|
+
*/
|
|
23
|
+
var deployer_screen_exports = /* @__PURE__ */ __exportAll({
|
|
24
|
+
AML_DEPLOYER_SCREEN_DESCRIPTION: () => AML_DEPLOYER_SCREEN_DESCRIPTION,
|
|
25
|
+
AML_DEPLOYER_SCREEN_TITLE: () => AML_DEPLOYER_SCREEN_TITLE,
|
|
26
|
+
AML_DEPLOYER_SCREEN_TOOL: () => AML_DEPLOYER_SCREEN_TOOL,
|
|
27
|
+
handleAmlDeployerScreen: () => handleAmlDeployerScreen
|
|
28
|
+
});
|
|
29
|
+
const AML_DEPLOYER_SCREEN_TOOL = "aml_deployer_screen";
|
|
30
|
+
const AML_DEPLOYER_SCREEN_SCHEMA = "chain-insights.aml-deployer-screen.v1";
|
|
31
|
+
const AML_DEPLOYER_SCREEN_TITLE = "Deployer screen";
|
|
32
|
+
const AML_DEPLOYER_SCREEN_DESCRIPTION = "Facts only, no score and no verdict: screens who is behind a token or a wallet. For a token contract it returns the creation transaction and the launcher (the wallet that sent it); for a wallet, that wallet as the launcher. Then the launcher's first funder of all time and what kind of wallet that funder is (wallet, contract, bridge, bundler, launchpad, exchange, mixer, scam), how many addresses the funder ever paid, the sanctions, scam, victim and risk labels on each, and the first inbound bridge deposit. The caller decides. A fresh launcher funded by a wallet that paid few addresses is the pattern to look at; a funder that paid thousands is shared infrastructure. A launcher that is a bundler hides the real sender: launcher_resolved is then false. not_covered lists what the graph cannot see yet.";
|
|
33
|
+
const AML_DEPLOYER_SCREEN_ANNOTATIONS = {
|
|
34
|
+
readOnlyHint: true,
|
|
35
|
+
idempotentHint: true,
|
|
36
|
+
openWorldHint: false
|
|
37
|
+
};
|
|
38
|
+
/** What the two reads cannot see yet, named in every answer. */
|
|
39
|
+
const NOT_COVERED = [
|
|
40
|
+
"exploit_labels",
|
|
41
|
+
"ml_labels",
|
|
42
|
+
"bridge_sender",
|
|
43
|
+
"ethereum_history"
|
|
44
|
+
];
|
|
45
|
+
const ADDRESS_INPUT = /^0x[0-9a-fA-F]{40}$/;
|
|
46
|
+
const ADDRESS_READ = /^0x[0-9a-f]{40}$/;
|
|
47
|
+
const FUNDER_READ = "OPTIONAL MATCH (f:Address)-[e:FLOWED_TO]->(l)";
|
|
48
|
+
const BRIDGE_READ = "OPTIONAL MATCH (ch:Chain)-[b:BRIDGED]->(l) WHERE b.kind IN ['TOKEN_DEPOSIT','NATIVE_DEPOSIT']";
|
|
49
|
+
const PARTY_COLUMNS = [
|
|
50
|
+
"labels(l) AS launcher_roles",
|
|
51
|
+
"l.first_activity_timestamp AS launcher_first_activity",
|
|
52
|
+
"l.degree_in AS launcher_degree_in",
|
|
53
|
+
"l.degree_out AS launcher_degree_out",
|
|
54
|
+
"l.is_sanctioned AS launcher_is_sanctioned",
|
|
55
|
+
"l.is_scam AS launcher_is_scam",
|
|
56
|
+
"l.is_victim AS launcher_is_victim",
|
|
57
|
+
"l.is_issuer_frozen AS launcher_is_issuer_frozen",
|
|
58
|
+
"l.label_risk_labels AS launcher_risk_labels",
|
|
59
|
+
"l.label_risk_levels AS launcher_risk_levels",
|
|
60
|
+
"f.address AS funder",
|
|
61
|
+
"labels(f) AS funder_roles",
|
|
62
|
+
"f.degree_out AS funder_degree_out",
|
|
63
|
+
"f.first_activity_timestamp AS funder_first_activity",
|
|
64
|
+
"f.is_sanctioned AS funder_is_sanctioned",
|
|
65
|
+
"f.is_scam AS funder_is_scam",
|
|
66
|
+
"f.is_victim AS funder_is_victim",
|
|
67
|
+
"f.is_issuer_frozen AS funder_is_issuer_frozen",
|
|
68
|
+
"f.label_risk_labels AS funder_risk_labels",
|
|
69
|
+
"f.label_risk_levels AS funder_risk_levels",
|
|
70
|
+
"e.first_seen_timestamp AS funded_at",
|
|
71
|
+
"e.tx_count AS funding_tx_count",
|
|
72
|
+
"e.amount_usd_sum AS funding_usd",
|
|
73
|
+
"ch.network AS bridged_chain",
|
|
74
|
+
"ch.address AS bridged_bridge",
|
|
75
|
+
"b.kind AS bridged_kind",
|
|
76
|
+
"b.asset AS bridged_asset",
|
|
77
|
+
"b.first_height AS bridged_first_block"
|
|
78
|
+
].join(", ");
|
|
79
|
+
const TOKEN_COLUMNS = [
|
|
80
|
+
"t.address AS token",
|
|
81
|
+
"labels(t) AS token_roles",
|
|
82
|
+
"c.tx_origin AS launcher",
|
|
83
|
+
"c.deployer_address AS deployer",
|
|
84
|
+
"c.factory_address AS factory",
|
|
85
|
+
"c.kind AS creation_kind",
|
|
86
|
+
"c.tx_id AS creation_tx",
|
|
87
|
+
"c.block_height AS creation_block",
|
|
88
|
+
"c.block_timestamp AS creation_time"
|
|
89
|
+
].join(", ");
|
|
90
|
+
function assertReadAddress(address) {
|
|
91
|
+
if (!ADDRESS_READ.test(address)) throw new Error(`deployer screen: ${JSON.stringify(address)} is not a lowercase 0x address`);
|
|
92
|
+
}
|
|
93
|
+
/** The token read: the address as a contract, its first creation and who sent it. */
|
|
94
|
+
function tokenScreenQuery(address) {
|
|
95
|
+
assertReadAddress(address);
|
|
96
|
+
return [
|
|
97
|
+
`USE topology MATCH (t:Address {address:'${address}'})<-[c:DEPLOYED_CONTRACT]-(:Address)`,
|
|
98
|
+
"WITH t, c ORDER BY c.block_height LIMIT 1",
|
|
99
|
+
"MATCH (l:Address {address: c.tx_origin})",
|
|
100
|
+
FUNDER_READ,
|
|
101
|
+
"WITH t, c, l, f, e ORDER BY e.first_seen_timestamp LIMIT 1",
|
|
102
|
+
BRIDGE_READ,
|
|
103
|
+
"WITH t, c, l, f, e, ch, b ORDER BY b.first_height LIMIT 1",
|
|
104
|
+
`RETURN ${TOKEN_COLUMNS}, ${PARTY_COLUMNS} LIMIT 1`
|
|
105
|
+
].join(" ");
|
|
106
|
+
}
|
|
107
|
+
/** The wallet read: the address as the launcher itself. */
|
|
108
|
+
function walletScreenQuery(address) {
|
|
109
|
+
assertReadAddress(address);
|
|
110
|
+
return [
|
|
111
|
+
`USE topology MATCH (l:Address {address:'${address}'})`,
|
|
112
|
+
FUNDER_READ,
|
|
113
|
+
"WITH l, f, e ORDER BY e.first_seen_timestamp LIMIT 1",
|
|
114
|
+
BRIDGE_READ,
|
|
115
|
+
"WITH l, f, e, ch, b ORDER BY b.first_height LIMIT 1",
|
|
116
|
+
`RETURN l.address AS launcher, ${PARTY_COLUMNS} LIMIT 1`
|
|
117
|
+
].join(" ");
|
|
118
|
+
}
|
|
119
|
+
/** The one batch the tool sends: members `token` and `wallet`. */
|
|
120
|
+
function deployerScreenQueries(address) {
|
|
121
|
+
return [{
|
|
122
|
+
id: "token",
|
|
123
|
+
query: tokenScreenQuery(address)
|
|
124
|
+
}, {
|
|
125
|
+
id: "wallet",
|
|
126
|
+
query: walletScreenQuery(address)
|
|
127
|
+
}];
|
|
128
|
+
}
|
|
129
|
+
function isRecord(value) {
|
|
130
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
131
|
+
}
|
|
132
|
+
const textOrNull = (value) => typeof value === "string" && value.trim() !== "" ? value.trim() : null;
|
|
133
|
+
const numberOrNull = (value) => {
|
|
134
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
135
|
+
if (typeof value === "string" && value.trim() !== "" && Number.isFinite(Number(value))) return Number(value);
|
|
136
|
+
return null;
|
|
137
|
+
};
|
|
138
|
+
const addressOrNull = (value) => typeof value === "string" && ADDRESS_INPUT.test(value.trim()) ? value.trim().toLowerCase() : null;
|
|
139
|
+
const utcOrNull = (ms) => isEpochMs(ms) ? utcText(ms) : null;
|
|
140
|
+
/**
|
|
141
|
+
* A label from a third-party explorer tag source is training data, never served.
|
|
142
|
+
* The graph is not meant to carry one; this drops it if it ever does.
|
|
143
|
+
*/
|
|
144
|
+
function isServedLabel(value) {
|
|
145
|
+
const lower = value.trim().toLowerCase();
|
|
146
|
+
return !(lower.startsWith("etherscan") || lower.startsWith("data:etherscan"));
|
|
147
|
+
}
|
|
148
|
+
const strings = (value) => Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
149
|
+
/** labels(n) minus Address, with an unserved label dropped. */
|
|
150
|
+
function rolesOf(value) {
|
|
151
|
+
return strings(value).filter((role) => role !== "Address" && isServedLabel(role));
|
|
152
|
+
}
|
|
153
|
+
const FLAG_CRIMES = [
|
|
154
|
+
[
|
|
155
|
+
"sanctioned",
|
|
156
|
+
"is_sanctioned",
|
|
157
|
+
"Sanctioned"
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
"scam",
|
|
161
|
+
"is_scam",
|
|
162
|
+
"Scam"
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"victim",
|
|
166
|
+
"is_victim",
|
|
167
|
+
"Victim"
|
|
168
|
+
],
|
|
169
|
+
[
|
|
170
|
+
"issuer_frozen",
|
|
171
|
+
"is_issuer_frozen",
|
|
172
|
+
"IssuerFrozen"
|
|
173
|
+
]
|
|
174
|
+
];
|
|
175
|
+
/** The flags that are true, then one risk entry per served risk label with its level. */
|
|
176
|
+
function crimeOf(row, prefix) {
|
|
177
|
+
const crime = [];
|
|
178
|
+
for (const [kind, flag, value] of FLAG_CRIMES) if (row[`${prefix}_${flag}`] === true) crime.push({
|
|
179
|
+
kind,
|
|
180
|
+
value,
|
|
181
|
+
level: null
|
|
182
|
+
});
|
|
183
|
+
const labels = Array.isArray(row[`${prefix}_risk_labels`]) ? row[`${prefix}_risk_labels`] : [];
|
|
184
|
+
const levels = Array.isArray(row[`${prefix}_risk_levels`]) ? row[`${prefix}_risk_levels`] : [];
|
|
185
|
+
labels.forEach((label, at) => {
|
|
186
|
+
if (typeof label !== "string" || label.trim() === "" || !isServedLabel(label)) return;
|
|
187
|
+
crime.push({
|
|
188
|
+
kind: "risk",
|
|
189
|
+
value: label,
|
|
190
|
+
level: textOrNull(levels[at])
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
return crime;
|
|
194
|
+
}
|
|
195
|
+
/** The funder kinds, first match wins; a contract with no role is 'contract', no match is a plain wallet. */
|
|
196
|
+
const FUNDER_KIND_RULES = [
|
|
197
|
+
["scam", (roles, isScam) => isScam || roles.includes("Scam")],
|
|
198
|
+
["mixer", (roles) => roles.includes("Mixer")],
|
|
199
|
+
["exchange", (roles) => roles.includes("Exchange")],
|
|
200
|
+
["bridge", (roles) => roles.includes("Bridge")],
|
|
201
|
+
["bundler", (roles) => roles.includes("Bundler")],
|
|
202
|
+
["launchpad", (roles) => roles.includes("Pool") || roles.includes("Protocol")],
|
|
203
|
+
["contract", (roles) => roles.includes("Contract")]
|
|
204
|
+
];
|
|
205
|
+
function funderKind(roles, isScam = false) {
|
|
206
|
+
return FUNDER_KIND_RULES.find(([, rule]) => rule(roles, isScam))?.[0] ?? "wallet";
|
|
207
|
+
}
|
|
208
|
+
function partyOf(row) {
|
|
209
|
+
const address = addressOrNull(row.launcher);
|
|
210
|
+
if (!address) return null;
|
|
211
|
+
const firstActivity = numberOrNull(row.launcher_first_activity);
|
|
212
|
+
return {
|
|
213
|
+
address,
|
|
214
|
+
roles: rolesOf(row.launcher_roles),
|
|
215
|
+
crime: crimeOf(row, "launcher"),
|
|
216
|
+
first_activity: firstActivity,
|
|
217
|
+
first_activity_utc: utcOrNull(firstActivity),
|
|
218
|
+
degree_in: numberOrNull(row.launcher_degree_in),
|
|
219
|
+
degree_out: numberOrNull(row.launcher_degree_out)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function funderOf(row) {
|
|
223
|
+
const address = addressOrNull(row.funder);
|
|
224
|
+
if (!address) return null;
|
|
225
|
+
const roles = rolesOf(row.funder_roles);
|
|
226
|
+
const firstActivity = numberOrNull(row.funder_first_activity);
|
|
227
|
+
const fundedAt = numberOrNull(row.funded_at);
|
|
228
|
+
return {
|
|
229
|
+
address,
|
|
230
|
+
kind: funderKind(roles, row.funder_is_scam === true),
|
|
231
|
+
roles,
|
|
232
|
+
crime: crimeOf(row, "funder"),
|
|
233
|
+
degree_out: numberOrNull(row.funder_degree_out),
|
|
234
|
+
first_activity: firstActivity,
|
|
235
|
+
first_activity_utc: utcOrNull(firstActivity),
|
|
236
|
+
funded_at: fundedAt,
|
|
237
|
+
funded_at_utc: utcOrNull(fundedAt),
|
|
238
|
+
funding_tx_count: numberOrNull(row.funding_tx_count),
|
|
239
|
+
funding_usd: numberOrNull(row.funding_usd)
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function bridgedInOf(row) {
|
|
243
|
+
const chain = textOrNull(row.bridged_chain);
|
|
244
|
+
const kind = textOrNull(row.bridged_kind);
|
|
245
|
+
if (!chain && !kind) return null;
|
|
246
|
+
const asset = textOrNull(row.bridged_asset);
|
|
247
|
+
return {
|
|
248
|
+
chain,
|
|
249
|
+
bridge: addressOrNull(row.bridged_bridge) ?? textOrNull(row.bridged_bridge),
|
|
250
|
+
kind,
|
|
251
|
+
asset: addressOrNull(asset) ?? asset,
|
|
252
|
+
first_block: numberOrNull(row.bridged_first_block)
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function creationOf(row) {
|
|
256
|
+
const factory = addressOrNull(row.factory);
|
|
257
|
+
const kind = textOrNull(row.creation_kind);
|
|
258
|
+
const time = numberOrNull(row.creation_time);
|
|
259
|
+
return {
|
|
260
|
+
tx: textOrNull(row.creation_tx)?.toLowerCase() ?? null,
|
|
261
|
+
block: numberOrNull(row.creation_block),
|
|
262
|
+
time,
|
|
263
|
+
time_utc: utcOrNull(time),
|
|
264
|
+
deployer: addressOrNull(row.deployer),
|
|
265
|
+
factory,
|
|
266
|
+
mode: kind === "factory" || kind !== "direct" && factory !== null ? "factory" : "direct"
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/** The first row of a member that names a launcher, or null when it has none. */
|
|
270
|
+
function launcherRow(member) {
|
|
271
|
+
if (!member || !Array.isArray(member.results)) return null;
|
|
272
|
+
return member.results.find((row) => isRecord(row) && addressOrNull(row.launcher) !== null) ?? null;
|
|
273
|
+
}
|
|
274
|
+
const answered = (member) => member?.ok === true && Array.isArray(member.results);
|
|
275
|
+
function memberFailure(id, member) {
|
|
276
|
+
if (!member) return `the ${id} read is missing from the batch answer`;
|
|
277
|
+
return typeof member.error === "string" && member.error.trim() !== "" ? member.error : `the ${id} read did not answer`;
|
|
278
|
+
}
|
|
279
|
+
/** The screen built from the two batch members, or why it cannot be. */
|
|
280
|
+
function screenFromMembers(network, input, members) {
|
|
281
|
+
const token = members.get("token");
|
|
282
|
+
const wallet = members.get("wallet");
|
|
283
|
+
const base = {
|
|
284
|
+
schema: AML_DEPLOYER_SCREEN_SCHEMA,
|
|
285
|
+
tool: AML_DEPLOYER_SCREEN_TOOL,
|
|
286
|
+
network,
|
|
287
|
+
input,
|
|
288
|
+
not_covered: [...NOT_COVERED]
|
|
289
|
+
};
|
|
290
|
+
if (!answered(token)) return { failure: memberFailure("token", token) };
|
|
291
|
+
const tokenRow = launcherRow(token);
|
|
292
|
+
if (tokenRow) {
|
|
293
|
+
const launcher = partyOf(tokenRow);
|
|
294
|
+
const result = {
|
|
295
|
+
...base,
|
|
296
|
+
found: true,
|
|
297
|
+
input_kind: "token",
|
|
298
|
+
token: {
|
|
299
|
+
address: addressOrNull(tokenRow.token) ?? input,
|
|
300
|
+
roles: rolesOf(tokenRow.token_roles)
|
|
301
|
+
},
|
|
302
|
+
creation: creationOf(tokenRow),
|
|
303
|
+
launcher,
|
|
304
|
+
launcher_resolved: !launcher.roles.includes("Bundler"),
|
|
305
|
+
first_funder: funderOf(tokenRow),
|
|
306
|
+
bridged_in: bridgedInOf(tokenRow)
|
|
307
|
+
};
|
|
308
|
+
return { result: {
|
|
309
|
+
...result,
|
|
310
|
+
hint: hintFor(result)
|
|
311
|
+
} };
|
|
312
|
+
}
|
|
313
|
+
if (!answered(wallet)) return { failure: memberFailure("wallet", wallet) };
|
|
314
|
+
const walletRow = launcherRow(wallet);
|
|
315
|
+
if (walletRow) {
|
|
316
|
+
const launcher = partyOf(walletRow);
|
|
317
|
+
const result = {
|
|
318
|
+
...base,
|
|
319
|
+
found: true,
|
|
320
|
+
input_kind: "wallet",
|
|
321
|
+
token: null,
|
|
322
|
+
creation: null,
|
|
323
|
+
launcher,
|
|
324
|
+
launcher_resolved: !launcher.roles.includes("Bundler"),
|
|
325
|
+
first_funder: funderOf(walletRow),
|
|
326
|
+
bridged_in: bridgedInOf(walletRow)
|
|
327
|
+
};
|
|
328
|
+
return { result: {
|
|
329
|
+
...result,
|
|
330
|
+
hint: hintFor(result)
|
|
331
|
+
} };
|
|
332
|
+
}
|
|
333
|
+
const result = {
|
|
334
|
+
...base,
|
|
335
|
+
found: false,
|
|
336
|
+
input_kind: null,
|
|
337
|
+
token: null,
|
|
338
|
+
creation: null,
|
|
339
|
+
launcher: null,
|
|
340
|
+
launcher_resolved: null,
|
|
341
|
+
first_funder: null,
|
|
342
|
+
bridged_in: null
|
|
343
|
+
};
|
|
344
|
+
return { result: {
|
|
345
|
+
...result,
|
|
346
|
+
hint: hintFor(result)
|
|
347
|
+
} };
|
|
348
|
+
}
|
|
349
|
+
const FACTS_ONLY = "Report these as facts. Give no score, no risk level and no verdict of your own: the user decides.";
|
|
350
|
+
function hintFor(result) {
|
|
351
|
+
const parts = [ANSWER_HINT];
|
|
352
|
+
if (!result.found) {
|
|
353
|
+
parts.push(`${result.input} is not in the Chain Insights Graph of ${result.network}: no flow, creation or bridge touches it. Say so in one line. That is not proof the address is clean, and it is not proof it is a token. Check the network and the address with the user.`);
|
|
354
|
+
return parts.join(" ");
|
|
355
|
+
}
|
|
356
|
+
parts.push(FACTS_ONLY);
|
|
357
|
+
if (result.input_kind === "wallet" && result.launcher?.roles.some((r) => r === "Contract" || r === "Token")) parts.push("The address is a contract, but the graph holds no creation record for it, so it was screened as a wallet.");
|
|
358
|
+
if (result.launcher_resolved === false) parts.push("The launcher is a bundler: it sends transactions for others, so the person behind the launch is not known from this read.");
|
|
359
|
+
if (!result.first_funder) parts.push("The launcher has no inbound flow in the graph: no first funder.");
|
|
360
|
+
parts.push(`not_covered names what the graph cannot see yet (${NOT_COVERED.join(", ")}); say so when it matters.`);
|
|
361
|
+
return parts.join(" ");
|
|
362
|
+
}
|
|
363
|
+
function errorResult(text) {
|
|
364
|
+
return {
|
|
365
|
+
content: [{
|
|
366
|
+
type: "text",
|
|
367
|
+
text
|
|
368
|
+
}],
|
|
369
|
+
isError: true
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function textResult(structured) {
|
|
373
|
+
return {
|
|
374
|
+
content: [{
|
|
375
|
+
type: "text",
|
|
376
|
+
text: JSON.stringify(structured, null, 2)
|
|
377
|
+
}],
|
|
378
|
+
structuredContent: structured,
|
|
379
|
+
isError: false
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
/** aml_deployer_screen, {network, address}. Every argument is checked before a read is sent. */
|
|
383
|
+
async function handleAmlDeployerScreen(args, deps) {
|
|
384
|
+
const record = isRecord(args) ? args : {};
|
|
385
|
+
let network;
|
|
386
|
+
try {
|
|
387
|
+
network = normalizeDexNetwork(record.network);
|
|
388
|
+
} catch (err) {
|
|
389
|
+
return errorResult(err instanceof DexRegistryError ? err.message : `invalid_network: ${err.message}`);
|
|
390
|
+
}
|
|
391
|
+
const raw = typeof record.address === "string" ? record.address.trim() : "";
|
|
392
|
+
if (!ADDRESS_INPUT.test(raw)) return errorResult("invalid_address: address is required: a token contract or a wallet, 0x plus 40 hex characters. A ticker or a name is not an address: call meta_token_lookup first.");
|
|
393
|
+
const address = raw.toLowerCase();
|
|
394
|
+
const unavailable = await deps.unavailable?.();
|
|
395
|
+
if (unavailable) return errorResult(`No deployer screen read was sent: ${unavailable} There is no answer yet, which is not "not found": try again later.`);
|
|
396
|
+
let answer;
|
|
397
|
+
try {
|
|
398
|
+
answer = await deps.graphQueryBatch({
|
|
399
|
+
network,
|
|
400
|
+
queries: deployerScreenQueries(address)
|
|
401
|
+
});
|
|
402
|
+
} catch (err) {
|
|
403
|
+
return errorResult(`The deployer screen read failed: ${deps.describeFailure(err)} This is not "not found": send the same screen again once.`);
|
|
404
|
+
}
|
|
405
|
+
const members = membersOf(answer);
|
|
406
|
+
if (members.size === 0) return errorResult(`The deployer screen read failed: ${answer.isError === true ? refusalOf(answer).text : "the batch answer held no reads"} This is not "not found".`);
|
|
407
|
+
const screen = screenFromMembers(network, address, members);
|
|
408
|
+
if ("failure" in screen) return errorResult(`The deployer screen read failed: ${screen.failure} This is not "not found": send the same screen again once.`);
|
|
409
|
+
return textResult(screen.result);
|
|
410
|
+
}
|
|
411
|
+
export { deployer_screen_exports as a, AML_DEPLOYER_SCREEN_TOOL as i, AML_DEPLOYER_SCREEN_DESCRIPTION as n, handleAmlDeployerScreen as o, AML_DEPLOYER_SCREEN_TITLE as r, AML_DEPLOYER_SCREEN_ANNOTATIONS as t };
|
|
412
|
+
|
|
413
|
+
//# sourceMappingURL=deployer-screen-eix6pvW7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployer-screen-eix6pvW7.mjs","names":[],"sources":["../src/mcp/deployer-screen.ts"],"sourcesContent":["/**\n * aml_deployer_screen: who is behind a token or a wallet, as facts.\n *\n * A local tool of the proxy. It sends one graph_query_batch with two reads on\n * USE topology, both anchored on the address:\n *\n * token the address as a contract: its first creation (DEPLOYED_CONTRACT),\n * the launcher (the transaction's sender), the launcher's first funder\n * of all time and its first inbound bridge deposit;\n * wallet the address as the launcher itself: the same funder and bridge reads.\n *\n * The token read answers first when it holds a row; the wallet read answers\n * otherwise. The tool returns facts and never a score, a level or a verdict:\n * the description below is the contract with every host, Claude Desktop chat\n * included, which reads no skill.\n */\n\nimport { ANSWER_HINT } from './answer-hint.js'\nimport { DexRegistryError, normalizeDexNetwork } from './dex-registry.js'\nimport { isEpochMs, utcText } from './timestamp-text.js'\nimport {\n membersOf,\n refusalOf,\n type GraphAnswer,\n type Member,\n type TokenToolDependencies,\n} from './token-lookup.js'\n\nexport const AML_DEPLOYER_SCREEN_TOOL = 'aml_deployer_screen' as const\nexport const AML_DEPLOYER_SCREEN_SCHEMA = 'chain-insights.aml-deployer-screen.v1' as const\nexport const AML_DEPLOYER_SCREEN_TITLE = 'Deployer screen'\nexport const AML_DEPLOYER_SCREEN_DESCRIPTION =\n 'Facts only, no score and no verdict: screens who is behind a token or a wallet. ' +\n 'For a token contract it returns the creation transaction and the launcher (the wallet that sent it); ' +\n 'for a wallet, that wallet as the launcher. Then the launcher\\'s first funder of all time and what kind of ' +\n 'wallet that funder is (wallet, contract, bridge, bundler, launchpad, exchange, mixer, scam), how many addresses the ' +\n 'funder ever paid, the sanctions, scam, victim and risk labels on each, and the first inbound bridge deposit. ' +\n 'The caller decides. A fresh launcher funded by a wallet that paid few addresses is the pattern to look at; ' +\n 'a funder that paid thousands is shared infrastructure. A launcher that is a bundler hides the real sender: ' +\n 'launcher_resolved is then false. not_covered lists what the graph cannot see yet.'\nexport const AML_DEPLOYER_SCREEN_ANNOTATIONS = {\n readOnlyHint: true,\n idempotentHint: true,\n openWorldHint: false,\n} as const\nexport const AML_DEPLOYER_SCREEN_ARGS = ['network', 'address'] as const\n\n/** What the two reads cannot see yet, named in every answer. */\nexport const NOT_COVERED = ['exploit_labels', 'ml_labels', 'bridge_sender', 'ethereum_history'] as const\n\nexport type CrimeKind = 'sanctioned' | 'scam' | 'victim' | 'issuer_frozen' | 'risk'\nexport interface Crime {\n kind: CrimeKind\n value: string\n level: string | null\n}\n\nexport interface Party {\n address: string\n roles: string[]\n crime: Crime[]\n first_activity: number | null\n first_activity_utc: string | null\n degree_in: number | null\n degree_out: number | null\n}\n\nexport type FunderKind = 'scam' | 'mixer' | 'exchange' | 'bridge' | 'bundler' | 'launchpad' | 'contract' | 'wallet'\n\nexport interface Funder {\n address: string\n kind: FunderKind\n roles: string[]\n crime: Crime[]\n degree_out: number | null\n first_activity: number | null\n first_activity_utc: string | null\n funded_at: number | null\n funded_at_utc: string | null\n funding_tx_count: number | null\n funding_usd: number | null\n}\n\nexport interface Creation {\n tx: string | null\n block: number | null\n time: number | null\n time_utc: string | null\n deployer: string | null\n factory: string | null\n mode: 'direct' | 'factory'\n}\n\nexport interface BridgedIn {\n chain: string | null\n bridge: string | null\n kind: string | null\n asset: string | null\n first_block: number | null\n}\n\nexport interface AmlDeployerScreenResult {\n schema: typeof AML_DEPLOYER_SCREEN_SCHEMA\n tool: typeof AML_DEPLOYER_SCREEN_TOOL\n network: string\n input: string\n /** false when the graph holds no node for the address: every fact below is then null. */\n found: boolean\n input_kind: 'token' | 'wallet' | null\n token: { address: string; roles: string[] } | null\n creation: Creation | null\n launcher: Party | null\n launcher_resolved: boolean | null\n first_funder: Funder | null\n bridged_in: BridgedIn | null\n not_covered: string[]\n hint: string\n}\n\nexport type DeployerScreenDependencies = Pick<\n TokenToolDependencies,\n 'graphQueryBatch' | 'unavailable' | 'describeFailure'\n>\n\nexport type AmlDeployerScreenToolResult = {\n content: Array<{ type: 'text'; text: string }>\n structuredContent?: Record<string, unknown>\n isError: boolean\n}\n\n// The only address form ever written into a read: 0x and 40 lowercase hex.\nconst ADDRESS_INPUT = /^0x[0-9a-fA-F]{40}$/\nconst ADDRESS_READ = /^0x[0-9a-f]{40}$/\n\n// The funder's first inbound flow and the first inbound bridge deposit of the\n// launcher `l`, and the columns both reads return about them.\nconst FUNDER_READ = 'OPTIONAL MATCH (f:Address)-[e:FLOWED_TO]->(l)'\nconst BRIDGE_READ =\n \"OPTIONAL MATCH (ch:Chain)-[b:BRIDGED]->(l) WHERE b.kind IN ['TOKEN_DEPOSIT','NATIVE_DEPOSIT']\"\nconst PARTY_COLUMNS = [\n 'labels(l) AS launcher_roles',\n 'l.first_activity_timestamp AS launcher_first_activity',\n 'l.degree_in AS launcher_degree_in',\n 'l.degree_out AS launcher_degree_out',\n 'l.is_sanctioned AS launcher_is_sanctioned',\n 'l.is_scam AS launcher_is_scam',\n 'l.is_victim AS launcher_is_victim',\n 'l.is_issuer_frozen AS launcher_is_issuer_frozen',\n 'l.label_risk_labels AS launcher_risk_labels',\n 'l.label_risk_levels AS launcher_risk_levels',\n 'f.address AS funder',\n 'labels(f) AS funder_roles',\n 'f.degree_out AS funder_degree_out',\n 'f.first_activity_timestamp AS funder_first_activity',\n 'f.is_sanctioned AS funder_is_sanctioned',\n 'f.is_scam AS funder_is_scam',\n 'f.is_victim AS funder_is_victim',\n 'f.is_issuer_frozen AS funder_is_issuer_frozen',\n 'f.label_risk_labels AS funder_risk_labels',\n 'f.label_risk_levels AS funder_risk_levels',\n 'e.first_seen_timestamp AS funded_at',\n 'e.tx_count AS funding_tx_count',\n 'e.amount_usd_sum AS funding_usd',\n 'ch.network AS bridged_chain',\n 'ch.address AS bridged_bridge',\n 'b.kind AS bridged_kind',\n 'b.asset AS bridged_asset',\n 'b.first_height AS bridged_first_block',\n].join(', ')\nconst TOKEN_COLUMNS = [\n 't.address AS token',\n 'labels(t) AS token_roles',\n 'c.tx_origin AS launcher',\n 'c.deployer_address AS deployer',\n 'c.factory_address AS factory',\n 'c.kind AS creation_kind',\n 'c.tx_id AS creation_tx',\n 'c.block_height AS creation_block',\n 'c.block_timestamp AS creation_time',\n].join(', ')\n\nfunction assertReadAddress(address: string): void {\n if (!ADDRESS_READ.test(address)) {\n throw new Error(`deployer screen: ${JSON.stringify(address)} is not a lowercase 0x address`)\n }\n}\n\n/** The token read: the address as a contract, its first creation and who sent it. */\nexport function tokenScreenQuery(address: string): string {\n assertReadAddress(address)\n return [\n `USE topology MATCH (t:Address {address:'${address}'})<-[c:DEPLOYED_CONTRACT]-(:Address)`,\n 'WITH t, c ORDER BY c.block_height LIMIT 1',\n 'MATCH (l:Address {address: c.tx_origin})',\n FUNDER_READ,\n 'WITH t, c, l, f, e ORDER BY e.first_seen_timestamp LIMIT 1',\n BRIDGE_READ,\n 'WITH t, c, l, f, e, ch, b ORDER BY b.first_height LIMIT 1',\n `RETURN ${TOKEN_COLUMNS}, ${PARTY_COLUMNS} LIMIT 1`,\n ].join(' ')\n}\n\n/** The wallet read: the address as the launcher itself. */\nexport function walletScreenQuery(address: string): string {\n assertReadAddress(address)\n return [\n `USE topology MATCH (l:Address {address:'${address}'})`,\n FUNDER_READ,\n 'WITH l, f, e ORDER BY e.first_seen_timestamp LIMIT 1',\n BRIDGE_READ,\n 'WITH l, f, e, ch, b ORDER BY b.first_height LIMIT 1',\n `RETURN l.address AS launcher, ${PARTY_COLUMNS} LIMIT 1`,\n ].join(' ')\n}\n\n/** The one batch the tool sends: members `token` and `wallet`. */\nexport function deployerScreenQueries(address: string): Array<{ id: 'token' | 'wallet'; query: string }> {\n return [\n { id: 'token', query: tokenScreenQuery(address) },\n { id: 'wallet', query: walletScreenQuery(address) },\n ]\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value)\n}\n\nconst textOrNull = (value: unknown): string | null =>\n typeof value === 'string' && value.trim() !== '' ? value.trim() : null\n\nconst numberOrNull = (value: unknown): number | null => {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string' && value.trim() !== '' && Number.isFinite(Number(value)))\n return Number(value)\n return null\n}\n\nconst addressOrNull = (value: unknown): string | null =>\n typeof value === 'string' && ADDRESS_INPUT.test(value.trim()) ? value.trim().toLowerCase() : null\n\nconst utcOrNull = (ms: number | null): string | null => (isEpochMs(ms) ? utcText(ms) : null)\n\n/**\n * A label from a third-party explorer tag source is training data, never served.\n * The graph is not meant to carry one; this drops it if it ever does.\n */\nexport function isServedLabel(value: string): boolean {\n const lower = value.trim().toLowerCase()\n return !(lower.startsWith('etherscan') || lower.startsWith('data:etherscan'))\n}\n\nconst strings = (value: unknown): string[] =>\n Array.isArray(value) ? value.filter((v): v is string => typeof v === 'string') : []\n\n/** labels(n) minus Address, with an unserved label dropped. */\nfunction rolesOf(value: unknown): string[] {\n return strings(value).filter((role) => role !== 'Address' && isServedLabel(role))\n}\n\n// The flag of each judgement mark, and the mark's label word served as its value.\nconst FLAG_CRIMES: Array<[CrimeKind, string, string]> = [\n ['sanctioned', 'is_sanctioned', 'Sanctioned'],\n ['scam', 'is_scam', 'Scam'],\n ['victim', 'is_victim', 'Victim'],\n ['issuer_frozen', 'is_issuer_frozen', 'IssuerFrozen'],\n]\n\n/** The flags that are true, then one risk entry per served risk label with its level. */\nfunction crimeOf(row: Record<string, unknown>, prefix: 'launcher' | 'funder'): Crime[] {\n const crime: Crime[] = []\n for (const [kind, flag, value] of FLAG_CRIMES) {\n if (row[`${prefix}_${flag}`] === true) crime.push({ kind, value, level: null })\n }\n const labels = Array.isArray(row[`${prefix}_risk_labels`]) ? (row[`${prefix}_risk_labels`] as unknown[]) : []\n const levels = Array.isArray(row[`${prefix}_risk_levels`]) ? (row[`${prefix}_risk_levels`] as unknown[]) : []\n labels.forEach((label, at) => {\n if (typeof label !== 'string' || label.trim() === '' || !isServedLabel(label)) return\n crime.push({ kind: 'risk', value: label, level: textOrNull(levels[at]) })\n })\n return crime\n}\n\n/** The funder kinds, first match wins; a contract with no role is 'contract', no match is a plain wallet. */\nexport const FUNDER_KIND_RULES: ReadonlyArray<\n readonly [FunderKind, (roles: readonly string[], isScam: boolean) => boolean]\n> = [\n ['scam', (roles, isScam) => isScam || roles.includes('Scam')],\n ['mixer', (roles) => roles.includes('Mixer')],\n ['exchange', (roles) => roles.includes('Exchange')],\n ['bridge', (roles) => roles.includes('Bridge')],\n ['bundler', (roles) => roles.includes('Bundler')],\n ['launchpad', (roles) => roles.includes('Pool') || roles.includes('Protocol')],\n ['contract', (roles) => roles.includes('Contract')],\n]\n\nexport function funderKind(roles: readonly string[], isScam = false): FunderKind {\n return FUNDER_KIND_RULES.find(([, rule]) => rule(roles, isScam))?.[0] ?? 'wallet'\n}\n\nfunction partyOf(row: Record<string, unknown>): Party | null {\n const address = addressOrNull(row.launcher)\n if (!address) return null\n const firstActivity = numberOrNull(row.launcher_first_activity)\n return {\n address,\n roles: rolesOf(row.launcher_roles),\n crime: crimeOf(row, 'launcher'),\n first_activity: firstActivity,\n first_activity_utc: utcOrNull(firstActivity),\n degree_in: numberOrNull(row.launcher_degree_in),\n degree_out: numberOrNull(row.launcher_degree_out),\n }\n}\n\nfunction funderOf(row: Record<string, unknown>): Funder | null {\n const address = addressOrNull(row.funder)\n if (!address) return null\n const roles = rolesOf(row.funder_roles)\n const firstActivity = numberOrNull(row.funder_first_activity)\n const fundedAt = numberOrNull(row.funded_at)\n return {\n address,\n kind: funderKind(roles, row.funder_is_scam === true),\n roles,\n crime: crimeOf(row, 'funder'),\n degree_out: numberOrNull(row.funder_degree_out),\n first_activity: firstActivity,\n first_activity_utc: utcOrNull(firstActivity),\n funded_at: fundedAt,\n funded_at_utc: utcOrNull(fundedAt),\n funding_tx_count: numberOrNull(row.funding_tx_count),\n funding_usd: numberOrNull(row.funding_usd),\n }\n}\n\nfunction bridgedInOf(row: Record<string, unknown>): BridgedIn | null {\n const chain = textOrNull(row.bridged_chain)\n const kind = textOrNull(row.bridged_kind)\n if (!chain && !kind) return null\n const asset = textOrNull(row.bridged_asset)\n return {\n chain,\n bridge: addressOrNull(row.bridged_bridge) ?? textOrNull(row.bridged_bridge),\n kind,\n asset: addressOrNull(asset) ?? asset,\n first_block: numberOrNull(row.bridged_first_block),\n }\n}\n\nfunction creationOf(row: Record<string, unknown>): Creation {\n const factory = addressOrNull(row.factory)\n const kind = textOrNull(row.creation_kind)\n const time = numberOrNull(row.creation_time)\n return {\n tx: textOrNull(row.creation_tx)?.toLowerCase() ?? null,\n block: numberOrNull(row.creation_block),\n time,\n time_utc: utcOrNull(time),\n deployer: addressOrNull(row.deployer),\n factory,\n mode: kind === 'factory' || (kind !== 'direct' && factory !== null) ? 'factory' : 'direct',\n }\n}\n\n/** The first row of a member that names a launcher, or null when it has none. */\nfunction launcherRow(member: Member | undefined): Record<string, unknown> | null {\n if (!member || !Array.isArray(member.results)) return null\n return member.results.find((row) => isRecord(row) && addressOrNull(row.launcher) !== null) ?? null\n}\n\nconst answered = (member: Member | undefined): boolean =>\n member?.ok === true && Array.isArray(member.results)\n\nfunction memberFailure(id: string, member: Member | undefined): string {\n if (!member) return `the ${id} read is missing from the batch answer`\n return typeof member.error === 'string' && member.error.trim() !== ''\n ? member.error\n : `the ${id} read did not answer`\n}\n\n/** The screen built from the two batch members, or why it cannot be. */\nexport function screenFromMembers(\n network: string,\n input: string,\n members: Map<string, Member>\n): { result: AmlDeployerScreenResult } | { failure: string } {\n const token = members.get('token')\n const wallet = members.get('wallet')\n const base = {\n schema: AML_DEPLOYER_SCREEN_SCHEMA,\n tool: AML_DEPLOYER_SCREEN_TOOL,\n network,\n input,\n not_covered: [...NOT_COVERED] as string[],\n }\n\n // A token read that failed cannot be told from \"not a token\": no fallback.\n if (!answered(token)) return { failure: memberFailure('token', token) }\n const tokenRow = launcherRow(token)\n if (tokenRow) {\n const launcher = partyOf(tokenRow)!\n const result = {\n ...base,\n found: true,\n input_kind: 'token' as const,\n token: {\n address: addressOrNull(tokenRow.token) ?? input,\n roles: rolesOf(tokenRow.token_roles),\n },\n creation: creationOf(tokenRow),\n launcher,\n launcher_resolved: !launcher.roles.includes('Bundler'),\n first_funder: funderOf(tokenRow),\n bridged_in: bridgedInOf(tokenRow),\n }\n return { result: { ...result, hint: hintFor(result) } }\n }\n\n if (!answered(wallet)) return { failure: memberFailure('wallet', wallet) }\n const walletRow = launcherRow(wallet)\n if (walletRow) {\n const launcher = partyOf(walletRow)!\n const result = {\n ...base,\n found: true,\n input_kind: 'wallet' as const,\n token: null,\n creation: null,\n launcher,\n launcher_resolved: !launcher.roles.includes('Bundler'),\n first_funder: funderOf(walletRow),\n bridged_in: bridgedInOf(walletRow),\n }\n return { result: { ...result, hint: hintFor(result) } }\n }\n\n const result = {\n ...base,\n found: false,\n input_kind: null,\n token: null,\n creation: null,\n launcher: null,\n launcher_resolved: null,\n first_funder: null,\n bridged_in: null,\n }\n return { result: { ...result, hint: hintFor(result) } }\n}\n\nconst FACTS_ONLY =\n 'Report these as facts. Give no score, no risk level and no verdict of your own: the user decides.'\n\nfunction hintFor(result: Omit<AmlDeployerScreenResult, 'hint'>): string {\n const parts: string[] = [ANSWER_HINT]\n if (!result.found) {\n parts.push(\n `${result.input} is not in the Chain Insights Graph of ${result.network}: no flow, creation or bridge touches it. ` +\n 'Say so in one line. That is not proof the address is clean, and it is not proof it is a token. ' +\n 'Check the network and the address with the user.'\n )\n return parts.join(' ')\n }\n parts.push(FACTS_ONLY)\n if (result.input_kind === 'wallet' && result.launcher?.roles.some((r) => r === 'Contract' || r === 'Token')) {\n parts.push(\n 'The address is a contract, but the graph holds no creation record for it, so it was screened as a wallet.'\n )\n }\n if (result.launcher_resolved === false) {\n parts.push(\n 'The launcher is a bundler: it sends transactions for others, so the person behind the launch is not known from this read.'\n )\n }\n if (!result.first_funder) parts.push('The launcher has no inbound flow in the graph: no first funder.')\n parts.push(`not_covered names what the graph cannot see yet (${NOT_COVERED.join(', ')}); say so when it matters.`)\n return parts.join(' ')\n}\n\nfunction errorResult(text: string): AmlDeployerScreenToolResult {\n return { content: [{ type: 'text', text }], isError: true }\n}\n\nfunction textResult(structured: AmlDeployerScreenResult): AmlDeployerScreenToolResult {\n return {\n content: [{ type: 'text', text: JSON.stringify(structured, null, 2) }],\n structuredContent: structured as unknown as Record<string, unknown>,\n isError: false,\n }\n}\n\n/** aml_deployer_screen, {network, address}. Every argument is checked before a read is sent. */\nexport async function handleAmlDeployerScreen(\n args: unknown,\n deps: DeployerScreenDependencies\n): Promise<AmlDeployerScreenToolResult> {\n const record = isRecord(args) ? args : {}\n let network: string\n try {\n network = normalizeDexNetwork(record.network)\n } catch (err) {\n return errorResult(\n err instanceof DexRegistryError ? err.message : `invalid_network: ${(err as Error).message}`\n )\n }\n const raw = typeof record.address === 'string' ? record.address.trim() : ''\n if (!ADDRESS_INPUT.test(raw)) {\n return errorResult(\n 'invalid_address: address is required: a token contract or a wallet, 0x plus 40 hex characters. ' +\n 'A ticker or a name is not an address: call meta_token_lookup first.'\n )\n }\n const address = raw.toLowerCase()\n\n const unavailable = await deps.unavailable?.()\n if (unavailable) {\n return errorResult(\n `No deployer screen read was sent: ${unavailable} There is no answer yet, which is not \"not found\": try again later.`\n )\n }\n\n let answer: GraphAnswer\n try {\n answer = await deps.graphQueryBatch({ network, queries: deployerScreenQueries(address) })\n } catch (err) {\n return errorResult(\n `The deployer screen read failed: ${deps.describeFailure(err)} This is not \"not found\": send the same screen again once.`\n )\n }\n const members = membersOf(answer)\n if (members.size === 0) {\n const text = answer.isError === true ? refusalOf(answer).text : 'the batch answer held no reads'\n return errorResult(`The deployer screen read failed: ${text} This is not \"not found\".`)\n }\n const screen = screenFromMembers(network, address, members)\n if ('failure' in screen) {\n return errorResult(\n `The deployer screen read failed: ${screen.failure} This is not \"not found\": send the same screen again once.`\n )\n }\n return textResult(screen.result)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,kCACX;AAQF,MAAa,kCAAkC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CAAC;EACrE,mBAAmB;EACnB,SAAS;CACX;AACF;;AAGA,eAAsB,wBACpB,MACA,MACsC;CACtC,MAAM,SAAS,SAAS,IAAI,IAAI,OAAO,CAAC;CACxC,IAAI;CACJ,IAAI;EACF,UAAU,oBAAoB,OAAO,OAAO;CAC9C,SAAS,KAAK;EACZ,OAAO,YACL,eAAe,mBAAmB,IAAI,UAAU,oBAAqB,IAAc,SACrF;CACF;CACA,MAAM,MAAM,OAAO,OAAO,YAAY,WAAW,OAAO,QAAQ,KAAK,IAAI;CACzE,IAAI,CAAC,cAAc,KAAK,GAAG,GACzB,OAAO,YACL,oKAEF;CAEF,MAAM,UAAU,IAAI,YAAY;CAEhC,MAAM,cAAc,MAAM,KAAK,cAAc;CAC7C,IAAI,aACF,OAAO,YACL,qCAAqC,YAAY,oEACnD;CAGF,IAAI;CACJ,IAAI;EACF,SAAS,MAAM,KAAK,gBAAgB;GAAE;GAAS,SAAS,sBAAsB,OAAO;EAAE,CAAC;CAC1F,SAAS,KAAK;EACZ,OAAO,YACL,oCAAoC,KAAK,gBAAgB,GAAG,EAAE,2DAChE;CACF;CACA,MAAM,UAAU,UAAU,MAAM;CAChC,IAAI,QAAQ,SAAS,GAEnB,OAAO,YAAY,oCADN,OAAO,YAAY,OAAO,UAAU,MAAM,CAAC,CAAC,OAAO,iCACJ,0BAA0B;CAExF,MAAM,SAAS,kBAAkB,SAAS,SAAS,OAAO;CAC1D,IAAI,aAAa,QACf,OAAO,YACL,oCAAoC,OAAO,QAAQ,2DACrD;CAEF,OAAO,WAAW,OAAO,MAAM;AACjC"}
|
package/dist/mcp-proxy.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-BW-eSwOZ.cjs");
|
|
3
3
|
const require_print_result = require("./print-result-BYppJlUi.cjs");
|
|
4
|
-
const require_tool_visibility = require("./tool-visibility-
|
|
4
|
+
const require_tool_visibility = require("./tool-visibility-DwNr6Rp9.cjs");
|
|
5
5
|
const require_client = require("./client-Ddk4X9Ko.cjs");
|
|
6
6
|
const require_usage_status = require("./usage-status-DnV3I3gX.cjs");
|
|
7
7
|
const require_subscription_status = require("./subscription-status-w4zI2KCK.cjs");
|
|
@@ -12,7 +12,8 @@ const require_action_log = require("./action-log-WMW6xFMx.cjs");
|
|
|
12
12
|
const require_answer_hint = require("./answer-hint-BlYEBq_Y.cjs");
|
|
13
13
|
const require_dex_tool = require("./dex-tool-CDmhhXfk.cjs");
|
|
14
14
|
const require_dex_registry = require("./dex-registry-DdXOg5On.cjs");
|
|
15
|
-
const require_token_lookup = require("./token-lookup-
|
|
15
|
+
const require_token_lookup = require("./token-lookup-DBN3Lxl7.cjs");
|
|
16
|
+
const require_deployer_screen = require("./deployer-screen-4AxZhsrO.cjs");
|
|
16
17
|
let node_url = require("node:url");
|
|
17
18
|
let node_path = require("node:path");
|
|
18
19
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -821,6 +822,7 @@ const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
821
822
|
"meta_rules",
|
|
822
823
|
require_dex_tool.META_DEX_LOOKUP_TOOL,
|
|
823
824
|
require_token_lookup.META_TOKEN_LOOKUP_TOOL,
|
|
825
|
+
require_deployer_screen.AML_DEPLOYER_SCREEN_TOOL,
|
|
824
826
|
"wallet_balance",
|
|
825
827
|
"wallet_topup",
|
|
826
828
|
require_rules.SUBSCRIPTION_TOPUP_TOOL,
|
|
@@ -889,6 +891,7 @@ const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
|
|
|
889
891
|
meta_schema: require_graph_schema.META_SCHEMA_DESCRIPTION,
|
|
890
892
|
[require_dex_tool.META_DEX_LOOKUP_TOOL]: require_dex_tool.META_DEX_LOOKUP_DESCRIPTION,
|
|
891
893
|
[require_token_lookup.META_TOKEN_LOOKUP_TOOL]: require_token_lookup.META_TOKEN_LOOKUP_DESCRIPTION,
|
|
894
|
+
[require_deployer_screen.AML_DEPLOYER_SCREEN_TOOL]: require_deployer_screen.AML_DEPLOYER_SCREEN_DESCRIPTION,
|
|
892
895
|
meta_usage_status: "Return the caller's public free graph_query quota for the current UTC day.",
|
|
893
896
|
meta_subscription_status: require_rules.META_SUBSCRIPTION_STATUS_DESCRIPTION,
|
|
894
897
|
meta_help: "Show a short guide to Chain Insights tools and workflow.",
|
|
@@ -1681,6 +1684,15 @@ async function createProxy() {
|
|
|
1681
1684
|
},
|
|
1682
1685
|
annotations: require_token_lookup.META_TOKEN_LOOKUP_ANNOTATIONS
|
|
1683
1686
|
}, async (args) => require_token_lookup.handleMetaTokenLookup(args, tokenDependencies));
|
|
1687
|
+
server.registerTool(require_deployer_screen.AML_DEPLOYER_SCREEN_TOOL, {
|
|
1688
|
+
title: require_deployer_screen.AML_DEPLOYER_SCREEN_TITLE,
|
|
1689
|
+
description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS[require_deployer_screen.AML_DEPLOYER_SCREEN_TOOL],
|
|
1690
|
+
inputSchema: {
|
|
1691
|
+
network: NETWORK_SCHEMA,
|
|
1692
|
+
address: zod.string().min(1).describe("The token contract or the wallet to screen: 0x plus 40 hex characters, any case. A ticker is not an address: call meta_token_lookup first.")
|
|
1693
|
+
},
|
|
1694
|
+
annotations: require_deployer_screen.AML_DEPLOYER_SCREEN_ANNOTATIONS
|
|
1695
|
+
}, async (args) => require_deployer_screen.handleAmlDeployerScreen(args, tokenDependencies));
|
|
1684
1696
|
const readUsageStatus = async () => {
|
|
1685
1697
|
try {
|
|
1686
1698
|
await ensureRemote();
|
|
@@ -1929,6 +1941,7 @@ async function createProxy() {
|
|
|
1929
1941
|
"- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
|
|
1930
1942
|
"- 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.",
|
|
1931
1943
|
"- 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.",
|
|
1944
|
+
"- aml_deployer_screen: who is behind a token or a wallet, as facts: the launcher, its first funder and what kind of wallet that is, their labels and the first inbound bridge deposit. No score, no verdict.",
|
|
1932
1945
|
"- meta_usage_status: check the caller public free graph_query quota.",
|
|
1933
1946
|
"- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
|
|
1934
1947
|
"- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
|
|
@@ -1950,6 +1963,7 @@ async function createProxy() {
|
|
|
1950
1963
|
"- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
|
|
1951
1964
|
"- 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.",
|
|
1952
1965
|
"- 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.",
|
|
1966
|
+
"- aml_deployer_screen: who is behind a token or a wallet, as facts: the launcher, its first funder and what kind of wallet that is, their labels and the first inbound bridge deposit. No score, no verdict.",
|
|
1953
1967
|
"- meta_usage_status: check the caller public free graph_query quota.",
|
|
1954
1968
|
"- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
|
|
1955
1969
|
"- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
|
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":";qBAoFa,kBAAgB;qBAgBhB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAIA;qBAKA;qBAGA,gCAAgC;KAwBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,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":";qBAoFa,kBAAgB;qBAgBhB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAIA;qBAKA;qBAGA,gCAAgC;KAwBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,eAAe"}
|
package/dist/mcp-proxy.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as withoutUtcProperties, s as withTimestampTextResult, u as PACKAGE_VERSION } from "./print-result-IFARsMnL.mjs";
|
|
2
|
-
import { i as isAppOnlyTool, n as PUBLIC_MCP_TOOL_ALLOWED_ARGS, r as PUBLIC_MCP_TOOL_REQUIRED_ARGS, t as HIDDEN_REMOTE_TOOL_NAMES } from "./tool-visibility-
|
|
2
|
+
import { i as isAppOnlyTool, n as PUBLIC_MCP_TOOL_ALLOWED_ARGS, r as PUBLIC_MCP_TOOL_REQUIRED_ARGS, t as HIDDEN_REMOTE_TOOL_NAMES } from "./tool-visibility-DlxA8R00.mjs";
|
|
3
3
|
import { t as PaymentRequiredError } from "./client-BaHAIidE.mjs";
|
|
4
4
|
import { n as primitiveBackendUsageStatus, t as freeTierSpentText } from "./usage-status-BUZgRl4r.mjs";
|
|
5
5
|
import { i as unavailableSubscriptionStatus, n as subscriptionStatusNeedsWallet, t as subscriptionStatusArguments } from "./subscription-status-5WfPhSep.mjs";
|
|
@@ -10,7 +10,8 @@ import { r as appendActionLog, t as actionLogSignalsFromResult } from "./action-
|
|
|
10
10
|
import { n as withAnswerHintResult } from "./answer-hint-vOE1O6Lf.mjs";
|
|
11
11
|
import { i as META_DEX_LOOKUP_TOOL, n as META_DEX_LOOKUP_DESCRIPTION, o as handleMetaDexLookup, r as META_DEX_LOOKUP_TITLE, t as META_DEX_LOOKUP_ANNOTATIONS } from "./dex-tool-D61sIjpq.mjs";
|
|
12
12
|
import { r as loadRegistry } from "./dex-registry-sPTFuCrP.mjs";
|
|
13
|
-
import { a as SYMBOL_MAX, i as META_TOKEN_LOOKUP_TOOL, n as META_TOKEN_LOOKUP_DESCRIPTION, o as handleMetaTokenLookup, r as META_TOKEN_LOOKUP_TITLE, t as META_TOKEN_LOOKUP_ANNOTATIONS } from "./token-lookup-
|
|
13
|
+
import { a as SYMBOL_MAX, i as META_TOKEN_LOOKUP_TOOL, n as META_TOKEN_LOOKUP_DESCRIPTION, o as handleMetaTokenLookup, r as META_TOKEN_LOOKUP_TITLE, t as META_TOKEN_LOOKUP_ANNOTATIONS } from "./token-lookup-Bv_Fviis.mjs";
|
|
14
|
+
import { i as AML_DEPLOYER_SCREEN_TOOL, n as AML_DEPLOYER_SCREEN_DESCRIPTION, o as handleAmlDeployerScreen, r as AML_DEPLOYER_SCREEN_TITLE, t as AML_DEPLOYER_SCREEN_ANNOTATIONS } from "./deployer-screen-eix6pvW7.mjs";
|
|
14
15
|
import { fileURLToPath } from "node:url";
|
|
15
16
|
import path from "node:path";
|
|
16
17
|
import { readFileSync } from "node:fs";
|
|
@@ -817,6 +818,7 @@ const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
817
818
|
"meta_rules",
|
|
818
819
|
META_DEX_LOOKUP_TOOL,
|
|
819
820
|
META_TOKEN_LOOKUP_TOOL,
|
|
821
|
+
AML_DEPLOYER_SCREEN_TOOL,
|
|
820
822
|
"wallet_balance",
|
|
821
823
|
"wallet_topup",
|
|
822
824
|
SUBSCRIPTION_TOPUP_TOOL,
|
|
@@ -885,6 +887,7 @@ const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
|
|
|
885
887
|
meta_schema: META_SCHEMA_DESCRIPTION,
|
|
886
888
|
[META_DEX_LOOKUP_TOOL]: META_DEX_LOOKUP_DESCRIPTION,
|
|
887
889
|
[META_TOKEN_LOOKUP_TOOL]: META_TOKEN_LOOKUP_DESCRIPTION,
|
|
890
|
+
[AML_DEPLOYER_SCREEN_TOOL]: AML_DEPLOYER_SCREEN_DESCRIPTION,
|
|
888
891
|
meta_usage_status: "Return the caller's public free graph_query quota for the current UTC day.",
|
|
889
892
|
meta_subscription_status: META_SUBSCRIPTION_STATUS_DESCRIPTION,
|
|
890
893
|
meta_help: "Show a short guide to Chain Insights tools and workflow.",
|
|
@@ -1677,6 +1680,15 @@ async function createProxy() {
|
|
|
1677
1680
|
},
|
|
1678
1681
|
annotations: META_TOKEN_LOOKUP_ANNOTATIONS
|
|
1679
1682
|
}, async (args) => handleMetaTokenLookup(args, tokenDependencies));
|
|
1683
|
+
server.registerTool(AML_DEPLOYER_SCREEN_TOOL, {
|
|
1684
|
+
title: AML_DEPLOYER_SCREEN_TITLE,
|
|
1685
|
+
description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS[AML_DEPLOYER_SCREEN_TOOL],
|
|
1686
|
+
inputSchema: {
|
|
1687
|
+
network: NETWORK_SCHEMA,
|
|
1688
|
+
address: z.string().min(1).describe("The token contract or the wallet to screen: 0x plus 40 hex characters, any case. A ticker is not an address: call meta_token_lookup first.")
|
|
1689
|
+
},
|
|
1690
|
+
annotations: AML_DEPLOYER_SCREEN_ANNOTATIONS
|
|
1691
|
+
}, async (args) => handleAmlDeployerScreen(args, tokenDependencies));
|
|
1680
1692
|
const readUsageStatus = async () => {
|
|
1681
1693
|
try {
|
|
1682
1694
|
await ensureRemote();
|
|
@@ -1925,6 +1937,7 @@ async function createProxy() {
|
|
|
1925
1937
|
"- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
|
|
1926
1938
|
"- 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.",
|
|
1927
1939
|
"- 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.",
|
|
1940
|
+
"- aml_deployer_screen: who is behind a token or a wallet, as facts: the launcher, its first funder and what kind of wallet that is, their labels and the first inbound bridge deposit. No score, no verdict.",
|
|
1928
1941
|
"- meta_usage_status: check the caller public free graph_query quota.",
|
|
1929
1942
|
"- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
|
|
1930
1943
|
"- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
|
|
@@ -1946,6 +1959,7 @@ async function createProxy() {
|
|
|
1946
1959
|
"- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
|
|
1947
1960
|
"- 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.",
|
|
1948
1961
|
"- 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.",
|
|
1962
|
+
"- aml_deployer_screen: who is behind a token or a wallet, as facts: the launcher, its first funder and what kind of wallet that is, their labels and the first inbound bridge deposit. No score, no verdict.",
|
|
1949
1963
|
"- meta_usage_status: check the caller public free graph_query quota.",
|
|
1950
1964
|
"- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
|
|
1951
1965
|
"- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
|