@loopman/langchain-sdk 1.17.1 → 1.17.2

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.
@@ -42,9 +42,9 @@ export interface LoopmanValidationNodeConfig {
42
42
  proposedDecision?: string | ((state: any) => string);
43
43
  /** Decision reasoning to include in the task (or function to extract from state) */
44
44
  decisionReasoning?: string | ((state: any) => string);
45
- /** Whether to include full state in task information (default: false) */
45
+ /** Whether to include full state in task information (default: true) */
46
46
  includeFullState?: boolean;
47
- /** Custom function to format state for task information (if not provided, uses JSON.stringify) */
47
+ /** Custom function to format state for task information (if not provided, uses default converter) */
48
48
  formatState?: (state: any) => TaskInformation[];
49
49
  }
50
50
  /**
@@ -68,9 +68,10 @@ export interface LoopmanValidationNodeConfig {
68
68
  * and adds `guidelines` and `decisionContext` to the state, making them
69
69
  * available for the agent on retry (NEEDS_CHANGES) or subsequent executions.
70
70
  *
71
- * **State Inclusion**: You can include the full agent state in the task information
72
- * by setting `includeFullState: true`. This helps human reviewers understand the
73
- * complete context of the decision. You can also provide custom formatters.
71
+ * **State Inclusion**: By default, the full agent state is included in the task information
72
+ * to help human reviewers understand the complete context of the decision.
73
+ * You can disable this by setting `includeFullState: false`, or provide a custom
74
+ * `formatState` function to control how state is formatted.
74
75
  *
75
76
  * **Decision Context**: You can provide business context, proposed decisions, and
76
77
  * reasoning either as static strings or as functions that extract from the state.
@@ -93,24 +94,31 @@ export interface LoopmanValidationNodeConfig {
93
94
  * workflow.addNode("loopman_validation", loopmanNode);
94
95
  * ```
95
96
  *
96
- * @example With full state and decision context
97
+ * @example With decision context (state included by default)
97
98
  * ```typescript
98
99
  * const loopmanNode = createLoopmanValidationNode({
99
100
  * apiKey: process.env.LOOPMAN_API_KEY!,
100
101
  * workflowId: "my-workflow",
101
- * includeFullState: true, // Include all state in task information
102
102
  * businessContext: (state) => `Processing user request: ${state.userQuery}`,
103
103
  * proposedDecision: (state) => `Execute ${state.currentAction} on ${state.targetResource}`,
104
104
  * decisionReasoning: (state) => state.reasoning || "No specific reasoning provided",
105
105
  * });
106
106
  * ```
107
107
  *
108
- * @example With custom state formatter
108
+ * @example Disable state inclusion
109
+ * ```typescript
110
+ * const loopmanNode = createLoopmanValidationNode({
111
+ * apiKey: process.env.LOOPMAN_API_KEY!,
112
+ * workflowId: "my-workflow",
113
+ * includeFullState: false, // Don't include state in task
114
+ * });
115
+ * ```
116
+ *
117
+ * @example With custom state formatter (state included by default)
109
118
  * ```typescript
110
119
  * const loopmanNode = createLoopmanValidationNode({
111
120
  * apiKey: process.env.LOOPMAN_API_KEY!,
112
121
  * workflowId: "my-workflow",
113
- * includeFullState: true,
114
122
  * formatState: (state) => [
115
123
  * { type: "text", label: "User", value: state.userId },
116
124
  * { type: "text", label: "Action", value: state.action },
@@ -1 +1 @@
1
- {"version":3,"file":"loopman-validation-node.d.ts","sourceRoot":"","sources":["../../src/langgraph/loopman-validation-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK;QACrC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,GAAG,CAAC;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,IAAI,CAAC;IACT,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IACpD,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IACrD,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IACtD,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kGAAkG;IAClG,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,2BAA2B,IAerB,OAAO,GAAG,kBAqMzB"}
1
+ {"version":3,"file":"loopman-validation-node.d.ts","sourceRoot":"","sources":["../../src/langgraph/loopman-validation-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK;QACrC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,GAAG,CAAC;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,IAAI,CAAC;IACT,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IACpD,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IACrD,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IACtD,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qGAAqG;IACrG,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,2BAA2B,IAerB,OAAO,GAAG,kBAsMzB"}
@@ -31,9 +31,10 @@ import { createLoopmanContextNode } from "./loopman-context-node.js";
31
31
  * and adds `guidelines` and `decisionContext` to the state, making them
32
32
  * available for the agent on retry (NEEDS_CHANGES) or subsequent executions.
33
33
  *
34
- * **State Inclusion**: You can include the full agent state in the task information
35
- * by setting `includeFullState: true`. This helps human reviewers understand the
36
- * complete context of the decision. You can also provide custom formatters.
34
+ * **State Inclusion**: By default, the full agent state is included in the task information
35
+ * to help human reviewers understand the complete context of the decision.
36
+ * You can disable this by setting `includeFullState: false`, or provide a custom
37
+ * `formatState` function to control how state is formatted.
37
38
  *
38
39
  * **Decision Context**: You can provide business context, proposed decisions, and
39
40
  * reasoning either as static strings or as functions that extract from the state.
@@ -56,24 +57,31 @@ import { createLoopmanContextNode } from "./loopman-context-node.js";
56
57
  * workflow.addNode("loopman_validation", loopmanNode);
57
58
  * ```
58
59
  *
59
- * @example With full state and decision context
60
+ * @example With decision context (state included by default)
60
61
  * ```typescript
61
62
  * const loopmanNode = createLoopmanValidationNode({
62
63
  * apiKey: process.env.LOOPMAN_API_KEY!,
63
64
  * workflowId: "my-workflow",
64
- * includeFullState: true, // Include all state in task information
65
65
  * businessContext: (state) => `Processing user request: ${state.userQuery}`,
66
66
  * proposedDecision: (state) => `Execute ${state.currentAction} on ${state.targetResource}`,
67
67
  * decisionReasoning: (state) => state.reasoning || "No specific reasoning provided",
68
68
  * });
69
69
  * ```
70
70
  *
71
- * @example With custom state formatter
71
+ * @example Disable state inclusion
72
+ * ```typescript
73
+ * const loopmanNode = createLoopmanValidationNode({
74
+ * apiKey: process.env.LOOPMAN_API_KEY!,
75
+ * workflowId: "my-workflow",
76
+ * includeFullState: false, // Don't include state in task
77
+ * });
78
+ * ```
79
+ *
80
+ * @example With custom state formatter (state included by default)
72
81
  * ```typescript
73
82
  * const loopmanNode = createLoopmanValidationNode({
74
83
  * apiKey: process.env.LOOPMAN_API_KEY!,
75
84
  * workflowId: "my-workflow",
76
- * includeFullState: true,
77
85
  * formatState: (state) => [
78
86
  * { type: "text", label: "User", value: state.userId },
79
87
  * { type: "text", label: "Action", value: state.action },
@@ -140,9 +148,10 @@ export function createLoopmanValidationNode(config) {
140
148
  const decisionReasoning = typeof config.decisionReasoning === "function"
141
149
  ? config.decisionReasoning(state)
142
150
  : config.decisionReasoning;
143
- // Prepare additional information from state if configured
151
+ // Prepare additional information from state (enabled by default)
144
152
  let additionalInformation;
145
- if (config.includeFullState) {
153
+ const shouldIncludeState = config.includeFullState !== false; // Default to true
154
+ if (shouldIncludeState) {
146
155
  if (config.formatState) {
147
156
  additionalInformation = config.formatState(state);
148
157
  }
@@ -1 +1 @@
1
- {"version":3,"file":"loopman-validation-node.js","sourceRoot":"","sources":["../../src/langgraph/loopman-validation-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AA0ClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAmC;IAEnC,8DAA8D;IAC9D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,QAAQ,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IAE/D,iEAAiE;IACjE,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC;QACxC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC,CAAC;IAEH,OAAO,KAAK,EAAE,KAAU,EAAE,EAAE;QAC1B,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;QAC1C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;QAErC,kFAAkF;QAClF,MAAM,WAAW,GAAG,QAAQ,CAAC,QAA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AC5B,MAAc,EACd,QAAuB,EACvB,UAAmB;IAEnB,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE;QACvC,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,IAAI,WAAW,CAAC;gBACrB,OAAO;gBACP,YAAY,EAAE,UAAU;aACzB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,UAAU;YACb,OAAO;gBACL,YAAY,CACV,QAAQ;oBACN,CAAC,CAAC,0CAA0C,QAAQ,GAAG;oBACvD,CAAC,CAAC,qDAAqD,CAC1D;aACF,CAAC;QAEJ,KAAK,UAAU;YACb,OAAO;gBACL,YAAY,CACV,QAAQ;oBACN,CAAC,CAAC,wCAAwC,QAAQ,GAAG;oBACrD,CAAC,CAAC,wDAAwD,CAC7D;aACF,CAAC;QAEJ,KAAK,eAAe;YAClB,OAAO;gBACL,YAAY,CACV,QAAQ;oBACN,CAAC,CAAC,yCAAyC,QAAQ,GAAG;oBACtD,CAAC,CAAC,mEAAmE,CACxE;aACF,CAAC;QAEJ,KAAK,SAAS;YACZ,OAAO;gBACL,YAAY,CACV,0DAA0D,CAC3D;aACF,CAAC;QAEJ,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb;YACE,OAAO,CAAC,YAAY,CAAC,sBAAsB,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"loopman-validation-node.js","sourceRoot":"","sources":["../../src/langgraph/loopman-validation-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;A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BACN,CAAC,CAAC,0CAA0C,QAAQ,GAAG;oBACvD,CAAC,CAAC,qDAAqD,CAC1D;aACF,CAAC;QAEJ,KAAK,UAAU;YACb,OAAO;gBACL,YAAY,CACV,QAAQ;oBACN,CAAC,CAAC,wCAAwC,QAAQ,GAAG;oBACrD,CAAC,CAAC,wDAAwD,CAC7D;aACF,CAAC;QAEJ,KAAK,eAAe;YAClB,OAAO;gBACL,YAAY,CACV,QAAQ;oBACN,CAAC,CAAC,yCAAyC,QAAQ,GAAG;oBACtD,CAAC,CAAC,mEAAmE,CACxE;aACF,CAAC;QAEJ,KAAK,SAAS;YACZ,OAAO;gBACL,YAAY,CACV,0DAA0D,CAC3D;aACF,CAAC;QAEJ,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb;YACE,OAAO,CAAC,YAAY,CAAC,sBAAsB,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "langgraph-hello-world": {
3
3
  "index.ts": "import { HumanMessage, ToolMessage } from \"@langchain/core/messages\";\nimport { END, MemorySaver, START, StateGraph } from \"@langchain/langgraph\";\nimport { ChatOpenAI } from \"@langchain/openai\";\nimport { config } from \"dotenv\";\nimport { tool } from \"langchain\";\nimport * as z from \"zod\";\n\nimport {\n LoopmanGraphState,\n createLoopmanConditionalEdge,\n createLoopmanContextNode,\n createLoopmanValidationNode,\n enrichSystemPrompt,\n} from \"@loopman/langchain-sdk\";\n\nconfig();\n\n// Define your tools\nconst sayHello = tool(\n ({ name }) => {\n console.log(`Hello, ${name}!`);\n return `Hello, ${name}! Welcome to Loopman.`;\n },\n {\n name: \"say_hello\",\n description: \"Say hello to someone\",\n schema: z.object({\n name: z.string().describe(\"The name of the person to greet\"),\n }),\n }\n);\n\n// Agent node with context enrichment\nasync function agentNode(state: typeof LoopmanGraphState.State) {\n const { messages, guidelines, decisionContext } = state;\n\n // Enrich system prompt with guidelines and decision history\n const systemPrompt = enrichSystemPrompt(\n \"You are a helpful assistant that greets people ....\",\n { guidelines, decisionContext },\n { maxDecisions: 3 }\n );\n\n const model = new ChatOpenAI({ model: \"gpt-4o-mini\" });\n const modelWithTools = model.bindTools([sayHello]);\n\n const messagesWithContext =\n (guidelines && guidelines.length > 0) ||\n (decisionContext && decisionContext.length > 0)\n ? [{ role: \"system\", content: systemPrompt }, ...messages]\n : messages;\n\n const response = await modelWithTools.invoke(messagesWithContext);\n\n return {\n messages: [response],\n };\n}\n\n// Tool execution node\nasync function toolNode(state: typeof LoopmanGraphState.State) {\n const { messages } = state;\n const lastMessage = messages[messages.length - 1];\n\n if (!lastMessage.tool_calls || lastMessage.tool_calls.length === 0) {\n return {};\n }\n\n const toolCall = lastMessage.tool_calls[0];\n const result = await sayHello.invoke(toolCall.args);\n\n return {\n messages: [\n new ToolMessage({\n content: String(result),\n tool_call_id: toolCall.id,\n }),\n ],\n };\n}\n\n// Build the graph with context loading\nconst workflow = new StateGraph(LoopmanGraphState)\n .addNode(\n \"load_context\",\n createLoopmanContextNode({\n apiKey: process.env.LOOPMAN_API_KEY!,\n workflowId: \"hello-world-workflow\",\n category: \"hello-world\",\n debug: true,\n })\n )\n .addNode(\"agent\", agentNode)\n .addNode(\n \"loopman_validation\",\n createLoopmanValidationNode({\n apiKey: process.env.LOOPMAN_API_KEY!,\n workflowId: \"hello-world-workflow\",\n debug: true,\n })\n )\n .addNode(\"tools\", toolNode)\n .addEdge(START, \"load_context\")\n .addEdge(\"load_context\", \"agent\")\n .addEdge(\"agent\", \"loopman_validation\")\n .addConditionalEdges(\n \"loopman_validation\",\n createLoopmanConditionalEdge({ debug: true }),\n {\n execute: \"tools\",\n rejected: END,\n retry: \"agent\",\n timeout: END,\n error: END,\n }\n )\n .addEdge(\"tools\", END);\n\n// Compile and run\nconst checkpointer = new MemorySaver();\nconst app = workflow.compile({ checkpointer });\n\nasync function main() {\n const config = { configurable: { thread_id: \"hello-world-thread\" } };\n const inputs = {\n messages: [new HumanMessage(\"Say hello to Alice\")],\n };\n\n console.log(\"Starting LangGraph workflow with context enrichment...\");\n\n for await (const output of await app.stream(inputs, config)) {\n const nodeName = Object.keys(output)[0];\n console.log(`Step: ${nodeName}`);\n }\n\n const finalState = await app.getState(config);\n console.log(\"Final status:\", finalState.values.loopmanTaskStatus);\n console.log(\"Guidelines loaded:\", finalState.values.guidelines?.length || 0);\n console.log(\n \"Decision context loaded:\",\n finalState.values.decisionContext?.length || 0\n );\n console.log(\"Workflow completed!\");\n}\n\nmain().catch(console.error);\n",
4
- "package.json": "{\n \"name\": \"loopman-langgraph-hello-world\",\n \"version\": \"1.0.0\",\n \"description\": \"Loopman LangGraph Hello World Example\",\n \"main\": \"index.ts\",\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"tsx index.ts\",\n \"dev\": \"tsx index.ts\",\n \"build\": \"tsc\",\n \"run\": \"node dist/index.js\"\n },\n \"dependencies\": {\n \"@langchain/core\": \"^1.0.2\",\n \"@langchain/langgraph\": \"^1.0.7\",\n \"@langchain/openai\": \"^1.0.0\",\n \"@loopman/langchain-sdk\": \"^1.17.1\",\n \"dotenv\": \"^17.2.3\",\n \"langchain\": \"^1.0.2\",\n \"tsx\": \"^4.20.6\",\n \"typescript\": \"^5.9.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^24.9.2\"\n }\n}\n",
4
+ "package.json": "{\n \"name\": \"loopman-langgraph-hello-world\",\n \"version\": \"1.0.0\",\n \"description\": \"Loopman LangGraph Hello World Example\",\n \"main\": \"index.ts\",\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"tsx index.ts\",\n \"dev\": \"tsx index.ts\",\n \"build\": \"tsc\",\n \"run\": \"node dist/index.js\"\n },\n \"dependencies\": {\n \"@langchain/core\": \"^1.0.2\",\n \"@langchain/langgraph\": \"^1.0.7\",\n \"@langchain/openai\": \"^1.0.0\",\n \"@loopman/langchain-sdk\": \"^1.17.2\",\n \"dotenv\": \"^17.2.3\",\n \"langchain\": \"^1.0.2\",\n \"tsx\": \"^4.20.6\",\n \"typescript\": \"^5.9.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^24.9.2\"\n }\n}\n",
5
5
  "tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ES2022\",\n \"lib\": [\"ES2022\"],\n \"moduleResolution\": \"bundler\",\n \"resolveJsonModule\": true,\n \"allowJs\": true,\n \"outDir\": \"./dist\",\n \"rootDir\": \"./\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"declaration\": true,\n \"declarationMap\": true,\n \"sourceMap\": true,\n \"types\": [\"node\"]\n },\n \"include\": [\"**/*.ts\"],\n \"exclude\": [\"node_modules\", \"dist\"]\n}\n",
