@atbash/sdk 0.12.0-dev.0 → 0.13.2-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 +89 -11
- package/dist/browser.mjs +133 -29
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +89 -11
- package/dist/index.d.ts +89 -11
- package/dist/index.js +179 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +176 -42
- package/dist/index.mjs.map +1 -1
- package/index.d.ts +25 -16
- package/index.js +294 -103
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -30,6 +30,15 @@ interface ValidatedEndpoint {
|
|
|
30
30
|
declare function buildAllowedJudgeHosts(): ReadonlySet<string>;
|
|
31
31
|
declare function validateJudgeEndpoint(judge?: JudgeEndpointConfig): ValidatedEndpoint;
|
|
32
32
|
|
|
33
|
+
interface ChainConfig {
|
|
34
|
+
readonly network: Network;
|
|
35
|
+
readonly blockchainRid: string;
|
|
36
|
+
readonly nodeUrls: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
declare const PUBLIC_CHAIN: ChainConfig;
|
|
39
|
+
declare const PRIVATE_CHAIN: ChainConfig;
|
|
40
|
+
declare function chainForNetwork(network: Network): ChainConfig;
|
|
41
|
+
|
|
33
42
|
/**
|
|
34
43
|
* User-facing types. Two groups:
|
|
35
44
|
* - Core types — the exact shapes the Rust core emits across the NAPI
|
|
@@ -290,7 +299,24 @@ interface AtbashLogger {
|
|
|
290
299
|
interface AtbashOptions {
|
|
291
300
|
endpoint?: string;
|
|
292
301
|
timeoutMs?: number;
|
|
302
|
+
/**
|
|
303
|
+
* Full chain override — BRID + nodeUrls in one object. Wins over every
|
|
304
|
+
* other chain selector. Prefer this over paired `nodeUrls`/`blockchainRid`
|
|
305
|
+
* for anything but backwards compatibility.
|
|
306
|
+
*/
|
|
307
|
+
chain?: ChainConfig;
|
|
308
|
+
/**
|
|
309
|
+
* Preset chain selector — `"public"` or `"private"`. Resolves to the
|
|
310
|
+
* matching `ChainConfig` via `chainForNetwork()`. Overridden by `chain`,
|
|
311
|
+
* overrides env `ATBASH_DEFAULT_CHAIN_NETWORK` and the config file.
|
|
312
|
+
*/
|
|
313
|
+
network?: Network;
|
|
314
|
+
/**
|
|
315
|
+
* Explicit node URLs. Must be paired with `blockchainRid`. Passing one
|
|
316
|
+
* without the other throws — a BRID/nodes mismatch 404s every request.
|
|
317
|
+
*/
|
|
293
318
|
nodeUrls?: readonly string[];
|
|
319
|
+
/** Explicit BRID. Must be paired with `nodeUrls`. See {@link nodeUrls}. */
|
|
294
320
|
blockchainRid?: string;
|
|
295
321
|
/**
|
|
296
322
|
* Default org name. When set, `judgeAction` / `auditToolCall` resolve
|
|
@@ -357,6 +383,10 @@ interface FromConfigOptions {
|
|
|
357
383
|
keyPath?: string;
|
|
358
384
|
/** Judge endpoint config — validated against the allowlist / self-hosted policy. */
|
|
359
385
|
judge?: JudgeEndpointConfig;
|
|
386
|
+
/** See {@link AtbashOptions.chain}. */
|
|
387
|
+
chain?: ChainConfig;
|
|
388
|
+
/** See {@link AtbashOptions.network}. */
|
|
389
|
+
network?: Network;
|
|
360
390
|
blockchainRid?: string;
|
|
361
391
|
timeoutMs?: number;
|
|
362
392
|
nodeUrls?: readonly string[];
|
|
@@ -408,12 +438,6 @@ interface LogToolCallOptions {
|
|
|
408
438
|
orgEncryptionPubKey?: string;
|
|
409
439
|
}
|
|
410
440
|
|
|
411
|
-
interface ChainConfig {
|
|
412
|
-
readonly network: Network;
|
|
413
|
-
readonly blockchainRid: string;
|
|
414
|
-
readonly nodeUrls: readonly string[];
|
|
415
|
-
}
|
|
416
|
-
|
|
417
441
|
declare class Atbash {
|
|
418
442
|
readonly auth: AgentAuth;
|
|
419
443
|
readonly endpoint: string;
|
|
@@ -437,6 +461,27 @@ declare class Atbash {
|
|
|
437
461
|
* calls don't re-hit the dashboard. Cleared by `clearChainCache()`.
|
|
438
462
|
*/
|
|
439
463
|
private readonly _chainCache;
|
|
464
|
+
/**
|
|
465
|
+
* The chain the constructor settled on. Used only where a lookup returns no
|
|
466
|
+
* answer — see {@link resolveChainFromMap}.
|
|
467
|
+
*/
|
|
468
|
+
private readonly _defaultChain;
|
|
469
|
+
/**
|
|
470
|
+
* True when the caller named a chain outright — `chain`, `network`, or the
|
|
471
|
+
* paired `blockchainRid` + `nodeUrls`.
|
|
472
|
+
*
|
|
473
|
+
* Such a client is never re-pointed: not by the migration switch, and not by
|
|
474
|
+
* where an org turns out to live. Naming a chain is the caller saying "talk
|
|
475
|
+
* to this one", and silently routing elsewhere would make the argument a
|
|
476
|
+
* suggestion. A client that names nothing is the one that follows the org.
|
|
477
|
+
*/
|
|
478
|
+
private readonly _explicitChain;
|
|
479
|
+
/**
|
|
480
|
+
* The fleet-wide chain switch, read once at construction. `resolve()` hits
|
|
481
|
+
* the config file on disk, so re-reading it per call would put a file read
|
|
482
|
+
* on every judge.
|
|
483
|
+
*/
|
|
484
|
+
private readonly _forcedNetwork;
|
|
440
485
|
/**
|
|
441
486
|
* Short-TTL cache for `/api/ai/exists`. The `registered` field is
|
|
442
487
|
* monotonic (once true, stays true), so most calls in a burst re-fetch
|
|
@@ -552,7 +597,9 @@ declare class Atbash {
|
|
|
552
597
|
* 2. Per-chain subscription fallback — public + private records
|
|
553
598
|
* are fetched in parallel, with `is_private_blockchain` and
|
|
554
599
|
* `assigned_at` reconciling mixed states.
|
|
555
|
-
*
|
|
600
|
+
* A lookup that names exactly one chain wins outright. Where it names
|
|
601
|
+
* neither (a brand-new org) or cannot choose between them, the client's
|
|
602
|
+
* configured default decides.
|
|
556
603
|
*/
|
|
557
604
|
resolveChainForOrg(orgName: string): Promise<ChainConfig>;
|
|
558
605
|
/**
|
|
@@ -602,10 +649,34 @@ declare class Atbash {
|
|
|
602
649
|
private riskEngineRecords;
|
|
603
650
|
/**
|
|
604
651
|
* BRID for an org — one round-trip to the map, honoring the client's chain
|
|
605
|
-
* cache.
|
|
606
|
-
*
|
|
652
|
+
* cache. A "brand-new org" (nothing anywhere names its chain) is not an
|
|
653
|
+
* error — `resolveChainForOrg` returns the client default for that case and
|
|
654
|
+
* this helper returns its BRID. A transport failure or non-200 from
|
|
655
|
+
* `/api/org-network` IS an error and propagates: the caller cannot fall
|
|
656
|
+
* back to the default chain on outage, because with multi-chain live that
|
|
657
|
+
* silently reads from the wrong chain. Matches the Python binding's
|
|
658
|
+
* `_brid_for_org` semantics.
|
|
607
659
|
*/
|
|
608
660
|
private bridForOrg;
|
|
661
|
+
/**
|
|
662
|
+
* BRID for the client's configured default org, if it has one.
|
|
663
|
+
*
|
|
664
|
+
* Calls that carry no `orgName` argument are not chain-less: they still
|
|
665
|
+
* belong to `this.orgName`, and that org lives on exactly one chain. Routing
|
|
666
|
+
* them by the constructor's chain instead means a client configured
|
|
667
|
+
* `network: "private"` reads the private chain for an org that lives on
|
|
668
|
+
* public, and gets an empty answer rather than an error. So where an org is
|
|
669
|
+
* known the org decides the chain, and the constructor's chain is what is
|
|
670
|
+
* left when no org is known at all — the order `resolveAgentLookupNetwork`
|
|
671
|
+
* already applies to agent metadata reads, and the order the dashboard
|
|
672
|
+
* applies in `resolveChainForWallet`.
|
|
673
|
+
*
|
|
674
|
+
* Undefined when there is no default org, so callers keep falling back to
|
|
675
|
+
* the client default.
|
|
676
|
+
*/
|
|
677
|
+
/** The switch's chain, unless this client named one of its own. */
|
|
678
|
+
private forcedNetwork;
|
|
679
|
+
private defaultOrgBrid;
|
|
609
680
|
private raiseIfError;
|
|
610
681
|
/** Wrap a failed HTTP *response* (non-2xx / non-200) as an AtbashAPIError. */
|
|
611
682
|
private httpError;
|
|
@@ -695,7 +766,14 @@ interface AtbashUserConfig {
|
|
|
695
766
|
* only way a non-allowlisted judge host is accepted.
|
|
696
767
|
*/
|
|
697
768
|
judgeVerifyPubKey?: string;
|
|
698
|
-
|
|
769
|
+
/**
|
|
770
|
+
* `"private"` pins every org to the private chain regardless of where the
|
|
771
|
+
* dashboard says it lives — the migration switch. Leave it unset for the
|
|
772
|
+
* normal mode, where each org's own chain decides. There is no `"public"`
|
|
773
|
+
* value; a caller that wants one specific chain passes `chain` or `network`
|
|
774
|
+
* at construction instead.
|
|
775
|
+
*/
|
|
776
|
+
defaultChainNetwork?: Network;
|
|
699
777
|
provider?: string;
|
|
700
778
|
providerModel?: string;
|
|
701
779
|
/** "1" / "true" turns on verbose diagnostics. See AtbashOptions.debug. */
|
|
@@ -1398,4 +1476,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
1398
1476
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
1399
1477
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
1400
1478
|
|
|
1401
|
-
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 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, 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 OrgSubscription, 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, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
1479
|
+
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, 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 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, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,15 @@ interface ValidatedEndpoint {
|
|
|
30
30
|
declare function buildAllowedJudgeHosts(): ReadonlySet<string>;
|
|
31
31
|
declare function validateJudgeEndpoint(judge?: JudgeEndpointConfig): ValidatedEndpoint;
|
|
32
32
|
|
|
33
|
+
interface ChainConfig {
|
|
34
|
+
readonly network: Network;
|
|
35
|
+
readonly blockchainRid: string;
|
|
36
|
+
readonly nodeUrls: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
declare const PUBLIC_CHAIN: ChainConfig;
|
|
39
|
+
declare const PRIVATE_CHAIN: ChainConfig;
|
|
40
|
+
declare function chainForNetwork(network: Network): ChainConfig;
|
|
41
|
+
|
|
33
42
|
/**
|
|
34
43
|
* User-facing types. Two groups:
|
|
35
44
|
* - Core types — the exact shapes the Rust core emits across the NAPI
|
|
@@ -290,7 +299,24 @@ interface AtbashLogger {
|
|
|
290
299
|
interface AtbashOptions {
|
|
291
300
|
endpoint?: string;
|
|
292
301
|
timeoutMs?: number;
|
|
302
|
+
/**
|
|
303
|
+
* Full chain override — BRID + nodeUrls in one object. Wins over every
|
|
304
|
+
* other chain selector. Prefer this over paired `nodeUrls`/`blockchainRid`
|
|
305
|
+
* for anything but backwards compatibility.
|
|
306
|
+
*/
|
|
307
|
+
chain?: ChainConfig;
|
|
308
|
+
/**
|
|
309
|
+
* Preset chain selector — `"public"` or `"private"`. Resolves to the
|
|
310
|
+
* matching `ChainConfig` via `chainForNetwork()`. Overridden by `chain`,
|
|
311
|
+
* overrides env `ATBASH_DEFAULT_CHAIN_NETWORK` and the config file.
|
|
312
|
+
*/
|
|
313
|
+
network?: Network;
|
|
314
|
+
/**
|
|
315
|
+
* Explicit node URLs. Must be paired with `blockchainRid`. Passing one
|
|
316
|
+
* without the other throws — a BRID/nodes mismatch 404s every request.
|
|
317
|
+
*/
|
|
293
318
|
nodeUrls?: readonly string[];
|
|
319
|
+
/** Explicit BRID. Must be paired with `nodeUrls`. See {@link nodeUrls}. */
|
|
294
320
|
blockchainRid?: string;
|
|
295
321
|
/**
|
|
296
322
|
* Default org name. When set, `judgeAction` / `auditToolCall` resolve
|
|
@@ -357,6 +383,10 @@ interface FromConfigOptions {
|
|
|
357
383
|
keyPath?: string;
|
|
358
384
|
/** Judge endpoint config — validated against the allowlist / self-hosted policy. */
|
|
359
385
|
judge?: JudgeEndpointConfig;
|
|
386
|
+
/** See {@link AtbashOptions.chain}. */
|
|
387
|
+
chain?: ChainConfig;
|
|
388
|
+
/** See {@link AtbashOptions.network}. */
|
|
389
|
+
network?: Network;
|
|
360
390
|
blockchainRid?: string;
|
|
361
391
|
timeoutMs?: number;
|
|
362
392
|
nodeUrls?: readonly string[];
|
|
@@ -408,12 +438,6 @@ interface LogToolCallOptions {
|
|
|
408
438
|
orgEncryptionPubKey?: string;
|
|
409
439
|
}
|
|
410
440
|
|
|
411
|
-
interface ChainConfig {
|
|
412
|
-
readonly network: Network;
|
|
413
|
-
readonly blockchainRid: string;
|
|
414
|
-
readonly nodeUrls: readonly string[];
|
|
415
|
-
}
|
|
416
|
-
|
|
417
441
|
declare class Atbash {
|
|
418
442
|
readonly auth: AgentAuth;
|
|
419
443
|
readonly endpoint: string;
|
|
@@ -437,6 +461,27 @@ declare class Atbash {
|
|
|
437
461
|
* calls don't re-hit the dashboard. Cleared by `clearChainCache()`.
|
|
438
462
|
*/
|
|
439
463
|
private readonly _chainCache;
|
|
464
|
+
/**
|
|
465
|
+
* The chain the constructor settled on. Used only where a lookup returns no
|
|
466
|
+
* answer — see {@link resolveChainFromMap}.
|
|
467
|
+
*/
|
|
468
|
+
private readonly _defaultChain;
|
|
469
|
+
/**
|
|
470
|
+
* True when the caller named a chain outright — `chain`, `network`, or the
|
|
471
|
+
* paired `blockchainRid` + `nodeUrls`.
|
|
472
|
+
*
|
|
473
|
+
* Such a client is never re-pointed: not by the migration switch, and not by
|
|
474
|
+
* where an org turns out to live. Naming a chain is the caller saying "talk
|
|
475
|
+
* to this one", and silently routing elsewhere would make the argument a
|
|
476
|
+
* suggestion. A client that names nothing is the one that follows the org.
|
|
477
|
+
*/
|
|
478
|
+
private readonly _explicitChain;
|
|
479
|
+
/**
|
|
480
|
+
* The fleet-wide chain switch, read once at construction. `resolve()` hits
|
|
481
|
+
* the config file on disk, so re-reading it per call would put a file read
|
|
482
|
+
* on every judge.
|
|
483
|
+
*/
|
|
484
|
+
private readonly _forcedNetwork;
|
|
440
485
|
/**
|
|
441
486
|
* Short-TTL cache for `/api/ai/exists`. The `registered` field is
|
|
442
487
|
* monotonic (once true, stays true), so most calls in a burst re-fetch
|
|
@@ -552,7 +597,9 @@ declare class Atbash {
|
|
|
552
597
|
* 2. Per-chain subscription fallback — public + private records
|
|
553
598
|
* are fetched in parallel, with `is_private_blockchain` and
|
|
554
599
|
* `assigned_at` reconciling mixed states.
|
|
555
|
-
*
|
|
600
|
+
* A lookup that names exactly one chain wins outright. Where it names
|
|
601
|
+
* neither (a brand-new org) or cannot choose between them, the client's
|
|
602
|
+
* configured default decides.
|
|
556
603
|
*/
|
|
557
604
|
resolveChainForOrg(orgName: string): Promise<ChainConfig>;
|
|
558
605
|
/**
|
|
@@ -602,10 +649,34 @@ declare class Atbash {
|
|
|
602
649
|
private riskEngineRecords;
|
|
603
650
|
/**
|
|
604
651
|
* BRID for an org — one round-trip to the map, honoring the client's chain
|
|
605
|
-
* cache.
|
|
606
|
-
*
|
|
652
|
+
* cache. A "brand-new org" (nothing anywhere names its chain) is not an
|
|
653
|
+
* error — `resolveChainForOrg` returns the client default for that case and
|
|
654
|
+
* this helper returns its BRID. A transport failure or non-200 from
|
|
655
|
+
* `/api/org-network` IS an error and propagates: the caller cannot fall
|
|
656
|
+
* back to the default chain on outage, because with multi-chain live that
|
|
657
|
+
* silently reads from the wrong chain. Matches the Python binding's
|
|
658
|
+
* `_brid_for_org` semantics.
|
|
607
659
|
*/
|
|
608
660
|
private bridForOrg;
|
|
661
|
+
/**
|
|
662
|
+
* BRID for the client's configured default org, if it has one.
|
|
663
|
+
*
|
|
664
|
+
* Calls that carry no `orgName` argument are not chain-less: they still
|
|
665
|
+
* belong to `this.orgName`, and that org lives on exactly one chain. Routing
|
|
666
|
+
* them by the constructor's chain instead means a client configured
|
|
667
|
+
* `network: "private"` reads the private chain for an org that lives on
|
|
668
|
+
* public, and gets an empty answer rather than an error. So where an org is
|
|
669
|
+
* known the org decides the chain, and the constructor's chain is what is
|
|
670
|
+
* left when no org is known at all — the order `resolveAgentLookupNetwork`
|
|
671
|
+
* already applies to agent metadata reads, and the order the dashboard
|
|
672
|
+
* applies in `resolveChainForWallet`.
|
|
673
|
+
*
|
|
674
|
+
* Undefined when there is no default org, so callers keep falling back to
|
|
675
|
+
* the client default.
|
|
676
|
+
*/
|
|
677
|
+
/** The switch's chain, unless this client named one of its own. */
|
|
678
|
+
private forcedNetwork;
|
|
679
|
+
private defaultOrgBrid;
|
|
609
680
|
private raiseIfError;
|
|
610
681
|
/** Wrap a failed HTTP *response* (non-2xx / non-200) as an AtbashAPIError. */
|
|
611
682
|
private httpError;
|
|
@@ -695,7 +766,14 @@ interface AtbashUserConfig {
|
|
|
695
766
|
* only way a non-allowlisted judge host is accepted.
|
|
696
767
|
*/
|
|
697
768
|
judgeVerifyPubKey?: string;
|
|
698
|
-
|
|
769
|
+
/**
|
|
770
|
+
* `"private"` pins every org to the private chain regardless of where the
|
|
771
|
+
* dashboard says it lives — the migration switch. Leave it unset for the
|
|
772
|
+
* normal mode, where each org's own chain decides. There is no `"public"`
|
|
773
|
+
* value; a caller that wants one specific chain passes `chain` or `network`
|
|
774
|
+
* at construction instead.
|
|
775
|
+
*/
|
|
776
|
+
defaultChainNetwork?: Network;
|
|
699
777
|
provider?: string;
|
|
700
778
|
providerModel?: string;
|
|
701
779
|
/** "1" / "true" turns on verbose diagnostics. See AtbashOptions.debug. */
|
|
@@ -1398,4 +1476,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
1398
1476
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
1399
1477
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
1400
1478
|
|
|
1401
|
-
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 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, 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 OrgSubscription, 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, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
1479
|
+
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, 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 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, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, normalizeActionForHash, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, redactJsonStrings, redactSecrets, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|