@atbash/sdk 0.23.0-dev.0 → 0.24.1-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/README.md +3 -1
- package/dist/browser.d.mts +48 -1
- package/dist/browser.mjs +27 -6
- package/dist/index.d.mts +48 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +27 -6
- package/dist/index.mjs +27 -6
- package/index.js +54 -54
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -86,6 +86,8 @@ Every `judgeAction` call returns one of three verdicts:
|
|
|
86
86
|
|
|
87
87
|
> **Shadow and Monitor mode.** On a judge host whose replies are signature-checked, `auditToolCall` asks the judge for its true verdict and the organisation's mode, and applies the mode itself. Under a signed `shadow`, `monitor` or `off` mode, a BLOCK or HOLD still runs (`allow: true`, `verdict: "ALLOW"`) and `decision.wouldVerdict` says what would have happened; it is also logged as a warning. A missing, unsigned or unknown mode enforces. Set `enforceLocally: true` to enforce every verdict whatever the mode; the SDK then asks the judge to judge every call before answering, and refuses a reply that does not confirm it, so against a judge without client enforcement every call is refused. `getJudgmentStatus` applies the mode the same way, so a shadow call polled later reports its `wouldVerdict` while `allow` stays true. `judgeAction` does not opt in and returns what the server sends. To poll a HOLD, call `getJudgmentStatus(decision.judgmentId || decision.toolCallId)` (or the same fields of a `judgeAction` result): on the on-chain judge path the verdict is recorded under its own id.
|
|
88
88
|
|
|
89
|
+
> **Verdict record.** `decision.record` says what the judge stated about recording the verdict: `onChain`, `status` (its `on_chain_status`, such as `pending`), `boundToCall` (the reply names this call's ids), `signatureChecked` (a judge key verified the reply) and `judgeStatus` (`shadow_recorded` for a shadow ack, which has no verdict yet). A host that must not run an unrecorded action gates on `verdictRecorded`: a signed reply about this call that states `on_chain` and carries a verdict, so a shadow ack or a logged-only answer is never one. `undefined` means unknown: treat it as not recorded. It is informational; `allow` remains the gate.
|
|
90
|
+
|
|
89
91
|
> **NB:** If your org has no active subscription, the judge returns `"No verdict"` — actions are logged on-chain for the audit trail but not evaluated by an AI provider. Assign a plan at [atbash.ai/risk-engine/settings](https://atbash.ai/risk-engine/settings) for active verdicts.
|
|
90
92
|
|
|
91
93
|
## API
|
|
@@ -113,7 +115,7 @@ Read-only methods that read from the Chromia blockchain and dashboard.
|
|
|
113
115
|
| `getToolCallFull(toolCallId)` | Full details of a single tool call |
|
|
114
116
|
| `getOrgTierInfo(orgName)` | Check an org's tier and whether verdicts are enabled |
|
|
115
117
|
| `getAgentDetail(pubkey, options?)` | Get agent metadata (org, status, creation date) |
|
|
116
|
-
| `getAgentPolicy(pubkey, options?)` | Check the agent's policy
|
|
118
|
+
| `getAgentPolicy(pubkey, options?)` | Check the agent's jail status; the policy text is served to the org owner only |
|
|
117
119
|
| `getPendingHeldActions(orgName, maxCount)` | List actions waiting for operator approval |
|
|
118
120
|
| `getHeldActionReviews(orgName, maxCount)` | List completed operator reviews |
|
|
119
121
|
| `getSafetyStats()` | Chain-wide safety statistics |
|
package/dist/browser.d.mts
CHANGED
|
@@ -227,6 +227,8 @@ interface JudgeResult {
|
|
|
227
227
|
*/
|
|
228
228
|
judgmentId?: string;
|
|
229
229
|
onChain: boolean;
|
|
230
|
+
/** What the reply stated about the chain; see {@link VerdictRecord}. */
|
|
231
|
+
record?: VerdictRecord;
|
|
230
232
|
/** Severity 1 (poisonous) → 10 (benign). Present on memory-scan responses; absent for regular tool-call judgments. */
|
|
231
233
|
score?: number;
|
|
232
234
|
/**
|
|
@@ -451,6 +453,44 @@ interface AtbashOptions {
|
|
|
451
453
|
debug?: boolean;
|
|
452
454
|
logger?: AtbashLogger;
|
|
453
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* What the judge stated about recording this verdict. A host that must not run
|
|
458
|
+
* an unrecorded action gates on `verdictRecorded`. `onChain` is the judge's
|
|
459
|
+
* statement: the SDK does not read the chain.
|
|
460
|
+
*/
|
|
461
|
+
interface VerdictRecord {
|
|
462
|
+
/** The judge's `on_chain`: the verdict is recorded on chain. */
|
|
463
|
+
onChain: boolean;
|
|
464
|
+
/** The judge's `on_chain_status`, such as `pending` or `skipped`; absent when not stated. */
|
|
465
|
+
status?: string;
|
|
466
|
+
/**
|
|
467
|
+
* The reply names the ids this call generated. False when it names another
|
|
468
|
+
* call, or none: `toolCallId` then falls back to this client's own id, which
|
|
469
|
+
* proves nothing about what the judge recorded.
|
|
470
|
+
*/
|
|
471
|
+
boundToCall: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* This reply's signature was checked against a judge key before it was read.
|
|
474
|
+
* False means nothing proves who wrote the reply: it can echo this call's ids
|
|
475
|
+
* and still read as bound, because the ids travel in the request.
|
|
476
|
+
*/
|
|
477
|
+
signatureChecked: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* The judge's own `status`, absent when not stated. `shadow_recorded` is a
|
|
480
|
+
* shadow ack: the call was stored and has no verdict yet, which is what
|
|
481
|
+
* separates it from an ALLOW whose `status` here is `pending`. Read it with
|
|
482
|
+
* `boundToCall` and `signatureChecked`: unsigned, it is only a claim.
|
|
483
|
+
*/
|
|
484
|
+
judgeStatus?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The judge answered this call with a verdict it states is recorded on chain,
|
|
487
|
+
* in a signature-checked reply: `onChain`, `boundToCall` and `signatureChecked`
|
|
488
|
+
* all true, and no `judgeStatus`, which only a reply without a verdict carries
|
|
489
|
+
* (a shadow ack, or an answer that was only logged). Still the judge's word:
|
|
490
|
+
* the SDK does not read the chain.
|
|
491
|
+
*/
|
|
492
|
+
verdictRecorded: boolean;
|
|
493
|
+
}
|
|
454
494
|
/** Canonical decision returned by `auditToolCall`. */
|
|
455
495
|
type DecisionVerdict = "ALLOW" | "HOLD" | "BLOCK" | "ERROR";
|
|
456
496
|
interface Decision {
|
|
@@ -479,6 +519,13 @@ interface Decision {
|
|
|
479
519
|
* Poll `getJudgmentStatus` with `judgmentId || toolCallId`.
|
|
480
520
|
*/
|
|
481
521
|
judgmentId?: string;
|
|
522
|
+
/**
|
|
523
|
+
* What the judge stated about recording this verdict. Absent means unknown:
|
|
524
|
+
* a transport error, a local jail hold, or a reply that did not state
|
|
525
|
+
* `on_chain`. Treat absent as not recorded. Informational only; `allow`
|
|
526
|
+
* remains the gate.
|
|
527
|
+
*/
|
|
528
|
+
record?: VerdictRecord;
|
|
482
529
|
}
|
|
483
530
|
/** Input to `auditToolCall`. */
|
|
484
531
|
interface ToolCallInput {
|
|
@@ -2085,4 +2132,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
2085
2132
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
2086
2133
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
2087
2134
|
|
|
2088
|
-
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, type MemoryHistoryPage, 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, judgeVerifyKeys, 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, setLoopbackJudgePinsForTests, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
2135
|
+
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, type MemoryHistoryPage, 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 VerdictRecord, 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, judgeVerifyKeys, 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, setLoopbackJudgePinsForTests, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
package/dist/browser.mjs
CHANGED
|
@@ -53,7 +53,7 @@ var init_define_ATBASH_PRIVATE_NODE_URLS = __esm({
|
|
|
53
53
|
var define_ATBASH_PROD_JUDGE_PINS_default;
|
|
54
54
|
var init_define_ATBASH_PROD_JUDGE_PINS = __esm({
|
|
55
55
|
"<define:__ATBASH_PROD_JUDGE_PINS__>"() {
|
|
56
|
-
define_ATBASH_PROD_JUDGE_PINS_default = [];
|
|
56
|
+
define_ATBASH_PROD_JUDGE_PINS_default = ["02818eced310b32f227fada6dba76dbf0f9171265f63ec9860cc5a89a2bdb18bff"];
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
|
|
@@ -45502,6 +45502,12 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
45502
45502
|
const data = parsed;
|
|
45503
45503
|
const rawScore = data.score;
|
|
45504
45504
|
const score = typeof rawScore === "number" && Number.isInteger(rawScore) && rawScore >= 1 && rawScore <= 10 ? rawScore : void 0;
|
|
45505
|
+
const statedId = wireText(data.tool_call_id);
|
|
45506
|
+
const statedJudgment = wireText(data.judgment_id);
|
|
45507
|
+
const statedStatus = wireText(data.on_chain_status);
|
|
45508
|
+
const statedJudgeStatus = typeof data.status === "string" ? data.status : "";
|
|
45509
|
+
const boundToCall = (statedId === logResult.toolCallId || statedId === judgmentId) && (!statedJudgment || statedJudgment === judgmentId);
|
|
45510
|
+
const signatureChecked = verifyKeys.length > 0;
|
|
45505
45511
|
const result = {
|
|
45506
45512
|
verdict: normalizeVerdict(data.verdict),
|
|
45507
45513
|
allow: this.executable(data),
|
|
@@ -45513,6 +45519,19 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
45513
45519
|
toolCallId: wireText(data.tool_call_id, logResult.toolCallId),
|
|
45514
45520
|
...wireText(data.judgment_id) ? { judgmentId: wireText(data.judgment_id) } : {},
|
|
45515
45521
|
onChain: Boolean(data.on_chain),
|
|
45522
|
+
// Only a stated boolean is a statement: `onChain` above reads silence as false.
|
|
45523
|
+
...typeof data.on_chain === "boolean" ? {
|
|
45524
|
+
record: {
|
|
45525
|
+
onChain: data.on_chain,
|
|
45526
|
+
...statedStatus ? { status: statedStatus } : {},
|
|
45527
|
+
boundToCall,
|
|
45528
|
+
signatureChecked,
|
|
45529
|
+
...statedJudgeStatus ? { judgeStatus: statedJudgeStatus } : {},
|
|
45530
|
+
// A judge status marks a reply that carries no verdict: a shadow
|
|
45531
|
+
// ack, or an answer that was only logged.
|
|
45532
|
+
verdictRecorded: data.on_chain && boundToCall && signatureChecked && !statedJudgeStatus
|
|
45533
|
+
}
|
|
45534
|
+
} : {},
|
|
45516
45535
|
enforced: Boolean(data.enforced),
|
|
45517
45536
|
enforcementMode: wireText(data.enforcement_mode),
|
|
45518
45537
|
status: wireText(data.status),
|
|
@@ -45527,8 +45546,6 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
45527
45546
|
);
|
|
45528
45547
|
}
|
|
45529
45548
|
if (verifyKeys.length > 0) {
|
|
45530
|
-
const statedId = wireText(data.tool_call_id);
|
|
45531
|
-
const statedJudgment = wireText(data.judgment_id);
|
|
45532
45549
|
if (statedId && statedId !== logResult.toolCallId && statedId !== judgmentId || statedJudgment && statedJudgment !== judgmentId) {
|
|
45533
45550
|
throw new SignatureVerificationError(
|
|
45534
45551
|
`the signed reply is for call ${statedJudgment || statedId}, not this one`
|
|
@@ -45537,7 +45554,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
45537
45554
|
if (statedId && echo === optInValue) this.modeTrusted.add(result);
|
|
45538
45555
|
}
|
|
45539
45556
|
}
|
|
45540
|
-
return this.applyJailHold(result, startedAt,
|
|
45557
|
+
return this.applyJailHold(result, startedAt, statedStatus);
|
|
45541
45558
|
}
|
|
45542
45559
|
/**
|
|
45543
45560
|
* Start a local hold on an enforced BLOCK that jails: one already on chain,
|
|
@@ -45569,7 +45586,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
45569
45586
|
verdict: "BLOCK",
|
|
45570
45587
|
allow: false,
|
|
45571
45588
|
actionType: "block",
|
|
45572
|
-
reason:
|
|
45589
|
+
reason: `Agent is jailed. All actions are blocked until the organization owner unjails this agent at ${this.endpoint.replace(/\/+$/, "")}/risk-engine/agents.`,
|
|
45573
45590
|
confidence: 1,
|
|
45574
45591
|
provider: "policy",
|
|
45575
45592
|
latencyMs: 0,
|
|
@@ -45670,7 +45687,11 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
45670
45687
|
*/
|
|
45671
45688
|
decide(result) {
|
|
45672
45689
|
const decided = this.applyMode(result);
|
|
45673
|
-
const inner =
|
|
45690
|
+
const inner = {
|
|
45691
|
+
...decided,
|
|
45692
|
+
...result.judgmentId ? { judgmentId: result.judgmentId } : {},
|
|
45693
|
+
...result.record ? { record: result.record } : {}
|
|
45694
|
+
};
|
|
45674
45695
|
if (!result.enforcementMode) return inner;
|
|
45675
45696
|
return {
|
|
45676
45697
|
...inner,
|
package/dist/index.d.mts
CHANGED
|
@@ -227,6 +227,8 @@ interface JudgeResult {
|
|
|
227
227
|
*/
|
|
228
228
|
judgmentId?: string;
|
|
229
229
|
onChain: boolean;
|
|
230
|
+
/** What the reply stated about the chain; see {@link VerdictRecord}. */
|
|
231
|
+
record?: VerdictRecord;
|
|
230
232
|
/** Severity 1 (poisonous) → 10 (benign). Present on memory-scan responses; absent for regular tool-call judgments. */
|
|
231
233
|
score?: number;
|
|
232
234
|
/**
|
|
@@ -451,6 +453,44 @@ interface AtbashOptions {
|
|
|
451
453
|
debug?: boolean;
|
|
452
454
|
logger?: AtbashLogger;
|
|
453
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* What the judge stated about recording this verdict. A host that must not run
|
|
458
|
+
* an unrecorded action gates on `verdictRecorded`. `onChain` is the judge's
|
|
459
|
+
* statement: the SDK does not read the chain.
|
|
460
|
+
*/
|
|
461
|
+
interface VerdictRecord {
|
|
462
|
+
/** The judge's `on_chain`: the verdict is recorded on chain. */
|
|
463
|
+
onChain: boolean;
|
|
464
|
+
/** The judge's `on_chain_status`, such as `pending` or `skipped`; absent when not stated. */
|
|
465
|
+
status?: string;
|
|
466
|
+
/**
|
|
467
|
+
* The reply names the ids this call generated. False when it names another
|
|
468
|
+
* call, or none: `toolCallId` then falls back to this client's own id, which
|
|
469
|
+
* proves nothing about what the judge recorded.
|
|
470
|
+
*/
|
|
471
|
+
boundToCall: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* This reply's signature was checked against a judge key before it was read.
|
|
474
|
+
* False means nothing proves who wrote the reply: it can echo this call's ids
|
|
475
|
+
* and still read as bound, because the ids travel in the request.
|
|
476
|
+
*/
|
|
477
|
+
signatureChecked: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* The judge's own `status`, absent when not stated. `shadow_recorded` is a
|
|
480
|
+
* shadow ack: the call was stored and has no verdict yet, which is what
|
|
481
|
+
* separates it from an ALLOW whose `status` here is `pending`. Read it with
|
|
482
|
+
* `boundToCall` and `signatureChecked`: unsigned, it is only a claim.
|
|
483
|
+
*/
|
|
484
|
+
judgeStatus?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The judge answered this call with a verdict it states is recorded on chain,
|
|
487
|
+
* in a signature-checked reply: `onChain`, `boundToCall` and `signatureChecked`
|
|
488
|
+
* all true, and no `judgeStatus`, which only a reply without a verdict carries
|
|
489
|
+
* (a shadow ack, or an answer that was only logged). Still the judge's word:
|
|
490
|
+
* the SDK does not read the chain.
|
|
491
|
+
*/
|
|
492
|
+
verdictRecorded: boolean;
|
|
493
|
+
}
|
|
454
494
|
/** Canonical decision returned by `auditToolCall`. */
|
|
455
495
|
type DecisionVerdict = "ALLOW" | "HOLD" | "BLOCK" | "ERROR";
|
|
456
496
|
interface Decision {
|
|
@@ -479,6 +519,13 @@ interface Decision {
|
|
|
479
519
|
* Poll `getJudgmentStatus` with `judgmentId || toolCallId`.
|
|
480
520
|
*/
|
|
481
521
|
judgmentId?: string;
|
|
522
|
+
/**
|
|
523
|
+
* What the judge stated about recording this verdict. Absent means unknown:
|
|
524
|
+
* a transport error, a local jail hold, or a reply that did not state
|
|
525
|
+
* `on_chain`. Treat absent as not recorded. Informational only; `allow`
|
|
526
|
+
* remains the gate.
|
|
527
|
+
*/
|
|
528
|
+
record?: VerdictRecord;
|
|
482
529
|
}
|
|
483
530
|
/** Input to `auditToolCall`. */
|
|
484
531
|
interface ToolCallInput {
|
|
@@ -2085,4 +2132,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
2085
2132
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
2086
2133
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
2087
2134
|
|
|
2088
|
-
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, type MemoryHistoryPage, 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, judgeVerifyKeys, 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, setLoopbackJudgePinsForTests, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
2135
|
+
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, type MemoryHistoryPage, 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 VerdictRecord, 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, judgeVerifyKeys, 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, setLoopbackJudgePinsForTests, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -227,6 +227,8 @@ interface JudgeResult {
|
|
|
227
227
|
*/
|
|
228
228
|
judgmentId?: string;
|
|
229
229
|
onChain: boolean;
|
|
230
|
+
/** What the reply stated about the chain; see {@link VerdictRecord}. */
|
|
231
|
+
record?: VerdictRecord;
|
|
230
232
|
/** Severity 1 (poisonous) → 10 (benign). Present on memory-scan responses; absent for regular tool-call judgments. */
|
|
231
233
|
score?: number;
|
|
232
234
|
/**
|
|
@@ -451,6 +453,44 @@ interface AtbashOptions {
|
|
|
451
453
|
debug?: boolean;
|
|
452
454
|
logger?: AtbashLogger;
|
|
453
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* What the judge stated about recording this verdict. A host that must not run
|
|
458
|
+
* an unrecorded action gates on `verdictRecorded`. `onChain` is the judge's
|
|
459
|
+
* statement: the SDK does not read the chain.
|
|
460
|
+
*/
|
|
461
|
+
interface VerdictRecord {
|
|
462
|
+
/** The judge's `on_chain`: the verdict is recorded on chain. */
|
|
463
|
+
onChain: boolean;
|
|
464
|
+
/** The judge's `on_chain_status`, such as `pending` or `skipped`; absent when not stated. */
|
|
465
|
+
status?: string;
|
|
466
|
+
/**
|
|
467
|
+
* The reply names the ids this call generated. False when it names another
|
|
468
|
+
* call, or none: `toolCallId` then falls back to this client's own id, which
|
|
469
|
+
* proves nothing about what the judge recorded.
|
|
470
|
+
*/
|
|
471
|
+
boundToCall: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* This reply's signature was checked against a judge key before it was read.
|
|
474
|
+
* False means nothing proves who wrote the reply: it can echo this call's ids
|
|
475
|
+
* and still read as bound, because the ids travel in the request.
|
|
476
|
+
*/
|
|
477
|
+
signatureChecked: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* The judge's own `status`, absent when not stated. `shadow_recorded` is a
|
|
480
|
+
* shadow ack: the call was stored and has no verdict yet, which is what
|
|
481
|
+
* separates it from an ALLOW whose `status` here is `pending`. Read it with
|
|
482
|
+
* `boundToCall` and `signatureChecked`: unsigned, it is only a claim.
|
|
483
|
+
*/
|
|
484
|
+
judgeStatus?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The judge answered this call with a verdict it states is recorded on chain,
|
|
487
|
+
* in a signature-checked reply: `onChain`, `boundToCall` and `signatureChecked`
|
|
488
|
+
* all true, and no `judgeStatus`, which only a reply without a verdict carries
|
|
489
|
+
* (a shadow ack, or an answer that was only logged). Still the judge's word:
|
|
490
|
+
* the SDK does not read the chain.
|
|
491
|
+
*/
|
|
492
|
+
verdictRecorded: boolean;
|
|
493
|
+
}
|
|
454
494
|
/** Canonical decision returned by `auditToolCall`. */
|
|
455
495
|
type DecisionVerdict = "ALLOW" | "HOLD" | "BLOCK" | "ERROR";
|
|
456
496
|
interface Decision {
|
|
@@ -479,6 +519,13 @@ interface Decision {
|
|
|
479
519
|
* Poll `getJudgmentStatus` with `judgmentId || toolCallId`.
|
|
480
520
|
*/
|
|
481
521
|
judgmentId?: string;
|
|
522
|
+
/**
|
|
523
|
+
* What the judge stated about recording this verdict. Absent means unknown:
|
|
524
|
+
* a transport error, a local jail hold, or a reply that did not state
|
|
525
|
+
* `on_chain`. Treat absent as not recorded. Informational only; `allow`
|
|
526
|
+
* remains the gate.
|
|
527
|
+
*/
|
|
528
|
+
record?: VerdictRecord;
|
|
482
529
|
}
|
|
483
530
|
/** Input to `auditToolCall`. */
|
|
484
531
|
interface ToolCallInput {
|
|
@@ -2085,4 +2132,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
2085
2132
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
2086
2133
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
2087
2134
|
|
|
2088
|
-
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, type MemoryHistoryPage, 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, judgeVerifyKeys, 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, setLoopbackJudgePinsForTests, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
2135
|
+
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, type MemoryHistoryPage, 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 VerdictRecord, 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, judgeVerifyKeys, 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, setLoopbackJudgePinsForTests, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
package/dist/index.js
CHANGED
|
@@ -755,7 +755,7 @@ var import_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
|
755
755
|
var import_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
756
756
|
var import_sdk_logs = require("@opentelemetry/sdk-logs");
|
|
757
757
|
var import_node_crypto = require("crypto");
|
|
758
|
-
var SDK_VERSION = true ? "0.
|
|
758
|
+
var SDK_VERSION = true ? "0.24.1-dev.0" : "";
|
|
759
759
|
var SDK_LANGUAGE = "node";
|
|
760
760
|
function sdkResourceAttributes() {
|
|
761
761
|
const attrs = {
|
|
@@ -1558,6 +1558,12 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1558
1558
|
const data = parsed;
|
|
1559
1559
|
const rawScore = data.score;
|
|
1560
1560
|
const score = typeof rawScore === "number" && Number.isInteger(rawScore) && rawScore >= 1 && rawScore <= 10 ? rawScore : void 0;
|
|
1561
|
+
const statedId = wireText(data.tool_call_id);
|
|
1562
|
+
const statedJudgment = wireText(data.judgment_id);
|
|
1563
|
+
const statedStatus = wireText(data.on_chain_status);
|
|
1564
|
+
const statedJudgeStatus = typeof data.status === "string" ? data.status : "";
|
|
1565
|
+
const boundToCall = (statedId === logResult.toolCallId || statedId === judgmentId) && (!statedJudgment || statedJudgment === judgmentId);
|
|
1566
|
+
const signatureChecked = verifyKeys.length > 0;
|
|
1561
1567
|
const result = {
|
|
1562
1568
|
verdict: normalizeVerdict(data.verdict),
|
|
1563
1569
|
allow: this.executable(data),
|
|
@@ -1569,6 +1575,19 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1569
1575
|
toolCallId: wireText(data.tool_call_id, logResult.toolCallId),
|
|
1570
1576
|
...wireText(data.judgment_id) ? { judgmentId: wireText(data.judgment_id) } : {},
|
|
1571
1577
|
onChain: Boolean(data.on_chain),
|
|
1578
|
+
// Only a stated boolean is a statement: `onChain` above reads silence as false.
|
|
1579
|
+
...typeof data.on_chain === "boolean" ? {
|
|
1580
|
+
record: {
|
|
1581
|
+
onChain: data.on_chain,
|
|
1582
|
+
...statedStatus ? { status: statedStatus } : {},
|
|
1583
|
+
boundToCall,
|
|
1584
|
+
signatureChecked,
|
|
1585
|
+
...statedJudgeStatus ? { judgeStatus: statedJudgeStatus } : {},
|
|
1586
|
+
// A judge status marks a reply that carries no verdict: a shadow
|
|
1587
|
+
// ack, or an answer that was only logged.
|
|
1588
|
+
verdictRecorded: data.on_chain && boundToCall && signatureChecked && !statedJudgeStatus
|
|
1589
|
+
}
|
|
1590
|
+
} : {},
|
|
1572
1591
|
enforced: Boolean(data.enforced),
|
|
1573
1592
|
enforcementMode: wireText(data.enforcement_mode),
|
|
1574
1593
|
status: wireText(data.status),
|
|
@@ -1583,8 +1602,6 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1583
1602
|
);
|
|
1584
1603
|
}
|
|
1585
1604
|
if (verifyKeys.length > 0) {
|
|
1586
|
-
const statedId = wireText(data.tool_call_id);
|
|
1587
|
-
const statedJudgment = wireText(data.judgment_id);
|
|
1588
1605
|
if (statedId && statedId !== logResult.toolCallId && statedId !== judgmentId || statedJudgment && statedJudgment !== judgmentId) {
|
|
1589
1606
|
throw new SignatureVerificationError(
|
|
1590
1607
|
`the signed reply is for call ${statedJudgment || statedId}, not this one`
|
|
@@ -1593,7 +1610,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1593
1610
|
if (statedId && echo === optInValue) this.modeTrusted.add(result);
|
|
1594
1611
|
}
|
|
1595
1612
|
}
|
|
1596
|
-
return this.applyJailHold(result, startedAt,
|
|
1613
|
+
return this.applyJailHold(result, startedAt, statedStatus);
|
|
1597
1614
|
}
|
|
1598
1615
|
/**
|
|
1599
1616
|
* Start a local hold on an enforced BLOCK that jails: one already on chain,
|
|
@@ -1625,7 +1642,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1625
1642
|
verdict: "BLOCK",
|
|
1626
1643
|
allow: false,
|
|
1627
1644
|
actionType: "block",
|
|
1628
|
-
reason:
|
|
1645
|
+
reason: `Agent is jailed. All actions are blocked until the organization owner unjails this agent at ${this.endpoint.replace(/\/+$/, "")}/risk-engine/agents.`,
|
|
1629
1646
|
confidence: 1,
|
|
1630
1647
|
provider: "policy",
|
|
1631
1648
|
latencyMs: 0,
|
|
@@ -1726,7 +1743,11 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1726
1743
|
*/
|
|
1727
1744
|
decide(result) {
|
|
1728
1745
|
const decided = this.applyMode(result);
|
|
1729
|
-
const inner =
|
|
1746
|
+
const inner = {
|
|
1747
|
+
...decided,
|
|
1748
|
+
...result.judgmentId ? { judgmentId: result.judgmentId } : {},
|
|
1749
|
+
...result.record ? { record: result.record } : {}
|
|
1750
|
+
};
|
|
1730
1751
|
if (!result.enforcementMode) return inner;
|
|
1731
1752
|
return {
|
|
1732
1753
|
...inner,
|
package/dist/index.mjs
CHANGED
|
@@ -630,7 +630,7 @@ import {
|
|
|
630
630
|
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
|
631
631
|
import { BatchLogRecordProcessor, LoggerProvider } from "@opentelemetry/sdk-logs";
|
|
632
632
|
import { createHash } from "crypto";
|
|
633
|
-
var SDK_VERSION = true ? "0.
|
|
633
|
+
var SDK_VERSION = true ? "0.24.1-dev.0" : "";
|
|
634
634
|
var SDK_LANGUAGE = "node";
|
|
635
635
|
function sdkResourceAttributes() {
|
|
636
636
|
const attrs = {
|
|
@@ -1439,6 +1439,12 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1439
1439
|
const data = parsed;
|
|
1440
1440
|
const rawScore = data.score;
|
|
1441
1441
|
const score = typeof rawScore === "number" && Number.isInteger(rawScore) && rawScore >= 1 && rawScore <= 10 ? rawScore : void 0;
|
|
1442
|
+
const statedId = wireText(data.tool_call_id);
|
|
1443
|
+
const statedJudgment = wireText(data.judgment_id);
|
|
1444
|
+
const statedStatus = wireText(data.on_chain_status);
|
|
1445
|
+
const statedJudgeStatus = typeof data.status === "string" ? data.status : "";
|
|
1446
|
+
const boundToCall = (statedId === logResult.toolCallId || statedId === judgmentId) && (!statedJudgment || statedJudgment === judgmentId);
|
|
1447
|
+
const signatureChecked = verifyKeys.length > 0;
|
|
1442
1448
|
const result = {
|
|
1443
1449
|
verdict: normalizeVerdict(data.verdict),
|
|
1444
1450
|
allow: this.executable(data),
|
|
@@ -1450,6 +1456,19 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1450
1456
|
toolCallId: wireText(data.tool_call_id, logResult.toolCallId),
|
|
1451
1457
|
...wireText(data.judgment_id) ? { judgmentId: wireText(data.judgment_id) } : {},
|
|
1452
1458
|
onChain: Boolean(data.on_chain),
|
|
1459
|
+
// Only a stated boolean is a statement: `onChain` above reads silence as false.
|
|
1460
|
+
...typeof data.on_chain === "boolean" ? {
|
|
1461
|
+
record: {
|
|
1462
|
+
onChain: data.on_chain,
|
|
1463
|
+
...statedStatus ? { status: statedStatus } : {},
|
|
1464
|
+
boundToCall,
|
|
1465
|
+
signatureChecked,
|
|
1466
|
+
...statedJudgeStatus ? { judgeStatus: statedJudgeStatus } : {},
|
|
1467
|
+
// A judge status marks a reply that carries no verdict: a shadow
|
|
1468
|
+
// ack, or an answer that was only logged.
|
|
1469
|
+
verdictRecorded: data.on_chain && boundToCall && signatureChecked && !statedJudgeStatus
|
|
1470
|
+
}
|
|
1471
|
+
} : {},
|
|
1453
1472
|
enforced: Boolean(data.enforced),
|
|
1454
1473
|
enforcementMode: wireText(data.enforcement_mode),
|
|
1455
1474
|
status: wireText(data.status),
|
|
@@ -1464,8 +1483,6 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1464
1483
|
);
|
|
1465
1484
|
}
|
|
1466
1485
|
if (verifyKeys.length > 0) {
|
|
1467
|
-
const statedId = wireText(data.tool_call_id);
|
|
1468
|
-
const statedJudgment = wireText(data.judgment_id);
|
|
1469
1486
|
if (statedId && statedId !== logResult.toolCallId && statedId !== judgmentId || statedJudgment && statedJudgment !== judgmentId) {
|
|
1470
1487
|
throw new SignatureVerificationError(
|
|
1471
1488
|
`the signed reply is for call ${statedJudgment || statedId}, not this one`
|
|
@@ -1474,7 +1491,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1474
1491
|
if (statedId && echo === optInValue) this.modeTrusted.add(result);
|
|
1475
1492
|
}
|
|
1476
1493
|
}
|
|
1477
|
-
return this.applyJailHold(result, startedAt,
|
|
1494
|
+
return this.applyJailHold(result, startedAt, statedStatus);
|
|
1478
1495
|
}
|
|
1479
1496
|
/**
|
|
1480
1497
|
* Start a local hold on an enforced BLOCK that jails: one already on chain,
|
|
@@ -1506,7 +1523,7 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1506
1523
|
verdict: "BLOCK",
|
|
1507
1524
|
allow: false,
|
|
1508
1525
|
actionType: "block",
|
|
1509
|
-
reason:
|
|
1526
|
+
reason: `Agent is jailed. All actions are blocked until the organization owner unjails this agent at ${this.endpoint.replace(/\/+$/, "")}/risk-engine/agents.`,
|
|
1510
1527
|
confidence: 1,
|
|
1511
1528
|
provider: "policy",
|
|
1512
1529
|
latencyMs: 0,
|
|
@@ -1607,7 +1624,11 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1607
1624
|
*/
|
|
1608
1625
|
decide(result) {
|
|
1609
1626
|
const decided = this.applyMode(result);
|
|
1610
|
-
const inner =
|
|
1627
|
+
const inner = {
|
|
1628
|
+
...decided,
|
|
1629
|
+
...result.judgmentId ? { judgmentId: result.judgmentId } : {},
|
|
1630
|
+
...result.record ? { record: result.record } : {}
|
|
1631
|
+
};
|
|
1611
1632
|
if (!result.enforcementMode) return inner;
|
|
1612
1633
|
return {
|
|
1613
1634
|
...inner,
|
package/index.js
CHANGED
|
@@ -92,8 +92,8 @@ function requireNative() {
|
|
|
92
92
|
try {
|
|
93
93
|
const binding = require('@atbash/sdk-android-arm64')
|
|
94
94
|
const bindingPackageVersion = require('@atbash/sdk-android-arm64/package.json').version
|
|
95
|
-
if (bindingPackageVersion !== '0.
|
|
96
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
95
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
96
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
97
97
|
}
|
|
98
98
|
return binding
|
|
99
99
|
} catch (e) {
|
|
@@ -108,8 +108,8 @@ function requireNative() {
|
|
|
108
108
|
try {
|
|
109
109
|
const binding = require('@atbash/sdk-android-arm-eabi')
|
|
110
110
|
const bindingPackageVersion = require('@atbash/sdk-android-arm-eabi/package.json').version
|
|
111
|
-
if (bindingPackageVersion !== '0.
|
|
112
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
111
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
112
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
113
113
|
}
|
|
114
114
|
return binding
|
|
115
115
|
} catch (e) {
|
|
@@ -129,8 +129,8 @@ function requireNative() {
|
|
|
129
129
|
try {
|
|
130
130
|
const binding = require('@atbash/sdk-win32-x64-gnu')
|
|
131
131
|
const bindingPackageVersion = require('@atbash/sdk-win32-x64-gnu/package.json').version
|
|
132
|
-
if (bindingPackageVersion !== '0.
|
|
133
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
132
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
133
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
134
134
|
}
|
|
135
135
|
return binding
|
|
136
136
|
} catch (e) {
|
|
@@ -145,8 +145,8 @@ function requireNative() {
|
|
|
145
145
|
try {
|
|
146
146
|
const binding = require('@atbash/sdk-win32-x64-msvc')
|
|
147
147
|
const bindingPackageVersion = require('@atbash/sdk-win32-x64-msvc/package.json').version
|
|
148
|
-
if (bindingPackageVersion !== '0.
|
|
149
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
148
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
149
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
150
150
|
}
|
|
151
151
|
return binding
|
|
152
152
|
} catch (e) {
|
|
@@ -162,8 +162,8 @@ function requireNative() {
|
|
|
162
162
|
try {
|
|
163
163
|
const binding = require('@atbash/sdk-win32-ia32-msvc')
|
|
164
164
|
const bindingPackageVersion = require('@atbash/sdk-win32-ia32-msvc/package.json').version
|
|
165
|
-
if (bindingPackageVersion !== '0.
|
|
166
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
165
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
166
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
167
167
|
}
|
|
168
168
|
return binding
|
|
169
169
|
} catch (e) {
|
|
@@ -178,8 +178,8 @@ function requireNative() {
|
|
|
178
178
|
try {
|
|
179
179
|
const binding = require('@atbash/sdk-win32-arm64-msvc')
|
|
180
180
|
const bindingPackageVersion = require('@atbash/sdk-win32-arm64-msvc/package.json').version
|
|
181
|
-
if (bindingPackageVersion !== '0.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
181
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
183
183
|
}
|
|
184
184
|
return binding
|
|
185
185
|
} catch (e) {
|
|
@@ -197,8 +197,8 @@ function requireNative() {
|
|
|
197
197
|
try {
|
|
198
198
|
const binding = require('@atbash/sdk-darwin-universal')
|
|
199
199
|
const bindingPackageVersion = require('@atbash/sdk-darwin-universal/package.json').version
|
|
200
|
-
if (bindingPackageVersion !== '0.
|
|
201
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
200
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
201
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
202
202
|
}
|
|
203
203
|
return binding
|
|
204
204
|
} catch (e) {
|
|
@@ -213,8 +213,8 @@ function requireNative() {
|
|
|
213
213
|
try {
|
|
214
214
|
const binding = require('@atbash/sdk-darwin-x64')
|
|
215
215
|
const bindingPackageVersion = require('@atbash/sdk-darwin-x64/package.json').version
|
|
216
|
-
if (bindingPackageVersion !== '0.
|
|
217
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
216
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
217
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
218
218
|
}
|
|
219
219
|
return binding
|
|
220
220
|
} catch (e) {
|
|
@@ -229,8 +229,8 @@ function requireNative() {
|
|
|
229
229
|
try {
|
|
230
230
|
const binding = require('@atbash/sdk-darwin-arm64')
|
|
231
231
|
const bindingPackageVersion = require('@atbash/sdk-darwin-arm64/package.json').version
|
|
232
|
-
if (bindingPackageVersion !== '0.
|
|
233
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
232
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
233
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
234
234
|
}
|
|
235
235
|
return binding
|
|
236
236
|
} catch (e) {
|
|
@@ -249,8 +249,8 @@ function requireNative() {
|
|
|
249
249
|
try {
|
|
250
250
|
const binding = require('@atbash/sdk-freebsd-x64')
|
|
251
251
|
const bindingPackageVersion = require('@atbash/sdk-freebsd-x64/package.json').version
|
|
252
|
-
if (bindingPackageVersion !== '0.
|
|
253
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
252
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
253
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
254
254
|
}
|
|
255
255
|
return binding
|
|
256
256
|
} catch (e) {
|
|
@@ -265,8 +265,8 @@ function requireNative() {
|
|
|
265
265
|
try {
|
|
266
266
|
const binding = require('@atbash/sdk-freebsd-arm64')
|
|
267
267
|
const bindingPackageVersion = require('@atbash/sdk-freebsd-arm64/package.json').version
|
|
268
|
-
if (bindingPackageVersion !== '0.
|
|
269
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
268
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
269
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
270
270
|
}
|
|
271
271
|
return binding
|
|
272
272
|
} catch (e) {
|
|
@@ -286,8 +286,8 @@ function requireNative() {
|
|
|
286
286
|
try {
|
|
287
287
|
const binding = require('@atbash/sdk-linux-x64-musl')
|
|
288
288
|
const bindingPackageVersion = require('@atbash/sdk-linux-x64-musl/package.json').version
|
|
289
|
-
if (bindingPackageVersion !== '0.
|
|
290
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
289
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
290
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
291
291
|
}
|
|
292
292
|
return binding
|
|
293
293
|
} catch (e) {
|
|
@@ -302,8 +302,8 @@ function requireNative() {
|
|
|
302
302
|
try {
|
|
303
303
|
const binding = require('@atbash/sdk-linux-x64-gnu')
|
|
304
304
|
const bindingPackageVersion = require('@atbash/sdk-linux-x64-gnu/package.json').version
|
|
305
|
-
if (bindingPackageVersion !== '0.
|
|
306
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
305
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
306
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
307
307
|
}
|
|
308
308
|
return binding
|
|
309
309
|
} catch (e) {
|
|
@@ -320,8 +320,8 @@ function requireNative() {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = require('@atbash/sdk-linux-arm64-musl')
|
|
322
322
|
const bindingPackageVersion = require('@atbash/sdk-linux-arm64-musl/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '0.
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
323
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
325
|
}
|
|
326
326
|
return binding
|
|
327
327
|
} catch (e) {
|
|
@@ -336,8 +336,8 @@ function requireNative() {
|
|
|
336
336
|
try {
|
|
337
337
|
const binding = require('@atbash/sdk-linux-arm64-gnu')
|
|
338
338
|
const bindingPackageVersion = require('@atbash/sdk-linux-arm64-gnu/package.json').version
|
|
339
|
-
if (bindingPackageVersion !== '0.
|
|
340
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
339
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
340
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
341
341
|
}
|
|
342
342
|
return binding
|
|
343
343
|
} catch (e) {
|
|
@@ -354,8 +354,8 @@ function requireNative() {
|
|
|
354
354
|
try {
|
|
355
355
|
const binding = require('@atbash/sdk-linux-arm-musleabihf')
|
|
356
356
|
const bindingPackageVersion = require('@atbash/sdk-linux-arm-musleabihf/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '0.
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
357
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
359
|
}
|
|
360
360
|
return binding
|
|
361
361
|
} catch (e) {
|
|
@@ -370,8 +370,8 @@ function requireNative() {
|
|
|
370
370
|
try {
|
|
371
371
|
const binding = require('@atbash/sdk-linux-arm-gnueabihf')
|
|
372
372
|
const bindingPackageVersion = require('@atbash/sdk-linux-arm-gnueabihf/package.json').version
|
|
373
|
-
if (bindingPackageVersion !== '0.
|
|
374
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
373
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
374
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
375
375
|
}
|
|
376
376
|
return binding
|
|
377
377
|
} catch (e) {
|
|
@@ -388,8 +388,8 @@ function requireNative() {
|
|
|
388
388
|
try {
|
|
389
389
|
const binding = require('@atbash/sdk-linux-loong64-musl')
|
|
390
390
|
const bindingPackageVersion = require('@atbash/sdk-linux-loong64-musl/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '0.
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
391
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
393
|
}
|
|
394
394
|
return binding
|
|
395
395
|
} catch (e) {
|
|
@@ -404,8 +404,8 @@ function requireNative() {
|
|
|
404
404
|
try {
|
|
405
405
|
const binding = require('@atbash/sdk-linux-loong64-gnu')
|
|
406
406
|
const bindingPackageVersion = require('@atbash/sdk-linux-loong64-gnu/package.json').version
|
|
407
|
-
if (bindingPackageVersion !== '0.
|
|
408
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
407
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
408
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
409
409
|
}
|
|
410
410
|
return binding
|
|
411
411
|
} catch (e) {
|
|
@@ -422,8 +422,8 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require('@atbash/sdk-linux-riscv64-musl')
|
|
424
424
|
const bindingPackageVersion = require('@atbash/sdk-linux-riscv64-musl/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '0.
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
425
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
427
|
}
|
|
428
428
|
return binding
|
|
429
429
|
} catch (e) {
|
|
@@ -438,8 +438,8 @@ function requireNative() {
|
|
|
438
438
|
try {
|
|
439
439
|
const binding = require('@atbash/sdk-linux-riscv64-gnu')
|
|
440
440
|
const bindingPackageVersion = require('@atbash/sdk-linux-riscv64-gnu/package.json').version
|
|
441
|
-
if (bindingPackageVersion !== '0.
|
|
442
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
441
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
442
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
443
443
|
}
|
|
444
444
|
return binding
|
|
445
445
|
} catch (e) {
|
|
@@ -455,8 +455,8 @@ function requireNative() {
|
|
|
455
455
|
try {
|
|
456
456
|
const binding = require('@atbash/sdk-linux-ppc64-gnu')
|
|
457
457
|
const bindingPackageVersion = require('@atbash/sdk-linux-ppc64-gnu/package.json').version
|
|
458
|
-
if (bindingPackageVersion !== '0.
|
|
459
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
458
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
459
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
460
460
|
}
|
|
461
461
|
return binding
|
|
462
462
|
} catch (e) {
|
|
@@ -471,8 +471,8 @@ function requireNative() {
|
|
|
471
471
|
try {
|
|
472
472
|
const binding = require('@atbash/sdk-linux-s390x-gnu')
|
|
473
473
|
const bindingPackageVersion = require('@atbash/sdk-linux-s390x-gnu/package.json').version
|
|
474
|
-
if (bindingPackageVersion !== '0.
|
|
475
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
474
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
475
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
476
476
|
}
|
|
477
477
|
return binding
|
|
478
478
|
} catch (e) {
|
|
@@ -491,8 +491,8 @@ function requireNative() {
|
|
|
491
491
|
try {
|
|
492
492
|
const binding = require('@atbash/sdk-openharmony-arm64')
|
|
493
493
|
const bindingPackageVersion = require('@atbash/sdk-openharmony-arm64/package.json').version
|
|
494
|
-
if (bindingPackageVersion !== '0.
|
|
495
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
494
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
495
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
496
496
|
}
|
|
497
497
|
return binding
|
|
498
498
|
} catch (e) {
|
|
@@ -507,8 +507,8 @@ function requireNative() {
|
|
|
507
507
|
try {
|
|
508
508
|
const binding = require('@atbash/sdk-openharmony-x64')
|
|
509
509
|
const bindingPackageVersion = require('@atbash/sdk-openharmony-x64/package.json').version
|
|
510
|
-
if (bindingPackageVersion !== '0.
|
|
511
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
510
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
511
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
512
512
|
}
|
|
513
513
|
return binding
|
|
514
514
|
} catch (e) {
|
|
@@ -523,8 +523,8 @@ function requireNative() {
|
|
|
523
523
|
try {
|
|
524
524
|
const binding = require('@atbash/sdk-openharmony-arm')
|
|
525
525
|
const bindingPackageVersion = require('@atbash/sdk-openharmony-arm/package.json').version
|
|
526
|
-
if (bindingPackageVersion !== '0.
|
|
527
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
526
|
+
if (bindingPackageVersion !== '0.24.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
527
|
+
throw new Error(`Native binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
528
528
|
}
|
|
529
529
|
return binding
|
|
530
530
|
} catch (e) {
|
|
@@ -664,8 +664,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
664
664
|
if (!candidateFailed) {
|
|
665
665
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
666
666
|
const bindingPackageVersion = require('@atbash/sdk-wasm32-wasi/package.json').version
|
|
667
|
-
if (bindingPackageVersion !== '0.
|
|
668
|
-
throw new Error(`WASI binding package version mismatch, expected 0.
|
|
667
|
+
if (bindingPackageVersion !== '0.24.1-dev.0') {
|
|
668
|
+
throw new Error(`WASI binding package version mismatch, expected 0.24.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
wasiBinding = require('@atbash/sdk-wasm32-wasi')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atbash/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1-dev.0",
|
|
4
4
|
"description": "TypeScript SDK for Atbash — the safety layer that evaluates AI agent actions against operator-defined policies before execution.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atbash",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@opentelemetry/api": "^1.9.1",
|
|
80
80
|
"@opentelemetry/api-logs": "^0.223.0",
|
|
81
81
|
"@opentelemetry/exporter-logs-otlp-http": "^0.223.0",
|
|
82
|
-
"@opentelemetry/exporter-metrics-otlp-http": "^0.
|
|
82
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.223.0",
|
|
83
83
|
"@opentelemetry/resources": "^2.7.1",
|
|
84
84
|
"@opentelemetry/sdk-logs": "^0.223.0",
|
|
85
85
|
"@opentelemetry/sdk-metrics": "^2.7.1"
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
"@napi-rs/cross-toolchain": "1.0.3"
|
|
106
106
|
},
|
|
107
107
|
"optionalDependencies": {
|
|
108
|
-
"@atbash/sdk-linux-x64-gnu": "0.
|
|
109
|
-
"@atbash/sdk-linux-arm64-gnu": "0.
|
|
110
|
-
"@atbash/sdk-linux-x64-musl": "0.
|
|
111
|
-
"@atbash/sdk-darwin-arm64": "0.
|
|
112
|
-
"@atbash/sdk-win32-x64-msvc": "0.
|
|
108
|
+
"@atbash/sdk-linux-x64-gnu": "0.24.1-dev.0",
|
|
109
|
+
"@atbash/sdk-linux-arm64-gnu": "0.24.1-dev.0",
|
|
110
|
+
"@atbash/sdk-linux-x64-musl": "0.24.1-dev.0",
|
|
111
|
+
"@atbash/sdk-darwin-arm64": "0.24.1-dev.0",
|
|
112
|
+
"@atbash/sdk-win32-x64-msvc": "0.24.1-dev.0"
|
|
113
113
|
}
|
|
114
114
|
}
|