@botbotgo/agent-harness 0.0.99 → 0.0.101

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 (74) hide show
  1. package/README.md +3 -6
  2. package/README.zh.md +2 -2
  3. package/dist/benchmark/upstream-runtime-ab-benchmark.d.ts +1 -1
  4. package/dist/benchmark/upstream-runtime-ab-benchmark.js +1 -2
  5. package/dist/contracts/core.d.ts +2 -2
  6. package/dist/contracts/runtime.d.ts +1 -5
  7. package/dist/package-version.d.ts +1 -1
  8. package/dist/package-version.js +1 -1
  9. package/dist/resource/resource-impl.js +78 -76
  10. package/dist/runtime/adapter/deepagent-runnable-config.d.ts +30 -0
  11. package/dist/runtime/adapter/deepagent-runnable-config.js +22 -0
  12. package/dist/runtime/adapter/index.d.ts +0 -2
  13. package/dist/runtime/adapter/index.js +0 -2
  14. package/dist/runtime/adapter/invocation-result.d.ts +13 -0
  15. package/dist/runtime/adapter/invocation-result.js +40 -0
  16. package/dist/runtime/adapter/langchain-runnable-config.d.ts +25 -0
  17. package/dist/runtime/adapter/langchain-runnable-config.js +19 -0
  18. package/dist/runtime/adapter/local-tool-invocation.d.ts +23 -0
  19. package/dist/runtime/adapter/local-tool-invocation.js +64 -0
  20. package/dist/runtime/adapter/runtime-adapter-support.d.ts +18 -0
  21. package/dist/runtime/adapter/runtime-adapter-support.js +54 -0
  22. package/dist/runtime/adapter/stream-event-projection.d.ts +19 -0
  23. package/dist/runtime/adapter/stream-event-projection.js +79 -0
  24. package/dist/runtime/adapter/stream-text-consumption.d.ts +4 -0
  25. package/dist/runtime/adapter/stream-text-consumption.js +18 -0
  26. package/dist/runtime/adapter/tool/builtin-middleware-tools.d.ts +64 -0
  27. package/dist/runtime/adapter/tool/builtin-middleware-tools.js +144 -0
  28. package/dist/runtime/adapter/tool/tool-replay.d.ts +18 -0
  29. package/dist/runtime/adapter/tool/tool-replay.js +26 -0
  30. package/dist/runtime/agent-runtime-adapter.d.ts +2 -54
  31. package/dist/runtime/agent-runtime-adapter.js +122 -1568
  32. package/dist/runtime/harness/run/helpers.js +2 -8
  33. package/dist/runtime/harness/run/recovery.d.ts +42 -0
  34. package/dist/runtime/harness/run/recovery.js +139 -0
  35. package/dist/runtime/harness/run/routing.d.ts +1 -3
  36. package/dist/runtime/harness/run/routing.js +2 -25
  37. package/dist/runtime/harness/run/run-lifecycle.d.ts +0 -11
  38. package/dist/runtime/harness/run/run-lifecycle.js +7 -50
  39. package/dist/runtime/harness/runtime-defaults.d.ts +4 -0
  40. package/dist/runtime/harness/runtime-defaults.js +39 -0
  41. package/dist/runtime/harness/system/inventory.js +2 -1
  42. package/dist/runtime/harness/system/skill-requirements.d.ts +1 -0
  43. package/dist/runtime/harness.d.ts +5 -24
  44. package/dist/runtime/harness.js +356 -536
  45. package/dist/runtime/index.d.ts +1 -12
  46. package/dist/runtime/index.js +1 -12
  47. package/dist/runtime/support/compiled-binding.d.ts +0 -2
  48. package/dist/runtime/support/compiled-binding.js +3 -22
  49. package/dist/runtime/support/harness-support.d.ts +0 -11
  50. package/dist/runtime/support/harness-support.js +1 -44
  51. package/dist/runtime/support/index.d.ts +1 -1
  52. package/dist/runtime/support/index.js +1 -1
  53. package/dist/runtime/support/runtime-factories.js +2 -2
  54. package/dist/workspace/agent-binding-compiler.js +9 -93
  55. package/dist/workspace/index.d.ts +0 -5
  56. package/dist/workspace/index.js +0 -5
  57. package/dist/workspace/object-loader.js +44 -99
  58. package/dist/workspace/support/agent-capabilities.js +2 -2
  59. package/dist/workspace/support/workspace-ref-utils.d.ts +0 -2
  60. package/dist/workspace/support/workspace-ref-utils.js +0 -17
  61. package/dist/workspace/validate.js +1 -1
  62. package/package.json +1 -1
  63. package/dist/config/workflows/langgraph-workflows.yaml +0 -570
  64. package/dist/config/workflows/runtime-profiles.yaml +0 -94
  65. package/dist/runtime/adapter/langgraph/presets.d.ts +0 -25
  66. package/dist/runtime/adapter/langgraph/presets.js +0 -165
  67. package/dist/runtime/adapter/langgraph/profiles.d.ts +0 -6
  68. package/dist/runtime/adapter/langgraph/profiles.js +0 -206
  69. package/dist/runtime/checkpoint-maintenance.d.ts +0 -1
  70. package/dist/runtime/checkpoint-maintenance.js +0 -1
  71. package/dist/runtime/file-checkpoint-saver.d.ts +0 -1
  72. package/dist/runtime/file-checkpoint-saver.js +0 -1
  73. package/dist/runtime/sqlite-maintained-checkpoint-saver.d.ts +0 -1
  74. package/dist/runtime/sqlite-maintained-checkpoint-saver.js +0 -1
