@engramx/client 0.1.0-rc.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -21
- package/README.md +12 -5
- package/dist/EngramClient.d.ts +105 -3
- package/dist/EngramClient.js +383 -39
- package/dist/EngramClient.js.map +1 -1
- package/dist/actionReceipt.d.ts +41 -0
- package/dist/actionReceipt.js +67 -0
- package/dist/actionReceipt.js.map +1 -0
- package/dist/certifiedAudit.d.ts +26 -0
- package/dist/certifiedAudit.js +57 -0
- package/dist/certifiedAudit.js.map +1 -0
- package/dist/claude-setup.js +22 -3
- package/dist/claude-setup.js.map +1 -1
- package/dist/cli.js +19 -60
- package/dist/cli.js.map +1 -1
- package/dist/encryption.d.ts +15 -0
- package/dist/encryption.js +92 -5
- package/dist/encryption.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/migrate.d.ts +1 -0
- package/dist/migrate.js +146 -47
- package/dist/migrate.js.map +1 -1
- package/dist/offline.js +15 -1
- package/dist/offline.js.map +1 -1
- package/dist/openclaw-setup.js +33 -9
- package/dist/openclaw-setup.js.map +1 -1
- package/dist/path-utils.d.ts +10 -0
- package/dist/path-utils.js +28 -0
- package/dist/path-utils.js.map +1 -1
- package/dist/types.d.ts +35 -1
- package/package.json +3 -3
- package/dist/agent-skill.d.ts +0 -150
- package/dist/agent-skill.js +0 -152
- package/dist/agent-skill.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw-setup.js","sourceRoot":"","sources":["../src/openclaw-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
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AAC;yBAAM,CAAC;wBACN,6CAA6C;wBAC7C,YAAY,CACV,CAAC,OAAO,EAAE,6BAA6B,EAAE,WAAW,EAAE,UAAU,YAAY,EAAE,CAAC,EAC/E,SAAS,CACV,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;QACnE,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAwC,CAAC;IACzE,MAAM,OAAO,GAAG,OAAO,EAAE,CAAC,SAAS,CAAwD,CAAC;IAC5F,MAAM,KAAK,GAAG,OAAO,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC1C,IAAI,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrB,KAAK,CAAC,QAAQ,CAA6B,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QAC1F,mFAAmF;QACnF,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AACrC,CAAC"}
|
package/dist/path-utils.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* Write a file atomically: serialize to a temp file in the SAME directory, then
|
|
4
|
+
* rename it over the target. `rename(2)` within one filesystem is atomic, so a
|
|
5
|
+
* crash / ENOSPC / Ctrl-C mid-write leaves either the old file or the temp file
|
|
6
|
+
* (which is cleaned up) intact — never a truncated destination. Use this for
|
|
7
|
+
* irreplaceable user config (~/.claude.json, openclaw.json) where a half-written
|
|
8
|
+
* file would corrupt state the user can't otherwise recover.
|
|
9
|
+
*/
|
|
10
|
+
export declare function atomicWriteFileSync(targetPath: string, data: string | NodeJS.ArrayBufferView, options?: fs.WriteFileOptions): void;
|
|
1
11
|
/**
|
|
2
12
|
* Resolve a relative path against a base directory and verify
|
|
3
13
|
* the result does not escape the base via traversal (e.g. `../`).
|
package/dist/path-utils.js
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
1
2
|
import * as path from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* Write a file atomically: serialize to a temp file in the SAME directory, then
|
|
5
|
+
* rename it over the target. `rename(2)` within one filesystem is atomic, so a
|
|
6
|
+
* crash / ENOSPC / Ctrl-C mid-write leaves either the old file or the temp file
|
|
7
|
+
* (which is cleaned up) intact — never a truncated destination. Use this for
|
|
8
|
+
* irreplaceable user config (~/.claude.json, openclaw.json) where a half-written
|
|
9
|
+
* file would corrupt state the user can't otherwise recover.
|
|
10
|
+
*/
|
|
11
|
+
export function atomicWriteFileSync(targetPath, data, options) {
|
|
12
|
+
const dir = path.dirname(targetPath);
|
|
13
|
+
const tmpPath = path.join(dir, `.${path.basename(targetPath)}.${process.pid}.tmp`);
|
|
14
|
+
try {
|
|
15
|
+
fs.writeFileSync(tmpPath, data, options);
|
|
16
|
+
fs.renameSync(tmpPath, targetPath);
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
// Best-effort cleanup so a failed write doesn't leave a stray temp file.
|
|
20
|
+
try {
|
|
21
|
+
if (fs.existsSync(tmpPath))
|
|
22
|
+
fs.unlinkSync(tmpPath);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
/* ignore cleanup errors */
|
|
26
|
+
}
|
|
27
|
+
throw err;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
2
30
|
/**
|
|
3
31
|
* Resolve a relative path against a base directory and verify
|
|
4
32
|
* the result does not escape the base via traversal (e.g. `../`).
|
package/dist/path-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.js","sourceRoot":"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C"}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,6 +20,11 @@ export interface OperatorPermissions {
|
|
|
20
20
|
callsPerMinute: bigint;
|
|
21
21
|
/** Bulk backup export (pull/list/metadata). Candid opt: [] = none. */
|
|
22
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[]];
|
|
23
28
|
}
|
|
24
29
|
export interface OperatorRecord {
|
|
25
30
|
principal: Principal;
|
|
@@ -53,6 +58,18 @@ export interface MemoryFileInfo {
|
|
|
53
58
|
version: bigint;
|
|
54
59
|
lastModifiedAt: bigint;
|
|
55
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Result of `startSession()` — the engram's memory assembled for injection at the start of an agent
|
|
63
|
+
* session. `files` are newest-modified first and decrypted; `truncated` is true when the byte cap was
|
|
64
|
+
* hit and older files were left out (page them with `readMemoryBatch`).
|
|
65
|
+
*/
|
|
66
|
+
export interface SessionContext {
|
|
67
|
+
files: MemoryFile[];
|
|
68
|
+
includedFiles: number;
|
|
69
|
+
totalFiles: number;
|
|
70
|
+
totalBytes: number;
|
|
71
|
+
truncated: boolean;
|
|
72
|
+
}
|
|
56
73
|
/** Internal wire type — raw snapshot bytes from canister (plaintext; see encryption.ts) */
|
|
57
74
|
export interface RawMemoryVersion {
|
|
58
75
|
version: bigint;
|
|
@@ -122,7 +139,6 @@ export interface EngramRecord {
|
|
|
122
139
|
owner: Principal;
|
|
123
140
|
canisterId: Principal;
|
|
124
141
|
createdAt: bigint;
|
|
125
|
-
lastTopUp: bigint;
|
|
126
142
|
status: EngramRecordStatus;
|
|
127
143
|
}
|
|
128
144
|
/** @deprecated Use EngramRecord instead */
|
|
@@ -137,6 +153,11 @@ export interface GuardianPermissions {
|
|
|
137
153
|
canRevokeOperators: boolean;
|
|
138
154
|
canFreezePayments: boolean;
|
|
139
155
|
canPauseWrites: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* The Bools above are FROZEN — every FUTURE permission is a scope string here
|
|
158
|
+
* (converges with OAuth scope names). Candid opt: [] = no extended scopes.
|
|
159
|
+
*/
|
|
160
|
+
scopes: [] | [string[]];
|
|
140
161
|
}
|
|
141
162
|
export interface GuardianRecord {
|
|
142
163
|
principal: Principal;
|
|
@@ -152,6 +173,10 @@ export type SessionStatus = {
|
|
|
152
173
|
closed: null;
|
|
153
174
|
} | {
|
|
154
175
|
expired: null;
|
|
176
|
+
}
|
|
177
|
+
/** Reserved catch-all: a future ic402 status arrives as `other`, never as a new tag. */
|
|
178
|
+
| {
|
|
179
|
+
other: string;
|
|
155
180
|
};
|
|
156
181
|
export interface Eip3009Authorization {
|
|
157
182
|
from: string;
|
|
@@ -261,6 +286,8 @@ export type AccessGrantResult = {
|
|
|
261
286
|
};
|
|
262
287
|
export interface ContentDelivery {
|
|
263
288
|
grant: AccessGrant;
|
|
289
|
+
/** EVM settle tx hash when the purchase settled on-chain (null-opt otherwise). */
|
|
290
|
+
settlementTxHash: [string] | [];
|
|
264
291
|
delivery: {
|
|
265
292
|
inline: Uint8Array;
|
|
266
293
|
} | {
|
|
@@ -293,10 +320,16 @@ export type PaymentResult = {
|
|
|
293
320
|
networkNotSupported: string;
|
|
294
321
|
} | {
|
|
295
322
|
settlementFailed: string;
|
|
323
|
+
} | {
|
|
324
|
+
settlementPending: string;
|
|
296
325
|
} | {
|
|
297
326
|
reputationTooLow: bigint;
|
|
298
327
|
} | {
|
|
299
328
|
depositBelowMinimum: bigint;
|
|
329
|
+
}
|
|
330
|
+
/** Reserved catch-all: a future ic402 result arrives as `other`, never as a new tag. */
|
|
331
|
+
| {
|
|
332
|
+
other: string;
|
|
300
333
|
};
|
|
301
334
|
export interface PaymentReceipt {
|
|
302
335
|
id: string;
|
|
@@ -367,6 +400,7 @@ export interface ApprovalRequest {
|
|
|
367
400
|
caller: Principal;
|
|
368
401
|
operation: string;
|
|
369
402
|
amount: bigint;
|
|
403
|
+
binding: string;
|
|
370
404
|
policyLimit: bigint;
|
|
371
405
|
policyField: string;
|
|
372
406
|
rationale: string;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engramx/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Client SDK for EngramX — persistent, decentralized memory for AI agents on ICP",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
6
|
"author": "EngramX <developer@engramx.ai>",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@icp-sdk/core": "^5.4.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@ic402/client": "^2.
|
|
53
|
+
"@ic402/client": "^2.9.0",
|
|
54
54
|
"@icp-sdk/core": "^5.4.0",
|
|
55
55
|
"@icp-sdk/vetkeys": "0.5.0-beta.0",
|
|
56
56
|
"cborg": "^5.1.1"
|
package/dist/agent-skill.d.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Skill: engramx
|
|
3
|
-
*
|
|
4
|
-
* Provides AI agents with tools to read/write persistent memory from an ICP
|
|
5
|
-
* engram canister. Works with any agent framework that supports tool/skill
|
|
6
|
-
* registration (OpenClaw, LangChain, etc.).
|
|
7
|
-
*
|
|
8
|
-
* Setup:
|
|
9
|
-
* 1. Install: pnpm add @engramx/client
|
|
10
|
-
* 2. Set environment variables:
|
|
11
|
-
* ENGRAM_CANISTER_ID=xxxxx-xxxxx-xxxxx-xxxxx-xxx (also checks VAULT_CANISTER_ID for migration)
|
|
12
|
-
* ENGRAM_SESSION_KEY_PATH=~/.engramx/session.key
|
|
13
|
-
* (also checks ENGRAMX_SESSION_KEY_PATH, VAULT_SESSION_KEY_PATH, and ~/.openclaw/vault-session.key for migration)
|
|
14
|
-
* 3. Add this skill to your agent's skill list
|
|
15
|
-
*/
|
|
16
|
-
export declare const name = "engramx";
|
|
17
|
-
export declare const description = "Persistent, decentralized memory storage for your agent";
|
|
18
|
-
export declare const tools: {
|
|
19
|
-
engram_read_memory: {
|
|
20
|
-
description: string;
|
|
21
|
-
parameters: {
|
|
22
|
-
path: {
|
|
23
|
-
type: string;
|
|
24
|
-
description: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
execute: ({ path }: {
|
|
28
|
-
path: string;
|
|
29
|
-
}) => Promise<string>;
|
|
30
|
-
};
|
|
31
|
-
engram_append_memory: {
|
|
32
|
-
description: string;
|
|
33
|
-
parameters: {
|
|
34
|
-
path: {
|
|
35
|
-
type: string;
|
|
36
|
-
description: string;
|
|
37
|
-
};
|
|
38
|
-
content: {
|
|
39
|
-
type: string;
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
execute: ({ path, content }: {
|
|
44
|
-
path: string;
|
|
45
|
-
content: string;
|
|
46
|
-
}) => Promise<string>;
|
|
47
|
-
};
|
|
48
|
-
engram_list_memory: {
|
|
49
|
-
description: string;
|
|
50
|
-
parameters: {};
|
|
51
|
-
execute: () => Promise<string>;
|
|
52
|
-
};
|
|
53
|
-
engram_wallet_balance: {
|
|
54
|
-
description: string;
|
|
55
|
-
parameters: {};
|
|
56
|
-
execute: () => Promise<string>;
|
|
57
|
-
};
|
|
58
|
-
engram_payment_info: {
|
|
59
|
-
description: string;
|
|
60
|
-
parameters: {
|
|
61
|
-
amount: {
|
|
62
|
-
type: string;
|
|
63
|
-
description: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
execute: ({ amount }: {
|
|
67
|
-
amount: number;
|
|
68
|
-
}) => Promise<string>;
|
|
69
|
-
};
|
|
70
|
-
engram_get_profile: {
|
|
71
|
-
description: string;
|
|
72
|
-
parameters: {};
|
|
73
|
-
execute: () => Promise<string>;
|
|
74
|
-
};
|
|
75
|
-
engram_save_preference: {
|
|
76
|
-
description: string;
|
|
77
|
-
parameters: {
|
|
78
|
-
preference: {
|
|
79
|
-
type: string;
|
|
80
|
-
description: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
execute: ({ preference }: {
|
|
84
|
-
preference: string;
|
|
85
|
-
}) => Promise<string>;
|
|
86
|
-
};
|
|
87
|
-
engram_save_insight: {
|
|
88
|
-
description: string;
|
|
89
|
-
parameters: {
|
|
90
|
-
content: {
|
|
91
|
-
type: string;
|
|
92
|
-
description: string;
|
|
93
|
-
};
|
|
94
|
-
topic: {
|
|
95
|
-
type: string;
|
|
96
|
-
description: string;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
execute: ({ content, topic }: {
|
|
100
|
-
content: string;
|
|
101
|
-
topic?: string;
|
|
102
|
-
}) => Promise<string>;
|
|
103
|
-
};
|
|
104
|
-
engram_save_decision: {
|
|
105
|
-
description: string;
|
|
106
|
-
parameters: {
|
|
107
|
-
decision: {
|
|
108
|
-
type: string;
|
|
109
|
-
description: string;
|
|
110
|
-
};
|
|
111
|
-
rationale: {
|
|
112
|
-
type: string;
|
|
113
|
-
description: string;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
execute: ({ decision, rationale }: {
|
|
117
|
-
decision: string;
|
|
118
|
-
rationale: string;
|
|
119
|
-
}) => Promise<string>;
|
|
120
|
-
};
|
|
121
|
-
engram_session_summary: {
|
|
122
|
-
description: string;
|
|
123
|
-
parameters: {
|
|
124
|
-
platform: {
|
|
125
|
-
type: string;
|
|
126
|
-
description: string;
|
|
127
|
-
};
|
|
128
|
-
summary: {
|
|
129
|
-
type: string;
|
|
130
|
-
description: string;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
execute: ({ platform, summary }: {
|
|
134
|
-
platform: string;
|
|
135
|
-
summary: string;
|
|
136
|
-
}) => Promise<string>;
|
|
137
|
-
};
|
|
138
|
-
engram_read_sessions: {
|
|
139
|
-
description: string;
|
|
140
|
-
parameters: {
|
|
141
|
-
limit: {
|
|
142
|
-
type: string;
|
|
143
|
-
description: string;
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
execute: ({ limit }: {
|
|
147
|
-
limit?: number;
|
|
148
|
-
}) => Promise<string>;
|
|
149
|
-
};
|
|
150
|
-
};
|
package/dist/agent-skill.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Skill: engramx
|
|
3
|
-
*
|
|
4
|
-
* Provides AI agents with tools to read/write persistent memory from an ICP
|
|
5
|
-
* engram canister. Works with any agent framework that supports tool/skill
|
|
6
|
-
* registration (OpenClaw, LangChain, etc.).
|
|
7
|
-
*
|
|
8
|
-
* Setup:
|
|
9
|
-
* 1. Install: pnpm add @engramx/client
|
|
10
|
-
* 2. Set environment variables:
|
|
11
|
-
* ENGRAM_CANISTER_ID=xxxxx-xxxxx-xxxxx-xxxxx-xxx (also checks VAULT_CANISTER_ID for migration)
|
|
12
|
-
* ENGRAM_SESSION_KEY_PATH=~/.engramx/session.key
|
|
13
|
-
* (also checks ENGRAMX_SESSION_KEY_PATH, VAULT_SESSION_KEY_PATH, and ~/.openclaw/vault-session.key for migration)
|
|
14
|
-
* 3. Add this skill to your agent's skill list
|
|
15
|
-
*/
|
|
16
|
-
import { EngramClient } from './EngramClient';
|
|
17
|
-
import { ProfileManager } from './ProfileManager';
|
|
18
|
-
import { SessionManager } from './SessionManager';
|
|
19
|
-
const canisterId = process.env['ENGRAM_CANISTER_ID'] || process.env['VAULT_CANISTER_ID'];
|
|
20
|
-
if (!canisterId) {
|
|
21
|
-
throw new Error('ENGRAM_CANISTER_ID environment variable is required');
|
|
22
|
-
}
|
|
23
|
-
const sessionKeyPath = process.env['ENGRAM_SESSION_KEY_PATH'] ||
|
|
24
|
-
process.env['ENGRAMX_SESSION_KEY_PATH'] ||
|
|
25
|
-
process.env['VAULT_SESSION_KEY_PATH'];
|
|
26
|
-
if (!sessionKeyPath) {
|
|
27
|
-
throw new Error('ENGRAM_SESSION_KEY_PATH environment variable is required');
|
|
28
|
-
}
|
|
29
|
-
const engram = new EngramClient({
|
|
30
|
-
canisterId,
|
|
31
|
-
sessionKeyPath,
|
|
32
|
-
cacheMaxAge: 60000,
|
|
33
|
-
offlineQueuePath: process.env['ENGRAM_OFFLINE_QUEUE_PATH'] ||
|
|
34
|
-
process.env['VAULT_OFFLINE_QUEUE_PATH'] ||
|
|
35
|
-
undefined,
|
|
36
|
-
});
|
|
37
|
-
const profile = new ProfileManager(engram);
|
|
38
|
-
const sessions = new SessionManager(engram);
|
|
39
|
-
export const name = 'engramx';
|
|
40
|
-
export const description = 'Persistent, decentralized memory storage for your agent';
|
|
41
|
-
export const tools = {
|
|
42
|
-
engram_read_memory: {
|
|
43
|
-
description: 'Read a memory file from the engram (e.g., "MEMORY.md", "memory/2026-02-11.md")',
|
|
44
|
-
parameters: { path: { type: 'string', description: 'File path' } },
|
|
45
|
-
execute: async ({ path }) => {
|
|
46
|
-
const file = await engram.readMemory(path);
|
|
47
|
-
return file.content;
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
engram_append_memory: {
|
|
51
|
-
description: 'Append content to a memory file in the engram. Creates the file if it does not exist. Cannot modify owner-protected paths.',
|
|
52
|
-
parameters: {
|
|
53
|
-
path: { type: 'string', description: 'File path' },
|
|
54
|
-
content: { type: 'string', description: 'Content to append' },
|
|
55
|
-
},
|
|
56
|
-
execute: async ({ path, content }) => {
|
|
57
|
-
const version = await engram.appendMemory(path, content);
|
|
58
|
-
return `Appended to ${path} (version ${version})`;
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
engram_list_memory: {
|
|
62
|
-
description: 'List all memory files stored in the engram',
|
|
63
|
-
parameters: {},
|
|
64
|
-
execute: async () => {
|
|
65
|
-
const files = await engram.listMemoryFiles();
|
|
66
|
-
return files
|
|
67
|
-
.map((f) => `${f.path} (v${f.version}, modified ${new Date(Number(f.lastModifiedAt) / 1000000).toISOString()})`)
|
|
68
|
-
.join('\n');
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
engram_wallet_balance: {
|
|
72
|
-
description: 'Check the engram wallet balance',
|
|
73
|
-
parameters: {},
|
|
74
|
-
execute: async () => {
|
|
75
|
-
const balance = await engram.walletBalance();
|
|
76
|
-
return `Balance: ${Number(balance) / 100000000} ICP`;
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
engram_payment_info: {
|
|
80
|
-
description: 'Get x402 payment requirements for accessing engram memory. Returns pricing and accepted payment methods.',
|
|
81
|
-
parameters: {
|
|
82
|
-
amount: { type: 'number', description: 'Amount in USDC e6s (1000 = $0.001)' },
|
|
83
|
-
},
|
|
84
|
-
execute: async ({ amount }) => {
|
|
85
|
-
const requirements = await engram.getPaymentRequirements(BigInt(amount));
|
|
86
|
-
return `Payment requirements (${requirements.length} options):\n${JSON.stringify(requirements, (_, v) => (typeof v === 'bigint' ? v.toString() : v), 2)}`;
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
// ── Schema-aware tools (ProfileManager / SessionManager) ────
|
|
90
|
-
engram_get_profile: {
|
|
91
|
-
description: 'Load user identity (soul, user, preferences) and accumulated lessons in one call. Use at session start.',
|
|
92
|
-
parameters: {},
|
|
93
|
-
execute: async () => {
|
|
94
|
-
const p = await profile.getProfile();
|
|
95
|
-
return JSON.stringify(p, null, 2);
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
engram_save_preference: {
|
|
99
|
-
description: 'Save a user preference (e.g. "prefers terse responses"). Persists across platforms.',
|
|
100
|
-
parameters: {
|
|
101
|
-
preference: { type: 'string', description: 'The preference to save' },
|
|
102
|
-
},
|
|
103
|
-
execute: async ({ preference }) => {
|
|
104
|
-
const version = await profile.savePreference(preference);
|
|
105
|
-
return `Preference saved (version ${version})`;
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
engram_save_insight: {
|
|
109
|
-
description: 'Save a lesson or insight. Optionally provide a topic for domain-specific knowledge.',
|
|
110
|
-
parameters: {
|
|
111
|
-
content: { type: 'string', description: 'The insight to save' },
|
|
112
|
-
topic: { type: 'string', description: 'Optional domain topic (lowercase, alphanumeric)' },
|
|
113
|
-
},
|
|
114
|
-
execute: async ({ content, topic }) => {
|
|
115
|
-
const version = await profile.saveInsight({ content, topic });
|
|
116
|
-
return `Insight saved${topic ? ` (topic: ${topic})` : ''} (version ${version})`;
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
engram_save_decision: {
|
|
120
|
-
description: 'Record a decision and its rationale for future cross-platform reference.',
|
|
121
|
-
parameters: {
|
|
122
|
-
decision: { type: 'string', description: 'What was decided' },
|
|
123
|
-
rationale: { type: 'string', description: 'Why this decision was made' },
|
|
124
|
-
},
|
|
125
|
-
execute: async ({ decision, rationale }) => {
|
|
126
|
-
const version = await profile.saveDecision(decision, rationale);
|
|
127
|
-
return `Decision recorded (version ${version})`;
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
engram_session_summary: {
|
|
131
|
-
description: 'Write a session summary for today. Other platforms can read this for continuity.',
|
|
132
|
-
parameters: {
|
|
133
|
-
platform: { type: 'string', description: 'Platform name (e.g. "openclaw")' },
|
|
134
|
-
summary: { type: 'string', description: 'Summary of what was accomplished' },
|
|
135
|
-
},
|
|
136
|
-
execute: async ({ platform, summary }) => {
|
|
137
|
-
const version = await sessions.writeSummary(platform, summary);
|
|
138
|
-
return `Session summary saved for ${platform} (version ${version})`;
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
engram_read_sessions: {
|
|
142
|
-
description: 'Read recent session summaries across platforms for continuity.',
|
|
143
|
-
parameters: {
|
|
144
|
-
limit: { type: 'number', description: 'Max sessions to return (default: 5)' },
|
|
145
|
-
},
|
|
146
|
-
execute: async ({ limit }) => {
|
|
147
|
-
const result = await sessions.readRecent(limit ?? 5);
|
|
148
|
-
return JSON.stringify(result, null, 2);
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
//# sourceMappingURL=agent-skill.js.map
|
package/dist/agent-skill.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-skill.js","sourceRoot":"","sources":["../src/agent-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACzF,IAAI,CAAC,UAAU,EAAE,CAAC;IAChB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;AACxC,IAAI,CAAC,cAAc,EAAE,CAAC;IACpB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC;IAC9B,UAAU;IACV,cAAc;IACd,WAAW,EAAE,KAAM;IACnB,gBAAgB,EACd,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;QACvC,SAAS;CACZ,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AAE5C,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAA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