@atbash/atbash-langgraph 0.0.15-dev.1 → 0.0.15-dev.3

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 CHANGED
@@ -7,7 +7,7 @@ This package adds a guard node before tool execution and an audit node after, us
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
- npm install @atbash/atbash-langgraph
10
+ npm install @atbash/atbash-langgraph@0.0.15-dev.2
11
11
  ```
12
12
 
13
13
  Peer dependencies:
@@ -28,7 +28,6 @@ Use this package when:
28
28
  ## Quick Start
29
29
 
30
30
  ```ts
31
- import { loadAgent } from "@atbash/sdk";
32
31
  import { StateGraph, START, END, MemorySaver } from "@langchain/langgraph";
33
32
  import { AtbashStateAnnotation, addAtbashSafety } from "@atbash/atbash-langgraph";
34
33
 
@@ -66,11 +65,22 @@ Convenience helper that wires `atbash_guard` and `atbash_audit` into your graph.
66
65
 
67
66
  Assumes your graph has nodes named `agent` and `tools`. If your layout differs, use `createGuardNode()` and `createAuditNode()` directly.
68
67
 
69
- | Option | Type | Description |
70
- |---|---|---|
71
- | `privkey` | `string` | Agent private key (falls back to `ATBASH_AGENT_PRIVKEY` env var) |
72
- | `agent` | `AgentAuth` | Pre-loaded agent (alternative to `privkey`) |
73
- | `endpoint` | `string` | Override Atbash endpoint |
68
+ | Option | Type | Default | Description |
69
+ |---|---|---|---|
70
+ | `privkey` | `string` | — | Agent private key (falls back to `ATBASH_AGENT_PRIVKEY` env var) |
71
+ | `endpoint` | `string` | `https://atbash.ai` | Override Atbash endpoint |
72
+ | `toolsNode` | `string` | `"tools"` | Name of the tools node in your graph |
73
+ | `agentNode` | `string` | `"agent"` | Name of the agent node in your graph |
74
+ | `workspaceDir` | `string` | `process.cwd()` | Agent workspace directory; `~` is expanded |
75
+ | `memoryFilePath` | `string` | `<workspaceDir>/MEMORY.md` | Explicit MEMORY.md path; overrides `workspaceDir` |
76
+ | `memorySyncTTLMs` | `number` | `30000` | How long (ms) to trust the local memory pointer between chain checks |
77
+ | `memoryRollbackMinScore` | `number` | `1` | Block memory reads when a rolled-back version scores below this (1–10); default 1 = warn only |
78
+ | `memoryPathPatterns` | `string[]` | SDK built-ins | Custom memory path glob patterns |
79
+ | `judgeEndpoint` | `string` | — | Override the judge endpoint separately from the main endpoint |
80
+ | `judgeVerifyPubKey` | `string` | — | Self-hosted judge response-signing pubkey (required when `judgeEndpoint` uses a self-hosted policy) |
81
+ | `orgName` | `string` | — | Organization name for chain resolution (public vs private chain) |
82
+ | `enforce` | `boolean` | `true` | Set to `false` for monitor mode: memory guard logs violations but never blocks |
83
+ | `debug` | `boolean` | `false` | Enable verbose debug logging |
74
84
 
75
85
  ### `createGuardNode(opts)`
76
86
 
@@ -97,10 +107,14 @@ Extends `MessagesAnnotation` with Atbash fields:
97
107
  | `atbashToolCallId` | `string \| null` | Tool call ID for polling or HOLD resume |
98
108
  | `atbashConfidence` | `number \| null` | Confidence score |
99
109
 
100
- ### `createJudgeTool(agent, endpoint?)`
110
+ ### `createJudgeTool(client)`
101
111
 
102
112
  Optional: creates an `atbash_safety_check` LangChain tool for direct LLM access to the judge.
103
113
 
114
+ | Param | Type | Description |
115
+ |---|---|---|
116
+ | `client` | `Atbash` | A constructed `Atbash` instance (e.g. `new Atbash(privkey)`) |
117
+
104
118
  ## Verdict Handling
105
119
 
106
120
  | Verdict | Meaning | Graph Behavior |
@@ -146,7 +160,7 @@ and asking the agent to try again is the supported flow.
146
160
  | Variable | Required | Description |
147
161
  |---|---|---|
148
162
  | `ATBASH_AGENT_PRIVKEY` | Yes (if not passing `agent`) | Your Atbash agent private key |
149
- | `ATBASH_ENDPOINT` | No | Override the default Atbash endpoint (`https://atbash.ai`) |
163
+ | `ATBASH_ENDPOINT` | No | Passed by your application via `opts.endpoint`. The builder does not read this env var automatically; read it yourself and forward it: `addAtbashSafety(builder, { endpoint: process.env.ATBASH_ENDPOINT })` |
150
164
 
151
165
  ## What This Package Does Not Do
152
166
 
package/dist/index.js CHANGED
@@ -349,11 +349,15 @@ function sealRoutesIntoGuard(graph, toolsNode) {
349
349
  return compile(...args);
350
350
  };
351
351
  }
352
+ var _telemetryRegistered = false;
352
353
  function addAtbashSafety(builder, opts) {
353
354
  setupTelemetry({ enabled: true, source: "plugin:langgraph" });
354
- process.once("beforeExit", () => shutdownTelemetry());
355
- process.once("SIGINT", () => shutdownTelemetry().finally(() => process.exit(0)));
356
- process.once("SIGTERM", () => shutdownTelemetry().finally(() => process.exit(0)));
355
+ if (!_telemetryRegistered) {
356
+ _telemetryRegistered = true;
357
+ process.once("beforeExit", () => shutdownTelemetry());
358
+ process.once("SIGINT", () => shutdownTelemetry().finally(() => process.exit(0)));
359
+ process.once("SIGTERM", () => shutdownTelemetry().finally(() => process.exit(0)));
360
+ }
357
361
  const privkey = opts.privkey ?? process.env.ATBASH_AGENT_PRIVKEY ?? "";
358
362
  const clientOpts = {};
359
363
  if (opts.endpoint) clientOpts.endpoint = opts.endpoint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atbash/atbash-langgraph",
3
- "version": "0.0.15-dev.1",
3
+ "version": "0.0.15-dev.3",
4
4
  "description": "Atbash safety guard and audit nodes for LangGraph workflows",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,7 +45,7 @@
45
45
  "release:dev": "node scripts/release.mjs --channel dev"
46
46
  },
47
47
  "dependencies": {
48
- "@atbash/sdk": "0.13.2-dev.0",
48
+ "@atbash/sdk": "0.13.3-dev.0",
49
49
  "zod": "^3.25.76"
50
50
  },
51
51
  "peerDependencies": {