@atbash/sdk 0.21.0-dev.0 → 0.22.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -16
- package/dist/browser.d.mts +10 -3
- package/dist/browser.mjs +8 -4
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +34 -8
- package/dist/index.mjs +34 -8
- package/index.js +54 -54
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ Two ways to create an agent:
|
|
|
68
68
|
|
|
69
69
|
## Secret storage
|
|
70
70
|
|
|
71
|
-
-
|
|
71
|
+
- Keep the private key in the key file (`~/.config/atbash/guard-client-key`, or a file named by `keyPath`), in `ATBASH_AGENT_KEY`, or in a secret manager — never hardcode it. See [Which key signs](#which-key-signs).
|
|
72
72
|
- Never commit `.env` files containing the key.
|
|
73
73
|
- If a key leaks, stop using it and create a new agent in the dashboard.
|
|
74
74
|
|
|
@@ -127,31 +127,71 @@ Standalone helpers for keypair handling.
|
|
|
127
127
|
| `isValidPrivateKey(hex)` | Validate a private-key string |
|
|
128
128
|
| `loadAgent(privkey)` | Validate the key + return `{ pubkey, privkey }` |
|
|
129
129
|
|
|
130
|
-
## Configuration
|
|
130
|
+
## Configuration resolution
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
`new Atbash(privkey, options)` takes everything explicitly. `Atbash.fromConfig(options)` fills in what you did not pass from the environment and then from `~/.config/atbash/config.json`, and finds the signing key for you.
|
|
133
133
|
|
|
134
134
|
```ts
|
|
135
135
|
import { Atbash } from "@atbash/sdk";
|
|
136
|
-
const atbash = Atbash.fromConfig(); //
|
|
136
|
+
const atbash = Atbash.fromConfig(); // key file + env + config.json
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
| `
|
|
139
|
+
### Settings: option, then env, then `config.json`
|
|
140
|
+
|
|
141
|
+
Each setting is read from the first place that has it: the `fromConfig` option, then the environment variable, then the key in `config.json`.
|
|
142
|
+
|
|
143
|
+
`judge` is taken whole. Pass it complete, or leave it out and use the environment or `config.json`: a `judge` with only an `endpoint` ignores `ATBASH_JUDGE_VERIFY_PUBKEY`, so a self-hosted host then fails the allowlist.
|
|
144
|
+
|
|
145
|
+
| `fromConfig` option | Env var | `config.json` key | Notes |
|
|
146
|
+
|---|---|---|---|
|
|
147
|
+
| `judge.endpoint` | `ATBASH_ENDPOINT` | `judgeEndpoint` | Must pass the endpoint rules below. |
|
|
148
|
+
| `judge.verifyPubKey` | `ATBASH_JUDGE_VERIFY_PUBKEY` | `judgeVerifyPubKey` | 66-hex response-signing key of a self-hosted judge. Set through the environment or `config.json` without an endpoint, it throws; passed in `judge` without an endpoint, the default endpoint is used. |
|
|
149
|
+
| `network` | `ATBASH_DEFAULT_CHAIN_NETWORK` | `defaultChainNetwork` | Only `"private"` is accepted; anything else throws. A client that names no chain is pinned to it, even for an org the dashboard places on another chain. |
|
|
150
|
+
| `debug` | `ATBASH_DEBUG` | `debug` | `1`, `true` or `yes` turns diagnostics on. |
|
|
151
|
+
| `orgName` | `ATBASH_ORG_NAME` | `orgName` | `fromConfig` reads the option only. The env var and file key are read by `resolve("orgName")`, which the CLI and plugins use. |
|
|
152
|
+
|
|
153
|
+
`agentKey` is not in this table on purpose: the signing key is never read from `config.json` (next section).
|
|
154
|
+
|
|
155
|
+
Helpers: `saveUserConfig(config)`, `loadUserConfig()`, `resolve(key, flagValue?)`, `getConfigPath()`.
|
|
156
|
+
|
|
157
|
+
### Which key signs
|
|
158
|
+
|
|
159
|
+
`fromConfig` picks the first of these that is set:
|
|
160
|
+
|
|
161
|
+
1. `agentKey` option (hex private key in code).
|
|
162
|
+
2. `keyPath` option. A path that does not exist throws; the SDK never falls through to another key when you named one.
|
|
163
|
+
3. `ATBASH_AGENT_KEY` environment variable.
|
|
164
|
+
4. `~/.config/atbash/guard-client-key`.
|
|
165
|
+
5. `~/.config/atbash/atbash-client-key`.
|
|
166
|
+
|
|
167
|
+
If none exists `fromConfig` throws `atbash key file not found. Looked for: <both default paths>`. The bare constructor never reads a key file.
|
|
168
|
+
|
|
169
|
+
An `agentKey` inside `config.json` is ignored. A settings file is writable by anything on the machine and is shared by every Atbash integration, so it is not allowed to choose who you sign as. When you pass a `logger`, `fromConfig` warns:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
[atbash] "agentKey" in config.json is ignored — settings do not choose the signing key. It holds <pubkey>; this client signs as the key file or ATBASH_AGENT_KEY instead. ...
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
and when no key file exists at all, the "not found" error names the pubkey stranded in `config.json` so you know where it went.
|
|
176
|
+
|
|
177
|
+
A key file is either `key=value` lines or JSON. Both fields must be present; the public key is re-derived from the private key, and a `0x` prefix is accepted.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
privkey=<64 hex>
|
|
181
|
+
pubkey=<66 hex>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{ "privKey": "<64 hex>", "pubKey": "<66 hex>" }
|
|
186
|
+
```
|
|
146
187
|
|
|
147
|
-
|
|
188
|
+
For adapters and CI, keep the key in a file and point at it with `keyPath` (or let the default path be found). Passing the key on a command line puts it in shell history and process listings.
|
|
148
189
|
|
|
149
|
-
###
|
|
190
|
+
### What `orgName` does
|
|
150
191
|
|
|
151
|
-
|
|
192
|
+
`orgName` tells the SDK which chain to sign the call for: the org's network is looked up once through the dashboard, cached per client, and every judge and log call is signed for that chain. The SDK does not check that the name matches the org the agent was registered under; which org's policy judges the action is decided by the agent's registration, not by this string. On a deployment with a single chain a missing or different `orgName` therefore does not change the verdict. Org-scoped reads such as `getOrgTierInfo(orgName)` send the name as given; the dashboard answers an agent-authenticated call for the agent's own org, whatever name was passed.
|
|
152
193
|
|
|
153
|
-
Agent policy and detail reads can
|
|
154
|
-
accept an explicit network override:
|
|
194
|
+
Agent policy and detail reads can take the org, or an explicit chain:
|
|
155
195
|
|
|
156
196
|
```ts
|
|
157
197
|
await atbash.getAgentPolicy(atbash.pubkey, { orgName: "acme" });
|
|
@@ -160,6 +200,41 @@ await atbash.getAgentDetail(atbash.pubkey, {
|
|
|
160
200
|
});
|
|
161
201
|
```
|
|
162
202
|
|
|
203
|
+
### Judge endpoint rules
|
|
204
|
+
|
|
205
|
+
Both `fromConfig` and the constructor validate the endpoint before any request. `validateJudgeEndpoint(...)` exposes the same check.
|
|
206
|
+
|
|
207
|
+
- With no endpoint configured the SDK talks to the endpoint compiled into the build (`https://atbash.ai` for a release build).
|
|
208
|
+
- An `https://` endpoint is accepted without further setup only on the trusted hosts: `atbash.ai`, `www.atbash.ai` and the build's own default host.
|
|
209
|
+
- Any other `https://` endpoint is a self-hosted judge. It needs `policy: "self-hosted"` plus `verifyPubKey` (the judge's 66-hex compressed response-signing key), or `ATBASH_ENDPOINT` plus `ATBASH_JUDGE_VERIFY_PUBKEY`. Every judge response is then signature-checked against that key. Without the key the constructor throws `judge endpoint hostname "<host>" is not in the trusted allowlist`.
|
|
210
|
+
- Plain `http://` is accepted only for loopback (`localhost`, `127.0.0.1`, `::1`), for a dashboard running on the same machine. Any other `http://` endpoint throws.
|
|
211
|
+
- A URL with embedded credentials (`user:pass@host`) throws.
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
const atbash = Atbash.fromConfig({
|
|
215
|
+
judge: {
|
|
216
|
+
policy: "self-hosted",
|
|
217
|
+
endpoint: "https://judge.example.com",
|
|
218
|
+
verifyPubKey: "02…66 hex…",
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### From a key file to a first ALLOW
|
|
224
|
+
|
|
225
|
+
1. Download the key file the onboarding wizard offers at its Deploy step (it is in the `key=value` form above) and save it, for example as `./agent.key`.
|
|
226
|
+
2. Build the client from that file and judge an action:
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
import { Atbash } from "@atbash/sdk";
|
|
230
|
+
|
|
231
|
+
const atbash = Atbash.fromConfig({ keyPath: "./agent.key" });
|
|
232
|
+
const result = await atbash.judgeAction("read file", "list the files in ./src");
|
|
233
|
+
console.log(result.allow, result.enforced, result.reason);
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Dropping the same file at `~/.config/atbash/guard-client-key` lets `Atbash.fromConfig()` find it with no options at all.
|
|
237
|
+
|
|
163
238
|
## Error handling
|
|
164
239
|
|
|
165
240
|
The SDK throws standard `Error` objects. Known failure modes are enriched with a pointer to the dashboard page that fixes them:
|
package/dist/browser.d.mts
CHANGED
|
@@ -1154,11 +1154,18 @@ declare function getRecentAgentMemory(auth: AgentAuth, chainOpts?: ChainOpts, fi
|
|
|
1154
1154
|
* when you need every active version regardless of age.
|
|
1155
1155
|
*/
|
|
1156
1156
|
declare function getActiveAgentMemory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null): Promise<AgentMemoryEntry[]>;
|
|
1157
|
+
interface MemoryHistoryPage {
|
|
1158
|
+
/** Most versions to return, at most 200. Omit for the full history. */
|
|
1159
|
+
maxCount?: number;
|
|
1160
|
+
/** Return only versions with a lower id: the last id of the previous page. */
|
|
1161
|
+
beforeId?: number;
|
|
1162
|
+
}
|
|
1157
1163
|
/**
|
|
1158
1164
|
* Full version history — active + inactive, most recent first. Used
|
|
1159
|
-
* by rollback UX to choose a target version.
|
|
1165
|
+
* by rollback UX to choose a target version. Pass `page` to read it in
|
|
1166
|
+
* pages; this needs a Dashboard and chain that support paging.
|
|
1160
1167
|
*/
|
|
1161
|
-
declare function getMemoryHistory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null): Promise<AgentMemoryEntry[]>;
|
|
1168
|
+
declare function getMemoryHistory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null, page?: MemoryHistoryPage): Promise<AgentMemoryEntry[]>;
|
|
1162
1169
|
/**
|
|
1163
1170
|
* Fetch a single memory entry by version id, including its current
|
|
1164
1171
|
* `is_active` state. Version ids are agent-unique on chain (not
|
|
@@ -1988,4 +1995,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
1988
1995
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
1989
1996
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
1990
1997
|
|
|
1991
|
-
export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, JudgeRefusalError, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OperationEvent, type OrgSubscription, PRIVATE_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, canonicalAllow, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, configureEvents, configureJailHold, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, eventsAreOn, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isJailHeld, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
1998
|
+
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, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
package/dist/browser.mjs
CHANGED
|
@@ -45635,15 +45635,19 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
45635
45635
|
}
|
|
45636
45636
|
const parsed = tryParseJson(bytes.toString("utf-8"));
|
|
45637
45637
|
const data = isRecord2(parsed) ? parsed : {};
|
|
45638
|
+
const rawId = data.tool_call_id ?? data.judgmentId;
|
|
45639
|
+
const statedId = wireText(rawId);
|
|
45640
|
+
const sameCall = rawId === void 0 || rawId === null || statedId === judgmentId;
|
|
45638
45641
|
return {
|
|
45639
45642
|
status: normalizeStatus(data.status),
|
|
45640
45643
|
verdict: normalizeVerdict(data.verdict),
|
|
45641
|
-
allow: this.executable(data),
|
|
45644
|
+
allow: sameCall && this.executable(data),
|
|
45642
45645
|
reason: wireText(data.reason),
|
|
45643
|
-
judgmentId:
|
|
45646
|
+
judgmentId: statedId || judgmentId,
|
|
45644
45647
|
onChain: optBool(data.onChain),
|
|
45645
45648
|
cached: optBool(data.cached),
|
|
45646
|
-
responseTimeMs
|
|
45649
|
+
// The Dashboard sends response_time_ms; responseTimeMs is the spec name.
|
|
45650
|
+
responseTimeMs: optNumber(data.responseTimeMs ?? data.response_time_ms)
|
|
45647
45651
|
};
|
|
45648
45652
|
});
|
|
45649
45653
|
}
|
|
@@ -46463,7 +46467,7 @@ async function getRecentAgentMemory(_auth, _chainOpts) {
|
|
|
46463
46467
|
async function getActiveAgentMemory(_auth, _chainOpts) {
|
|
46464
46468
|
throw new Error(`getActiveAgentMemory ${STUB_MSG3}`);
|
|
46465
46469
|
}
|
|
46466
|
-
async function getMemoryHistory(_auth, _chainOpts) {
|
|
46470
|
+
async function getMemoryHistory(_auth, _chainOpts, _filePath, _page) {
|
|
46467
46471
|
throw new Error(`getMemoryHistory ${STUB_MSG3}`);
|
|
46468
46472
|
}
|
|
46469
46473
|
async function getMemoryById(_id, _auth, _chainOpts) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1154,11 +1154,18 @@ declare function getRecentAgentMemory(auth: AgentAuth, chainOpts?: ChainOpts, fi
|
|
|
1154
1154
|
* when you need every active version regardless of age.
|
|
1155
1155
|
*/
|
|
1156
1156
|
declare function getActiveAgentMemory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null): Promise<AgentMemoryEntry[]>;
|
|
1157
|
+
interface MemoryHistoryPage {
|
|
1158
|
+
/** Most versions to return, at most 200. Omit for the full history. */
|
|
1159
|
+
maxCount?: number;
|
|
1160
|
+
/** Return only versions with a lower id: the last id of the previous page. */
|
|
1161
|
+
beforeId?: number;
|
|
1162
|
+
}
|
|
1157
1163
|
/**
|
|
1158
1164
|
* Full version history — active + inactive, most recent first. Used
|
|
1159
|
-
* by rollback UX to choose a target version.
|
|
1165
|
+
* by rollback UX to choose a target version. Pass `page` to read it in
|
|
1166
|
+
* pages; this needs a Dashboard and chain that support paging.
|
|
1160
1167
|
*/
|
|
1161
|
-
declare function getMemoryHistory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null): Promise<AgentMemoryEntry[]>;
|
|
1168
|
+
declare function getMemoryHistory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null, page?: MemoryHistoryPage): Promise<AgentMemoryEntry[]>;
|
|
1162
1169
|
/**
|
|
1163
1170
|
* Fetch a single memory entry by version id, including its current
|
|
1164
1171
|
* `is_active` state. Version ids are agent-unique on chain (not
|
|
@@ -1988,4 +1995,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
1988
1995
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
1989
1996
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
1990
1997
|
|
|
1991
|
-
export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, JudgeRefusalError, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OperationEvent, type OrgSubscription, PRIVATE_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, canonicalAllow, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, configureEvents, configureJailHold, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, eventsAreOn, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isJailHeld, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
1998
|
+
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, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -1154,11 +1154,18 @@ declare function getRecentAgentMemory(auth: AgentAuth, chainOpts?: ChainOpts, fi
|
|
|
1154
1154
|
* when you need every active version regardless of age.
|
|
1155
1155
|
*/
|
|
1156
1156
|
declare function getActiveAgentMemory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null): Promise<AgentMemoryEntry[]>;
|
|
1157
|
+
interface MemoryHistoryPage {
|
|
1158
|
+
/** Most versions to return, at most 200. Omit for the full history. */
|
|
1159
|
+
maxCount?: number;
|
|
1160
|
+
/** Return only versions with a lower id: the last id of the previous page. */
|
|
1161
|
+
beforeId?: number;
|
|
1162
|
+
}
|
|
1157
1163
|
/**
|
|
1158
1164
|
* Full version history — active + inactive, most recent first. Used
|
|
1159
|
-
* by rollback UX to choose a target version.
|
|
1165
|
+
* by rollback UX to choose a target version. Pass `page` to read it in
|
|
1166
|
+
* pages; this needs a Dashboard and chain that support paging.
|
|
1160
1167
|
*/
|
|
1161
|
-
declare function getMemoryHistory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null): Promise<AgentMemoryEntry[]>;
|
|
1168
|
+
declare function getMemoryHistory(auth: AgentAuth, chainOpts?: ChainOpts, filePath?: string | null, page?: MemoryHistoryPage): Promise<AgentMemoryEntry[]>;
|
|
1162
1169
|
/**
|
|
1163
1170
|
* Fetch a single memory entry by version id, including its current
|
|
1164
1171
|
* `is_active` state. Version ids are agent-unique on chain (not
|
|
@@ -1988,4 +1995,4 @@ declare function containsSecret(text: string): boolean;
|
|
|
1988
1995
|
declare function createMemorySnapshot(entries: MemoryEntry[], takenAt: number): MemorySnapshot;
|
|
1989
1996
|
declare function diffMemorySnapshots(before: MemorySnapshot, after: MemorySnapshot): MemoryDiffResult;
|
|
1990
1997
|
|
|
1991
|
-
export { type ActionType, type AgentAuth, type AgentLookupOptions, type AgentMemoryEntry, type AgentPolicy, type AnomalySeverity, type AnomalyType, Atbash, AtbashAPIError, type AtbashLogger, type AtbashOptions, type AtbashUserConfig, BOOT_SYNC_HINT, type ChainConfig, type ChainOpts, type ClassifierToolContext, type ClassifierToolEvent, type ClassifyMemoryReadOptions, type ClassifyMemoryWriteOptions, type ClientSource, type CommitMemoryOptions, DEFAULT_ENDPOINT, DEFAULT_MEMORY_PATH_PATTERNS, DEFAULT_MEMORY_READ_TOOL_NAMES, DEFAULT_MEMORY_WRITE_TOOL_NAMES, type Decision, type DecisionVerdict, EciesDomain, type EncryptedMemory, type Envelope, type FromConfigOptions, type GuardLogger, type GuardMemoryDecision, type GuardMemoryWriteInput, type GuardMemoryWriteResult, type HeldAction, type HeldActionReview, type HookDecision, HttpClient, HttpTransportError, type JudgeEndpointConfig, type JudgeOptions, JudgeRefusalError, type JudgeResult, type JudgmentState, type JudgmentStatus, KEY_FILENAMES, type KeyPair, type LogToolCallOptions, type LogToolCallResult, type MemoryAnomaly, type MemoryDiffResult, type MemoryEntry, MemoryGuardManager, type MemoryGuardManagerOptions, MemoryIntegrityError, type MemoryPointer, type MemoryRollbackEvent, type MemoryScanOptions, type MemoryScanResult, type MemoryScanVerdict, type MemorySnapshot, type ModifiedEntry, type Network, type OperationEvent, type OrgSubscription, PRIVATE_CHAIN, PointerStore, type Provider, type PubkeyValue, type RedactResult, type RollbackMemoryOptions, type SecretKind, type SecretMatch, SignatureVerificationError, type Subscription, type SyncMemoryOptions, type SyncMemoryResult, type TelemetryConfig, type TierInfo, type ToolCallFull, type ToolCallInput, type ToolCallRecord, type ValidatedEndpoint, type Verdict, type WrappedLogger, bootSyncFailureLine, buildAllowedJudgeHosts, canonicalAllow, chainForNetwork, chooseKeyPath, claimHashHex, classifyMemoryRead, classifyMemoryWrite, columnAad, commitMemoryVersion, configureEvents, configureJailHold, containsEvasionCharacters, containsSecret, createFileLogger, createMemoryGuardManager, createMemorySnapshot, decryptForOrg, decryptMemoryContent, defaultPluginLogPath, defaultPointerPath, deriveMemoryKey, derivePublicKey, diffMemorySnapshots, encryptForOrg, encryptMemoryContent, encryptedLength, eventsAreOn, flushTelemetry, generateKeypair, getActiveAgentMemory, getActiveMemoryId, getConfigDir, getConfigPath, getMemoryById, getMemoryHistory, getRecentAgentMemory, getRollbackHistory, guardMemoryWrite, isEnvelope, isJailHeld, isValidPrivateKey, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
|
1998
|
+
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, keyFingerprintOf, keyPathCandidates, loadAgent, loadAgentFromFile, loadUserConfig, memorySlotOf, normalizeActionForHash, normalizeActionType, normalizeForMatching, normalizeStatus, normalizeVerdict, packEnvelope, parseEnvelope, pubkeyToHex, recordCall, recordDuration, recordEvent, redactJsonStrings, redactSecrets, releaseJailHolds, resolve, resolveKeyPath, rollbackMemory, saveUserConfig, scanMemory, scanMemoryBatch, setupTelemetry, shutdownTelemetry, signEncryptedToolCall, signJudgeAction, signLogToolCall, syncLocalMemory, validateJudgeEndpoint, verifyJudgeResponseSignature, verifySignature };
|
package/dist/index.js
CHANGED
|
@@ -736,7 +736,7 @@ var import_sdk_metrics = require("@opentelemetry/sdk-metrics");
|
|
|
736
736
|
var import_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
737
737
|
var import_sdk_logs = require("@opentelemetry/sdk-logs");
|
|
738
738
|
var import_node_crypto = require("crypto");
|
|
739
|
-
var SDK_VERSION = true ? "0.
|
|
739
|
+
var SDK_VERSION = true ? "0.22.0-dev.0" : "";
|
|
740
740
|
var SDK_LANGUAGE = "node";
|
|
741
741
|
function sdkResourceAttributes() {
|
|
742
742
|
const attrs = {
|
|
@@ -1789,15 +1789,19 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1789
1789
|
}
|
|
1790
1790
|
const parsed = tryParseJson(bytes.toString("utf-8"));
|
|
1791
1791
|
const data = isRecord2(parsed) ? parsed : {};
|
|
1792
|
+
const rawId = data.tool_call_id ?? data.judgmentId;
|
|
1793
|
+
const statedId = wireText(rawId);
|
|
1794
|
+
const sameCall = rawId === void 0 || rawId === null || statedId === judgmentId;
|
|
1792
1795
|
return {
|
|
1793
1796
|
status: normalizeStatus(data.status),
|
|
1794
1797
|
verdict: normalizeVerdict(data.verdict),
|
|
1795
|
-
allow: this.executable(data),
|
|
1798
|
+
allow: sameCall && this.executable(data),
|
|
1796
1799
|
reason: wireText(data.reason),
|
|
1797
|
-
judgmentId:
|
|
1800
|
+
judgmentId: statedId || judgmentId,
|
|
1798
1801
|
onChain: optBool(data.onChain),
|
|
1799
1802
|
cached: optBool(data.cached),
|
|
1800
|
-
responseTimeMs
|
|
1803
|
+
// The Dashboard sends response_time_ms; responseTimeMs is the spec name.
|
|
1804
|
+
responseTimeMs: optNumber(data.responseTimeMs ?? data.response_time_ms)
|
|
1801
1805
|
};
|
|
1802
1806
|
});
|
|
1803
1807
|
}
|
|
@@ -2733,14 +2737,15 @@ async function decryptRow(row, key) {
|
|
|
2733
2737
|
updatedAt: parsed.updated_at
|
|
2734
2738
|
};
|
|
2735
2739
|
}
|
|
2736
|
-
async function readRows(action, auth, chainOpts, filePath) {
|
|
2740
|
+
async function readRows(action, auth, chainOpts, filePath, extra = {}) {
|
|
2737
2741
|
const key = await deriveMemoryKey(auth.privkey);
|
|
2738
2742
|
const rows = await memoryQuery(
|
|
2739
2743
|
action,
|
|
2740
2744
|
auth,
|
|
2741
2745
|
resolveBlockchainRid(chainOpts),
|
|
2742
2746
|
chainOpts,
|
|
2743
|
-
filePath
|
|
2747
|
+
filePath,
|
|
2748
|
+
extra
|
|
2744
2749
|
);
|
|
2745
2750
|
return Promise.all((rows ?? []).map((row) => decryptRow(row, key)));
|
|
2746
2751
|
}
|
|
@@ -2760,8 +2765,29 @@ function getRecentAgentMemory(auth, chainOpts, filePath) {
|
|
|
2760
2765
|
function getActiveAgentMemory(auth, chainOpts, filePath) {
|
|
2761
2766
|
return readRows("memory-active", auth, chainOpts, filePath ?? null);
|
|
2762
2767
|
}
|
|
2763
|
-
|
|
2764
|
-
|
|
2768
|
+
var MEMORY_HISTORY_MAX_COUNT = 200;
|
|
2769
|
+
function memoryHistoryPageArgs(page) {
|
|
2770
|
+
const extra = {};
|
|
2771
|
+
for (const [name, value] of [
|
|
2772
|
+
["max_count", page?.maxCount],
|
|
2773
|
+
["before_id", page?.beforeId]
|
|
2774
|
+
]) {
|
|
2775
|
+
if (value === void 0) continue;
|
|
2776
|
+
if (!Number.isSafeInteger(value) || value < 1) {
|
|
2777
|
+
throw new Error(`getMemoryHistory: ${name} must be a positive integer`);
|
|
2778
|
+
}
|
|
2779
|
+
if (name === "max_count" && value > MEMORY_HISTORY_MAX_COUNT) {
|
|
2780
|
+
throw new Error(`getMemoryHistory: max_count must be at most ${MEMORY_HISTORY_MAX_COUNT}`);
|
|
2781
|
+
}
|
|
2782
|
+
extra[name] = value;
|
|
2783
|
+
}
|
|
2784
|
+
return extra;
|
|
2785
|
+
}
|
|
2786
|
+
async function getMemoryHistory(auth, chainOpts, filePath, page) {
|
|
2787
|
+
const rows = await readRows("memory-history", auth, chainOpts, filePath ?? null, memoryHistoryPageArgs(page));
|
|
2788
|
+
const beforeId = page?.beforeId;
|
|
2789
|
+
const older = beforeId === void 0 ? rows : rows.filter((row) => row.id < beforeId);
|
|
2790
|
+
return page?.maxCount === void 0 ? older : older.slice(0, page.maxCount);
|
|
2765
2791
|
}
|
|
2766
2792
|
async function getMemoryById(id, auth, chainOpts) {
|
|
2767
2793
|
native.validateMemoryId(id);
|
package/dist/index.mjs
CHANGED
|
@@ -613,7 +613,7 @@ import {
|
|
|
613
613
|
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
|
614
614
|
import { BatchLogRecordProcessor, LoggerProvider } from "@opentelemetry/sdk-logs";
|
|
615
615
|
import { createHash } from "crypto";
|
|
616
|
-
var SDK_VERSION = true ? "0.
|
|
616
|
+
var SDK_VERSION = true ? "0.22.0-dev.0" : "";
|
|
617
617
|
var SDK_LANGUAGE = "node";
|
|
618
618
|
function sdkResourceAttributes() {
|
|
619
619
|
const attrs = {
|
|
@@ -1672,15 +1672,19 @@ config.json still holds an "agentKey" (${identity}), but a settings file no long
|
|
|
1672
1672
|
}
|
|
1673
1673
|
const parsed = tryParseJson(bytes.toString("utf-8"));
|
|
1674
1674
|
const data = isRecord2(parsed) ? parsed : {};
|
|
1675
|
+
const rawId = data.tool_call_id ?? data.judgmentId;
|
|
1676
|
+
const statedId = wireText(rawId);
|
|
1677
|
+
const sameCall = rawId === void 0 || rawId === null || statedId === judgmentId;
|
|
1675
1678
|
return {
|
|
1676
1679
|
status: normalizeStatus(data.status),
|
|
1677
1680
|
verdict: normalizeVerdict(data.verdict),
|
|
1678
|
-
allow: this.executable(data),
|
|
1681
|
+
allow: sameCall && this.executable(data),
|
|
1679
1682
|
reason: wireText(data.reason),
|
|
1680
|
-
judgmentId:
|
|
1683
|
+
judgmentId: statedId || judgmentId,
|
|
1681
1684
|
onChain: optBool(data.onChain),
|
|
1682
1685
|
cached: optBool(data.cached),
|
|
1683
|
-
responseTimeMs
|
|
1686
|
+
// The Dashboard sends response_time_ms; responseTimeMs is the spec name.
|
|
1687
|
+
responseTimeMs: optNumber(data.responseTimeMs ?? data.response_time_ms)
|
|
1684
1688
|
};
|
|
1685
1689
|
});
|
|
1686
1690
|
}
|
|
@@ -2616,14 +2620,15 @@ async function decryptRow(row, key) {
|
|
|
2616
2620
|
updatedAt: parsed.updated_at
|
|
2617
2621
|
};
|
|
2618
2622
|
}
|
|
2619
|
-
async function readRows(action, auth, chainOpts, filePath) {
|
|
2623
|
+
async function readRows(action, auth, chainOpts, filePath, extra = {}) {
|
|
2620
2624
|
const key = await deriveMemoryKey(auth.privkey);
|
|
2621
2625
|
const rows = await memoryQuery(
|
|
2622
2626
|
action,
|
|
2623
2627
|
auth,
|
|
2624
2628
|
resolveBlockchainRid(chainOpts),
|
|
2625
2629
|
chainOpts,
|
|
2626
|
-
filePath
|
|
2630
|
+
filePath,
|
|
2631
|
+
extra
|
|
2627
2632
|
);
|
|
2628
2633
|
return Promise.all((rows ?? []).map((row) => decryptRow(row, key)));
|
|
2629
2634
|
}
|
|
@@ -2643,8 +2648,29 @@ function getRecentAgentMemory(auth, chainOpts, filePath) {
|
|
|
2643
2648
|
function getActiveAgentMemory(auth, chainOpts, filePath) {
|
|
2644
2649
|
return readRows("memory-active", auth, chainOpts, filePath ?? null);
|
|
2645
2650
|
}
|
|
2646
|
-
|
|
2647
|
-
|
|
2651
|
+
var MEMORY_HISTORY_MAX_COUNT = 200;
|
|
2652
|
+
function memoryHistoryPageArgs(page) {
|
|
2653
|
+
const extra = {};
|
|
2654
|
+
for (const [name, value] of [
|
|
2655
|
+
["max_count", page?.maxCount],
|
|
2656
|
+
["before_id", page?.beforeId]
|
|
2657
|
+
]) {
|
|
2658
|
+
if (value === void 0) continue;
|
|
2659
|
+
if (!Number.isSafeInteger(value) || value < 1) {
|
|
2660
|
+
throw new Error(`getMemoryHistory: ${name} must be a positive integer`);
|
|
2661
|
+
}
|
|
2662
|
+
if (name === "max_count" && value > MEMORY_HISTORY_MAX_COUNT) {
|
|
2663
|
+
throw new Error(`getMemoryHistory: max_count must be at most ${MEMORY_HISTORY_MAX_COUNT}`);
|
|
2664
|
+
}
|
|
2665
|
+
extra[name] = value;
|
|
2666
|
+
}
|
|
2667
|
+
return extra;
|
|
2668
|
+
}
|
|
2669
|
+
async function getMemoryHistory(auth, chainOpts, filePath, page) {
|
|
2670
|
+
const rows = await readRows("memory-history", auth, chainOpts, filePath ?? null, memoryHistoryPageArgs(page));
|
|
2671
|
+
const beforeId = page?.beforeId;
|
|
2672
|
+
const older = beforeId === void 0 ? rows : rows.filter((row) => row.id < beforeId);
|
|
2673
|
+
return page?.maxCount === void 0 ? older : older.slice(0, page.maxCount);
|
|
2648
2674
|
}
|
|
2649
2675
|
async function getMemoryById(id, auth, chainOpts) {
|
|
2650
2676
|
native.validateMemoryId(id);
|
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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-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.22.0-dev.0') {
|
|
668
|
+
throw new Error(`WASI binding package version mismatch, expected 0.22.0-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.22.0-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",
|
|
@@ -97,10 +97,10 @@
|
|
|
97
97
|
"typescript-eslint": "^8.62.1"
|
|
98
98
|
},
|
|
99
99
|
"optionalDependencies": {
|
|
100
|
-
"@atbash/sdk-linux-x64-gnu": "0.
|
|
101
|
-
"@atbash/sdk-linux-arm64-gnu": "0.
|
|
102
|
-
"@atbash/sdk-linux-x64-musl": "0.
|
|
103
|
-
"@atbash/sdk-darwin-arm64": "0.
|
|
104
|
-
"@atbash/sdk-win32-x64-msvc": "0.
|
|
100
|
+
"@atbash/sdk-linux-x64-gnu": "0.22.0-dev.0",
|
|
101
|
+
"@atbash/sdk-linux-arm64-gnu": "0.22.0-dev.0",
|
|
102
|
+
"@atbash/sdk-linux-x64-musl": "0.22.0-dev.0",
|
|
103
|
+
"@atbash/sdk-darwin-arm64": "0.22.0-dev.0",
|
|
104
|
+
"@atbash/sdk-win32-x64-msvc": "0.22.0-dev.0"
|
|
105
105
|
}
|
|
106
106
|
}
|