@engramx/client 0.16.0-rc.12 → 0.16.0-rc.14

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 (68) hide show
  1. package/README.md +31 -8
  2. package/dist/EngramClient.d.ts +45 -15
  3. package/dist/EngramClient.js +121 -70
  4. package/dist/EngramClient.js.map +1 -1
  5. package/dist/ProfileManager.d.ts +3 -19
  6. package/dist/ProfileManager.js +1 -58
  7. package/dist/ProfileManager.js.map +1 -1
  8. package/dist/SessionManager.d.ts +1 -1
  9. package/dist/SessionManager.js.map +1 -1
  10. package/dist/certifiedAudit.d.ts +31 -0
  11. package/dist/certifiedAudit.js +124 -0
  12. package/dist/certifiedAudit.js.map +1 -1
  13. package/dist/claude-setup.d.ts +15 -6
  14. package/dist/claude-setup.js +30 -20
  15. package/dist/claude-setup.js.map +1 -1
  16. package/dist/cli.js +103 -166
  17. package/dist/cli.js.map +1 -1
  18. package/dist/connect-config.d.ts +109 -0
  19. package/dist/connect-config.js +251 -0
  20. package/dist/connect-config.js.map +1 -0
  21. package/dist/encryption.js +7 -1
  22. package/dist/encryption.js.map +1 -1
  23. package/dist/evidence.d.ts +94 -0
  24. package/dist/evidence.js +352 -0
  25. package/dist/evidence.js.map +1 -0
  26. package/dist/idl.d.ts +16 -1
  27. package/dist/idl.js +9 -1
  28. package/dist/idl.js.map +1 -1
  29. package/dist/index.d.ts +11 -5
  30. package/dist/index.js +13 -4
  31. package/dist/index.js.map +1 -1
  32. package/dist/ledgerfsHash.d.ts +0 -2
  33. package/dist/ledgerfsHash.js +0 -2
  34. package/dist/ledgerfsHash.js.map +1 -1
  35. package/dist/lineage.d.ts +7 -1
  36. package/dist/lineage.js +7 -1
  37. package/dist/lineage.js.map +1 -1
  38. package/dist/memoryArchive.d.ts +12 -77
  39. package/dist/memoryArchive.js.map +1 -1
  40. package/dist/migrate.d.ts +1 -30
  41. package/dist/migrate.js +13 -136
  42. package/dist/migrate.js.map +1 -1
  43. package/dist/openclaw-local.d.ts +86 -0
  44. package/dist/openclaw-local.js +332 -0
  45. package/dist/openclaw-local.js.map +1 -0
  46. package/dist/openclaw-setup.d.ts +2 -2
  47. package/dist/openclaw-setup.js +8 -36
  48. package/dist/openclaw-setup.js.map +1 -1
  49. package/dist/path-utils.d.ts +0 -16
  50. package/dist/path-utils.js +4 -27
  51. package/dist/path-utils.js.map +1 -1
  52. package/dist/publicRecord.d.ts +5 -0
  53. package/dist/publicRecord.js +52 -0
  54. package/dist/publicRecord.js.map +1 -0
  55. package/dist/recordChain.d.ts +69 -0
  56. package/dist/recordChain.js +145 -0
  57. package/dist/recordChain.js.map +1 -0
  58. package/dist/schema.d.ts +6 -17
  59. package/dist/schema.js +6 -28
  60. package/dist/schema.js.map +1 -1
  61. package/dist/types.d.ts +50 -453
  62. package/dist/verify.d.ts +6 -0
  63. package/dist/verify.js +16 -0
  64. package/dist/verify.js.map +1 -0
  65. package/package.json +17 -5
  66. package/dist/offline.d.ts +0 -21
  67. package/dist/offline.js +0 -104
  68. package/dist/offline.js.map +0 -1
