@botbotgo/agent-harness 0.0.95 → 0.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -114
- package/README.zh.md +1 -70
- package/dist/api.d.ts +5 -5
- package/dist/config/workflows/langgraph-workflows.yaml +363 -111
- package/dist/config/workflows/runtime-profiles.yaml +94 -0
- package/dist/contracts/core.d.ts +9 -0
- package/dist/contracts/core.js +1 -0
- package/dist/contracts/runtime.d.ts +421 -0
- package/dist/contracts/runtime.js +1 -0
- package/dist/contracts/types.d.ts +3 -571
- package/dist/contracts/types.js +3 -1
- package/dist/contracts/workspace.d.ts +229 -0
- package/dist/contracts/workspace.js +1 -0
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/adapter/compat/deepagent-compat.d.ts +16 -0
- package/dist/runtime/adapter/compat/deepagent-compat.js +45 -0
- package/dist/runtime/adapter/compat/openai-compatible.d.ts +2 -0
- package/dist/runtime/adapter/compat/openai-compatible.js +43 -0
- package/dist/runtime/adapter/index.d.ts +15 -0
- package/dist/runtime/adapter/index.js +15 -0
- package/dist/runtime/adapter/langgraph/presets.js +165 -0
- package/dist/runtime/{langgraph-profiles.d.ts → adapter/langgraph/profiles.d.ts} +1 -1
- package/dist/runtime/adapter/langgraph/profiles.js +206 -0
- package/dist/runtime/adapter/model/invocation-request.d.ts +10 -0
- package/dist/runtime/adapter/model/invocation-request.js +46 -0
- package/dist/runtime/adapter/model/message-assembly.d.ts +6 -0
- package/dist/runtime/adapter/model/message-assembly.js +21 -0
- package/dist/runtime/adapter/model/model-providers.d.ts +2 -0
- package/dist/runtime/adapter/model/model-providers.js +27 -0
- package/dist/runtime/adapter/resilience.d.ts +12 -0
- package/dist/runtime/adapter/resilience.js +60 -0
- package/dist/runtime/{declared-middleware.d.ts → adapter/tool/declared-middleware.d.ts} +1 -1
- package/dist/runtime/adapter/tool/interrupt-policy.d.ts +8 -0
- package/dist/runtime/adapter/tool/interrupt-policy.js +34 -0
- package/dist/runtime/adapter/tool/provider-tool.d.ts +2 -0
- package/dist/runtime/adapter/tool/provider-tool.js +25 -0
- package/dist/runtime/adapter/tool/resolved-tool.d.ts +18 -0
- package/dist/runtime/adapter/tool/resolved-tool.js +62 -0
- package/dist/runtime/adapter/tool/tool-arguments.d.ts +7 -0
- package/dist/runtime/adapter/tool/tool-arguments.js +87 -0
- package/dist/runtime/{tool-hitl.d.ts → adapter/tool/tool-hitl.d.ts} +2 -2
- package/dist/runtime/adapter/tool/tool-name-mapping.d.ts +13 -0
- package/dist/runtime/adapter/tool/tool-name-mapping.js +101 -0
- package/dist/runtime/agent-runtime-adapter.d.ts +5 -20
- package/dist/runtime/agent-runtime-adapter.js +42 -544
- package/dist/runtime/checkpoint-maintenance.d.ts +1 -45
- package/dist/runtime/checkpoint-maintenance.js +1 -259
- package/dist/runtime/file-checkpoint-saver.d.ts +1 -20
- package/dist/runtime/file-checkpoint-saver.js +1 -106
- package/dist/runtime/{event-bus.d.ts → harness/events/event-bus.d.ts} +1 -1
- package/dist/runtime/{event-sink.d.ts → harness/events/event-sink.d.ts} +1 -1
- package/dist/runtime/{event-sink.js → harness/events/event-sink.js} +1 -1
- package/dist/runtime/harness/events/events.d.ts +23 -0
- package/dist/runtime/harness/events/events.js +61 -0
- package/dist/runtime/harness/events/streaming.d.ts +19 -0
- package/dist/runtime/harness/events/streaming.js +96 -0
- package/dist/runtime/harness/index.d.ts +16 -0
- package/dist/runtime/harness/index.js +16 -0
- package/dist/runtime/harness/run/helpers.d.ts +33 -0
- package/dist/runtime/harness/run/helpers.js +74 -0
- package/dist/runtime/harness/run/resources.d.ts +7 -0
- package/dist/runtime/harness/run/resources.js +58 -0
- package/dist/runtime/harness/run/resume.d.ts +6 -0
- package/dist/runtime/harness/run/resume.js +56 -0
- package/dist/runtime/harness/run/routing.d.ts +12 -0
- package/dist/runtime/harness/run/routing.js +47 -0
- package/dist/runtime/harness/run/run-lifecycle.d.ts +37 -0
- package/dist/runtime/harness/run/run-lifecycle.js +109 -0
- package/dist/runtime/harness/run/run-queue.d.ts +17 -0
- package/dist/runtime/harness/run/run-queue.js +43 -0
- package/dist/runtime/{health-monitor.d.ts → harness/system/health-monitor.d.ts} +3 -3
- package/dist/runtime/{health-monitor.js → harness/system/health-monitor.js} +2 -2
- package/dist/runtime/{inventory.d.ts → harness/system/inventory.d.ts} +2 -2
- package/dist/runtime/{inventory.js → harness/system/inventory.js} +4 -4
- package/dist/runtime/{policy-engine.d.ts → harness/system/policy-engine.d.ts} +1 -1
- package/dist/runtime/{policy-engine.js → harness/system/policy-engine.js} +1 -1
- package/dist/runtime/{skill-requirements.d.ts → harness/system/skill-requirements.d.ts} +1 -1
- package/dist/runtime/{skill-requirements.js → harness/system/skill-requirements.js} +1 -1
- package/dist/runtime/{thread-memory-sync.d.ts → harness/system/thread-memory-sync.d.ts} +2 -2
- package/dist/runtime/{thread-memory-sync.js → harness/system/thread-memory-sync.js} +1 -1
- package/dist/runtime/harness.d.ts +2 -7
- package/dist/runtime/harness.js +158 -477
- package/dist/runtime/index.d.ts +7 -7
- package/dist/runtime/index.js +7 -7
- package/dist/runtime/maintenance/checkpoint-maintenance.d.ts +45 -0
- package/dist/runtime/maintenance/checkpoint-maintenance.js +259 -0
- package/dist/runtime/maintenance/file-checkpoint-saver.d.ts +20 -0
- package/dist/runtime/maintenance/file-checkpoint-saver.js +106 -0
- package/dist/runtime/maintenance/index.d.ts +4 -0
- package/dist/runtime/maintenance/index.js +4 -0
- package/dist/runtime/{runtime-record-maintenance.d.ts → maintenance/runtime-record-maintenance.d.ts} +1 -1
- package/dist/runtime/{runtime-record-maintenance.js → maintenance/runtime-record-maintenance.js} +2 -2
- package/dist/runtime/maintenance/sqlite-maintained-checkpoint-saver.d.ts +9 -0
- package/dist/runtime/maintenance/sqlite-maintained-checkpoint-saver.js +39 -0
- package/dist/runtime/parsing/stream-event-parsing.d.ts +6 -0
- package/dist/runtime/parsing/stream-event-parsing.js +231 -0
- package/dist/runtime/sqlite-maintained-checkpoint-saver.d.ts +1 -9
- package/dist/runtime/sqlite-maintained-checkpoint-saver.js +1 -39
- package/dist/runtime/support/harness-support.d.ts +4 -4
- package/dist/runtime/support/harness-support.js +14 -3
- package/dist/runtime/support/runtime-factories.d.ts +1 -1
- package/dist/runtime/support/runtime-factories.js +1 -1
- package/dist/workspace/agent-binding-compiler.js +39 -3
- package/dist/workspace/object-loader.js +5 -1
- package/package.json +4 -4
- package/dist/runtime/langgraph-presets.js +0 -165
- package/dist/runtime/langgraph-profiles.js +0 -206
- /package/dist/runtime/{langgraph-presets.d.ts → adapter/langgraph/presets.d.ts} +0 -0
- /package/dist/runtime/{declared-middleware.js → adapter/tool/declared-middleware.js} +0 -0
- /package/dist/runtime/{tool-hitl.js → adapter/tool/tool-hitl.js} +0 -0
- /package/dist/runtime/{event-bus.js → harness/events/event-bus.js} +0 -0
- /package/dist/runtime/{store.d.ts → harness/system/store.d.ts} +0 -0
- /package/dist/runtime/{store.js → harness/system/store.js} +0 -0
|
@@ -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: "planner",
|
|
32
|
-
nodes: [
|
|
33
|
-
{ id: "planner", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
|
|
34
|
-
{ id: "coder", kind: "agent", agent: coderAgent },
|
|
35
|
-
{ id: "reviewer", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
|
|
36
|
-
{ id: "replanner", kind: "llm", role: "replanner", prompt: DEFAULT_REPLANNER_PROMPT },
|
|
37
|
-
...(needsVerification
|
|
38
|
-
? [{ id: "approval", kind: "approval" }, { id: "verifier", kind: "agent", agent: verifierAgent ?? coderAgent }]
|
|
39
|
-
: []),
|
|
40
|
-
{ id: "finalizer", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
|
|
41
|
-
],
|
|
42
|
-
edges: [
|
|
43
|
-
{ from: "planner", to: "coder" },
|
|
44
|
-
{ from: "coder", to: "reviewer", when: "has_result" },
|
|
45
|
-
{ from: "reviewer", to: needsVerification ? "approval" : "finalizer", when: "review_ok" },
|
|
46
|
-
{ from: "reviewer", to: "replanner", when: "review_incomplete" },
|
|
47
|
-
{ from: "replanner", to: "coder", when: "has_plan" },
|
|
48
|
-
...(needsVerification
|
|
49
|
-
? [
|
|
50
|
-
{ from: "approval", to: "verifier", when: "approval_approved" },
|
|
51
|
-
{ from: "approval", to: "verifier", when: "approval_edited" },
|
|
52
|
-
{ from: "verifier", to: "finalizer", 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: "intake",
|
|
65
|
-
nodes: [
|
|
66
|
-
{ id: "intake", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
|
|
67
|
-
...(worker ? [{ id: "worker", kind: "agent", agent: worker }] : [{ id: "lookup", kind: "tool", tool: "repo_inventory" }]),
|
|
68
|
-
{ id: "reviewer", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
|
|
69
|
-
{ id: "approval", kind: "approval" },
|
|
70
|
-
{ id: "finalizer", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
|
|
71
|
-
],
|
|
72
|
-
edges: [
|
|
73
|
-
{ from: "intake", to: worker ? "worker" : "lookup" },
|
|
74
|
-
{ from: worker ? "worker" : "lookup", to: "reviewer", when: "has_result" },
|
|
75
|
-
{ from: "reviewer", to: "approval", when: "review_incomplete" },
|
|
76
|
-
{ from: "reviewer", to: "finalizer", when: "review_ok" },
|
|
77
|
-
{ from: "approval", to: "finalizer", when: "approval_approved" },
|
|
78
|
-
{ from: "approval", to: "finalizer", 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: "planner",
|
|
88
|
-
nodes: [
|
|
89
|
-
{ id: "planner", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
|
|
90
|
-
{ id: "gatherer", kind: "agent", agent: gathererAgent },
|
|
91
|
-
{ id: "coverage-review", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
|
|
92
|
-
{ id: "analyst", kind: "agent", agent: analystAgent },
|
|
93
|
-
...(synthesizerAgent ? [{ id: "synthesizer", kind: "agent", agent: synthesizerAgent }] : []),
|
|
94
|
-
{ id: "finalizer", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
|
|
95
|
-
],
|
|
96
|
-
edges: [
|
|
97
|
-
{ from: "planner", to: "gatherer" },
|
|
98
|
-
{ from: "gatherer", to: "coverage-review", when: "has_result" },
|
|
99
|
-
{ from: "coverage-review", to: "analyst", when: "review_ok" },
|
|
100
|
-
{ from: "coverage-review", to: "gatherer", when: "review_incomplete" },
|
|
101
|
-
{ from: "analyst", to: synthesizerAgent ? "synthesizer" : "finalizer", when: "has_result" },
|
|
102
|
-
...(synthesizerAgent ? [{ from: "synthesizer", to: "finalizer", 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: "scope",
|
|
111
|
-
nodes: [
|
|
112
|
-
{ id: "scope", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
|
|
113
|
-
{ id: "preparer", kind: "agent", agent: preparerAgent },
|
|
114
|
-
...(reviewerAgent ? [{ id: "reviewer-agent", kind: "agent", agent: reviewerAgent }] : [{ id: "risk-review", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT }]),
|
|
115
|
-
{ id: "approval", kind: "approval" },
|
|
116
|
-
{ id: "finalizer", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
|
|
117
|
-
],
|
|
118
|
-
edges: [
|
|
119
|
-
{ from: "scope", to: "preparer" },
|
|
120
|
-
{ from: "preparer", to: reviewerAgent ? "reviewer-agent" : "risk-review", when: "has_result" },
|
|
121
|
-
{ from: reviewerAgent ? "reviewer-agent" : "risk-review", to: "approval", when: "has_result" },
|
|
122
|
-
{ from: "approval", to: "finalizer", when: "approval_approved" },
|
|
123
|
-
{ from: "approval", to: "finalizer", 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: "router",
|
|
137
|
-
nodes: [
|
|
138
|
-
{ id: "router", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
|
|
139
|
-
{ id: "worker", kind: "agent", agent: routedAgent },
|
|
140
|
-
{ id: "finalizer", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
|
|
141
|
-
],
|
|
142
|
-
edges: [
|
|
143
|
-
{ from: "router", to: "worker" },
|
|
144
|
-
{ from: "worker", to: "finalizer", when: "has_result" },
|
|
145
|
-
],
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function buildCopilotSidecarWorkflow(options) {
|
|
149
|
-
const coderAgent = requireAgentOption("copilot-sidecar", options, "coderAgent");
|
|
150
|
-
return {
|
|
151
|
-
entryNode: "intake",
|
|
152
|
-
nodes: [
|
|
153
|
-
{ id: "intake", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
|
|
154
|
-
{ id: "coder", kind: "agent", agent: coderAgent },
|
|
155
|
-
{ id: "finalizer", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
|
|
156
|
-
],
|
|
157
|
-
edges: [
|
|
158
|
-
{ from: "intake", to: "coder" },
|
|
159
|
-
{ from: "coder", to: "finalizer", 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: "router",
|
|
170
|
-
nodes: [
|
|
171
|
-
{ id: "router", kind: "llm", role: "planner", prompt: DEFAULT_PLANNER_PROMPT },
|
|
172
|
-
{ id: "worker", kind: "agent", agent: workerAgent },
|
|
173
|
-
{ id: "reviewer", kind: "llm", role: "reviewer", prompt: DEFAULT_REVIEWER_PROMPT },
|
|
174
|
-
{ id: "finalizer", kind: "llm", role: "finalizer", prompt: DEFAULT_FINALIZER_PROMPT },
|
|
175
|
-
],
|
|
176
|
-
edges: [
|
|
177
|
-
{ from: "router", to: "worker" },
|
|
178
|
-
{ from: "worker", to: "reviewer", when: "has_result" },
|
|
179
|
-
{ from: "reviewer", to: "finalizer", 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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|