@atbash/sdk 0.5.1 → 0.5.3-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.
Files changed (4) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +148 -107
  3. package/index.js +52 -52
  4. package/package.json +14 -7
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ Atbash CLI — Proprietary Software License
2
+
3
+ Copyright (c) 2026 Atbash,
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ The views and conclusions contained in the software and documentation are those
27
+ of the authors and should not be interpreted as representing official policies,
28
+ either expressed or implied, Atbash.
package/README.md CHANGED
@@ -1,143 +1,184 @@
1
- # @atbash/sdk (Node)
1
+ # @atbash/sdk
2
2
 
3
- The Node.js Atbash SDK. One package, two layers:
3
+ TypeScript SDK for Atbash the safety layer that evaluates AI agent actions against operator-defined policies before execution.
4
4
 
5
- - **Rust core via NAPI-RS** — signing, key derivation, redaction, unicode
6
- normalization, memory diff. Byte-identical to the TypeScript reference.
7
- - **Judge / risk-engine HTTP client** — types generated from
8
- [`spec/openapi.yaml`](../../spec/openapi.yaml), transport in
9
- [src-ts/http/client.ts](src-ts/http/client.ts).
5
+ ## Installation
10
6
 
11
- The high-level `Atbash` class composes the two, mirroring the TS reference at
12
- [atbash-sdk/src/client.ts](../../atbash-sdk/src/client.ts) and the Python
13
- surface at [bindings/python/python/atbash/client.py](../../bindings/python/python/atbash/client.py).
7
+ ```bash
8
+ npm install @atbash/sdk
9
+ ```
14
10
 
15
- ## Layout
11
+ Requires Node.js 18+. Server-side only — private keys are used for local signing and must never be exposed to browsers.
16
12
 
17
- ```
18
- bindings/node/
19
- ├── src/lib.rs # NAPI-RS Rust bindings → atbash.<triple>.node + index.{js,d.ts}
20
- ├── index.js / index.d.ts # NAPI-generated native glue (gitignored)
21
- ├── src-ts/ # TypeScript SDK surface
22
- │ ├── index.ts # public exports (Atbash + native re-exports)
23
- │ ├── client.ts # Atbash class (judge / log / queries)
24
- │ ├── native.ts # typed loader for the NAPI addon
25
- │ ├── http/ # schema.ts (generated) + thin fetch client
26
- │ ├── types.ts, constants.ts, errors.ts, normalize.ts
27
- │ └── ...
28
- ├── dist/ # tsup output (gitignored) — what gets published
29
- └── __test__/ # native parity, config, and live health tests
30
- ```
13
+ ## Quickstart
31
14
 
