@atbash/sdk 0.10.4-dev.0 → 0.10.6-dev.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/dist/browser.mjs +159 -19
- package/dist/browser.mjs.map +1 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -5
package/dist/browser.mjs
CHANGED
|
@@ -10,6 +10,9 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
12
|
});
|
|
13
|
+
var __esm = (fn, res) => function __init() {
|
|
14
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
|
+
};
|
|
13
16
|
var __commonJS = (cb, mod2) => function __require2() {
|
|
14
17
|
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
15
18
|
};
|
|
@@ -30,10 +33,28 @@ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__
|
|
|
30
33
|
mod2
|
|
31
34
|
));
|
|
32
35
|
|
|
36
|
+
// <define:__ATBASH_CHROMIA_NODE_URLS__>
|
|
37
|
+
var define_ATBASH_CHROMIA_NODE_URLS_default;
|
|
38
|
+
var init_define_ATBASH_CHROMIA_NODE_URLS = __esm({
|
|
39
|
+
"<define:__ATBASH_CHROMIA_NODE_URLS__>"() {
|
|
40
|
+
define_ATBASH_CHROMIA_NODE_URLS_default = ["https://node0.testnet.chromia.com:7740", "https://node1.testnet.chromia.com:7740", "https://node3.testnet.chromia.com:7740"];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// <define:__ATBASH_PRIVATE_NODE_URLS__>
|
|
45
|
+
var define_ATBASH_PRIVATE_NODE_URLS_default;
|
|
46
|
+
var init_define_ATBASH_PRIVATE_NODE_URLS = __esm({
|
|
47
|
+
"<define:__ATBASH_PRIVATE_NODE_URLS__>"() {
|
|
48
|
+
define_ATBASH_PRIVATE_NODE_URLS_default = ["https://node0-pvn-testnet.dynamic.chromia.dev"];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
33
52
|
// (disabled):node_modules/buffer/index.js
|
|
34
53
|
var require_buffer = __commonJS({
|
|
35
54
|
"(disabled):node_modules/buffer/index.js"() {
|
|
36
55
|
"use strict";
|
|
56
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
57
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
37
58
|
}
|
|
38
59
|
});
|
|
39
60
|
|
|
@@ -41,6 +62,8 @@ var require_buffer = __commonJS({
|
|
|
41
62
|
var require_bn = __commonJS({
|
|
42
63
|
"node_modules/bn.js/lib/bn.js"(exports, module) {
|
|
43
64
|
"use strict";
|
|
65
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
66
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44
67
|
(function(module2, exports2) {
|
|
45
68
|
"use strict";
|
|
46
69
|
function assert2(val, msg) {
|
|
@@ -2858,7 +2881,29 @@ var require_bn = __commonJS({
|
|
|
2858
2881
|
}
|
|
2859
2882
|
});
|
|
2860
2883
|
|
|
2884
|
+
// src-ts/index.ts
|
|
2885
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
2886
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
2887
|
+
|
|
2888
|
+
// src-ts/browser/native.ts
|
|
2889
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
2890
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
2891
|
+
|
|
2892
|
+
// node_modules/@noble/curves/secp256k1.js
|
|
2893
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
2894
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
2895
|
+
|
|
2896
|
+
// node_modules/@noble/hashes/sha2.js
|
|
2897
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
2898
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
2899
|
+
|
|
2900
|
+
// node_modules/@noble/hashes/_md.js
|
|
2901
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
2902
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
2903
|
+
|
|
2861
2904
|
// node_modules/@noble/hashes/utils.js
|
|
2905
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
2906
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
2862
2907
|
function isBytes(a) {
|
|
2863
2908
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
|
2864
2909
|
}
|
|
@@ -3279,7 +3324,13 @@ var sha256 = /* @__PURE__ */ createHasher(
|
|
|
3279
3324
|
/* @__PURE__ */ oidNist(1)
|
|
3280
3325
|
);
|
|
3281
3326
|
|
|
3327
|
+
// node_modules/@noble/curves/abstract/curve.js
|
|
3328
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
3329
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
3330
|
+
|
|
3282
3331
|
// node_modules/@noble/curves/utils.js
|
|
3332
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
3333
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
3283
3334
|
var abytes2 = (value, length, title) => abytes(value, length, title);
|
|
3284
3335
|
var anumber2 = anumber;
|
|
3285
3336
|
var bytesToHex2 = bytesToHex;
|
|
@@ -3432,6 +3483,8 @@ function validateObject(object, fields = {}, optFields = {}) {
|
|
|
3432
3483
|
}
|
|
3433
3484
|
|
|
3434
3485
|
// node_modules/@noble/curves/abstract/modular.js
|
|
3486
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
3487
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
3435
3488
|
var _0n2 = /* @__PURE__ */ BigInt(0);
|
|
3436
3489
|
var _1n2 = /* @__PURE__ */ BigInt(1);
|
|
3437
3490
|
var _2n = /* @__PURE__ */ BigInt(2);
|
|
@@ -4079,7 +4132,13 @@ function createKeygen(randomSecretKey, getPublicKey) {
|
|
|
4079
4132
|
};
|
|
4080
4133
|
}
|
|
4081
4134
|
|
|
4135
|
+
// node_modules/@noble/curves/abstract/weierstrass.js
|
|
4136
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
4137
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
4138
|
+
|
|
4082
4139
|
// node_modules/@noble/hashes/hmac.js
|
|
4140
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
4141
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
4083
4142
|
var _HMAC = class {
|
|
4084
4143
|
oHash;
|
|
4085
4144
|
iHash;
|
|
@@ -5111,6 +5170,8 @@ var Pointk1 = /* @__PURE__ */ weierstrass(secp256k1_CURVE, {
|
|
|
5111
5170
|
var secp256k1 = /* @__PURE__ */ ecdsa(Pointk1, sha256);
|
|
5112
5171
|
|
|
5113
5172
|
// node_modules/postchain-client/built/esm/index.js
|
|
5173
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
5174
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
5114
5175
|
var import_bn = __toESM(require_bn(), 1);
|
|
5115
5176
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
5116
5177
|
function getDefaultExportFromCjs(x) {
|
|
@@ -43233,17 +43294,11 @@ var index = /* @__PURE__ */ getDefaultExportFromCjs(builtExports);
|
|
|
43233
43294
|
|
|
43234
43295
|
// src-ts/browser/native.ts
|
|
43235
43296
|
var { Buffer: Buffer3, gtx: pcgtx } = index;
|
|
43236
|
-
var
|
|
43237
|
-
var
|
|
43238
|
-
var
|
|
43239
|
-
var DEFAULT_CHROMIA_NODE_URLS_ARR =
|
|
43240
|
-
|
|
43241
|
-
"https://node1.testnet.chromia.com:7740",
|
|
43242
|
-
"https://node3.testnet.chromia.com:7740"
|
|
43243
|
-
];
|
|
43244
|
-
var DEFAULT_PRIVATE_NODE_URLS_ARR = [
|
|
43245
|
-
"https://node0-pvn-testnet.dynamic.chromia.dev"
|
|
43246
|
-
];
|
|
43297
|
+
var ATBASH_ENDPOINT = "https://atbash.ai";
|
|
43298
|
+
var ATBASH_BLOCKCHAIN_RID = "0163241D9AF137638E63E48EFCDE15510F38C2426F7AD5DC726AF60351BF4DFE";
|
|
43299
|
+
var ATBASH_PRIVATE_BLOCKCHAIN_RID = "39FFD3557D0296CB2C57FDC6A3B8C024E95639CF4964DA08141AC20C6344D408";
|
|
43300
|
+
var DEFAULT_CHROMIA_NODE_URLS_ARR = define_ATBASH_CHROMIA_NODE_URLS_default;
|
|
43301
|
+
var DEFAULT_PRIVATE_NODE_URLS_ARR = define_ATBASH_PRIVATE_NODE_URLS_default;
|
|
43247
43302
|
var MERKLE_HASH_VERSION = 2;
|
|
43248
43303
|
function stripHex(s2) {
|
|
43249
43304
|
return s2.trim().replace(/^0x/i, "").toLowerCase();
|
|
@@ -43394,9 +43449,9 @@ var native = {
|
|
|
43394
43449
|
deriveMemoryKey,
|
|
43395
43450
|
encryptMemoryContent,
|
|
43396
43451
|
decryptMemoryContent,
|
|
43397
|
-
DEFAULT_BLOCKCHAIN_RID:
|
|
43398
|
-
DEFAULT_PRIVATE_BLOCKCHAIN_RID:
|
|
43399
|
-
DEFAULT_ENDPOINT:
|
|
43452
|
+
DEFAULT_BLOCKCHAIN_RID: ATBASH_BLOCKCHAIN_RID,
|
|
43453
|
+
DEFAULT_PRIVATE_BLOCKCHAIN_RID: ATBASH_PRIVATE_BLOCKCHAIN_RID,
|
|
43454
|
+
DEFAULT_ENDPOINT: ATBASH_ENDPOINT,
|
|
43400
43455
|
// Browser has no NAPI channel to Rust's HONEYCOMB_KEY — telemetry
|
|
43401
43456
|
// silently no-ops. `HONEYCOMB_API_KEY` env var still overrides at runtime.
|
|
43402
43457
|
HONEYCOMB_KEY: "",
|
|
@@ -43456,7 +43511,13 @@ var native = {
|
|
|
43456
43511
|
ARG_ID: "id"
|
|
43457
43512
|
};
|
|
43458
43513
|
|
|
43514
|
+
// src-ts/client.ts
|
|
43515
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43516
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43517
|
+
|
|
43459
43518
|
// src-ts/random.ts
|
|
43519
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43520
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43460
43521
|
function randomBytes4(size) {
|
|
43461
43522
|
const buf = new Uint8Array(size);
|
|
43462
43523
|
globalThis.crypto.getRandomValues(buf);
|
|
@@ -43471,7 +43532,13 @@ function randomHex(size) {
|
|
|
43471
43532
|
return hex;
|
|
43472
43533
|
}
|
|
43473
43534
|
|
|
43535
|
+
// src-ts/chain-config.ts
|
|
43536
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43537
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43538
|
+
|
|
43474
43539
|
// src-ts/constants.ts
|
|
43540
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43541
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43475
43542
|
var DEFAULT_ENDPOINT = native.DEFAULT_ENDPOINT;
|
|
43476
43543
|
var DEFAULT_CHROMIA_NODE_URLS = Object.freeze(
|
|
43477
43544
|
native.defaultChromiaNodeUrls()
|
|
@@ -43494,7 +43561,17 @@ var PRIVATE_CHAIN = {
|
|
|
43494
43561
|
nodeUrls: DEFAULT_PRIVATE_NODE_URLS
|
|
43495
43562
|
};
|
|
43496
43563
|
|
|
43564
|
+
// src-ts/browser/encrypted-toolcall.ts
|
|
43565
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43566
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43567
|
+
|
|
43568
|
+
// src-ts/browser/crypto-ecies.ts
|
|
43569
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43570
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43571
|
+
|
|
43497
43572
|
// node_modules/@noble/hashes/hkdf.js
|
|
43573
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43574
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43498
43575
|
function extract(hash3, ikm, salt) {
|
|
43499
43576
|
ahash(hash3);
|
|
43500
43577
|
if (salt === void 0)
|
|
@@ -43534,7 +43611,17 @@ function expand2(hash3, prk, info2, length = 32) {
|
|
|
43534
43611
|
}
|
|
43535
43612
|
var hkdf = (hash3, ikm, salt, info2, length) => expand2(hash3, extract(hash3, ikm, salt), info2, length);
|
|
43536
43613
|
|
|
43614
|
+
// node_modules/@noble/ciphers/aes.js
|
|
43615
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43616
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43617
|
+
|
|
43618
|
+
// node_modules/@noble/ciphers/_polyval.js
|
|
43619
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43620
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43621
|
+
|
|
43537
43622
|
// node_modules/@noble/ciphers/utils.js
|
|
43623
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
43624
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
43538
43625
|
function isBytes3(a) {
|
|
43539
43626
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
|
43540
43627
|
}
|
|
@@ -44127,6 +44214,8 @@ function encryptedLength(plaintextByteLength) {
|
|
|
44127
44214
|
}
|
|
44128
44215
|
|
|
44129
44216
|
// src-ts/crypto/envelope.ts
|
|
44217
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44218
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44130
44219
|
var PREFIX = "atb1";
|
|
44131
44220
|
var SEPARATOR = ".";
|
|
44132
44221
|
function toBase64(bytes) {
|
|
@@ -44259,6 +44348,8 @@ function signEncryptedToolCall(toolCallId, action, context, toolName, toolArgsJs
|
|
|
44259
44348
|
}
|
|
44260
44349
|
|
|
44261
44350
|
// src-ts/endpoint.ts
|
|
44351
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44352
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44262
44353
|
function buildAllowedJudgeHosts() {
|
|
44263
44354
|
return /* @__PURE__ */ new Set([
|
|
44264
44355
|
"atbash.ai",
|
|
@@ -44309,6 +44400,8 @@ function validateJudgeEndpoint(judge) {
|
|
|
44309
44400
|
}
|
|
44310
44401
|
|
|
44311
44402
|
// src-ts/errors.ts
|
|
44403
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44404
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44312
44405
|
var AtbashAPIError = class extends Error {
|
|
44313
44406
|
/** HTTP status code (or 0 if the request never completed). */
|
|
44314
44407
|
status;
|
|
@@ -44351,6 +44444,8 @@ function enrich(status, body, statusText, endpoint) {
|
|
|
44351
44444
|
}
|
|
44352
44445
|
|
|
44353
44446
|
// src-ts/http/client.ts
|
|
44447
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44448
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44354
44449
|
var HttpClient = class {
|
|
44355
44450
|
baseUrl;
|
|
44356
44451
|
timeoutMs;
|
|
@@ -44388,6 +44483,8 @@ var HttpClient = class {
|
|
|
44388
44483
|
};
|
|
44389
44484
|
|
|
44390
44485
|
// src-ts/browser/keyLoader.ts
|
|
44486
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44487
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44391
44488
|
var NOT_AVAILABLE = "keyLoader is not available in the browser bundle \u2014 pass `agentKey` explicitly to Atbash.fromConfig or use `new Atbash(privkey, opts)`.";
|
|
44392
44489
|
function resolveKeyPath(_input) {
|
|
44393
44490
|
throw new Error(NOT_AVAILABLE);
|
|
@@ -44397,6 +44494,8 @@ function loadAgentFromFile(_keyPath) {
|
|
|
44397
44494
|
}
|
|
44398
44495
|
|
|
44399
44496
|
// src-ts/normalize.ts
|
|
44497
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44498
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44400
44499
|
function normalizeVerdict(raw2) {
|
|
44401
44500
|
if (raw2 === null || raw2 === void 0) return "No verdict";
|
|
44402
44501
|
const v = String(raw2).toUpperCase();
|
|
@@ -44422,6 +44521,8 @@ function pubkeyToHex(val) {
|
|
|
44422
44521
|
}
|
|
44423
44522
|
|
|
44424
44523
|
// src-ts/browser/opentel/telemetry.ts
|
|
44524
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44525
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44425
44526
|
function setupTelemetry(_config) {
|
|
44426
44527
|
}
|
|
44427
44528
|
function recordCall(_functionName, _source, _agentPubkey) {
|
|
@@ -44434,6 +44535,8 @@ async function shutdownTelemetry() {
|
|
|
44434
44535
|
}
|
|
44435
44536
|
|
|
44436
44537
|
// src-ts/browser/userConfig.ts
|
|
44538
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
44539
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
44437
44540
|
var NOT_AVAILABLE2 = "userConfig file I/O is not available in the browser bundle.";
|
|
44438
44541
|
function getConfigDir() {
|
|
44439
44542
|
throw new Error(NOT_AVAILABLE2);
|
|
@@ -44623,11 +44726,15 @@ var Atbash = class _Atbash {
|
|
|
44623
44726
|
* response bytes via the Rust core's `verifySignature`.
|
|
44624
44727
|
*/
|
|
44625
44728
|
async judgeAction(action, context = "", options = {}) {
|
|
44626
|
-
return this.track(
|
|
44627
|
-
|
|
44628
|
-
|
|
44629
|
-
|
|
44630
|
-
|
|
44729
|
+
return this.track("judgeAction", this.auth.pubkey, async () => {
|
|
44730
|
+
try {
|
|
44731
|
+
return await this._judgeAction(action, context, options);
|
|
44732
|
+
} catch (err) {
|
|
44733
|
+
if (!isEncryptionStateMismatch(err)) throw err;
|
|
44734
|
+
this._orgKeyFromChain = null;
|
|
44735
|
+
return await this._judgeAction(action, context, options);
|
|
44736
|
+
}
|
|
44737
|
+
});
|
|
44631
44738
|
}
|
|
44632
44739
|
async _judgeAction(action, context, options) {
|
|
44633
44740
|
if (!action?.trim()) {
|
|
@@ -44674,6 +44781,7 @@ var Atbash = class _Atbash {
|
|
|
44674
44781
|
if (context) body.context = context;
|
|
44675
44782
|
if (options.provider) body.provider = options.provider;
|
|
44676
44783
|
if (options.toolName) body.tool_name = options.toolName;
|
|
44784
|
+
if (options.toolArgsJson) body.tool_args_json = options.toolArgsJson;
|
|
44677
44785
|
if (options.model) body.model = options.model;
|
|
44678
44786
|
if (options.resolved) body.resolved = options.resolved;
|
|
44679
44787
|
if (options.mode) body.mode = options.mode;
|
|
@@ -45300,6 +45408,10 @@ async function safeText(resp) {
|
|
|
45300
45408
|
function errorMessage(err) {
|
|
45301
45409
|
return err instanceof Error ? err.message : String(err);
|
|
45302
45410
|
}
|
|
45411
|
+
function isEncryptionStateMismatch(err) {
|
|
45412
|
+
const msg = errorMessage(err);
|
|
45413
|
+
return msg.includes("must be a valid encryption envelope") || msg.includes("must be plaintext");
|
|
45414
|
+
}
|
|
45303
45415
|
function stringifyArgs(args) {
|
|
45304
45416
|
if (args === null || args === void 0) return "";
|
|
45305
45417
|
if (typeof args === "string") return args;
|
|
@@ -45316,6 +45428,8 @@ function truncate(text) {
|
|
|
45316
45428
|
}
|
|
45317
45429
|
|
|
45318
45430
|
// src-ts/redact.ts
|
|
45431
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45432
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45319
45433
|
function redactJsonStrings(value) {
|
|
45320
45434
|
if (typeof value === "string") {
|
|
45321
45435
|
return native.redactSecrets(value).redacted;
|
|
@@ -45334,6 +45448,8 @@ function redactJsonStrings(value) {
|
|
|
45334
45448
|
}
|
|
45335
45449
|
|
|
45336
45450
|
// src-ts/signature.ts
|
|
45451
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45452
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45337
45453
|
function verifyJudgeResponseSignature(bodyBytes, signatureHex, pubKeyHex) {
|
|
45338
45454
|
if (!signatureHex) {
|
|
45339
45455
|
return { ok: false, reason: "missing X-Atbash-Signature header" };
|
|
@@ -45355,7 +45471,13 @@ function verifyJudgeResponseSignature(bodyBytes, signatureHex, pubKeyHex) {
|
|
|
45355
45471
|
};
|
|
45356
45472
|
}
|
|
45357
45473
|
|
|
45474
|
+
// src-ts/memory/index.ts
|
|
45475
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45476
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45477
|
+
|
|
45358
45478
|
// src-ts/browser/memory-crypto.ts
|
|
45479
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45480
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45359
45481
|
var { Buffer: Buffer4 } = index;
|
|
45360
45482
|
var HKDF_INFO = new TextEncoder().encode("atbash:memory-encryption");
|
|
45361
45483
|
var KEY_LEN = 32;
|
|
@@ -45430,6 +45552,8 @@ async function decryptMemoryContent2(ciphertext, nonce, key3) {
|
|
|
45430
45552
|
}
|
|
45431
45553
|
|
|
45432
45554
|
// src-ts/browser/memory-scan.ts
|
|
45555
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45556
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45433
45557
|
var STUB_MSG2 = "not available in @atbash/sdk browser bundle \u2014 scan memory server-side";
|
|
45434
45558
|
async function scanMemory(_entry, _auth, _opts) {
|
|
45435
45559
|
throw new Error(`scanMemory ${STUB_MSG2}`);
|
|
@@ -45439,6 +45563,8 @@ async function scanMemoryBatch(_entries, _auth, _opts) {
|
|
|
45439
45563
|
}
|
|
45440
45564
|
|
|
45441
45565
|
// src-ts/browser/memory-chain.ts
|
|
45566
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45567
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45442
45568
|
var STUB_MSG3 = "not available in @atbash/sdk browser bundle \u2014 commit/rollback memory server-side";
|
|
45443
45569
|
async function commitMemoryVersion(_plaintext, _auth, _opts) {
|
|
45444
45570
|
throw new Error(`commitMemoryVersion ${STUB_MSG3}`);
|
|
@@ -45466,6 +45592,8 @@ async function rollbackMemory(_toId, _reason, _auth, _opts) {
|
|
|
45466
45592
|
}
|
|
45467
45593
|
|
|
45468
45594
|
// src-ts/browser/memory-classifier.ts
|
|
45595
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45596
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45469
45597
|
var STUB_MSG4 = "not available in @atbash/sdk browser bundle \u2014 classify memory writes server-side";
|
|
45470
45598
|
var DEFAULT_MEMORY_WRITE_TOOL_NAMES = [
|
|
45471
45599
|
"write",
|
|
@@ -45488,6 +45616,8 @@ function classifyMemoryWrite(_event, _ctx, _opts = {}) {
|
|
|
45488
45616
|
}
|
|
45489
45617
|
|
|
45490
45618
|
// src-ts/memory/guard.ts
|
|
45619
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45620
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45491
45621
|
function emitDebugProbe(event, ctx, memEntry, logger2) {
|
|
45492
45622
|
if (!logger2?.info) return;
|
|
45493
45623
|
const ev = event ?? {};
|
|
@@ -45584,6 +45714,8 @@ async function guardMemoryWrite(input) {
|
|
|
45584
45714
|
}
|
|
45585
45715
|
|
|
45586
45716
|
// src-ts/memory/sync.ts
|
|
45717
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45718
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45587
45719
|
var MemoryIntegrityError = class extends Error {
|
|
45588
45720
|
constructor(id, reason) {
|
|
45589
45721
|
super(`memory integrity check failed on id ${id}: ${reason}`);
|
|
@@ -45616,6 +45748,8 @@ async function syncLocalMemory(auth, pointer, opts = {}) {
|
|
|
45616
45748
|
}
|
|
45617
45749
|
|
|
45618
45750
|
// src-ts/browser/memory-pointer-store.ts
|
|
45751
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45752
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45619
45753
|
var unavailable = (name2) => {
|
|
45620
45754
|
throw new Error(`${name2} is not available in the browser bundle`);
|
|
45621
45755
|
};
|
|
@@ -45634,6 +45768,8 @@ function defaultPointerPath(_workspaceDir) {
|
|
|
45634
45768
|
}
|
|
45635
45769
|
|
|
45636
45770
|
// src-ts/browser/memory-file-logger.ts
|
|
45771
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45772
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45637
45773
|
var unavailable2 = (name2) => {
|
|
45638
45774
|
throw new Error(`${name2} is not available in the browser bundle`);
|
|
45639
45775
|
};
|
|
@@ -45645,6 +45781,8 @@ function defaultPluginLogPath(_workspaceDir) {
|
|
|
45645
45781
|
}
|
|
45646
45782
|
|
|
45647
45783
|
// src-ts/browser/memory-read-classifier.ts
|
|
45784
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45785
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45648
45786
|
var STUB_MSG5 = "not available in @atbash/sdk browser bundle \u2014 classify memory reads server-side";
|
|
45649
45787
|
var DEFAULT_MEMORY_READ_TOOL_NAMES = [
|
|
45650
45788
|
"memory_search",
|
|
@@ -45655,6 +45793,8 @@ function classifyMemoryRead(_event, _ctx, _opts = {}) {
|
|
|
45655
45793
|
}
|
|
45656
45794
|
|
|
45657
45795
|
// src-ts/browser/memory-guard-manager.ts
|
|
45796
|
+
init_define_ATBASH_CHROMIA_NODE_URLS();
|
|
45797
|
+
init_define_ATBASH_PRIVATE_NODE_URLS();
|
|
45658
45798
|
var unavailable3 = (name2) => {
|
|
45659
45799
|
throw new Error(`${name2} is not available in the browser bundle`);
|
|
45660
45800
|
};
|