@mcsherrylabs/evolver-mcp 0.12.0 → 0.14.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.
Files changed (163) hide show
  1. package/dist/application-signer.d.ts +16 -0
  2. package/dist/application-signer.d.ts.map +1 -0
  3. package/dist/application-signer.js +55 -0
  4. package/dist/application-signer.js.map +1 -0
  5. package/dist/approved-request.d.ts +30 -0
  6. package/dist/approved-request.d.ts.map +1 -0
  7. package/dist/approved-request.js +167 -0
  8. package/dist/approved-request.js.map +1 -0
  9. package/dist/attachment-tools.d.ts +3 -0
  10. package/dist/attachment-tools.d.ts.map +1 -0
  11. package/dist/attachment-tools.js +32 -0
  12. package/dist/attachment-tools.js.map +1 -0
  13. package/dist/attachments.d.ts +41 -0
  14. package/dist/attachments.d.ts.map +1 -0
  15. package/dist/attachments.js +458 -0
  16. package/dist/attachments.js.map +1 -0
  17. package/dist/content-file-tools.d.ts +3 -0
  18. package/dist/content-file-tools.d.ts.map +1 -0
  19. package/dist/content-file-tools.js +67 -0
  20. package/dist/content-file-tools.js.map +1 -0
  21. package/dist/content-files.d.ts +32 -0
  22. package/dist/content-files.d.ts.map +1 -0
  23. package/dist/content-files.js +79 -0
  24. package/dist/content-files.js.map +1 -0
  25. package/dist/content-ranges.d.ts +41 -0
  26. package/dist/content-ranges.d.ts.map +1 -0
  27. package/dist/content-ranges.js +75 -0
  28. package/dist/content-ranges.js.map +1 -0
  29. package/dist/files.d.ts +60 -0
  30. package/dist/files.d.ts.map +1 -0
  31. package/dist/files.js +355 -0
  32. package/dist/files.js.map +1 -0
  33. package/dist/group-crypto-tools.d.ts +3 -0
  34. package/dist/group-crypto-tools.d.ts.map +1 -0
  35. package/dist/group-crypto-tools.js +47 -0
  36. package/dist/group-crypto-tools.js.map +1 -0
  37. package/dist/group-crypto.d.ts +24 -0
  38. package/dist/group-crypto.d.ts.map +1 -0
  39. package/dist/group-crypto.js +135 -0
  40. package/dist/group-crypto.js.map +1 -0
  41. package/dist/group-key-provider.d.ts +30 -0
  42. package/dist/group-key-provider.d.ts.map +1 -0
  43. package/dist/group-key-provider.js +72 -0
  44. package/dist/group-key-provider.js.map +1 -0
  45. package/dist/group-keys.d.ts +34 -0
  46. package/dist/group-keys.d.ts.map +1 -0
  47. package/dist/group-keys.js +88 -0
  48. package/dist/group-keys.js.map +1 -0
  49. package/dist/http-profiles.d.ts +47 -0
  50. package/dist/http-profiles.d.ts.map +1 -0
  51. package/dist/http-profiles.js +161 -0
  52. package/dist/http-profiles.js.map +1 -0
  53. package/dist/human-approval.d.ts +14 -0
  54. package/dist/human-approval.d.ts.map +1 -0
  55. package/dist/human-approval.js +34 -0
  56. package/dist/human-approval.js.map +1 -0
  57. package/dist/inbox.d.ts +1 -1
  58. package/dist/inbox.d.ts.map +1 -1
  59. package/dist/inbox.js +1 -1
  60. package/dist/inbox.js.map +1 -1
  61. package/dist/index.d.ts +11 -0
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +94 -41
  64. package/dist/index.js.map +1 -1
  65. package/dist/login-profiles.d.ts +25 -0
  66. package/dist/login-profiles.d.ts.map +1 -0
  67. package/dist/login-profiles.js +77 -0
  68. package/dist/login-profiles.js.map +1 -0
  69. package/dist/login-tools.d.ts +3 -0
  70. package/dist/login-tools.d.ts.map +1 -0
  71. package/dist/login-tools.js +27 -0
  72. package/dist/login-tools.js.map +1 -0
  73. package/dist/login.d.ts +36 -0
  74. package/dist/login.d.ts.map +1 -0
  75. package/dist/login.js +144 -0
  76. package/dist/login.js.map +1 -0
  77. package/dist/mcp.d.ts +2 -2
  78. package/dist/mcp.d.ts.map +1 -1
  79. package/dist/p2p-tools.d.ts +3 -0
  80. package/dist/p2p-tools.d.ts.map +1 -0
  81. package/dist/p2p-tools.js +52 -0
  82. package/dist/p2p-tools.js.map +1 -0
  83. package/dist/p2p.d.ts +67 -0
  84. package/dist/p2p.d.ts.map +1 -0
  85. package/dist/p2p.js +326 -0
  86. package/dist/p2p.js.map +1 -0
  87. package/dist/processor.d.ts +1 -1
  88. package/dist/processor.d.ts.map +1 -1
  89. package/dist/processor.js +1 -1
  90. package/dist/processor.js.map +1 -1
  91. package/dist/proof-attempts.d.ts +19 -0
  92. package/dist/proof-attempts.d.ts.map +1 -0
  93. package/dist/proof-attempts.js +30 -0
  94. package/dist/proof-attempts.js.map +1 -0
  95. package/dist/signed-http-tools.d.ts +3 -0
  96. package/dist/signed-http-tools.d.ts.map +1 -0
  97. package/dist/signed-http-tools.js +33 -0
  98. package/dist/signed-http-tools.js.map +1 -0
  99. package/dist/signed-http.d.ts +30 -0
  100. package/dist/signed-http.d.ts.map +1 -0
  101. package/dist/signed-http.js +114 -0
  102. package/dist/signed-http.js.map +1 -0
  103. package/dist/tools.d.ts +29 -4
  104. package/dist/tools.d.ts.map +1 -1
  105. package/dist/tools.js +24 -10
  106. package/dist/tools.js.map +1 -1
  107. package/dist/transaction-interchange-tools.d.ts +3 -0
  108. package/dist/transaction-interchange-tools.d.ts.map +1 -0
  109. package/dist/transaction-interchange-tools.js +41 -0
  110. package/dist/transaction-interchange-tools.js.map +1 -0
  111. package/dist/transaction-interchange.d.ts +141 -0
  112. package/dist/transaction-interchange.d.ts.map +1 -0
  113. package/dist/transaction-interchange.js +502 -0
  114. package/dist/transaction-interchange.js.map +1 -0
  115. package/dist/transaction-policy.d.ts +32 -0
  116. package/dist/transaction-policy.d.ts.map +1 -0
  117. package/dist/transaction-policy.js +89 -0
  118. package/dist/transaction-policy.js.map +1 -0
  119. package/package.json +7 -18
  120. package/dist/amount.d.ts +0 -23
  121. package/dist/amount.d.ts.map +0 -1
  122. package/dist/amount.js +0 -53
  123. package/dist/amount.js.map +0 -1
  124. package/dist/channel.d.ts +0 -77
  125. package/dist/channel.d.ts.map +0 -1
  126. package/dist/channel.js +0 -287
  127. package/dist/channel.js.map +0 -1
  128. package/dist/claim.d.ts +0 -48
  129. package/dist/claim.d.ts.map +0 -1
  130. package/dist/claim.js +0 -81
  131. package/dist/claim.js.map +0 -1
  132. package/dist/content.d.ts +0 -81
  133. package/dist/content.d.ts.map +0 -1
  134. package/dist/content.js +0 -215
  135. package/dist/content.js.map +0 -1
  136. package/dist/group-ownership.d.ts +0 -78
  137. package/dist/group-ownership.d.ts.map +0 -1
  138. package/dist/group-ownership.js +0 -325
  139. package/dist/group-ownership.js.map +0 -1
  140. package/dist/group.d.ts +0 -60
  141. package/dist/group.d.ts.map +0 -1
  142. package/dist/group.js +0 -204
  143. package/dist/group.js.map +0 -1
  144. package/dist/identity.d.ts +0 -87
  145. package/dist/identity.d.ts.map +0 -1
  146. package/dist/identity.js +0 -236
  147. package/dist/identity.js.map +0 -1
  148. package/dist/read.d.ts +0 -252
  149. package/dist/read.d.ts.map +0 -1
  150. package/dist/read.js +0 -320
  151. package/dist/read.js.map +0 -1
  152. package/dist/result.d.ts +0 -110
  153. package/dist/result.d.ts.map +0 -1
  154. package/dist/result.js +0 -97
  155. package/dist/result.js.map +0 -1
  156. package/dist/signer.d.ts +0 -37
  157. package/dist/signer.d.ts.map +0 -1
  158. package/dist/signer.js +0 -76
  159. package/dist/signer.js.map +0 -1
  160. package/dist/write.d.ts +0 -208
  161. package/dist/write.d.ts.map +0 -1
  162. package/dist/write.js +0 -385
  163. package/dist/write.js.map +0 -1
