isoloop 0.1.0-next.5 → 0.1.0-next.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/dist/cli.js +50 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -539,6 +539,10 @@ const DEFAULT_REQUEST_MS = 1e4;
|
|
|
539
539
|
const MAX_REQUEST_MS = 3e4;
|
|
540
540
|
/** ADR 0020, decision 4. */
|
|
541
541
|
const MAX_BLOCK_MS = 1e4;
|
|
542
|
+
/** `isoloop_tap`'s longest sample, like `block`'s cap. */
|
|
543
|
+
const MAX_TAP_MS = 1e4;
|
|
544
|
+
/** `isoloop_tap`'s sample when `ms` isn't given. */
|
|
545
|
+
const DEFAULT_TAP_MS = 3e3;
|
|
542
546
|
const PAGE_ARG$1 = {
|
|
543
547
|
type: "string",
|
|
544
548
|
description: "The page to call, from isoloop_pages. Default: the page that connected last among those that can answer."
|
|
@@ -658,6 +662,51 @@ const BUILTIN_TOOLS = [
|
|
|
658
662
|
},
|
|
659
663
|
timeoutMs: () => READ_MS
|
|
660
664
|
},
|
|
665
|
+
{
|
|
666
|
+
name: "isoloop_tap",
|
|
667
|
+
write: false,
|
|
668
|
+
mcp: {
|
|
669
|
+
name: "isoloop_tap",
|
|
670
|
+
title: "Live records",
|
|
671
|
+
description: `A live sample of the records published to some topics, for ms milliseconds (default ${DEFAULT_TAP_MS}, at most ${MAX_TAP_MS}), stopping early once it has max records (default and at most 100). The sample is capped at 50 records a second: skipped is how many the bus left out over that cap (reported once a second, so the last second can be missing), and ms is how long it listened. Each record has its topic, offset, key, time, producer, request id and via, size in bytes, and the value as a preview of at most 2 KB. ${UNTRUSTED_SENTENCE}`,
|
|
672
|
+
inputSchema: schema({
|
|
673
|
+
topics: {
|
|
674
|
+
type: "array",
|
|
675
|
+
items: { type: "string" },
|
|
676
|
+
minItems: 1,
|
|
677
|
+
description: "The topic names, such as markets.quote.v1."
|
|
678
|
+
},
|
|
679
|
+
ms: {
|
|
680
|
+
type: "integer",
|
|
681
|
+
minimum: 1,
|
|
682
|
+
maximum: MAX_TAP_MS,
|
|
683
|
+
description: `How long to listen, in ms. Default ${DEFAULT_TAP_MS}.`
|
|
684
|
+
},
|
|
685
|
+
max: {
|
|
686
|
+
type: "integer",
|
|
687
|
+
minimum: 1,
|
|
688
|
+
maximum: 100,
|
|
689
|
+
description: `Stop after this many records. Default 100.`
|
|
690
|
+
}
|
|
691
|
+
}, ["topics"]),
|
|
692
|
+
annotations: read
|
|
693
|
+
},
|
|
694
|
+
op: (args) => {
|
|
695
|
+
const t = args["topics"];
|
|
696
|
+
if (!Array.isArray(t) || t.length === 0 || !t.every((x) => typeof x === "string" && x.length > 0)) return "topics must be a non-empty list of topic names";
|
|
697
|
+
const ms = intArg(args, "ms", MAX_TAP_MS, DEFAULT_TAP_MS);
|
|
698
|
+
if (typeof ms === "string") return ms;
|
|
699
|
+
const max = intArg(args, "max", 100, 100);
|
|
700
|
+
if (typeof max === "string") return max;
|
|
701
|
+
return {
|
|
702
|
+
op: "tap",
|
|
703
|
+
topics: t,
|
|
704
|
+
ms,
|
|
705
|
+
max
|
|
706
|
+
};
|
|
707
|
+
},
|
|
708
|
+
timeoutMs: (op) => (op.op === "tap" ? op.ms : 0) + READ_MS
|
|
709
|
+
},
|
|
661
710
|
{
|
|
662
711
|
name: "isoloop_events",
|
|
663
712
|
write: false,
|
|
@@ -945,7 +994,7 @@ var DevMcpServer = class {
|
|
|
945
994
|
title: "Isoloop dev MCP",
|
|
946
995
|
version: this.#o.version
|
|
947
996
|
},
|
|
948
|
-
instructions: "Tools of the Isoloop app pages open in a browser in development. isoloop_pages lists the connected pages; isoloop_isolates, isoloop_topics, isoloop_records and isoloop_events read a page's isolates, bus, records and recent events; the other tools are the tools those pages expose, by topic name. " + (this.#o.allowWrite ? "Tools that change something are available (--allow-write), including isoloop_restart, isoloop_kill, isoloop_block, isoloop_publish and isoloop_request." : "Only read-only tools are available; tools that change something need --allow-write.")
|
|
997
|
+
instructions: "Tools of the Isoloop app pages open in a browser in development. isoloop_pages lists the connected pages; isoloop_isolates, isoloop_topics, isoloop_records, isoloop_tap and isoloop_events read a page's isolates, bus, retained records, a live sample of records and recent events; the other tools are the tools those pages expose, by topic name. " + (this.#o.allowWrite ? "Tools that change something are available (--allow-write), including isoloop_restart, isoloop_kill, isoloop_block, isoloop_publish and isoloop_request." : "Only read-only tools are available; tools that change something need --allow-write.")
|
|
949
998
|
});
|
|
950
999
|
}
|
|
951
1000
|
/** The pages, newest first. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isoloop",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.7",
|
|
4
4
|
"description": "The Isoloop command line: export contracts as JSON Schema, run the dev MCP server, and later add the agent skill.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"node": ">=26"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@isoloop/bus": "0.1.0-next.
|
|
23
|
-
"@isoloop/protocol": "0.1.0-next.
|
|
22
|
+
"@isoloop/bus": "0.1.0-next.7",
|
|
23
|
+
"@isoloop/protocol": "0.1.0-next.7"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@modelcontextprotocol/sdk": "1.32.2",
|