@lhi/n8m 0.1.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 (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +247 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.js +6 -0
  5. package/dist/agentic/checkpointer.d.ts +2 -0
  6. package/dist/agentic/checkpointer.js +14 -0
  7. package/dist/agentic/graph.d.ts +483 -0
  8. package/dist/agentic/graph.js +100 -0
  9. package/dist/agentic/nodes/architect.d.ts +6 -0
  10. package/dist/agentic/nodes/architect.js +51 -0
  11. package/dist/agentic/nodes/engineer.d.ts +11 -0
  12. package/dist/agentic/nodes/engineer.js +182 -0
  13. package/dist/agentic/nodes/qa.d.ts +5 -0
  14. package/dist/agentic/nodes/qa.js +151 -0
  15. package/dist/agentic/nodes/reviewer.d.ts +5 -0
  16. package/dist/agentic/nodes/reviewer.js +111 -0
  17. package/dist/agentic/nodes/supervisor.d.ts +6 -0
  18. package/dist/agentic/nodes/supervisor.js +18 -0
  19. package/dist/agentic/state.d.ts +51 -0
  20. package/dist/agentic/state.js +26 -0
  21. package/dist/commands/config.d.ts +13 -0
  22. package/dist/commands/config.js +47 -0
  23. package/dist/commands/create.d.ts +14 -0
  24. package/dist/commands/create.js +182 -0
  25. package/dist/commands/deploy.d.ts +13 -0
  26. package/dist/commands/deploy.js +68 -0
  27. package/dist/commands/modify.d.ts +13 -0
  28. package/dist/commands/modify.js +276 -0
  29. package/dist/commands/prune.d.ts +9 -0
  30. package/dist/commands/prune.js +98 -0
  31. package/dist/commands/resume.d.ts +8 -0
  32. package/dist/commands/resume.js +39 -0
  33. package/dist/commands/test.d.ts +27 -0
  34. package/dist/commands/test.js +619 -0
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1 -0
  37. package/dist/services/ai.service.d.ts +51 -0
  38. package/dist/services/ai.service.js +421 -0
  39. package/dist/services/n8n.service.d.ts +17 -0
  40. package/dist/services/n8n.service.js +81 -0
  41. package/dist/services/node-definitions.service.d.ts +36 -0
  42. package/dist/services/node-definitions.service.js +102 -0
  43. package/dist/utils/config.d.ts +15 -0
  44. package/dist/utils/config.js +25 -0
  45. package/dist/utils/multilinePrompt.d.ts +1 -0
  46. package/dist/utils/multilinePrompt.js +52 -0
  47. package/dist/utils/n8nClient.d.ts +97 -0
  48. package/dist/utils/n8nClient.js +440 -0
  49. package/dist/utils/sandbox.d.ts +13 -0
  50. package/dist/utils/sandbox.js +34 -0
  51. package/dist/utils/theme.d.ts +23 -0
  52. package/dist/utils/theme.js +92 -0
  53. package/oclif.manifest.json +331 -0
  54. package/package.json +95 -0
@@ -0,0 +1,483 @@
1
+ import { TeamState } from "./state.js";
2
+ export declare const graph: import("@langchain/langgraph").CompiledStateGraph<{
3
+ userGoal: string;
4
+ spec: any;
5
+ workflowJson: any;
6
+ validationErrors: string[];
7
+ messages: import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[];
8
+ needsClarification: boolean;
9
+ validationStatus: "passed" | "failed";
10
+ availableNodeTypes: string[];
11
+ revisionCount: number;
12
+ strategies: any[];
13
+ candidates: any[];
14
+ customTools: Record<string, string>;
15
+ }, {
16
+ userGoal?: string | undefined;
17
+ spec?: any;
18
+ workflowJson?: any;
19
+ validationErrors?: string[] | undefined;
20
+ messages?: import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[] | undefined;
21
+ needsClarification?: boolean | undefined;
22
+ validationStatus?: "passed" | "failed" | undefined;
23
+ availableNodeTypes?: string[] | undefined;
24
+ revisionCount?: number | undefined;
25
+ strategies?: any[] | undefined;
26
+ candidates?: any[] | undefined;
27
+ customTools?: Record<string, string> | undefined;
28
+ }, "__start__" | "architect" | "engineer" | "reviewer" | "supervisor" | "qa", {
29
+ userGoal: {
30
+ (): import("@langchain/langgraph").LastValue<string>;
31
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
32
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
33
+ };
34
+ spec: {
35
+ (): import("@langchain/langgraph").LastValue<any>;
36
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
37
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
38
+ };
39
+ workflowJson: {
40
+ (): import("@langchain/langgraph").LastValue<any>;
41
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
42
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
43
+ };
44
+ validationErrors: {
45
+ (): import("@langchain/langgraph").LastValue<string[]>;
46
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
47
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
48
+ };
49
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
50
+ needsClarification: {
51
+ (): import("@langchain/langgraph").LastValue<boolean>;
52
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
53
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
54
+ };
55
+ validationStatus: {
56
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
57
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
58
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
59
+ };
60
+ availableNodeTypes: {
61
+ (): import("@langchain/langgraph").LastValue<string[]>;
62
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
63
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
64
+ };
65
+ revisionCount: {
66
+ (): import("@langchain/langgraph").LastValue<number>;
67
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
68
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
69
+ };
70
+ strategies: {
71
+ (): import("@langchain/langgraph").LastValue<any[]>;
72
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
73
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
74
+ };
75
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
76
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
77
+ }, {
78
+ userGoal: {
79
+ (): import("@langchain/langgraph").LastValue<string>;
80
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
81
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
82
+ };
83
+ spec: {
84
+ (): import("@langchain/langgraph").LastValue<any>;
85
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
86
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
87
+ };
88
+ workflowJson: {
89
+ (): import("@langchain/langgraph").LastValue<any>;
90
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
91
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
92
+ };
93
+ validationErrors: {
94
+ (): import("@langchain/langgraph").LastValue<string[]>;
95
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
96
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
97
+ };
98
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
99
+ needsClarification: {
100
+ (): import("@langchain/langgraph").LastValue<boolean>;
101
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
102
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
103
+ };
104
+ validationStatus: {
105
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
106
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
107
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
108
+ };
109
+ availableNodeTypes: {
110
+ (): import("@langchain/langgraph").LastValue<string[]>;
111
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
112
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
113
+ };
114
+ revisionCount: {
115
+ (): import("@langchain/langgraph").LastValue<number>;
116
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
117
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
118
+ };
119
+ strategies: {
120
+ (): import("@langchain/langgraph").LastValue<any[]>;
121
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
122
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
123
+ };
124
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
125
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
126
+ }, import("@langchain/langgraph").StateDefinition, {
127
+ architect: {
128
+ spec: any;
129
+ strategies: any[];
130
+ needsClarification: any;
131
+ };
132
+ engineer: {
133
+ workflowJson: any;
134
+ candidates?: undefined;
135
+ } | {
136
+ workflowJson?: undefined;
137
+ candidates?: undefined;
138
+ } | {
139
+ workflowJson: any;
140
+ candidates: any[];
141
+ };
142
+ reviewer: import("@langchain/langgraph").UpdateType<{
143
+ userGoal: {
144
+ (): import("@langchain/langgraph").LastValue<string>;
145
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
146
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
147
+ };
148
+ spec: {
149
+ (): import("@langchain/langgraph").LastValue<any>;
150
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
151
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
152
+ };
153
+ workflowJson: {
154
+ (): import("@langchain/langgraph").LastValue<any>;
155
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
156
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
157
+ };
158
+ validationErrors: {
159
+ (): import("@langchain/langgraph").LastValue<string[]>;
160
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
161
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
162
+ };
163
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
164
+ needsClarification: {
165
+ (): import("@langchain/langgraph").LastValue<boolean>;
166
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
167
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
168
+ };
169
+ validationStatus: {
170
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
171
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
172
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
173
+ };
174
+ availableNodeTypes: {
175
+ (): import("@langchain/langgraph").LastValue<string[]>;
176
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
177
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
178
+ };
179
+ revisionCount: {
180
+ (): import("@langchain/langgraph").LastValue<number>;
181
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
182
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
183
+ };
184
+ strategies: {
185
+ (): import("@langchain/langgraph").LastValue<any[]>;
186
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
187
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
188
+ };
189
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
190
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
191
+ }>;
192
+ supervisor: {
193
+ workflowJson?: undefined;
194
+ } | {
195
+ workflowJson: any;
196
+ };
197
+ qa: import("@langchain/langgraph").UpdateType<{
198
+ userGoal: {
199
+ (): import("@langchain/langgraph").LastValue<string>;
200
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
201
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
202
+ };
203
+ spec: {
204
+ (): import("@langchain/langgraph").LastValue<any>;
205
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
206
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
207
+ };
208
+ workflowJson: {
209
+ (): import("@langchain/langgraph").LastValue<any>;
210
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
211
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
212
+ };
213
+ validationErrors: {
214
+ (): import("@langchain/langgraph").LastValue<string[]>;
215
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
216
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
217
+ };
218
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
219
+ needsClarification: {
220
+ (): import("@langchain/langgraph").LastValue<boolean>;
221
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
222
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
223
+ };
224
+ validationStatus: {
225
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
226
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
227
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
228
+ };
229
+ availableNodeTypes: {
230
+ (): import("@langchain/langgraph").LastValue<string[]>;
231
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
232
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
233
+ };
234
+ revisionCount: {
235
+ (): import("@langchain/langgraph").LastValue<number>;
236
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
237
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
238
+ };
239
+ strategies: {
240
+ (): import("@langchain/langgraph").LastValue<any[]>;
241
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
242
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
243
+ };
244
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
245
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
246
+ }>;
247
+ }, unknown, unknown>;
248
+ /**
249
+ * Run the Agentic Workflow
250
+ * @param goal The user's goal string
251
+ * @param initialState Optional initial state (e.g. for existing workflows)
252
+ * @returns The final state of the graph
253
+ */
254
+ export declare const runAgenticWorkflow: (goal: string, initialState?: Partial<typeof TeamState.State>, threadId?: string) => Promise<import("@langchain/langgraph").StateType<{
255
+ userGoal: {
256
+ (): import("@langchain/langgraph").LastValue<string>;
257
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
258
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
259
+ };
260
+ spec: {
261
+ (): import("@langchain/langgraph").LastValue<any>;
262
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
263
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
264
+ };
265
+ workflowJson: {
266
+ (): import("@langchain/langgraph").LastValue<any>;
267
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
268
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
269
+ };
270
+ validationErrors: {
271
+ (): import("@langchain/langgraph").LastValue<string[]>;
272
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
273
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
274
+ };
275
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
276
+ needsClarification: {
277
+ (): import("@langchain/langgraph").LastValue<boolean>;
278
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
279
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
280
+ };
281
+ validationStatus: {
282
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
283
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
284
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
285
+ };
286
+ availableNodeTypes: {
287
+ (): import("@langchain/langgraph").LastValue<string[]>;
288
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
289
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
290
+ };
291
+ revisionCount: {
292
+ (): import("@langchain/langgraph").LastValue<number>;
293
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
294
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
295
+ };
296
+ strategies: {
297
+ (): import("@langchain/langgraph").LastValue<any[]>;
298
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
299
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
300
+ };
301
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
302
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
303
+ }>>;
304
+ /**
305
+ * Run the Agentic Workflow with Streaming
306
+ * @param goal The user's goal string
307
+ * @returns AsyncIterable for events
308
+ */
309
+ export declare const runAgenticWorkflowStream: (goal: string, threadId?: string) => Promise<import("@langchain/core/utils/stream").IterableReadableStream<{
310
+ architect?: {
311
+ spec: any;
312
+ strategies: any[];
313
+ needsClarification: any;
314
+ } | undefined;
315
+ engineer?: {
316
+ workflowJson: any;
317
+ candidates?: undefined;
318
+ } | {
319
+ workflowJson?: undefined;
320
+ candidates?: undefined;
321
+ } | {
322
+ workflowJson: any;
323
+ candidates: any[];
324
+ } | undefined;
325
+ reviewer?: import("@langchain/langgraph").UpdateType<{
326
+ userGoal: {
327
+ (): import("@langchain/langgraph").LastValue<string>;
328
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
329
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
330
+ };
331
+ spec: {
332
+ (): import("@langchain/langgraph").LastValue<any>;
333
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
334
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
335
+ };
336
+ workflowJson: {
337
+ (): import("@langchain/langgraph").LastValue<any>;
338
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
339
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
340
+ };
341
+ validationErrors: {
342
+ (): import("@langchain/langgraph").LastValue<string[]>;
343
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
344
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
345
+ };
346
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
347
+ needsClarification: {
348
+ (): import("@langchain/langgraph").LastValue<boolean>;
349
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
350
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
351
+ };
352
+ validationStatus: {
353
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
354
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
355
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
356
+ };
357
+ availableNodeTypes: {
358
+ (): import("@langchain/langgraph").LastValue<string[]>;
359
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
360
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
361
+ };
362
+ revisionCount: {
363
+ (): import("@langchain/langgraph").LastValue<number>;
364
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
365
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
366
+ };
367
+ strategies: {
368
+ (): import("@langchain/langgraph").LastValue<any[]>;
369
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
370
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
371
+ };
372
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
373
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
374
+ }> | undefined;
375
+ supervisor?: {
376
+ workflowJson?: undefined;
377
+ } | {
378
+ workflowJson: any;
379
+ } | undefined;
380
+ qa?: import("@langchain/langgraph").UpdateType<{
381
+ userGoal: {
382
+ (): import("@langchain/langgraph").LastValue<string>;
383
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
384
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
385
+ };
386
+ spec: {
387
+ (): import("@langchain/langgraph").LastValue<any>;
388
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
389
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
390
+ };
391
+ workflowJson: {
392
+ (): import("@langchain/langgraph").LastValue<any>;
393
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
394
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
395
+ };
396
+ validationErrors: {
397
+ (): import("@langchain/langgraph").LastValue<string[]>;
398
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
399
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
400
+ };
401
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
402
+ needsClarification: {
403
+ (): import("@langchain/langgraph").LastValue<boolean>;
404
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
405
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
406
+ };
407
+ validationStatus: {
408
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
409
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
410
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
411
+ };
412
+ availableNodeTypes: {
413
+ (): import("@langchain/langgraph").LastValue<string[]>;
414
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
415
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
416
+ };
417
+ revisionCount: {
418
+ (): import("@langchain/langgraph").LastValue<number>;
419
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
420
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
421
+ };
422
+ strategies: {
423
+ (): import("@langchain/langgraph").LastValue<any[]>;
424
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
425
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
426
+ };
427
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
428
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
429
+ }> | undefined;
430
+ }>>;
431
+ /**
432
+ * Resume the Agentic Workflow from an interrupted state
433
+ */
434
+ export declare const resumeAgenticWorkflow: (threadId: string, input?: any) => Promise<import("@langchain/langgraph").StateType<{
435
+ userGoal: {
436
+ (): import("@langchain/langgraph").LastValue<string>;
437
+ (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
438
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
439
+ };
440
+ spec: {
441
+ (): import("@langchain/langgraph").LastValue<any>;
442
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
443
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
444
+ };
445
+ workflowJson: {
446
+ (): import("@langchain/langgraph").LastValue<any>;
447
+ (annotation: import("@langchain/langgraph").SingleReducer<any, any>): import("@langchain/langgraph").BinaryOperatorAggregate<any, any>;
448
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
449
+ };
450
+ validationErrors: {
451
+ (): import("@langchain/langgraph").LastValue<string[]>;
452
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
453
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
454
+ };
455
+ messages: import("@langchain/langgraph").BinaryOperatorAggregate<import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[], import("@langchain/core/messages").BaseMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>, import("@langchain/core/messages").MessageType>[]>;
456
+ needsClarification: {
457
+ (): import("@langchain/langgraph").LastValue<boolean>;
458
+ (annotation: import("@langchain/langgraph").SingleReducer<boolean, boolean>): import("@langchain/langgraph").BinaryOperatorAggregate<boolean, boolean>;
459
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
460
+ };
461
+ validationStatus: {
462
+ (): import("@langchain/langgraph").LastValue<"passed" | "failed">;
463
+ (annotation: import("@langchain/langgraph").SingleReducer<"passed" | "failed", "passed" | "failed">): import("@langchain/langgraph").BinaryOperatorAggregate<"passed" | "failed", "passed" | "failed">;
464
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
465
+ };
466
+ availableNodeTypes: {
467
+ (): import("@langchain/langgraph").LastValue<string[]>;
468
+ (annotation: import("@langchain/langgraph").SingleReducer<string[], string[]>): import("@langchain/langgraph").BinaryOperatorAggregate<string[], string[]>;
469
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
470
+ };
471
+ revisionCount: {
472
+ (): import("@langchain/langgraph").LastValue<number>;
473
+ (annotation: import("@langchain/langgraph").SingleReducer<number, number>): import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
474
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
475
+ };
476
+ strategies: {
477
+ (): import("@langchain/langgraph").LastValue<any[]>;
478
+ (annotation: import("@langchain/langgraph").SingleReducer<any[], any[]>): import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
479
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
480
+ };
481
+ candidates: import("@langchain/langgraph").BinaryOperatorAggregate<any[], any[]>;
482
+ customTools: import("@langchain/langgraph").BinaryOperatorAggregate<Record<string, string>, Record<string, string>>;
483
+ }>>;
@@ -0,0 +1,100 @@
1
+ import { StateGraph, START, END, Send } from "@langchain/langgraph";
2
+ import { checkpointer } from "./checkpointer.js";
3
+ import { architectNode } from "./nodes/architect.js";
4
+ import { engineerNode } from "./nodes/engineer.js";
5
+ import { qaNode } from "./nodes/qa.js";
6
+ import { reviewerNode } from "./nodes/reviewer.js";
7
+ import { supervisorNode } from "./nodes/supervisor.js";
8
+ import { TeamState } from "./state.js";
9
+ // Define the graph
10
+ const workflow = new StateGraph(TeamState)
11
+ .addNode("architect", architectNode)
12
+ .addNode("engineer", engineerNode)
13
+ .addNode("reviewer", reviewerNode)
14
+ .addNode("supervisor", supervisorNode)
15
+ .addNode("qa", qaNode)
16
+ // Edges
17
+ .addEdge(START, "architect")
18
+ // Parallel Fan-Out: Architect -> Multiple Engineers (via Send)
19
+ .addConditionalEdges("architect", (state) => {
20
+ if (state.strategies && state.strategies.length > 0) {
21
+ return state.strategies.map(s => new Send("engineer", { spec: s }));
22
+ }
23
+ // Fallback for linear path
24
+ return "engineer";
25
+ }, ["engineer"]) // We must declare valid destination nodes for visualization/compilation
26
+ // Fan-In: Engineer -> Supervisor (Wait for all to finish) or route to Reviewer (if fixing)
27
+ .addConditionalEdges("engineer", (state) => {
28
+ // If we have errors, we are in "Repair Mode" -> Skip Supervisor (which only handles fresh candidates)
29
+ if (state.validationErrors && state.validationErrors.length > 0) {
30
+ return "reviewer";
31
+ }
32
+ return "supervisor";
33
+ }, ["supervisor", "reviewer"]) // Declare destinations
34
+ // Supervisor -> Reviewer
35
+ .addEdge("supervisor", "reviewer")
36
+ // Reviewer Logic: Pass -> QA, Fail -> Engineer
37
+ .addConditionalEdges("reviewer", (state) => state.validationStatus === "passed" ? "passed" : "failed", {
38
+ passed: "qa",
39
+ failed: "engineer"
40
+ })
41
+ // Self-Correction Loop
42
+ .addConditionalEdges("qa", (state) => {
43
+ // If validation passed, we are done
44
+ if (state.validationStatus === "passed") {
45
+ return "passed";
46
+ }
47
+ // If failed, loop back to engineer to fix
48
+ return "failed";
49
+ }, {
50
+ passed: END,
51
+ failed: "engineer",
52
+ });
53
+ // Compile the graph with persistence and interrupts
54
+ export const graph = workflow.compile({
55
+ checkpointer: checkpointer,
56
+ interruptBefore: ["qa"],
57
+ });
58
+ /**
59
+ * Run the Agentic Workflow
60
+ * @param goal The user's goal string
61
+ * @param initialState Optional initial state (e.g. for existing workflows)
62
+ * @returns The final state of the graph
63
+ */
64
+ export const runAgenticWorkflow = async (goal, initialState = {}, threadId = "default_session") => {
65
+ console.log(`🚀 Starting Agentic Workflow for goal: "${goal}" (Thread: ${threadId})`);
66
+ const result = await graph.invoke({
67
+ userGoal: goal,
68
+ messages: [],
69
+ validationErrors: [],
70
+ revisionCount: 0,
71
+ ...initialState
72
+ }, {
73
+ configurable: { thread_id: threadId }
74
+ });
75
+ return result;
76
+ };
77
+ /**
78
+ * Run the Agentic Workflow with Streaming
79
+ * @param goal The user's goal string
80
+ * @returns AsyncIterable for events
81
+ */
82
+ export const runAgenticWorkflowStream = async (goal, threadId = "default_session") => {
83
+ return await graph.stream({
84
+ userGoal: goal,
85
+ messages: [],
86
+ validationErrors: [],
87
+ revisionCount: 0,
88
+ }, {
89
+ configurable: { thread_id: threadId }
90
+ });
91
+ };
92
+ /**
93
+ * Resume the Agentic Workflow from an interrupted state
94
+ */
95
+ export const resumeAgenticWorkflow = async (threadId, input) => {
96
+ console.log(`▶️ Resuming Agentic Workflow (Thread: ${threadId})`);
97
+ return await graph.invoke(input, {
98
+ configurable: { thread_id: threadId }
99
+ });
100
+ };
@@ -0,0 +1,6 @@
1
+ import { TeamState } from "../state.js";
2
+ export declare const architectNode: (state: typeof TeamState.State) => Promise<{
3
+ spec: any;
4
+ strategies: any[];
5
+ needsClarification: any;
6
+ }>;