32
- ## Setup
15
+ ```ts
16
+ import { Atbash } from "@atbash/sdk";
33
17
 
34
- ```bash
35
- cd bindings/node
36
- npm install
18
+ // 1. Construct with your agent's private key.
19
+ // The SDK validates the key and derives the matching public key.
20
+ const atbash = new Atbash(process.env.ATBASH_AGENT_KEY!, {
21
+ orgName: "my_org",
22
+ });
23
+
24
+ // 2. Submit an action for judgment, before executing it.
25
+ // The SDK signs the transaction locally and sends it to the judge API.
26
+ // The private key stays on your machine — never sent over HTTP.
27
+ const result = await atbash.judgeAction(
28
+ "Transfer $50,000 to external wallet 0xabc",
29
+ "Outbound AML check — new recipient, over threshold",
30
+ );
31
+
32
+ // 3. Enforce the verdict
33
+ switch (result.verdict) {
34
+ case "ALLOW":
35
+ // Proceed with the action
36
+ break;
37
+ case "HOLD":
38
+ // Held — operator must approve in the dashboard
39
+ console.log("Held for review:", result.toolCallId);
40
+ break;
41
+ case "BLOCK":
42
+ // Refused — agent is jailed in Enforcement tier
43
+ throw new Error(`Blocked: ${result.reason}`);
44
+ }
37
45
  ```
38
46
 
39
- ## Build
47
+ Before this works, the agent must be onboarded at [atbash.ai](https://atbash.ai/) — assigned to an org, with a policy pack attached, and the org on an active subscription plan.
40
48
 
41
- ```bash
42
- npm run gen:http # regenerate src-ts/http/schema.ts from spec/openapi.yaml
43
- npm run build:native # atbash.<triple>.node + index.{js,d.ts}
44
- npm run build:ts # tsup → dist/{index.js,index.mjs,index.d.ts}
45
- npm run build # native + ts
46
- ```
49
+ ## How it works
47
50
 
48
- Native artifacts (`*.node`, `index.js`, `index.d.ts`) and `dist/` are
49
- `.gitignore`d — build locally.
51
+ `judgeAction()` performs a two-step flow:
50
52
 
51
- ## Test
53
+ 1. **Sign locally** — signs the request using the agent's private key. The key never leaves your machine.
54
+ 2. **Request verdict** — sends the signed request and agent pubkey to the Atbash judge API. The server broadcasts it to the Chromia blockchain and returns a verdict.
52
55
 
53
- ```bash
54
- npm run test:native # native vector parity
55
- npm run test:live # real SDK health, skipped unless ATBASH_LIVE_HEALTH=1
56
- ```
56
+ ## Don't have an agent yet?
57
57
 
58
- The live SDK health test uses real HTTP responses only. It verifies BRID
59
- signing, key loading, and a real judge call when live credentials are present.
58
+ Two ways to create an agent:
60
59
 
61
- ## Usage
60
+ 1. **Dashboard (recommended)** — create an agent at [atbash.ai/risk-engine/agents](https://atbash.ai/risk-engine/agents). The dashboard generates the keypair, assigns the agent to your org, and lets you attach a policy pack — all in one step.
62
61
 
63
- ```ts
64
- import { Atbash } from "@atbash/sdk";
62
+ 2. **Programmatic** — generate a keypair locally, then onboard it via the dashboard:
65
63
 
66
- const client = new Atbash(privkey, { endpoint: "https://atbash.ai" });
64
+ ```ts
65
+ import { generateKeypair } from "@atbash/sdk";
66
+ const { privKey, pubKey } = generateKeypair();
67
+ console.log("Save this private key somewhere safe:", privKey);
68
+ ```
67
69
 
68
- // Sign + submit for judgement (verdict normalized to ALLOW/HOLD/BLOCK).
69
- const verdict = await client.judgeAction("read_file", "reading config", {
70
- toolName: "fs.read",
71
- });
70
+ Paste the public key into the **Onboard agent** form on the dashboard, assign it to an org, and attach a policy pack before calling `judgeAction`.
72
71
 
73
- // Sign a tool call locally (server broadcasts to chain).
74
- const logged = await client.logToolCall("write_file", "patching deps");
72
+ ## Secret storage
75
73
 
