chain-insights 0.57.5 → 0.57.7
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 +20 -49
- package/dist/cli.cjs +1 -76
- package/dist/cli.mjs +1 -76
- package/dist/cli.mjs.map +1 -1
- package/dist/mcp-proxy.cjs +3 -1
- package/dist/mcp-proxy.d.cts +2 -0
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts +2 -0
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +2 -2
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/subscription-status-DA9DCFrC.mjs +32 -0
- package/dist/subscription-status-DA9DCFrC.mjs.map +1 -0
- package/dist/subscription-status-ru99UCPZ.cjs +40 -0
- package/package.json +1 -1
- package/dist/subscription-status-CJ-DaMW9.mjs +0 -142
- package/dist/subscription-status-CJ-DaMW9.mjs.map +0 -1
- package/dist/subscription-status-Cm7LqY_h.cjs +0 -150
package/README.md
CHANGED
|
@@ -37,7 +37,9 @@ cia mcp tools # list remote graph tools
|
|
|
37
37
|
Sixty seconds gets you the CLI, a network overview, and the available remote
|
|
38
38
|
graph tools for Robinhood.
|
|
39
39
|
To call the same tools from an agent, register the MCP proxy:
|
|
40
|
-
`cia setup claude-code` (or `claude-desktop` / `codex` / `hermes`).
|
|
40
|
+
`cia setup claude-code` (or `claude-desktop` / `codex` / `chatgpt` / `hermes`).
|
|
41
|
+
The `chatgpt` target is for Codex chats inside the ChatGPT app: ask there,
|
|
42
|
+
not in a plain ChatGPT chat.
|
|
41
43
|
|
|
42
44
|
CLI results are human-readable by default. Add `--json` when another tool or
|
|
43
45
|
script needs indented JSON:
|
|
@@ -61,35 +63,20 @@ the balance), and reaches the Chain Insights Graph for the data.
|
|
|
61
63
|
- **Cannot start it:** claude.ai on the web, the Claude mobile apps and Cowork
|
|
62
64
|
cloud sessions. They run no program on your computer.
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Without the plugin, register the installed proxy in Claude Desktop directly:
|
|
68
|
-
|
|
69
|
-
1. Quit Claude Desktop fully. Closing the window is not enough: it keeps
|
|
70
|
-
running and writes its settings file back, which can remove the new entry.
|
|
71
|
-
- macOS: Claude menu > Quit Claude (Cmd+Q).
|
|
72
|
-
- Windows: right-click the Claude icon in the taskbar tray > Quit.
|
|
73
|
-
- Linux: File menu > Quit, or the tray icon > Quit.
|
|
74
|
-
2. Run `npm install -g chain-insights`, then `cia setup claude-desktop`.
|
|
75
|
-
It warns if Claude Desktop is still running.
|
|
76
|
-
3. Start Claude Desktop. `chain-insights` shows under Settings > Developer.
|
|
66
|
+
In Claude Code the plugin also ships a Stop hook that checks every answer
|
|
67
|
+
against the Chain Insights answer rules (full addresses, tokens are not
|
|
68
|
+
dollars) and sends the model back once when one is broken.
|
|
77
69
|
|
|
78
|
-
The
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
The plugin skills are copies of `skills/`. After editing a skill, run
|
|
84
|
-
`node scripts/sync-plugin-skills.mjs`; a test fails while the copies differ.
|
|
70
|
+
The plugin needs Node.js 22 or newer. Add this repository as a plugin
|
|
71
|
+
marketplace, then install the `chain-insights` plugin from it. Setup for
|
|
72
|
+
Claude Desktop without the plugin, and the plugin's own layout, are in
|
|
73
|
+
[plugin/README.md](plugin/README.md).
|
|
85
74
|
|
|
86
75
|
## Purpose And Ownership
|
|
87
76
|
|
|
88
77
|
One public npm package (`chain-insights`) providing the `cia` CLI and a
|
|
89
78
|
stdio MCP proxy over a Chain Insights Graph endpoint.
|
|
90
79
|
|
|
91
|
-
Owning group: chainswarm org, infra group.
|
|
92
|
-
|
|
93
80
|
## What It Does
|
|
94
81
|
|
|
95
82
|
Owns:
|
|
@@ -119,7 +106,9 @@ Never touches:
|
|
|
119
106
|
| `graph_query_batch` | Run related read-only graph queries as one MCP call |
|
|
120
107
|
| `meta_network_capabilities` | Check supported Chain Insights networks and graph tools |
|
|
121
108
|
| `meta_schema` | Read the live graph schema of a network: labels, link types, fields, indexes |
|
|
122
|
-
| `meta_usage_status` | Check the caller's daily free-
|
|
109
|
+
| `meta_usage_status` | Check the caller's daily free-tier graph query allowance |
|
|
110
|
+
| `meta_subscription_status` | Check the caller's $CIA subscription window and allowance |
|
|
111
|
+
| `meta_rules` | Read the answer rules when the `chain-insights-cypher` skill is not loaded |
|
|
123
112
|
| `meta_help` | Show Chain Insights tool and workflow guidance |
|
|
124
113
|
| `wallet_balance` | Show the local payment wallet amount |
|
|
125
114
|
| `wallet_topup` | Show the local payment wallet address and its QR code for a USDC top-up on Base |
|
|
@@ -349,24 +338,8 @@ first, then paid access continues automatically.
|
|
|
349
338
|
|
|
350
339
|
## Test
|
|
351
340
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
```bash
|
|
355
|
-
npm run typecheck
|
|
356
|
-
npm run build
|
|
357
|
-
npm test
|
|
358
|
-
npm run release:check # PR-only step in verify.yml
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
CI install step, when reproducing CI:
|
|
362
|
-
|
|
363
|
-
```bash
|
|
364
|
-
npm ci --ignore-scripts --audit=false --fund=false
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
CI workflows: `.github/workflows/verify.yml` (typecheck, build,
|
|
368
|
-
release:check, tests, npm pack contents), `security.yml`, `scorecard.yml`,
|
|
369
|
-
`docs.yml`.
|
|
341
|
+
The local gate, the CI install step and the workflows are in
|
|
342
|
+
[docs/development.md](docs/development.md).
|
|
370
343
|
|
|
371
344
|
## Debug
|
|
372
345
|
|
|
@@ -394,6 +367,9 @@ cia mcp tools --refresh
|
|
|
394
367
|
# Installed CLI sanity
|
|
395
368
|
cia --version && cia update --check
|
|
396
369
|
|
|
370
|
+
# Endpoint, wallet and access mode in one view
|
|
371
|
+
cia status
|
|
372
|
+
|
|
397
373
|
```
|
|
398
374
|
|
|
399
375
|
If network or tool discovery fails, check the endpoint and access mode
|
|
@@ -402,13 +378,8 @@ the command.
|
|
|
402
378
|
|
|
403
379
|
## Pre-staging / Release
|
|
404
380
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
verification checks. Before pre-staging or release, run the full local gate
|
|
408
|
-
and confirm the release metadata is consistent.
|
|
409
|
-
|
|
410
|
-
See [Release Discipline](docs/contributing.md#release-discipline) for the
|
|
411
|
-
complete contributor requirements.
|
|
381
|
+
Contributor rules, the version bump and the changelog entry every pull
|
|
382
|
+
request carries: [Release Discipline](docs/contributing.md#release-discipline).
|
|
412
383
|
|
|
413
384
|
## Documentation Links
|
|
414
385
|
|
package/dist/cli.cjs
CHANGED
|
@@ -162,66 +162,6 @@ async function printNetworkSchema(name, opts) {
|
|
|
162
162
|
});
|
|
163
163
|
console.log(opts.json ? JSON.stringify(schema, null, 2) : formatGraphSchemaText(schema));
|
|
164
164
|
}
|
|
165
|
-
/**
|
|
166
|
-
* Fetches the caller's subscription facts for the deposit pre-sign guard.
|
|
167
|
-
* The extension math is server-authoritative: the printed values come from
|
|
168
|
-
* `subscription_status`. Any failure (no wallet, unreachable endpoint,
|
|
169
|
-
* missing tool, error result) degrades to an unavailable lookup — the guard
|
|
170
|
-
* must never block the flow on a server that lacks the tool.
|
|
171
|
-
*/
|
|
172
|
-
async function fetchSubscriptionStatusForCli() {
|
|
173
|
-
try {
|
|
174
|
-
const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-BHfphgy9.cjs")).then((n) => n.tools_exports);
|
|
175
|
-
const account = await getWalletAccount();
|
|
176
|
-
return await withGraphMcpClient("chain-insights-cli-subscription-status", async (client) => {
|
|
177
|
-
const result = await client.callTool({
|
|
178
|
-
name: "subscription_status",
|
|
179
|
-
arguments: { wallet: account.address }
|
|
180
|
-
});
|
|
181
|
-
const { parseSubscriptionStatusToolResult } = await Promise.resolve().then(() => require("./subscription-status-Cm7LqY_h.cjs")).then((n) => n.subscription_status_exports);
|
|
182
|
-
const facts = parseSubscriptionStatusToolResult(result);
|
|
183
|
-
if (!facts) return {
|
|
184
|
-
kind: "unavailable",
|
|
185
|
-
reason: "the graph endpoint returned no subscription facts"
|
|
186
|
-
};
|
|
187
|
-
return {
|
|
188
|
-
kind: "available",
|
|
189
|
-
facts
|
|
190
|
-
};
|
|
191
|
-
});
|
|
192
|
-
} catch (err) {
|
|
193
|
-
return {
|
|
194
|
-
kind: "unavailable",
|
|
195
|
-
reason: err.message
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
async function printSubscriptionPassGuidance(pass) {
|
|
200
|
-
const { formatDepositGuardLine, formatDepositIrreversibilityWarning, formatSubscriptionPassHint, isDepositConfirmed, resolveSubscriptionMonthUsd } = await Promise.resolve().then(() => require("./subscription-status-Cm7LqY_h.cjs")).then((n) => n.subscription_status_exports);
|
|
201
|
-
const hint = formatSubscriptionPassHint(pass, resolveSubscriptionMonthUsd());
|
|
202
|
-
const status = await fetchSubscriptionStatusForCli();
|
|
203
|
-
if (status.kind === "available") {
|
|
204
|
-
process.stderr.write(`${formatDepositGuardLine(status.facts, pass)}\n`);
|
|
205
|
-
process.stderr.write("The no-admin subscription sink cannot refund deposits. Type DEPOSIT to continue:\n");
|
|
206
|
-
const { createInterface } = await import("node:readline/promises");
|
|
207
|
-
const prompt = createInterface({
|
|
208
|
-
input: process.stdin,
|
|
209
|
-
output: process.stderr
|
|
210
|
-
});
|
|
211
|
-
let answer;
|
|
212
|
-
try {
|
|
213
|
-
answer = await prompt.question("> ");
|
|
214
|
-
} finally {
|
|
215
|
-
prompt.close();
|
|
216
|
-
}
|
|
217
|
-
process.stderr.write("\n");
|
|
218
|
-
if (!isDepositConfirmed(answer)) throw new Error("Deposit cancelled. No deposit was made.");
|
|
219
|
-
console.log(hint);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
process.stderr.write(`${formatDepositIrreversibilityWarning(status.reason)}\n`);
|
|
223
|
-
console.log(hint);
|
|
224
|
-
}
|
|
225
165
|
function addAmlAddressRiskCommand(parent, networksCommand) {
|
|
226
166
|
parent.addCommand(createCliCommand("aml-address-risk").description("CIA workflow: screen an address for AML risk, exchange behavior, and optional comparison with another address").requiredOption("--address <address>", "Full blockchain address to screen").requiredOption("--network <network>", `Network to query. Run \`${networksCommand}\` for supported networks.`).option("--compare-address <address>", "Optional second address to compare against the screened address").option("--json", "Print machine-readable JSON output").option("--version <version>", "AML tool contract version. Omit to use the latest version (currently v1)").addOption(new commander.Option("--tool-version <version>", "Internal alias for the AML tool version").hideHelp()).action(async (opts) => {
|
|
227
167
|
try {
|
|
@@ -548,21 +488,6 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
548
488
|
process.exit(1);
|
|
549
489
|
}
|
|
550
490
|
}));
|
|
551
|
-
program.command("buy").description("Show CIA subscription pass deposit guidance (the sink cannot refund deposits)").addCommand(createCliCommand("day").description("Show day-pass deposit guidance (SUBSCRIPTION_MONTH_USD / 30)").action(async () => {
|
|
552
|
-
try {
|
|
553
|
-
await printSubscriptionPassGuidance("day");
|
|
554
|
-
} catch (err) {
|
|
555
|
-
console.error(err.message);
|
|
556
|
-
process.exit(1);
|
|
557
|
-
}
|
|
558
|
-
})).addCommand(createCliCommand("month").description("Show month-pass deposit guidance at the list price").action(async () => {
|
|
559
|
-
try {
|
|
560
|
-
await printSubscriptionPassGuidance("month");
|
|
561
|
-
} catch (err) {
|
|
562
|
-
console.error(err.message);
|
|
563
|
-
process.exit(1);
|
|
564
|
-
}
|
|
565
|
-
}));
|
|
566
491
|
program.command("mcp").description("Low-level access to the Chain Insights MCP endpoint").allowExcessArguments(false).addCommand(createCliCommand("networks").description("List the detailed Chain Insights capability matrix and tool support").option("--json", "Print raw capability JSON").action(async (opts) => {
|
|
567
492
|
try {
|
|
568
493
|
await printNetworkCapabilities(opts);
|
|
@@ -661,7 +586,7 @@ program.command("mcp").description("Low-level access to the Chain Insights MCP e
|
|
|
661
586
|
json: opts.json
|
|
662
587
|
});
|
|
663
588
|
} catch (err) {
|
|
664
|
-
const { isMissingSubscriptionStatusToolError, unavailableSubscriptionStatus, subscriptionStatusText } = await Promise.resolve().then(() => require("./subscription-status-
|
|
589
|
+
const { isMissingSubscriptionStatusToolError, unavailableSubscriptionStatus, subscriptionStatusText } = await Promise.resolve().then(() => require("./subscription-status-ru99UCPZ.cjs")).then((n) => n.subscription_status_exports);
|
|
665
590
|
if (!isMissingSubscriptionStatusToolError(err)) throw err;
|
|
666
591
|
const { resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-Ypw9BNbn.cjs")).then((n) => n.client_exports);
|
|
667
592
|
console.log(subscriptionStatusText(unavailableSubscriptionStatus(resolveGraphMcpEndpoint(config), `subscription_status failed: ${err.message}`)));
|
package/dist/cli.mjs
CHANGED
|
@@ -160,66 +160,6 @@ async function printNetworkSchema(name, opts) {
|
|
|
160
160
|
});
|
|
161
161
|
console.log(opts.json ? JSON.stringify(schema, null, 2) : formatGraphSchemaText(schema));
|
|
162
162
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Fetches the caller's subscription facts for the deposit pre-sign guard.
|
|
165
|
-
* The extension math is server-authoritative: the printed values come from
|
|
166
|
-
* `subscription_status`. Any failure (no wallet, unreachable endpoint,
|
|
167
|
-
* missing tool, error result) degrades to an unavailable lookup — the guard
|
|
168
|
-
* must never block the flow on a server that lacks the tool.
|
|
169
|
-
*/
|
|
170
|
-
async function fetchSubscriptionStatusForCli() {
|
|
171
|
-
try {
|
|
172
|
-
const { getWalletAccount } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
173
|
-
const account = await getWalletAccount();
|
|
174
|
-
return await withGraphMcpClient("chain-insights-cli-subscription-status", async (client) => {
|
|
175
|
-
const result = await client.callTool({
|
|
176
|
-
name: "subscription_status",
|
|
177
|
-
arguments: { wallet: account.address }
|
|
178
|
-
});
|
|
179
|
-
const { parseSubscriptionStatusToolResult } = await import("./subscription-status-CJ-DaMW9.mjs").then((n) => n.t);
|
|
180
|
-
const facts = parseSubscriptionStatusToolResult(result);
|
|
181
|
-
if (!facts) return {
|
|
182
|
-
kind: "unavailable",
|
|
183
|
-
reason: "the graph endpoint returned no subscription facts"
|
|
184
|
-
};
|
|
185
|
-
return {
|
|
186
|
-
kind: "available",
|
|
187
|
-
facts
|
|
188
|
-
};
|
|
189
|
-
});
|
|
190
|
-
} catch (err) {
|
|
191
|
-
return {
|
|
192
|
-
kind: "unavailable",
|
|
193
|
-
reason: err.message
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
async function printSubscriptionPassGuidance(pass) {
|
|
198
|
-
const { formatDepositGuardLine, formatDepositIrreversibilityWarning, formatSubscriptionPassHint, isDepositConfirmed, resolveSubscriptionMonthUsd } = await import("./subscription-status-CJ-DaMW9.mjs").then((n) => n.t);
|
|
199
|
-
const hint = formatSubscriptionPassHint(pass, resolveSubscriptionMonthUsd());
|
|
200
|
-
const status = await fetchSubscriptionStatusForCli();
|
|
201
|
-
if (status.kind === "available") {
|
|
202
|
-
process.stderr.write(`${formatDepositGuardLine(status.facts, pass)}\n`);
|
|
203
|
-
process.stderr.write("The no-admin subscription sink cannot refund deposits. Type DEPOSIT to continue:\n");
|
|
204
|
-
const { createInterface } = await import("node:readline/promises");
|
|
205
|
-
const prompt = createInterface({
|
|
206
|
-
input: process.stdin,
|
|
207
|
-
output: process.stderr
|
|
208
|
-
});
|
|
209
|
-
let answer;
|
|
210
|
-
try {
|
|
211
|
-
answer = await prompt.question("> ");
|
|
212
|
-
} finally {
|
|
213
|
-
prompt.close();
|
|
214
|
-
}
|
|
215
|
-
process.stderr.write("\n");
|
|
216
|
-
if (!isDepositConfirmed(answer)) throw new Error("Deposit cancelled. No deposit was made.");
|
|
217
|
-
console.log(hint);
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
process.stderr.write(`${formatDepositIrreversibilityWarning(status.reason)}\n`);
|
|
221
|
-
console.log(hint);
|
|
222
|
-
}
|
|
223
163
|
function addAmlAddressRiskCommand(parent, networksCommand) {
|
|
224
164
|
parent.addCommand(createCliCommand("aml-address-risk").description("CIA workflow: screen an address for AML risk, exchange behavior, and optional comparison with another address").requiredOption("--address <address>", "Full blockchain address to screen").requiredOption("--network <network>", `Network to query. Run \`${networksCommand}\` for supported networks.`).option("--compare-address <address>", "Optional second address to compare against the screened address").option("--json", "Print machine-readable JSON output").option("--version <version>", "AML tool contract version. Omit to use the latest version (currently v1)").addOption(new Option("--tool-version <version>", "Internal alias for the AML tool version").hideHelp()).action(async (opts) => {
|
|
225
165
|
try {
|
|
@@ -546,21 +486,6 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
546
486
|
process.exit(1);
|
|
547
487
|
}
|
|
548
488
|
}));
|
|
549
|
-
program.command("buy").description("Show CIA subscription pass deposit guidance (the sink cannot refund deposits)").addCommand(createCliCommand("day").description("Show day-pass deposit guidance (SUBSCRIPTION_MONTH_USD / 30)").action(async () => {
|
|
550
|
-
try {
|
|
551
|
-
await printSubscriptionPassGuidance("day");
|
|
552
|
-
} catch (err) {
|
|
553
|
-
console.error(err.message);
|
|
554
|
-
process.exit(1);
|
|
555
|
-
}
|
|
556
|
-
})).addCommand(createCliCommand("month").description("Show month-pass deposit guidance at the list price").action(async () => {
|
|
557
|
-
try {
|
|
558
|
-
await printSubscriptionPassGuidance("month");
|
|
559
|
-
} catch (err) {
|
|
560
|
-
console.error(err.message);
|
|
561
|
-
process.exit(1);
|
|
562
|
-
}
|
|
563
|
-
}));
|
|
564
489
|
program.command("mcp").description("Low-level access to the Chain Insights MCP endpoint").allowExcessArguments(false).addCommand(createCliCommand("networks").description("List the detailed Chain Insights capability matrix and tool support").option("--json", "Print raw capability JSON").action(async (opts) => {
|
|
565
490
|
try {
|
|
566
491
|
await printNetworkCapabilities(opts);
|
|
@@ -659,7 +584,7 @@ program.command("mcp").description("Low-level access to the Chain Insights MCP e
|
|
|
659
584
|
json: opts.json
|
|
660
585
|
});
|
|
661
586
|
} catch (err) {
|
|
662
|
-
const { isMissingSubscriptionStatusToolError, unavailableSubscriptionStatus, subscriptionStatusText } = await import("./subscription-status-
|
|
587
|
+
const { isMissingSubscriptionStatusToolError, unavailableSubscriptionStatus, subscriptionStatusText } = await import("./subscription-status-DA9DCFrC.mjs").then((n) => n.t);
|
|
663
588
|
if (!isMissingSubscriptionStatusToolError(err)) throw err;
|
|
664
589
|
const { resolveGraphMcpEndpoint } = await import("./client-gsLi528K.mjs").then((n) => n.r);
|
|
665
590
|
console.log(subscriptionStatusText(unavailableSubscriptionStatus(resolveGraphMcpEndpoint(config), `subscription_status failed: ${err.message}`)));
|