chain-insights 0.57.6 → 0.58.1
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 +46 -1
- package/dist/{capabilities-BGkL9yAr.cjs → capabilities-54Vh1A8B.cjs} +127 -7
- package/dist/{capabilities-Cur8x6c7.mjs → capabilities-SIyEvaPw.mjs} +128 -8
- package/dist/capabilities-SIyEvaPw.mjs.map +1 -0
- package/dist/cli.cjs +4 -4
- package/dist/cli.mjs +4 -4
- package/dist/{graph-schema-_u1aB_f1.cjs → graph-schema-2wUG2Vaz.cjs} +1 -1
- package/dist/{graph-schema-CwsQBYrP.mjs → graph-schema-CHfXmmDK.mjs} +2 -2
- package/dist/{graph-schema-CwsQBYrP.mjs.map → graph-schema-CHfXmmDK.mjs.map} +1 -1
- package/dist/mcp-proxy.cjs +4 -2
- 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 +3 -3
- package/dist/mcp-proxy.mjs.map +1 -1
- package/docs/graph-tools.md +3 -2
- package/docs/mcp-proxy.md +49 -4
- package/package.json +1 -1
- package/dist/capabilities-Cur8x6c7.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ as-is on macOS; on Windows use WSL.
|
|
|
29
29
|
npx chain-insights@latest --help # run without installing
|
|
30
30
|
npm install -g chain-insights # or install the cia CLI globally
|
|
31
31
|
cia networks # network status + dataset overview
|
|
32
|
-
cia network robinhood #
|
|
32
|
+
cia network robinhood # how far one network is indexed
|
|
33
33
|
cia network robinhood --schema # live graph schema, cached for 24 hours
|
|
34
34
|
cia mcp tools # list remote graph tools
|
|
35
35
|
```
|
|
@@ -372,6 +372,51 @@ cia status
|
|
|
372
372
|
|
|
373
373
|
```
|
|
374
374
|
|
|
375
|
+
`cia network robinhood` shows how far that network is indexed:
|
|
376
|
+
|
|
377
|
+
```text
|
|
378
|
+
$ cia network robinhood
|
|
379
|
+
Network Robinhood Chain
|
|
380
|
+
Identifier robinhood
|
|
381
|
+
Status live (default)
|
|
382
|
+
Blockchain head 87,642,448 (1 s old)
|
|
383
|
+
|
|
384
|
+
Indexing height behind head
|
|
385
|
+
receipts 87,642,307 141
|
|
386
|
+
traces 87,641,751 697
|
|
387
|
+
dex 11,959,694 75,682,754 ◀ slowest
|
|
388
|
+
bridge 87,641,751 697
|
|
389
|
+
smart accounts 87,641,751 697
|
|
390
|
+
|
|
391
|
+
Graph height behind head
|
|
392
|
+
flows 87,641,751 697
|
|
393
|
+
operated_by 87,642,307 141
|
|
394
|
+
dex_swaps 87,312,173 330,275 ◀ slowest
|
|
395
|
+
dex_liquidity 87,312,173 330,275 ◀ slowest
|
|
396
|
+
bridged 87,641,751 697
|
|
397
|
+
approvals 87,642,307 141
|
|
398
|
+
sponsored 87,641,703 745
|
|
399
|
+
bundled 87,641,751 697
|
|
400
|
+
signers 87,641,703 745
|
|
401
|
+
owners 87,641,751 697
|
|
402
|
+
contracts 87,641,751 697
|
|
403
|
+
|
|
404
|
+
Evidence height behind head
|
|
405
|
+
evidence not reported
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
- `Blockchain head` is the newest block the chain node holds, and how old that
|
|
409
|
+
reading is. Every other number reads against it.
|
|
410
|
+
- `Indexing` is the raw chain data: receipts, traces, dex, bridge and smart
|
|
411
|
+
accounts. `Graph` is each link kind of the topology graph. `Evidence` is the
|
|
412
|
+
evidence index.
|
|
413
|
+
- `height` is the block each one has reached. `behind head` is the head minus
|
|
414
|
+
that height.
|
|
415
|
+
- `◀ slowest` marks every row at the lowest height in its table.
|
|
416
|
+
- `not started` means that data has not begun. `not reported` means the
|
|
417
|
+
network does not report it yet.
|
|
418
|
+
- `--json` prints the network's reply unchanged.
|
|
419
|
+
|
|
375
420
|
If network or tool discovery fails, check the endpoint and access mode
|
|
376
421
|
first. Confirm the endpoint with `cia config get graphMcpEndpoint` and retry
|
|
377
422
|
the command.
|
|
@@ -7,6 +7,9 @@ var capabilities_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll(
|
|
|
7
7
|
formatNetworkCapabilities: () => formatNetworkCapabilities,
|
|
8
8
|
formatNetworkCapability: () => formatNetworkCapability,
|
|
9
9
|
formatNetworkOverview: () => formatNetworkOverview,
|
|
10
|
+
groupThousands: () => groupThousands,
|
|
11
|
+
laneDisplayName: () => laneDisplayName,
|
|
12
|
+
layerDisplayName: () => layerDisplayName,
|
|
10
13
|
mirrorGraphNetworkCapabilities: () => mirrorGraphNetworkCapabilities
|
|
11
14
|
});
|
|
12
15
|
const AVAILABLE_TOOLS_PER_LINE = 3;
|
|
@@ -185,16 +188,133 @@ function findNetworkCapability(document, name) {
|
|
|
185
188
|
if (!normalizedName) return void 0;
|
|
186
189
|
return document.networks.find((network) => [network.network, network.display_name].some((candidate) => candidate?.trim().toLowerCase() === normalizedName));
|
|
187
190
|
}
|
|
191
|
+
/** The writer lanes a customer sees, in screen order, by their plain names. */
|
|
192
|
+
const KNOWN_LANES = [
|
|
193
|
+
["core_transfers_source_head", "receipts"],
|
|
194
|
+
["core_transfers_internal_follow", "traces"],
|
|
195
|
+
["core_dex_follow", "dex"],
|
|
196
|
+
["core_bridge_follow", "bridge"],
|
|
197
|
+
["core_smart_account_follow", "smart accounts"]
|
|
198
|
+
];
|
|
199
|
+
/** The evidence worker's lane. It has its own table and never joins Indexing. */
|
|
200
|
+
const EVIDENCE_LANE = "evidence_sync";
|
|
201
|
+
/** The plain name a lane prints as. An unknown lane prints as sent. */
|
|
202
|
+
function laneDisplayName(lane) {
|
|
203
|
+
if (lane === EVIDENCE_LANE) return "evidence";
|
|
204
|
+
return KNOWN_LANES.find(([name]) => name === lane)?.[1] ?? lane;
|
|
205
|
+
}
|
|
206
|
+
/** A graph layer prints as sent: it is the link kind a query names. */
|
|
207
|
+
function layerDisplayName(layer) {
|
|
208
|
+
return layer;
|
|
209
|
+
}
|
|
210
|
+
/** 87642448 -> "87,642,448", the same on every machine (no locale). */
|
|
211
|
+
function groupThousands(value) {
|
|
212
|
+
return (value < 0 ? "-" : "") + String(Math.trunc(Math.abs(value))).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
213
|
+
}
|
|
214
|
+
const DETAIL_LABEL_WIDTH = 18;
|
|
215
|
+
const TABLE_LABEL_WIDTH = 30;
|
|
216
|
+
const HEIGHT_MIN_WIDTH = 10;
|
|
217
|
+
const LAG_HEADER = "behind head";
|
|
218
|
+
const SLOWEST_MARK = "◀ slowest";
|
|
219
|
+
function progressRows(entries, head) {
|
|
220
|
+
const heights = entries.map((entry) => entry.height).filter((height) => height !== null);
|
|
221
|
+
const lowest = heights.length > 0 ? Math.min(...heights) : void 0;
|
|
222
|
+
const marks = lowest !== void 0 && heights.some((height) => height > lowest);
|
|
223
|
+
return entries.map(({ label, height }) => ({
|
|
224
|
+
label,
|
|
225
|
+
height,
|
|
226
|
+
...height === null ? { note: "not started" } : {},
|
|
227
|
+
...height !== null && head !== void 0 ? { behind: Math.max(0, head - height) } : {},
|
|
228
|
+
slowest: marks && height === lowest
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
231
|
+
function notReportedRow(label) {
|
|
232
|
+
return {
|
|
233
|
+
label,
|
|
234
|
+
height: null,
|
|
235
|
+
note: "not reported",
|
|
236
|
+
slowest: false
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function formatProgressTables(tables, withLag) {
|
|
240
|
+
const allRows = tables.flatMap((table) => table.rows);
|
|
241
|
+
const labelWidth = Math.max(TABLE_LABEL_WIDTH, ...allRows.map((row) => row.label.length + 4), ...tables.map((table) => table.title.length + 2));
|
|
242
|
+
const heightWidth = Math.max(HEIGHT_MIN_WIDTH, ...allRows.map((row) => row.height === null ? 0 : groupThousands(row.height).length));
|
|
243
|
+
const lagWidth = Math.max(11, ...allRows.map((row) => row.behind === void 0 ? 0 : groupThousands(row.behind).length));
|
|
244
|
+
const lines = [];
|
|
245
|
+
for (const table of tables) {
|
|
246
|
+
if (lines.length > 0) lines.push("");
|
|
247
|
+
const header = table.title.padEnd(labelWidth) + "height";
|
|
248
|
+
lines.push(withLag ? header.padEnd(labelWidth + heightWidth + 2) + LAG_HEADER : header);
|
|
249
|
+
for (const row of table.rows) {
|
|
250
|
+
let line = ` ${row.label}`.padEnd(labelWidth);
|
|
251
|
+
if (row.height === null) line += row.note ?? "";
|
|
252
|
+
else {
|
|
253
|
+
line += groupThousands(row.height).padEnd(heightWidth);
|
|
254
|
+
if (withLag && row.behind !== void 0) line += " " + groupThousands(row.behind).padStart(lagWidth);
|
|
255
|
+
if (row.slowest) line += ` ${SLOWEST_MARK}`;
|
|
256
|
+
}
|
|
257
|
+
lines.push(line.trimEnd());
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return lines;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* `cia network <name>`: how far this network is indexed. The chain node's head
|
|
264
|
+
* comes first; every row reads against it. Known lanes print by plain name,
|
|
265
|
+
* unknown lanes as sent after them, graph layers as sent, and evidence in its
|
|
266
|
+
* own table. `--json` never comes through here.
|
|
267
|
+
*/
|
|
188
268
|
function formatNetworkCapability(network) {
|
|
189
|
-
const
|
|
190
|
-
|
|
269
|
+
const headBlock = network.freshness?.chain_head_block;
|
|
270
|
+
const head = typeof headBlock === "number" ? headBlock : void 0;
|
|
271
|
+
const detail = [
|
|
272
|
+
["Network", displayName(network)],
|
|
191
273
|
["Identifier", network.network],
|
|
192
|
-
["Status", network
|
|
193
|
-
["Dataset", datasetLabel(network)],
|
|
194
|
-
["Available tools", availableTools(network).join(", ") || "none"]
|
|
274
|
+
["Status", statusLabel(network)]
|
|
195
275
|
];
|
|
196
|
-
|
|
197
|
-
|
|
276
|
+
if (head !== void 0) {
|
|
277
|
+
const age = network.freshness?.chain_head_age_seconds;
|
|
278
|
+
const ageText = typeof age === "number" ? ` (${groupThousands(age)} s old)` : "";
|
|
279
|
+
detail.push(["Blockchain head", `${groupThousands(head)}${ageText}`]);
|
|
280
|
+
}
|
|
281
|
+
const lanes = network.lane_progress ?? [];
|
|
282
|
+
const known = KNOWN_LANES.flatMap(([name, label]) => lanes.filter((lane) => lane.lane === name).map((lane) => ({
|
|
283
|
+
label,
|
|
284
|
+
height: lane.height
|
|
285
|
+
})));
|
|
286
|
+
const unknown = lanes.filter((lane) => lane.lane !== EVIDENCE_LANE && !KNOWN_LANES.some(([name]) => name === lane.lane)).map((lane) => ({
|
|
287
|
+
label: laneDisplayName(lane.lane),
|
|
288
|
+
height: lane.height
|
|
289
|
+
}));
|
|
290
|
+
const indexing = [...known, ...unknown];
|
|
291
|
+
const layers = (network.graph_progress?.layers ?? []).map((layer) => ({
|
|
292
|
+
label: layerDisplayName(layer.layer),
|
|
293
|
+
height: layer.position
|
|
294
|
+
}));
|
|
295
|
+
const evidence = lanes.filter((lane) => lane.lane === EVIDENCE_LANE).map((lane) => ({
|
|
296
|
+
label: laneDisplayName(lane.lane),
|
|
297
|
+
height: lane.height
|
|
298
|
+
}));
|
|
299
|
+
const tables = [
|
|
300
|
+
{
|
|
301
|
+
title: "Indexing",
|
|
302
|
+
rows: indexing.length > 0 ? progressRows(indexing, head) : [notReportedRow("indexing")]
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
title: "Graph",
|
|
306
|
+
rows: layers.length > 0 ? progressRows(layers, head) : [notReportedRow("graph")]
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
title: "Evidence",
|
|
310
|
+
rows: evidence.length > 0 ? progressRows(evidence, head) : [notReportedRow("evidence")]
|
|
311
|
+
}
|
|
312
|
+
];
|
|
313
|
+
return [
|
|
314
|
+
...detail.map(([label, value]) => `${label.padEnd(DETAIL_LABEL_WIDTH)}${value}`),
|
|
315
|
+
"",
|
|
316
|
+
...formatProgressTables(tables, head !== void 0)
|
|
317
|
+
].join("\n");
|
|
198
318
|
}
|
|
199
319
|
//#endregion
|
|
200
320
|
Object.defineProperty(exports, "capabilities_exports", {
|
|
@@ -7,6 +7,9 @@ var capabilities_exports = /* @__PURE__ */ __exportAll({
|
|
|
7
7
|
formatNetworkCapabilities: () => formatNetworkCapabilities,
|
|
8
8
|
formatNetworkCapability: () => formatNetworkCapability,
|
|
9
9
|
formatNetworkOverview: () => formatNetworkOverview,
|
|
10
|
+
groupThousands: () => groupThousands,
|
|
11
|
+
laneDisplayName: () => laneDisplayName,
|
|
12
|
+
layerDisplayName: () => layerDisplayName,
|
|
10
13
|
mirrorGraphNetworkCapabilities: () => mirrorGraphNetworkCapabilities
|
|
11
14
|
});
|
|
12
15
|
const AVAILABLE_TOOLS_PER_LINE = 3;
|
|
@@ -185,18 +188,135 @@ function findNetworkCapability(document, name) {
|
|
|
185
188
|
if (!normalizedName) return void 0;
|
|
186
189
|
return document.networks.find((network) => [network.network, network.display_name].some((candidate) => candidate?.trim().toLowerCase() === normalizedName));
|
|
187
190
|
}
|
|
191
|
+
/** The writer lanes a customer sees, in screen order, by their plain names. */
|
|
192
|
+
const KNOWN_LANES = [
|
|
193
|
+
["core_transfers_source_head", "receipts"],
|
|
194
|
+
["core_transfers_internal_follow", "traces"],
|
|
195
|
+
["core_dex_follow", "dex"],
|
|
196
|
+
["core_bridge_follow", "bridge"],
|
|
197
|
+
["core_smart_account_follow", "smart accounts"]
|
|
198
|
+
];
|
|
199
|
+
/** The evidence worker's lane. It has its own table and never joins Indexing. */
|
|
200
|
+
const EVIDENCE_LANE = "evidence_sync";
|
|
201
|
+
/** The plain name a lane prints as. An unknown lane prints as sent. */
|
|
202
|
+
function laneDisplayName(lane) {
|
|
203
|
+
if (lane === EVIDENCE_LANE) return "evidence";
|
|
204
|
+
return KNOWN_LANES.find(([name]) => name === lane)?.[1] ?? lane;
|
|
205
|
+
}
|
|
206
|
+
/** A graph layer prints as sent: it is the link kind a query names. */
|
|
207
|
+
function layerDisplayName(layer) {
|
|
208
|
+
return layer;
|
|
209
|
+
}
|
|
210
|
+
/** 87642448 -> "87,642,448", the same on every machine (no locale). */
|
|
211
|
+
function groupThousands(value) {
|
|
212
|
+
return (value < 0 ? "-" : "") + String(Math.trunc(Math.abs(value))).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
213
|
+
}
|
|
214
|
+
const DETAIL_LABEL_WIDTH = 18;
|
|
215
|
+
const TABLE_LABEL_WIDTH = 30;
|
|
216
|
+
const HEIGHT_MIN_WIDTH = 10;
|
|
217
|
+
const LAG_HEADER = "behind head";
|
|
218
|
+
const SLOWEST_MARK = "◀ slowest";
|
|
219
|
+
function progressRows(entries, head) {
|
|
220
|
+
const heights = entries.map((entry) => entry.height).filter((height) => height !== null);
|
|
221
|
+
const lowest = heights.length > 0 ? Math.min(...heights) : void 0;
|
|
222
|
+
const marks = lowest !== void 0 && heights.some((height) => height > lowest);
|
|
223
|
+
return entries.map(({ label, height }) => ({
|
|
224
|
+
label,
|
|
225
|
+
height,
|
|
226
|
+
...height === null ? { note: "not started" } : {},
|
|
227
|
+
...height !== null && head !== void 0 ? { behind: Math.max(0, head - height) } : {},
|
|
228
|
+
slowest: marks && height === lowest
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
231
|
+
function notReportedRow(label) {
|
|
232
|
+
return {
|
|
233
|
+
label,
|
|
234
|
+
height: null,
|
|
235
|
+
note: "not reported",
|
|
236
|
+
slowest: false
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function formatProgressTables(tables, withLag) {
|
|
240
|
+
const allRows = tables.flatMap((table) => table.rows);
|
|
241
|
+
const labelWidth = Math.max(TABLE_LABEL_WIDTH, ...allRows.map((row) => row.label.length + 4), ...tables.map((table) => table.title.length + 2));
|
|
242
|
+
const heightWidth = Math.max(HEIGHT_MIN_WIDTH, ...allRows.map((row) => row.height === null ? 0 : groupThousands(row.height).length));
|
|
243
|
+
const lagWidth = Math.max(11, ...allRows.map((row) => row.behind === void 0 ? 0 : groupThousands(row.behind).length));
|
|
244
|
+
const lines = [];
|
|
245
|
+
for (const table of tables) {
|
|
246
|
+
if (lines.length > 0) lines.push("");
|
|
247
|
+
const header = table.title.padEnd(labelWidth) + "height";
|
|
248
|
+
lines.push(withLag ? header.padEnd(labelWidth + heightWidth + 2) + LAG_HEADER : header);
|
|
249
|
+
for (const row of table.rows) {
|
|
250
|
+
let line = ` ${row.label}`.padEnd(labelWidth);
|
|
251
|
+
if (row.height === null) line += row.note ?? "";
|
|
252
|
+
else {
|
|
253
|
+
line += groupThousands(row.height).padEnd(heightWidth);
|
|
254
|
+
if (withLag && row.behind !== void 0) line += " " + groupThousands(row.behind).padStart(lagWidth);
|
|
255
|
+
if (row.slowest) line += ` ${SLOWEST_MARK}`;
|
|
256
|
+
}
|
|
257
|
+
lines.push(line.trimEnd());
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return lines;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* `cia network <name>`: how far this network is indexed. The chain node's head
|
|
264
|
+
* comes first; every row reads against it. Known lanes print by plain name,
|
|
265
|
+
* unknown lanes as sent after them, graph layers as sent, and evidence in its
|
|
266
|
+
* own table. `--json` never comes through here.
|
|
267
|
+
*/
|
|
188
268
|
function formatNetworkCapability(network) {
|
|
189
|
-
const
|
|
190
|
-
|
|
269
|
+
const headBlock = network.freshness?.chain_head_block;
|
|
270
|
+
const head = typeof headBlock === "number" ? headBlock : void 0;
|
|
271
|
+
const detail = [
|
|
272
|
+
["Network", displayName(network)],
|
|
191
273
|
["Identifier", network.network],
|
|
192
|
-
["Status", network
|
|
193
|
-
["Dataset", datasetLabel(network)],
|
|
194
|
-
["Available tools", availableTools(network).join(", ") || "none"]
|
|
274
|
+
["Status", statusLabel(network)]
|
|
195
275
|
];
|
|
196
|
-
|
|
197
|
-
|
|
276
|
+
if (head !== void 0) {
|
|
277
|
+
const age = network.freshness?.chain_head_age_seconds;
|
|
278
|
+
const ageText = typeof age === "number" ? ` (${groupThousands(age)} s old)` : "";
|
|
279
|
+
detail.push(["Blockchain head", `${groupThousands(head)}${ageText}`]);
|
|
280
|
+
}
|
|
281
|
+
const lanes = network.lane_progress ?? [];
|
|
282
|
+
const known = KNOWN_LANES.flatMap(([name, label]) => lanes.filter((lane) => lane.lane === name).map((lane) => ({
|
|
283
|
+
label,
|
|
284
|
+
height: lane.height
|
|
285
|
+
})));
|
|
286
|
+
const unknown = lanes.filter((lane) => lane.lane !== EVIDENCE_LANE && !KNOWN_LANES.some(([name]) => name === lane.lane)).map((lane) => ({
|
|
287
|
+
label: laneDisplayName(lane.lane),
|
|
288
|
+
height: lane.height
|
|
289
|
+
}));
|
|
290
|
+
const indexing = [...known, ...unknown];
|
|
291
|
+
const layers = (network.graph_progress?.layers ?? []).map((layer) => ({
|
|
292
|
+
label: layerDisplayName(layer.layer),
|
|
293
|
+
height: layer.position
|
|
294
|
+
}));
|
|
295
|
+
const evidence = lanes.filter((lane) => lane.lane === EVIDENCE_LANE).map((lane) => ({
|
|
296
|
+
label: laneDisplayName(lane.lane),
|
|
297
|
+
height: lane.height
|
|
298
|
+
}));
|
|
299
|
+
const tables = [
|
|
300
|
+
{
|
|
301
|
+
title: "Indexing",
|
|
302
|
+
rows: indexing.length > 0 ? progressRows(indexing, head) : [notReportedRow("indexing")]
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
title: "Graph",
|
|
306
|
+
rows: layers.length > 0 ? progressRows(layers, head) : [notReportedRow("graph")]
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
title: "Evidence",
|
|
310
|
+
rows: evidence.length > 0 ? progressRows(evidence, head) : [notReportedRow("evidence")]
|
|
311
|
+
}
|
|
312
|
+
];
|
|
313
|
+
return [
|
|
314
|
+
...detail.map(([label, value]) => `${label.padEnd(DETAIL_LABEL_WIDTH)}${value}`),
|
|
315
|
+
"",
|
|
316
|
+
...formatProgressTables(tables, head !== void 0)
|
|
317
|
+
].join("\n");
|
|
198
318
|
}
|
|
199
319
|
//#endregion
|
|
200
320
|
export { findNetworkCapability as n, mirrorGraphNetworkCapabilities as r, capabilities_exports as t };
|
|
201
321
|
|
|
202
|
-
//# sourceMappingURL=capabilities-
|
|
322
|
+
//# sourceMappingURL=capabilities-SIyEvaPw.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities-SIyEvaPw.mjs","names":[],"sources":["../src/mcp/capabilities.ts"],"sourcesContent":["import type { InvestigatorConfig } from '../config/schema.js'\nimport { applyMcpAuthHeaders, resolveGraphMcpEndpoint } from './client.js'\n\nexport interface NetworkTopologyLayer {\n enabled: boolean\n coverage?: {\n from_block?: number\n to_block?: number\n from_timestamp?: string\n to_timestamp?: string\n chain_tip_block?: number\n blocks_behind_tip?: number\n /** Lowest height among the raw-data lanes that have started. Above it an empty answer may mean \"not indexed yet\". */\n complete_through_block?: number\n }\n}\n\nexport interface NetworkLayerCapability {\n enabled: boolean\n live?: NetworkTopologyLayer\n archive?: NetworkTopologyLayer\n /** The relationships a facts layer serves, when the server lists them. */\n relationships?: string[]\n}\n\n/**\n * A block the server publishes about one layer's limits. The mirror repeats it\n * exactly as it came: the members named below are the ones known today, and\n * any other member the server adds is kept. Read a limit from the block, never\n * from a number written elsewhere.\n */\nexport type NetworkAdmissionBlock = Record<string, unknown>\n\n/** `USE chain`: the lookups, the ceilings and the slots of the chain layer. */\nexport interface ChainAdmission extends NetworkAdmissionBlock {\n enabled: boolean\n /** ok, or the reason the layer is off or behind. */\n status?: string\n rules_version?: string\n grammar?: string\n /** The labels of `USE chain`, such as Transaction, Block, Head and Address. */\n lookups?: string[]\n ceiling_seconds?: Record<string, number>\n slots?: number\n past_slots?: number\n slots_per_caller?: number\n calls_per_second_per_caller?: number\n batch_max?: number\n call_gas?: number\n head_ttl_ms?: number\n max_head_age_seconds?: number\n /** How many blocks below the tip a past `Address` read (`at_block`) must be. Read it here, never write it down. */\n at_block_min_depth?: number\n}\n\n/** `USE topology`: the shape rules, when the server publishes them. */\nexport interface TopologyAdmission extends NetworkAdmissionBlock {\n rules_version?: string\n max_hops_per_path?: number\n max_limit?: number\n slots?: number\n}\n\n/** `USE facts`: the read contract, when the server publishes it. */\nexport interface FactsAdmission extends NetworkAdmissionBlock {\n rules_version?: string\n window_days?: number\n max_rows?: number\n max_hops?: number\n}\n\nexport interface NetworkCapability {\n network: string\n display_name?: string\n status: string\n default?: boolean\n /** The layers as the server sent them. Absent when the server sent none. */\n layers?: Record<string, NetworkLayerCapability>\n tools: Record<string, string>\n /** The three layer blocks below are repeated exactly as sent, and absent when not sent. */\n chain_admission?: ChainAdmission\n topology_admission?: TopologyAdmission\n facts_admission?: FactsAdmission\n coverage?: {\n from_block?: number\n to_block?: number\n from_timestamp?: string\n to_timestamp?: string\n chain_tip_block?: number\n blocks_behind_tip?: number\n /** Lowest height among the raw-data lanes that have started. Above it an empty answer may mean \"not indexed yet\". */\n complete_through_block?: number\n }\n freshness?: {\n last_processed_at?: string\n last_successful_sync_at?: string\n max_data_age_seconds?: number\n last_processing_duration_seconds?: number\n /** The chain node's own head block, and how old that reading is. */\n chain_head_block?: number\n chain_head_age_seconds?: number\n warehouse_blocks_behind_head?: number\n graph_blocks_behind_head?: number\n }\n lane_progress?: NetworkLaneProgress[]\n graph_progress?: NetworkGraphProgress\n}\n\n/** One writer lane's committed height. null: the lane has not started. */\nexport interface NetworkLaneProgress {\n lane: string\n height: number | null\n}\n\n/** How far each block layer of the topology graph reaches, and their lowest. */\nexport interface NetworkGraphProgress {\n complete_through_block: number\n layers: { layer: string; position: number }[]\n}\n\nexport interface NetworkCapabilitiesDocument {\n schema: 'chain-insights.network-capabilities.v1'\n networks: NetworkCapability[]\n}\n\nconst AVAILABLE_TOOLS_PER_LINE = 3\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction advertisedTools(raw: unknown): Record<string, string> {\n if (!isRecord(raw)) return {}\n const tools: Record<string, string> = {}\n for (const [name, status] of Object.entries(raw)) {\n if (name.trim() !== '' && typeof status === 'string') tools[name] = status\n }\n return tools\n}\n\nfunction advertisedLaneProgress(raw: unknown): NetworkLaneProgress[] | undefined {\n if (!Array.isArray(raw)) return undefined\n const lanes: NetworkLaneProgress[] = []\n for (const entry of raw) {\n if (!isRecord(entry) || typeof entry.lane !== 'string' || entry.lane.trim() === '') continue\n if (typeof entry.height === 'number') lanes.push({ lane: entry.lane, height: entry.height })\n else if (entry.height === null) lanes.push({ lane: entry.lane, height: null })\n }\n return lanes\n}\n\nfunction advertisedGraphProgress(raw: unknown): NetworkGraphProgress | undefined {\n if (!isRecord(raw) || typeof raw.complete_through_block !== 'number') return undefined\n if (!Array.isArray(raw.layers)) return undefined\n const layers: NetworkGraphProgress['layers'] = []\n for (const entry of raw.layers) {\n if (!isRecord(entry) || typeof entry.layer !== 'string' || typeof entry.position !== 'number')\n continue\n layers.push({ layer: entry.layer, position: entry.position })\n }\n return { complete_through_block: raw.complete_through_block, layers }\n}\n\nfunction advertisedNetwork(raw: unknown): NetworkCapability | null {\n if (!isRecord(raw) || typeof raw.network !== 'string' || raw.network.trim() === '') {\n return null\n }\n const network = raw.network.trim()\n const capability: NetworkCapability = {\n network,\n display_name:\n typeof raw.display_name === 'string' && raw.display_name.trim() !== ''\n ? raw.display_name\n : network,\n status: typeof raw.status === 'string' && raw.status.trim() !== '' ? raw.status : 'live',\n tools: advertisedTools(raw.tools),\n }\n // The layer blocks are the server's own words about its limits. They pass\n // through exactly as sent: nothing is added, no default is invented and no\n // member is dropped. A block the server did not send stays absent.\n if (isRecord(raw.layers)) capability.layers = raw.layers as NetworkCapability['layers']\n if (isRecord(raw.chain_admission)) {\n capability.chain_admission = raw.chain_admission as unknown as ChainAdmission\n }\n if (isRecord(raw.topology_admission)) {\n capability.topology_admission = raw.topology_admission as TopologyAdmission\n }\n if (isRecord(raw.facts_admission)) {\n capability.facts_admission = raw.facts_admission as FactsAdmission\n }\n if (raw.default === true) capability.default = true\n if (raw.default === false) capability.default = false\n if (isRecord(raw.coverage)) capability.coverage = raw.coverage as NetworkCapability['coverage']\n if (isRecord(raw.freshness))\n capability.freshness = raw.freshness as NetworkCapability['freshness']\n const laneProgress = advertisedLaneProgress(raw.lane_progress)\n if (laneProgress) capability.lane_progress = laneProgress\n const graphProgress = advertisedGraphProgress(raw.graph_progress)\n if (graphProgress) capability.graph_progress = graphProgress\n return capability\n}\n\n/** Repeat GraphRAG's network list. CIA does not add, drop, or invent names. */\nexport function mirrorGraphNetworkCapabilities(document: {\n networks: unknown[]\n}): NetworkCapabilitiesDocument {\n return {\n schema: 'chain-insights.network-capabilities.v1',\n networks: document.networks\n .map((network) => advertisedNetwork(network))\n .filter((network): network is NetworkCapability => network !== null),\n }\n}\n\nfunction publicNetworkCapabilities(\n document: NetworkCapabilitiesDocument\n): NetworkCapabilitiesDocument {\n return mirrorGraphNetworkCapabilities(document)\n}\n\nfunction metadataNetworksUrl(endpoint: string): URL {\n const url = new URL(endpoint)\n url.pathname = '/metadata/networks'\n url.search = ''\n url.hash = ''\n return url\n}\n\nexport async function fetchNetworkCapabilities(\n config: Pick<InvestigatorConfig, 'graphMcpAuthToken' | 'graphMcpMode' | 'graphMcpEndpoint'>\n): Promise<NetworkCapabilitiesDocument> {\n const endpoint = resolveGraphMcpEndpoint(config)\n const request = metadataNetworksUrl(endpoint)\n const headers = new Headers()\n const token = config.graphMcpAuthToken?.trim()\n if (token) {\n applyMcpAuthHeaders(headers, token)\n }\n let response: Response\n try {\n response = await fetch(request, { headers })\n } catch (err) {\n throw new Error(`network capabilities unavailable at ${request}: ${(err as Error).message}`)\n }\n if (!response.ok) {\n throw new Error(`network capabilities unavailable at ${request}: HTTP ${response.status}`)\n }\n const parsed = (await response.json()) as NetworkCapabilitiesDocument\n if (\n parsed.schema !== 'chain-insights.network-capabilities.v1' ||\n !Array.isArray(parsed.networks)\n ) {\n throw new Error('network capabilities response has unsupported schema')\n }\n return publicNetworkCapabilities(parsed)\n}\n\nfunction availableTools(network: NetworkCapability): string[] {\n const tools = Object.entries(network.tools ?? {})\n .filter(([, status]) => status === 'available')\n .map(([name]) => name)\n return tools.sort()\n}\n\nfunction availableToolLines(network: NetworkCapability): string[] {\n const tools = availableTools(network)\n if (tools.length === 0) return ['none']\n const lines: string[] = []\n for (let index = 0; index < tools.length; index += AVAILABLE_TOOLS_PER_LINE) {\n lines.push(tools.slice(index, index + AVAILABLE_TOOLS_PER_LINE).join(', '))\n }\n return lines\n}\n\nfunction shortDate(value?: string): string {\n if (!value) return ''\n return value.slice(0, 10)\n}\n\nfunction datasetLabel(network: NetworkCapability): string {\n const coverage = network.coverage\n if (!coverage) return 'unknown'\n const blockRange =\n coverage.from_block !== undefined && coverage.to_block !== undefined\n ? `${coverage.from_block}..${coverage.to_block}`\n : 'blocks unknown'\n const dateRange =\n coverage.from_timestamp && coverage.to_timestamp\n ? `${shortDate(coverage.from_timestamp)}..${shortDate(coverage.to_timestamp)}`\n : ''\n if (blockRange === 'blocks unknown' && dateRange === '') return 'unknown'\n if (blockRange === 'blocks unknown') return dateRange\n if (dateRange === '') return blockRange\n return `${blockRange} / ${dateRange}`\n}\n\nfunction displayName(network: NetworkCapability): string {\n return network.display_name || network.network\n}\n\nfunction statusLabel(network: NetworkCapability): string {\n return network.default ? `${network.status} (default)` : network.status\n}\n\nfunction formatTable(headers: string[], rows: string[][], minimumWidths: number[]): string {\n const widths = headers.map((header, index) =>\n Math.max(\n minimumWidths[index] ?? 0,\n header.length,\n ...rows.map((row) => row[index]?.length ?? 0)\n )\n )\n const row = (values: string[]) =>\n values.map((value, index) => value.padEnd(widths[index]!)).join(' ')\n return [row(headers), widths.map((width) => '-'.repeat(width)).join(' '), ...rows.map(row)].join(\n '\\n'\n )\n}\n\nexport function formatNetworkOverview(document: NetworkCapabilitiesDocument): string {\n if (document.networks.length === 0) return 'No supported networks advertised.'\n const rows = document.networks.map((network) => [\n displayName(network),\n statusLabel(network),\n datasetLabel(network),\n ])\n return formatTable(['Network', 'Status', 'Dataset'], rows, [14, 10, 38])\n}\n\nexport function formatNetworkCapabilities(document: NetworkCapabilitiesDocument): string {\n if (document.networks.length === 0) return 'No supported networks advertised.'\n const networkRows = document.networks.flatMap((network) => {\n const toolLines = availableToolLines(network)\n return toolLines.map((toolLine, index) => [\n index === 0 ? displayName(network) : '',\n index === 0 ? datasetLabel(network) : '',\n toolLine,\n ])\n })\n return formatTable(['Network', 'Dataset', 'Chain Insights tools'], networkRows, [14, 38, 64])\n}\n\nexport function findNetworkCapability(\n document: NetworkCapabilitiesDocument,\n name: string\n): NetworkCapability | undefined {\n const normalizedName = name.trim().toLowerCase()\n if (!normalizedName) return undefined\n return document.networks.find((network) =>\n [network.network, network.display_name].some(\n (candidate) => candidate?.trim().toLowerCase() === normalizedName\n )\n )\n}\n\n/** The writer lanes a customer sees, in screen order, by their plain names. */\nconst KNOWN_LANES: readonly (readonly [string, string])[] = [\n ['core_transfers_source_head', 'receipts'],\n ['core_transfers_internal_follow', 'traces'],\n ['core_dex_follow', 'dex'],\n ['core_bridge_follow', 'bridge'],\n ['core_smart_account_follow', 'smart accounts'],\n]\n\n/** The evidence worker's lane. It has its own table and never joins Indexing. */\nconst EVIDENCE_LANE = 'evidence_sync'\n\n/** The plain name a lane prints as. An unknown lane prints as sent. */\nexport function laneDisplayName(lane: string): string {\n if (lane === EVIDENCE_LANE) return 'evidence'\n return KNOWN_LANES.find(([name]) => name === lane)?.[1] ?? lane\n}\n\n/** A graph layer prints as sent: it is the link kind a query names. */\nexport function layerDisplayName(layer: string): string {\n return layer\n}\n\n/** 87642448 -> \"87,642,448\", the same on every machine (no locale). */\nexport function groupThousands(value: number): string {\n const sign = value < 0 ? '-' : ''\n const digits = String(Math.trunc(Math.abs(value)))\n return sign + digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')\n}\n\n/** One row of a progress table. `behind` is absent with no head or no height. */\ninterface ProgressRow {\n label: string\n height: number | null\n /** Text printed in the height column instead of a number. */\n note?: string\n behind?: number\n slowest: boolean\n}\n\nconst DETAIL_LABEL_WIDTH = 18\nconst TABLE_LABEL_WIDTH = 30\nconst HEIGHT_MIN_WIDTH = 10\nconst LAG_HEADER = 'behind head'\nconst SLOWEST_MARK = '◀ slowest'\n\nfunction progressRows(\n entries: { label: string; height: number | null }[],\n head: number | undefined\n): ProgressRow[] {\n const heights = entries\n .map((entry) => entry.height)\n .filter((height): height is number => height !== null)\n const lowest = heights.length > 0 ? Math.min(...heights) : undefined\n // A mark needs something faster beside it: one row, or rows all level, have no slowest.\n const marks = lowest !== undefined && heights.some((height) => height > lowest)\n return entries.map(({ label, height }) => ({\n label,\n height,\n ...(height === null ? { note: 'not started' } : {}),\n ...(height !== null && head !== undefined ? { behind: Math.max(0, head - height) } : {}),\n slowest: marks && height === lowest,\n }))\n}\n\nfunction notReportedRow(label: string): ProgressRow {\n return { label, height: null, note: 'not reported', slowest: false }\n}\n\nfunction formatProgressTables(\n tables: { title: string; rows: ProgressRow[] }[],\n withLag: boolean\n): string[] {\n const allRows = tables.flatMap((table) => table.rows)\n const labelWidth = Math.max(\n TABLE_LABEL_WIDTH,\n ...allRows.map((row) => row.label.length + 4),\n ...tables.map((table) => table.title.length + 2)\n )\n const heightWidth = Math.max(\n HEIGHT_MIN_WIDTH,\n ...allRows.map((row) => (row.height === null ? 0 : groupThousands(row.height).length))\n )\n const lagWidth = Math.max(\n LAG_HEADER.length,\n ...allRows.map((row) => (row.behind === undefined ? 0 : groupThousands(row.behind).length))\n )\n const lines: string[] = []\n for (const table of tables) {\n if (lines.length > 0) lines.push('')\n const header = table.title.padEnd(labelWidth) + 'height'\n lines.push(withLag ? header.padEnd(labelWidth + heightWidth + 2) + LAG_HEADER : header)\n for (const row of table.rows) {\n let line = ` ${row.label}`.padEnd(labelWidth)\n if (row.height === null) {\n line += row.note ?? ''\n } else {\n line += groupThousands(row.height).padEnd(heightWidth)\n if (withLag && row.behind !== undefined) {\n line += ' ' + groupThousands(row.behind).padStart(lagWidth)\n }\n if (row.slowest) line += ` ${SLOWEST_MARK}`\n }\n lines.push(line.trimEnd())\n }\n }\n return lines\n}\n\n/**\n * `cia network <name>`: how far this network is indexed. The chain node's head\n * comes first; every row reads against it. Known lanes print by plain name,\n * unknown lanes as sent after them, graph layers as sent, and evidence in its\n * own table. `--json` never comes through here.\n */\nexport function formatNetworkCapability(network: NetworkCapability): string {\n const headBlock = network.freshness?.chain_head_block\n const head = typeof headBlock === 'number' ? headBlock : undefined\n const detail: [string, string][] = [\n ['Network', displayName(network)],\n ['Identifier', network.network],\n ['Status', statusLabel(network)],\n ]\n if (head !== undefined) {\n const age = network.freshness?.chain_head_age_seconds\n const ageText = typeof age === 'number' ? ` (${groupThousands(age)} s old)` : ''\n detail.push(['Blockchain head', `${groupThousands(head)}${ageText}`])\n }\n\n const lanes = network.lane_progress ?? []\n const known = KNOWN_LANES.flatMap(([name, label]) =>\n lanes.filter((lane) => lane.lane === name).map((lane) => ({ label, height: lane.height }))\n )\n const unknown = lanes\n .filter(\n (lane) => lane.lane !== EVIDENCE_LANE && !KNOWN_LANES.some(([name]) => name === lane.lane)\n )\n .map((lane) => ({ label: laneDisplayName(lane.lane), height: lane.height }))\n const indexing = [...known, ...unknown]\n const layers = (network.graph_progress?.layers ?? []).map((layer) => ({\n label: layerDisplayName(layer.layer),\n height: layer.position,\n }))\n const evidence = lanes\n .filter((lane) => lane.lane === EVIDENCE_LANE)\n .map((lane) => ({ label: laneDisplayName(lane.lane), height: lane.height }))\n\n const tables = [\n {\n title: 'Indexing',\n rows: indexing.length > 0 ? progressRows(indexing, head) : [notReportedRow('indexing')],\n },\n {\n title: 'Graph',\n rows: layers.length > 0 ? progressRows(layers, head) : [notReportedRow('graph')],\n },\n {\n title: 'Evidence',\n rows: evidence.length > 0 ? progressRows(evidence, head) : [notReportedRow('evidence')],\n },\n ]\n\n return [\n ...detail.map(([label, value]) => `${label.padEnd(DETAIL_LABEL_WIDTH)}${value}`),\n '',\n ...formatProgressTables(tables, head !== undefined),\n ].join('\\n')\n}\n"],"mappings":";;;;;;;;;;;;;;AA6HA,MAAM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3F;CACA,MAAM,UAAU,MACb,QACE,SAAS,KAAK,SAAS,iBAAiB,CAAC,YAAY,MAAM,CAAC,UAAU,SAAS,KAAK,IAAI,CAC3F,CAAC,CACA,KAAK,UAAU;EAAE,OAAO,gBAAgB,KAAK,IAAI;EAAG,QAAQ,KAAK;CAAO,EAAE;CAC7E,MAAM,WAAW,CAAC,GAAG,OAAO,GAAG,OAAO;CACtC,MAAM,UAAU,QAAQ,gBAAgB,UAAU,CAAC,EAAA,CAAG,KAAK,WAAW;EACpE,OAAO,iBAAiB,MAAM,KAAK;EACnC,QAAQ,MAAM;CAChB,EAAE;CACF,MAAM,WAAW,MACd,QAAQ,SAAS,KAAK,SAAS,aAAa,CAAC,CAC7C,KAAK,UAAU;EAAE,OAAO,gBAAgB,KAAK,IAAI;EAAG,QAAQ,KAAK;CAAO,EAAE;CAE7E,MAAM,SAAS;EACb;GACE,OAAO;GACP,MAAM,SAAS,SAAS,IAAI,aAAa,UAAU,IAAI,IAAI,CAAC,eAAe,UAAU,CAAC;EACxF;EACA;GACE,OAAO;GACP,MAAM,OAAO,SAAS,IAAI,aAAa,QAAQ,IAAI,IAAI,CAAC,eAAe,OAAO,CAAC;EACjF;EACA;GACE,OAAO;GACP,MAAM,SAAS,SAAS,IAAI,aAAa,UAAU,IAAI,IAAI,CAAC,eAAe,UAAU,CAAC;EACxF;CACF;CAEA,OAAO;EACL,GAAG,OAAO,KAAK,CAAC,OAAO,WAAW,GAAG,MAAM,OAAO,kBAAkB,IAAI,OAAO;EAC/E;EACA,GAAG,qBAAqB,QAAQ,SAAS,KAAA,CAAS;CACpD,CAAC,CAAC,KAAK,IAAI;AACb"}
|
package/dist/cli.cjs
CHANGED
|
@@ -120,21 +120,21 @@ async function withGraphMcpClient(name, fn) {
|
|
|
120
120
|
}
|
|
121
121
|
async function printNetworkCapabilities(opts) {
|
|
122
122
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-BxtMoo9c.cjs")).then((n) => n.config_exports);
|
|
123
|
-
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await Promise.resolve().then(() => require("./capabilities-
|
|
123
|
+
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await Promise.resolve().then(() => require("./capabilities-54Vh1A8B.cjs")).then((n) => n.capabilities_exports);
|
|
124
124
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
125
125
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
126
126
|
else console.log(formatNetworkCapabilities(document));
|
|
127
127
|
}
|
|
128
128
|
async function printNetworkOverview(opts) {
|
|
129
129
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-BxtMoo9c.cjs")).then((n) => n.config_exports);
|
|
130
|
-
const { fetchNetworkCapabilities, formatNetworkOverview } = await Promise.resolve().then(() => require("./capabilities-
|
|
130
|
+
const { fetchNetworkCapabilities, formatNetworkOverview } = await Promise.resolve().then(() => require("./capabilities-54Vh1A8B.cjs")).then((n) => n.capabilities_exports);
|
|
131
131
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
132
132
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
133
133
|
else console.log(formatNetworkOverview(document));
|
|
134
134
|
}
|
|
135
135
|
async function printNetworkCapability(name, opts) {
|
|
136
136
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-BxtMoo9c.cjs")).then((n) => n.config_exports);
|
|
137
|
-
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await Promise.resolve().then(() => require("./capabilities-
|
|
137
|
+
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await Promise.resolve().then(() => require("./capabilities-54Vh1A8B.cjs")).then((n) => n.capabilities_exports);
|
|
138
138
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
139
139
|
const network = findNetworkCapability(document, name);
|
|
140
140
|
if (!network) {
|
|
@@ -152,7 +152,7 @@ async function printNetworkCapability(name, opts) {
|
|
|
152
152
|
async function printNetworkSchema(name, opts) {
|
|
153
153
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-BxtMoo9c.cjs")).then((n) => n.config_exports);
|
|
154
154
|
const { resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-Ypw9BNbn.cjs")).then((n) => n.client_exports);
|
|
155
|
-
const { formatGraphSchemaText, getGraphSchema } = await Promise.resolve().then(() => require("./graph-schema-
|
|
155
|
+
const { formatGraphSchemaText, getGraphSchema } = await Promise.resolve().then(() => require("./graph-schema-2wUG2Vaz.cjs")).then((n) => n.graph_schema_exports);
|
|
156
156
|
const config = await loadConfig();
|
|
157
157
|
const schema = await getGraphSchema({
|
|
158
158
|
network: name,
|
package/dist/cli.mjs
CHANGED
|
@@ -118,21 +118,21 @@ async function withGraphMcpClient(name, fn) {
|
|
|
118
118
|
}
|
|
119
119
|
async function printNetworkCapabilities(opts) {
|
|
120
120
|
const { loadConfig } = await import("./config-9MabJh5R.mjs").then((n) => n.t);
|
|
121
|
-
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-
|
|
121
|
+
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-SIyEvaPw.mjs").then((n) => n.t);
|
|
122
122
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
123
123
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
124
124
|
else console.log(formatNetworkCapabilities(document));
|
|
125
125
|
}
|
|
126
126
|
async function printNetworkOverview(opts) {
|
|
127
127
|
const { loadConfig } = await import("./config-9MabJh5R.mjs").then((n) => n.t);
|
|
128
|
-
const { fetchNetworkCapabilities, formatNetworkOverview } = await import("./capabilities-
|
|
128
|
+
const { fetchNetworkCapabilities, formatNetworkOverview } = await import("./capabilities-SIyEvaPw.mjs").then((n) => n.t);
|
|
129
129
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
130
130
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
131
131
|
else console.log(formatNetworkOverview(document));
|
|
132
132
|
}
|
|
133
133
|
async function printNetworkCapability(name, opts) {
|
|
134
134
|
const { loadConfig } = await import("./config-9MabJh5R.mjs").then((n) => n.t);
|
|
135
|
-
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await import("./capabilities-
|
|
135
|
+
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await import("./capabilities-SIyEvaPw.mjs").then((n) => n.t);
|
|
136
136
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
137
137
|
const network = findNetworkCapability(document, name);
|
|
138
138
|
if (!network) {
|
|
@@ -150,7 +150,7 @@ async function printNetworkCapability(name, opts) {
|
|
|
150
150
|
async function printNetworkSchema(name, opts) {
|
|
151
151
|
const { loadConfig } = await import("./config-9MabJh5R.mjs").then((n) => n.t);
|
|
152
152
|
const { resolveGraphMcpEndpoint } = await import("./client-gsLi528K.mjs").then((n) => n.r);
|
|
153
|
-
const { formatGraphSchemaText, getGraphSchema } = await import("./graph-schema-
|
|
153
|
+
const { formatGraphSchemaText, getGraphSchema } = await import("./graph-schema-CHfXmmDK.mjs").then((n) => n.i);
|
|
154
154
|
const config = await loadConfig();
|
|
155
155
|
const schema = await getGraphSchema({
|
|
156
156
|
network: name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
2
|
const require_client = require("./client-Ypw9BNbn.cjs");
|
|
3
|
-
const require_capabilities = require("./capabilities-
|
|
3
|
+
const require_capabilities = require("./capabilities-54Vh1A8B.cjs");
|
|
4
4
|
const require_cache_location = require("./cache-location-CBVzUIxq.cjs");
|
|
5
5
|
let node_path = require("node:path");
|
|
6
6
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { t as PaymentRequiredError } from "./client-gsLi528K.mjs";
|
|
3
|
-
import { n as findNetworkCapability, r as mirrorGraphNetworkCapabilities } from "./capabilities-
|
|
3
|
+
import { n as findNetworkCapability, r as mirrorGraphNetworkCapabilities } from "./capabilities-SIyEvaPw.mjs";
|
|
4
4
|
import { n as chainInsightsHome, t as CACHE_TTL_MS } from "./cache-location-BO2XkfgI.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
@@ -1177,4 +1177,4 @@ async function handleMetaSchema(args, deps) {
|
|
|
1177
1177
|
//#endregion
|
|
1178
1178
|
export { handleMetaSchema as a, GRAPH_EXPAND_TITLE as c, graph_schema_exports as i, GRAPH_EXPAND_TOOL as l, META_SCHEMA_DESCRIPTION as n, FLOWS_MAX_OFFSET as o, META_SCHEMA_TITLE as r, GRAPH_EXPAND_DESCRIPTION as s, GraphSchemaError as t, handleGraphExpand as u };
|
|
1179
1179
|
|
|
1180
|
-
//# sourceMappingURL=graph-schema-
|
|
1180
|
+
//# sourceMappingURL=graph-schema-CHfXmmDK.mjs.map
|