@botbotgo/agent-harness 0.0.451 → 0.0.453
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/adapter/middleware-assembly.js +0 -3
- package/dist/runtime/adapter/tool/builtin-middleware-tools.d.ts +0 -9
- package/dist/runtime/adapter/tool/builtin-middleware-tools.js +0 -38
- package/dist/runtime/agent-runtime-adapter.js +3 -3
- package/dist/runtime/agent-runtime-assembly.d.ts +3 -2
- package/dist/runtime/agent-runtime-assembly.js +7 -41
- package/dist/scaffold/init-project.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.453";
|
|
2
2
|
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
package/dist/package-version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.453";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
|
@@ -799,15 +799,12 @@ export async function resolveBuiltinMiddlewareTools(input) {
|
|
|
799
799
|
if (builtinTools.filesystem === false) {
|
|
800
800
|
for (const name of [
|
|
801
801
|
"ls",
|
|
802
|
-
"list_files",
|
|
803
802
|
"read_file",
|
|
804
803
|
"write_file",
|
|
805
804
|
"edit_file",
|
|
806
805
|
"glob",
|
|
807
806
|
"grep",
|
|
808
|
-
"search_files",
|
|
809
807
|
"execute",
|
|
810
|
-
"run_command",
|
|
811
808
|
]) {
|
|
812
809
|
tools.delete(name);
|
|
813
810
|
}
|
|
@@ -201,9 +201,6 @@ export declare const BUILTIN_MIDDLEWARE_TOOL_DESCRIPTORS: readonly [{
|
|
|
201
201
|
}, {
|
|
202
202
|
readonly name: "ls";
|
|
203
203
|
readonly description: "List files in a directory.";
|
|
204
|
-
}, {
|
|
205
|
-
readonly name: "list_files";
|
|
206
|
-
readonly description: "List files in a directory.";
|
|
207
204
|
}, {
|
|
208
205
|
readonly name: "read_file";
|
|
209
206
|
readonly description: "Read a file from the workspace filesystem.";
|
|
@@ -219,15 +216,9 @@ export declare const BUILTIN_MIDDLEWARE_TOOL_DESCRIPTORS: readonly [{
|
|
|
219
216
|
}, {
|
|
220
217
|
readonly name: "grep";
|
|
221
218
|
readonly description: "Search for text across workspace files.";
|
|
222
|
-
}, {
|
|
223
|
-
readonly name: "search_files";
|
|
224
|
-
readonly description: "Search for text across workspace files.";
|
|
225
219
|
}, {
|
|
226
220
|
readonly name: "execute";
|
|
227
221
|
readonly description: "Run a shell command in the workspace sandbox.";
|
|
228
|
-
}, {
|
|
229
|
-
readonly name: "run_command";
|
|
230
|
-
readonly description: "Run a shell command in the workspace sandbox.";
|
|
231
222
|
}, {
|
|
232
223
|
readonly name: "fetch_url";
|
|
233
224
|
readonly description: "Fetch a URL and return the response body.";
|
|
@@ -35,15 +35,12 @@ export const BUILTIN_MIDDLEWARE_TOOL_DESCRIPTORS = [
|
|
|
35
35
|
{ name: "write_todos", description: "Create and update the runtime todo board for multi-step work." },
|
|
36
36
|
{ name: "read_todos", description: "Read the current runtime todo board." },
|
|
37
37
|
{ name: "ls", description: "List files in a directory." },
|
|
38
|
-
{ name: "list_files", description: "List files in a directory." },
|
|
39
38
|
{ name: "read_file", description: "Read a file from the workspace filesystem." },
|
|
40
39
|
{ name: "write_file", description: "Write a file in the workspace filesystem." },
|
|
41
40
|
{ name: "edit_file", description: "Replace exact text inside a workspace file." },
|
|
42
41
|
{ name: "glob", description: "Find files matching a glob pattern." },
|
|
43
42
|
{ name: "grep", description: "Search for text across workspace files." },
|
|
44
|
-
{ name: "search_files", description: "Search for text across workspace files." },
|
|
45
43
|
{ name: "execute", description: "Run a shell command in the workspace sandbox." },
|
|
46
|
-
{ name: "run_command", description: "Run a shell command in the workspace sandbox." },
|
|
47
44
|
{ name: "fetch_url", description: "Fetch a URL and return the response body." },
|
|
48
45
|
{ name: "http_request", description: "Send a structured HTTP request." },
|
|
49
46
|
{ name: "send_message", description: "Send a message through the configured backend." },
|
|
@@ -70,15 +67,12 @@ export function filterBuiltinMiddlewareToolDescriptors(options) {
|
|
|
70
67
|
if (options?.filesystem === false
|
|
71
68
|
&& [
|
|
72
69
|
"ls",
|
|
73
|
-
"list_files",
|
|
74
70
|
"read_file",
|
|
75
71
|
"write_file",
|
|
76
72
|
"edit_file",
|
|
77
73
|
"glob",
|
|
78
74
|
"grep",
|
|
79
|
-
"search_files",
|
|
80
75
|
"execute",
|
|
81
|
-
"run_command",
|
|
82
76
|
].includes(descriptor.name)) {
|
|
83
77
|
return false;
|
|
84
78
|
}
|
|
@@ -330,12 +324,6 @@ export async function createBuiltinMiddlewareTools(backend, options) {
|
|
|
330
324
|
return finalizeOutput("ls", truncateLines(infos.map((info) => info.is_dir ? `${info.path} (directory)` : `${info.path}${info.size ? ` (${info.size} bytes)` : ""}`)), toolConfig);
|
|
331
325
|
},
|
|
332
326
|
});
|
|
333
|
-
tools.set("list_files", {
|
|
334
|
-
name: "list_files",
|
|
335
|
-
description: "List files in a directory.",
|
|
336
|
-
schema: z.object({ path: z.string().optional().default("/") }).passthrough(),
|
|
337
|
-
invoke: async (input, toolConfig) => tools.get("ls").invoke(input, toolConfig),
|
|
338
|
-
});
|
|
339
327
|
tools.set("read_file", {
|
|
340
328
|
name: "read_file",
|
|
341
329
|
description: "Read a file from the workspace filesystem.",
|
|
@@ -438,26 +426,6 @@ export async function createBuiltinMiddlewareTools(backend, options) {
|
|
|
438
426
|
return truncateLines(lines);
|
|
439
427
|
},
|
|
440
428
|
});
|
|
441
|
-
tools.set("search_files", {
|
|
442
|
-
name: "search_files",
|
|
443
|
-
description: "Search for text across workspace files.",
|
|
444
|
-
schema: z.object({
|
|
445
|
-
query: z.string(),
|
|
446
|
-
path: z.string().optional().default("/"),
|
|
447
|
-
glob: z.string().nullable().optional(),
|
|
448
|
-
search_type: z.enum(["content", "path"]).optional().default("content"),
|
|
449
|
-
}).passthrough(),
|
|
450
|
-
invoke: async (input) => {
|
|
451
|
-
const typed = isRecord(input) ? input : {};
|
|
452
|
-
const query = typeof typed.query === "string" ? typed.query : "";
|
|
453
|
-
const searchPath = normalizeWorkspacePathOrThrow(pathScopedBackend, typeof typed.path === "string" ? typed.path : "/");
|
|
454
|
-
const globPattern = typeof typed.glob === "string" ? typed.glob : null;
|
|
455
|
-
const searchType = typed.search_type === "path" ? "path" : "content";
|
|
456
|
-
return searchType === "path"
|
|
457
|
-
? tools.get("glob").invoke({ pattern: query, path: searchPath })
|
|
458
|
-
: tools.get("grep").invoke({ pattern: query, path: searchPath, glob: globPattern });
|
|
459
|
-
},
|
|
460
|
-
});
|
|
461
429
|
tools.set("execute", {
|
|
462
430
|
name: "execute",
|
|
463
431
|
description: "Run a shell command in the workspace sandbox.",
|
|
@@ -478,12 +446,6 @@ export async function createBuiltinMiddlewareTools(backend, options) {
|
|
|
478
446
|
return finalizeOutput("execute", parts.join(""), toolConfig);
|
|
479
447
|
},
|
|
480
448
|
});
|
|
481
|
-
tools.set("run_command", {
|
|
482
|
-
name: "run_command",
|
|
483
|
-
description: "Run a shell command in the workspace sandbox.",
|
|
484
|
-
schema: z.object({ command: z.string() }).passthrough(),
|
|
485
|
-
invoke: async (input, toolConfig) => tools.get("execute").invoke(input, toolConfig),
|
|
486
|
-
});
|
|
487
449
|
tools.set("fetch_url", {
|
|
488
450
|
name: "fetch_url",
|
|
489
451
|
description: "Fetch a URL and return the response body.",
|
|
@@ -5,7 +5,7 @@ import { createAgent, humanInTheLoopMiddleware, todoListMiddleware } from "langc
|
|
|
5
5
|
import { sanitizeVisibleText, tryParseJson, wrapResolvedModel, } from "./parsing/output-parsing.js";
|
|
6
6
|
import { salvageJsonToolCalls } from "./parsing/output-tool-args.js";
|
|
7
7
|
import { extractMessageText } from "../utils/message-content.js";
|
|
8
|
-
import { AGENT_INTERRUPT_SENTINEL_PREFIX, buildDeepAgentCreateParams,
|
|
8
|
+
import { AGENT_INTERRUPT_SENTINEL_PREFIX, buildDeepAgentCreateParams, buildDeepAgentSystemPromptWithCapabilityCatalog, buildLangChainCreateParams, DEFAULT_DEEPAGENT_RECURSION_LIMIT, materializeModelExposedBuiltinMiddlewareTools, resolveLangChainInvocationConfig, resolveRunnableCheckpointer, resolveRunnableInterruptOn, shouldAttachDeepAgentBackend, shouldAttachDeepAgentCheckpointer, shouldAttachDeepAgentStore, } from "./agent-runtime-assembly.js";
|
|
9
9
|
import { resolveDeepAgentSkillSourcePaths, resolveDeepAgentSkillSourceRootPaths, } from "./adapter/compat/deepagent-compat.js";
|
|
10
10
|
import { EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION } from "./prompts/runtime-prompts.js";
|
|
11
11
|
import { buildToolNameMapping, } from "./adapter/tool/tool-name-mapping.js";
|
|
@@ -921,7 +921,7 @@ export class AgentRuntimeAdapter {
|
|
|
921
921
|
: undefined;
|
|
922
922
|
return createDeepAgent({
|
|
923
923
|
model: input.resolvedModel,
|
|
924
|
-
systemPrompt:
|
|
924
|
+
systemPrompt: buildDeepAgentSystemPromptWithCapabilityCatalog({
|
|
925
925
|
systemPrompt: getBindingSystemPrompt(binding),
|
|
926
926
|
subagents: input.resolvedSubagents,
|
|
927
927
|
skills: input.resolvedSkills,
|
|
@@ -984,7 +984,7 @@ export class AgentRuntimeAdapter {
|
|
|
984
984
|
: undefined;
|
|
985
985
|
return createAgent({
|
|
986
986
|
model: input.resolvedModel,
|
|
987
|
-
systemPrompt:
|
|
987
|
+
systemPrompt: buildDeepAgentSystemPromptWithCapabilityCatalog({
|
|
988
988
|
systemPrompt: getBindingSystemPrompt(binding),
|
|
989
989
|
subagents: input.resolvedSubagents,
|
|
990
990
|
skills: input.resolvedSkills,
|
|
@@ -9,7 +9,7 @@ export declare function materializeModelExposedBuiltinMiddlewareTools(input: {
|
|
|
9
9
|
modelExposed?: boolean | string[];
|
|
10
10
|
}): unknown[];
|
|
11
11
|
export declare function buildRuntimeTemporalContext(now?: Date): string;
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function buildDeepAgentSystemPromptWithCapabilityCatalog(input: {
|
|
13
13
|
systemPrompt?: unknown;
|
|
14
14
|
subagents: Array<Pick<UpstreamSubagentConfig, "name" | "description"> | Pick<CompiledAsyncSubAgent, "name" | "description">>;
|
|
15
15
|
skills?: string[];
|
|
@@ -18,7 +18,8 @@ export declare function buildDeepAgentSystemPromptWithCapabilityHierarchy(input:
|
|
|
18
18
|
description?: string;
|
|
19
19
|
}>;
|
|
20
20
|
}): unknown;
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const buildDeepAgentSystemPromptWithCapabilityHierarchy: typeof buildDeepAgentSystemPromptWithCapabilityCatalog;
|
|
22
|
+
export declare const buildDeepAgentSystemPromptWithSubagentCatalog: typeof buildDeepAgentSystemPromptWithCapabilityCatalog;
|
|
22
23
|
export declare function resolveRunnableCheckpointer(options: RuntimeAdapterOptions, binding: CompiledAgentBinding): unknown;
|
|
23
24
|
export declare function resolveRunnableInterruptOn(binding: CompiledAgentBinding): Record<string, {
|
|
24
25
|
allowedDecisions: import("./adapter/tool/interrupt-policy.js").InterruptDecision[];
|
|
@@ -6,11 +6,6 @@ import { readSkillMetadata } from "./skills/skill-metadata.js";
|
|
|
6
6
|
import { getBindingBackendConfig, getBindingExecutionKind, getBindingExecutionParams, getBindingInterruptCompatibilityRules, getBindingMemorySources, getBindingMiddlewareConfigs, getBindingPrimaryTools, getBindingSkills, getBindingStoreConfig, } from "./support/compiled-binding.js";
|
|
7
7
|
export const AGENT_INTERRUPT_SENTINEL_PREFIX = "__agent_harness_interrupt__:";
|
|
8
8
|
export const DEFAULT_DEEPAGENT_RECURSION_LIMIT = 100;
|
|
9
|
-
const BUILTIN_MIDDLEWARE_ALIAS_TOOL_NAMES = new Set([
|
|
10
|
-
"list_files",
|
|
11
|
-
"search_files",
|
|
12
|
-
"run_command",
|
|
13
|
-
]);
|
|
14
9
|
const MODEL_EXPOSED_BUILTIN_MIDDLEWARE_TOOL_NAMES = new Set([
|
|
15
10
|
"fetch_url",
|
|
16
11
|
"http_request",
|
|
@@ -29,7 +24,6 @@ export function materializeModelExposedBuiltinMiddlewareTools(input) {
|
|
|
29
24
|
const tools = [];
|
|
30
25
|
for (const [toolName, tool] of input.builtinTools.entries()) {
|
|
31
26
|
if (explicitToolNames.has(toolName)
|
|
32
|
-
|| BUILTIN_MIDDLEWARE_ALIAS_TOOL_NAMES.has(toolName)
|
|
33
27
|
|| !MODEL_EXPOSED_BUILTIN_MIDDLEWARE_TOOL_NAMES.has(toolName)
|
|
34
28
|
|| (allowedToolNames && !allowedToolNames.has(toolName))) {
|
|
35
29
|
continue;
|
|
@@ -68,31 +62,23 @@ function appendRuntimeTemporalContext(systemPrompt) {
|
|
|
68
62
|
.filter((part) => typeof part === "string" && part.length > 0)
|
|
69
63
|
.join("\n\n");
|
|
70
64
|
}
|
|
71
|
-
export function
|
|
65
|
+
export function buildDeepAgentSystemPromptWithCapabilityCatalog(input) {
|
|
72
66
|
const basePrompt = typeof input.systemPrompt === "string" ? input.systemPrompt : undefined;
|
|
73
67
|
const skills = buildSkillCatalog(input.skills ?? []);
|
|
74
68
|
const tools = input.tools ?? [];
|
|
75
|
-
const hasNoConfiguredCapabilities = input.subagents.length === 0 && skills.length === 0 && tools.length === 0;
|
|
76
|
-
const isDelegationOnly = input.subagents.length > 0 && skills.length === 0 && tools.length === 0;
|
|
77
69
|
const catalogPrompt = [
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"3. Use raw tools as execution primitives for the selected agent or skill, or when no listed skill applies.",
|
|
82
|
-
"Keep each selection inside the selected capability's described responsibility boundary.",
|
|
83
|
-
"If no listed subagent, skill, or tool can responsibly handle the request, do not invent a path. Return a terminal response with status \"refused\" and explain the missing capability.",
|
|
84
|
-
"If a selected capability cannot complete after using its available tools, return a terminal response with status \"blocked\" or \"failed\" and include the blocker evidence.",
|
|
70
|
+
"Runtime capability catalog:",
|
|
71
|
+
"The runtime has configured the following available subagents, skills, and raw tools for this agent.",
|
|
72
|
+
"Use the configured capability descriptions and upstream DeepAgents tool semantics to decide how to proceed.",
|
|
85
73
|
...(input.subagents.length > 0
|
|
86
74
|
? [
|
|
87
75
|
"",
|
|
88
76
|
"Available subagents for task delegation:",
|
|
89
77
|
...input.subagents.map(formatCapabilityLine),
|
|
90
|
-
"",
|
|
91
|
-
"When using the task tool, set subagent_type to exactly one of the listed subagent names. Do not create, translate, alias, or modify subagent names.",
|
|
92
78
|
]
|
|
93
79
|
: [
|
|
94
80
|
"",
|
|
95
|
-
"
|
|
81
|
+
"Available subagents for task delegation: none.",
|
|
96
82
|
]),
|
|
97
83
|
...(skills.length > 0
|
|
98
84
|
? [
|
|
@@ -113,33 +99,13 @@ export function buildDeepAgentSystemPromptWithCapabilityHierarchy(input) {
|
|
|
113
99
|
: [
|
|
114
100
|
"",
|
|
115
101
|
"Raw tools available to this agent: none.",
|
|
116
|
-
"Do not mention, offer, or claim any raw tool that is not listed here.",
|
|
117
102
|
]),
|
|
118
|
-
...(hasNoConfiguredCapabilities
|
|
119
|
-
? [
|
|
120
|
-
"",
|
|
121
|
-
"No-capability terminal rule:",
|
|
122
|
-
"This agent currently has no configured subagents, skills, or raw tools.",
|
|
123
|
-
"For requests that require execution, retrieval, live data, workspace inspection, or external evidence, return a direct refusal based on the missing configured capability.",
|
|
124
|
-
"Do not propose a tool-based next step, do not name any unlisted tool, and do not ask the user for links so this agent can fetch them.",
|
|
125
|
-
"The only valid next step is for the workspace owner to attach an appropriate subagent, skill, or tool and retry.",
|
|
126
|
-
]
|
|
127
|
-
: []),
|
|
128
|
-
...(isDelegationOnly
|
|
129
|
-
? [
|
|
130
|
-
"",
|
|
131
|
-
"Delegation-only mode:",
|
|
132
|
-
"This agent has specialist subagents but no direct execution skills or raw tools.",
|
|
133
|
-
"For any request that fits a listed subagent, the first assistant response must be a task tool call only.",
|
|
134
|
-
"Do not write a natural-language promise such as saying you will use a subagent. Actually call the task tool.",
|
|
135
|
-
"If no listed subagent fits, return a final refusal instead of answering locally.",
|
|
136
|
-
]
|
|
137
|
-
: []),
|
|
138
103
|
"",
|
|
139
104
|
].join("\n");
|
|
140
105
|
return appendRuntimeTemporalContext([basePrompt, catalogPrompt].filter((part) => typeof part === "string" && part.length > 0).join("\n\n"));
|
|
141
106
|
}
|
|
142
|
-
export const
|
|
107
|
+
export const buildDeepAgentSystemPromptWithCapabilityHierarchy = buildDeepAgentSystemPromptWithCapabilityCatalog;
|
|
108
|
+
export const buildDeepAgentSystemPromptWithSubagentCatalog = buildDeepAgentSystemPromptWithCapabilityCatalog;
|
|
143
109
|
export function resolveRunnableCheckpointer(options, binding) {
|
|
144
110
|
return options.checkpointerResolver ? options.checkpointerResolver(binding) : new MemorySaver();
|
|
145
111
|
}
|
|
@@ -511,7 +511,7 @@ description: Inspect the current workspace before making claims or edits.
|
|
|
511
511
|
|
|
512
512
|
# Workspace Inspection
|
|
513
513
|
|
|
514
|
-
1. Start with lightweight discovery such as \`
|
|
514
|
+
1. Start with lightweight discovery such as \`ls\`, \`glob\`, or \`grep\`.
|
|
515
515
|
2. Read only the files needed to establish the relevant facts.
|
|
516
516
|
3. Ground each conclusion in inspected workspace evidence instead of guesses.
|
|
517
517
|
4. If the workspace does not contain the needed evidence, say that plainly before proposing a next step.
|