76
- // Read-only queries.
77
- const tier = await client.getOrgTierInfo("acme");
78
- ```
74
+ - Load the private key from an environment variable (`ATBASH_AGENT_KEY`) or a secret manager — never hardcode it.
75
+ - Never commit `.env` files containing the key.
76
+ - If a key leaks, stop using it and create a new agent in the dashboard.
79
77
 
80
- Crypto / redaction / memory primitives are also exported as plain functions
81
- (byte-identical to the TS reference):
78
+ ## Verdicts
82
79
 
83
- ```ts
84
- import {
85
- generateKeypair,
86
- derivePublicKey,
87
- signLogToolCall,
88
- redactSecrets,
89
- diffMemorySnapshots,
90
- DEFAULT_BLOCKCHAIN_RID,
91
- } from "@atbash/sdk";
92
-
93
- const kp = generateKeypair(); // { priv_key, pub_key }
94
- const { redacted, found } = redactSecrets("token=sk-abc123…");
95
- ```
80
+ Every `judgeAction` call returns one of three verdicts:
81
+
82
+ | Verdict | Meaning | What your code should do |
83
+ |---|---|---|
84
+ | `ALLOW` | Action is within policy | Proceed with execution |
85
+ | `HOLD` | Requires operator review | Pause — poll `getJudgmentStatus` until resolved |
86
+ | `BLOCK` | Violates a red line | Abort — agent is jailed in Enforcement tier |
87
+
88
+ > **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.
96
89
 
97
- ## Config loading
90
+ ## API
98
91
 
99
- Construct from environment / config file / key file instead of an inline key.
100
- Resolution precedence is flag → `ATBASH_*` env → `~/.config/atbash/config.json`
101
- (camelCase keys, shared with the Python SDK) → default.
92
+ The `Atbash` class is the main entry point. Construct it once with your agent's private key and (optionally) a default `orgName`, then call methods on it.
93
+
94
+ ### Operations
95
+
96
+ | Method | Use case |
97
+ |---|---|
98
+ | `judgeAction(action, context, opts?)` | Sign locally + request a verdict from the judge API |
99
+
100
+ ### Queries
101
+
102
+ Read-only methods that read from the Chromia blockchain and dashboard.
103
+
104
+ | Method | Use case |
105
+ |---|---|
106
+ | `checkAgentExists(pubkey?)` | Check if an agent is onboarded before signing |
107
+ | `getJudgmentStatus(judgmentId, pubkey)` | Poll whether a held action has been approved or rejected |
108
+ | `getToolCalls(maxCount)` | List recent tool calls across all agents |
109
+ | `getOrgToolCalls(orgName, maxCount)` | List tool calls for a specific org |
110
+ | `getAgentToolCalls(pubkey, maxCount)` | List tool calls for a specific agent |
111
+ | `getToolCallCount()` | Total number of tool calls on-chain |
112
+ | `getToolCallFull(toolCallId)` | Full details of a single tool call |
113
+ | `getOrgTierInfo(orgName)` | Check an org's tier and whether verdicts are enabled |
114
+ | `getAgentDetail(pubkey)` | Get agent metadata (org, status, creation date) |
115
+ | `getAgentPolicy(pubkey)` | Check the agent's policy pack and jail status |
116
+ | `getPendingHeldActions(orgName, maxCount)` | List actions waiting for operator approval |
117
+ | `getHeldActionReviews(orgName, maxCount)` | List completed operator reviews |
118
+ | `getSafetyStats()` | Chain-wide safety statistics |
119
+
120
+ ### Agent identity
121
+
122
+ Standalone helpers for keypair handling.
123
+
124
+ | Function | Use case |
125
+ |---|---|
126
+ | `generateKeypair()` | Generate a fresh secp256k1 keypair |
127
+ | `derivePublicKey(privkey)` | Derive the public key from a private key |
128
+ | `isValidPrivateKey(hex)` | Validate a private-key string |
129
+ | `loadAgent(privkey)` | Validate the key + return `{ pubkey, privkey }` |
130
+
131
+ ## Configuration
132
+
133
+ Configuration is resolved with priority: **constructor arg > env var > config file** (`~/.config/atbash/config.json`).
102
134
 
103
135
  ```ts
104
136
  import { Atbash } from "@atbash/sdk";