package/dist/types.d.ts CHANGED
@@ -1,164 +1,53 @@
1
- import { Principal } from '@icp-sdk/core/principal';
2
- export type Role = {
3
- Owner: null;
4
- } | {
5
- Agent: null;
6
- } | {
7
- Guardian: null;
8
- };
9
- export type AgentStatus = {
10
- Active: null;
11
- } | {
12
- Revoked: null;
13
- } | {
14
- Resigned: null;
15
- };
16
- export interface AgentPermissions {
17
- canReadMemory: boolean;
18
- canAppendMemory: boolean;
19
- canReadWallet: boolean;
20
- callsPerMinute: bigint;
21
- /** Bulk backup export (pull/list/metadata). Candid opt: [] = none. */
22
- canReadBackup: [] | [boolean];
23
- /**
24
- * The Bools above are FROZEN — every FUTURE permission is a scope string here
25
- * (converges with OAuth scope names). Candid opt: [] = no extended scopes.
26
- */
27
- scopes: [] | [string[]];
28
- }
29
- /** The stored form of an enrolment statement — see `AgentRecord.enrolment`. */
30
- export interface EnrolmentProof {
31
- rootPubkey: Uint8Array;
32
- enrolledKey: Principal;
33
- inviteCode: string;
34
- signature: Uint8Array;
35
- }
36
- /** ⟨2026-09-29⟩ Why an agent's engagement with an engram ended. Mirrors the engram's `AgentEndReason`. */
37
- export type AgentEndReason = {
38
- OwnerRevoked: null;
39
- } | {
40
- GuardianRevoked: null;
41
- } | {
42
- KillSwitch: null;
43
- } | {
44
- Reset: null;
45
- } | {
46
- Resigned: null;
47
- };
48
- /** ⟨2026-09-29⟩ An ending as the engram keeps it — see `AgentRecord.ended`. */
49
- export interface AgentEnding {
50
- reason: AgentEndReason;
51
- day: bigint;
52
- }
1
+ import type { Principal } from '@icp-sdk/core/principal';
2
+ import type * as Engram from '@engramx/idl/engram';
3
+ type Served = Engram._SERVICE;
4
+ /** The `Ok` payload of a served method's reply — for replies the generator names by number. */
5
+ type OkOf<M extends keyof Served> = Extract<Awaited<ReturnType<Served[M]>>, {
6
+ Ok: unknown;
7
+ }>['Ok'];
8
+ export type Role = Engram.Role;
9
+ export type AgentStatus = Engram.AgentStatus;
10
+ export type AgentPermissions = Engram.AgentPermissions;
11
+ export type EnrolmentProof = Engram.EnrolmentProof;
12
+ export type AgentEndReason = Engram.AgentEndReason;
13
+ export type AgentEnding = Engram.AgentEnding;
14
+ export type TrackRecordNotice = Engram.TrackRecordNotice;
15
+ export type ChildAllowanceRow = Engram.ChildAllowanceRow;
16
+ export type Pairing = Engram.Pairing;
17
+ export type AgentRecord = Engram.AgentRecord;
18
+ export type LogPosition = Engram.LogPosition;
19
+ export type HeldKey = Engram.HeldKey;
20
+ export type KeyNomination = Engram.KeyNomination;
21
+ /** A memory file as stored: its content is the stored bytes (ciphertext on an encrypted engram). */
22
+ export type RawMemoryFile = Engram.MemoryFile;
23
+ /** One row of the engram's file listing (`listMemoryFiles`). */
24
+ export type MemoryFileInfo = OkOf<'listMemoryFiles'>['items'][number];
25
+ export type MemoryVersionSummary = Engram.MemoryVersionSummary;
26
+ export type MemoryEviction = Engram.MemoryEviction;
27
+ export type MemoryHistory = Engram.MemoryHistory;
28
+ export type AuditEntry = Engram.AuditEntry;
53
29
  /**
54
- * ⟨2026-09-29⟩ Whether the registry put a new engagement on the agent's track record. `NotRecorded`
55
- * carries a plain sentence: why, whether it is expected, and what to do. The pairing itself
56
- * has succeeded either way. Mirrors the engram's `TrackRecordNotice`.
30
+ * A window of the engram's record, as the reader may see it: an agent reads in full only the entries
31
+ * it caused, and every other entry in the window comes back in `sealed` as a hash-only row (id, the
32
+ * SHA-256 of its body, its entry hash), so `items.length + sealed.length` is the window examined and
33
+ * the chain can be walked through it. `total` is how many entries the record has ever held,
34
+ * `ringFloor` the oldest id still retained, and `hashFirstFrom` where the record switched to the
35
+ * hash-first rule. ⟨2026-10-18: this said `items.length + withheld`; the owner's ruling 6B of
36
+ * 2026-10-14 replaced the count with the sealed rows.⟩
57
37
  */
