@mcsherrylabs/evolver-mcp 0.13.0 → 0.15.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/docker-compose.http.yml +45 -0
- package/deploy/docker-compose.yml +4 -1
- package/dist/application-signer.d.ts +1 -1
- package/dist/application-signer.d.ts.map +1 -1
- package/dist/attachments.d.ts +1 -1
- package/dist/attachments.d.ts.map +1 -1
- package/dist/attachments.js +2 -2
- package/dist/attachments.js.map +1 -1
- package/dist/bootstrap.d.ts +36 -4
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +35 -11
- package/dist/bootstrap.js.map +1 -1
- package/dist/content-file-tools.js +1 -1
- package/dist/content-file-tools.js.map +1 -1
- package/dist/content-files.d.ts +1 -1
- package/dist/content-files.d.ts.map +1 -1
- package/dist/content-files.js +1 -1
- package/dist/content-files.js.map +1 -1
- package/dist/content-ranges.d.ts +1 -1
- package/dist/content-ranges.d.ts.map +1 -1
- package/dist/group-crypto-tools.js +1 -1
- package/dist/group-crypto-tools.js.map +1 -1
- package/dist/group-crypto.d.ts +2 -2
- package/dist/group-crypto.d.ts.map +1 -1
- package/dist/group-crypto.js +1 -1
- package/dist/group-crypto.js.map +1 -1
- package/dist/http-transport.d.ts +87 -0
- package/dist/http-transport.d.ts.map +1 -0
- package/dist/http-transport.js +359 -0
- package/dist/http-transport.js.map +1 -0
- package/dist/inbox.d.ts +1 -1
- package/dist/inbox.d.ts.map +1 -1
- package/dist/inbox.js +1 -1
- package/dist/inbox.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +254 -115
- package/dist/index.js.map +1 -1
- package/dist/install-http.d.ts +27 -0
- package/dist/install-http.d.ts.map +1 -0
- package/dist/install-http.js +192 -0
- package/dist/install-http.js.map +1 -0
- package/dist/install.d.ts +18 -0
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +128 -22
- package/dist/install.js.map +1 -1
- package/dist/login.d.ts +1 -1
- package/dist/login.d.ts.map +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.d.ts.map +1 -1
- package/dist/p2p.d.ts +1 -1
- package/dist/p2p.d.ts.map +1 -1
- package/dist/p2p.js +1 -1
- package/dist/p2p.js.map +1 -1
- package/dist/processor.d.ts +1 -1
- package/dist/processor.d.ts.map +1 -1
- package/dist/processor.js +1 -1
- package/dist/processor.js.map +1 -1
- package/dist/signed-http.d.ts +1 -1
- package/dist/signed-http.d.ts.map +1 -1
- package/dist/tools.d.ts +5 -3
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +34 -34
- package/dist/tools.js.map +1 -1
- package/dist/transaction-interchange-tools.js +1 -1
- package/dist/transaction-interchange-tools.js.map +1 -1
- package/dist/transaction-interchange.d.ts +5 -2
- package/dist/transaction-interchange.d.ts.map +1 -1
- package/dist/transaction-interchange.js +10 -10
- package/dist/transaction-interchange.js.map +1 -1
- package/package.json +10 -16
- package/dist/amount.d.ts +0 -23
- package/dist/amount.d.ts.map +0 -1
- package/dist/amount.js +0 -53
- package/dist/amount.js.map +0 -1
- package/dist/channel.d.ts +0 -77
- package/dist/channel.d.ts.map +0 -1
- package/dist/channel.js +0 -287
- package/dist/channel.js.map +0 -1
- package/dist/claim.d.ts +0 -48
- package/dist/claim.d.ts.map +0 -1
- package/dist/claim.js +0 -81
- package/dist/claim.js.map +0 -1
- package/dist/content.d.ts +0 -94
- package/dist/content.d.ts.map +0 -1
- package/dist/content.js +0 -215
- package/dist/content.js.map +0 -1
- package/dist/group-ownership.d.ts +0 -78
- package/dist/group-ownership.d.ts.map +0 -1
- package/dist/group-ownership.js +0 -324
- package/dist/group-ownership.js.map +0 -1
- package/dist/group.d.ts +0 -60
- package/dist/group.d.ts.map +0 -1
- package/dist/group.js +0 -204
- package/dist/group.js.map +0 -1
- package/dist/identity.d.ts +0 -87
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js +0 -236
- package/dist/identity.js.map +0 -1
- package/dist/node-transport.d.ts +0 -14
- package/dist/node-transport.d.ts.map +0 -1
- package/dist/node-transport.js +0 -54
- package/dist/node-transport.js.map +0 -1
- package/dist/read.d.ts +0 -252
- package/dist/read.d.ts.map +0 -1
- package/dist/read.js +0 -320
- package/dist/read.js.map +0 -1
- package/dist/result.d.ts +0 -110
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -97
- package/dist/result.js.map +0 -1
- package/dist/signer.d.ts +0 -37
- package/dist/signer.d.ts.map +0 -1
- package/dist/signer.js +0 -76
- package/dist/signer.js.map +0 -1
- package/dist/write.d.ts +0 -214
- package/dist/write.d.ts.map +0 -1
- package/dist/write.js +0 -399
- package/dist/write.js.map +0 -1
package/dist/read.d.ts
DELETED
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import type { ChannelOwner, ChannelTerms, TransactionObservation } from "@mcsherrylabs/evolver-client";
|
|
2
|
-
import type { ToolResult } from "./result.js";
|
|
3
|
-
/** One row of the chain's recent-transaction feed, as the client returns it. */
|
|
4
|
-
export interface FeedTx {
|
|
5
|
-
readonly txId: string;
|
|
6
|
-
readonly roundNum: number;
|
|
7
|
-
readonly ledgerId: string;
|
|
8
|
-
readonly txType: string;
|
|
9
|
-
readonly sender: string;
|
|
10
|
-
readonly details: ReadonlyArray<{
|
|
11
|
-
label: string;
|
|
12
|
-
value: string;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
/** Only what this module needs from a chain. `NodeClient` satisfies it structurally, which is what
|
|
16
|
-
* lets the rules be exercised without a node — a rule only checked against a live chain is a rule
|
|
17
|
-
* that drifts. */
|
|
18
|
-
export interface ChainReads {
|
|
19
|
-
currentRound(): Promise<number>;
|
|
20
|
-
/** All three heights. Required, not optional: an optional one would let a build that forgot
|
|
21
|
-
* it silently report only the held tip, which is the exact defect this closes — a node can
|
|
22
|
-
* HOLD 8147 and have applied only 5253, and every committed-state read answers as of the
|
|
23
|
-
* latter. */
|
|
24
|
-
nodeStatus(): Promise<{
|
|
25
|
-
nodeId: string;
|
|
26
|
-
blockHeight: number;
|
|
27
|
-
appliedRound: number | null;
|
|
28
|
-
heardRound: number;
|
|
29
|
-
/** #9 — `true` only from a node that refuses any tx lacking its sender's AUTHORIZE auth.
|
|
30
|
-
* Absent (older SDK/node), `null` or `false` all mean unsupported; never defaulted. */
|
|
31
|
-
senderAuthorizationRequired?: boolean | null;
|
|
32
|
-
}>;
|
|
33
|
-
getIdentity(name: string): Promise<{
|
|
34
|
-
nodeId: string;
|
|
35
|
-
balance: bigint;
|
|
36
|
-
} | null>;
|
|
37
|
-
getGroup(name: string): Promise<{
|
|
38
|
-
ledgerId: string;
|
|
39
|
-
members: string[];
|
|
40
|
-
} | null>;
|
|
41
|
-
recentTransactions(limit?: number, offset?: number): Promise<FeedTx[]>;
|
|
42
|
-
getIdentityKeys(name: string): Promise<Array<{
|
|
43
|
-
nodeId: string;
|
|
44
|
-
keyType: string;
|
|
45
|
-
label: string;
|
|
46
|
-
publicKeyHex: string;
|
|
47
|
-
}> | null>;
|
|
48
|
-
getChannelTerms(ledgerId: string): Promise<ChannelTerms>;
|
|
49
|
-
listGroups(): Promise<Array<{
|
|
50
|
-
ledgerId: string;
|
|
51
|
-
memberCount: number;
|
|
52
|
-
owner: string;
|
|
53
|
-
}>>;
|
|
54
|
-
/** SDK 0.21+ page contract. Old installed SDKs fail closed, never fall back to scans. */
|
|
55
|
-
searchPrincipalPage?(q: string, options?: SearchOptions): Promise<SearchPage>;
|
|
56
|
-
/** SDK 0.21+ / node #101. Missing API refuses, never falls back to a feed scan. */
|
|
57
|
-
getTransaction?(txId: string): Promise<TransactionObservation>;
|
|
58
|
-
/** #10 — one explorer page each. Optional so a client without them refuses, never scans. */
|
|
59
|
-
listLedgerOwners?(limit?: number, offset?: number): Promise<{
|
|
60
|
-
owners: Array<{
|
|
61
|
-
ledgerId: string;
|
|
62
|
-
ownerNodeId: string;
|
|
63
|
-
}>;
|
|
64
|
-
total: number;
|
|
65
|
-
}>;
|
|
66
|
-
getKeys?(limit?: number, offset?: number): Promise<Array<{
|
|
67
|
-
nodeId: string;
|
|
68
|
-
keyType: string;
|
|
69
|
-
label: string;
|
|
70
|
-
publicKeyHex: string;
|
|
71
|
-
}>>;
|
|
72
|
-
}
|
|
73
|
-
export interface SearchOptions {
|
|
74
|
-
mode?: "prefix" | "contains";
|
|
75
|
-
kind?: "all" | "identity" | "group" | "validator";
|
|
76
|
-
limit?: number;
|
|
77
|
-
offset?: number;
|
|
78
|
-
}
|
|
79
|
-
export interface SearchPage {
|
|
80
|
-
results: Array<{
|
|
81
|
-
type: "identity" | "group";
|
|
82
|
-
nodeId: string;
|
|
83
|
-
summary: string;
|
|
84
|
-
balance: bigint | null;
|
|
85
|
-
memberCount: number | null;
|
|
86
|
-
owner: string | null;
|
|
87
|
-
validator: boolean;
|
|
88
|
-
weight: number | null;
|
|
89
|
-
}>;
|
|
90
|
-
total: number;
|
|
91
|
-
limit: number;
|
|
92
|
-
offset: number;
|
|
93
|
-
truncated: boolean;
|
|
94
|
-
mode: "prefix" | "contains";
|
|
95
|
-
kind: "all" | "identity" | "group" | "validator";
|
|
96
|
-
stateRound: number;
|
|
97
|
-
}
|
|
98
|
-
/** Small on purpose: the reader is a model, and a page it did not need is context it cannot get
|
|
99
|
-
* back. 200 is the node's own clamp, so the tool never asks for what it cannot get. */
|
|
100
|
-
export declare const DEFAULT_LIMIT = 20;
|
|
101
|
-
export declare const MAX_LIMIT = 200;
|
|
102
|
-
/** The node's clamp for the ledger-owners and keys explorer pages (`ExplorerApiHandler`). */
|
|
103
|
-
export declare const INVENTORY_MAX_LIMIT = 100;
|
|
104
|
-
/** The node parses `offset` as a JVM Int and reads anything larger as 0 — page one, silently. */
|
|
105
|
-
export declare const MAX_OFFSET = 2147483647;
|
|
106
|
-
/** Exact page arguments, or why not. Only an ABSENT value takes the default; a present one must
|
|
107
|
-
* already be an in-range safe integer. Nothing is clamped, coerced or rounded: the node would
|
|
108
|
-
* clamp silently, and an answer to a page nobody asked for reads as the page they did. */
|
|
109
|
-
export declare function pageArgs(limit: unknown, offset: unknown, maxLimit: number): {
|
|
110
|
-
limit: number;
|
|
111
|
-
offset: number;
|
|
112
|
-
} | string;
|
|
113
|
-
/** The three heights a node actually has, and what each one answers.
|
|
114
|
-
*
|
|
115
|
-
* ⚠️ `height` ALONE IS THE TRAP THIS REPLACES. It used to return one number — the held tip —
|
|
116
|
-
* and a model reading it concluded the node was current. A processing node answers every
|
|
117
|
-
* committed-state read AS OF `applied`, so a name created above that round reads `not_found`
|
|
118
|
-
* while the node holds the block containing it. */
|
|
119
|
-
export interface NodeHeights {
|
|
120
|
-
readonly held: number;
|
|
121
|
-
readonly applied: number | null;
|
|
122
|
-
readonly heard: number;
|
|
123
|
-
}
|
|
124
|
-
export interface HeightReport extends NodeHeights {
|
|
125
|
-
/** held - applied, or null when this is not a processing node (nothing to be behind). */
|
|
126
|
-
readonly applyLag: number | null;
|
|
127
|
-
/** heard - held: how far the world is known to be ahead of what we hold. */
|
|
128
|
-
readonly syncLag: number;
|
|
129
|
-
readonly note: string;
|
|
130
|
-
}
|
|
131
|
-
export declare function chainHeight(reads: ChainReads): Promise<ToolResult<HeightReport>>;
|
|
132
|
-
export declare function transaction(reads: Pick<ChainReads, "getTransaction">, txId: unknown): Promise<ToolResult<TransactionObservation>>;
|
|
133
|
-
/** One newest-first page of the explorer feed at the exact validated offset. A display tail, never
|
|
134
|
-
* a lookup: an empty page says nothing about whether a transaction exists. */
|
|
135
|
-
export declare function recent(reads: ChainReads, limit?: unknown, offset?: unknown): Promise<ToolResult<{
|
|
136
|
-
transactions: FeedTx[];
|
|
137
|
-
limit: number;
|
|
138
|
-
offset: number;
|
|
139
|
-
}>>;
|
|
140
|
-
/** One page of the chain-wide ledger-owner listing, exactly as the node orders and reports it.
|
|
141
|
-
* `ownerNodeId` carries no identity/group kind on this row, so none is invented here.
|
|
142
|
-
*
|
|
143
|
-
* ⚠️ NO TOTAL. SDK 0.21.0 substitutes `0` for an absent node total, so a zero cannot be told from
|
|
144
|
-
* a missing field; a count that may be fabricated is not reported. */
|
|
145
|
-
export declare function ledgerOwnersPage(reads: ChainReads, limit?: unknown, offset?: unknown): Promise<ToolResult<{
|
|
146
|
-
owners: Array<{
|
|
147
|
-
ledgerId: string;
|
|
148
|
-
ownerNodeId: string;
|
|
149
|
-
}>;
|
|
150
|
-
limit: number;
|
|
151
|
-
offset: number;
|
|
152
|
-
}>>;
|
|
153
|
-
/** One page of the chain-wide registered PUBLIC key metadata. Never the route to one identity's
|
|
154
|
-
* keys — that is `keys(name)`, a direct read. The SDK returns no total for this page. */
|
|
155
|
-
export declare function chainKeysPage(reads: ChainReads, limit?: unknown, offset?: unknown): Promise<ToolResult<{
|
|
156
|
-
keys: Array<{
|
|
157
|
-
nodeId: string;
|
|
158
|
-
keyType: string;
|
|
159
|
-
label: string;
|
|
160
|
-
publicKeyHex: string;
|
|
161
|
-
}>;
|
|
162
|
-
limit: number;
|
|
163
|
-
offset: number;
|
|
164
|
-
}>>;
|
|
165
|
-
/** The one read with a DEFINITIVE negative: the chain answered and has no such identity. The
|
|
166
|
-
* height it answered at travels with it, so a lagging node is visible rather than confident.
|
|
167
|
-
*
|
|
168
|
-
* ⚠️ AND A NEGATIVE IS CHECKED AGAINST THE OTHER KIND BEFORE IT IS REPORTED. `/api/identity`
|
|
169
|
-
* answers only for identities, so a GROUP name 404s there — and reporting that as `not_found`
|
|
170
|
-
* tells a model "no such thing" about a name the chain holds. A name is one kind or the other
|
|
171
|
-
* (the two share one namespace, with uniqueness enforced across both), so the second read
|
|
172
|
-
* settles it. */
|
|
173
|
-
export declare function identity(reads: ChainReads, name: string): Promise<ToolResult<{
|
|
174
|
-
nodeId: string;
|
|
175
|
-
balance: bigint;
|
|
176
|
-
}>>;
|
|
177
|
-
/** The mirror read: one group and who is in it.
|
|
178
|
-
*
|
|
179
|
-
* ⚠️ IT REPORTS THE OTHER KIND TOO, in the other direction. Asking about an identity by this
|
|
180
|
-
* verb is the same mistake and deserves the same answer — otherwise closing half the gap would
|
|
181
|
-
* leave a model told "no such group" about an identity it can see elsewhere.
|
|
182
|
-
*
|
|
183
|
-
* ⚠️ AN EMPTY MEMBER LIST IS AN ANSWER, NOT AN ABSENCE: a group exists before anyone is added to
|
|
184
|
-
* it, and `members: []` is what that looks like. The existence question is answered by the read
|
|
185
|
-
* returning at all. */
|
|
186
|
-
export declare function group(reads: ChainReads, name: string): Promise<ToolResult<{
|
|
187
|
-
ledgerId: string;
|
|
188
|
-
members: string[];
|
|
189
|
-
}>>;
|
|
190
|
-
/** An identity's complete registered keys, read directly.
|
|
191
|
-
*
|
|
192
|
-
* ⚠️ AN EMPTY LIST IS AN ANSWER AND NOT AN ABSENCE: an identity exists before it holds keys, and
|
|
193
|
-
* an empty set is what that looks like. `not_found` means the chain has no such identity. */
|
|
194
|
-
export declare function keys(reads: ChainReads, identityName: string): Promise<ToolResult<{
|
|
195
|
-
identity: string;
|
|
196
|
-
keys: Array<{
|
|
197
|
-
keyType: string;
|
|
198
|
-
label: string;
|
|
199
|
-
publicKeyHex: string;
|
|
200
|
-
}>;
|
|
201
|
-
complete: boolean;
|
|
202
|
-
scanned: number;
|
|
203
|
-
}>>;
|
|
204
|
-
/** A channel's terms: who owns it, who may write, what a write costs, who holds the bodies.
|
|
205
|
-
*
|
|
206
|
-
* ⚠️ `owners: []` IS AN ANSWER AND IT IS NOT AN ERROR. A channel is not a registered entity —
|
|
207
|
-
* an unclaimed ledger id simply has no owner and no terms, and is therefore open to everyone.
|
|
208
|
-
* So this never reports `not_found`: it reports `claimed: false`, which is the fact. */
|
|
209
|
-
export declare function channelTerms(reads: ChainReads, ledgerId: string): Promise<ToolResult<{
|
|
210
|
-
ledgerId: string;
|
|
211
|
-
claimed: boolean;
|
|
212
|
-
owners: ChannelOwner[];
|
|
213
|
-
toll: {
|
|
214
|
-
amount: string;
|
|
215
|
-
recipient: string;
|
|
216
|
-
} | null;
|
|
217
|
-
da: {
|
|
218
|
-
group: string;
|
|
219
|
-
thresholdM: number;
|
|
220
|
-
} | null;
|
|
221
|
-
writePolicy: string;
|
|
222
|
-
}>>;
|
|
223
|
-
/** Every group on the chain, each with its owner.
|
|
224
|
-
*
|
|
225
|
-
* ⚠️ THIS IS THE ONLY READ THAT CARRIES AN OWNER. Reading one group by name returns its members
|
|
226
|
-
* and NOT who owns it, so "who owns this group?" is answered here or nowhere. The node returns
|
|
227
|
-
* the whole listing, so the slice below is local and `total` says what it was sliced from. */
|
|
228
|
-
export declare function groups(reads: ChainReads, limit?: number, offset?: number): Promise<ToolResult<{
|
|
229
|
-
groups: Array<{
|
|
230
|
-
ledgerId: string;
|
|
231
|
-
memberCount: number;
|
|
232
|
-
owner: string;
|
|
233
|
-
}>;
|
|
234
|
-
total: number;
|
|
235
|
-
limit: number;
|
|
236
|
-
offset: number;
|
|
237
|
-
}>>;
|
|
238
|
-
/** One bounded node page. Total is the NODE's filtered count, not an array length. */
|
|
239
|
-
export declare function searchPrincipals(reads: ChainReads, q: string, limit?: number, offset?: number, mode?: SearchOptions["mode"], kind?: SearchOptions["kind"]): Promise<ToolResult<{
|
|
240
|
-
query: string;
|
|
241
|
-
matches: Array<Omit<SearchPage["results"][number], "balance"> & {
|
|
242
|
-
balance: string | null;
|
|
243
|
-
}>;
|
|
244
|
-
total: number;
|
|
245
|
-
limit: number;
|
|
246
|
-
offset: number;
|
|
247
|
-
truncated: boolean;
|
|
248
|
-
mode: string;
|
|
249
|
-
kind: string;
|
|
250
|
-
stateRound: number;
|
|
251
|
-
}>>;
|
|
252
|
-
//# sourceMappingURL=read.d.ts.map
|
package/dist/read.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;A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,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
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
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.
|
|
4
|
-
import { ok, partial, wrongKind } from "./result.js";
|
|
5
|
-
/** Small on purpose: the reader is a model, and a page it did not need is context it cannot get
|
|
6
|
-
* back. 200 is the node's own clamp, so the tool never asks for what it cannot get. */
|
|
7
|
-
export const DEFAULT_LIMIT = 20;
|
|
8
|
-
export const MAX_LIMIT = 200;
|
|
9
|
-
/** The node's clamp for the ledger-owners and keys explorer pages (`ExplorerApiHandler`). */
|
|
10
|
-
export const INVENTORY_MAX_LIMIT = 100;
|
|
11
|
-
/** The node parses `offset` as a JVM Int and reads anything larger as 0 — page one, silently. */
|
|
12
|
-
export const MAX_OFFSET = 2_147_483_647;
|
|
13
|
-
/** Exact page arguments, or why not. Only an ABSENT value takes the default; a present one must
|
|
14
|
-
* already be an in-range safe integer. Nothing is clamped, coerced or rounded: the node would
|
|
15
|
-
* clamp silently, and an answer to a page nobody asked for reads as the page they did. */
|
|
16
|
-
export function pageArgs(limit, offset, maxLimit) {
|
|
17
|
-
const lim = limit === undefined ? DEFAULT_LIMIT : limit;
|
|
18
|
-
const off = offset === undefined ? 0 : offset;
|
|
19
|
-
const shown = (v) => typeof v === "string" ? JSON.stringify(v) : String(v);
|
|
20
|
-
if (typeof lim !== "number" || !Number.isSafeInteger(lim) || lim < 1 || lim > maxLimit)
|
|
21
|
-
return `limit must be an integer 1-${maxLimit} (omit for ${DEFAULT_LIMIT}); got ${shown(limit)}`;
|
|
22
|
-
if (typeof off !== "number" || !Number.isSafeInteger(off) || off < 0 || off > MAX_OFFSET)
|
|
23
|
-
return `offset must be an integer 0-${MAX_OFFSET} (omit for 0); got ${shown(offset)}`;
|
|
24
|
-
return { limit: lim, offset: off };
|
|
25
|
-
}
|
|
26
|
-
/** A node that answered outside the page contract is `partial` — retrying will not change it;
|
|
27
|
-
* only failing to get an answer is `unreachable`. The SDK throws `<method>: HTTP <status>`. */
|
|
28
|
-
function pageFailure(what, e) {
|
|
29
|
-
const cause = e instanceof Error ? e.message : String(e);
|
|
30
|
-
if (e instanceof SyntaxError)
|
|
31
|
-
return partial(what, `malformed node response (${cause}); no scan fallback`);
|
|
32
|
-
if (/: HTTP (404|405|501)$/.test(cause))
|
|
33
|
-
return partial(what, `unsupported by this node (${cause}); no scan fallback`);
|
|
34
|
-
return { kind: "unreachable", chain: "", cause };
|
|
35
|
-
}
|
|
36
|
-
const malformedPage = (what, fields) => partial(what, `malformed node page: expected an array of at most limit rows with string ${fields}; no scan fallback`);
|
|
37
|
-
const stringFields = (v, fields) => typeof v === "object" && v !== null && fields.every((f) => typeof v[f] === "string");
|
|
38
|
-
/** Every declared `FeedTx` field, checked before a row is rendered — a renderer handed a partial row
|
|
39
|
-
* would manufacture `undefined` fields. Values are checked, never converted or decoded. */
|
|
40
|
-
const isFeedTx = (v) => {
|
|
41
|
-
if (!stringFields(v, ["txId", "ledgerId", "txType", "sender"]))
|
|
42
|
-
return false;
|
|
43
|
-
const { roundNum, details } = v;
|
|
44
|
-
return typeof roundNum === "number" && Number.isSafeInteger(roundNum) && roundNum >= 0 &&
|
|
45
|
-
Array.isArray(details) && details.every((d) => stringFields(d, ["label", "value"]));
|
|
46
|
-
};
|
|
47
|
-
export async function chainHeight(reads) {
|
|
48
|
-
try {
|
|
49
|
-
const raw = await reads.nodeStatus();
|
|
50
|
-
// The node's field names travel as far as this line and no further. The tool answers in
|
|
51
|
-
// held/applied/heard, because a model reading `blockHeight` alongside `appliedRound` has to
|
|
52
|
-
// infer that the first is also a round and that they are comparable — which is the inference
|
|
53
|
-
// that went wrong.
|
|
54
|
-
const h = { held: raw.blockHeight, applied: raw.appliedRound, heard: raw.heardRound };
|
|
55
|
-
const applyLag = h.applied === null ? null : Math.max(0, h.held - h.applied);
|
|
56
|
-
const syncLag = Math.max(0, h.heard - h.held);
|
|
57
|
-
// Say what the numbers MEAN, because the consumer is a model and a bare triple invites the
|
|
58
|
-
// same conflation the single number caused.
|
|
59
|
-
const note = applyLag !== null && applyLag > 0
|
|
60
|
-
? `state is applied only to ${h.applied}, ${applyLag} round(s) behind what this node holds — ` +
|
|
61
|
-
`a read of anything created above round ${h.applied} will answer not_found here even though the chain has it`
|
|
62
|
-
: syncLag > 0
|
|
63
|
-
? `this node is ${syncLag} round(s) behind the highest round it has heard of`
|
|
64
|
-
: h.applied === null
|
|
65
|
-
? "not a processing node: state applies at commit, so held is what reads answer as of"
|
|
66
|
-
: "state is applied up to what this node holds; reads are current";
|
|
67
|
-
return { kind: "ok", value: { ...h, applyLag, syncLag, note } };
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export async function transaction(reads, txId) {
|
|
74
|
-
const what = "transaction observation";
|
|
75
|
-
if (typeof txId !== "string" || !/^[0-9a-f]{64}$/.test(txId))
|
|
76
|
-
return { kind: "partial", what, cause: "invalid txId: use the original 64-character lowercase signed-intent ID" };
|
|
77
|
-
if (typeof reads.getTransaction !== "function")
|
|
78
|
-
return { kind: "partial", what, cause: "unsupported SDK: getTransaction requires SDK 0.21+ and node #101; no scan fallback" };
|
|
79
|
-
try {
|
|
80
|
-
return { kind: "ok", value: await reads.getTransaction(txId) };
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
const cause = e instanceof Error ? e.message : String(e);
|
|
84
|
-
if (/unsupported transaction lookup|malformed transaction lookup/.test(cause))
|
|
85
|
-
return { kind: "partial", what, cause };
|
|
86
|
-
return { kind: "unreachable", chain: "", cause };
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/** One newest-first page of the explorer feed at the exact validated offset. A display tail, never
|
|
90
|
-
* a lookup: an empty page says nothing about whether a transaction exists. */
|
|
91
|
-
export async function recent(reads, limit, offset) {
|
|
92
|
-
const what = "recent transactions";
|
|
93
|
-
const page = pageArgs(limit, offset, MAX_LIMIT);
|
|
94
|
-
if (typeof page === "string")
|
|
95
|
-
return partial(what, page);
|
|
96
|
-
try {
|
|
97
|
-
const rows = await reads.recentTransactions(page.limit, page.offset);
|
|
98
|
-
if (!Array.isArray(rows) || rows.length > page.limit || !rows.every(isFeedTx))
|
|
99
|
-
return malformedPage(what, "txId/ledgerId/txType/sender, a nonnegative integer roundNum and label/value details");
|
|
100
|
-
return ok({ transactions: rows, ...page });
|
|
101
|
-
}
|
|
102
|
-
catch (e) {
|
|
103
|
-
return pageFailure(what, e);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/** One page of the chain-wide ledger-owner listing, exactly as the node orders and reports it.
|
|
107
|
-
* `ownerNodeId` carries no identity/group kind on this row, so none is invented here.
|
|
108
|
-
*
|
|
109
|
-
* ⚠️ NO TOTAL. SDK 0.21.0 substitutes `0` for an absent node total, so a zero cannot be told from
|
|
110
|
-
* a missing field; a count that may be fabricated is not reported. */
|
|
111
|
-
export async function ledgerOwnersPage(reads, limit, offset) {
|
|
112
|
-
const what = "ledger owners page";
|
|
113
|
-
const page = pageArgs(limit, offset, INVENTORY_MAX_LIMIT);
|
|
114
|
-
if (typeof page === "string")
|
|
115
|
-
return partial(what, page);
|
|
116
|
-
if (typeof reads.listLedgerOwners !== "function")
|
|
117
|
-
return partial(what, "unsupported client: listLedgerOwners is unavailable; no scan fallback");
|
|
118
|
-
try {
|
|
119
|
-
const rows = (await reads.listLedgerOwners(page.limit, page.offset))?.owners;
|
|
120
|
-
if (!Array.isArray(rows) || rows.length > page.limit || !rows.every((o) => stringFields(o, ["ledgerId", "ownerNodeId"])))
|
|
121
|
-
return malformedPage(what, "ledgerId/ownerNodeId");
|
|
122
|
-
const owners = rows
|
|
123
|
-
.map((o) => ({ ledgerId: o.ledgerId, ownerNodeId: o.ownerNodeId }));
|
|
124
|
-
return ok({ owners, ...page });
|
|
125
|
-
}
|
|
126
|
-
catch (e) {
|
|
127
|
-
return pageFailure(what, e);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/** One page of the chain-wide registered PUBLIC key metadata. Never the route to one identity's
|
|
131
|
-
* keys — that is `keys(name)`, a direct read. The SDK returns no total for this page. */
|
|
132
|
-
export async function chainKeysPage(reads, limit, offset) {
|
|
133
|
-
const what = "chain keys page";
|
|
134
|
-
const page = pageArgs(limit, offset, INVENTORY_MAX_LIMIT);
|
|
135
|
-
if (typeof page === "string")
|
|
136
|
-
return partial(what, page);
|
|
137
|
-
if (typeof reads.getKeys !== "function")
|
|
138
|
-
return partial(what, "unsupported client: getKeys is unavailable; no scan fallback");
|
|
139
|
-
const fields = ["nodeId", "keyType", "label", "publicKeyHex"];
|
|
140
|
-
try {
|
|
141
|
-
const rows = await reads.getKeys(page.limit, page.offset);
|
|
142
|
-
if (!Array.isArray(rows) || rows.length > page.limit || !rows.every((k) => stringFields(k, fields)))
|
|
143
|
-
return malformedPage(what, fields.join("/"));
|
|
144
|
-
const keys = rows
|
|
145
|
-
.map((k) => ({ nodeId: k.nodeId, keyType: k.keyType, label: k.label, publicKeyHex: k.publicKeyHex }));
|
|
146
|
-
return ok({ keys, ...page });
|
|
147
|
-
}
|
|
148
|
-
catch (e) {
|
|
149
|
-
return pageFailure(what, e);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/** The one read with a DEFINITIVE negative: the chain answered and has no such identity. The
|
|
153
|
-
* height it answered at travels with it, so a lagging node is visible rather than confident.
|
|
154
|
-
*
|
|
155
|
-
* ⚠️ AND A NEGATIVE IS CHECKED AGAINST THE OTHER KIND BEFORE IT IS REPORTED. `/api/identity`
|
|
156
|
-
* answers only for identities, so a GROUP name 404s there — and reporting that as `not_found`
|
|
157
|
-
* tells a model "no such thing" about a name the chain holds. A name is one kind or the other
|
|
158
|
-
* (the two share one namespace, with uniqueness enforced across both), so the second read
|
|
159
|
-
* settles it. */
|
|
160
|
-
export async function identity(reads, name) {
|
|
161
|
-
try {
|
|
162
|
-
const found = await reads.getIdentity(name);
|
|
163
|
-
if (found === null) {
|
|
164
|
-
let atHeight;
|
|
165
|
-
try {
|
|
166
|
-
atHeight = await reads.currentRound();
|
|
167
|
-
}
|
|
168
|
-
catch { /* the negative still stands */ }
|
|
169
|
-
// Best-effort, and deliberately so: if THIS read fails we still report the identity
|
|
170
|
-
// negative, which the node gave definitively. A group we cannot confirm must not turn a
|
|
171
|
-
// definitive answer into an unreachable one.
|
|
172
|
-
let asGroup = null;
|
|
173
|
-
try {
|
|
174
|
-
asGroup = await reads.getGroup(name);
|
|
175
|
-
}
|
|
176
|
-
catch { /* the identity negative still stands */ }
|
|
177
|
-
if (asGroup !== null)
|
|
178
|
-
return wrongKind(`identity "${name}"`, "group", "evolver_group", atHeight);
|
|
179
|
-
return { kind: "not_found", what: `identity "${name}"`, atHeight };
|
|
180
|
-
}
|
|
181
|
-
return { kind: "ok", value: found };
|
|
182
|
-
}
|
|
183
|
-
catch (e) {
|
|
184
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
/** The mirror read: one group and who is in it.
|
|
188
|
-
*
|
|
189
|
-
* ⚠️ IT REPORTS THE OTHER KIND TOO, in the other direction. Asking about an identity by this
|
|
190
|
-
* verb is the same mistake and deserves the same answer — otherwise closing half the gap would
|
|
191
|
-
* leave a model told "no such group" about an identity it can see elsewhere.
|
|
192
|
-
*
|
|
193
|
-
* ⚠️ AN EMPTY MEMBER LIST IS AN ANSWER, NOT AN ABSENCE: a group exists before anyone is added to
|
|
194
|
-
* it, and `members: []` is what that looks like. The existence question is answered by the read
|
|
195
|
-
* returning at all. */
|
|
196
|
-
export async function group(reads, name) {
|
|
197
|
-
try {
|
|
198
|
-
const found = await reads.getGroup(name);
|
|
199
|
-
if (found !== null)
|
|
200
|
-
return { kind: "ok", value: found };
|
|
201
|
-
let atHeight;
|
|
202
|
-
try {
|
|
203
|
-
atHeight = await reads.currentRound();
|
|
204
|
-
}
|
|
205
|
-
catch { /* the negative still stands */ }
|
|
206
|
-
let asIdentity = null;
|
|
207
|
-
try {
|
|
208
|
-
asIdentity = await reads.getIdentity(name);
|
|
209
|
-
}
|
|
210
|
-
catch { /* the group negative still stands */ }
|
|
211
|
-
if (asIdentity !== null)
|
|
212
|
-
return wrongKind(`group "${name}"`, "identity", "evolver_identity", atHeight);
|
|
213
|
-
return { kind: "not_found", what: `group "${name}"`, atHeight };
|
|
214
|
-
}
|
|
215
|
-
catch (e) {
|
|
216
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
/** A name (or ledger id) that must be supplied for the read to mean anything. `partial` — a
|
|
220
|
-
* refusal, not an answer — because the chain was never asked: there is nothing to retry. */
|
|
221
|
-
const refuseRead = (what, cause) => ({ kind: "partial", what, cause });
|
|
222
|
-
/** An identity's complete registered keys, read directly.
|
|
223
|
-
*
|
|
224
|
-
* ⚠️ AN EMPTY LIST IS AN ANSWER AND NOT AN ABSENCE: an identity exists before it holds keys, and
|
|
225
|
-
* an empty set is what that looks like. `not_found` means the chain has no such identity. */
|
|
226
|
-
export async function keys(reads, identityName) {
|
|
227
|
-
const who = String(identityName ?? "").trim();
|
|
228
|
-
if (who.length === 0)
|
|
229
|
-
return refuseRead("keys", "which identity? a name is required");
|
|
230
|
-
try {
|
|
231
|
-
// Older key endpoints returned [] for groups too. Probe the other kind first so even
|
|
232
|
-
// those nodes cannot turn an empty group into a fabricated keyless identity. Two direct
|
|
233
|
-
// by-name reads, no chain-wide keys/groups scan. A failed kind read is not absence.
|
|
234
|
-
if (await reads.getGroup(who) !== null)
|
|
235
|
-
return wrongKind(`identity keys "${who}"`, "group", "evolver_group");
|
|
236
|
-
const rows = await reads.getIdentityKeys(who);
|
|
237
|
-
if (rows === null)
|
|
238
|
-
return { kind: "not_found", what: `identity "${who}"` };
|
|
239
|
-
return {
|
|
240
|
-
kind: "ok",
|
|
241
|
-
value: {
|
|
242
|
-
identity: who,
|
|
243
|
-
keys: rows.map((r) => ({ keyType: r.keyType, label: r.label, publicKeyHex: r.publicKeyHex })),
|
|
244
|
-
complete: true,
|
|
245
|
-
scanned: rows.length,
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
catch (e) {
|
|
250
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
/** A channel's terms: who owns it, who may write, what a write costs, who holds the bodies.
|
|
254
|
-
*
|
|
255
|
-
* ⚠️ `owners: []` IS AN ANSWER AND IT IS NOT AN ERROR. A channel is not a registered entity —
|
|
256
|
-
* an unclaimed ledger id simply has no owner and no terms, and is therefore open to everyone.
|
|
257
|
-
* So this never reports `not_found`: it reports `claimed: false`, which is the fact. */
|
|
258
|
-
export async function channelTerms(reads, ledgerId) {
|
|
259
|
-
const id = String(ledgerId ?? "").trim();
|
|
260
|
-
if (id.length === 0)
|
|
261
|
-
return refuseRead("channel terms", "which channel? a ledger id is required");
|
|
262
|
-
try {
|
|
263
|
-
const t = await reads.getChannelTerms(id);
|
|
264
|
-
return {
|
|
265
|
-
kind: "ok",
|
|
266
|
-
value: {
|
|
267
|
-
ledgerId: id,
|
|
268
|
-
claimed: t.owners.length > 0,
|
|
269
|
-
owners: t.owners,
|
|
270
|
-
// A decimal STRING on the way out: an amount is an int64 and a JSON number silently
|
|
271
|
-
// loses precision above 2^53, which for a toll means being wrong about what a write costs.
|
|
272
|
-
toll: t.toll === null ? null : { amount: t.toll.amount.toString(), recipient: t.toll.recipient },
|
|
273
|
-
da: t.da,
|
|
274
|
-
// ABSENCE IS THE DEFAULT: no row means owner_or_group. `null` is therefore an answer, not
|
|
275
|
-
// a gap, and is resolved here so the agent never sees an unexplained null.
|
|
276
|
-
writePolicy: t.writePolicy ?? "owner_or_group",
|
|
277
|
-
},
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
catch (e) {
|
|
281
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
/** Every group on the chain, each with its owner.
|
|
285
|
-
*
|
|
286
|
-
* ⚠️ THIS IS THE ONLY READ THAT CARRIES AN OWNER. Reading one group by name returns its members
|
|
287
|
-
* and NOT who owns it, so "who owns this group?" is answered here or nowhere. The node returns
|
|
288
|
-
* the whole listing, so the slice below is local and `total` says what it was sliced from. */
|
|
289
|
-
export async function groups(reads, limit = DEFAULT_LIMIT, offset = 0) {
|
|
290
|
-
const lim = Math.max(1, Math.min(MAX_LIMIT, Math.trunc(limit)));
|
|
291
|
-
const off = Math.max(0, Math.trunc(offset));
|
|
292
|
-
try {
|
|
293
|
-
const all = await reads.listGroups();
|
|
294
|
-
return { kind: "ok", value: { groups: all.slice(off, off + lim), total: all.length, limit: lim, offset: off } };
|
|
295
|
-
}
|
|
296
|
-
catch (e) {
|
|
297
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
/** One bounded node page. Total is the NODE's filtered count, not an array length. */
|
|
301
|
-
export async function searchPrincipals(reads, q, limit = DEFAULT_LIMIT, offset = 0, mode = "prefix", kind = "all") {
|
|
302
|
-
const query = String(q ?? "").trim();
|
|
303
|
-
if (!query || query.length > 128)
|
|
304
|
-
return refuseRead("search", "query must be 1-128 characters");
|
|
305
|
-
if (!Number.isSafeInteger(limit) || !Number.isSafeInteger(offset) ||
|
|
306
|
-
!["prefix", "contains"].includes(mode) || !["all", "identity", "group", "validator"].includes(kind))
|
|
307
|
-
return refuseRead("search", "use integer limit/offset, mode prefix|contains and kind all|identity|group|validator");
|
|
308
|
-
const lim = Math.max(1, Math.min(100, limit)), off = Math.max(0, offset);
|
|
309
|
-
if (!reads.searchPrincipalPage)
|
|
310
|
-
return refuseRead("search", "requires evolver-client 0.21+ and the node #64 principal-page contract; upgrade both (no scan fallback)");
|
|
311
|
-
try {
|
|
312
|
-
const { results, ...page } = await reads.searchPrincipalPage(query, { limit: lim, offset: off, mode, kind });
|
|
313
|
-
const matches = results.map(r => ({ ...r, balance: r.balance === null ? null : r.balance.toString() }));
|
|
314
|
-
return { kind: "ok", value: { query, matches, ...page } };
|
|
315
|
-
}
|
|
316
|
-
catch (e) {
|
|
317
|
-
return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
//# sourceMappingURL=read.js.map
|
package/dist/read.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAwDrD;wFACwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAC7B,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,iGAAiG;AACjG,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;AAExC;;2FAE2F;AAC3F,MAAM,UAAU,QAAQ,CAAC,KAAc,EAAE,MAAe,EAAE,QAAgB;IACxE,MAAM,GAAG,GA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