@mcsherrylabs/evolver-mcp 0.9.5 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy/.dockerignore +8 -0
- package/deploy/Dockerfile +3 -3
- package/deploy/config/node-join.sh +32 -74
- package/deploy/config/node.conf +5 -47
- package/deploy/docker-compose.yml +97 -81
- package/deploy/processor/.dockerignore +8 -0
- package/deploy/processor/Dockerfile +14 -0
- package/deploy/processor/entrypoint.mjs +122 -0
- package/deploy/release.json +8 -0
- package/dist/amount.d.ts +3 -0
- package/dist/amount.d.ts.map +1 -1
- package/dist/amount.js +9 -0
- package/dist/amount.js.map +1 -1
- package/dist/bootstrap.d.ts +4 -0
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +44 -5
- package/dist/bootstrap.js.map +1 -1
- package/dist/channel.d.ts +3 -4
- package/dist/channel.d.ts.map +1 -1
- package/dist/channel.js +27 -28
- package/dist/channel.js.map +1 -1
- package/dist/config.d.ts +5 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +44 -11
- package/dist/config.js.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +10 -4
- package/dist/identity.js.map +1 -1
- package/dist/inbox.d.ts +4 -26
- package/dist/inbox.d.ts.map +1 -1
- package/dist/inbox.js +43 -80
- package/dist/inbox.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +37 -2
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +261 -101
- package/dist/install.js.map +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +3 -2
- package/dist/mcp.js.map +1 -1
- package/dist/processor.d.ts +14 -0
- package/dist/processor.d.ts.map +1 -0
- package/dist/processor.js +46 -0
- package/dist/processor.js.map +1 -0
- package/dist/read.d.ts +39 -21
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +37 -28
- package/dist/read.js.map +1 -1
- package/dist/tools.d.ts +3 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +103 -37
- package/dist/tools.js.map +1 -1
- package/dist/write.d.ts +2 -0
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +12 -5
- package/dist/write.js.map +1 -1
- package/package.json +8 -3
package/dist/read.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChannelOwner, ChannelTerms } from "@mcsherrylabs/evolver-client";
|
|
1
|
+
import type { ChannelOwner, ChannelTerms, TransactionObservation } from "@mcsherrylabs/evolver-client";
|
|
2
2
|
import type { ToolResult } from "./result.js";
|
|
3
3
|
/** One row of the chain's recent-transaction feed, as the client returns it. */
|
|
4
4
|
export interface FeedTx {
|
|
@@ -48,11 +48,35 @@ export interface ChainReads {
|
|
|
48
48
|
memberCount: number;
|
|
49
49
|
owner: string;
|
|
50
50
|
}>>;
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
/** SDK 0.21+ page contract. Old installed SDKs fail closed, never fall back to scans. */
|
|
52
|
+
searchPrincipalPage?(q: string, options?: SearchOptions): Promise<SearchPage>;
|
|
53
|
+
/** SDK 0.21+ / node #101. Missing API refuses, never falls back to a feed scan. */
|
|
54
|
+
getTransaction?(txId: string): Promise<TransactionObservation>;
|
|
55
|
+
}
|
|
56
|
+
export interface SearchOptions {
|
|
57
|
+
mode?: "prefix" | "contains";
|
|
58
|
+
kind?: "all" | "identity" | "group" | "validator";
|
|
59
|
+
limit?: number;
|
|
60
|
+
offset?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface SearchPage {
|
|
63
|
+
results: Array<{
|
|
64
|
+
type: "identity" | "group";
|
|
53
65
|
nodeId: string;
|
|
54
66
|
summary: string;
|
|
55
|
-
|
|
67
|
+
balance: bigint | null;
|
|
68
|
+
memberCount: number | null;
|
|
69
|
+
owner: string | null;
|
|
70
|
+
validator: boolean;
|
|
71
|
+
weight: number | null;
|
|
72
|
+
}>;
|
|
73
|
+
total: number;
|
|
74
|
+
limit: number;
|
|
75
|
+
offset: number;
|
|
76
|
+
truncated: boolean;
|
|
77
|
+
mode: "prefix" | "contains";
|
|
78
|
+
kind: "all" | "identity" | "group" | "validator";
|
|
79
|
+
stateRound: number;
|
|
56
80
|
}
|
|
57
81
|
/** Small on purpose: the reader is a model, and a page it did not need is context it cannot get
|
|
58
82
|
* back. 200 is the node's own clamp, so the tool never asks for what it cannot get. */
|
|
@@ -77,6 +101,7 @@ export interface HeightReport extends NodeHeights {
|
|
|
77
101
|
readonly note: string;
|
|
78
102
|
}
|
|
79
103
|
export declare function chainHeight(reads: ChainReads): Promise<ToolResult<HeightReport>>;
|
|
104
|
+
export declare function transaction(reads: Pick<ChainReads, "getTransaction">, txId: unknown): Promise<ToolResult<TransactionObservation>>;
|
|
80
105
|
export declare function recent(reads: ChainReads, limit?: number): Promise<ToolResult<FeedTx[]>>;
|
|
81
106
|
/** The one read with a DEFINITIVE negative: the chain answered and has no such identity. The
|
|
82
107
|
* height it answered at travels with it, so a lagging node is visible rather than confident.
|
|
@@ -151,25 +176,18 @@ export declare function groups(reads: ChainReads, limit?: number, offset?: numbe
|
|
|
151
176
|
limit: number;
|
|
152
177
|
offset: number;
|
|
153
178
|
}>>;
|
|
154
|
-
/**
|
|
155
|
-
|
|
156
|
-
* ⚠️ THIS SEARCHES NAMES, NOT CONTENT BYTES. Content is content-addressed — "nothing can be
|
|
157
|
-
* found without being told the key", so there is no content search, and this is the only search
|
|
158
|
-
* the node exposes. A query shorter than two characters is refused locally BEFORE the node is
|
|
159
|
-
* asked: the node's own 400 `invalid_query` floor exists because a one-character query would ask
|
|
160
|
-
* for everything (T-5-06).
|
|
161
|
-
*
|
|
162
|
-
* ⚠️ THE NODE RETURNS THE WHOLE RESULT SET, so the `limit` slice below is local and `total` says
|
|
163
|
-
* what it was sliced from — the node's own results are unordered and de-duplicated by
|
|
164
|
-
* `(nodeId, type)`.
|
|
165
|
-
*/
|
|
166
|
-
export declare function searchPrincipals(reads: ChainReads, q: string, limit?: number): Promise<ToolResult<{
|
|
179
|
+
/** One bounded node page. Total is the NODE's filtered count, not an array length. */
|
|
180
|
+
export declare function searchPrincipals(reads: ChainReads, q: string, limit?: number, offset?: number, mode?: SearchOptions["mode"], kind?: SearchOptions["kind"]): Promise<ToolResult<{
|
|
167
181
|
query: string;
|
|
168
|
-
matches: Array<{
|
|
169
|
-
|
|
170
|
-
nodeId: string;
|
|
171
|
-
summary: string;
|
|
182
|
+
matches: Array<Omit<SearchPage["results"][number], "balance"> & {
|
|
183
|
+
balance: string | null;
|
|
172
184
|
}>;
|
|
173
185
|
total: number;
|
|
186
|
+
limit: number;
|
|
187
|
+
offset: number;
|
|
188
|
+
truncated: boolean;
|
|
189
|
+
mode: string;
|
|
190
|
+
kind: string;
|
|
191
|
+
stateRound: number;
|
|
174
192
|
}>>;
|
|
175
193
|
//# sourceMappingURL=read.d.ts.map
|
package/dist/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,gFAAgF;AAChF,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;QAAE,KAAK,EAA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AK,SAAgB,EACrB,MAAM,SAAI,EACV,IAAI,GAAE,aAAa,CAAC,MAAM,CAAY,EACtC,IAAI,GAAE,aAAa,CAAC,MAAM,CAAS,GAClC,OAAO,CAAC,UAAU,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG;QAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IACjI,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAerH"}
|
package/dist/read.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// read, the recent-transaction feed, identity/group (with `wrong_kind` disambiguation), keys,
|
|
5
|
-
// channel terms, and the group listing — plus the structural `ChainReads` seam that lets every
|
|
6
|
-
// rule be exercised without a live node.
|
|
7
|
-
//
|
|
8
|
-
// The chain has no lookup by transaction id and no filter by sender: transactions are not a
|
|
9
|
-
// queryable entity at all, they live inside block payloads and the only read is "the most recent
|
|
10
|
-
// N, paged".
|
|
1
|
+
// Chain reads, including bounded node-owned transaction observations. Exact lookup never walks
|
|
2
|
+
// the feed, proves absence, or touches session signing records. A cache miss is not permission
|
|
3
|
+
// to retry a payment. Structural seams permit focused checks without a live node.
|
|
11
4
|
import { wrongKind } from "./result.js";
|
|
12
5
|
/** Small on purpose: the reader is a model, and a page it did not need is context it cannot get
|
|
13
6
|
* back. 200 is the node's own clamp, so the tool never asks for what it cannot get. */
|
|
@@ -39,6 +32,22 @@ export async function chainHeight(reads) {
|
|
|
39
32
|
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
40
33
|
}
|
|
41
34
|
}
|
|
35
|
+
export async function transaction(reads, txId) {
|
|
36
|
+
const what = "transaction observation";
|
|
37
|
+
if (typeof txId !== "string" || !/^[0-9a-f]{64}$/.test(txId))
|
|
38
|
+
return { kind: "partial", what, cause: "invalid txId: use the original 64-character lowercase signed-intent ID" };
|
|
39
|
+
if (typeof reads.getTransaction !== "function")
|
|
40
|
+
return { kind: "partial", what, cause: "unsupported SDK: getTransaction requires SDK 0.21+ and node #101; no scan fallback" };
|
|
41
|
+
try {
|
|
42
|
+
return { kind: "ok", value: await reads.getTransaction(txId) };
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
const cause = e instanceof Error ? e.message : String(e);
|
|
46
|
+
if (/unsupported transaction lookup|malformed transaction lookup/.test(cause))
|
|
47
|
+
return { kind: "partial", what, cause };
|
|
48
|
+
return { kind: "unreachable", chain: "", cause };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
42
51
|
export async function recent(reads, limit = DEFAULT_LIMIT) {
|
|
43
52
|
const bounded = Math.max(1, Math.min(limit, MAX_LIMIT));
|
|
44
53
|
try {
|
|
@@ -127,6 +136,11 @@ export async function keys(reads, identityName) {
|
|
|
127
136
|
if (who.length === 0)
|
|
128
137
|
return refuseRead("keys", "which identity? a name is required");
|
|
129
138
|
try {
|
|
139
|
+
// Older key endpoints returned [] for groups too. Probe the other kind first so even
|
|
140
|
+
// those nodes cannot turn an empty group into a fabricated keyless identity. Two direct
|
|
141
|
+
// by-name reads, no chain-wide keys/groups scan. A failed kind read is not absence.
|
|
142
|
+
if (await reads.getGroup(who) !== null)
|
|
143
|
+
return wrongKind(`identity keys "${who}"`, "group", "evolver_group");
|
|
130
144
|
const rows = await reads.getIdentityKeys(who);
|
|
131
145
|
if (rows === null)
|
|
132
146
|
return { kind: "not_found", what: `identity "${who}"` };
|
|
@@ -191,26 +205,21 @@ export async function groups(reads, limit = DEFAULT_LIMIT, offset = 0) {
|
|
|
191
205
|
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
192
206
|
}
|
|
193
207
|
}
|
|
194
|
-
/**
|
|
195
|
-
|
|
196
|
-
* ⚠️ THIS SEARCHES NAMES, NOT CONTENT BYTES. Content is content-addressed — "nothing can be
|
|
197
|
-
* found without being told the key", so there is no content search, and this is the only search
|
|
198
|
-
* the node exposes. A query shorter than two characters is refused locally BEFORE the node is
|
|
199
|
-
* asked: the node's own 400 `invalid_query` floor exists because a one-character query would ask
|
|
200
|
-
* for everything (T-5-06).
|
|
201
|
-
*
|
|
202
|
-
* ⚠️ THE NODE RETURNS THE WHOLE RESULT SET, so the `limit` slice below is local and `total` says
|
|
203
|
-
* what it was sliced from — the node's own results are unordered and de-duplicated by
|
|
204
|
-
* `(nodeId, type)`.
|
|
205
|
-
*/
|
|
206
|
-
export async function searchPrincipals(reads, q, limit = DEFAULT_LIMIT) {
|
|
208
|
+
/** One bounded node page. Total is the NODE's filtered count, not an array length. */
|
|
209
|
+
export async function searchPrincipals(reads, q, limit = DEFAULT_LIMIT, offset = 0, mode = "prefix", kind = "all") {
|
|
207
210
|
const query = String(q ?? "").trim();
|
|
208
|
-
if (query.length
|
|
209
|
-
return refuseRead("search", "
|
|
210
|
-
|
|
211
|
+
if (!query || query.length > 128)
|
|
212
|
+
return refuseRead("search", "query must be 1-128 characters");
|
|
213
|
+
if (!Number.isSafeInteger(limit) || !Number.isSafeInteger(offset) ||
|
|
214
|
+
!["prefix", "contains"].includes(mode) || !["all", "identity", "group", "validator"].includes(kind))
|
|
215
|
+
return refuseRead("search", "use integer limit/offset, mode prefix|contains and kind all|identity|group|validator");
|
|
216
|
+
const lim = Math.max(1, Math.min(100, limit)), off = Math.max(0, offset);
|
|
217
|
+
if (!reads.searchPrincipalPage)
|
|
218
|
+
return refuseRead("search", "requires evolver-client 0.21+ and the node #64 principal-page contract; upgrade both (no scan fallback)");
|
|
211
219
|
try {
|
|
212
|
-
const
|
|
213
|
-
|
|
220
|
+
const { results, ...page } = await reads.searchPrincipalPage(query, { limit: lim, offset: off, mode, kind });
|
|
221
|
+
const matches = results.map(r => ({ ...r, balance: r.balance === null ? null : r.balance.toString() }));
|
|
222
|
+
return { kind: "ok", value: { query, matches, ...page } };
|
|
214
223
|
}
|
|
215
224
|
catch (e) {
|
|
216
225
|
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
package/dist/read.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,+FAA+F;AAC/F,kFAAkF;AAGlF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAgDxC;wFACwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAsB7B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAiB;IACjD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,CAAC;QACrC,wFAAwF;QACxF,4FAA4F;QAC5F,6FAA6F;QAC7F,mBAAmB;QACnB,MAAM,CAAC,GAAgB,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,YAAY,EAAE,KAAK,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC;QACnG,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7E,MAAM,O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AY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/F,CAAC;AACH,CAAC"}
|
package/dist/tools.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ChainReads } from "./read.js";
|
|
|
3
3
|
import type { EvolverConfig } from "./config.js";
|
|
4
4
|
import type { ToolResult } from "./result.js";
|
|
5
5
|
import type { ContentDeps } from "./content.js";
|
|
6
|
+
import type { ProcessorAccess } from "./processor.js";
|
|
6
7
|
import type { Signer, SubmitResult, ClaimResult } from "@mcsherrylabs/evolver-client";
|
|
7
8
|
import type { McpResult } from "./mcp.js";
|
|
8
9
|
/** SAFE-02: the untrusted-content warning (also exported from src/mcp.ts — the tool result text
|
|
@@ -29,6 +30,8 @@ export interface ToolContext {
|
|
|
29
30
|
ed25519Pop: Uint8Array;
|
|
30
31
|
}) => Promise<ClaimResult>;
|
|
31
32
|
readonly content: ContentDeps;
|
|
33
|
+
/** Shared thin client, built once at startup. No SDK processor runtime in an MCP session. */
|
|
34
|
+
readonly processor?: ProcessorAccess;
|
|
32
35
|
}
|
|
33
36
|
export interface ToolSpec {
|
|
34
37
|
readonly name: string;
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAW9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"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AAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B;;sEAEkE;IAClE,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;CAC/G;AAED,eAAO,MAAM,KAAK,EAAE,QAAQ,EAgyB3B,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// reading an empty result as an answer to a question the tool never asked.
|
|
9
9
|
import { Type } from "typebox";
|
|
10
10
|
import { formatAmount } from "./amount.js";
|
|
11
|
-
import { DEFAULT_LIMIT, MAX_LIMIT, chainHeight, group, identity, recent, keys, channelTerms, groups, searchPrincipals } from "./read.js";
|
|
11
|
+
import { DEFAULT_LIMIT, MAX_LIMIT, chainHeight, group, identity, recent, keys, channelTerms, groups, searchPrincipals, transaction } from "./read.js";
|
|
12
12
|
import { isLocal } from "./config.js";
|
|
13
13
|
import { ok } from "./result.js";
|
|
14
14
|
import { signTransfer, submitSigned, inspectSigned, signOpaque } from "./write.js";
|
|
@@ -16,6 +16,7 @@ import { signCreateIdentity, signDeleteIdentity, signAddKey, signReplaceKey, sig
|
|
|
16
16
|
import { claimIdentity } from "./claim.js";
|
|
17
17
|
import { publishBytes, fetchBytes } from "./content.js";
|
|
18
18
|
import { inboxSummary, inboxPage, INBOX_DEFAULT_LIMIT, INBOX_MAX_LIMIT } from "./inbox.js";
|
|
19
|
+
import { subscriptions, setSubscription } from "./processor.js";
|
|
19
20
|
import { signCreateGroup, signDeleteGroup, signAddMember, signRemoveMember, signGroupTransfer } from "./group.js";
|
|
20
21
|
import { signChannelClaim, signChannelUnclaim, signChannelWrite, signChannelWritePolicy, signChannelToll, signChannelDa } from "./channel.js";
|
|
21
22
|
import { submitOutcomeToMcpResult } from "./mcp.js";
|
|
@@ -167,7 +168,8 @@ export const TOOLS = [
|
|
|
167
168
|
"⚠️ USE THIS BEFORE ADDING OR REPLACING A KEY — a label that already exists makes an add a " +
|
|
168
169
|
"no-op, and replacing the wrong one can lock an identity out of signing. A committee member " +
|
|
169
170
|
"cannot delete its default BLS key. An empty list means the identity exists and holds no " +
|
|
170
|
-
"keys; not_found means the chain has no such identity, as of this node's applied round." +
|
|
171
|
+
"keys; not_found means the chain has no such identity, as of this node's applied round. " +
|
|
172
|
+
"A group name is wrong_kind: use evolver_group for membership; groups hold no identity keys or balance." +
|
|
171
173
|
UNTRUSTED,
|
|
172
174
|
parameters: Type.Object({ name: Type.String({ description: "The identity whose keys to list." }) }),
|
|
173
175
|
run: async (ctx, p) => keys(ctx.client, String(p["name"] ?? "")),
|
|
@@ -410,7 +412,7 @@ export const TOOLS = [
|
|
|
410
412
|
writePolicy: Type.Optional(Type.String({ description: "\"owner_or_group\" or \"open\"." })),
|
|
411
413
|
daGroup: Type.Optional(Type.String({ description: "The data-availability group for the channel." })),
|
|
412
414
|
daThresholdM: Type.Optional(Type.Number({ description: "The DA threshold (M-of-N)." })),
|
|
413
|
-
tollAmount: Type.Optional(Type.String({ description: "A
|
|
415
|
+
tollAmount: Type.Optional(Type.String({ description: "A canonical nonnegative decimal integer string, at most 9223372036854775807; \"0\"/omit means untolled." })),
|
|
414
416
|
tollRecipient: Type.Optional(Type.String({ description: "Who receives the toll." })),
|
|
415
417
|
}),
|
|
416
418
|
run: async (ctx, p) => signChannelClaim({ identity: ctx.identity, signer: ctx.signer, reads: ctx.client, ttlOffset: undefined }, {
|
|
@@ -419,7 +421,7 @@ export const TOOLS = [
|
|
|
419
421
|
writePolicy: p["writePolicy"] === undefined ? undefined : String(p["writePolicy"]),
|
|
420
422
|
daGroup: p["daGroup"] === undefined ? undefined : String(p["daGroup"]),
|
|
421
423
|
daThresholdM: p["daThresholdM"] === undefined ? undefined : Number(p["daThresholdM"]),
|
|
422
|
-
tollAmount: p["tollAmount"]
|
|
424
|
+
tollAmount: p["tollAmount"],
|
|
423
425
|
tollRecipient: p["tollRecipient"] === undefined ? undefined : String(p["tollRecipient"]),
|
|
424
426
|
}),
|
|
425
427
|
},
|
|
@@ -448,12 +450,12 @@ export const TOOLS = [
|
|
|
448
450
|
parameters: Type.Object({
|
|
449
451
|
channel: Type.String({ description: "The channel to write to (not a core ledger)." }),
|
|
450
452
|
bodyHex: Type.String({ description: "The payload to sign, as a hex string." }),
|
|
451
|
-
maxToll: Type.Optional(Type.String({ description: "The signed toll ceiling
|
|
453
|
+
maxToll: Type.Optional(Type.String({ description: "The signed toll ceiling: a canonical nonnegative decimal integer string, at most 9223372036854775807; \"0\"/omit consents to no toll." })),
|
|
452
454
|
}),
|
|
453
455
|
run: async (ctx, p) => signChannelWrite({ identity: ctx.identity, signer: ctx.signer, reads: ctx.client, ttlOffset: undefined }, {
|
|
454
456
|
channel: String(p["channel"] ?? ""),
|
|
455
457
|
bodyHex: String(p["bodyHex"] ?? ""),
|
|
456
|
-
maxToll: p["maxToll"]
|
|
458
|
+
maxToll: p["maxToll"],
|
|
457
459
|
}),
|
|
458
460
|
},
|
|
459
461
|
{
|
|
@@ -480,12 +482,12 @@ export const TOOLS = [
|
|
|
480
482
|
UNTRUSTED,
|
|
481
483
|
parameters: Type.Object({
|
|
482
484
|
channel: Type.String({ description: "The channel whose toll to set (not a core ledger)." }),
|
|
483
|
-
tollAmount: Type.Optional(Type.String({ description: "A
|
|
485
|
+
tollAmount: Type.Optional(Type.String({ description: "A canonical nonnegative decimal integer string, at most 9223372036854775807; \"0\"/omit removes the toll." })),
|
|
484
486
|
tollRecipient: Type.Optional(Type.String({ description: "Who receives the toll." })),
|
|
485
487
|
}),
|
|
486
488
|
run: async (ctx, p) => signChannelToll({ identity: ctx.identity, signer: ctx.signer, reads: ctx.client, ttlOffset: undefined }, {
|
|
487
489
|
channel: String(p["channel"] ?? ""),
|
|
488
|
-
tollAmount: p["tollAmount"]
|
|
490
|
+
tollAmount: p["tollAmount"],
|
|
489
491
|
tollRecipient: p["tollRecipient"] === undefined ? undefined : String(p["tollRecipient"]),
|
|
490
492
|
}),
|
|
491
493
|
},
|
|
@@ -566,28 +568,57 @@ export const TOOLS = [
|
|
|
566
568
|
{
|
|
567
569
|
name: "evolver_search_principals",
|
|
568
570
|
label: "Search principal names",
|
|
569
|
-
description: "Search principal NAMES
|
|
570
|
-
"
|
|
571
|
-
"
|
|
572
|
-
"
|
|
573
|
-
"
|
|
574
|
-
"
|
|
575
|
-
"
|
|
571
|
+
description: "Search principal NAMES, not content bytes. Literal, case-sensitive prefix matching by default; " +
|
|
572
|
+
"mode=contains matches a substring. Queries are 1-128 characters; %, _ and ! are literals, not wildcards. " +
|
|
573
|
+
"One row per unique name, ordered by name; type is identity or group. Validator is an identity role " +
|
|
574
|
+
"at stateRound (completed cursor round if initialized, otherwise committed-tip fallback, not proof of applied coverage), " +
|
|
575
|
+
"not a separate principal kind; kind=validator filters that role. " +
|
|
576
|
+
"Filtering/counting/paging happen on the node: default limit 20, clamped 1-100, offset >=0. total is the " +
|
|
577
|
+
"filtered count before paging; truncated means more matches follow this page. Results include exact string " +
|
|
578
|
+
"identity balances or group memberCount/owner, never a group balance or a credit-recipient shortcut. " +
|
|
579
|
+
"Requires SDK 0.21+ and node #64 principal-page support; older contracts refuse, with no exhaustive scan fallback." + UNTRUSTED,
|
|
576
580
|
parameters: Type.Object({
|
|
577
|
-
q: Type.String({ description: "
|
|
578
|
-
limit: Type.Optional(Type.
|
|
579
|
-
|
|
580
|
-
|
|
581
|
+
q: Type.String({ description: "Literal principal-name query, 1-128 characters." }),
|
|
582
|
+
limit: Type.Optional(Type.Integer({ description: "Page size, default 20, clamped 1-100." })),
|
|
583
|
+
offset: Type.Optional(Type.Integer({ description: "Number of matching names to skip, default 0, clamped >=0." })),
|
|
584
|
+
mode: Type.Optional(Type.Union([Type.Literal("prefix"), Type.Literal("contains")])),
|
|
585
|
+
kind: Type.Optional(Type.Union([Type.Literal("all"), Type.Literal("identity"), Type.Literal("group"), Type.Literal("validator")])),
|
|
586
|
+
}),
|
|
587
|
+
run: async (ctx, p) => searchPrincipals(ctx.client, String(p["q"] ?? ""), Number(p["limit"] ?? DEFAULT_LIMIT), Number(p["offset"] ?? 0), (p["mode"] ?? "prefix"), (p["kind"] ?? "all")),
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: "evolver_transaction",
|
|
591
|
+
label: "Look up a transaction by exact ID",
|
|
592
|
+
description: "Dedicated read-only node lookup of the original signing txId (64 lowercase hex signed-intent ID), " +
|
|
593
|
+
"not a block/content hash. Works across MCP sessions and for transactions signed elsewhere; " +
|
|
594
|
+
"does not inspect session records or page recent transactions. Requires SDK 0.21+ and node #101. " +
|
|
595
|
+
"Returns chainId, node source/role and latestObservedRound (NOT a complete-coverage watermark). " +
|
|
596
|
+
"A committed result proves ordering at round/index with ledger/sender only: admission and application " +
|
|
597
|
+
"remain unknown, not payment/admin success, actual charges, finality or commit latency. " +
|
|
598
|
+
"Cache capacity/retained, oldest-observation eviction and empty-on-node-restart/no-backfill coverage " +
|
|
599
|
+
"are explicit. Covers local committed-block observations only, may lag delivery/indexing; identifiers " +
|
|
600
|
+
"over 256 ledger / 128 sender characters aren't retained. Retained IDs outlive the recent feed. " +
|
|
601
|
+
"not-observed means bounded unknown (including pre-start history or evicted entries), NEVER absence. " +
|
|
602
|
+
"After unknown submit, keep the original txId and query here; never automatically re-sign, retry or pay " +
|
|
603
|
+
"again on a miss. Unsupported/malformed/transport failures are not cache misses." + UNTRUSTED,
|
|
604
|
+
parameters: Type.Object({
|
|
605
|
+
txId: Type.String({ pattern: "^[0-9a-f]{64}$", description: "Original canonical signed-intent txId, including IDs signed outside this MCP session." }),
|
|
606
|
+
}, { additionalProperties: false }),
|
|
607
|
+
run: async (ctx, p) => transaction(ctx.client, p["txId"]),
|
|
581
608
|
},
|
|
582
609
|
{
|
|
583
610
|
name: "evolver_inspect",
|
|
584
611
|
label: "Inspect a signed transaction",
|
|
585
612
|
description: "Read back what THIS agent signed THIS session, by the transaction id the signing step " +
|
|
586
|
-
"returned: the sender,
|
|
587
|
-
"
|
|
588
|
-
"
|
|
613
|
+
"returned: the sender, transaction id, expiry and operation fields. Financial strings describe " +
|
|
614
|
+
"signed intent: `maxToll` is the authorized toll ceiling (including default \"0\"), `amount`/" +
|
|
615
|
+
"`amount.N` and recipients describe transfers, `initialCredit` is sponsored starting credit, " +
|
|
616
|
+
"and `tollAmount`/`tollRecipient` describe toll configuration, not actual payments or charges. " +
|
|
617
|
+
"No fees, applied charges or node outcome are established here. Reads only — it contacts no " +
|
|
618
|
+
"chain and reads the session record, not decoded transactions. An unknown id answers " +
|
|
619
|
+
"`not_found` for this session, not proof of on-chain absence." + UNTRUSTED,
|
|
589
620
|
parameters: Type.Object({
|
|
590
|
-
txId: Type.String({ description: "The transaction id returned by
|
|
621
|
+
txId: Type.String({ description: "The transaction id returned by a signing tool in this session." }),
|
|
591
622
|
}),
|
|
592
623
|
run: async (ctx, p) => inspectSigned(String(p["txId"] ?? "")),
|
|
593
624
|
},
|
|
@@ -598,7 +629,8 @@ export const TOOLS = [
|
|
|
598
629
|
"cannot sign and will not create a transaction. It will not submit anything this session did " +
|
|
599
630
|
"not sign, and will not submit the same transaction twice. ⚠️ On an UNKNOWN outcome, do NOT " +
|
|
600
631
|
"re-sign: a new signature is a DIFFERENT transaction that nothing deduplicates, so both may " +
|
|
601
|
-
"commit —
|
|
632
|
+
"commit — call evolver_transaction with the ORIGINAL txId instead; not-observed is unknown, never " +
|
|
633
|
+
"permission to retry. ⚠️ A `committed` outcome means ORDERED, not necessarily PAID — " +
|
|
602
634
|
"read the balance to know whether the payment landed. On a `committed` outcome only, " +
|
|
603
635
|
"`commitIntervalMs` reports the submit-to-commit time — an integer number of milliseconds " +
|
|
604
636
|
"(not on any other outcome)." + UNTRUSTED,
|
|
@@ -610,28 +642,62 @@ export const TOOLS = [
|
|
|
610
642
|
return submitOutcomeToMcpResult(report);
|
|
611
643
|
},
|
|
612
644
|
},
|
|
645
|
+
{
|
|
646
|
+
name: "evolver_subscribe",
|
|
647
|
+
label: "Subscribe to a channel",
|
|
648
|
+
description: "Idempotent SET membership on the explicitly paired managed processor. The owner updates " +
|
|
649
|
+
"saved subscriptions and reconciles its fixed node restart. Only outcome=active confirms " +
|
|
650
|
+
"the boot-loaded processing node matches desired; configured is not effective, unknown " +
|
|
651
|
+
"is not confirmed. A transport error may leave effects unknown: inspect or repeat the same " +
|
|
652
|
+
"SET. No node signing key required; a chain URL alone grants no control. Forward-only, no " +
|
|
653
|
+
"historical replay. User preferences override defaults." + UNTRUSTED,
|
|
654
|
+
parameters: Type.Object({ ledgerId: Type.String({ description: "Non-core channel ledger id to include in saved subscriptions." }) }, { additionalProperties: false }),
|
|
655
|
+
run: (ctx, p) => setSubscription(ctx, p["ledgerId"], true),
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
name: "evolver_unsubscribe",
|
|
659
|
+
label: "Unsubscribe from a channel",
|
|
660
|
+
description: "Idempotent REMOVE membership through the explicitly paired managed processor and its " +
|
|
661
|
+
"fixed node restart. Retains old inbox data and progress; other channels continue. Saved " +
|
|
662
|
+
"empty membership is intentional. Modules needing a removed channel park visibly, never " +
|
|
663
|
+
"force re-subscription. Only outcome=active confirms desired is boot-loaded; configured " +
|
|
664
|
+
"and unknown do not confirm removal. On uncertain reply inspect or repeat identical SET. " +
|
|
665
|
+
"No caller-selected files, commands or restart targets; a chain URL alone grants no control." + UNTRUSTED,
|
|
666
|
+
parameters: Type.Object({ ledgerId: Type.String({ description: "Non-core channel ledger id to remove from saved subscriptions." }) }, { additionalProperties: false }),
|
|
667
|
+
run: (ctx, p) => setSubscription(ctx, p["ledgerId"], false),
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
name: "evolver_subscriptions",
|
|
671
|
+
label: "Inspect channel subscriptions",
|
|
672
|
+
description: "Inspect the paired managed processor's binding, desired subscriptions, active boot-loaded " +
|
|
673
|
+
"node observation, outcome (active/configured/unknown), reason and active/parked modules. " +
|
|
674
|
+
"A desired file is not proof of activation; null active is unknown. This read never drains " +
|
|
675
|
+
"the node or mutates subscriptions. Explicit operator control-socket pairing required; " +
|
|
676
|
+
"remote or localhost chain URL alone grants no authority." + UNTRUSTED,
|
|
677
|
+
parameters: Type.Object({}, { additionalProperties: false }),
|
|
678
|
+
run: (ctx) => subscriptions(ctx),
|
|
679
|
+
},
|
|
613
680
|
{
|
|
614
681
|
name: "evolver_inbox",
|
|
615
682
|
label: "Read the event inbox",
|
|
616
|
-
description: "Read already-
|
|
617
|
-
"
|
|
618
|
-
"
|
|
619
|
-
"
|
|
620
|
-
"
|
|
621
|
-
"
|
|
622
|
-
"
|
|
623
|
-
"
|
|
624
|
-
"
|
|
625
|
-
"
|
|
626
|
-
"
|
|
627
|
-
"before acting; an open channel accepts writes from anyone." + UNTRUSTED,
|
|
683
|
+
description: "Read already-collected local data from the explicitly paired shared processor; this never " +
|
|
684
|
+
"drains or advances the node. Omit ledgerId for channels with exact decimal-string entries, " +
|
|
685
|
+
"evicted, unavailable and lastRound counts. With ledgerId get one ordered page (default " +
|
|
686
|
+
INBOX_DEFAULT_LIMIT + ", max " + INBOX_MAX_LIMIT + "), including module-handled originals, " +
|
|
687
|
+
"binding, txId, position, sender, outcome and detail. body is COMPLETE base64, up to 2 MiB " +
|
|
688
|
+
"decoded per retained entry; bodyPreview is bounded hex DISPLAY ONLY, explicitly marked " +
|
|
689
|
+
"complete or not. Null body is unavailable/evicted, distinct from empty bytes. The owner " +
|
|
690
|
+
"byte-bounds pages (first large body allowed); pass next as after (<round>:<index>), honor " +
|
|
691
|
+
"more. Reads retain old unsubscribed data and do not imply historical replay. Transport or " +
|
|
692
|
+
"binding failures are not empty pages. Check `sender` before acting; open channels allow " +
|
|
693
|
+
"anyone to write." + UNTRUSTED,
|
|
628
694
|
parameters: Type.Object({
|
|
629
695
|
ledgerId: Type.Optional(Type.String({ description: "The channel's ledger id. Omit to list the per-channel summary." })),
|
|
630
696
|
after: Type.Optional(Type.String({ description: "Resume position as `<round>:<index>` — the `next` of the previous page." })),
|
|
631
697
|
limit: Type.Optional(Type.Number({ description: `How many entries, default ${INBOX_DEFAULT_LIMIT}, max ${INBOX_MAX_LIMIT}.` })),
|
|
632
698
|
}),
|
|
633
699
|
run: async (ctx, p) => {
|
|
634
|
-
const deps = {
|
|
700
|
+
const deps = { processor: ctx.processor };
|
|
635
701
|
const ledgerId = p["ledgerId"] === undefined ? "" : String(p["ledgerId"]).trim();
|
|
636
702
|
if (ledgerId.length === 0)
|
|
637
703
|
return inboxSummary(deps);
|