58
- export type TrackRecordNotice = {
59
- Recorded: null;
60
- } | {
61
- NotRecorded: string;
62
- };
63
- /**
64
- * ⟨2026-10-01, the owner's ruling 2 A⟩ How many engrams of its own an agent may still open through
65
- * this engram, as the owner set it (`setChildAllowance`). `root` is the agent's lasting key — the key
66
- * that will own what it opens. Mirrors the engram's `ChildAllowanceRow`.
67
- */
68
- export interface ChildAllowanceRow {
69
- root: Principal;
70
- remaining: bigint;
71
- }
72
- /** ⟨2026-09-29⟩ `pairAgent`'s reply: the agent record and its track-record notice. */
73
- export interface Pairing {
74
- agent: AgentRecord;
75
- trackRecord: TrackRecordNotice;
76
- }
77
- export interface AgentRecord {
78
- principal: Principal;
79
- /**
80
- * The agent this key belongs to: the principal of the root key that enrolled it (2026-09-28,
81
- * owner decision: one root key per agent, with an enrolled key per client). The registry keeps
82
- * the agent's track record under this.
83
- */
84
- root: Principal;
85
- /**
86
- * The enrolment statement that admitted this key, as the engram keeps it (2026-09-28, review
87
- * finding OPS-1): the engram forwards it with every start it reports, so the registry verifies
88
- * the root's consent itself instead of trusting the engram's word for the root. The invite code
89
- * in it was burned at pairing.
90
- */
91
- enrolment: EnrolmentProof;
92
- name: string;
93
- /**
94
- * When this key was paired (nanoseconds). Renamed from `registeredAt` 2026-09-29 by the
95
- * vocabulary ruling: pairing is the one verb that admits an agent.
96
- */
97
- pairedAtNs: bigint;
98
- lastSeenNs: bigint;
99
- permissions: AgentPermissions;
100
- status: AgentStatus;
101
- /**
102
- * ⟨2026-09-29⟩ How this key's engagement with the engram ended — why, and the start of the UTC day
103
- * (nanoseconds) it ended — or empty while it is active. The engram keeps it so the owner's
104
- * `resyncAgentEdges` can re-send an ending the registry never received. Candid `opt`.
105
- */
106
- ended: [] | [AgentEnding];
107
- /**
108
- * ⟨CORRECTED 2026-10-05⟩ Was `string | null`. The wire is Candid `opt text`, and this record is
109
- * handed back as delivered, so a caller gets `[]` or `[hash]`, never null: `=== null` never
110
- * fired and `?? fallback` never applied. The same correction was made that day on
111
- * ApprovalRequest and BackupMetadata; the wire-mirror gate now compares option-ness too.
112
- */
113
- publicKeyHash: [] | [string];
114
- /** ⟨2026-09-29⟩ Count a key replacement as well as a change of the recorded key hash. */
115
- keyRotatedAtNs: bigint;
116
- keyRotationCount: bigint;
117
- /**
118
- * ⟨2026-09-29, the owner's ruling of that date (follow-up 10)⟩ A replacement key this agent has
119
- * nominated (`EngramClient.nominateAgentKey`) that has not yet accepted, and when (nanoseconds);
120
- * empty when there is none. It expires 24 hours after it was made. Candid `opt`.
121
- */
122
- keyNomination: [] | [KeyNomination];
123
- /**
124
- * ⟨2026-09-29, review PR-6⟩ Where the engram's two logs stood when the key in use began to hold
125
- * this record (at pairing, or at the replacement that moved it here). The agent reads the entries
126
- * this key caused from here on, and none from before.
127
- */
128
- keyHeldFrom: LogPosition;
129
- /**
130
- * ⟨2026-09-29, review PR-6⟩ The keys this agent held on this engram before the one in use, oldest
131
- * first (at most 16), each with the stretch of the logs it held the record for. The agent reads
132
- * the entries each caused within its stretch, so a key replacement does not hide what it did
133
- * before.
134
- */
135
- earlierKeys: HeldKey[];
136
- }
137
- /** ⟨2026-09-29, review PR-6⟩ The ids the next entries of the chained record and the read log get. */
138
- export interface LogPosition {
139
- record: bigint;
140
- reads: bigint;
141
- }
142
- /** ⟨2026-09-29, review PR-6⟩ A key an agent held, from `from` (inclusive) to `until` (exclusive). */
143
- export interface HeldKey {
144
- key: Principal;
145
- from: LogPosition;
146
- until: LogPosition;
147
- }
148
- /** ⟨2026-09-29, follow-up 10⟩ A pending key nomination — see `AgentRecord.keyNomination`. */
149
- export interface KeyNomination {
150
- key: Principal;
151
- atNs: bigint;
152
- }
153
- /** Internal wire type — raw bytes as stored on-canister (plaintext; see encryption.ts) */
154
- export interface RawMemoryFile {
155
- path: string;
156
- content: Uint8Array;
157
- version: bigint;
158
- lastModifiedBy: Principal;
159
- lastModifiedAtNs: bigint;
160
- }
161
- /** Public type — content decoded to a UTF-8 string (no decryption; see encryption.ts) */
38
+ export type AuditPage = OkOf<'listAuditEntries'>;
39
+ /** The engram's public self-description — `about()`. The owner and the cycles balance are not in
40
+ * it (the owner read is gated): read them from `getOwnerConsole()`. */
41
+ export type EngramStatus = Engram.About;
42
+ export type OwnerConsole = Engram.OwnerConsole;
43
+ export type GuardianPermissions = Engram.GuardianPermissions;
44
+ export type GuardianRecord = Engram.GuardianRecord;
45
+ export type BackupType = Engram.BackupType;
46
+ export type BackupStatus = Engram.BackupStatus;
47
+ export type BackupMetadata = Engram.BackupMetadata;
48
+ export type ApprovalStatus = Engram.ApprovalStatus;
49
+ export type ApprovalRequest = Engram.ApprovalRequest;
50
+ /** A memory file with its content decoded to text (decrypted first on an encrypted engram). */
162
51
  export interface MemoryFile {
163
52
  path: string;
164
53
  content: string;
@@ -166,11 +55,6 @@ export interface MemoryFile {
166
55
  lastModifiedBy: Principal;
167
56
  lastModifiedAtNs: bigint;
168
57
  }
169
- export interface MemoryFileInfo {
170
- path: string;
171
- version: bigint;
172
- lastModifiedAtNs: bigint;
173
- }
174
58
  /**
175
59
  * Result of `startSession()` — the engram's memory assembled for injection at the start of an agent
176
60
  * session. `files` are newest-modified first and decrypted; `truncated` is true when the byte cap was
@@ -183,297 +67,10 @@ export interface SessionContext {
183
67
  totalBytes: number;
184
68
  truncated: boolean;
185
69
  }
186
- /**
187
- * What a recorded version commits to.
188
- *
189
- * BREAKING at 0.14.0: versions no longer carry content. The previous shape returned a full
190
- * snapshot per version, truncated at 100 KB with no flag — so a large file's history was a set
191
- * of prefixes that could not be restored from and could not be told apart from complete ones.
192
- * What a version now carries is its commitment: `size` and `contentRoot`. Read the bytes of a
193
- * particular version with `readMemoryAt(path, version)`.
194
- */
195
- export interface MemoryVersionSummary {
196
- version: bigint;
197
- /** Position in the engram's single event chain — the ordering authority across all files. */
198
- seq: bigint;
199
- kind: {
200
- set: null;
201
- } | {
202
- append: null;
203
- } | {
204
- restore: null;
205
- } | {
206
- tombstone: null;
207
- };
208
- by: Principal;
209
- atNs: bigint;
210
- size: bigint;
211
- /** 32-byte hash the record commits to. Anyone holding the bytes can check them against it. */
212
- contentRoot: Uint8Array;
213
- }
214
- /**
215
- * A disclosed byte eviction. The record and the hash always survive, so a reader learns that a
216
- * range's BYTES were reclaimed rather than having to notice their absence. `evictSeq` names the
217
- * chain position where the engram confessed it, and `evictedRoot` is what that confession
218
- * committed to.
219
- */
220
- export interface MemoryEviction {
221
- fromVersion: bigint;
222
- toVersion: bigint;
223
- evictSeq: bigint;
224
- evictedRoot: Uint8Array;
225
- trigger: {
226
- perFileCap: null;
227
- } | {
228
- globalCap: null;
229
- } | {
230
- policy: null;
231
- } | {
232
- thinTail: null;
233
- } | {
234
- thinLogSpaced: null;
235
- };
236
- cause: {
237
- maxVersions: null;
238
- } | {
239
- maxBytes: null;
240
- };
241
- }
242
- /**
243
- * One page of a file's history.
244
- *
245
- * `everCount` vs `retainedCount` is the point: when they differ, bytes were reclaimed and
246
- * `evictions` says which range and under what disclosure. Silent eviction is not representable.
247
- */
248
- export interface MemoryHistory {
249
- versions: MemoryVersionSummary[];
250
- everCount: bigint;
251
- retainedCount: bigint;
252
- oldestRetainedVersion: bigint;
253
- evictedCount: bigint;
254
- evictions: MemoryEviction[];
255
- }
256
- /** One page of a file's bytes. `more` discloses the server's per-call clamp. */
70
+ /** One page of a file's bytes, as a Uint8Array. `more` discloses the server's per-call clamp. */
257
71
  export interface MemoryRangePage {
258
72
  bytes: Uint8Array;
259
73
  fileSize: bigint;
260
74
  more: boolean;
261
75
  }
262
- export interface Account {
263
- owner: Principal;
264
- subaccount: Uint8Array | null;
265
- }
266
- export interface AuditEntry {
267
- id: bigint;
268
- timestampNs: bigint;
269
- caller: Principal;
270
- callerRole: Role;
271
- operation: string;
272
- details: string;
273
- success: boolean;
274
- }
275
- /**
276
- * A window of the engram's record, as the reader may see it. ⟨2026-09-29, owner ruling follow-up 16
277
- * (B)⟩ An agent reads only the entries it caused; the owner and guardians read everything. So
278
- * `withheld` counts the entries in the window this reader was not shown, and `items.length +
279
- * withheld` is the window examined: a page with `withheld > 0` is not the whole record. `total` is
280
- * how many entries the record has ever held (the same number the public certified head publishes).
281
- * WHAT WOULD MAKE THIS WRONG: a reader handed only `items` — which is why `readAuditLog` returns this
282
- * page and not the bare array it used to.
283
- */
284
- export interface AuditPage {
285
- items: AuditEntry[];
286
- total: bigint;
287
- withheld: bigint;
288
- }
289
- /**
290
- * ⚠ **STALE AS OF 2026-08-24 — this type no longer describes what the canister returns, and the
291
- * three fields below carrying that news are the reason.** `EngramClient.status()` calls
292
- * `about()` (the engram's `status()` was split into `about()` + `getOwnerConsole()` in the 0.16.0
293
- * cut), and `About` carries NO `owner`, NO `authorized` and NO `cyclesBalance`. Measured against
294
- * `src/engram/engram.did` on 2026-08-24, not inferred.
295
- *
296
- * Left declared rather than retyped because the retype is not local: `migrate.ts`'s
297
- * `hasValidPairing` returns `status.authorized`, which is now `undefined` — falsy — so every
298
- * caller reads as UNPAIRED. Removing the field here without fixing that call site turns a silent
299
- * wrong answer into a compile error in a file this change does not own; both need to move
300
- * together. Named here so the next reader does not mistake this for a description of the wire.
301
- *
302
- * ⟨RESOLVED 2026-10-05⟩ The banner above describes a past state: all three fields are now gone.
303
- * `authorized` went on 2026-08-25 (its note is below). `owner` and `cyclesBalance` stayed declared
304
- * until the v0.16.0-rc.1 release workflow failed to build the OpenClaw plugin, which still read
305
- * `status.authorized`. The same plugin command read `status.cyclesBalance.length`. Against a real
306
- * `about()` reply that is a TypeError, not a blank line, and tsc could not see it, because the
307
- * actor is `ActorSubclass<any>` and this declaration is the only thing standing between a reader
308
- * and the wire. Every field left here is one `type About` serves, compared field by field with
309
- * `src/engram/engram.did`. test/wire-mirror.test.ts checks the same thing against the generated
310
- * factory and fails on any declared field the reply does not carry. Read the owner and the cycles
311
- * from `getOwnerConsole()`, which refuses a caller with no role on the engram instead of masking.
312
- */
313
- export interface EngramStatus {
314
- memoryFileCount: bigint;
315
- auditLogSize: bigint;
316
- agentCount: bigint;
317
- version: string;
318
- guardianCount: bigint;
319
- paymentsFrozen: boolean;
320
- writesPaused: boolean;
321
- backupCount: bigint;
322
- totalBackupSize: bigint;
323
- /**
324
- * Whether NEW memory writes should be encrypted client-side. Ungated, and ⟨2026-08-24⟩ for a
325
- * simpler reason than the one recorded here before: this said "`status()` redacts only `owner`
326
- * and `cyclesBalance`", which described the masking that the 0.16.0 split removed. `about()`
327
- * redacts NOTHING — the fields worth redacting left for `getOwnerConsole()` — so this reads the
328
- * `memoryEncryptionEnabled` var for every caller including an anonymous one. Verified against
329
- * `src/engram/engram.did` (`type About`), which carries `encryptionEnabled : bool`.
330
- *
331
- * DECLARED HERE ON 2026-08-17 because the SDK now READS it. The canister has always served it;
332
- * this interface simply never named it, because the client asked the singleton
333
- * `isEncryptionEnabled()` instead. The surface diet (R3) removed that method — one variable, one
334
- * audience, two doors — so `ensureEncryptionMode()`, `isMemoryEncryptionEnabled()` and
335
- * `auditLogSize()` all come through this record now, and a field the write path branches on may
336
- * not be left off the type.
337
- *
338
- * `totalMemoryWrites` and `verifiedHuman` are still served-but-undeclared here, exactly as
339
- * before: this type is a narrowing of the record, not a transcription of it, and nothing in this
340
- * package reads those two.
341
- */
342
- encryptionEnabled: boolean;
343
- }
344
- /**
345
- * ⟨0.16.0, L2.2⟩ The GATED half of the `status()` split — the fields `about()` shed because they
346
- * identify the engram's people or its money, which an anonymous query must not hand out.
347
- *
348
- * SHAPE READ FROM `src/generated/engram.idl.ts` (`const OwnerConsole = IDL.Record({…})`), not
349
- * inferred. `owner` is `IDL.Opt(IDL.Principal)`, which agent-js delivers as a 0-or-1-element
350
- * ARRAY — the same option-as-array shape that, read as a bare value elsewhere in this package,
351
- * silently corrupted a certificate witness (see `optBytes` in certifiedAudit.ts). `cyclesBalance`
352
- * is a BARE bigint here and an option on `EngramStatus`: the widening exists only on the ungated
353
- * half, and behind a gate there is nobody to mask it from.
354
- * ⟨CORRECTED 2026-10-05⟩ There is no option on `EngramStatus`. `about()` never served
355
- * `cyclesBalance` at 0.16.0, so the field "on the ungated half" was a declaration with no wire
356
- * behind it, and it is now deleted. This is the only SDK type left with a `cyclesBalance` field.
357
- * ⟨2026-10-06⟩ `src/generated/engram.idl.ts` is deleted; the same declaration is now read from
358
- * `@engramx/idl/engram` (in this repository, `packages/idl/dist/engram.idl.js`).
359
- *
360
- * DESPITE THE NAME the gate is #anyRole — owner, active agent or active guardian — which is
361
- * what makes this the right pairing probe for an agent SDK.
362
- */
363
- export interface OwnerConsole {
364
- owner: [] | [Principal];
365
- cyclesBalance: bigint;
366
- memoryKeyEpoch: bigint;
367
- protectedPathCount: bigint;
368
- agentRevisablePathCount: bigint;
369
- pendingApprovalCount: bigint;
370
- /**
371
- * ⟨ADDED 2026-10-05⟩ Served since the paid-session rail began counting, never declared here, so
372
- * an SDK caller could not read it while the repo's own integration suite read it off the raw
373
- * actor. How many paid-session calls named a session this engram does not have: counted, not
374
- * logged, so a flood of forged session ids cannot push real refusals out of the denial log. Zero
375
- * is a real answer on a fresh engram. Measured that day against engram.did: with it, this type
376
- * declares all seven fields the record serves.
377
- */
378
- unknownSessionRefusals: bigint;
379
- }
380
- export type EngramRecordStatus = {
381
- Active: null;
382
- } | {
383
- Frozen: null;
384
- } | {
385
- Deleted: null;
386
- };
387
- export interface EngramRecord {
388
- owner: Principal;
389
- canisterId: Principal;
390
- createdAtNs: bigint;
391
- status: EngramRecordStatus;
392
- }
393
- export interface RegistryStatus {
394
- totalEngrams: bigint;
395
- activeEngrams: bigint;
396
- registryVersion: string;
397
- engramWasmHash: string;
398
- }
399
- export interface GuardianPermissions {
400
- canRevokeAgents: boolean;
401
- canFreezePayments: boolean;
402
- canPauseWrites: boolean;
403
- /**
404
- * The Bools above are FROZEN — every FUTURE permission is a scope string here
405
- * (converges with OAuth scope names). Candid opt: [] = no extended scopes.
406
- */
407
- scopes: [] | [string[]];
408
- }
409
- export interface GuardianRecord {
410
- principal: Principal;
411
- name: string;
412
- addedAtNs: bigint;
413
- permissions: GuardianPermissions;
414
- }
415
- export type BackupType = {
416
- FullSnapshot: null;
417
- } | {
418
- PartialSnapshot: null;
419
- } | {
420
- IncrementalDiff: null;
421
- };
422
- export type BackupStatus = {
423
- Uploading: null;
424
- } | {
425
- Finalized: null;
426
- } | {
427
- Failed: null;
428
- };
429
- export type ApprovalStatus = {
430
- Pending: null;
431
- } | {
432
- Approved: null;
433
- } | {
434
- Denied: null;
435
- } | {
436
- Used: null;
437
- } | {
438
- Expired: null;
439
- };
440
- export interface ApprovalRequest {
441
- id: string;
442
- caller: Principal;
443
- operation: string;
444
- amount: bigint;
445
- binding: string;
446
- policyLimit: bigint;
447
- policyField: string;
448
- rationale: string;
449
- createdAtNs: bigint;
450
- expiresAtNs: bigint;
451
- status: ApprovalStatus;
452
- /**
453
- * ⟨CORRECTED 2026-10-05⟩ These three were `X | null`. The wire is Candid `opt`, and
454
- * getMyApprovalRequests hands the rows back as delivered, so each is `[]` or `[value]`, never
455
- * null (see AgentRecord.publicKeyHash).
456
- */
457
- approvedBy: [] | [Principal];
458
- approvedAtNs: [] | [bigint];
459
- denialReason: [] | [string];
460
- }
461
- export interface BackupMetadata {
462
- backupId: string;
463
- dbType: string;
464
- backupType: BackupType;
465
- /**
466
- * ⟨CORRECTED 2026-10-05⟩ This and `backupLabel` were `string | null`. The wire is Candid `opt
467
- * text`, and getBackupMetadata and listBackups hand the record back as delivered, so each is `[]`
468
- * or `[text]`, never null (see AgentRecord.publicKeyHash). The OpenClaw backups table printed
469
- * the label correctly only because an array of one string prints as that string.
470
- */
471
- parentBackupId: [] | [string];
472
- totalSize: bigint;
473
- chunkCount: bigint;
474
- sha256: string;
475
- createdAtNs: bigint;
476
- createdBy: Principal;
477
- backupLabel: [] | [string];
478
- status: BackupStatus;
479
- }
76
+ export {};
@@ -0,0 +1,6 @@
1
+ export { verifyCertifiedAuditHead, verifyCertifiedLeaf, verifyCertifiedRegistryHead, verifyCertifiedAnchor, } from './certifiedAudit.js';
2
+ export type { CertifiedAuditHead, VerifiedAuditHead, CertifiedLeaf } from './certifiedAudit.js';
3
+ export { verifyHistoricalCertificate, IC_MAINNET_ROOT_KEY_HEX } from './certifiedAudit.js';
4
+ export type { HistoricalCertificate } from './certifiedAudit.js';
5
+ export { recordEntryBody, recordDigest, recordLink, legacyRecordLink, recordEntryHash, sealedRowOf, walkToCertifiedHead, } from './recordChain.js';
6
+ export type { RecordEntryFields, SealedRow, WalkResult } from './recordChain.js';
package/dist/verify.js ADDED
@@ -0,0 +1,16 @@
1
+ // `@engramx/client/verify` — the browser-safe verifiers: an engram's certified audit head, the
2
+ // registry's certified head, and an engram's certified anchor.
3
+ //
4
+ // ⟨ADDED 2026-10-13, the owner's 3A⟩ WHY A SUBPATH. The package root pulls Node-only modules (pair,
5
+ // migrate, the key cache, the OpenClaw and Claude set-up), so a web page could not import the
6
+ // verifiers it needs and kept a hand-written port of them instead — "the same verifier the
7
+ // ecosystem runs" was N hand-synced copies. This entry, `./connect-config` and `./encryption` import
8
+ // nothing from Node; test/browser-safe-subpaths.test.ts walks their import graphs to hold that.
9
+ // (The ratified name, from the 2026-08 architecture audit's "INTRODUCE @engramx/client/verify".)
10
+ export { verifyCertifiedAuditHead, verifyCertifiedLeaf, verifyCertifiedRegistryHead, verifyCertifiedAnchor, } from './certifiedAudit.js';
11
+ // ⟨2026-10-15, the owner's ruling 6B of 2026-10-14⟩ The historical-certificate check and the record
12
+ // walk, browser-safe (WebCrypto hashing). The evidence bundle's content link needs the memory-file
13
+ // hash contract, which hashes with node:crypto, so `checkEvidence` stays on the package root.
14
+ export { verifyHistoricalCertificate, IC_MAINNET_ROOT_KEY_HEX } from './certifiedAudit.js';
15
+ export { recordEntryBody, recordDigest, recordLink, legacyRecordLink, recordEntryHash, sealedRowOf, walkToCertifiedHead, } from './recordChain.js';
16
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,+DAA+D;AAC/D,EAAE;AACF,oGAAoG;AACpG,8FAA8F;AAC9F,2FAA2F;AAC3F,qGAAqG;AACrG,gGAAgG;AAChG,iGAAiG;AACjG,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,oGAAoG;AACpG,mGAAmG;AACnG,8FAA8F;AAC9F,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EACL,eAAe,EACf,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engramx/client",
3
- "version": "0.16.0-rc.12",
3
+ "version": "0.16.0-rc.14",
4
4
  "description": "Client SDK for EngramX — persistent, decentralized memory for AI agents on the Internet Computer",
5
5
  "license": "Apache-2.0",
6
6
  "author": "EngramX <developer@engramx.ai>",
@@ -11,8 +11,7 @@
11
11
  "engram",
12
12
  "memory",
13
13
  "decentralized",
14
- "openclaw",
15
- "engram"
14
+ "openclaw"
16
15
  ],
