@atbash/sdk 0.20.0-dev.0 → 0.21.0-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.
@@ -38,8 +38,12 @@ interface ChainConfig {
38
38
  readonly blockchainRid: string;
39
39
  readonly nodeUrls: readonly string[];
40
40
  }
41
- declare const PUBLIC_CHAIN: ChainConfig;
42
41
  declare const PRIVATE_CHAIN: ChainConfig;
42
+ /**
43
+ * The chain a network name selects. Only `"private"` exists; any other value,
44
+ * including `"public"` from an untyped caller, is refused with the same
45
+ * message the config switch gives, never routed to private in silence.
46
+ */
43
47
  declare function chainForNetwork(network: Network): ChainConfig;
44
48
 
45
49
  /**
@@ -130,13 +134,11 @@ interface MemoryScanOptions {
130
134
  toolArgsJson?: string;
131
135
  }
132
136
  /**
133
- * Which Atbash chain an action runs against. `public` is the shared
134
- * testnet (Free plan); `private` is reserved for Private / Swarm /
135
- * Enterprise tier subscribers. The SDK resolves which one to use from
136
- * the org's subscription via `orgName` — callers normally don't need
137
- * to pass this manually.
137
+ * Chain selector. Only `"private"` exists: the public testnet chains are
138
+ * retired. The SDK resolves an org's chain through the Dashboard via
139
+ * `orgName` — callers normally don't need to pass this manually.
138
140
  */
139
- type Network = "public" | "private";
141
+ type Network = "private";
140
142
  /**
141
143
  * Per-call chain overrides. Pass exactly what you need to override —
142
144
  * `network` selects between the SDK's known chains, `blockchainRid` pins a
@@ -340,7 +342,7 @@ interface AtbashOptions {
340
342
  */
341
343
  chain?: ChainConfig;
342
344
  /**
343
- * Preset chain selector — `"public"` or `"private"`. Resolves to the
345
+ * Preset chain selector — `"private"` is the only value. Resolves to the
344
346
  * matching `ChainConfig` via `chainForNetwork()`. Overridden by `chain`,
345
347
  * overrides env `ATBASH_DEFAULT_CHAIN_NETWORK` and the config file.
346
348
  */
@@ -748,12 +750,9 @@ declare class Atbash {
748
750
  * Resolve which chain an org's actions should run against. Cached
749
751
  * per-client by orgName. Resolution order:
750
752
  * 1. `org_networks` map (authoritative).
751
- * 2. Per-chain subscription fallback — public + private records
752
- * are fetched in parallel, with `is_private_blockchain` and
753
- * `assigned_at` reconciling mixed states.
754
- * A lookup that names exactly one chain wins outright. Where it names
755
- * neither (a brand-new org) or cannot choose between them, the client's
756
- * configured default decides.
753
+ * 2. Subscription fallback — the org's subscription row on the chain.
754
+ * A lookup that finds the org wins outright. Where it finds nothing (a
755
+ * brand-new org), the client's configured default decides.
757
756
  */
758
757
  resolveChainForOrg(orgName: string): Promise<ChainConfig>;
759
758
  /**
@@ -870,8 +869,6 @@ declare function releaseJailHolds(): void;
870
869
  declare function configureJailHold(next: Partial<typeof DEFAULTS>): void;
871
870
 
872
871
  declare const DEFAULT_ENDPOINT: string;
873
- declare const DEFAULT_CHROMIA_NODE_URLS: readonly string[];
874
- declare const DEFAULT_BLOCKCHAIN_RID: string;
875
872
 
876
873
  declare class AtbashAPIError extends Error {
877
874
  /** HTTP status code (or 0 if the request never completed). */
@@ -1991,4 +1988,4 @@ declare function containsSecret(text: string): boolean;
1991
1988
  declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
1992
1989
  declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
1993
1990
 
1994
- export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_BLOCKCHAIN_RID, DEFAULT_CHROMIA_NODE_URLS, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, JudgeRefusalError, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OperationEvent, type OrgSubscription, PRIVATE_CHAIN, PUBLIC_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, canonicalAllow, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, configureEvents, configureJailHold, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, eventsAreOn, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isJailHeld, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
1991
+ export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, JudgeRefusalError, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OperationEvent, type OrgSubscription, PRIVATE_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, canonicalAllow, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, configureEvents, configureJailHold, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, eventsAreOn, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isJailHeld, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
package/dist/browser.mjs CHANGED
@@ -33,14 +33,6 @@ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__
33
33
  mod2
34
34
  ));
35
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"];
41
- }
42
- });
43
-
44
36
  // <define:__ATBASH_PRIVATE_NODE_URLS__>
45
37
  var define_ATBASH_PRIVATE_NODE_URLS_default;