105
-
106
- // Reads agentKey/judgeEndpoint/blockchainRid from env or config.json; falls
107
- // back to the key file at ~/.config/atbash/guard-client-key.
108
- const client = Atbash.fromConfig();
109
-
110
- // Self-hosted judge: endpoint is validated and its response-signing pubkey
111
- // becomes the default verifyPubKey for judgeAction.
112
- const selfHosted = Atbash.fromConfig({
113
- judge: {
114
- policy: "self-hosted",
115
- endpoint: "https://judge.internal",
116
- verifyPubKey: "02…", // 66-hex compressed secp256k1
117
- },
118
- });
137
+ const atbash = Atbash.fromConfig(); // reads env + config file
119
138
  ```
120
139
 
121
- Lower-level helpers are also exported: `loadUserConfig`, `saveUserConfig`,
122
- `resolve`, `validateJudgeEndpoint`, `resolveKeyPath`, `loadAgentFromFile`.
140
+ | Config key | Env var |
141
+ |---|---|
142
+ | `agentKey` | `ATBASH_AGENT_KEY` |
143
+ | `orgName` | `ATBASH_ORG_NAME` |
144
+ | `judgeEndpoint` | `ATBASH_ENDPOINT` |
145
+ | `blockchainRid` | `ATBASH_BLOCKCHAIN_RID` |
146
+ | `provider` | `ATBASH_PROVIDER` |
147
+ | `providerModel` | `ATBASH_PROVIDER_MODEL` |
148
+
149
+ Persistent config helpers: `saveUserConfig(config)`, `loadUserConfig()`, `resolve(key, flagValue?)`, `getConfigPath()`.
150
+
151
+ ## Error handling
152
+
153
+ The SDK throws standard `Error` objects. Known failure modes are enriched with a pointer to the dashboard page that fixes them:
123
154
 
124
- ## One-call guard: `auditToolCall`
155
+ ```
156
+ API error 404: {"error":"Agent not registered..."}
157
+ → Onboard the agent at https://atbash.ai/risk-engine/agents
158
+ ```
125
159
 
126
- Redact secrets sign judge allow/deny `Decision`, failing closed by
127
- default (any error denies unless `failClosed: false`):
160
+ | Error | Cause | Where to fix |
161
+ |---|---|---|
162
+ | `API error 404: Agent not registered` | Agent not onboarded | [atbash.ai/risk-engine/agents](https://atbash.ai/risk-engine/agents) |
163
+ | `API error 400: Agent has no policy` | No policy attached to agent | [atbash.ai/risk-engine/agents](https://atbash.ai/risk-engine/agents) |
164
+ | `Agent is jailed` | BLOCK verdict triggered auto-jail | [atbash.ai/risk-engine/agents](https://atbash.ai/risk-engine/agents) |
165
+ | `Verdicts are disabled` | Org has no active subscription | [atbash.ai/risk-engine/settings](https://atbash.ai/risk-engine/settings) |
166
+ | `API error 400: action is required` | Empty action string | Fix caller |
128
167
 
129
168
  ```ts