17
16
  "type": "module",
18
17
  "engines": {
@@ -27,7 +26,20 @@
27
26
  ".": {
28
27
  "types": "./dist/index.d.ts",
29
28
  "import": "./dist/index.js"
30
- }
29
+ },
30
+ "./verify": {
31
+ "types": "./dist/verify.d.ts",
32
+ "import": "./dist/verify.js"
33
+ },
34
+ "./encryption": {
35
+ "types": "./dist/encryption.d.ts",
36
+ "import": "./dist/encryption.js"
37
+ },
38
+ "./connect-config": {
39
+ "types": "./dist/connect-config.d.ts",
40
+ "import": "./dist/connect-config.js"
41
+ },
42
+ "./package.json": "./package.json"
31
43
  },
32
44
  "files": [
33
45
  "dist/",
@@ -41,7 +53,7 @@
41
53
  "@icp-sdk/core": "^6.1.0"
42
54
  },
43
55
  "dependencies": {
44
- "@engramx/idl": "0.16.0-rc.12",
56
+ "@engramx/idl": "0.16.0-rc.14",
45
57
  "@icp-sdk/core": "^6.1.0",
46
58
  "@icp-sdk/vetkeys": "0.7.0",
47
59
  "@noble/curves": "^2.4.0"
package/dist/offline.d.ts DELETED
@@ -1,21 +0,0 @@
1
- export interface QueuedOperation {
2
- id: string;
3
- method: string;
4
- args: unknown[];
5
- timestamp: number;
6
- retries: number;
7
- }
8
- export declare class OfflineQueue {
9
- private queue;
10
- private filePath;
11
- private maxRetries;
12
- constructor(filePath: string, maxRetries?: number);
13
- enqueue(method: string, args: unknown[]): void;
14
- flush(executor: (method: string, args: unknown[]) => Promise<void>): Promise<{
15
- synced: number;
16
- failed: number;
17
- }>;
18
- get pending(): number;
19
- private load;
20
- private save;
21
- }