6
6
  "README.md": "# Loopman LangGraph Hello World\n\nThis project demonstrates how to integrate Loopman with LangGraph using Context Enrichment / Feedback Loop mode.\n\n## About LangGraph\n\nLangGraph is LangChain's official framework for building stateful, multi-actor applications with LLMs. It provides:\n\n- **Stateful workflows**: Explicit state management across nodes\n- **Conditional routing**: Dynamic edges based on state\n- **Streaming support**: Real-time updates during execution\n- **Visual debugging**: Graph visualization and inspection\n\n## Setup\n\n1. Install dependencies:\n```bash\nnpm install\n```\n\n2. Copy .env.example to .env and configure your keys:\n```bash\ncp .env.example .env\n```\n\nEdit the .env file and replace the placeholders with your actual values:\n- `OPENAI_API_KEY`: Your OpenAI API key\n- `LOOPMAN_API_KEY`: Your Loopman API key\n- `LOOPMAN_WORKFLOW_ID`: Your workflow ID from Loopman\n\n3. Run the example:\n```bash\nnpm start\n```\n\n## Graph Architecture\n\nThe workflow follows this pattern:\n\n```\nSTART\n ↓\nload_context (load guidelines and decision history)\n ↓\nagent (LLM decides action)\n ↓\nloopman_validation (create task + poll)\n ↓\n[conditional edge based on status]\n ↓\n├─→ tools (APPROVED: execute)\n├─→ agent (NEEDS_CHANGES: retry)\n└─→ END (REJECTED/TIMEOUT/ERROR: end)\n ↓\nEND\n```\n\n## Key Features\n\n- **Context Enrichment**: Loads validation guidelines and historical decisions\n- **Prompt Enhancement**: Automatically enriches system prompts with context\n- **Learning from History**: Agent learns from past human decisions\n- **Category Filtering**: Guidelines filtered by category for relevance\n- **Feedback Loop**: Human feedback is stored and used to improve future decisions\n\n## Learn More\n\n- [LangGraph Documentation](https://js.langchain.com/docs/langgraph/)\n- [Loopman LangGraph Integration Guide](https://github.com/loopman/loopman-langchain-sdk/blob/main/docs/LANGGRAPH_INTEGRATION.md)\n- [Loopman Documentation](https://loopman.dev/docs)\n\n"
