@atbash/sdk 0.14.1-dev.0 → 0.15.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.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Helpers for the SDK's own tests, published as `@atbash/sdk/testing` and kept
3
+ * out of the main entry: fixing the call ids in production would let an old
4
+ * signed reply pass as the answer to a new call.
5
+ */
6
+ /**
7
+ * Fix the ids the client generates, handed out in turn, so a test can serve a
8
+ * judge reply signed for them. A judge call takes two: its call id, then its
9
+ * judgment id.
10
+ *
11
+ * @param ids - One id or several, used in turn; `undefined` restores random ids.
12
+ */
13
+ declare function setToolCallIdForTests(ids: string | readonly string[] | undefined): void;
14
+
15
+ export { setToolCallIdForTests };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Helpers for the SDK's own tests, published as `@atbash/sdk/testing` and kept
3
+ * out of the main entry: fixing the call ids in production would let an old
4
+ * signed reply pass as the answer to a new call.
5
+ */
6
+ /**
7
+ * Fix the ids the client generates, handed out in turn, so a test can serve a
8
+ * judge reply signed for them. A judge call takes two: its call id, then its
9
+ * judgment id.
10
+ *
11
+ * @param ids - One id or several, used in turn; `undefined` restores random ids.
12
+ */
13
+ declare function setToolCallIdForTests(ids: string | readonly string[] | undefined): void;
14
+
15
+ export { setToolCallIdForTests };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src-ts/testing.ts
21
+ var testing_exports = {};
22
+ __export(testing_exports, {
23
+ setToolCallIdForTests: () => setToolCallIdForTests
24
+ });
25
+ module.exports = __toCommonJS(testing_exports);
26
+ var TOOL_CALL_IDS_FOR_TESTS = /* @__PURE__ */ Symbol.for("@atbash/sdk.toolCallIdsForTests");
27
+ function setToolCallIdForTests(ids) {
28
+ globalThis[TOOL_CALL_IDS_FOR_TESTS] = ids === void 0 ? void 0 : { ids: typeof ids === "string" ? [ids] : [...ids], next: 0 };
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ setToolCallIdForTests
33
+ });
@@ -0,0 +1,8 @@
1
+ // src-ts/testing.ts
2
+ var TOOL_CALL_IDS_FOR_TESTS = /* @__PURE__ */ Symbol.for("@atbash/sdk.toolCallIdsForTests");
3
+ function setToolCallIdForTests(ids) {
4
+ globalThis[TOOL_CALL_IDS_FOR_TESTS] = ids === void 0 ? void 0 : { ids: typeof ids === "string" ? [ids] : [...ids], next: 0 };
5
+ }
6
+ export {
7
+ setToolCallIdForTests
8
+ };
package/index.d.ts CHANGED
@@ -27,6 +27,8 @@ export interface AgentPubkeyOnlyQueryJs {
27
27
  file_path?: string
28
28
  }
29
29
 
30
+ export declare function applyMemoryEdits(current: string, edits: Array<MemoryEditJs>): string
31
+
30
32
  export declare const ARG_AGENT_PUBKEY: string
31
33
 
32
34
  export declare const ARG_FILE_PATH: string
