@atbash/atbash-langgraph 0.0.5-dev.4 → 0.0.5-dev.5
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/dist/index.js +3 -1
- package/package.json +1 -1
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
|