130
- const client = Atbash.fromConfig({ logger: console });
131
- const decision = await client.auditToolCall({
132
- toolName: "shell.exec",
133
- args: { cmd: "rm -rf /tmp/cache" },
134
- context: "cleaning build cache",
135
- });
136
- if (!decision.allow) throw new Error(`${decision.verdict}: ${decision.reason}`);
169
+ try {
170
+ const result = await atbash.judgeAction(action, context);
171
+ } catch (err) {
172
+ if (err.message.includes("Agent not registered")) {
173
+ // Point the user at https://atbash.ai/risk-engine/agents to onboard.
174
+ }
175
+ }
137
176
  ```
138
177
 
139
- Secret-shaped values in `args`/`context` are redacted before signing, so they
140
- never reach the signed bytes, the request, the on-chain log, or the LLM prompt.
178
+ ## Dashboard
179
+
180
+ Policy authoring, operator reviews, and agent management happen at [atbash.ai](https://atbash.ai/). The SDK is the programmatic interface; the dashboard is the operator interface.
181
+
182
+ ## License
141
183
 
142
- The raw native addon is also reachable at `@atbash/sdk/native` for advanced
143
- callers who want the un-wrapped functions.
184
+ Proprietary all rights reserved. See [LICENSE](https://atbash.ai/license).
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@atbash/sdk-android-arm64')
79
79
  const bindingPackageVersion = require('@atbash/sdk-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@atbash/sdk-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@atbash/sdk-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@atbash/sdk-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@atbash/sdk-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@atbash/sdk-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@atbash/sdk-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@atbash/sdk-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@atbash/sdk-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@atbash/sdk-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@atbash/sdk-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@atbash/sdk-darwin-universal')
184
184
  const bindingPackageVersion = require('@atbash/sdk-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@atbash/sdk-darwin-x64')
200
200
  const bindingPackageVersion = require('@atbash/sdk-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@atbash/sdk-darwin-arm64')
216
216
  const bindingPackageVersion = require('@atbash/sdk-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@atbash/sdk-freebsd-x64')
236
236
  const bindingPackageVersion = require('@atbash/sdk-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@atbash/sdk-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@atbash/sdk-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@atbash/sdk-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@atbash/sdk-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@atbash/sdk-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@atbash/sdk-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@atbash/sdk-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@atbash/sdk-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@atbash/sdk-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@atbash/sdk-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@atbash/sdk-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@atbash/sdk-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@atbash/sdk-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@atbash/sdk-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@atbash/sdk-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@atbash/sdk-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@atbash/sdk-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@atbash/sdk-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@atbash/sdk-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@atbash/sdk-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@atbash/sdk-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@atbash/sdk-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@atbash/sdk-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@atbash/sdk-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@atbash/sdk-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@atbash/sdk-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@atbash/sdk-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@atbash/sdk-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@atbash/sdk-openharmony-x64')
494
494
  const bindingPackageVersion = require('@atbash/sdk-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@atbash/sdk-openharmony-arm')
510
510
  const bindingPackageVersion = require('@atbash/sdk-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.5.0-dev.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.5.0-dev.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.5.1-dev.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.5.1-dev.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
package/package.json CHANGED
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "name": "@atbash/sdk",
3
- "version": "0.5.1",
4
- "description": "Atbash SDK for Node.jsRust core (signing, redaction, memory diff) via NAPI-RS + judge/risk-engine HTTP client generated from spec/openapi.yaml.",
3
+ "version": "0.5.3-dev.0",
4
+ "description": "TypeScript SDK for Atbashthe safety layer that evaluates AI agent actions against operator-defined policies before execution.",
5
+ "keywords": [
6
+ "atbash",
7
+ "risk-engine",
8
+ "agent-safety",
9
+ "ai-safety"
10
+ ],
5
11
  "main": "dist/index.js",
6
12
  "module": "dist/index.mjs",
7
13
  "types": "dist/index.d.ts",
@@ -17,7 +23,7 @@
17
23
  "default": "./index.js"
18
24
  }
19
25
  },
20
- "license": "Apache-2.0",
26
+ "license": "SEE LICENSE IN LICENSE",
21
27
  "napi": {
22
28
  "name": "atbash",
23
29
  "packageName": "@atbash/sdk",
@@ -42,7 +48,8 @@
42
48
  "index.js",
43
49
  "index.d.ts",
44
50
  "*.node",
45
- "README.md"
51
+ "README.md",
52
+ "LICENSE"
46
53
  ],
47
54
  "scripts": {
48
55
  "build:native": "napi build --platform --release",
@@ -81,8 +88,8 @@
81
88
  "typescript-eslint": "^8.62.1"
82
89
  },
83
90
  "optionalDependencies": {
84
- "@atbash/sdk-linux-x64-gnu": "0.5.1",
85
- "@atbash/sdk-linux-arm64-gnu": "0.5.1",
86
- "@atbash/sdk-darwin-arm64": "0.5.1"
91
+ "@atbash/sdk-linux-x64-gnu": "0.5.1-dev.0",
92
+ "@atbash/sdk-linux-arm64-gnu": "0.5.1-dev.0",
93
+ "@atbash/sdk-darwin-arm64": "0.5.1-dev.0"
87
94
  }
88
95
  }