@@ -1,94 +0,0 @@
1
- # agent-harness feature: schema version for this declarative config object.
2
- apiVersion: agent-harness/v1alpha1
3
- # agent-harness feature: catalog of reusable runtime entry profiles layered on workflow resources.
4
- kind: RuntimeProfiles
5
- spec:
6
- - id: coding-runtime
7
- workflowRef: langgraph-workflow/coding-loop
8
- defaults:
9
- approvalPolicy: safe-default
10
- memoryPolicy: project-facts-only
11
- directAnswerFirst: false
12
- watchGithubActionsAfterPush: true
13
- allowPushToMaster: false
14
- closeGithubIssueOnSuccess: false
15
- requiredAgents:
16
- - coderAgent
17
- optionalAgents:
18
- - verifierAgent
19
- - id: personal-assistant
20
- workflowRef: langgraph-workflow/assistant-loop
21
- defaults:
22
- approvalPolicy: human-before-side-effects
23
- memoryPolicy: user-preferences-and-routines
24
- directAnswerFirst: true
25
- persistDurableMemory: true
26
- optionalAgents:
27
- - defaultResearchAgent
28
- - defaultWritingAgent
29
- - defaultSchedulingAgent
30
- - defaultWorkerAgent
31
- - id: research-runtime
32
- workflowRef: langgraph-workflow/research-loop
33
- defaults:
34
- approvalPolicy: minimal
35
- memoryPolicy: report-summary-only
36
- requireSourceGrounding: true
37
- requireCoverageReview: true
38
- requiredAgents:
39
- - gathererAgent
40
- - analystAgent
41
- optionalAgents:
42
- - synthesizerAgent
43
- - id: approval-review-runtime
44
- workflowRef: langgraph-workflow/approval-review-loop
45
- defaults:
46
- approvalPolicy: always-required
47
- memoryPolicy: none
48
- executeAfterApproval: true
49
- auditTrail: full
50
- requiredAgents:
51
- - preparerAgent
52
- optionalAgents:
53
- - reviewerAgent
54
- - id: claw-style-assistant
55
- workflowRef: langgraph-workflow/assistant-loop
56
- defaults:
57
- approvalPolicy: human-before-side-effects
58
- memoryPolicy: user-preferences-and-stable-context
59
- channelFirst: true
60
- attachmentAware: true
61
- sessionMemory: thread-scoped
62
- optionalAgents:
63
- - defaultWorkerAgent
64
- - id: chat-operator
65
- workflowRef: langgraph-workflow/chat-router-loop
66
- defaults:
67
- approvalPolicy: route-dependent
68
- memoryPolicy: thread-only
69
- directAnswerFirst: true
70
- optionalAgents:
71
- - codingAgent
72
- - researchAgent
73
- - assistantAgent
74
- - approvalAgent
75
- - id: copilot-sidecar
76
- workflowRef: langgraph-workflow/coding-lite-loop
77
- defaults:
78
- approvalPolicy: no-push
79
- memoryPolicy: repo-context-only
80
- directAnswerFirst: false
81
- allowRepositoryEdits: true
82
- allowPushToMaster: false
83
- runIntegrationVerification: false
84
- requiredAgents:
85
- - coderAgent
86
- - id: task-delegation-hub
87
- workflowRef: langgraph-workflow/delegation-loop
88
- defaults:
89
- approvalPolicy: worker-dependent
90
- memoryPolicy: task-summary-only
91
- routingStrategy: planner-first
92
- reviewerEnabled: true
93
- optionalAgents:
94
- - defaultWorkerFallback
@@ -1,25 +0,0 @@
1
- type LangGraphPresetNode = {
2
- id: string;
3
- kind: string;
4
- prompt?: string;
5
- role?: string;
6
- agent?: string;
7
- tool?: string;
8
- };
9
- type LangGraphPresetEdge = {
10
- from: string;
11
- to: string;
12
- when?: string;
13
- };
14
- export type LangGraphPresetWorkflow = {
15
- entryNode: string;
16
- nodes: LangGraphPresetNode[];
17
- edges: LangGraphPresetEdge[];
18
- };
19
- export type LangGraphPresetName = "react" | "prompt-chaining" | "routing" | "parallelization" | "plan-execute" | "review-loop" | "evaluator-optimizer" | "approval-gate" | "handoff" | "orchestrator-workers";
20
- type LangGraphPresetOptions = {
21
- agent?: string;
22
- };
23
- export declare const SUPPORTED_LANGGRAPH_PRESETS: LangGraphPresetName[];
24
- export declare function resolveLangGraphPresetWorkflow(presetName: string | undefined, options?: LangGraphPresetOptions): LangGraphPresetWorkflow | undefined;
25
- export {};
@@ -1,165 +0,0 @@
1
- const DEFAULT_PLANNER_PROMPT = "You are the workflow planner. Produce a concise execution plan for the user request before execution starts.";
2
- const DEFAULT_REVIEWER_PROMPT = "Review the current result, call out missing verification or obvious gaps, and state whether the work looks sufficient.";
3
- const DEFAULT_REPLANNER_PROMPT = "Refine the plan based on the reviewer feedback and current result. Return only the updated plan.";
4
- const DEFAULT_FINALIZER_PROMPT = "Rewrite the current result into a concise user-facing final answer. Preserve facts and caveats.";
5
- export const SUPPORTED_LANGGRAPH_PRESETS = [
6
- "react",
7
- "prompt-chaining",
8
- "routing",
9
- "parallelization",
10
- "plan-execute",
11
- "review-loop",
12
- "evaluator-optimizer",
13
- "approval-gate",
14
- "handoff",
15
- "orchestrator-workers",
16
- ];
17
- function requireAgent(preset, options) {
18
- if (typeof options.agent === "string" && options.agent.trim()) {
19
- return options.agent.trim();
20
- }
21
- throw new Error(`LangGraph preset ${preset} requires config.agent`);
22
- }
23
- export function resolveLangGraphPresetWorkflow(presetName, options = {}) {
24
- switch (presetName) {
25
- case undefined:
26
- case "":
27
- return undefined;
28
- case "react":
29
- return {
30
- entryNode: "step1",
31
- nodes: [
32
- { id: "step1", kind: "agent" },
33
- ],
34
- edges: [],
35
- };
36
- case "prompt-chaining":
37
- case "plan-execute":
38
- return {
39
- entryNode: "step1",
40
- nodes: [
41
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
42
- { id: "step2", kind: "agent" },
43
- { id: "step3", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
44
- ],
45
- edges: [
46
- { from: "step1", to: "step2" },
47
- { from: "step2", to: "step3", when: "has_result" },
48
- ],
49
- };
50
- case "routing": {
51
- const agent = requireAgent("routing", options);
52
- return {
53
- entryNode: "step1",
54
- nodes: [
55
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
56
- { id: "step2", kind: "agent", agent },
57
- { id: "step3", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
58
- ],
59
- edges: [
60
- { from: "step1", to: "step2" },
61
- { from: "step2", to: "step3", when: "has_result" },
62
- ],
63
- };
64
- }
65
- case "parallelization": {
66
- const agent = requireAgent("parallelization", options);
67
- return {
68
- entryNode: "step1",
69
- nodes: [
70
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
71
- { id: "step2", kind: "agent", agent },
72
- { id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
73
- { id: "step4", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
74
- ],
75
- edges: [
76
- { from: "step1", to: "step2" },
77
- { from: "step2", to: "step3", when: "has_result" },
78
- { from: "step3", to: "step4", when: "review_ok" },
79
- ],
80
- };
81
- }
82
- case "review-loop":
83
- return {
84
- entryNode: "step1",
85
- nodes: [
86
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
87
- { id: "step2", kind: "agent" },
88
- { id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
89
- { id: "step4", kind: "llm", role: "replanner", prompt: DEFAULT_REPLANNER_PROMPT },
90
- { id: "step5", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
91
- ],
92
- edges: [
93
- { from: "step1", to: "step2" },
94
- { from: "step2", to: "step3", when: "has_result" },
95
- { from: "step3", to: "step5", when: "review_ok" },
96
- { from: "step3", to: "step4", when: "review_incomplete" },
97
- { from: "step4", to: "step2", when: "has_plan" },
98
- ],
99
- };
100
- case "evaluator-optimizer":
101
- return {
102
- entryNode: "step1",
103
- nodes: [
104
- { id: "step1", kind: "agent" },
105
- { id: "step2", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
106
- { id: "step3", kind: "llm", role: "replanner", prompt: DEFAULT_REPLANNER_PROMPT },
107
- { id: "step4", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
108
- ],
109
- edges: [
110
- { from: "step1", to: "step2", when: "has_result" },
111
- { from: "step2", to: "step4", when: "review_ok" },
112
- { from: "step2", to: "step3", when: "review_incomplete" },
113
- { from: "step3", to: "step1", when: "has_plan" },
114
- ],
115
- };
116
- case "approval-gate":
117
- return {
118
- entryNode: "step1",
119
- nodes: [
120
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
121
- { id: "step2", kind: "approval" },
122
- { id: "step3", kind: "agent" },
123
- { id: "step4", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
124
- ],
125
- edges: [
126
- { from: "step1", to: "step2" },
127
- { from: "step2", to: "step3", when: "approval_approved" },
128
- { from: "step2", to: "step3", when: "approval_edited" },
129
- { from: "step3", to: "step4", when: "has_result" },
130
- ],
131
- };
132
- case "handoff": {
133
- const agent = requireAgent("handoff", options);
134
- return {
135
- entryNode: "step1",
136
- nodes: [
137
- { id: "step1", kind: "agent", agent },
138
- { id: "step2", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
139
- ],
140
- edges: [
141
- { from: "step1", to: "step2", when: "has_result" },
142
- ],
143
- };
144
- }
145
- case "orchestrator-workers": {
146
- const agent = requireAgent("orchestrator-workers", options);
147
- return {
148
- entryNode: "step1",
149
- nodes: [
150
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
151
- { id: "step2", kind: "agent", agent },
152
- { id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
153
- { id: "step4", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
154
- ],
155
- edges: [
156
- { from: "step1", to: "step2" },
157
- { from: "step2", to: "step3", when: "has_result" },
158
- { from: "step3", to: "step4", when: "review_ok" },
159
- ],
160
- };
161
- }
162
- default:
163
- throw new Error(`Unsupported LangGraph preset ${String(presetName)}. Supported presets: ${SUPPORTED_LANGGRAPH_PRESETS.join(", ")}`);
164
- }
165
- }
@@ -1,6 +0,0 @@
1
- import type { LangGraphPresetWorkflow } from "./presets.js";
2
- export type LangGraphProfileName = "coding-runtime" | "personal-assistant" | "research-runtime" | "approval-review-runtime" | "claw-style-assistant" | "chat-operator" | "copilot-sidecar" | "task-delegation-hub";
3
- type LangGraphProfileOptions = Record<string, unknown>;
4
- export declare const SUPPORTED_LANGGRAPH_PROFILES: LangGraphProfileName[];
5
- export declare function resolveLangGraphProfileWorkflow(profileName: string | undefined, options?: LangGraphProfileOptions): LangGraphPresetWorkflow | undefined;
6
- export {};
@@ -1,206 +0,0 @@
1
- const DEFAULT_PLANNER_PROMPT = "You are the workflow planner. Produce a concise execution plan for the user request before execution starts.";
2
- const DEFAULT_REVIEWER_PROMPT = "Review the current result, call out missing verification or obvious gaps, and state whether the work looks sufficient.";
3
- const DEFAULT_FINALIZER_PROMPT = "Rewrite the current result into a concise user-facing final answer. Preserve facts and caveats.";
4
- const DEFAULT_REPLANNER_PROMPT = "Refine the plan based on the reviewer feedback and current result. Return only the updated plan.";
5
- export const SUPPORTED_LANGGRAPH_PROFILES = [
6
- "coding-runtime",
7
- "personal-assistant",
8
- "research-runtime",
9
- "approval-review-runtime",
10
- "claw-style-assistant",
11
- "chat-operator",
12
- "copilot-sidecar",
13
- "task-delegation-hub",
14
- ];
15
- function readStringOption(options, key) {
16
- const value = options[key];
17
- return typeof value === "string" && value.trim() ? value.trim() : undefined;
18
- }
19
- function requireAgentOption(profile, options, key) {
20
- const value = readStringOption(options, key);
21
- if (value) {
22
- return value;
23
- }
24
- throw new Error(`LangGraph profile ${profile} requires with.${key}`);
25
- }
26
- function buildCodingRuntimeWorkflow(options) {
27
- const coderAgent = requireAgentOption("coding-runtime", options, "coderAgent");
28
- const verifierAgent = readStringOption(options, "verifierAgent");
29
- const needsVerification = Boolean(verifierAgent) || options.runIntegrationVerification === true;
30
- return {
31
- entryNode: "step1",
32
- nodes: [
33
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
34
- { id: "step2", kind: "agent", agent: coderAgent },
35
- { id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
36
- { id: "step4", kind: "llm", role: "replanner", prompt: DEFAULT_REPLANNER_PROMPT },
37
- ...(needsVerification
38
- ? [{ id: "step5", kind: "approval" }, { id: "step6", kind: "agent", agent: verifierAgent ?? coderAgent }]
39
- : []),
40
- { id: "step7", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
41
- ],
42
- edges: [
43
- { from: "step1", to: "step2" },
44
- { from: "step2", to: "step3", when: "has_result" },
45
- { from: "step3", to: needsVerification ? "step5" : "step7", when: "review_ok" },
46
- { from: "step3", to: "step4", when: "review_incomplete" },
47
- { from: "step4", to: "step2", when: "has_plan" },
48
- ...(needsVerification
49
- ? [
50
- { from: "step5", to: "step6", when: "approval_approved" },
51
- { from: "step5", to: "step6", when: "approval_edited" },
52
- { from: "step6", to: "step7", when: "has_result" },
53
- ]
54
- : []),
55
- ],
56
- };
57
- }
58
- function buildAssistantWorkflow(options) {
59
- const worker = readStringOption(options, "defaultWorkerAgent") ??
60
- readStringOption(options, "defaultResearchAgent") ??
61
- readStringOption(options, "defaultWritingAgent") ??
62
- readStringOption(options, "defaultSchedulingAgent");
63
- return {
64
- entryNode: "step1",
65
- nodes: [
66
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
67
- ...(worker ? [{ id: "step2", kind: "agent", agent: worker }] : [{ id: "step2", kind: "tool", tool: "repo_inventory" }]),
68
- { id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
69
- { id: "step4", kind: "approval" },
70
- { id: "step5", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
71
- ],
72
- edges: [
73
- { from: "step1", to: "step2" },
74
- { from: "step2", to: "step3", when: "has_result" },
75
- { from: "step3", to: "step4", when: "review_incomplete" },
76
- { from: "step3", to: "step5", when: "review_ok" },
77
- { from: "step4", to: "step5", when: "approval_approved" },
78
- { from: "step4", to: "step5", when: "approval_edited" },
79
- ],
80
- };
81
- }
82
- function buildResearchWorkflow(options) {
83
- const gathererAgent = requireAgentOption("research-runtime", options, "gathererAgent");
84
- const analystAgent = requireAgentOption("research-runtime", options, "analystAgent");
85
- const synthesizerAgent = readStringOption(options, "synthesizerAgent");
86
- return {
87
- entryNode: "step1",
88
- nodes: [
89
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
90
- { id: "step2", kind: "agent", agent: gathererAgent },
91
- { id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
92
- { id: "step4", kind: "agent", agent: analystAgent },
93
- ...(synthesizerAgent ? [{ id: "step5", kind: "agent", agent: synthesizerAgent }] : []),
94
- { id: "step6", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
95
- ],
96
- edges: [
97
- { from: "step1", to: "step2" },
98
- { from: "step2", to: "step3", when: "has_result" },
99
- { from: "step3", to: "step4", when: "review_ok" },
100
- { from: "step3", to: "step2", when: "review_incomplete" },
101
- { from: "step4", to: synthesizerAgent ? "step5" : "step6", when: "has_result" },
102
- ...(synthesizerAgent ? [{ from: "step5", to: "step6", when: "has_result" }] : []),
103
- ],
104
- };
105
- }
106
- function buildApprovalReviewWorkflow(options) {
107
- const preparerAgent = requireAgentOption("approval-review-runtime", options, "preparerAgent");
108
- const reviewerAgent = readStringOption(options, "reviewerAgent");
109
- return {
110
- entryNode: "step1",
111
- nodes: [
112
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
113
- { id: "step2", kind: "agent", agent: preparerAgent },
114
- ...(reviewerAgent ? [{ id: "step3", kind: "agent", agent: reviewerAgent }] : [{ id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT }]),
115
- { id: "step4", kind: "approval" },
116
- { id: "step5", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
117
- ],
118
- edges: [
119
- { from: "step1", to: "step2" },
120
- { from: "step2", to: "step3", when: "has_result" },
121
- { from: "step3", to: "step4", when: "has_result" },
122
- { from: "step4", to: "step5", when: "approval_approved" },
123
- { from: "step4", to: "step5", when: "approval_edited" },
124
- ],
125
- };
126
- }
127
- function buildChatOperatorWorkflow(options) {
128
- const routedAgent = readStringOption(options, "assistantAgent") ??
129
- readStringOption(options, "researchAgent") ??
130
- readStringOption(options, "codingAgent") ??
131
- readStringOption(options, "approvalAgent");
132
- if (!routedAgent) {
133
- throw new Error("LangGraph profile chat-operator requires at least one target agent in with.assistantAgent, with.researchAgent, with.codingAgent, or with.approvalAgent");
134
- }
135
- return {
136
- entryNode: "step1",
137
- nodes: [
138
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
139
- { id: "step2", kind: "agent", agent: routedAgent },
140
- { id: "step3", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
141
- ],
142
- edges: [
143
- { from: "step1", to: "step2" },
144
- { from: "step2", to: "step3", when: "has_result" },
145
- ],
146
- };
147
- }
148
- function buildCopilotSidecarWorkflow(options) {
149
- const coderAgent = requireAgentOption("copilot-sidecar", options, "coderAgent");
150
- return {
151
- entryNode: "step1",
152
- nodes: [
153
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
154
- { id: "step2", kind: "agent", agent: coderAgent },
155
- { id: "step3", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
156
- ],
157
- edges: [
158
- { from: "step1", to: "step2" },
159
- { from: "step2", to: "step3", when: "has_result" },
160
- ],
161
- };
162
- }
163
- function buildDelegationHubWorkflow(options) {
164
- const workerAgent = readStringOption(options, "defaultWorkerFallback");
165
- if (!workerAgent) {
166
- throw new Error("LangGraph profile task-delegation-hub requires with.defaultWorkerFallback");
167
- }
168
- return {
169
- entryNode: "step1",
170
- nodes: [
171
- { id: "step1", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
172
- { id: "step2", kind: "agent", agent: workerAgent },
173
- { id: "step3", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
174
- { id: "step4", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
175
- ],
176
- edges: [
177
- { from: "step1", to: "step2" },
178
- { from: "step2", to: "step3", when: "has_result" },
179
- { from: "step3", to: "step4", when: "review_ok" },
180
- ],
181
- };
182
- }
183
- export function resolveLangGraphProfileWorkflow(profileName, options = {}) {
184
- switch (profileName) {
185
- case undefined:
186
- case "":
187
- return undefined;
188
- case "coding-runtime":
189
- return buildCodingRuntimeWorkflow(options);
190
- case "personal-assistant":
191
- case "claw-style-assistant":
192
- return buildAssistantWorkflow(options);
193
- case "research-runtime":
194
- return buildResearchWorkflow(options);
195
- case "approval-review-runtime":
196
- return buildApprovalReviewWorkflow(options);
197
- case "chat-operator":
198
- return buildChatOperatorWorkflow(options);
199
- case "copilot-sidecar":
200
- return buildCopilotSidecarWorkflow(options);
201
- case "task-delegation-hub":
202
- return buildDelegationHubWorkflow(options);
203
- default:
204
- throw new Error(`Unsupported LangGraph profile ${String(profileName)}. Supported profiles: ${SUPPORTED_LANGGRAPH_PROFILES.join(", ")}`);
205
- }
206
- }
@@ -1 +0,0 @@
1
- export * from "./maintenance/checkpoint-maintenance.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/checkpoint-maintenance.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/file-checkpoint-saver.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/file-checkpoint-saver.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/sqlite-maintained-checkpoint-saver.js";
@@ -1 +0,0 @@
1
- export * from "./maintenance/sqlite-maintained-checkpoint-saver.js";