7
7
  },
8
8
  "langchain-tool-validation": {
9
9
  "index.ts": "import { MemorySaver } from \"@langchain/langgraph\";\nimport { config } from \"dotenv\";\nimport { createAgent, tool } from \"langchain\";\nimport * as z from \"zod\";\nimport { loopmanMiddleware } from \"@loopman/langchain-sdk\";\n\n// Load environment variables\nconfig();\n\n// Simple hello world tool\nconst sayHello = tool(\n ({ name }) => {\n console.log(`Hello, ${name}!`);\n return `Hello, ${name}! Welcome to Loopman.`;\n },\n {\n name: \"say_hello\",\n description: \"Say hello to someone\",\n schema: z.object({\n name: z.string().describe(\"The name of the person to greet\"),\n }),\n }\n);\n\n// Create agent with Loopman middleware\nconst checkpointer = new MemorySaver();\n\nconst agent = createAgent({\n model: \"openai:gpt-4o-mini\",\n systemPrompt: \"You are a helpful assistant that greets people.\",\n tools: [sayHello],\n middleware: [\n loopmanMiddleware({\n apiKey: process.env.LOOPMAN_API_KEY!,\n workflowId: process.env.LOOPMAN_WORKFLOW_ID!,\n interruptOn: {\n say_hello: true, // Requires human validation\n },\n debug: true,\n }),\n ],\n checkpointer,\n});\n\n// Run the agent\nasync function main() {\n const config = { configurable: { thread_id: \"hello-world-thread\" } };\n\n const result = await agent.invoke(\n {\n messages: [\n {\n role: \"user\",\n content: \"Say hello to Alice\",\n },\n ],\n },\n config\n );\n\n console.log(\"Agent response:\", result.messages[result.messages.length - 1].content);\n}\n\nmain().catch(console.error);\n\n",
10
- "package.json": "{\n \"name\": \"loopman-langchain-tool-validation\",\n \"version\": \"1.0.0\",\n \"description\": \"Loopman LangChain Tool Validation Example\",\n \"main\": \"index.ts\",\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"tsx index.ts\",\n \"dev\": \"tsx index.ts\",\n \"build\": \"tsc\",\n \"run\": \"node dist/index.js\"\n },\n \"dependencies\": {\n \"@langchain/core\": \"^1.0.2\",\n \"@langchain/mcp-adapters\": \"^1.0.0\",\n \"@langchain/langgraph\": \"^1.0.7\",\n \"@langchain/openai\": \"^1.0.0\",\n \"@loopman/langchain-sdk\": \"^1.17.1\",\n \"dotenv\": \"^17.2.3\",\n \"langchain\": \"^1.0.2\",\n \"tsx\": \"^4.20.6\",\n \"typescript\": \"^5.9.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^24.9.2\"\n }\n}\n",
10
+ "package.json": "{\n \"name\": \"loopman-langchain-tool-validation\",\n \"version\": \"1.0.0\",\n \"description\": \"Loopman LangChain Tool Validation Example\",\n \"main\": \"index.ts\",\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"tsx index.ts\",\n \"dev\": \"tsx index.ts\",\n \"build\": \"tsc\",\n \"run\": \"node dist/index.js\"\n },\n \"dependencies\": {\n \"@langchain/core\": \"^1.0.2\",\n \"@langchain/mcp-adapters\": \"^1.0.0\",\n \"@langchain/langgraph\": \"^1.0.7\",\n \"@langchain/openai\": \"^1.0.0\",\n \"@loopman/langchain-sdk\": \"^1.17.2\",\n \"dotenv\": \"^17.2.3\",\n \"langchain\": \"^1.0.2\",\n \"tsx\": \"^4.20.6\",\n \"typescript\": \"^5.9.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^24.9.2\"\n }\n}\n",
11
11
  "tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ES2022\",\n \"lib\": [\"ES2022\"],\n \"moduleResolution\": \"bundler\",\n \"resolveJsonModule\": true,\n \"allowJs\": true,\n \"outDir\": \"./dist\",\n \"rootDir\": \"./\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"declaration\": true,\n \"declarationMap\": true,\n \"sourceMap\": true\n },\n \"include\": [\"**/*.ts\"],\n \"exclude\": [\"node_modules\", \"dist\"]\n}\n\n",
12
12
  "README.md": "# Loopman LangChain - Tool Validation Mode\n\nThis project demonstrates how to integrate Loopman with LangChain using **Tool Validation** mode.\n\n## About Tool Validation Mode\n\nIn this mode, Loopman middleware intercepts specific tool calls and requires human validation before execution. This is useful when:\n- Certain actions need human approval (e.g., sending emails, making payments)\n- You want to validate AI decisions before they affect real systems\n- Compliance requires human oversight for specific operations\n\n## Setup\n\n1. Install dependencies:\n```bash\nnpm install\n```\n\n2. Copy .env.example to .env and configure your keys:\n```bash\ncp .env.example .env\n```\n\nEdit the .env file and replace the placeholders with your actual values:\n- `OPENAI_API_KEY`: Your OpenAI API key\n- `LOOPMAN_API_KEY`: Your Loopman API key\n- `LOOPMAN_WORKFLOW_ID`: Your workflow ID from Loopman\n\n3. Run the example:\n```bash\nnpm start\n```\n\n## How It Works\n\n### 1. Define Tools\n\n```typescript\nconst sayHello = tool(\n ({ name }) => {\n console.log(`Hello, ${name}!`);\n return `Hello, ${name}! Welcome to Loopman.`;\n },\n {\n name: \"say_hello\",\n description: \"Say hello to someone\",\n schema: z.object({\n name: z.string().describe(\"The name of the person to greet\"),\n }),\n }\n);\n```\n\n### 2. Add Loopman Middleware\n\n```typescript\nconst agent = createAgent({\n model: \"openai:gpt-4o-mini\",\n tools: [sayHello],\n middleware: [\n loopmanMiddleware({\n apiKey: process.env.LOOPMAN_API_KEY!,\n workflowId: process.env.LOOPMAN_WORKFLOW_ID!,\n interruptOn: {\n say_hello: true, // Requires human validation\n },\n debug: true,\n }),\n ],\n checkpointer,\n});\n```\n\n### 3. Run the Agent\n\n```typescript\nconst result = await agent.invoke(\n {\n messages: [{ role: \"user\", content: \"Say hello to Alice\" }],\n },\n config\n);\n```\n\n## Key Features\n\n- **Selective Validation**: Only specified tools require approval\n- **Automatic Interception**: Middleware handles validation workflow\n- **Stateful**: Uses checkpointer to maintain conversation state\n- **Debug Mode**: Verbose logging for development\n\n## Workflow\n\n```\n1. User sends message\n ↓\n2. Agent generates tool call (say_hello)\n ↓\n3. Loopman middleware intercepts\n ↓\n4. Creates validation task\n ↓\n5. Waits for human decision\n ↓\n6. If approved → Execute tool\n If rejected → Return to agent with feedback\n```\n\n## Configuration Options\n\n### interruptOn\n\nSpecify which tools require validation:\n\n```typescript\ninterruptOn: {\n say_hello: true, // Always validate\n send_email: true, // Always validate\n get_weather: false, // Never validate (auto-execute)\n}\n```\n\n### debug\n\nEnable/disable verbose logging:\n\n```typescript\ndebug: true // Show detailed logs\ndebug: false // Production mode\n```\n\n## Learn More\n\n- [Loopman Middleware Documentation](https://github.com/loopman/loopman-langchain-sdk/blob/main/docs/TOOL_VALIDATION_MODE.md)\n- [LangChain Agent Documentation](https://js.langchain.com/docs/how_to/agent_executor)\n- [Loopman Documentation](https://loopman.dev/docs)\n\n"
13
13
  },
