@atbash/atbash-langgraph 0.0.12 → 0.0.14
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/LICENSE +14 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +25 -2
- package/package.json +14 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Atbash CLI — Proprietary Software License
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Atbash. All rights reserved.
|
|
4
|
+
|
|
5
|
+
The full license is available at https://atbash.ai/license
|
|
6
|
+
|
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
10
|
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
13
|
+
|
|
14
|
+
The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Atbash.
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,25 @@ interface AtbashSafetyOptions {
|
|
|
30
30
|
endpoint?: string;
|
|
31
31
|
toolsNode?: string;
|
|
32
32
|
agentNode?: string;
|
|
33
|
+
/** Agent workspace directory — `~` is expanded. Defaults to `process.cwd()`. */
|
|
34
|
+
workspaceDir?: string;
|
|
35
|
+
/** Explicit MEMORY.md path. Overrides `workspaceDir/MEMORY.md`. */
|
|
36
|
+
memoryFilePath?: string;
|
|
37
|
+
/** How long (ms) to trust the local pointer between chain checks. Default 30000. */
|
|
38
|
+
memorySyncTTLMs?: number;
|
|
39
|
+
/** Block memory reads when a rolled-back version scores below this (1–10). Default 1 = warn only. */
|
|
40
|
+
memoryRollbackMinScore?: number;
|
|
41
|
+
/** Custom memory path patterns. Defaults to SDK built-ins. */
|
|
42
|
+
memoryPathPatterns?: string[];
|
|
43
|
+
/** Optional judge endpoint override. */
|
|
44
|
+
judgeEndpoint?: string;
|
|
45
|
+
/** Self-hosted judge response-signing pubkey (required when judgeEndpoint uses "self-hosted" policy). */
|
|
46
|
+
judgeVerifyPubKey?: string;
|
|
47
|
+
/** Organization name for chain resolution (public vs private chain). */
|
|
48
|
+
orgName?: string;
|
|
49
|
+
/** false = monitor mode: log but never block. Default true. */
|
|
50
|
+
enforce?: boolean;
|
|
51
|
+
debug?: boolean;
|
|
33
52
|
}
|
|
34
53
|
declare function addAtbashSafety(builder: StateGraph<AtbashState>, opts: AtbashSafetyOptions): StateGraph<_langchain_langgraph.StateType<{
|
|
35
54
|
atbashVerdict: _langchain_langgraph.BaseChannel<string | null, string | _langchain_langgraph.OverwriteValue<string | null> | null, unknown>;
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var AtbashStateAnnotation = Annotation.Root({
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
// src/nodes/guardNode.ts
|
|
24
|
+
import { MemoryIntegrityError } from "@atbash/sdk";
|
|
24
25
|
import { ToolMessage } from "@langchain/core/messages";
|
|
25
26
|
import { isGraphBubbleUp } from "@langchain/langgraph";
|
|
26
27
|
function createGuardNode(opts) {
|
|
@@ -44,6 +45,7 @@ function createGuardNode(opts) {
|
|
|
44
45
|
);
|
|
45
46
|
} catch (err) {
|
|
46
47
|
const reason = err instanceof Error ? err.message : String(err);
|
|
48
|
+
const verdict = err instanceof MemoryIntegrityError ? "BLOCK" : "ERROR";
|
|
47
49
|
return {
|
|
48
50
|
messages: toolCalls.map(
|
|
49
51
|
(toolCall) => new ToolMessage({
|
|
@@ -51,7 +53,7 @@ function createGuardNode(opts) {
|
|
|
51
53
|
content: toolCall.id === tc.id ? `Memory guard error: ${reason}` : "Blocked \u2014 memory safety check failed for another tool call"
|
|
52
54
|
})
|
|
53
55
|
),
|
|
54
|
-
atbashVerdict:
|
|
56
|
+
atbashVerdict: verdict,
|
|
55
57
|
atbashReason: `Memory guard error: ${reason}`,
|
|
56
58
|
atbashToolCallId: null,
|
|
57
59
|
atbashConfidence: null
|
|
@@ -178,9 +180,14 @@ function createAuditNode(opts) {
|
|
|
178
180
|
// src/builder.ts
|
|
179
181
|
import {
|
|
180
182
|
Atbash,
|
|
183
|
+
createMemoryGuardManager,
|
|
181
184
|
setupTelemetry,
|
|
182
185
|
shutdownTelemetry
|
|
183
186
|
} from "@atbash/sdk";
|
|
187
|
+
import { homedir } from "os";
|
|
188
|
+
function expandHome(p) {
|
|
189
|
+
return p.replace(/^~(?=\/|$)/, homedir());
|
|
190
|
+
}
|
|
184
191
|
function addAtbashSafety(builder, opts) {
|
|
185
192
|
setupTelemetry({ enabled: true, source: "plugin:langgraph" });
|
|
186
193
|
process.once("beforeExit", () => shutdownTelemetry());
|
|
@@ -190,10 +197,26 @@ function addAtbashSafety(builder, opts) {
|
|
|
190
197
|
const clientOpts = {};
|
|
191
198
|
if (opts.endpoint) clientOpts.endpoint = opts.endpoint;
|
|
192
199
|
const client = new Atbash(privkey, clientOpts);
|
|
200
|
+
const guard = createMemoryGuardManager({
|
|
201
|
+
auth: client.auth,
|
|
202
|
+
workspaceDir: opts.workspaceDir ? expandHome(opts.workspaceDir) : process.cwd(),
|
|
203
|
+
...opts.memoryFilePath ? { memoryFilePath: expandHome(opts.memoryFilePath) } : {},
|
|
204
|
+
...opts.memorySyncTTLMs !== void 0 ? { ttlMs: opts.memorySyncTTLMs } : {},
|
|
205
|
+
...opts.memoryRollbackMinScore !== void 0 ? { rollbackMinScore: opts.memoryRollbackMinScore } : {},
|
|
206
|
+
...opts.memoryPathPatterns ? { memoryPathPatterns: opts.memoryPathPatterns } : {},
|
|
207
|
+
...opts.judgeEndpoint ? { judgeEndpoint: opts.judgeEndpoint } : {},
|
|
208
|
+
...opts.judgeVerifyPubKey ? { judgeVerifyPubKey: opts.judgeVerifyPubKey } : {},
|
|
209
|
+
...opts.orgName ? { orgName: opts.orgName } : {},
|
|
210
|
+
enforce: opts.enforce ?? true,
|
|
211
|
+
debug: opts.debug ?? false
|
|
212
|
+
});
|
|
213
|
+
guard.runBootProbe().catch((err) => {
|
|
214
|
+
console.warn("[atbash] boot probe failed:", err instanceof Error ? err.message : String(err));
|
|
215
|
+
});
|
|
193
216
|
const graph = builder;
|
|
194
217
|
const toolsNode = opts.toolsNode ?? "tools";
|
|
195
218
|
const agentNode = opts.agentNode ?? "agent";
|
|
196
|
-
graph.addNode("atbash_guard", createGuardNode({ client }));
|
|
219
|
+
graph.addNode("atbash_guard", createGuardNode({ client, guardManager: guard }));
|
|
197
220
|
graph.addNode("atbash_audit", createAuditNode({ client }));
|
|
198
221
|
graph.addConditionalEdges("atbash_guard", (state) => {
|
|
199
222
|
return state.atbashVerdict === "ALLOW" ? toolsNode : agentNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atbash/atbash-langgraph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Atbash safety guard and audit nodes for LangGraph workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
|
-
"README.md"
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
17
18
|
],
|
|
18
19
|
"keywords": [
|
|
19
20
|
"atbash",
|
|
@@ -25,7 +26,11 @@
|
|
|
25
26
|
"audit",
|
|
26
27
|
"policy"
|
|
27
28
|
],
|
|
28
|
-
"license": "
|
|
29
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/Atbash-Ai/atbash-langgraph-plugin"
|
|
33
|
+
},
|
|
29
34
|
"publishConfig": {
|
|
30
35
|
"access": "public"
|
|
31
36
|
},
|
|
@@ -33,11 +38,13 @@
|
|
|
33
38
|
"node": ">=18.0.0"
|
|
34
39
|
},
|
|
35
40
|
"scripts": {
|
|
36
|
-
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
37
|
-
"
|
|
41
|
+
"build": "node scripts/clean.mjs && tsup src/index.ts --format esm --dts --clean",
|
|
42
|
+
"verify:package": "node scripts/release.mjs --verify-current",
|
|
43
|
+
"release": "node scripts/release.mjs --channel latest",
|
|
44
|
+
"release:dev": "node scripts/release.mjs --channel dev"
|
|
38
45
|
},
|
|
39
46
|
"dependencies": {
|
|
40
|
-
"@atbash/sdk": "
|
|
47
|
+
"@atbash/sdk": "0.7.1",
|
|
41
48
|
"zod": "^3.25.76"
|
|
42
49
|
},
|
|
43
50
|
"peerDependencies": {
|
|
@@ -48,6 +55,7 @@
|
|
|
48
55
|
"@langchain/core": "^1.1.45",
|
|
49
56
|
"@langchain/langgraph": "^1.3.0",
|
|
50
57
|
"@types/node": "^25.7.0",
|
|
58
|
+
"semver": "7.8.5",
|
|
51
59
|
"tsup": "^8.0.0",
|
|
52
60
|
"typescript": "^5.0.0"
|
|
53
61
|
}
|