46
38
  var init_define_ATBASH_PRIVATE_NODE_URLS = __esm({
@@ -53,7 +45,6 @@ var init_define_ATBASH_PRIVATE_NODE_URLS = __esm({
53
45
  var require_buffer = __commonJS({
54
46
  "(disabled):node_modules/buffer/index.js"() {
55
47
  "use strict";
56
- init_define_ATBASH_CHROMIA_NODE_URLS();
57
48
  init_define_ATBASH_PRIVATE_NODE_URLS();
58
49
  }
59
50
  });
@@ -62,7 +53,6 @@ var require_buffer = __commonJS({
62
53
  var require_bn = __commonJS({
63
54
  "node_modules/bn.js/lib/bn.js"(exports, module) {
64
55
  "use strict";
65
- init_define_ATBASH_CHROMIA_NODE_URLS();
66
56
  init_define_ATBASH_PRIVATE_NODE_URLS();
67
57
  (function(module2, exports2) {
68
58
  "use strict";
@@ -2882,27 +2872,21 @@ var require_bn = __commonJS({
2882
2872
  });
2883
2873
 
2884
2874
  // src-ts/index.ts
2885
- init_define_ATBASH_CHROMIA_NODE_URLS();
2886
2875
  init_define_ATBASH_PRIVATE_NODE_URLS();
2887
2876
 
2888
2877
  // src-ts/browser/native.ts
2889
- init_define_ATBASH_CHROMIA_NODE_URLS();
2890
2878
  init_define_ATBASH_PRIVATE_NODE_URLS();
2891
2879
 
2892
2880
  // node_modules/@noble/curves/secp256k1.js
2893
- init_define_ATBASH_CHROMIA_NODE_URLS();
2894
2881
  init_define_ATBASH_PRIVATE_NODE_URLS();
2895
2882
 
2896
2883
  // node_modules/@noble/hashes/sha2.js
2897
- init_define_ATBASH_CHROMIA_NODE_URLS();
2898
2884
  init_define_ATBASH_PRIVATE_NODE_URLS();
2899
2885
 
2900
2886
  // node_modules/@noble/hashes/_md.js
2901
- init_define_ATBASH_CHROMIA_NODE_URLS();
2902
2887
  init_define_ATBASH_PRIVATE_NODE_URLS();
2903
2888
 
2904
2889
  // node_modules/@noble/hashes/utils.js
2905
- init_define_ATBASH_CHROMIA_NODE_URLS();
2906
2890
  init_define_ATBASH_PRIVATE_NODE_URLS();
2907
2891
  function isBytes(a) {
2908
2892
  return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
@@ -3325,11 +3309,9 @@ var sha256 = /* @__PURE__ */ createHasher(
3325
3309
  );
3326
3310
 
3327
3311
  // node_modules/@noble/curves/abstract/curve.js
3328
- init_define_ATBASH_CHROMIA_NODE_URLS();
3329
3312
  init_define_ATBASH_PRIVATE_NODE_URLS();
3330
3313
 
3331
3314
  // node_modules/@noble/curves/utils.js
3332
- init_define_ATBASH_CHROMIA_NODE_URLS();
3333
3315
  init_define_ATBASH_PRIVATE_NODE_URLS();
3334
3316
  var abytes2 = (value, length, title) => abytes(value, length, title);
3335
3317
  var anumber2 = anumber;
@@ -3483,7 +3465,6 @@ function validateObject(object, fields = {}, optFields = {}) {
3483
3465
  }
3484
3466
 
3485
3467
  // node_modules/@noble/curves/abstract/modular.js
3486
- init_define_ATBASH_CHROMIA_NODE_URLS();
3487
3468
  init_define_ATBASH_PRIVATE_NODE_URLS();
3488
3469
  var _0n2 = /* @__PURE__ */ BigInt(0);
3489
3470
  var _1n2 = /* @__PURE__ */ BigInt(1);
@@ -4133,11 +4114,9 @@ function createKeygen(randomSecretKey, getPublicKey) {
4133
4114
  }
4134
4115
 
4135
4116
  // node_modules/@noble/curves/abstract/weierstrass.js
4136
- init_define_ATBASH_CHROMIA_NODE_URLS();
4137
4117
  init_define_ATBASH_PRIVATE_NODE_URLS();
4138
4118
 
4139
4119
  // node_modules/@noble/hashes/hmac.js
4140
- init_define_ATBASH_CHROMIA_NODE_URLS();
4141
4120
  init_define_ATBASH_PRIVATE_NODE_URLS();
4142
4121
  var _HMAC = class {
4143
4122
  oHash;
@@ -5170,7 +5149,6 @@ var Pointk1 = /* @__PURE__ */ weierstrass(secp256k1_CURVE, {
5170
5149
  var secp256k1 = /* @__PURE__ */ ecdsa(Pointk1, sha256);
5171
5150
 
5172
5151
  // node_modules/postchain-client/built/esm/index.js
5173
- init_define_ATBASH_CHROMIA_NODE_URLS();
5174
5152
  init_define_ATBASH_PRIVATE_NODE_URLS();
5175
5153
  var import_bn = __toESM(require_bn(), 1);
5176
5154
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -43295,9 +43273,7 @@ var index = /* @__PURE__ */ getDefaultExportFromCjs(builtExports);
43295
43273
  // src-ts/browser/native.ts
43296
43274
  var { Buffer: Buffer3, gtx: pcgtx } = index;
43297
43275
  var ATBASH_ENDPOINT = "https://chromia-verified-ai-dev-two.vercel.app";
43298
- var ATBASH_BLOCKCHAIN_RID = "02668C5218871F69A93CC0F7032DCFFE06EF0D35EF2F0B07A92A3D83A3F23A7D";
43299
43276
  var ATBASH_PRIVATE_BLOCKCHAIN_RID = "2603569AE8DC3F254323F719C8D4347BBA964E874E781291F8474236BE8B6493";
43300
- var DEFAULT_CHROMIA_NODE_URLS_ARR = define_ATBASH_CHROMIA_NODE_URLS_default;
43301
43277
  var DEFAULT_PRIVATE_NODE_URLS_ARR = define_ATBASH_PRIVATE_NODE_URLS_default;
43302
43278
  var MERKLE_HASH_VERSION = 2;
43303
43279
  function stripHex(s2) {
@@ -43449,10 +43425,8 @@ var native = {
43449
43425
  deriveMemoryKey,
43450
43426
  encryptMemoryContent,
43451
43427
  decryptMemoryContent,
43452
- DEFAULT_BLOCKCHAIN_RID: ATBASH_BLOCKCHAIN_RID,
43453
43428
  DEFAULT_PRIVATE_BLOCKCHAIN_RID: ATBASH_PRIVATE_BLOCKCHAIN_RID,
43454
43429
  DEFAULT_ENDPOINT: ATBASH_ENDPOINT,
43455
- defaultChromiaNodeUrls: () => [...DEFAULT_CHROMIA_NODE_URLS_ARR],
43456
43430
  defaultPrivateNodeUrls: () => [...DEFAULT_PRIVATE_NODE_URLS_ARR],
43457
43431
  // Server-only surfaces — throw at runtime, keep types satisfied.
43458
43432
  // The memory signers are here and not with the other signing shims because
@@ -43522,11 +43496,9 @@ var native = {
43522
43496
  };
43523
43497
 
43524
43498
  // src-ts/client.ts
43525
- init_define_ATBASH_CHROMIA_NODE_URLS();
43526
43499
  init_define_ATBASH_PRIVATE_NODE_URLS();
43527
43500
 
43528
43501
  // src-ts/random.ts
43529
- init_define_ATBASH_CHROMIA_NODE_URLS();
43530
43502
  init_define_ATBASH_PRIVATE_NODE_URLS();
43531
43503
  function randomBytes4(size) {
43532
43504
  const buf = new Uint8Array(size);
@@ -43543,7 +43515,6 @@ function randomHex(size) {
43543
43515
  }
43544
43516
 
43545
43517
  // src-ts/auth-bearer.ts
43546
- init_define_ATBASH_CHROMIA_NODE_URLS();
43547
43518
  init_define_ATBASH_PRIVATE_NODE_URLS();
43548
43519
  var BEARER_TTL_MS = 4 * 60 * 1e3;
43549
43520
  var bearers = /* @__PURE__ */ new Map();
@@ -43569,47 +43540,36 @@ function agentAuthHeaders(auth, blockchainRid) {
43569
43540
  }
43570
43541
 
43571
43542
  // src-ts/chain-config.ts
43572
- init_define_ATBASH_CHROMIA_NODE_URLS();
43573
43543
  init_define_ATBASH_PRIVATE_NODE_URLS();
43574
-
43575
- // src-ts/constants.ts
43576
- init_define_ATBASH_CHROMIA_NODE_URLS();
43577
- init_define_ATBASH_PRIVATE_NODE_URLS();
43578
- var DEFAULT_ENDPOINT = native.DEFAULT_ENDPOINT;
43579
- var DEFAULT_CHROMIA_NODE_URLS = Object.freeze(
43580
- native.defaultChromiaNodeUrls()
43581
- );
43582
- var DEFAULT_BLOCKCHAIN_RID = native.DEFAULT_BLOCKCHAIN_RID;
43583
-
43584
- // src-ts/chain-config.ts
43585
43544
  var DEFAULT_PRIVATE_NODE_URLS = Object.freeze(
43586
43545
  native.defaultPrivateNodeUrls()
43587
43546
  );
43588
43547
  var DEFAULT_PRIVATE_BLOCKCHAIN_RID = native.DEFAULT_PRIVATE_BLOCKCHAIN_RID;
43589
- var PUBLIC_CHAIN = {
43590
- network: "public",
43591
- blockchainRid: DEFAULT_BLOCKCHAIN_RID,
43592
- nodeUrls: DEFAULT_CHROMIA_NODE_URLS
43593
- };
43594
43548
  var PRIVATE_CHAIN = {
43595
43549
  network: "private",
43596
43550
  blockchainRid: DEFAULT_PRIVATE_BLOCKCHAIN_RID,
43597
43551
  nodeUrls: DEFAULT_PRIVATE_NODE_URLS
43598
43552
  };
43599
43553
  function chainForNetwork(network) {
43600
- return network === "private" ? PRIVATE_CHAIN : PUBLIC_CHAIN;
43554
+ if (network !== "private") {
43555
+ throw new Error(
43556
+ `network must be "private" (the public chain is retired), got ${JSON.stringify(network)}`
43557
+ );
43558
+ }
43559
+ return PRIVATE_CHAIN;
43601
43560
  }
43602
43561
 
43562
+ // src-ts/constants.ts
43563
+ init_define_ATBASH_PRIVATE_NODE_URLS();
43564
+ var DEFAULT_ENDPOINT = native.DEFAULT_ENDPOINT;
43565
+
43603
43566
  // src-ts/browser/encrypted-toolcall.ts
43604
- init_define_ATBASH_CHROMIA_NODE_URLS();
43605
43567
  init_define_ATBASH_PRIVATE_NODE_URLS();
43606
43568
 
43607
43569
  // src-ts/browser/crypto-ecies.ts
43608
- init_define_ATBASH_CHROMIA_NODE_URLS();
43609
43570
  init_define_ATBASH_PRIVATE_NODE_URLS();
43610
43571
 
43611
43572
  // node_modules/@noble/hashes/hkdf.js
43612
- init_define_ATBASH_CHROMIA_NODE_URLS();
43613
43573
  init_define_ATBASH_PRIVATE_NODE_URLS();
43614
43574
  function extract(hash3, ikm, salt) {
43615
43575
  ahash(hash3);
@@ -43651,15 +43611,12 @@ function expand2(hash3, prk, info2, length = 32) {
43651
43611
  var hkdf = (hash3, ikm, salt, info2, length) => expand2(hash3, extract(hash3, ikm, salt), info2, length);
43652
43612
 
43653
43613
  // node_modules/@noble/ciphers/aes.js
43654
- init_define_ATBASH_CHROMIA_NODE_URLS();
43655
43614
  init_define_ATBASH_PRIVATE_NODE_URLS();
43656
43615
 
43657
43616
  // node_modules/@noble/ciphers/_polyval.js
43658
- init_define_ATBASH_CHROMIA_NODE_URLS();
43659
43617
  init_define_ATBASH_PRIVATE_NODE_URLS();
43660
43618
 
43661
43619
  // node_modules/@noble/ciphers/utils.js
43662
- init_define_ATBASH_CHROMIA_NODE_URLS();
43663
43620
  init_define_ATBASH_PRIVATE_NODE_URLS();
43664
43621
  function isBytes3(a) {
43665
43622
  return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
@@ -44253,7 +44210,6 @@ function encryptedLength(plaintextByteLength) {
44253
44210
  }
44254
44211
 
44255
44212
  // src-ts/crypto/envelope.ts
44256
- init_define_ATBASH_CHROMIA_NODE_URLS();
44257
44213
  init_define_ATBASH_PRIVATE_NODE_URLS();
44258
44214
  var PREFIX = "atb1";
44259
44215
  var SEPARATOR = ".";
@@ -44387,7 +44343,6 @@ function signEncryptedToolCall(toolCallId, action, context, toolName, toolArgsJs
44387
44343
  }
44388
44344
 
44389
44345
  // src-ts/endpoint.ts
44390
- init_define_ATBASH_CHROMIA_NODE_URLS();
44391
44346
  init_define_ATBASH_PRIVATE_NODE_URLS();
44392
44347
  function buildAllowedJudgeHosts() {
44393
44348
  return /* @__PURE__ */ new Set([
@@ -44446,7 +44401,6 @@ function validateJudgeEndpoint(judge) {
44446
44401
  }
44447
44402
 
44448
44403
  // src-ts/errors.ts
44449
- init_define_ATBASH_CHROMIA_NODE_URLS();
44450
44404
  init_define_ATBASH_PRIVATE_NODE_URLS();
44451
44405
  var AtbashAPIError = class extends Error {
44452
44406
  /** HTTP status code (or 0 if the request never completed). */
@@ -44511,7 +44465,6 @@ function enrich(status, body, statusText, endpoint, path3) {
44511
44465
  }
44512
44466
 
44513
44467
  // src-ts/jail-hold.ts
44514
- init_define_ATBASH_CHROMIA_NODE_URLS();
44515
44468
  init_define_ATBASH_PRIVATE_NODE_URLS();
44516
44469
  var DEFAULTS = { ceilingMs: 3e4, pollMs: 1e3 };
44517
44470
  var holds = /* @__PURE__ */ new Map();
@@ -44568,7 +44521,6 @@ function configureJailHold(next) {
44568
44521
  }
44569
44522
 
44570
44523
  // src-ts/http/client.ts
44571
- init_define_ATBASH_CHROMIA_NODE_URLS();
44572
44524
  init_define_ATBASH_PRIVATE_NODE_URLS();
44573
44525
  var HttpClient = class {
44574
44526
  baseUrl;
@@ -44674,7 +44626,6 @@ function classifyTransportError(err, url, method, timeoutMs) {
44674
44626
  }
44675
44627
 
44676
44628
  // src-ts/browser/keyLoader.ts
44677
- init_define_ATBASH_CHROMIA_NODE_URLS();
44678
44629
  init_define_ATBASH_PRIVATE_NODE_URLS();
44679
44630
  var NOT_AVAILABLE = "keyLoader is not available in the browser bundle \u2014 pass `agentKey` explicitly to Atbash.fromConfig or use `new Atbash(privkey, opts)`.";
44680
44631
  function resolveKeyPath(_input) {
@@ -44685,11 +44636,9 @@ function loadAgentFromFile(_keyPath) {
44685
44636
  }
44686
44637
 
44687
44638
  // src-ts/decision.ts
44688
- init_define_ATBASH_CHROMIA_NODE_URLS();
44689
44639
  init_define_ATBASH_PRIVATE_NODE_URLS();
44690
44640
 
44691
44641
  // src-ts/normalize.ts
44692
- init_define_ATBASH_CHROMIA_NODE_URLS();
44693
44642
  init_define_ATBASH_PRIVATE_NODE_URLS();
44694
44643
  function wireText(raw2, fallback = "") {
44695
44644
  if (raw2 === null || raw2 === void 0) return fallback;
@@ -44801,7 +44750,6 @@ function canonicalAllow(data) {
44801
44750
  }
44802
44751
 
44803
44752
  // src-ts/opentel/events.ts
44804
- init_define_ATBASH_CHROMIA_NODE_URLS();
44805
44753
  init_define_ATBASH_PRIVATE_NODE_URLS();
44806
44754
  var SLOW_MS = 1500;
44807
44755
  var SUCCESS_SAMPLE_RATE = 10;
@@ -44857,7 +44805,6 @@ function recordEvent(e) {
44857
44805
  }
44858
44806
 
44859
44807
  // src-ts/browser/opentel/telemetry.ts
44860
- init_define_ATBASH_CHROMIA_NODE_URLS();
44861
44808
  init_define_ATBASH_PRIVATE_NODE_URLS();
44862
44809
  function setupTelemetry(_config) {
44863
44810
  }
@@ -44871,7 +44818,6 @@ async function shutdownTelemetry() {
44871
44818
  }
44872
44819
 
44873
44820
  // src-ts/browser/userConfig.ts
44874
- init_define_ATBASH_CHROMIA_NODE_URLS();
44875
44821
  init_define_ATBASH_PRIVATE_NODE_URLS();
44876
44822
  var NOT_AVAILABLE2 = "userConfig file I/O is not available in the browser bundle.";
44877
44823
  function getConfigDir() {
@@ -44890,7 +44836,7 @@ function resolve(_key, flagValue) {
44890
44836
  return flagValue ?? "";
44891
44837
  }
44892
44838
  function forcedChainNetwork(flagValue) {
44893
- return flagValue === "public" || flagValue === "private" ? flagValue : void 0;
44839
+ return flagValue === "private" ? flagValue : void 0;
44894
44840
  }
44895
44841
  function agentKeyFromEnv() {
44896
44842
  return "";
@@ -44910,15 +44856,13 @@ function resolveConstructorChain(options) {
44910
44856
  const hasBrid = options.blockchainRid !== void 0;
44911
44857
  if (hasNodeUrls !== hasBrid) {
44912
44858
  throw new Error(
44913
- 'nodeUrls and blockchainRid must be provided together \u2014 passing one without the other 404s every chain request. Prefer `chain: PUBLIC_CHAIN | PRIVATE_CHAIN` or `network: "public" | "private"`.'
44859
+ 'nodeUrls and blockchainRid must be provided together \u2014 passing one without the other 404s every chain request. Prefer `chain: PRIVATE_CHAIN` or `network: "private"`.'
44914
44860
  );
44915
44861
  }
44916
44862
  if (hasNodeUrls && hasBrid) {
44917
- const brid = options.blockchainRid;
44918
- const derivedNetwork = options.network ?? (brid === PUBLIC_CHAIN.blockchainRid ? "public" : brid === PRIVATE_CHAIN.blockchainRid ? "private" : "private");
44919
44863
  return {
44920
- network: derivedNetwork,
44921
- blockchainRid: brid,
44864
+ network: "private",
44865
+ blockchainRid: options.blockchainRid,
44922
44866
  nodeUrls: options.nodeUrls
44923
44867
  };
44924
44868
  }
@@ -45058,10 +45002,9 @@ var Atbash = class _Atbash {
45058
45002
  _Atbash.environmentLogged = true;
45059
45003
  const brief = (rid) => rid ? `${rid.slice(0, 8)}\u2026` : "(unset)";
45060
45004
  this.logger.info?.(
45061
- `[atbash] environment \u2014 judge=${this.endpoint} publicChain=${brief(native.DEFAULT_BLOCKCHAIN_RID)} privateChain=${brief(native.DEFAULT_PRIVATE_BLOCKCHAIN_RID)} activeChain=${brief(this.blockchainRid)} responseSignatureCheck=${this.verifyPubKey ? "on" : "off"}`,
45005
+ `[atbash] environment \u2014 judge=${this.endpoint} privateChain=${brief(native.DEFAULT_PRIVATE_BLOCKCHAIN_RID)} activeChain=${brief(this.blockchainRid)} responseSignatureCheck=${this.verifyPubKey ? "on" : "off"}`,
45062
45006
  {
45063
45007
  judgeEndpoint: this.endpoint,
45064
- publicBlockchainRid: native.DEFAULT_BLOCKCHAIN_RID,
45065
45008
  privateBlockchainRid: native.DEFAULT_PRIVATE_BLOCKCHAIN_RID,
45066
45009
  activeBlockchainRid: this.blockchainRid,
45067
45010
  responseSignatureCheck: Boolean(this.verifyPubKey)
@@ -45334,7 +45277,9 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
45334
45277
  const startedAt = Date.now();
45335
45278
  let chainOpts = options.chainOpts;
45336
45279
  if (options.orgName && this._explicitChain) {
45337
- chainOpts = options.chainOpts ?? { network: this._defaultChain.network };
45280
+ chainOpts = options.chainOpts ?? {
45281
+ blockchainRid: this._defaultChain.blockchainRid
45282
+ };
45338
45283
  } else if (options.orgName && this.forcedNetwork()) {
45339
45284
  chainOpts = { network: this.forcedNetwork() };
45340
45285
  } else if (options.orgName) {
@@ -45344,8 +45289,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
45344
45289
  } else {
45345
45290
  const mapNetwork = await this.getActiveNetworkForOrg(options.orgName);
45346
45291
  if (mapNetwork) {
45347
- const chain = mapNetwork === "private" ? PRIVATE_CHAIN : PUBLIC_CHAIN;
45348
- this._chainCache.set(options.orgName, chain);
45292
+ this._chainCache.set(options.orgName, chainForNetwork(mapNetwork));
45349
45293
  chainOpts = { network: mapNetwork };
45350
45294
  } else if (!chainOpts?.blockchainRid) {
45351
45295
  const resolved = await this.resolveChainFromMap(
@@ -45883,21 +45827,16 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
45883
45827
  }
45884
45828
  if (resp.status !== 200) throw await this.httpError(resp);
45885
45829
  const data = await this.json(resp);
45886
- if (data?.network === "public" || data?.network === "private") {
45887
- return data.network;
45888
- }
45830
+ if (data?.network === "private") return data.network;
45889
45831
  return null;
45890
45832
  }
45891
45833
  /**
45892
45834
  * Resolve which chain an org's actions should run against. Cached
45893
45835
  * per-client by orgName. Resolution order:
45894
45836
  * 1. `org_networks` map (authoritative).
45895
- * 2. Per-chain subscription fallback — public + private records
45896
- * are fetched in parallel, with `is_private_blockchain` and
45897
- * `assigned_at` reconciling mixed states.
45898
- * A lookup that names exactly one chain wins outright. Where it names
45899
- * neither (a brand-new org) or cannot choose between them, the client's
45900
- * configured default decides.
45837
+ * 2. Subscription fallback — the org's subscription row on the chain.
45838
+ * A lookup that finds the org wins outright. Where it finds nothing (a
45839
+ * brand-new org), the client's configured default decides.
45901
45840
  */
45902
45841
  async resolveChainForOrg(orgName) {
45903
45842
  const name2 = orgName.trim();
@@ -45919,35 +45858,14 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
45919
45858
  const cached = this._chainCache.get(orgName);
45920
45859
  if (cached) return cached;
45921
45860
  if (mapNetwork) {
45922
- const chain = mapNetwork === "private" ? PRIVATE_CHAIN : PUBLIC_CHAIN;
45923
- this._chainCache.set(orgName, chain);
45924
- return chain;
45925
- }
45926
- const [pubRes, privRes] = await Promise.allSettled([
45927
- this.getOrgSubscription(orgName, "public"),
45928
- this.getOrgSubscription(orgName, "private")
45929
- ]);
45930
- const pubSub = pubRes.status === "fulfilled" ? pubRes.value : null;
45931
- const privSub = privRes.status === "fulfilled" ? privRes.value : null;
45932
- const failure = pubRes.status === "rejected" ? pubRes.reason : privRes.status === "rejected" ? privRes.reason : null;
45933
- if (pubSub?.is_private_blockchain) {
45934
- this._chainCache.set(orgName, PRIVATE_CHAIN);
45935
- return PRIVATE_CHAIN;
45936
- }
45937
- if (pubSub && privSub) {
45938
- const chain = privSub.assigned_at === pubSub.assigned_at ? this._defaultChain : privSub.assigned_at > pubSub.assigned_at ? PRIVATE_CHAIN : PUBLIC_CHAIN;
45861
+ const chain = chainForNetwork(mapNetwork);
45939
45862
  this._chainCache.set(orgName, chain);
45940
45863
  return chain;
45941
45864
  }
45942
- if (pubSub) {
45943
- this._chainCache.set(orgName, PUBLIC_CHAIN);
45944
- return PUBLIC_CHAIN;
45945
- }
45946
- if (privSub?.is_private_blockchain) {
45947
- this._chainCache.set(orgName, PRIVATE_CHAIN);
45948
- return PRIVATE_CHAIN;
45949
- }
45950
- if (failure) {
45865
+ let privSub;
45866
+ try {
45867
+ privSub = await this.getOrgSubscription(orgName, "private");
45868
+ } catch (failure) {
45951
45869
  const detail = failure instanceof Error ? failure.message : String(failure);
45952
45870
  throw new AtbashAPIError(
45953
45871
  failure instanceof AtbashAPIError ? failure.status : 0,
@@ -45956,6 +45874,10 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
45956
45874
  this.endpoint
45957
45875
  );
45958
45876
  }
45877
+ if (privSub) {
45878
+ this._chainCache.set(orgName, PRIVATE_CHAIN);
45879
+ return PRIVATE_CHAIN;
45880
+ }
45959
45881
  this._chainCache.set(orgName, this._defaultChain);
45960
45882
  return this._defaultChain;
45961
45883
  }
@@ -46012,8 +45934,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
46012
45934
  */
46013
45935
  bridFromChainOpts(chainOpts) {
46014
45936
  if (chainOpts?.blockchainRid) return chainOpts.blockchainRid;
46015
- if (chainOpts?.network === "private") return PRIVATE_CHAIN.blockchainRid;
46016
- if (chainOpts?.network === "public") return PUBLIC_CHAIN.blockchainRid;
45937
+ if (chainOpts?.network) return chainForNetwork(chainOpts.network).blockchainRid;
46017
45938
  return this.blockchainRid;
46018
45939
  }
46019
45940
  /**
@@ -46373,7 +46294,6 @@ function truncate(text, limit = MAX_ACTION_LEN) {
46373
46294
  }
46374
46295
 
46375
46296
  // src-ts/browser/key-path.ts
46376
- init_define_ATBASH_CHROMIA_NODE_URLS();
46377
46297
  init_define_ATBASH_PRIVATE_NODE_URLS();
46378
46298
  var KEY_FILENAMES = ["guard-client-key", "atbash-client-key"];
46379
46299
  var unavailable = (name2) => {
@@ -46387,7 +46307,6 @@ function chooseKeyPath(_input, _exists) {
46387
46307
  }
46388
46308
 
46389
46309
  // src-ts/redact.ts
46390
- init_define_ATBASH_CHROMIA_NODE_URLS();
46391
46310
  init_define_ATBASH_PRIVATE_NODE_URLS();
46392
46311
  function redactJsonStrings(value) {
46393
46312
  if (typeof value === "string") {
@@ -46407,7 +46326,6 @@ function redactJsonStrings(value) {
46407
46326
  }
46408
46327
 
46409
46328
  // src-ts/signature.ts
46410
- init_define_ATBASH_CHROMIA_NODE_URLS();
46411
46329
  init_define_ATBASH_PRIVATE_NODE_URLS();
46412
46330
  function verifyJudgeResponseSignature(bodyBytes, signatureHex, pubKeyHex) {
46413
46331
  if (!signatureHex) {
@@ -46431,7 +46349,6 @@ function verifyJudgeResponseSignature(bodyBytes, signatureHex, pubKeyHex) {
46431
46349
  }
46432
46350
 
46433
46351
  // src-ts/memory/boot-sync-message.ts
46434
- init_define_ATBASH_CHROMIA_NODE_URLS();
46435
46352
  init_define_ATBASH_PRIVATE_NODE_URLS();
46436
46353
  var BOOT_SYNC_HINT = "check the chain endpoint and orgName if the cause above does not explain it";
46437
46354
  function bootSyncFailureLine(cause) {
@@ -46444,11 +46361,9 @@ function bootSyncFailureLine(cause) {
46444
46361
  }
46445
46362
 
46446
46363
  // src-ts/memory/index.ts
46447
- init_define_ATBASH_CHROMIA_NODE_URLS();
46448
46364
  init_define_ATBASH_PRIVATE_NODE_URLS();
46449
46365
 
46450
46366
  // src-ts/browser/memory-crypto.ts
46451
- init_define_ATBASH_CHROMIA_NODE_URLS();
46452
46367
  init_define_ATBASH_PRIVATE_NODE_URLS();
46453
46368
  var { Buffer: Buffer4 } = index;
46454
46369
  var HKDF_INFO = new TextEncoder().encode("atbash:memory-encryption");
@@ -46524,7 +46439,6 @@ async function decryptMemoryContent2(ciphertext, nonce, key3) {
46524
46439
  }
46525
46440
 
46526
46441
  // src-ts/browser/memory-scan.ts
46527
- init_define_ATBASH_CHROMIA_NODE_URLS();
46528
46442
  init_define_ATBASH_PRIVATE_NODE_URLS();
46529
46443
  var STUB_MSG2 = "not available in @atbash/sdk browser bundle \u2014 scan memory server-side";
46530
46444
  async function scanMemory(_entry, _auth, _opts) {
@@ -46535,7 +46449,6 @@ async function scanMemoryBatch(_entries, _auth, _opts) {
46535
46449
  }
46536
46450
 
46537
46451
  // src-ts/browser/memory-chain.ts
46538
- init_define_ATBASH_CHROMIA_NODE_URLS();
46539
46452
  init_define_ATBASH_PRIVATE_NODE_URLS();
46540
46453
  var STUB_MSG3 = "not available in @atbash/sdk browser bundle \u2014 commit/rollback memory server-side";
46541
46454
  async function commitMemoryVersion(_plaintext, _auth, _opts) {
@@ -46564,7 +46477,6 @@ async function rollbackMemory(_toId, _reason, _auth, _opts) {
46564
46477
  }
46565
46478
 
46566
46479
  // src-ts/browser/memory-classifier.ts
46567
- init_define_ATBASH_CHROMIA_NODE_URLS();
46568
46480
  init_define_ATBASH_PRIVATE_NODE_URLS();
46569
46481
  var STUB_MSG4 = "not available in @atbash/sdk browser bundle \u2014 classify memory writes server-side";
46570
46482
  var DEFAULT_MEMORY_WRITE_TOOL_NAMES = [
@@ -46588,7 +46500,6 @@ function classifyMemoryWrite(_event, _ctx, _opts = {}) {
46588
46500
  }
46589
46501
 
46590
46502
  // src-ts/browser/memory-guard.ts
46591
- init_define_ATBASH_CHROMIA_NODE_URLS();
46592
46503
  init_define_ATBASH_PRIVATE_NODE_URLS();
46593
46504
  var STUB_MSG5 = "not available in @atbash/sdk browser bundle \u2014 guard memory writes agent-side";
46594
46505
  async function guardMemoryWrite(_input) {
@@ -46596,7 +46507,6 @@ async function guardMemoryWrite(_input) {
46596
46507
  }
46597
46508
 
46598
46509
  // src-ts/browser/memory-slot.ts
46599
- init_define_ATBASH_CHROMIA_NODE_URLS();
46600
46510
  init_define_ATBASH_PRIVATE_NODE_URLS();
46601
46511
  var unavailable2 = (name2) => {
46602
46512
  throw new Error(`${name2} is not available in the browser bundle`);
@@ -46606,7 +46516,6 @@ function memorySlotOf(_target, _home, _root2, _extraHomes, _p) {
46606
46516
  }
46607
46517
 
46608
46518
  // src-ts/memory/sync.ts
46609
- init_define_ATBASH_CHROMIA_NODE_URLS();
46610
46519
  init_define_ATBASH_PRIVATE_NODE_URLS();
46611
46520
  var MemoryIntegrityError = class extends Error {
46612
46521
  constructor(id, reason) {
@@ -46640,7 +46549,6 @@ async function syncLocalMemory(auth, pointer, opts = {}) {
46640
46549
  }
46641
46550
 
46642
46551
  // src-ts/browser/memory-pointer-store.ts
46643
- init_define_ATBASH_CHROMIA_NODE_URLS();
46644
46552
  init_define_ATBASH_PRIVATE_NODE_URLS();
46645
46553
  var unavailable3 = (name2) => {
46646
46554
  throw new Error(`${name2} is not available in the browser bundle`);
@@ -46660,7 +46568,6 @@ function defaultPointerPath(_workspaceDir) {
46660
46568
  }
46661
46569
 
46662
46570
  // src-ts/browser/memory-file-logger.ts
46663
- init_define_ATBASH_CHROMIA_NODE_URLS();
46664
46571
  init_define_ATBASH_PRIVATE_NODE_URLS();
46665
46572
  var unavailable4 = (name2) => {
46666
46573
  throw new Error(`${name2} is not available in the browser bundle`);
@@ -46673,7 +46580,6 @@ function defaultPluginLogPath(_workspaceDir) {
46673
46580
  }
46674
46581
 
46675
46582
  // src-ts/browser/memory-read-classifier.ts
46676
- init_define_ATBASH_CHROMIA_NODE_URLS();
46677
46583
  init_define_ATBASH_PRIVATE_NODE_URLS();
46678
46584
  var STUB_MSG6 = "not available in @atbash/sdk browser bundle \u2014 classify memory reads server-side";
46679
46585
  var DEFAULT_MEMORY_READ_TOOL_NAMES = [
@@ -46685,7 +46591,6 @@ function classifyMemoryRead(_event, _ctx, _opts = {}) {
46685
46591
  }
46686
46592
 
46687
46593
  // src-ts/browser/memory-guard-manager.ts
46688
- init_define_ATBASH_CHROMIA_NODE_URLS();
46689
46594
  init_define_ATBASH_PRIVATE_NODE_URLS();
46690
46595
  var unavailable5 = (name2) => {
46691
46596
  throw new Error(`${name2} is not available in the browser bundle`);
@@ -46769,8 +46674,6 @@ export {
46769
46674
  Atbash,
46770
46675
  AtbashAPIError,
46771
46676
  BOOT_SYNC_HINT,
46772
- DEFAULT_BLOCKCHAIN_RID,
46773
- DEFAULT_CHROMIA_NODE_URLS,
46774
46677
  DEFAULT_ENDPOINT,
46775
46678
  DEFAULT_MEMORY_PATH_PATTERNS,
46776
46679
  DEFAULT_MEMORY_READ_TOOL_NAMES,
@@ -46783,7 +46686,6 @@ export {
46783
46686
  MemoryGuardManager,
46784
46687
  MemoryIntegrityError,
46785
46688
  PRIVATE_CHAIN,
46786
- PUBLIC_CHAIN,
46787
46689
  PointerStore,
46788
46690
  SignatureVerificationError,
46789
46691
  bootSyncFailureLine,