14
14
  "langchain-full-review": {
15
15
  "index.ts": "import { config } from \"dotenv\";\nimport { tool } from \"langchain\";\nimport * as z from \"zod\";\nimport { createLoopmanAgent } from \"@loopman/langchain-sdk\";\n\n// Load environment variables\nconfig();\n\n// Simple hello world tool\nconst sayHello = tool(\n ({ name }) => {\n console.log(`Hello, ${name}!`);\n return `Hello, ${name}! Welcome to Loopman.`;\n },\n {\n name: \"say_hello\",\n description: \"Say hello to someone\",\n schema: z.object({\n name: z.string().describe(\"The name of the person to greet\"),\n }),\n }\n);\n\n// Create Loopman agent with full human review process\nconst agent = createLoopmanAgent({\n apiKey: process.env.LOOPMAN_API_KEY!,\n workflowId: process.env.LOOPMAN_WORKFLOW_ID!,\n model: \"openai:gpt-4o-mini\",\n systemPrompt: \"You are a helpful assistant that greets people.\",\n category: \"hello-world\",\n additionalTools: [sayHello],\n requireApprovalForTools: [\"say_hello\"], // Requires validation\n debug: true,\n});\n\n// Run the agent\nasync function main() {\n const result = await agent.processWithHumanValidation({\n input: \"Say hello to Alice\",\n });\n\n console.log(\"Agent response:\", result.response);\n if (result.decision) {\n console.log(\"Decision status:\", result.decision.status);\n if (result.decision.feedback) {\n console.log(\"Human feedback:\", result.decision.feedback);\n }\n }\n\n await agent.disconnect();\n}\n\nmain().catch(console.error);\n\n",
16
- "package.json": "{\n \"name\": \"loopman-langchain-full-review\",\n \"version\": \"1.0.0\",\n \"description\": \"Loopman LangChain Full Human Review Example\",\n \"main\": \"index.ts\",\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"tsx index.ts\",\n \"dev\": \"tsx index.ts\",\n \"build\": \"tsc\",\n \"run\": \"node dist/index.js\"\n },\n \"dependencies\": {\n \"@langchain/core\": \"^1.0.2\",\n \"@langchain/mcp-adapters\": \"^1.0.0\",\n \"@langchain/langgraph\": \"^1.0.7\",\n \"@langchain/openai\": \"^1.0.0\",\n \"@loopman/langchain-sdk\": \"^1.17.1\",\n \"dotenv\": \"^17.2.3\",\n \"langchain\": \"^1.0.2\",\n \"tsx\": \"^4.20.6\",\n \"typescript\": \"^5.9.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^24.9.2\"\n }\n}\n",
16
+ "package.json": "{\n \"name\": \"loopman-langchain-full-review\",\n \"version\": \"1.0.0\",\n \"description\": \"Loopman LangChain Full Human Review Example\",\n \"main\": \"index.ts\",\n \"type\": \"module\",\n \"scripts\": {\n \"start\": \"tsx index.ts\",\n \"dev\": \"tsx index.ts\",\n \"build\": \"tsc\",\n \"run\": \"node dist/index.js\"\n },\n \"dependencies\": {\n \"@langchain/core\": \"^1.0.2\",\n \"@langchain/mcp-adapters\": \"^1.0.0\",\n \"@langchain/langgraph\": \"^1.0.7\",\n \"@langchain/openai\": \"^1.0.0\",\n \"@loopman/langchain-sdk\": \"^1.17.2\",\n \"dotenv\": \"^17.2.3\",\n \"langchain\": \"^1.0.2\",\n \"tsx\": \"^4.20.6\",\n \"typescript\": \"^5.9.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^24.9.2\"\n }\n}\n",
17
17
  "tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"module\": \"ES2022\",\n \"lib\": [\"ES2022\"],\n \"moduleResolution\": \"bundler\",\n \"resolveJsonModule\": true,\n \"allowJs\": true,\n \"outDir\": \"./dist\",\n \"rootDir\": \"./\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"declaration\": true,\n \"declarationMap\": true,\n \"sourceMap\": true\n },\n \"include\": [\"**/*.ts\"],\n \"exclude\": [\"node_modules\", \"dist\"]\n}\n\n",
18
18
  "README.md": "# Loopman LangChain - Full Human Review Mode\n\nThis project demonstrates how to integrate Loopman with LangChain using **Full Human Review Process** mode.\n\n## About Full Human Review Mode\n\nIn this mode, the Loopman Agent handles the entire workflow including:\n- Creating validation tasks\n- Waiting for human approval\n- Handling feedback and retries\n- Managing the complete lifecycle\n\nThis is useful when:\n- You want a complete HITL (Human-In-The-Loop) solution\n- The agent should wait for human decisions before proceeding\n- You need full control over the validation workflow\n\n## Setup\n\n1. Install dependencies:\n```bash\nnpm install\n```\n\n2. Copy .env.example to .env and configure your keys:\n```bash\ncp .env.example .env\n```\n\nEdit the .env file and replace the placeholders with your actual values:\n- `OPENAI_API_KEY`: Your OpenAI API key\n- `LOOPMAN_API_KEY`: Your Loopman API key\n- `LOOPMAN_WORKFLOW_ID`: Your workflow ID from Loopman\n\n3. Run the example:\n```bash\nnpm start\n```\n\n## How It Works\n\n### 1. Define Tools\n\n```typescript\nconst sayHello = tool(\n ({ name }) => {\n console.log(`Hello, ${name}!`);\n return `Hello, ${name}! Welcome to Loopman.`;\n },\n {\n name: \"say_hello\",\n description: \"Say hello to someone\",\n schema: z.object({\n name: z.string().describe(\"The name of the person to greet\"),\n }),\n }\n);\n```\n\n### 2. Create Loopman Agent\n\n```typescript\nconst agent = createLoopmanAgent({\n apiKey: process.env.LOOPMAN_API_KEY!,\n workflowId: process.env.LOOPMAN_WORKFLOW_ID!,\n model: \"openai:gpt-4o-mini\",\n systemPrompt: \"You are a helpful assistant that greets people.\",\n category: \"hello-world\",\n additionalTools: [sayHello],\n requireApprovalForTools: [\"say_hello\"],\n debug: true,\n});\n```\n\n### 3. Process with Human Validation\n\n```typescript\nconst result = await agent.processWithHumanValidation({\n input: \"Say hello to Alice\",\n});\n\nconsole.log(\"Agent response:\", result.response);\nif (result.decision) {\n console.log(\"Decision status:\", result.decision.status);\n console.log(\"Human feedback:\", result.decision.feedback);\n}\n```\n\n## Key Features\n\n- **Complete HITL Workflow**: Agent manages the entire validation lifecycle\n- **Automatic Polling**: Waits for human decisions\n- **Feedback Handling**: Processes human feedback and retries if needed\n- **Category Support**: Organize validations by category\n- **Debug Mode**: Verbose logging for development\n\n## Workflow\n\n```\n1. User sends message\n ↓\n2. Agent processes with LLM\n ↓\n3. Agent generates tool call\n ↓\n4. Creates Loopman validation task\n ↓\n5. Polls for human decision\n ↓\n6. If approved → Execute and return result\n If rejected → Process feedback and retry\n If timeout → Handle timeout\n```\n\n## Configuration Options\n\n### requireApprovalForTools\n\nSpecify which tools require validation:\n\n```typescript\nrequireApprovalForTools: [\"say_hello\", \"send_email\"]\n// Only these tools will require human approval\n```\n\n### category\n\nOrganize validations by category:\n\n```typescript\ncategory: \"hello-world\"\n// Helps filter and organize validation tasks\n```\n\n### debug\n\nEnable/disable verbose logging:\n\n```typescript\ndebug: true // Show detailed logs\ndebug: false // Production mode\n```\n\n## Response Structure\n\nThe `processWithHumanValidation` method returns:\n\n```typescript\n{\n response: string, // Final agent response\n decision?: {\n status: \"APPROVED\" | \"REJECTED\" | \"NEEDS_CHANGES\",\n feedback?: string, // Human feedback if provided\n createdAt: Date,\n updatedAt: Date,\n }\n}\n```\n\n## Learn More\n\n- [Loopman Agent Documentation](https://github.com/loopman/loopman-langchain-sdk/blob/main/docs/LOOPMAN_AGENT.md)\n- [LangChain Documentation](https://js.langchain.com/docs)\n- [Loopman Documentation](https://loopman.dev/docs)\n\n"
19
19
  }
