@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.
- package/dist/browser.d.mts +14 -17
- package/dist/browser.mjs +33 -131
- package/dist/index.d.mts +14 -17
- package/dist/index.d.ts +14 -17
- package/dist/index.js +35 -70
- package/dist/index.mjs +35 -67
- package/index.d.ts +0 -4
- package/index.js +54 -56
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -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
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
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 = "
|
|
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 — `"
|
|
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.
|
|
752
|
-
*
|
|
753
|
-
*
|
|
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,
|
|
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/index.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
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 = "
|
|
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 — `"
|
|
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.
|
|
752
|
-
*
|
|
753
|
-
*
|
|
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,
|
|
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/index.js
CHANGED
|
@@ -33,8 +33,6 @@ __export(src_ts_exports, {
|
|
|
33
33
|
Atbash: () => Atbash,
|
|
34
34
|
AtbashAPIError: () => AtbashAPIError,
|
|
35
35
|
BOOT_SYNC_HINT: () => BOOT_SYNC_HINT,
|
|
36
|
-
DEFAULT_BLOCKCHAIN_RID: () => DEFAULT_BLOCKCHAIN_RID,
|
|
37
|
-
DEFAULT_CHROMIA_NODE_URLS: () => DEFAULT_CHROMIA_NODE_URLS,
|
|
38
36
|
DEFAULT_ENDPOINT: () => DEFAULT_ENDPOINT,
|
|
39
37
|
DEFAULT_MEMORY_PATH_PATTERNS: () => DEFAULT_MEMORY_PATH_PATTERNS,
|
|
40
38
|
DEFAULT_MEMORY_READ_TOOL_NAMES: () => DEFAULT_MEMORY_READ_TOOL_NAMES,
|
|
@@ -47,7 +45,6 @@ __export(src_ts_exports, {
|
|
|
47
45
|
MemoryGuardManager: () => MemoryGuardManager,
|
|
48
46
|
MemoryIntegrityError: () => MemoryIntegrityError,
|
|
49
47
|
PRIVATE_CHAIN: () => PRIVATE_CHAIN,
|
|
50
|
-
PUBLIC_CHAIN: () => PUBLIC_CHAIN,
|
|
51
48
|
PointerStore: () => PointerStore,
|
|
52
49
|
SignatureVerificationError: () => SignatureVerificationError,
|
|
53
50
|
bootSyncFailureLine: () => bootSyncFailureLine,
|
|
@@ -175,32 +172,28 @@ function agentAuthHeaders(auth, blockchainRid) {
|
|
|
175
172
|
return { Authorization: `Bearer ${agentAuthBearer(auth, blockchainRid)}` };
|
|
176
173
|
}
|
|
177
174
|
|
|
178
|
-
// src-ts/constants.ts
|
|
179
|
-
var DEFAULT_ENDPOINT = native.DEFAULT_ENDPOINT;
|
|
180
|
-
var DEFAULT_CHROMIA_NODE_URLS = Object.freeze(
|
|
181
|
-
native.defaultChromiaNodeUrls()
|
|
182
|
-
);
|
|
183
|
-
var DEFAULT_BLOCKCHAIN_RID = native.DEFAULT_BLOCKCHAIN_RID;
|
|
184
|
-
|
|
185
175
|
// src-ts/chain-config.ts
|
|
186
176
|
var DEFAULT_PRIVATE_NODE_URLS = Object.freeze(
|
|
187
177
|
native.defaultPrivateNodeUrls()
|
|
188
178
|
);
|
|
189
179
|
var DEFAULT_PRIVATE_BLOCKCHAIN_RID = native.DEFAULT_PRIVATE_BLOCKCHAIN_RID;
|
|
190
|
-
var PUBLIC_CHAIN = {
|
|
191
|
-
network: "public",
|
|
192
|
-
blockchainRid: DEFAULT_BLOCKCHAIN_RID,
|
|
193
|
-
nodeUrls: DEFAULT_CHROMIA_NODE_URLS
|
|
194
|
-
};
|
|
195
180
|
var PRIVATE_CHAIN = {
|
|
196
181
|
network: "private",
|
|
197
182
|
blockchainRid: DEFAULT_PRIVATE_BLOCKCHAIN_RID,
|
|
198
183
|
nodeUrls: DEFAULT_PRIVATE_NODE_URLS
|
|
199
184
|
};
|
|
200
185
|
function chainForNetwork(network) {
|
|
201
|
-
|
|
186
|
+
if (network !== "private") {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`network must be "private" (the public chain is retired), got ${JSON.stringify(network)}`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return PRIVATE_CHAIN;
|
|
202
192
|
}
|
|
203
193
|
|
|
194
|
+
// src-ts/constants.ts
|
|
195
|
+
var DEFAULT_ENDPOINT = native.DEFAULT_ENDPOINT;
|
|
196
|
+
|
|
204
197
|
// src-ts/encrypted-toolcall.ts
|
|
205
198
|
function columnAad(toolCallId, column) {
|
|
206
199
|
return `${toolCallId}:${column}`;
|
|
@@ -743,7 +736,7 @@ var import_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
|
743
736
|
var import_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
744
737
|
var import_sdk_logs = require("@opentelemetry/sdk-logs");
|
|
745
738
|
var import_node_crypto = require("crypto");
|
|
746
|
-
var SDK_VERSION = true ? "0.
|
|
739
|
+
var SDK_VERSION = true ? "0.21.0-dev.0" : "";
|
|
747
740
|
var SDK_LANGUAGE = "node";
|
|
748
741
|
function sdkResourceAttributes() {
|
|
749
742
|
const attrs = {
|
|
@@ -998,9 +991,9 @@ function resolve(key, flagValue) {
|
|
|
998
991
|
function forcedChainNetwork(flagValue) {
|
|
999
992
|
const raw = resolve("defaultChainNetwork", flagValue);
|
|
1000
993
|
if (!raw) return void 0;
|
|
1001
|
-
if (raw !== "
|
|
994
|
+
if (raw !== "private") {
|
|
1002
995
|
throw new Error(
|
|
1003
|
-
`ATBASH_DEFAULT_CHAIN_NETWORK / defaultChainNetwork must be "
|
|
996
|
+
`ATBASH_DEFAULT_CHAIN_NETWORK / defaultChainNetwork must be "private" (the public chain is retired), got ${JSON.stringify(raw)} \u2014 unset it to let each org's chain decide.`
|
|
1004
997
|
);
|
|
1005
998
|
}
|
|
1006
999
|
return raw;
|
|
@@ -1017,15 +1010,13 @@ function resolveConstructorChain(options) {
|
|
|
1017
1010
|
const hasBrid = options.blockchainRid !== void 0;
|
|
1018
1011
|
if (hasNodeUrls !== hasBrid) {
|
|
1019
1012
|
throw new Error(
|
|
1020
|
-
'nodeUrls and blockchainRid must be provided together \u2014 passing one without the other 404s every chain request. Prefer `chain:
|
|
1013
|
+
'nodeUrls and blockchainRid must be provided together \u2014 passing one without the other 404s every chain request. Prefer `chain: PRIVATE_CHAIN` or `network: "private"`.'
|
|
1021
1014
|
);
|
|
1022
1015
|
}
|
|
1023
1016
|
if (hasNodeUrls && hasBrid) {
|
|
1024
|
-
const brid = options.blockchainRid;
|
|
1025
|
-
const derivedNetwork = options.network ?? (brid === PUBLIC_CHAIN.blockchainRid ? "public" : brid === PRIVATE_CHAIN.blockchainRid ? "private" : "private");
|
|
1026
1017
|
return {
|
|
1027
|
-
network:
|
|
1028
|
-
blockchainRid:
|
|
1018
|
+
network: "private",
|
|
1019
|
+
blockchainRid: options.blockchainRid,
|
|
1029
1020
|
nodeUrls: options.nodeUrls
|
|
1030
1021
|
};
|
|
1031
1022
|
}
|
|
@@ -1165,10 +1156,9 @@ var Atbash = class _Atbash {
|
|
|
1165
1156
|
_Atbash.environmentLogged = true;
|
|
1166
1157
|
const brief = (rid) => rid ? `${rid.slice(0, 8)}\u2026` : "(unset)";
|
|
1167
1158
|
this.logger.info?.(
|
|
1168
|
-
`[atbash] environment \u2014 judge=${this.endpoint}
|
|
1159
|
+
`[atbash] environment \u2014 judge=${this.endpoint} privateChain=${brief(native.DEFAULT_PRIVATE_BLOCKCHAIN_RID)} activeChain=${brief(this.blockchainRid)} responseSignatureCheck=${this.verifyPubKey ? "on" : "off"}`,
|
|
1169
1160
|
{
|
|
1170
1161
|
judgeEndpoint: this.endpoint,
|
|
1171
|
-
publicBlockchainRid: native.DEFAULT_BLOCKCHAIN_RID,
|
|
1172
1162
|
privateBlockchainRid: native.DEFAULT_PRIVATE_BLOCKCHAIN_RID,
|
|
1173
1163
|
activeBlockchainRid: this.blockchainRid,
|
|
1174
1164
|
responseSignatureCheck: Boolean(this.verifyPubKey)
|
|
@@ -1441,7 +1431,9 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1441
1431
|
const startedAt = Date.now();
|
|
1442
1432
|
let chainOpts = options.chainOpts;
|
|
1443
1433
|
if (options.orgName && this._explicitChain) {
|
|
1444
|
-
chainOpts = options.chainOpts ?? {
|
|
1434
|
+
chainOpts = options.chainOpts ?? {
|
|
1435
|
+
blockchainRid: this._defaultChain.blockchainRid
|
|
1436
|
+
};
|
|
1445
1437
|
} else if (options.orgName && this.forcedNetwork()) {
|
|
1446
1438
|
chainOpts = { network: this.forcedNetwork() };
|
|
1447
1439
|
} else if (options.orgName) {
|
|
@@ -1451,8 +1443,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1451
1443
|
} else {
|
|
1452
1444
|
const mapNetwork = await this.getActiveNetworkForOrg(options.orgName);
|
|
1453
1445
|
if (mapNetwork) {
|
|
1454
|
-
|
|
1455
|
-
this._chainCache.set(options.orgName, chain);
|
|
1446
|
+
this._chainCache.set(options.orgName, chainForNetwork(mapNetwork));
|
|
1456
1447
|
chainOpts = { network: mapNetwork };
|
|
1457
1448
|
} else if (!chainOpts?.blockchainRid) {
|
|
1458
1449
|
const resolved = await this.resolveChainFromMap(
|
|
@@ -1990,21 +1981,16 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1990
1981
|
}
|
|
1991
1982
|
if (resp.status !== 200) throw await this.httpError(resp);
|
|
1992
1983
|
const data = await this.json(resp);
|
|
1993
|
-
if (data?.network === "
|
|
1994
|
-
return data.network;
|
|
1995
|
-
}
|
|
1984
|
+
if (data?.network === "private") return data.network;
|
|
1996
1985
|
return null;
|
|
1997
1986
|
}
|
|
1998
1987
|
/**
|
|
1999
1988
|
* Resolve which chain an org's actions should run against. Cached
|
|
2000
1989
|
* per-client by orgName. Resolution order:
|
|
2001
1990
|
* 1. `org_networks` map (authoritative).
|
|
2002
|
-
* 2.
|
|
2003
|
-
*
|
|
2004
|
-
*
|
|
2005
|
-
* A lookup that names exactly one chain wins outright. Where it names
|
|
2006
|
-
* neither (a brand-new org) or cannot choose between them, the client's
|
|
2007
|
-
* configured default decides.
|
|
1991
|
+
* 2. Subscription fallback — the org's subscription row on the chain.
|
|
1992
|
+
* A lookup that finds the org wins outright. Where it finds nothing (a
|
|
1993
|
+
* brand-new org), the client's configured default decides.
|
|
2008
1994
|
*/
|
|
2009
1995
|
async resolveChainForOrg(orgName) {
|
|
2010
1996
|
const name = orgName.trim();
|
|
@@ -2026,35 +2012,14 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
2026
2012
|
const cached = this._chainCache.get(orgName);
|
|
2027
2013
|
if (cached) return cached;
|
|
2028
2014
|
if (mapNetwork) {
|
|
2029
|
-
const chain = mapNetwork
|
|
2015
|
+
const chain = chainForNetwork(mapNetwork);
|
|
2030
2016
|
this._chainCache.set(orgName, chain);
|
|
2031
2017
|
return chain;
|
|
2032
2018
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
this.getOrgSubscription(orgName, "private")
|
|
2036
|
-
|
|
2037
|
-
const pubSub = pubRes.status === "fulfilled" ? pubRes.value : null;
|
|
2038
|
-
const privSub = privRes.status === "fulfilled" ? privRes.value : null;
|
|
2039
|
-
const failure2 = pubRes.status === "rejected" ? pubRes.reason : privRes.status === "rejected" ? privRes.reason : null;
|
|
2040
|
-
if (pubSub?.is_private_blockchain) {
|
|
2041
|
-
this._chainCache.set(orgName, PRIVATE_CHAIN);
|
|
2042
|
-
return PRIVATE_CHAIN;
|
|
2043
|
-
}
|
|
2044
|
-
if (pubSub && privSub) {
|
|
2045
|
-
const chain = privSub.assigned_at === pubSub.assigned_at ? this._defaultChain : privSub.assigned_at > pubSub.assigned_at ? PRIVATE_CHAIN : PUBLIC_CHAIN;
|
|
2046
|
-
this._chainCache.set(orgName, chain);
|
|
2047
|
-
return chain;
|
|
2048
|
-
}
|
|
2049
|
-
if (pubSub) {
|
|
2050
|
-
this._chainCache.set(orgName, PUBLIC_CHAIN);
|
|
2051
|
-
return PUBLIC_CHAIN;
|
|
2052
|
-
}
|
|
2053
|
-
if (privSub?.is_private_blockchain) {
|
|
2054
|
-
this._chainCache.set(orgName, PRIVATE_CHAIN);
|
|
2055
|
-
return PRIVATE_CHAIN;
|
|
2056
|
-
}
|
|
2057
|
-
if (failure2) {
|
|
2019
|
+
let privSub;
|
|
2020
|
+
try {
|
|
2021
|
+
privSub = await this.getOrgSubscription(orgName, "private");
|
|
2022
|
+
} catch (failure2) {
|
|
2058
2023
|
const detail = failure2 instanceof Error ? failure2.message : String(failure2);
|
|
2059
2024
|
throw new AtbashAPIError(
|
|
2060
2025
|
failure2 instanceof AtbashAPIError ? failure2.status : 0,
|
|
@@ -2063,6 +2028,10 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
2063
2028
|
this.endpoint
|
|
2064
2029
|
);
|
|
2065
2030
|
}
|
|
2031
|
+
if (privSub) {
|
|
2032
|
+
this._chainCache.set(orgName, PRIVATE_CHAIN);
|
|
2033
|
+
return PRIVATE_CHAIN;
|
|
2034
|
+
}
|
|
2066
2035
|
this._chainCache.set(orgName, this._defaultChain);
|
|
2067
2036
|
return this._defaultChain;
|
|
2068
2037
|
}
|
|
@@ -2119,8 +2088,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
2119
2088
|
*/
|
|
2120
2089
|
bridFromChainOpts(chainOpts) {
|
|
2121
2090
|
if (chainOpts?.blockchainRid) return chainOpts.blockchainRid;
|
|
2122
|
-
if (chainOpts?.network
|
|
2123
|
-
if (chainOpts?.network === "public") return PUBLIC_CHAIN.blockchainRid;
|
|
2091
|
+
if (chainOpts?.network) return chainForNetwork(chainOpts.network).blockchainRid;
|
|
2124
2092
|
return this.blockchainRid;
|
|
2125
2093
|
}
|
|
2126
2094
|
/**
|
|
@@ -2717,7 +2685,7 @@ function resolveBlockchainRid(chainOpts) {
|
|
|
2717
2685
|
if (chainOpts?.blockchainRid !== void 0) return chainOpts.blockchainRid;
|
|
2718
2686
|
if (chainOpts?.nodeUrls !== void 0) {
|
|
2719
2687
|
throw new Error(
|
|
2720
|
-
'chainOpts.nodeUrls no longer selects a chain on its own \u2014 memory reaches the chain through the Atbash service, not a node. Set `blockchainRid`, or `network: "
|
|
2688
|
+
'chainOpts.nodeUrls no longer selects a chain on its own \u2014 memory reaches the chain through the Atbash service, not a node. Set `blockchainRid`, or `network: "private"`.'
|
|
2721
2689
|
);
|
|
2722
2690
|
}
|
|
2723
2691
|
const config2 = chainForNetwork(
|
|
@@ -4036,8 +4004,6 @@ function diffMemorySnapshots(before, after) {
|
|
|
4036
4004
|
Atbash,
|
|
4037
4005
|
AtbashAPIError,
|
|
4038
4006
|
BOOT_SYNC_HINT,
|
|
4039
|
-
DEFAULT_BLOCKCHAIN_RID,
|
|
4040
|
-
DEFAULT_CHROMIA_NODE_URLS,
|
|
4041
4007
|
DEFAULT_ENDPOINT,
|
|
4042
4008
|
DEFAULT_MEMORY_PATH_PATTERNS,
|
|
4043
4009
|
DEFAULT_MEMORY_READ_TOOL_NAMES,
|
|
@@ -4050,7 +4016,6 @@ function diffMemorySnapshots(before, after) {
|
|
|
4050
4016
|
MemoryGuardManager,
|
|
4051
4017
|
MemoryIntegrityError,
|
|
4052
4018
|
PRIVATE_CHAIN,
|
|
4053
|
-
PUBLIC_CHAIN,
|
|
4054
4019
|
PointerStore,
|
|
4055
4020
|
SignatureVerificationError,
|
|
4056
4021
|
bootSyncFailureLine,
|
package/dist/index.mjs
CHANGED
|
@@ -43,32 +43,28 @@ function agentAuthHeaders(auth, blockchainRid) {
|
|
|
43
43
|
return { Authorization: `Bearer ${agentAuthBearer(auth, blockchainRid)}` };
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// src-ts/constants.ts
|
|
47
|
-
var DEFAULT_ENDPOINT = native.DEFAULT_ENDPOINT;
|
|
48
|
-
var DEFAULT_CHROMIA_NODE_URLS = Object.freeze(
|
|
49
|
-
native.defaultChromiaNodeUrls()
|
|
50
|
-
);
|
|
51
|
-
var DEFAULT_BLOCKCHAIN_RID = native.DEFAULT_BLOCKCHAIN_RID;
|
|
52
|
-
|
|
53
46
|
// src-ts/chain-config.ts
|
|
54
47
|
var DEFAULT_PRIVATE_NODE_URLS = Object.freeze(
|
|
55
48
|
native.defaultPrivateNodeUrls()
|
|
56
49
|
);
|
|
57
50
|
var DEFAULT_PRIVATE_BLOCKCHAIN_RID = native.DEFAULT_PRIVATE_BLOCKCHAIN_RID;
|
|
58
|
-
var PUBLIC_CHAIN = {
|
|
59
|
-
network: "public",
|
|
60
|
-
blockchainRid: DEFAULT_BLOCKCHAIN_RID,
|
|
61
|
-
nodeUrls: DEFAULT_CHROMIA_NODE_URLS
|
|
62
|
-
};
|
|
63
51
|
var PRIVATE_CHAIN = {
|
|
64
52
|
network: "private",
|
|
65
53
|
blockchainRid: DEFAULT_PRIVATE_BLOCKCHAIN_RID,
|
|
66
54
|
nodeUrls: DEFAULT_PRIVATE_NODE_URLS
|
|
67
55
|
};
|
|
68
56
|
function chainForNetwork(network) {
|
|
69
|
-
|
|
57
|
+
if (network !== "private") {
|
|
58
|
+
throw new Error(
|
|
59
|
+
`network must be "private" (the public chain is retired), got ${JSON.stringify(network)}`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return PRIVATE_CHAIN;
|
|
70
63
|
}
|
|
71
64
|
|
|
65
|
+
// src-ts/constants.ts
|
|
66
|
+
var DEFAULT_ENDPOINT = native.DEFAULT_ENDPOINT;
|
|
67
|
+
|
|
72
68
|
// src-ts/encrypted-toolcall.ts
|
|
73
69
|
function columnAad(toolCallId, column) {
|
|
74
70
|
return `${toolCallId}:${column}`;
|
|
@@ -617,7 +613,7 @@ import {
|
|
|
617
613
|
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
|
618
614
|
import { BatchLogRecordProcessor, LoggerProvider } from "@opentelemetry/sdk-logs";
|
|
619
615
|
import { createHash } from "crypto";
|
|
620
|
-
var SDK_VERSION = true ? "0.
|
|
616
|
+
var SDK_VERSION = true ? "0.21.0-dev.0" : "";
|
|
621
617
|
var SDK_LANGUAGE = "node";
|
|
622
618
|
function sdkResourceAttributes() {
|
|
623
619
|
const attrs = {
|
|
@@ -878,9 +874,9 @@ function resolve(key, flagValue) {
|
|
|
878
874
|
function forcedChainNetwork(flagValue) {
|
|
879
875
|
const raw = resolve("defaultChainNetwork", flagValue);
|
|
880
876
|
if (!raw) return void 0;
|
|
881
|
-
if (raw !== "
|
|
877
|
+
if (raw !== "private") {
|
|
882
878
|
throw new Error(
|
|
883
|
-
`ATBASH_DEFAULT_CHAIN_NETWORK / defaultChainNetwork must be "
|
|
879
|
+
`ATBASH_DEFAULT_CHAIN_NETWORK / defaultChainNetwork must be "private" (the public chain is retired), got ${JSON.stringify(raw)} \u2014 unset it to let each org's chain decide.`
|
|
884
880
|
);
|
|
885
881
|
}
|
|
886
882
|
return raw;
|
|
@@ -897,15 +893,13 @@ function resolveConstructorChain(options) {
|
|
|
897
893
|
const hasBrid = options.blockchainRid !== void 0;
|
|
898
894
|
if (hasNodeUrls !== hasBrid) {
|
|
899
895
|
throw new Error(
|
|
900
|
-
'nodeUrls and blockchainRid must be provided together \u2014 passing one without the other 404s every chain request. Prefer `chain:
|
|
896
|
+
'nodeUrls and blockchainRid must be provided together \u2014 passing one without the other 404s every chain request. Prefer `chain: PRIVATE_CHAIN` or `network: "private"`.'
|
|
901
897
|
);
|
|
902
898
|
}
|
|
903
899
|
if (hasNodeUrls && hasBrid) {
|
|
904
|
-
const brid = options.blockchainRid;
|
|
905
|
-
const derivedNetwork = options.network ?? (brid === PUBLIC_CHAIN.blockchainRid ? "public" : brid === PRIVATE_CHAIN.blockchainRid ? "private" : "private");
|
|
906
900
|
return {
|
|
907
|
-
network:
|
|
908
|
-
blockchainRid:
|
|
901
|
+
network: "private",
|
|
902
|
+
blockchainRid: options.blockchainRid,
|
|
909
903
|
nodeUrls: options.nodeUrls
|
|
910
904
|
};
|
|
911
905
|
}
|
|
@@ -1045,10 +1039,9 @@ var Atbash = class _Atbash {
|
|
|
1045
1039
|
_Atbash.environmentLogged = true;
|
|
1046
1040
|
const brief = (rid) => rid ? `${rid.slice(0, 8)}\u2026` : "(unset)";
|
|
1047
1041
|
this.logger.info?.(
|
|
1048
|
-
`[atbash] environment \u2014 judge=${this.endpoint}
|
|
1042
|
+
`[atbash] environment \u2014 judge=${this.endpoint} privateChain=${brief(native.DEFAULT_PRIVATE_BLOCKCHAIN_RID)} activeChain=${brief(this.blockchainRid)} responseSignatureCheck=${this.verifyPubKey ? "on" : "off"}`,
|
|
1049
1043
|
{
|
|
1050
1044
|
judgeEndpoint: this.endpoint,
|
|
1051
|
-
publicBlockchainRid: native.DEFAULT_BLOCKCHAIN_RID,
|
|
1052
1045
|
privateBlockchainRid: native.DEFAULT_PRIVATE_BLOCKCHAIN_RID,
|
|
1053
1046
|
activeBlockchainRid: this.blockchainRid,
|
|
1054
1047
|
responseSignatureCheck: Boolean(this.verifyPubKey)
|
|
@@ -1321,7 +1314,9 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1321
1314
|
const startedAt = Date.now();
|
|
1322
1315
|
let chainOpts = options.chainOpts;
|
|
1323
1316
|
if (options.orgName && this._explicitChain) {
|
|
1324
|
-
chainOpts = options.chainOpts ?? {
|
|
1317
|
+
chainOpts = options.chainOpts ?? {
|
|
1318
|
+
blockchainRid: this._defaultChain.blockchainRid
|
|
1319
|
+
};
|
|
1325
1320
|
} else if (options.orgName && this.forcedNetwork()) {
|
|
1326
1321
|
chainOpts = { network: this.forcedNetwork() };
|
|
1327
1322
|
} else if (options.orgName) {
|
|
@@ -1331,8 +1326,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1331
1326
|
} else {
|
|
1332
1327
|
const mapNetwork = await this.getActiveNetworkForOrg(options.orgName);
|
|
1333
1328
|
if (mapNetwork) {
|
|
1334
|
-
|
|
1335
|
-
this._chainCache.set(options.orgName, chain);
|
|
1329
|
+
this._chainCache.set(options.orgName, chainForNetwork(mapNetwork));
|
|
1336
1330
|
chainOpts = { network: mapNetwork };
|
|
1337
1331
|
} else if (!chainOpts?.blockchainRid) {
|
|
1338
1332
|
const resolved = await this.resolveChainFromMap(
|
|
@@ -1870,21 +1864,16 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1870
1864
|
}
|
|
1871
1865
|
if (resp.status !== 200) throw await this.httpError(resp);
|
|
1872
1866
|
const data = await this.json(resp);
|
|
1873
|
-
if (data?.network === "
|
|
1874
|
-
return data.network;
|
|
1875
|
-
}
|
|
1867
|
+
if (data?.network === "private") return data.network;
|
|
1876
1868
|
return null;
|
|
1877
1869
|
}
|
|
1878
1870
|
/**
|
|
1879
1871
|
* Resolve which chain an org's actions should run against. Cached
|
|
1880
1872
|
* per-client by orgName. Resolution order:
|
|
1881
1873
|
* 1. `org_networks` map (authoritative).
|
|
1882
|
-
* 2.
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
1885
|
-
* A lookup that names exactly one chain wins outright. Where it names
|
|
1886
|
-
* neither (a brand-new org) or cannot choose between them, the client's
|
|
1887
|
-
* configured default decides.
|
|
1874
|
+
* 2. Subscription fallback — the org's subscription row on the chain.
|
|
1875
|
+
* A lookup that finds the org wins outright. Where it finds nothing (a
|
|
1876
|
+
* brand-new org), the client's configured default decides.
|
|
1888
1877
|
*/
|
|
1889
1878
|
async resolveChainForOrg(orgName) {
|
|
1890
1879
|
const name = orgName.trim();
|
|
@@ -1906,35 +1895,14 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1906
1895
|
const cached = this._chainCache.get(orgName);
|
|
1907
1896
|
if (cached) return cached;
|
|
1908
1897
|
if (mapNetwork) {
|
|
1909
|
-
const chain = mapNetwork
|
|
1898
|
+
const chain = chainForNetwork(mapNetwork);
|
|
1910
1899
|
this._chainCache.set(orgName, chain);
|
|
1911
1900
|
return chain;
|
|
1912
1901
|
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
this.getOrgSubscription(orgName, "private")
|
|
1916
|
-
|
|
1917
|
-
const pubSub = pubRes.status === "fulfilled" ? pubRes.value : null;
|
|
1918
|
-
const privSub = privRes.status === "fulfilled" ? privRes.value : null;
|
|
1919
|
-
const failure2 = pubRes.status === "rejected" ? pubRes.reason : privRes.status === "rejected" ? privRes.reason : null;
|
|
1920
|
-
if (pubSub?.is_private_blockchain) {
|
|
1921
|
-
this._chainCache.set(orgName, PRIVATE_CHAIN);
|
|
1922
|
-
return PRIVATE_CHAIN;
|
|
1923
|
-
}
|
|
1924
|
-
if (pubSub && privSub) {
|
|
1925
|
-
const chain = privSub.assigned_at === pubSub.assigned_at ? this._defaultChain : privSub.assigned_at > pubSub.assigned_at ? PRIVATE_CHAIN : PUBLIC_CHAIN;
|
|
1926
|
-
this._chainCache.set(orgName, chain);
|
|
1927
|
-
return chain;
|
|
1928
|
-
}
|
|
1929
|
-
if (pubSub) {
|
|
1930
|
-
this._chainCache.set(orgName, PUBLIC_CHAIN);
|
|
1931
|
-
return PUBLIC_CHAIN;
|
|
1932
|
-
}
|
|
1933
|
-
if (privSub?.is_private_blockchain) {
|
|
1934
|
-
this._chainCache.set(orgName, PRIVATE_CHAIN);
|
|
1935
|
-
return PRIVATE_CHAIN;
|
|
1936
|
-
}
|
|
1937
|
-
if (failure2) {
|
|
1902
|
+
let privSub;
|
|
1903
|
+
try {
|
|
1904
|
+
privSub = await this.getOrgSubscription(orgName, "private");
|
|
1905
|
+
} catch (failure2) {
|
|
1938
1906
|
const detail = failure2 instanceof Error ? failure2.message : String(failure2);
|
|
1939
1907
|
throw new AtbashAPIError(
|
|
1940
1908
|
failure2 instanceof AtbashAPIError ? failure2.status : 0,
|
|
@@ -1943,6 +1911,10 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1943
1911
|
this.endpoint
|
|
1944
1912
|
);
|
|
1945
1913
|
}
|
|
1914
|
+
if (privSub) {
|
|
1915
|
+
this._chainCache.set(orgName, PRIVATE_CHAIN);
|
|
1916
|
+
return PRIVATE_CHAIN;
|
|
1917
|
+
}
|
|
1946
1918
|
this._chainCache.set(orgName, this._defaultChain);
|
|
1947
1919
|
return this._defaultChain;
|
|
1948
1920
|
}
|
|
@@ -1999,8 +1971,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1999
1971
|
*/
|
|
2000
1972
|
bridFromChainOpts(chainOpts) {
|
|
2001
1973
|
if (chainOpts?.blockchainRid) return chainOpts.blockchainRid;
|
|
2002
|
-
if (chainOpts?.network
|
|
2003
|
-
if (chainOpts?.network === "public") return PUBLIC_CHAIN.blockchainRid;
|
|
1974
|
+
if (chainOpts?.network) return chainForNetwork(chainOpts.network).blockchainRid;
|
|
2004
1975
|
return this.blockchainRid;
|
|
2005
1976
|
}
|
|
2006
1977
|
/**
|
|
@@ -2597,7 +2568,7 @@ function resolveBlockchainRid(chainOpts) {
|
|
|
2597
2568
|
if (chainOpts?.blockchainRid !== void 0) return chainOpts.blockchainRid;
|
|
2598
2569
|
if (chainOpts?.nodeUrls !== void 0) {
|
|
2599
2570
|
throw new Error(
|
|
2600
|
-
'chainOpts.nodeUrls no longer selects a chain on its own \u2014 memory reaches the chain through the Atbash service, not a node. Set `blockchainRid`, or `network: "
|
|
2571
|
+
'chainOpts.nodeUrls no longer selects a chain on its own \u2014 memory reaches the chain through the Atbash service, not a node. Set `blockchainRid`, or `network: "private"`.'
|
|
2601
2572
|
);
|
|
2602
2573
|
}
|
|
2603
2574
|
const config2 = chainForNetwork(
|
|
@@ -3915,8 +3886,6 @@ export {
|
|
|
3915
3886
|
Atbash,
|
|
3916
3887
|
AtbashAPIError,
|
|
3917
3888
|
BOOT_SYNC_HINT,
|
|
3918
|
-
DEFAULT_BLOCKCHAIN_RID,
|
|
3919
|
-
DEFAULT_CHROMIA_NODE_URLS,
|
|
3920
3889
|
DEFAULT_ENDPOINT,
|
|
3921
3890
|
DEFAULT_MEMORY_PATH_PATTERNS,
|
|
3922
3891
|
DEFAULT_MEMORY_READ_TOOL_NAMES,
|
|
@@ -3929,7 +3898,6 @@ export {
|
|
|
3929
3898
|
MemoryGuardManager,
|
|
3930
3899
|
MemoryIntegrityError,
|
|
3931
3900
|
PRIVATE_CHAIN,
|
|
3932
|
-
PUBLIC_CHAIN,
|
|
3933
3901
|
PointerStore,
|
|
3934
3902
|
SignatureVerificationError,
|
|
3935
3903
|
bootSyncFailureLine,
|
package/index.d.ts
CHANGED
|
@@ -88,16 +88,12 @@ export declare function decryptForOrg(payload: Buffer, orgPrivKeyHex: string, aa
|
|
|
88
88
|
|
|
89
89
|
export declare function decryptMemoryContent(ciphertext: Buffer, nonce: Buffer, key: Buffer): string
|
|
90
90
|
|
|
91
|
-
export declare const DEFAULT_BLOCKCHAIN_RID: string
|
|
92
|
-
|
|
93
91
|
export declare const DEFAULT_ENDPOINT: string
|
|
94
92
|
|
|
95
93
|
export declare const DEFAULT_PRIVATE_BLOCKCHAIN_RID: string
|
|
96
94
|
|
|
97
95
|
export declare function defaultAgentHomeDirs(): Array<string>
|
|
98
96
|
|
|
99
|
-
export declare function defaultChromiaNodeUrls(): Array<string>
|
|
100
|
-
|
|
101
97
|
export declare function defaultMemoryPathPatterns(): Array<string>
|
|
102
98
|
|
|
103
99
|
export declare function defaultMemoryReadToolNames(): Array<string>
|