@atbash/sdk 0.10.0-dev.0 → 0.10.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/index.d.ts CHANGED
@@ -1,10 +1,20 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+
4
+ /**
5
+ * Which binding artifact the generated loader actually loaded: `'native'` for
6
+ * a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
7
+ * flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
8
+ * can point the loader at a WASI artifact this package does not build itself.
9
+ */
10
+ export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
11
+
3
12
  export interface AddAgentMemoryArgsJs {
4
13
  agent_pubkey: Buffer
5
14
  content_cipher: Buffer
6
15
  nonce: Buffer
7
16
  score: number
17
+ file_path: string
8
18
  }
9
19
 
10
20
  export interface AgentAuthJs {
@@ -14,27 +24,32 @@ export interface AgentAuthJs {
14
24
 
15
25
  export interface AgentPubkeyOnlyQueryJs {
16
26
  agent_pubkey_hex: string
27
+ file_path?: string
17
28
  }
18
29
 
19
- export const ARG_AGENT_PUBKEY: string
30
+ export declare function applyMemoryEdits(current: string, edits: Array<MemoryEditJs>): string
31
+
32
+ export declare const ARG_AGENT_PUBKEY: string
20
33
 
21
- export const ARG_ID: string
34
+ export declare const ARG_FILE_PATH: string
22
35
 
23
- export declare function buildAddAgentMemoryArgs(agentPubkeyHex: string, contentCipher: Buffer, nonce: Buffer, score: number): AddAgentMemoryArgsJs
36
+ export declare const ARG_ID: string
37
+
38
+ export declare function buildAddAgentMemoryArgs(agentPubkeyHex: string, contentCipher: Buffer, nonce: Buffer, score: number, filePath: string): AddAgentMemoryArgsJs
24
39
 
25
40
  export declare function buildEncryptedToolcallArgs(toolCallId: string, action: string, context: string, toolName: string, toolArgsJson: string, orgEncryptionPubKeyHex: string): EncryptedToolCallArgsJs
26
41
 
27
- export declare function buildGetActiveMemoryIdQuery(agentPubkeyHex: string): AgentPubkeyOnlyQueryJs
42
+ export declare function buildGetActiveAgentMemoryQuery(agentPubkeyHex: string, filePath?: string | undefined | null): AgentPubkeyOnlyQueryJs
28
43
 
29
- export declare function buildGetAgentMemoryByIdQuery(agentPubkeyHex: string, id: number): MemoryByIdQueryJs
44
+ export declare function buildGetActiveMemoryIdQuery(agentPubkeyHex: string, filePath?: string | undefined | null): AgentPubkeyOnlyQueryJs
30
45
 
31
- export declare function buildGetAgentMemoryHistoryQuery(agentPubkeyHex: string): AgentPubkeyOnlyQueryJs
46
+ export declare function buildGetAgentMemoryByIdQuery(agentPubkeyHex: string, id: number): MemoryByIdQueryJs
32
47
 
33
- export declare function buildGetAgentMemoryQuery(agentPubkeyHex: string): AgentPubkeyOnlyQueryJs
48
+ export declare function buildGetAgentMemoryHistoryQuery(agentPubkeyHex: string, filePath?: string | undefined | null): AgentPubkeyOnlyQueryJs
34
49
 
35
- export declare function buildGetAgentMemoryRollbackHistoryQuery(agentPubkeyHex: string): AgentPubkeyOnlyQueryJs
50
+ export declare function buildGetAgentMemoryRollbackHistoryQuery(agentPubkeyHex: string, filePath?: string | undefined | null): AgentPubkeyOnlyQueryJs
36
51
 
37
- export declare function buildGetAllAgentMemoryQuery(agentPubkeyHex: string): AgentPubkeyOnlyQueryJs
52
+ export declare function buildGetRecentAgentMemoryQuery(agentPubkeyHex: string, filePath?: string | undefined | null): AgentPubkeyOnlyQueryJs
38
53
 
39
54
  export declare function buildRollbackAgentMemoryArgs(agentPubkeyHex: string, toId: number, reason: string): RollbackAgentMemoryArgsJs
40
55
 
@@ -73,11 +88,13 @@ export declare function decryptForOrg(payload: Buffer, orgPrivKeyHex: string, aa
73
88
 
74
89
  export declare function decryptMemoryContent(ciphertext: Buffer, nonce: Buffer, key: Buffer): string
75
90
 
76
- export const DEFAULT_BLOCKCHAIN_RID: string
91
+ export declare const DEFAULT_BLOCKCHAIN_RID: string
92
+
93
+ export declare const DEFAULT_ENDPOINT: string
77
94
 
78
- export const DEFAULT_ENDPOINT: string
95
+ export declare const DEFAULT_PRIVATE_BLOCKCHAIN_RID: string
79
96
 
80
- export const DEFAULT_PRIVATE_BLOCKCHAIN_RID: string
97
+ export declare function defaultAgentHomeDirs(): Array<string>
81
98
 
82
99
  export declare function defaultChromiaNodeUrls(): Array<string>
83
100
 
@@ -97,7 +114,7 @@ export declare function derivePublicKey(s: string): string
97
114
 
98
115
  export declare function diffMemorySnapshots(before: MemorySnapshotJs, after: MemorySnapshotJs): MemoryDiffResultJs
99
116
 
100
- export const ECIES_FORMAT_VERSION: number
117
+ export declare const ECIES_FORMAT_VERSION: number
101
118
 
102
119
  export declare function encryptedLength(plaintextByteLength: number): number
103
120
 
@@ -106,24 +123,26 @@ export interface EncryptedMemoryJs {
106
123
  nonce: Buffer
107
124
  }
108
125
 
126
+ /** Columns of `log_tool_call` — `tool_name` stays readable for filtering. */
109
127
  export interface EncryptedToolCallArgsJs {
110
128
  tool_call_id: string
129
+ action_text: string
130
+ action_context: string
111
131
  tool_name: string
112
- content_cipher: Buffer
113
- action_hash: string
114
- encryption_key_ref: Buffer
115
- claim_hash: string
132
+ tool_args_json: string
116
133
  }
117
134
 
118
135
  export declare function encryptForOrg(plaintext: string, orgPubKeyHex: string, aad: string, domain?: string | undefined | null): Buffer
119
136
 
120
137
  export declare function encryptMemoryContent(plaintext: string, key: Buffer): EncryptedMemoryJs
121
138
 
139
+ export declare function extractMemoryEdits(event: any, ctx: any): Array<MemoryEditJs>
140
+
122
141
  export declare function formatEntryForScan(entry: MemoryEntryJs, hasEvasion: boolean): string
123
142
 
124
143
  export declare function generateKeypair(): KeyPairJs
125
144
 
126
- export const HONEYCOMB_KEY: string
145
+ export declare function isSafeMemorySlot(slot: string): boolean
127
146
 
128
147
  export declare function isValidPrivateKey(s: string): boolean
129
148
 
@@ -165,6 +184,11 @@ export interface MemoryDiffResultJs {
165
184
  anomalies: Array<MemoryAnomalyJs>
166
185
  }
167
186
 
187
+ export interface MemoryEditJs {
188
+ old_text: string
189
+ new_text: string
190
+ }
191
+
168
192
  export interface MemoryEntryJs {
169
193
  key: string
170
194
  value: string
@@ -174,6 +198,8 @@ export interface MemoryEntryJs {
174
198
 
175
199
  export declare function memoryScanContext(): string
176
200
 
201
+ export declare function memorySlotForPath(path: string, userHome: string, root?: string | undefined | null, extraHomes?: Array<string> | undefined | null): string | null
202
+
177
203
  export interface MemorySnapshotJs {
178
204
  entries: Array<MemoryEntryJs>
179
205
  takenAt: number
@@ -189,11 +215,11 @@ export declare function normalizeActionForHash(action: string): string
189
215
 
190
216
  export declare function normalizeForMatching(s: string): string
191
217
 
192
- export const OP_ADD_AGENT_MEMORY: string
218
+ export declare const OP_ADD_AGENT_MEMORY: string
193
219
 
194
- export const OP_LOG_ENCRYPTED_TOOL_CALL: string
220
+ export declare const OP_LOG_TOOL_CALL: string
195
221
 
196
- export const OP_ROLLBACK_AGENT_MEMORY: string
222
+ export declare const OP_ROLLBACK_AGENT_MEMORY: string
197
223
 
198
224
  export declare function parseActiveMemoryId(value: any): number | null
199
225
 
@@ -214,20 +240,21 @@ export declare function parseRollbackRows(value: any): Array<RawRollbackRowJs>
214
240
 
215
241
  export declare function parseScoreFromReason(reason: string): ParsedScoreJs
216
242
 
217
- export const QUERY_GET_ACTIVE_MEMORY_ID: string
243
+ export declare const QUERY_GET_ACTIVE_AGENT_MEMORY: string
218
244
 
219
- export const QUERY_GET_AGENT_MEMORY: string
245
+ export declare const QUERY_GET_ACTIVE_MEMORY_ID: string
220
246
 
221
- export const QUERY_GET_AGENT_MEMORY_BY_ID: string
247
+ export declare const QUERY_GET_AGENT_MEMORY_BY_ID: string
222
248
 
223
- export const QUERY_GET_AGENT_MEMORY_HISTORY: string
249
+ export declare const QUERY_GET_AGENT_MEMORY_HISTORY: string
224
250
 
225
- export const QUERY_GET_AGENT_MEMORY_ROLLBACK_HISTORY: string
251
+ export declare const QUERY_GET_AGENT_MEMORY_ROLLBACK_HISTORY: string
226
252
 
227
- export const QUERY_GET_ALL_AGENT_MEMORY: string
253
+ export declare const QUERY_GET_RECENT_AGENT_MEMORY: string
228
254
 
229
255
  export interface RawMemoryRowJs {
230
256
  id: number
257
+ file_path: string
231
258
  content_cipher: Buffer
232
259
  nonce: Buffer
233
260
  score: number
@@ -239,6 +266,7 @@ export interface RawMemoryRowJs {
239
266
  export interface RawRollbackRowJs {
240
267
  from_id: number
241
268
  to_id: number
269
+ file_path: string
242
270
  reason: string
243
271
  signer: Buffer
244
272
  created_at: number
@@ -269,14 +297,20 @@ export interface SecretMatchJs {
269
297
  length: number
270
298
  }
271
299
 
300
+ export declare function signAddAgentMemory(agentPubkeyHex: string, contentCipher: Buffer, nonce: Buffer, score: number, filePath: string, privkey: string, blockchainRid: string): string
301
+
272
302
  export declare function signEncryptedToolCall(toolCallId: string, action: string, context: string, toolName: string, toolArgsJson: string, orgEncryptionPubKeyHex: string, privkeyHex: string, blockchainRidHex: string): string
273
303
 
274
304
  export declare function signJudgeAction(judgmentId: string, action: string, context: string, extra: string, privkey: string, blockchainRid: string): string
275
305
 
276
306
  export declare function signLogToolCall(toolCallId: string, action: string, context: string, toolName: string, toolArgsJson: string, privkey: string, blockchainRid: string): string
277
307
 
308
+ export declare function signRollbackAgentMemory(agentPubkeyHex: string, toId: number, reason: string, privkey: string, blockchainRid: string): string
309
+
278
310
  export declare function validateAgentPubkeyHex(pubkeyHex: string): Buffer
279
311
 
312
+ export declare function validateFilePath(filePath: string): string
313
+
280
314
  export declare function validateMemoryId(id: number): void
281
315
 
282
316
  export declare function validateMemoryNonce(nonce: Buffer): void