@@ -15,7 +15,7 @@
15
15
  "@langchain/mcp-adapters": "^1.0.0",
16
16
  "@langchain/langgraph": "^1.0.7",
17
17
  "@langchain/openai": "^1.0.0",
18
- "@loopman/langchain-sdk": "^1.17.1",
18
+ "@loopman/langchain-sdk": "^1.17.2",
19
19
  "dotenv": "^17.2.3",
20
20
  "langchain": "^1.0.2",
21
21
  "tsx": "^4.20.6",
@@ -15,7 +15,7 @@
15
15
  "@langchain/mcp-adapters": "^1.0.0",
16
16
  "@langchain/langgraph": "^1.0.7",
17
17
  "@langchain/openai": "^1.0.0",
18
- "@loopman/langchain-sdk": "^1.17.1",
18
+ "@loopman/langchain-sdk": "^1.17.2",
19
19
  "dotenv": "^17.2.3",
20
20
  "langchain": "^1.0.2",
21
21
  "tsx": "^4.20.6",
@@ -14,7 +14,7 @@
14
14
  "@langchain/core": "^1.0.2",
15
15
  "@langchain/langgraph": "^1.0.7",
16
16
  "@langchain/openai": "^1.0.0",
17
- "@loopman/langchain-sdk": "^1.17.1",
17
+ "@loopman/langchain-sdk": "^1.17.2",
18
18
  "dotenv": "^17.2.3",
19
19
  "langchain": "^1.0.2",
20
20
  "tsx": "^4.20.6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopman/langchain-sdk",
3
- "version": "1.17.1",
3
+ "version": "1.17.2",
4
4
  "description": "LangChain TypeScript SDK - Human-in-the-Loop validation via Loopman platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",