@engramx/client 0.15.0 → 0.16.0-rc.10
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/README.md +262 -26
- package/dist/EngramClient.d.ts +235 -229
- package/dist/EngramClient.js +446 -1247
- package/dist/EngramClient.js.map +1 -1
- package/dist/MarketClient.d.ts +137 -0
- package/dist/MarketClient.js +228 -0
- package/dist/MarketClient.js.map +1 -0
- package/dist/ProfileManager.d.ts +4 -4
- package/dist/SessionManager.d.ts +3 -3
- package/dist/SessionManager.js +1 -1
- package/dist/SessionManager.js.map +1 -1
- package/dist/actionReceipt.d.ts +67 -0
- package/dist/actionReceipt.js +76 -2
- package/dist/actionReceipt.js.map +1 -1
- package/dist/auth.d.ts +16 -0
- package/dist/auth.js +38 -5
- package/dist/auth.js.map +1 -1
- package/dist/certifiedAudit.d.ts +32 -6
- package/dist/certifiedAudit.js +75 -14
- package/dist/certifiedAudit.js.map +1 -1
- package/dist/cli.js +100 -26
- package/dist/cli.js.map +1 -1
- package/dist/encryption.d.ts +30 -12
- package/dist/encryption.js +13 -15
- package/dist/encryption.js.map +1 -1
- package/dist/idl.d.ts +69 -0
- package/dist/idl.js +242 -0
- package/dist/idl.js.map +1 -0
- package/dist/index.d.ts +12 -18
- package/dist/index.js +58 -9
- package/dist/index.js.map +1 -1
- package/dist/ledgerfsHash.js +1 -1
- package/dist/ledgerfsHash.js.map +1 -1
- package/dist/lineage.js +8 -5
- package/dist/lineage.js.map +1 -1
- package/dist/memoryArchive.d.ts +428 -0
- package/dist/memoryArchive.js +504 -0
- package/dist/memoryArchive.js.map +1 -0
- package/dist/migrate.js +31 -4
- package/dist/migrate.js.map +1 -1
- package/dist/openEngram.d.ts +55 -0
- package/dist/openEngram.js +185 -0
- package/dist/openEngram.js.map +1 -0
- package/dist/pair.d.ts +33 -2
- package/dist/pair.js +56 -9
- package/dist/pair.js.map +1 -1
- package/dist/types.d.ts +246 -307
- package/dist/version.d.ts +8 -0
- package/dist/version.js +45 -0
- package/dist/version.js.map +1 -0
- package/dist/wire.d.ts +76 -0
- package/dist/wire.js +79 -0
- package/dist/wire.js.map +1 -0
- package/package.json +11 -19
- package/dist/bootstrap.d.ts +0 -21
- package/dist/bootstrap.js +0 -71
- package/dist/bootstrap.js.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -2,18 +2,18 @@ import { Principal } from '@icp-sdk/core/principal';
|
|
|
2
2
|
export type Role = {
|
|
3
3
|
Owner: null;
|
|
4
4
|
} | {
|
|
5
|
-
|
|
5
|
+
Agent: null;
|
|
6
6
|
} | {
|
|
7
7
|
Guardian: null;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type AgentStatus = {
|
|
10
10
|
Active: null;
|
|
11
11
|
} | {
|
|
12
12
|
Revoked: null;
|
|
13
13
|
} | {
|
|
14
|
-
|
|
14
|
+
Resigned: null;
|
|
15
15
|
};
|
|
16
|
-
export interface
|
|
16
|
+
export interface AgentPermissions {
|
|
17
17
|
canReadMemory: boolean;
|
|
18
18
|
canAppendMemory: boolean;
|
|
19
19
|
canReadWallet: boolean;
|
|
@@ -26,16 +26,129 @@ export interface OperatorPermissions {
|
|
|
26
26
|
*/
|
|
27
27
|
scopes: [] | [string[]];
|
|
28
28
|
}
|
|
29
|
-
|
|
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
|
+
}
|
|
53
|
+
/**
|
|
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`.
|
|
57
|
+
*/
|
|
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 {
|
|
30
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;
|
|
31
92
|
name: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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;
|
|
38
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;
|
|
39
152
|
}
|
|
40
153
|
/** Internal wire type — raw bytes as stored on-canister (plaintext; see encryption.ts) */
|
|
41
154
|
export interface RawMemoryFile {
|
|
@@ -43,7 +156,7 @@ export interface RawMemoryFile {
|
|
|
43
156
|
content: Uint8Array;
|
|
44
157
|
version: bigint;
|
|
45
158
|
lastModifiedBy: Principal;
|
|
46
|
-
|
|
159
|
+
lastModifiedAtNs: bigint;
|
|
47
160
|
}
|
|
48
161
|
/** Public type — content decoded to a UTF-8 string (no decryption; see encryption.ts) */
|
|
49
162
|
export interface MemoryFile {
|
|
@@ -51,12 +164,12 @@ export interface MemoryFile {
|
|
|
51
164
|
content: string;
|
|
52
165
|
version: bigint;
|
|
53
166
|
lastModifiedBy: Principal;
|
|
54
|
-
|
|
167
|
+
lastModifiedAtNs: bigint;
|
|
55
168
|
}
|
|
56
169
|
export interface MemoryFileInfo {
|
|
57
170
|
path: string;
|
|
58
171
|
version: bigint;
|
|
59
|
-
|
|
172
|
+
lastModifiedAtNs: bigint;
|
|
60
173
|
}
|
|
61
174
|
/**
|
|
62
175
|
* Result of `startSession()` — the engram's memory assembled for injection at the start of an agent
|
|
@@ -93,7 +206,7 @@ export interface MemoryVersionSummary {
|
|
|
93
206
|
tombstone: null;
|
|
94
207
|
};
|
|
95
208
|
by: Principal;
|
|
96
|
-
|
|
209
|
+
atNs: bigint;
|
|
97
210
|
size: bigint;
|
|
98
211
|
/** 32-byte hash the record commits to. Anyone holding the bytes can check them against it. */
|
|
99
212
|
contentRoot: Uint8Array;
|
|
@@ -152,34 +265,118 @@ export interface Account {
|
|
|
152
265
|
}
|
|
153
266
|
export interface AuditEntry {
|
|
154
267
|
id: bigint;
|
|
155
|
-
|
|
268
|
+
timestampNs: bigint;
|
|
156
269
|
caller: Principal;
|
|
157
270
|
callerRole: Role;
|
|
158
271
|
operation: string;
|
|
159
272
|
details: string;
|
|
160
273
|
success: boolean;
|
|
161
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
|
+
*/
|
|
162
313
|
export interface EngramStatus {
|
|
163
|
-
owner: Principal | null;
|
|
164
314
|
memoryFileCount: bigint;
|
|
165
315
|
auditLogSize: bigint;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* D3 discriminator: when false, cyclesBalance is a MASK (0), owner is null, and the sensitive
|
|
169
|
-
* fields are hidden — do not read cyclesBalance=0 as "broke" without checking this first.
|
|
170
|
-
*/
|
|
171
|
-
/** Present only on 0.12.0+ engrams (not wire-declared until the fleet serves it). */
|
|
172
|
-
authorized?: boolean;
|
|
173
|
-
cyclesBalance: bigint;
|
|
316
|
+
agentCount: bigint;
|
|
174
317
|
version: string;
|
|
175
318
|
guardianCount: bigint;
|
|
176
319
|
paymentsFrozen: boolean;
|
|
177
320
|
writesPaused: boolean;
|
|
178
321
|
backupCount: bigint;
|
|
179
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;
|
|
180
379
|
}
|
|
181
|
-
/** @deprecated Use EngramStatus instead */
|
|
182
|
-
export type VaultStatus = EngramStatus;
|
|
183
380
|
export type EngramRecordStatus = {
|
|
184
381
|
Active: null;
|
|
185
382
|
} | {
|
|
@@ -187,16 +384,12 @@ export type EngramRecordStatus = {
|
|
|
187
384
|
} | {
|
|
188
385
|
Deleted: null;
|
|
189
386
|
};
|
|
190
|
-
/** @deprecated Use EngramRecordStatus instead */
|
|
191
|
-
export type VaultRecordStatus = EngramRecordStatus;
|
|
192
387
|
export interface EngramRecord {
|
|
193
388
|
owner: Principal;
|
|
194
389
|
canisterId: Principal;
|
|
195
|
-
|
|
390
|
+
createdAtNs: bigint;
|
|
196
391
|
status: EngramRecordStatus;
|
|
197
392
|
}
|
|
198
|
-
/** @deprecated Use EngramRecord instead */
|
|
199
|
-
export type VaultRecord = EngramRecord;
|
|
200
393
|
export interface RegistryStatus {
|
|
201
394
|
totalEngrams: bigint;
|
|
202
395
|
activeEngrams: bigint;
|
|
@@ -204,7 +397,7 @@ export interface RegistryStatus {
|
|
|
204
397
|
engramWasmHash: string;
|
|
205
398
|
}
|
|
206
399
|
export interface GuardianPermissions {
|
|
207
|
-
|
|
400
|
+
canRevokeAgents: boolean;
|
|
208
401
|
canFreezePayments: boolean;
|
|
209
402
|
canPauseWrites: boolean;
|
|
210
403
|
/**
|
|
@@ -216,214 +409,9 @@ export interface GuardianPermissions {
|
|
|
216
409
|
export interface GuardianRecord {
|
|
217
410
|
principal: Principal;
|
|
218
411
|
name: string;
|
|
219
|
-
|
|
412
|
+
addedAtNs: bigint;
|
|
220
413
|
permissions: GuardianPermissions;
|
|
221
414
|
}
|
|
222
|
-
export type SessionStatus = {
|
|
223
|
-
open: null;
|
|
224
|
-
} | {
|
|
225
|
-
closing: null;
|
|
226
|
-
} | {
|
|
227
|
-
closed: null;
|
|
228
|
-
} | {
|
|
229
|
-
expired: null;
|
|
230
|
-
}
|
|
231
|
-
/** Reserved catch-all: a future ic402 status arrives as `other`, never as a new tag. */
|
|
232
|
-
| {
|
|
233
|
-
other: string;
|
|
234
|
-
};
|
|
235
|
-
export interface Eip3009Authorization {
|
|
236
|
-
from: string;
|
|
237
|
-
to: string;
|
|
238
|
-
value: bigint;
|
|
239
|
-
validAfter: bigint;
|
|
240
|
-
validBefore: bigint;
|
|
241
|
-
nonce: Uint8Array;
|
|
242
|
-
v: number;
|
|
243
|
-
r: Uint8Array;
|
|
244
|
-
s: Uint8Array;
|
|
245
|
-
}
|
|
246
|
-
export interface PaymentRequirement {
|
|
247
|
-
scheme: string;
|
|
248
|
-
network: string;
|
|
249
|
-
token: string;
|
|
250
|
-
amount: bigint;
|
|
251
|
-
recipient: string;
|
|
252
|
-
nonce: Uint8Array;
|
|
253
|
-
expiry: bigint;
|
|
254
|
-
tokenName: string | null;
|
|
255
|
-
tokenVersion: string | null;
|
|
256
|
-
}
|
|
257
|
-
export interface PaymentSignature {
|
|
258
|
-
scheme: string;
|
|
259
|
-
network: string;
|
|
260
|
-
signature: Uint8Array;
|
|
261
|
-
asset: string | null;
|
|
262
|
-
publicKey: Uint8Array | null;
|
|
263
|
-
sender: string;
|
|
264
|
-
nonce: Uint8Array;
|
|
265
|
-
authorization: Eip3009Authorization | null;
|
|
266
|
-
}
|
|
267
|
-
export interface SessionIntent {
|
|
268
|
-
network: string;
|
|
269
|
-
token: string;
|
|
270
|
-
recipient: string;
|
|
271
|
-
suggestedDeposit: bigint;
|
|
272
|
-
minDeposit: bigint | null;
|
|
273
|
-
expiry: bigint;
|
|
274
|
-
costPerCall: bigint | null;
|
|
275
|
-
description: string | null;
|
|
276
|
-
}
|
|
277
|
-
export interface SessionConfig {
|
|
278
|
-
maxDeposit: bigint;
|
|
279
|
-
autoClose: boolean;
|
|
280
|
-
idleTimeout: bigint | null;
|
|
281
|
-
}
|
|
282
|
-
export interface SessionState {
|
|
283
|
-
id: string;
|
|
284
|
-
payer: Principal;
|
|
285
|
-
deposited: bigint;
|
|
286
|
-
consumed: bigint;
|
|
287
|
-
remaining: bigint;
|
|
288
|
-
voucherCount: bigint;
|
|
289
|
-
status: SessionStatus;
|
|
290
|
-
openedAt: bigint;
|
|
291
|
-
lastActivityAt: bigint;
|
|
292
|
-
}
|
|
293
|
-
export interface Voucher {
|
|
294
|
-
sessionId: string;
|
|
295
|
-
cumulativeAmount: bigint;
|
|
296
|
-
sequence: bigint;
|
|
297
|
-
signature: Uint8Array;
|
|
298
|
-
}
|
|
299
|
-
export interface SpendingPolicy {
|
|
300
|
-
maxPerTransaction: bigint | null;
|
|
301
|
-
maxPerDay: bigint | null;
|
|
302
|
-
rateLimitPerMinute: bigint | null;
|
|
303
|
-
maxSessionDeposit: bigint | null;
|
|
304
|
-
maxConcurrentSessions: bigint | null;
|
|
305
|
-
maxSessionDuration: bigint | null;
|
|
306
|
-
sessionIdleTimeout: bigint | null;
|
|
307
|
-
allowedCallers: Principal[] | null;
|
|
308
|
-
blockedCallers: Principal[] | null;
|
|
309
|
-
}
|
|
310
|
-
export interface ContentEntry {
|
|
311
|
-
id: string;
|
|
312
|
-
mimeType: string;
|
|
313
|
-
totalSize: bigint;
|
|
314
|
-
chunkCount: bigint;
|
|
315
|
-
createdAt: bigint;
|
|
316
|
-
}
|
|
317
|
-
export interface ContentRef {
|
|
318
|
-
id: string;
|
|
319
|
-
mimeType: string | null;
|
|
320
|
-
sizeBytes: bigint | null;
|
|
321
|
-
metadata: Array<[string, string]> | null;
|
|
322
|
-
}
|
|
323
|
-
export interface AccessGrant {
|
|
324
|
-
grantId: string;
|
|
325
|
-
contentRef: ContentRef;
|
|
326
|
-
grantee: Principal;
|
|
327
|
-
receiptId: string;
|
|
328
|
-
issuedAt: bigint;
|
|
329
|
-
expiresAt: bigint;
|
|
330
|
-
hmac: Uint8Array;
|
|
331
|
-
}
|
|
332
|
-
export type AccessGrantResult = {
|
|
333
|
-
ok: null;
|
|
334
|
-
} | {
|
|
335
|
-
expired: string;
|
|
336
|
-
} | {
|
|
337
|
-
revoked: string;
|
|
338
|
-
} | {
|
|
339
|
-
invalidGrant: string;
|
|
340
|
-
};
|
|
341
|
-
export interface ContentDelivery {
|
|
342
|
-
grant: AccessGrant;
|
|
343
|
-
/** EVM settle tx hash when the purchase settled on-chain (null-opt otherwise). */
|
|
344
|
-
settlementTxHash: [string] | [];
|
|
345
|
-
delivery: {
|
|
346
|
-
inline: Uint8Array;
|
|
347
|
-
} | {
|
|
348
|
-
canisterQuery: {
|
|
349
|
-
method: string;
|
|
350
|
-
chunkCount: bigint;
|
|
351
|
-
};
|
|
352
|
-
} | {
|
|
353
|
-
httpUrl: string;
|
|
354
|
-
} | {
|
|
355
|
-
assetCanister: {
|
|
356
|
-
canisterId: Principal;
|
|
357
|
-
path: string;
|
|
358
|
-
};
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
export type PaymentResult = {
|
|
362
|
-
ok: PaymentReceipt;
|
|
363
|
-
} | {
|
|
364
|
-
insufficientFunds: string;
|
|
365
|
-
} | {
|
|
366
|
-
invalidSignature: string;
|
|
367
|
-
} | {
|
|
368
|
-
expired: string;
|
|
369
|
-
} | {
|
|
370
|
-
policyDenied: string;
|
|
371
|
-
} | {
|
|
372
|
-
tokenNotAccepted: string;
|
|
373
|
-
} | {
|
|
374
|
-
networkNotSupported: string;
|
|
375
|
-
} | {
|
|
376
|
-
settlementFailed: string;
|
|
377
|
-
} | {
|
|
378
|
-
settlementPending: string;
|
|
379
|
-
} | {
|
|
380
|
-
reputationTooLow: bigint;
|
|
381
|
-
} | {
|
|
382
|
-
depositBelowMinimum: bigint;
|
|
383
|
-
}
|
|
384
|
-
/** Reserved catch-all: a future ic402 result arrives as `other`, never as a new tag. */
|
|
385
|
-
| {
|
|
386
|
-
other: string;
|
|
387
|
-
};
|
|
388
|
-
export interface PaymentReceipt {
|
|
389
|
-
id: string;
|
|
390
|
-
amount: bigint;
|
|
391
|
-
token: string;
|
|
392
|
-
sender: string;
|
|
393
|
-
recipient: string;
|
|
394
|
-
network: string;
|
|
395
|
-
timestamp: bigint;
|
|
396
|
-
txHash: string | null;
|
|
397
|
-
sessionId: string | null;
|
|
398
|
-
refunded: bigint | null;
|
|
399
|
-
}
|
|
400
|
-
export interface AgentCard {
|
|
401
|
-
name: string;
|
|
402
|
-
description: string;
|
|
403
|
-
services: ServiceEntry[];
|
|
404
|
-
x402Support: boolean;
|
|
405
|
-
}
|
|
406
|
-
export interface ServiceEntry {
|
|
407
|
-
name: string;
|
|
408
|
-
endpoint: string;
|
|
409
|
-
version: string;
|
|
410
|
-
skills: string[];
|
|
411
|
-
domains: string[];
|
|
412
|
-
}
|
|
413
|
-
export type VerificationLevel = {
|
|
414
|
-
Orb: null;
|
|
415
|
-
} | {
|
|
416
|
-
Device: null;
|
|
417
|
-
} | {
|
|
418
|
-
Document: null;
|
|
419
|
-
};
|
|
420
|
-
export interface WorldIdProof {
|
|
421
|
-
nullifierHash: string;
|
|
422
|
-
merkleRoot: string;
|
|
423
|
-
proof: string;
|
|
424
|
-
verificationLevel: VerificationLevel;
|
|
425
|
-
verifiedAt: bigint;
|
|
426
|
-
}
|
|
427
415
|
export type BackupType = {
|
|
428
416
|
FullSnapshot: null;
|
|
429
417
|
} | {
|
|
@@ -458,83 +446,34 @@ export interface ApprovalRequest {
|
|
|
458
446
|
policyLimit: bigint;
|
|
459
447
|
policyField: string;
|
|
460
448
|
rationale: string;
|
|
461
|
-
|
|
462
|
-
|
|
449
|
+
createdAtNs: bigint;
|
|
450
|
+
expiresAtNs: bigint;
|
|
463
451
|
status: ApprovalStatus;
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
Disabled: null;
|
|
473
|
-
} | {
|
|
474
|
-
Enabled: null;
|
|
475
|
-
} | {
|
|
476
|
-
Deleted: null;
|
|
477
|
-
};
|
|
478
|
-
export interface X402Endpoint {
|
|
479
|
-
id: string;
|
|
480
|
-
name: string;
|
|
481
|
-
description: string;
|
|
482
|
-
endpointType: EndpointType;
|
|
483
|
-
contentId: string | null;
|
|
484
|
-
suggestedPrice: bigint;
|
|
485
|
-
price: bigint;
|
|
486
|
-
createdBy: Principal;
|
|
487
|
-
createdAt: bigint;
|
|
488
|
-
status: EndpointStatus;
|
|
489
|
-
enabledBy: Principal | null;
|
|
490
|
-
enabledAt: bigint | null;
|
|
491
|
-
totalRevenue: bigint;
|
|
492
|
-
totalPurchases: bigint;
|
|
493
|
-
}
|
|
494
|
-
export interface PurchaseRecord {
|
|
495
|
-
id: string;
|
|
496
|
-
endpointId: string;
|
|
497
|
-
buyer: string;
|
|
498
|
-
amount: bigint;
|
|
499
|
-
network: string;
|
|
500
|
-
timestamp: bigint;
|
|
501
|
-
receiptId: string;
|
|
502
|
-
txHash: string | null;
|
|
503
|
-
}
|
|
504
|
-
export interface RevenueSummary {
|
|
505
|
-
totalRevenue: bigint;
|
|
506
|
-
totalPurchases: bigint;
|
|
507
|
-
endpointBreakdown: Array<{
|
|
508
|
-
endpointId: string;
|
|
509
|
-
name: string;
|
|
510
|
-
revenue: bigint;
|
|
511
|
-
purchases: bigint;
|
|
512
|
-
}>;
|
|
513
|
-
}
|
|
514
|
-
export interface StorageStats {
|
|
515
|
-
totalFiles: bigint;
|
|
516
|
-
totalContentSize: bigint;
|
|
517
|
-
memoryFilesSize: bigint;
|
|
518
|
-
memoryFilesCount: bigint;
|
|
519
|
-
sessionFilesSize: bigint;
|
|
520
|
-
sessionFilesCount: bigint;
|
|
521
|
-
versionHistorySize: bigint;
|
|
522
|
-
versionHistoryCount: bigint;
|
|
523
|
-
backupSize: bigint;
|
|
524
|
-
backupCount: bigint;
|
|
525
|
-
fileLimit: bigint;
|
|
526
|
-
auditLogSize: bigint;
|
|
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];
|
|
527
460
|
}
|
|
528
461
|
export interface BackupMetadata {
|
|
529
462
|
backupId: string;
|
|
530
463
|
dbType: string;
|
|
531
464
|
backupType: BackupType;
|
|
532
|
-
|
|
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];
|
|
533
472
|
totalSize: bigint;
|
|
534
473
|
chunkCount: bigint;
|
|
535
474
|
sha256: string;
|
|
536
|
-
|
|
475
|
+
createdAtNs: bigint;
|
|
537
476
|
createdBy: Principal;
|
|
538
|
-
backupLabel:
|
|
477
|
+
backupLabel: [] | [string];
|
|
539
478
|
status: BackupStatus;
|
|
540
479
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Printed in place of a version this module could not read: a visible blank, never the bare form. */
|
|
2
|
+
export declare const UNREAD_VERSION = "<version>";
|
|
3
|
+
/** The version this package was built with (its package.json's), or UNREAD_VERSION. */
|
|
4
|
+
export declare const VERSION: string;
|
|
5
|
+
/** `npx @engramx/client@<version>` — the prefix of every command this package's help prints. */
|
|
6
|
+
export declare const NPX_CLIENT: string;
|
|
7
|
+
/** The pairing command, pinned to this build's version. */
|
|
8
|
+
export declare function pairCommand(code?: string, engram?: string): string;
|