@@ -1,87 +0,0 @@
1
- import type { Signer } from "@mcsherrylabs/evolver-client";
2
- import type { ChainReads } from "./read.js";
3
- import type { SignedIdentity, SignedGroup, SignedChannel, SignedRecord } from "./write.js";
4
- import type { ToolResult } from "./result.js";
5
- /** What the identity verbs need from the world. NO `submitTx` — deliberately: the five signing
6
- * verbs submit nothing, so the capability is not present to reach for (SIGN-20 is structural). */
7
- export interface IdentityOpsDeps {
8
- readonly identity: string;
9
- readonly signer: Signer;
10
- readonly ttlOffset?: number;
11
- readonly reads: ChainReads;
12
- }
13
- /** A signed identity operation, as returned by a signing verb. Always `ok` once composed. */
14
- export type IdentitySignResult = ToolResult<SignedIdentity>;
15
- /** Decode a starting credit from a decimal string, refusing `< 1`, non-integers, and negative/hex
16
- * forms. The chain FINES a zero- or negative-credit creation rather than refusing it, so the whole
17
- * point is this refusal happening BEFORE anything is signed (Pitfall 4). */
18
- export declare function parseInitialCredit(input: string): {
19
- ok: true;
20
- value: bigint;
21
- } | {
22
- ok: false;
23
- error: string;
24
- };
25
- /**
26
- * Compose a body into a signed identity transaction and record it — in ONE call. Mirrors
27
- * `signTransfer`'s inline compose→sign→record: `buildSignedTx` → `txIdHex` → record into the two
28
- * session stores via `recordSigned`. It SUBMITS NOTHING.
29
- *
30
- * This is the single compose implementation, re-exported from `src/write.ts` as `composeAndSign`
31
- * (one compose path, never two). The `ledgerId` is always `LEDGER.identity` at the call sites.
32
- */
33
- export declare function composeIdentityTx(deps: IdentityOpsDeps, args: {
34
- ledgerId: string;
35
- body: Uint8Array;
36
- ttlRound: number;
37
- signedAtRound: number;
38
- verb: SignedIdentity["verb"] | SignedGroup["verb"] | SignedChannel["verb"];
39
- fields: Record<string, string>;
40
- maxToll?: bigint;
41
- }): ToolResult<SignedRecord>;
42
- /**
43
- * Sponsor a new identity, paid for by this agent — signed for `deps.identity`, the configured host
44
- * identity as `senderNodeId` (never a caller-chosen node id).
45
- *
46
- * ⚠️ THE CHAIN'S KEY RULES ARE ENFORCED HERE, not left to it, because its answer arrives too late
47
- * to help: a body with the wrong keys is ORDERED and FINED 100, not refused. Exactly one
48
- * BLS12-381-G1 and one Ed25519, each at label "", a starting credit >= 1, and both keys carrying a
49
- * proof of possession from their holder.
50
- */
51
- export declare function signCreateIdentity(deps: IdentityOpsDeps, params: {
52
- keys: Array<{
53
- keyType: string;
54
- keyLabel: string;
55
- publicKey: string;
56
- popSignature: string;
57
- }>;
58
- initialCredit: string;
59
- }): Promise<ToolResult<SignedRecord>>;
60
- /**
61
- * Delete the identity this agent signs as. SELF-DELETION ONLY (Pitfall 5): `confirmName` must match
62
- * `deps.identity`, else the chain would fine a deletion naming another identity.
63
- */
64
- export declare function signDeleteIdentity(deps: IdentityOpsDeps, params: {
65
- confirmName: string;
66
- }): Promise<ToolResult<SignedRecord>>;
67
- export declare const signAddKey: (deps: IdentityOpsDeps, p: {
68
- keyType: string;
69
- keyLabel: string;
70
- publicKey: string;
71
- popSignature: string;
72
- }) => Promise<ToolResult<SignedRecord>>;
73
- export declare const signReplaceKey: (deps: IdentityOpsDeps, p: {
74
- keyType: string;
75
- keyLabel: string;
76
- publicKey: string;
77
- popSignature: string;
78
- }) => Promise<ToolResult<SignedRecord>>;
79
- /**
80
- * Remove one of this identity's own keys. ⚠️ THE CHAIN WILL NOT STOP YOU LOCKING YOURSELF OUT — its
81
- * only guard refuses a committee member deleting its default consensus key.
82
- */
83
- export declare function signDeleteKey(deps: IdentityOpsDeps, p: {
84
- keyType: string;
85
- keyLabel: string;
86
- }): Promise<ToolResult<SignedRecord>>;
87
- //# sourceMappingURL=identity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;mGACmG;AACnG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B;AAED,6FAA6F;AAC7F,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;AAE5D;;6EAE6E;AAC7E,wBAAgB,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MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,sCACpG,CAAC;AAEhC,eAAO,MAAM,cAAc,GAAI,MAAM,eAAe,EAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,sCACpG,CAAC;AAEpC;;;GAGG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,eAAe,EACrB,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAiBnC"}
package/dist/identity.js DELETED
@@ -1,236 +0,0 @@
1
- // Identity-lifecycle signing verbs (SIGN-03..07): sign create/delete identity and add/replace/delete
2
- // key. Each is a compose→sign→record→return-txId operation with ZERO submit, mirroring Phase 2's
3
- // `signTransfer` (SIGN-20) and resolving in the SAME `submitSigned`/`inspectSigned` path (SIGN-19).
4
- //
5
- // The ledger is pinned to `LEDGER.identity` (never a caller-chosen channel or core-ledger id), so
6
- // nothing here can reach a node before `evolver_submit`. The costly local refusals — create-identity
7
- // key rules, delete-identity self-check, empty-PoP refusal — fire BEFORE anything is signed, because
8
- // the chain's answer for a malformed body arrives as a FINE, too late to refuse (Pitfalls 4/5).
9
- //
10
- // ⚠️ KEY MATERIAL NEVER REACHES A RECORD OR A REFUSAL. Records carry key `type`/`label` and the txId
11
- // only; the caller supplies the holder-produced `popSignature` bytes, which are folded into the
12
- // composed body by the SDK encoder — this process never computes a PoP digest and never signs for a
13
- // key it does not hold.
14
- import { LEDGER, buildSignedTx, txIdHex, hexToBytes, createIdentityInner, createIdentityBody, deleteIdentityBody, addKeyBody, replaceKeyBody, deleteKeyBody, } from "@mcsherrylabs/evolver-client";
15
- import { DEFAULT_TTL_OFFSET, recordSigned } from "./write.js";
16
- /** Decode a starting credit from a decimal string, refusing `< 1`, non-integers, and negative/hex
17
- * forms. The chain FINES a zero- or negative-credit creation rather than refusing it, so the whole
18
- * point is this refusal happening BEFORE anything is signed (Pitfall 4). */
19
- export function parseInitialCredit(input) {
20
- const s = String(input ?? "").trim();
21
- if (!/^[1-9][0-9]*$/.test(s))
22
- return {
23
- ok: false,
24
- error: `initialCredit "${s}" is not a positive decimal integer — it must be at least 1, because ` +
25
- `a zero- or negative-credit creation is ordered and FINED rather than refused`,
26
- };
27
- return { ok: true, value: BigInt(s) };
28
- }
29
- /**
30
- * Compose a body into a signed identity transaction and record it — in ONE call. Mirrors
31
- * `signTransfer`'s inline compose→sign→record: `buildSignedTx` → `txIdHex` → record into the two
32
- * session stores via `recordSigned`. It SUBMITS NOTHING.
33
- *
34
- * This is the single compose implementation, re-exported from `src/write.ts` as `composeAndSign`
35
- * (one compose path, never two). The `ledgerId` is always `LEDGER.identity` at the call sites.
36
- */
37
- export function composeIdentityTx(deps, args) {
38
- // Resolve once for the envelope, digest and inspection. Call-site metadata must not override
39
- // the channel write's effective signed consent (including the SDK's zero default).
40
- const maxToll = args.maxToll ?? 0n;
41
- const fields = args.verb === "channel_write"
42
- ? { ...args.fields, maxToll: maxToll.toString() }
43
- : { ...args.fields };
44
- const bytes = buildSignedTx({
45
- ledgerId: args.ledgerId,
46
- senderNodeId: deps.identity,
47
- body: args.body,
48
- ttlRound: args.ttlRound,
49
- signers: [deps.signer],
50
- maxToll,
51
- });
52
- const id = txIdHex(args.ledgerId, deps.identity, args.ttlRound, args.body, maxToll);
53
- const signed = {
54
- txId: id,
55
- expiresAtRound: args.ttlRound,
56
- signedAtRound: args.signedAtRound,
57
- verb: args.verb,
58
- fields,
59
- summary: { sender: deps.identity, ...fields },
60
- };
61
- recordSigned(signed, bytes);
62
- return { kind: "ok", value: signed };
63
- }
64
- /** Read the chain tip to bound a transaction's life; an unreachable chain is `unreachable`, never a
65
- * submit. */
66
- async function tipOrUnreachable(deps) {
67
- try {
68
- return await deps.reads.currentRound();
69
- }
70
- catch (e) {
71
- return { kind: "unreachable", chain: "", cause: e instanceof Error ? e.message : String(e) };
72
- }
73
- }
74
- /**
75
- * Sponsor a new identity, paid for by this agent — signed for `deps.identity`, the configured host
76
- * identity as `senderNodeId` (never a caller-chosen node id).
77
- *
78
- * ⚠️ THE CHAIN'S KEY RULES ARE ENFORCED HERE, not left to it, because its answer arrives too late
79
- * to help: a body with the wrong keys is ORDERED and FINED 100, not refused. Exactly one
80
- * BLS12-381-G1 and one Ed25519, each at label "", a starting credit >= 1, and both keys carrying a
81
- * proof of possession from their holder.
82
- */
83
- export async function signCreateIdentity(deps, params) {
84
- const credit = parseInitialCredit(params.initialCredit);
85
- if (!credit.ok)
86
- return { kind: "partial", what: "initialCredit", cause: credit.error };
87
- const keys = Array.isArray(params.keys) ? params.keys : [];
88
- const bls = keys.filter((k) => k.keyType === "BLS12-381-G1");
89
- const ed = keys.filter((k) => k.keyType === "Ed25519");
90
- if (bls.length !== 1 || ed.length !== 1 || keys.length !== 2)
91
- return {
92
- kind: "partial",
93
- what: "keys",
94
- cause: "exactly one BLS12-381-G1 and one Ed25519 are required, each at the default label. " +
95
- "A body without both is ordered and FINED 100 rather than refused, so it is refused here.",
96
- };
97
- if (keys.some((k) => String(k.keyLabel ?? "") !== ""))
98
- return {
99
- kind: "partial",
100
- what: "keys",
101
- cause: "both keys must be at the default (empty) label — a non-empty label is refused here rather than fined on-chain",
102
- };
103
- // Empty-PoP refusal: this agent signs for NO key it does not hold (T-03-01). Named by field, never bytes.
104
- const empty = keys.findIndex((k) => !k.popSignature || String(k.popSignature).length === 0);
105
- if (empty !== -1)
106
- return {
107
- kind: "partial",
108
- what: `keys.${empty}.popSignature`,
109
- cause: "each key needs a proof of possession from its holder — this agent signs for no key it does not hold",
110
- };
111
- // Hex-decode each key, refusing (naming the PATH) on non-hex/odd-length input (T-03-07). The
112
- // refusal names the field, never echoes the bytes.
113
- const decoded = [];
114
- for (let i = 0; i < keys.length; i++) {
115
- const k = keys[i];
116
- try {
117
- const publicKey = hexToBytes(String(k.publicKey ?? ""));
118
- // Empty-publicKey refusal: zero bytes, not an error — refused for free rather than fined.
119
- if (publicKey.length === 0)
120
- return { kind: "partial", what: `keys.${i}.publicKey`, cause: "a key is needed" };
121
- const popSig = hexToBytes(String(k.popSignature ?? ""));
122
- decoded.push({ keyType: k.keyType, publicKey, keyLabel: String(k.keyLabel ?? ""), popSig });
123
- }
124
- catch (e) {
125
- return { kind: "partial", what: `keys.${i}`, cause: e instanceof Error ? e.message : String(e) };
126
- }
127
- }
128
- const tip = await tipOrUnreachable(deps);
129
- if (typeof tip !== "number")
130
- return tip;
131
- const expiresAtRound = tip + (deps.ttlOffset ?? DEFAULT_TTL_OFFSET);
132
- const body = createIdentityBody(createIdentityInner(deps.identity, credit.value, decoded, true));
133
- return composeIdentityTx(deps, {
134
- ledgerId: LEDGER.identity,
135
- body,
136
- ttlRound: expiresAtRound,
137
- signedAtRound: tip,
138
- verb: "create_identity",
139
- fields: { initialCredit: credit.value.toString() },
140
- });
141
- }
142
- /**
143
- * Delete the identity this agent signs as. SELF-DELETION ONLY (Pitfall 5): `confirmName` must match
144
- * `deps.identity`, else the chain would fine a deletion naming another identity.
145
- */
146
- export async function signDeleteIdentity(deps, params) {
147
- const confirmName = String(params.confirmName ?? "").trim();
148
- if (confirmName !== deps.identity)
149
- return {
150
- kind: "partial",
151
- what: "confirmName",
152
- cause: `this deletes THIS identity and nothing else — the chain fines a deletion naming another. ` +
153
- `Pass "${deps.identity}" to mean it.`,
154
- };
155
- const tip = await tipOrUnreachable(deps);
156
- if (typeof tip !== "number")
157
- return tip;
158
- const expiresAtRound = tip + (deps.ttlOffset ?? DEFAULT_TTL_OFFSET);
159
- return composeIdentityTx(deps, {
160
- ledgerId: LEDGER.identity,
161
- body: deleteIdentityBody(deps.identity),
162
- ttlRound: expiresAtRound,
163
- signedAtRound: tip,
164
- verb: "delete_identity",
165
- fields: { target: deps.identity },
166
- });
167
- }
168
- /** Add/replace share one shape, differing only by verb tag and encoder. The SDK encoders keep them
169
- * distinct (a shared hand-rolled digest would make an AddKey proof valid for a ReplaceKey). */
170
- async function signKeyOp(deps, verb, p) {
171
- const keyType = String(p.keyType ?? "").trim();
172
- const keyLabel = String(p.keyLabel ?? "");
173
- let publicKey, popSignature;
174
- try {
175
- publicKey = hexToBytes(String(p.publicKey ?? ""));
176
- }
177
- catch (e) {
178
- return { kind: "partial", what: "publicKey", cause: e instanceof Error ? e.message : String(e) };
179
- }
180
- // Empty-publicKey refusal: `hexToBytes("")` is zero bytes, not an error — a body carrying an
181
- // empty key would be ordered and fined on-chain, so it is refused for free before anything is
182
- // signed (reference: admin.ts signKeyOp refuses `publicKey.length === 0`).
183
- if (publicKey.length === 0)
184
- return { kind: "partial", what: "publicKey", cause: "a key is needed" };
185
- try {
186
- popSignature = hexToBytes(String(p.popSignature ?? ""));
187
- }
188
- catch (e) {
189
- return { kind: "partial", what: "popSignature", cause: e instanceof Error ? e.message : String(e) };
190
- }
191
- // Empty-PoP refusal: this agent signs for NO key it does not hold.
192
- if (popSignature.length === 0)
193
- return {
194
- kind: "partial",
195
- what: "popSignature",
196
- cause: "the key's holder must prove possession — this agent cannot sign for a key it does not hold",
197
- };
198
- const tip = await tipOrUnreachable(deps);
199
- if (typeof tip !== "number")
200
- return tip;
201
- const expiresAtRound = tip + (deps.ttlOffset ?? DEFAULT_TTL_OFFSET);
202
- const args = { publicKey, keyType, keyLabel, popSignature };
203
- return composeIdentityTx(deps, {
204
- ledgerId: LEDGER.identity,
205
- body: verb === "add_key" ? addKeyBody(args) : replaceKeyBody(args),
206
- ttlRound: expiresAtRound,
207
- signedAtRound: tip,
208
- verb,
209
- fields: { keyType, keyLabel },
210
- });
211
- }
212
- export const signAddKey = (deps, p) => signKeyOp(deps, "add_key", p);
213
- export const signReplaceKey = (deps, p) => signKeyOp(deps, "replace_key", p);
214
- /**
215
- * Remove one of this identity's own keys. ⚠️ THE CHAIN WILL NOT STOP YOU LOCKING YOURSELF OUT — its
216
- * only guard refuses a committee member deleting its default consensus key.
217
- */
218
- export async function signDeleteKey(deps, p) {
219
- const keyType = String(p.keyType ?? "").trim();
220
- if (keyType.length === 0)
221
- return { kind: "partial", what: "keyType", cause: "which key?" };
222
- const keyLabel = String(p.keyLabel ?? "");
223
- const tip = await tipOrUnreachable(deps);
224
- if (typeof tip !== "number")
225
- return tip;
226
- const expiresAtRound = tip + (deps.ttlOffset ?? DEFAULT_TTL_OFFSET);
227
- return composeIdentityTx(deps, {
228
- ledgerId: LEDGER.identity,
229
- body: deleteKeyBody({ keyType, keyLabel }),
230
- ttlRound: expiresAtRound,
231
- signedAtRound: tip,
232
- verb: "delete_key",
233
- fields: { keyType, keyLabel },
234
- });
235
- }
236
- //# sourceMappingURL=identity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iGAAiG;AACjG,oGAAoG;AACpG,EAAE;AACF,kGAAkG;AAClG,qGAAqG;AACrG,qGAAqG;AACrG,gGAAgG;AAChG,EAAE;AACF,qGAAqG;AACrG,gGAAgG;AAChG,oGAAoG;AACpG,wBAAwB;AAExB,OAAO,EACL,MAAM,EACN,aAAa,EACb,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAgB9D;;6EAE6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QAC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IAEpE,OAAO,iBAAiB,CAAC,IAAI,EAAE;QAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;QAC1C,QAAQ,EAAE,cAAc;QACxB,aAAa,EAAE,GAAG;QAClB,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC9B,CAAC,CAAC;AACL,CAAC"}
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":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