@@ -86,13 +88,11 @@ export declare function decryptForOrg(payload: Buffer, orgPrivKeyHex: string, aa
86
88
 
87
89
  export declare function decryptMemoryContent(ciphertext: Buffer, nonce: Buffer, key: Buffer): string
88
90
 
89
- export declare const DEFAULT_BLOCKCHAIN_RID: string
90
-
91
91
  export declare const DEFAULT_ENDPOINT: string
92
92
 
93
93
  export declare const DEFAULT_PRIVATE_BLOCKCHAIN_RID: string
94
94
 
95
- export declare function defaultChromiaNodeUrls(): Array<string>
95
+ export declare function defaultAgentHomeDirs(): Array<string>
96
96
 
97
97
  export declare function defaultMemoryPathPatterns(): Array<string>
98
98
 
@@ -132,10 +132,14 @@ export declare function encryptForOrg(plaintext: string, orgPubKeyHex: string, a
132
132
 
133
133
  export declare function encryptMemoryContent(plaintext: string, key: Buffer): EncryptedMemoryJs
134
134
 
135
+ export declare function extractMemoryEdits(event: any, ctx: any): Array<MemoryEditJs>
136
+
135
137
  export declare function formatEntryForScan(entry: MemoryEntryJs, hasEvasion: boolean): string
136
138
 
137
139
  export declare function generateKeypair(): KeyPairJs
138
140
 
141
+ export declare function isSafeMemorySlot(slot: string): boolean
142
+
139
143
  export declare function isValidPrivateKey(s: string): boolean
140
144
 
141
145
  export interface JudgeSignatureCheckJs {
@@ -176,6 +180,11 @@ export interface MemoryDiffResultJs {
176
180
  anomalies: Array<MemoryAnomalyJs>
177
181
  }
178
182
 
183
+ export interface MemoryEditJs {
184
+ old_text: string
185
+ new_text: string
186
+ }
187
+
179
188
  export interface MemoryEntryJs {
180
189
  key: string
181
190
  value: string
@@ -185,6 +194,8 @@ export interface MemoryEntryJs {
185
194
 
186
195
  export declare function memoryScanContext(): string
187
196
 
197
+ export declare function memorySlotForPath(path: string, userHome: string, root?: string | undefined | null, extraHomes?: Array<string> | undefined | null): string | null
198
+
188
199
  export interface MemorySnapshotJs {
189
200
  entries: Array<MemoryEntryJs>
190
201
  takenAt: number
@@ -225,6 +236,9 @@ export declare function parseRollbackRows(value: any): Array<RawRollbackRowJs>
225
236
 
226
237
  export declare function parseScoreFromReason(reason: string): ParsedScoreJs
227
238
 
239
+ /** The response-signing pubkeys pinned for a judge host; empty when it has none. */
240
+ export declare function pinnedJudgeVerifyKeys(host: string): Array<string>
241
+
228
242
  export declare const QUERY_GET_ACTIVE_AGENT_MEMORY: string
229
243
 
230
244
  export declare const QUERY_GET_ACTIVE_MEMORY_ID: string
@@ -282,12 +296,16 @@ export interface SecretMatchJs {
282
296
  length: number
283
297
  }
284
298
 
299
+ export declare function signAddAgentMemory(agentPubkeyHex: string, contentCipher: Buffer, nonce: Buffer, score: number, filePath: string, privkey: string, blockchainRid: string): string
300
+
285
301
  export declare function signEncryptedToolCall(toolCallId: string, action: string, context: string, toolName: string, toolArgsJson: string, orgEncryptionPubKeyHex: string, privkeyHex: string, blockchainRidHex: string): string
286
302
 
287
303
  export declare function signJudgeAction(judgmentId: string, action: string, context: string, extra: string, privkey: string, blockchainRid: string): string
288
304
 
289
305
  export declare function signLogToolCall(toolCallId: string, action: string, context: string, toolName: string, toolArgsJson: string, privkey: string, blockchainRid: string): string
290
306
 
307
+ export declare function signRollbackAgentMemory(agentPubkeyHex: string, toId: number, reason: string, privkey: string, blockchainRid: string): string
308
+
291
309
  export declare function validateAgentPubkeyHex(pubkeyHex: string): Buffer
292
310
 
293
311
  export declare function validateFilePath(filePath: string): string
package/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  /* eslint-disable */
2
2
  // @ts-nocheck
3
3
  /* auto-generated by NAPI-RS */
4
+ // Every version check below is bumped by release-please (extra-files, generic
5
+ // updater) in the same release PR as package.json; keep them inside this block.
6
+ // x-release-please-start-version
4
7
 
5
8
  const { readFileSync } = require('fs')
6
9
  let nativeBinding = null
@@ -89,8 +92,8 @@ function requireNative() {
89
92
  try {
90
93
  const binding = require('@atbash/sdk-android-arm64')
91
94
  const bindingPackageVersion = require('@atbash/sdk-android-arm64/package.json').version
92
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
93
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
95
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
96
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
94
97
  }
95
98
  return binding
96
99
  } catch (e) {
@@ -105,8 +108,8 @@ function requireNative() {
105
108
  try {
106
109
  const binding = require('@atbash/sdk-android-arm-eabi')
107
110
  const bindingPackageVersion = require('@atbash/sdk-android-arm-eabi/package.json').version
108
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
109
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
111
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
112
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
110
113
  }
111
114
  return binding
112
115
  } catch (e) {
@@ -126,8 +129,8 @@ function requireNative() {
126
129
  try {
127
130
  const binding = require('@atbash/sdk-win32-x64-gnu')
128
131
  const bindingPackageVersion = require('@atbash/sdk-win32-x64-gnu/package.json').version
129
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
130
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
132
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
133
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
131
134
  }
132
135
  return binding
133
136
  } catch (e) {
@@ -142,8 +145,8 @@ function requireNative() {
142
145
  try {
143
146
  const binding = require('@atbash/sdk-win32-x64-msvc')
144
147
  const bindingPackageVersion = require('@atbash/sdk-win32-x64-msvc/package.json').version
145
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
146
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
148
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
149
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
147
150
  }
148
151
  return binding
149
152
  } catch (e) {
@@ -159,8 +162,8 @@ function requireNative() {
159
162
  try {
160
163
  const binding = require('@atbash/sdk-win32-ia32-msvc')
161
164
  const bindingPackageVersion = require('@atbash/sdk-win32-ia32-msvc/package.json').version
162
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
163
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
165
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
166
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
164
167
  }
165
168
  return binding
166
169
  } catch (e) {
@@ -175,8 +178,8 @@ function requireNative() {
175
178
  try {
176
179
  const binding = require('@atbash/sdk-win32-arm64-msvc')
177
180
  const bindingPackageVersion = require('@atbash/sdk-win32-arm64-msvc/package.json').version
178
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
179
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
181
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
182
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
180
183
  }
181
184
  return binding
182
185
  } catch (e) {
@@ -194,8 +197,8 @@ function requireNative() {
194
197
  try {
195
198
  const binding = require('@atbash/sdk-darwin-universal')
196
199
  const bindingPackageVersion = require('@atbash/sdk-darwin-universal/package.json').version
197
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
198
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
200
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
201
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
199
202
  }
200
203
  return binding
201
204
  } catch (e) {
@@ -210,8 +213,8 @@ function requireNative() {
210
213
  try {
211
214
  const binding = require('@atbash/sdk-darwin-x64')
212
215
  const bindingPackageVersion = require('@atbash/sdk-darwin-x64/package.json').version
213
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
214
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
216
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
217
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
215
218
  }
216
219
  return binding
217
220
  } catch (e) {
@@ -226,8 +229,8 @@ function requireNative() {
226
229
  try {
227
230
  const binding = require('@atbash/sdk-darwin-arm64')
228
231
  const bindingPackageVersion = require('@atbash/sdk-darwin-arm64/package.json').version
229
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
230
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
232
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
233
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
231
234
  }
232
235
  return binding
233
236
  } catch (e) {
@@ -246,8 +249,8 @@ function requireNative() {
246
249
  try {
247
250
  const binding = require('@atbash/sdk-freebsd-x64')
248
251
  const bindingPackageVersion = require('@atbash/sdk-freebsd-x64/package.json').version
249
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
250
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
252
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
253
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
251
254
  }
252
255
  return binding
253
256
  } catch (e) {
@@ -262,8 +265,8 @@ function requireNative() {
262
265
  try {
263
266
  const binding = require('@atbash/sdk-freebsd-arm64')
264
267
  const bindingPackageVersion = require('@atbash/sdk-freebsd-arm64/package.json').version
265
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
266
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
268
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
269
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
267
270
  }
268
271
  return binding
269
272
  } catch (e) {
@@ -283,8 +286,8 @@ function requireNative() {
283
286
  try {
284
287
  const binding = require('@atbash/sdk-linux-x64-musl')
285
288
  const bindingPackageVersion = require('@atbash/sdk-linux-x64-musl/package.json').version
286
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
287
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
289
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
290
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
288
291
  }
289
292
  return binding
290
293
  } catch (e) {
@@ -299,8 +302,8 @@ function requireNative() {
299
302
  try {
300
303
  const binding = require('@atbash/sdk-linux-x64-gnu')
301
304
  const bindingPackageVersion = require('@atbash/sdk-linux-x64-gnu/package.json').version
302
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
303
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
305
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
306
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
304
307
  }
305
308
  return binding
306
309
  } catch (e) {
@@ -317,8 +320,8 @@ function requireNative() {
317
320
  try {
318
321
  const binding = require('@atbash/sdk-linux-arm64-musl')
319
322
  const bindingPackageVersion = require('@atbash/sdk-linux-arm64-musl/package.json').version
320
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
321
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
323
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
324
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
322
325
  }
323
326
  return binding
324
327
  } catch (e) {
@@ -333,8 +336,8 @@ function requireNative() {
333
336
  try {
334
337
  const binding = require('@atbash/sdk-linux-arm64-gnu')
335
338
  const bindingPackageVersion = require('@atbash/sdk-linux-arm64-gnu/package.json').version
336
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
337
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
339
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
340
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
338
341
  }
339
342
  return binding
340
343
  } catch (e) {
@@ -351,8 +354,8 @@ function requireNative() {
351
354
  try {
352
355
  const binding = require('@atbash/sdk-linux-arm-musleabihf')
353
356
  const bindingPackageVersion = require('@atbash/sdk-linux-arm-musleabihf/package.json').version
354
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
355
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
357
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
358
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
356
359
  }
357
360
  return binding
358
361
  } catch (e) {
@@ -367,8 +370,8 @@ function requireNative() {
367
370
  try {
368
371
  const binding = require('@atbash/sdk-linux-arm-gnueabihf')
369
372
  const bindingPackageVersion = require('@atbash/sdk-linux-arm-gnueabihf/package.json').version
370
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
371
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
373
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
374
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
372
375
  }
373
376
  return binding
374
377
  } catch (e) {
@@ -385,8 +388,8 @@ function requireNative() {
385
388
  try {
386
389
  const binding = require('@atbash/sdk-linux-loong64-musl')
387
390
  const bindingPackageVersion = require('@atbash/sdk-linux-loong64-musl/package.json').version
388
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
389
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
391
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
392
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
390
393
  }
391
394
  return binding
392
395
  } catch (e) {
@@ -401,8 +404,8 @@ function requireNative() {
401
404
  try {
402
405
  const binding = require('@atbash/sdk-linux-loong64-gnu')
403
406
  const bindingPackageVersion = require('@atbash/sdk-linux-loong64-gnu/package.json').version
404
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
405
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
407
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
408
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
406
409
  }
407
410
  return binding
408
411
  } catch (e) {
@@ -419,8 +422,8 @@ function requireNative() {
419
422
  try {
420
423
  const binding = require('@atbash/sdk-linux-riscv64-musl')
421
424
  const bindingPackageVersion = require('@atbash/sdk-linux-riscv64-musl/package.json').version
422
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
423
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
425
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
426
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
424
427
  }
425
428
  return binding
426
429
  } catch (e) {
@@ -435,8 +438,8 @@ function requireNative() {
435
438
  try {
436
439
  const binding = require('@atbash/sdk-linux-riscv64-gnu')
437
440
  const bindingPackageVersion = require('@atbash/sdk-linux-riscv64-gnu/package.json').version
438
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
439
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
441
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
442
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
440
443
  }
441
444
  return binding
442
445
  } catch (e) {
@@ -452,8 +455,8 @@ function requireNative() {
452
455
  try {
453
456
  const binding = require('@atbash/sdk-linux-ppc64-gnu')
454
457
  const bindingPackageVersion = require('@atbash/sdk-linux-ppc64-gnu/package.json').version
455
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
456
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
458
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
459
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
457
460
  }
458
461
  return binding
459
462
  } catch (e) {
@@ -468,8 +471,8 @@ function requireNative() {
468
471
  try {
469
472
  const binding = require('@atbash/sdk-linux-s390x-gnu')
470
473
  const bindingPackageVersion = require('@atbash/sdk-linux-s390x-gnu/package.json').version
471
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
472
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
474
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
475
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
473
476
  }
474
477
  return binding
475
478
  } catch (e) {
@@ -488,8 +491,8 @@ function requireNative() {
488
491
  try {
489
492
  const binding = require('@atbash/sdk-openharmony-arm64')
490
493
  const bindingPackageVersion = require('@atbash/sdk-openharmony-arm64/package.json').version
491
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
492
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
494
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
495
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
493
496
  }
494
497
  return binding
495
498
  } catch (e) {
@@ -504,8 +507,8 @@ function requireNative() {
504
507
  try {
505
508
  const binding = require('@atbash/sdk-openharmony-x64')
506
509
  const bindingPackageVersion = require('@atbash/sdk-openharmony-x64/package.json').version
507
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
508
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
510
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
511
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
509
512
  }
510
513
  return binding
511
514
  } catch (e) {
@@ -520,8 +523,8 @@ function requireNative() {
520
523
  try {
521
524
  const binding = require('@atbash/sdk-openharmony-arm')
522
525
  const bindingPackageVersion = require('@atbash/sdk-openharmony-arm/package.json').version
523
- if (bindingPackageVersion !== '0.12.0-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
524
- throw new Error(`Native binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
526
+ if (bindingPackageVersion !== '0.15.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
527
+ throw new Error(`Native binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
525
528
  }
526
529
  return binding
527
530
  } catch (e) {
@@ -661,8 +664,8 @@ if (!nativeBinding || forceWasi) {
661
664
  if (!candidateFailed) {
662
665
  if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
663
666
  const bindingPackageVersion = require('@atbash/sdk-wasm32-wasi/package.json').version
664
- if (bindingPackageVersion !== '0.12.0-dev.0') {
665
- throw new Error(`WASI binding package version mismatch, expected 0.12.0-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
667
+ if (bindingPackageVersion !== '0.15.0') {
668
+ throw new Error(`WASI binding package version mismatch, expected 0.15.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
666
669
  }
667
670
  }
668
671
  wasiBinding = require('@atbash/sdk-wasm32-wasi')
@@ -778,6 +781,7 @@ function __napiStampBindingTarget(exportsObject, target) {
778
781
  // linked import resolves to `undefined`.
779
782
  module.exports.__napiBindingTarget = __napiStampBindingTarget(nativeBinding, __napiLoadedBindingTarget)
780
783
  module.exports = nativeBinding
784
+ module.exports.applyMemoryEdits = nativeBinding.applyMemoryEdits
781
785
  module.exports.ARG_AGENT_PUBKEY = nativeBinding.ARG_AGENT_PUBKEY
782
786
  module.exports.ARG_FILE_PATH = nativeBinding.ARG_FILE_PATH
783
787
  module.exports.ARG_ID = nativeBinding.ARG_ID
@@ -800,10 +804,9 @@ module.exports.containsSecret = nativeBinding.containsSecret
800
804
  module.exports.createMemorySnapshot = nativeBinding.createMemorySnapshot
801
805
  module.exports.decryptForOrg = nativeBinding.decryptForOrg
802
806
  module.exports.decryptMemoryContent = nativeBinding.decryptMemoryContent
803
- module.exports.DEFAULT_BLOCKCHAIN_RID = nativeBinding.DEFAULT_BLOCKCHAIN_RID
804
807
  module.exports.DEFAULT_ENDPOINT = nativeBinding.DEFAULT_ENDPOINT
805
808
  module.exports.DEFAULT_PRIVATE_BLOCKCHAIN_RID = nativeBinding.DEFAULT_PRIVATE_BLOCKCHAIN_RID
806
- module.exports.defaultChromiaNodeUrls = nativeBinding.defaultChromiaNodeUrls
809
+ module.exports.defaultAgentHomeDirs = nativeBinding.defaultAgentHomeDirs
807
810
  module.exports.defaultMemoryPathPatterns = nativeBinding.defaultMemoryPathPatterns
808
811
  module.exports.defaultMemoryReadToolNames = nativeBinding.defaultMemoryReadToolNames
809
812
  module.exports.defaultMemoryWriteToolNames = nativeBinding.defaultMemoryWriteToolNames
@@ -816,12 +819,15 @@ module.exports.ECIES_FORMAT_VERSION = nativeBinding.ECIES_FORMAT_VERSION
816
819
  module.exports.encryptedLength = nativeBinding.encryptedLength
817
820
  module.exports.encryptForOrg = nativeBinding.encryptForOrg
818
821
  module.exports.encryptMemoryContent = nativeBinding.encryptMemoryContent
822
+ module.exports.extractMemoryEdits = nativeBinding.extractMemoryEdits
819
823
  module.exports.formatEntryForScan = nativeBinding.formatEntryForScan
820
824
  module.exports.generateKeypair = nativeBinding.generateKeypair
825
+ module.exports.isSafeMemorySlot = nativeBinding.isSafeMemorySlot
821
826
  module.exports.isValidPrivateKey = nativeBinding.isValidPrivateKey
822
827
  module.exports.loadAgent = nativeBinding.loadAgent
823
828
  module.exports.mapVerdict = nativeBinding.mapVerdict
824
829
  module.exports.memoryScanContext = nativeBinding.memoryScanContext
830
+ module.exports.memorySlotForPath = nativeBinding.memorySlotForPath
825
831
  module.exports.normalizeActionForHash = nativeBinding.normalizeActionForHash
826
832
  module.exports.normalizeForMatching = nativeBinding.normalizeForMatching
827
833
  module.exports.OP_ADD_AGENT_MEMORY = nativeBinding.OP_ADD_AGENT_MEMORY
@@ -834,6 +840,7 @@ module.exports.parseMemoryRows = nativeBinding.parseMemoryRows
834
840
  module.exports.parseRollbackRow = nativeBinding.parseRollbackRow
835
841
  module.exports.parseRollbackRows = nativeBinding.parseRollbackRows
836
842
  module.exports.parseScoreFromReason = nativeBinding.parseScoreFromReason
843
+ module.exports.pinnedJudgeVerifyKeys = nativeBinding.pinnedJudgeVerifyKeys
837
844
  module.exports.QUERY_GET_ACTIVE_AGENT_MEMORY = nativeBinding.QUERY_GET_ACTIVE_AGENT_MEMORY
838
845
  module.exports.QUERY_GET_ACTIVE_MEMORY_ID = nativeBinding.QUERY_GET_ACTIVE_MEMORY_ID
839
846
  module.exports.QUERY_GET_AGENT_MEMORY_BY_ID = nativeBinding.QUERY_GET_AGENT_MEMORY_BY_ID
@@ -841,9 +848,11 @@ module.exports.QUERY_GET_AGENT_MEMORY_HISTORY = nativeBinding.QUERY_GET_AGENT_ME
841
848
  module.exports.QUERY_GET_AGENT_MEMORY_ROLLBACK_HISTORY = nativeBinding.QUERY_GET_AGENT_MEMORY_ROLLBACK_HISTORY
842
849
  module.exports.QUERY_GET_RECENT_AGENT_MEMORY = nativeBinding.QUERY_GET_RECENT_AGENT_MEMORY
843
850
  module.exports.redactSecrets = nativeBinding.redactSecrets
851
+ module.exports.signAddAgentMemory = nativeBinding.signAddAgentMemory
844
852
  module.exports.signEncryptedToolCall = nativeBinding.signEncryptedToolCall
845
853
  module.exports.signJudgeAction = nativeBinding.signJudgeAction
846
854
  module.exports.signLogToolCall = nativeBinding.signLogToolCall
855
+ module.exports.signRollbackAgentMemory = nativeBinding.signRollbackAgentMemory
847
856
  module.exports.validateAgentPubkeyHex = nativeBinding.validateAgentPubkeyHex
848
857
  module.exports.validateFilePath = nativeBinding.validateFilePath
849
858
  module.exports.validateMemoryId = nativeBinding.validateMemoryId
@@ -852,3 +861,4 @@ module.exports.validateRollbackReason = nativeBinding.validateRollbackReason
852
861
  module.exports.validateScore = nativeBinding.validateScore
853
862
  module.exports.verifyJudgeResponseSignature = nativeBinding.verifyJudgeResponseSignature
854
863
  module.exports.verifySignature = nativeBinding.verifySignature
864
+ // x-release-please-end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atbash/sdk",
3
- "version": "0.14.1-dev.0",
3
+ "version": "0.15.0",
4
4
  "description": "TypeScript SDK for Atbash — the safety layer that evaluates AI agent actions against operator-defined policies before execution.",
5
5
  "keywords": [
6
6
  "atbash",
@@ -21,9 +21,14 @@
21
21
  "./native": {
22
22
  "types": "./index.d.ts",
23
23
  "default": "./index.js"
24
+ },
25
+ "./testing": {
26
+ "types": "./dist/testing.d.ts",
27
+ "import": "./dist/testing.mjs",
28
+ "require": "./dist/testing.js"
24
29
  }
25
30
  },
26
- "license": "SEE LICENSE IN LICENSE",
31
+ "license": "Apache-2.0",
27
32
  "napi": {
28
33
  "binaryName": "atbash",
29
34
  "packageName": "@atbash/sdk",
@@ -48,17 +53,22 @@
48
53
  "index.d.ts",
49
54
  "*.node",
50
55
  "README.md",
51
- "LICENSE"
56
+ "LICENSE",
57
+ "NOTICE",
58
+ "THIRD-PARTY-NOTICES"
52
59
  ],
53
60
  "scripts": {
54
61
  "build:native": "napi build --platform --release",
62
+ "postbuild:native": "node scripts/sync-loader-version.mjs",
55
63
  "build:native:debug": "napi build --platform",
64
+ "postbuild:native:debug": "node scripts/sync-loader-version.mjs",
56
65
  "gen:http": "openapi-typescript ../../spec/openapi.yaml -o src-ts/http/schema.ts",
57
- "build:ts": "tsup",
66
+ "build:ts": "tsup && node scripts/assert-browser-bundle-clean.mjs",
58
67
  "build": "npm run build:native && npm run build:ts",
59
68
  "test:native": "node --test __test__/vector_parity.test.mjs",
60
69
  "test:sdk": "node --test __test__/*.sdk.test.mjs",
61
70
  "test:live": "node --test __test__/live_technical_health.test.mjs",
71
+ "test:memory:live": "node --test __test__/memory_chain_live.test.mjs",
62
72
  "test": "node --test __test__/*.test.mjs",
63
73
  "lint": "eslint .",
64
74
  "lint:fix": "eslint . --fix",
@@ -67,13 +77,16 @@
67
77
  },
68
78
  "dependencies": {
69
79
  "@opentelemetry/api": "^1.9.1",
70
- "@opentelemetry/exporter-metrics-otlp-http": "^0.219.0",
80
+ "@opentelemetry/api-logs": "^0.223.0",
81
+ "@opentelemetry/exporter-logs-otlp-http": "^0.223.0",
82
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.223.0",
71
83
  "@opentelemetry/resources": "^2.7.1",
84
+ "@opentelemetry/sdk-logs": "^0.223.0",
72
85
  "@opentelemetry/sdk-metrics": "^2.7.1"
73
86
  },
74
87
  "devDependencies": {
75
88
  "@eslint/js": "^10.0.1",
76
- "@napi-rs/cli": "^3.7.2",
89
+ "@napi-rs/cli": "3.10.9",
77
90
  "@noble/ciphers": "^2.2.0",
78
91
  "@noble/curves": "2.2.0",
79
92
  "@types/node": "^26.0.1",
@@ -88,11 +101,14 @@
88
101
  "typescript": "^5.4.0",
89
102
  "typescript-eslint": "^8.62.1"
90
103
  },
104
+ "overrides": {
105
+ "@napi-rs/cross-toolchain": "1.0.3"
106
+ },
91
107
  "optionalDependencies": {
92
- "@atbash/sdk-linux-x64-gnu": "0.14.1-dev.0",
93
- "@atbash/sdk-linux-arm64-gnu": "0.14.1-dev.0",
94
- "@atbash/sdk-linux-x64-musl": "0.14.1-dev.0",
95
- "@atbash/sdk-darwin-arm64": "0.14.1-dev.0",
96
- "@atbash/sdk-win32-x64-msvc": "0.14.1-dev.0"
108
+ "@atbash/sdk-linux-x64-gnu": "0.15.0",
109
+ "@atbash/sdk-linux-arm64-gnu": "0.15.0",
110
+ "@atbash/sdk-linux-x64-musl": "0.15.0",
111
+ "@atbash/sdk-darwin-arm64": "0.15.0",
112
+ "@atbash/sdk-win32-x64-msvc": "0.15.0"
97
113
  }
98
114
  }