@botbotgo/agent-harness 0.0.111 → 0.0.112

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 (45) hide show
  1. package/README.md +0 -2
  2. package/README.zh.md +0 -2
  3. package/dist/config/agents/direct.yaml +58 -59
  4. package/dist/config/agents/orchestra.yaml +68 -70
  5. package/dist/contracts/core.d.ts +0 -2
  6. package/dist/contracts/runtime.d.ts +0 -17
  7. package/dist/contracts/workspace.d.ts +2 -7
  8. package/dist/init-project.js +10 -8
  9. package/dist/package-version.d.ts +1 -1
  10. package/dist/package-version.js +1 -1
  11. package/dist/persistence/file-store.d.ts +1 -5
  12. package/dist/persistence/file-store.js +1 -34
  13. package/dist/runtime/adapter/compat/deepagent-compat.d.ts +6 -0
  14. package/dist/runtime/adapter/compat/deepagent-compat.js +3 -0
  15. package/dist/runtime/adapter/{execution-context.d.ts → flow/execution-context.d.ts} +17 -3
  16. package/dist/runtime/adapter/{execution-context.js → flow/execution-context.js} +20 -2
  17. package/dist/runtime/adapter/flow/invocation-flow.d.ts +24 -0
  18. package/dist/runtime/adapter/flow/invocation-flow.js +42 -0
  19. package/dist/runtime/adapter/{invoke-runtime.d.ts → flow/invoke-runtime.d.ts} +3 -3
  20. package/dist/runtime/adapter/{invoke-runtime.js → flow/invoke-runtime.js} +1 -1
  21. package/dist/runtime/adapter/flow/runnable-assembly.d.ts +51 -0
  22. package/dist/runtime/adapter/flow/runnable-assembly.js +52 -0
  23. package/dist/runtime/adapter/{stream-runtime.d.ts → flow/stream-runtime.d.ts} +3 -3
  24. package/dist/runtime/adapter/{stream-runtime.js → flow/stream-runtime.js} +6 -6
  25. package/dist/runtime/adapter/middleware-assembly.d.ts +1 -1
  26. package/dist/runtime/adapter/middleware-assembly.js +5 -8
  27. package/dist/runtime/adapter/runnable-config.d.ts +0 -2
  28. package/dist/runtime/adapter/runnable-config.js +0 -2
  29. package/dist/runtime/adapter/runtime-adapter-support.d.ts +0 -7
  30. package/dist/runtime/adapter/runtime-adapter-support.js +1 -20
  31. package/dist/runtime/adapter/runtime-shell.js +1 -1
  32. package/dist/runtime/adapter/tool/builtin-middleware-tools.js +10 -9
  33. package/dist/runtime/adapter/tool-resolution.d.ts +1 -1
  34. package/dist/runtime/agent-runtime-adapter.d.ts +1 -1
  35. package/dist/runtime/agent-runtime-adapter.js +52 -81
  36. package/dist/runtime/harness/system/inventory.d.ts +2 -2
  37. package/dist/runtime/harness/system/inventory.js +5 -6
  38. package/dist/runtime/parsing/stream-event-parsing.js +2 -2
  39. package/dist/runtime/support/compiled-binding.d.ts +1 -2
  40. package/dist/runtime/support/compiled-binding.js +0 -3
  41. package/dist/workspace/agent-binding-compiler.js +2 -22
  42. package/dist/workspace/object-loader.js +94 -23
  43. package/dist/workspace/support/workspace-ref-utils.d.ts +1 -2
  44. package/dist/workspace/support/workspace-ref-utils.js +0 -12
  45. package/package.json +1 -1
package/README.md CHANGED
@@ -625,8 +625,6 @@ spec:
625
625
  ref: backend/default
626
626
  interruptOn: {}
627
627
  middleware: []
628
- generalPurposeAgent: true
629
- taskDescription: Complete delegated sidecar work and return concise results without bloating the parent context.
630
628
  ```
631
629
 
632
630
  For backend-specific options, prefer the upstream concept directly inside `spec.execution.config`. Upstream feature coverage is tracked in [docs/upstream-feature-matrix.md](docs/upstream-feature-matrix.md).
package/README.zh.md CHANGED
@@ -622,8 +622,6 @@ spec:
622
622
  ref: backend/default
623
623
  interruptOn: {}
624
624
  middleware: []
625
- generalPurposeAgent: true
626
- taskDescription: Complete delegated sidecar work and return concise results without bloating the parent context.
627
625
  ```
628
626
 
629
627
  后端相关选项优先直接写在 `spec.execution.config` 中沿用上游概念。上游能力覆盖见 [docs/upstream-feature-matrix.md](docs/upstream-feature-matrix.md)。
@@ -7,12 +7,15 @@ metadata:
7
7
  # agent-harness feature: stable object id used for refs and host-agent selection.
8
8
  name: direct
9
9
  # agent-harness feature: human-readable summary for inventory and UI.
10
- description: Manual low-latency host for direct answers and lightweight inventory lookup. Do not use it as the default executor for tool-heavy or specialist-shaped tasks.
10
+ description: Manual low-latency host for direct answers and lightweight inventory lookup. Do not use it as the default executor for tool-heavy or delegation-heavy tasks.
11
11
  spec:
12
12
  runtime:
13
13
  # agent-harness feature: host-level run data placement override.
14
14
  # This matches the workspace default and keeps the default config shape explicit.
15
15
  runRoot: ./.agent
16
+ # agent-harness feature: workspace-level durable long-term memory defaults for this host profile.
17
+ runtimeMemory:
18
+ ref: runtime-memory/default
16
19
  # =====================
17
20
  # Runtime Agent Features
18
21
  # =====================
@@ -29,65 +32,61 @@ spec:
29
32
  skills: []
30
33
  # Upstream execution feature: direct host does not bootstrap project memory by default.
31
34
  memory: []
32
- # Upstream execution feature: direct host does not predeclare specialist subagents by default.
35
+ # Upstream execution feature: direct host does not predeclare subagents by default.
33
36
  subagents: []
34
37
  # Upstream execution feature: direct host does not attach MCP servers by default.
35
38
  mcpServers: []
36
- config:
37
- # Runtime execution feature: checkpointer config passed into the selected backend adapter.
38
- # Even the lightweight direct path can benefit from resumable state during interactive use.
39
- # Available `kind` options in this harness: `FileCheckpointer`, `MemorySaver`, `SqliteSaver`.
40
- # `path` is only used by `FileCheckpointer` and `SqliteSaver`; omit it for `MemorySaver`.
41
- checkpointer:
42
- ref: checkpointer/sqlite
43
- # Upstream execution feature: LangGraph store available to middleware and runtime context hooks.
44
- # The default direct host keeps this enabled so middleware can use the same durable store surface as other hosts.
45
- store:
46
- ref: store/default
47
- # agent-harness feature: workspace-level durable long-term memory defaults for this host profile.
48
- runtimeMemory:
49
- ref: runtime-memory/default
50
- # Upstream execution feature: no declarative HITL tool routing by default.
51
- interruptOn: {}
52
- # Upstream execution feature: filesystem middleware settings for LangChain v1 agents.
53
- # This only becomes active when `middleware` includes `{ kind: filesystem }`, or when
54
- # automatic upstream middleware such as skills or memory need a filesystem backend.
55
- # Keep the default root inside the workspace so file-aware middleware stays bounded.
56
- filesystem:
57
- rootDir: .
58
- virtualMode: true
59
- maxFileSizeMb: 10
60
- # Upstream execution feature: no extra declarative middleware beyond the runtime's automatic injections.
61
- # Common upstream middleware kinds that this harness can compile directly from YAML:
62
- # - `filesystem`
63
- # - `patchToolCalls`
64
- # - `summarization`
65
- # - `dynamicSystemPrompt`
66
- # - `humanInTheLoop`
67
- # - `todoList`
68
- # - `pii`, `piiRedaction`
69
- #
70
- # Keep the default empty so the lightweight direct host stays minimal.
71
- middleware: []
72
- # Upstream execution feature: system prompt for the lightweight direct-response host.
73
- # This prompt should keep the agent focused on:
74
- # - answering simple requests in one turn
75
- # - staying lightweight instead of planning or orchestrating
76
- # - avoiding specialist-style decomposition unless the caller explicitly switches agents
77
- #
78
- # The direct host is intentionally narrower than the orchestra host:
79
- # - `direct` is optimized for latency and straightforward completion
80
- # - `orchestra` is optimized for multi-step work, tools, delegation, and specialist use
81
- #
82
- # Keep this prompt biased toward concise, self-contained answers. If richer routing policy is
83
- # needed for choosing between host agents, configure that separately via `Runtime.spec.routing`
84
- # rather than overloading the direct host prompt with classifier behavior.
85
- systemPrompt: |-
86
- You are the direct agent.
39
+ # Runtime execution feature: checkpointer config passed into the selected backend adapter.
40
+ # Even the lightweight direct path can benefit from resumable state during interactive use.
41
+ # Available `kind` options in this harness: `FileCheckpointer`, `MemorySaver`, `SqliteSaver`.
42
+ # `path` is only used by `FileCheckpointer` and `SqliteSaver`; omit it for `MemorySaver`.
43
+ checkpointer:
44
+ ref: checkpointer/sqlite
45
+ # Upstream execution feature: LangGraph store available to middleware and runtime context hooks.
46
+ # The default direct host keeps this enabled so middleware can use the same durable store surface as other hosts.
47
+ store:
48
+ ref: store/default
49
+ # Upstream execution feature: no declarative HITL tool routing by default.
50
+ interruptOn: {}
51
+ # Upstream execution feature: filesystem middleware settings for LangChain v1 agents.
52
+ # This only becomes active when `middleware` includes `{ kind: filesystem }`, or when
53
+ # automatic upstream middleware such as skills or memory need a filesystem backend.
54
+ # Keep the default root inside the workspace so file-aware middleware stays bounded.
55
+ filesystem:
56
+ rootDir: .
57
+ virtualMode: true
58
+ maxFileSizeMb: 10
59
+ # Upstream execution feature: no extra declarative middleware beyond the runtime's automatic injections.
60
+ # Common upstream middleware kinds that this harness can compile directly from YAML:
61
+ # - `filesystem`
62
+ # - `patchToolCalls`
63
+ # - `summarization`
64
+ # - `dynamicSystemPrompt`
65
+ # - `humanInTheLoop`
66
+ # - `todoList`
67
+ # - `pii`, `piiRedaction`
68
+ #
69
+ # Keep the default empty so the lightweight direct host stays minimal.
70
+ middleware: []
71
+ # Upstream execution feature: system prompt for the lightweight direct-response host.
72
+ # This prompt should keep the agent focused on:
73
+ # - answering simple requests in one turn
74
+ # - staying lightweight instead of planning or orchestrating
75
+ # - avoiding delegation-heavy decomposition unless the caller explicitly switches agents
76
+ #
77
+ # The direct host is intentionally narrower than the orchestra host:
78
+ # - `direct` is optimized for latency and straightforward completion
79
+ # - `orchestra` is optimized for multi-step work, tools, and delegation
80
+ #
81
+ # Keep this prompt biased toward concise, self-contained answers. If richer routing policy is
82
+ # needed for choosing between host agents, configure that separately via `Runtime.spec.routing`
83
+ # rather than overloading the direct host prompt with classifier behavior.
84
+ systemPrompt: |-
85
+ You are the direct agent.
87
86
 
88
- This is a manual low-latency host.
89
- Answer simple requests directly.
90
- Keep the path lightweight.
91
- Do not delegate.
92
- Do not perform broad multi-step execution.
93
- Do not behave like the default execution host.
87
+ This is a manual low-latency host.
88
+ Answer simple requests directly.
89
+ Keep the path lightweight.
90
+ Do not delegate.
91
+ Do not perform broad multi-step execution.
92
+ Do not behave like the default execution host.
@@ -7,12 +7,15 @@ metadata:
7
7
  # agent-harness feature: stable object id used for refs and runtime naming.
8
8
  name: orchestra
9
9
  # agent-harness feature: human-readable summary for inventory and UI.
10
- description: Default execution host. Answer directly when possible, use local tools and skills first, and delegate only when a specialist is a better fit. Not a reflex delegation-only planner.
10
+ description: Default execution host. Answer directly when possible, use local tools and skills first, and delegate only when a subagent is a better fit. Not a reflex delegation-only orchestrator.
11
11
  spec:
12
12
  runtime:
13
13
  # agent-harness feature: host-level run data placement override.
14
14
  # This matches the workspace default and keeps the default config shape explicit.
15
15
  runRoot: ./.agent
16
+ # agent-harness feature: workspace-level durable long-term memory defaults for this host profile.
17
+ runtimeMemory:
18
+ ref: runtime-memory/default
16
19
  # =====================
17
20
  # Runtime Agent Features
18
21
  # =====================
@@ -36,84 +39,79 @@ spec:
36
39
  tools: []
37
40
  # Upstream execution feature: top-level host starts with no explicit skill package refs in the default workspace.
38
41
  skills: []
39
- # Upstream execution feature: specialist topology is empty in the repository default and can be filled in YAML.
42
+ # Upstream execution feature: subagent topology is empty in the repository default and can be filled in YAML.
40
43
  subagents: []
41
44
  # Upstream execution feature: host-level MCP servers are opt-in and empty by default.
42
45
  mcpServers: []
46
+ # Runtime execution feature: checkpointer config passed into the selected backend adapter.
47
+ # This persists resumable graph state for this agent.
48
+ # Available `kind` options in this harness: `FileCheckpointer`, `MemorySaver`, `SqliteSaver`.
49
+ # `path` is only used by `FileCheckpointer` and `SqliteSaver`; omit it for `MemorySaver`.
50
+ checkpointer:
51
+ ref: checkpointer/sqlite
52
+ # Upstream execution feature: store config passed into the selected backend adapter.
53
+ # In the default deepagent adapter this is the LangGraph store used by `StoreBackend` routes.
54
+ # Built-in kinds in this harness today: `FileStore`, `InMemoryStore`.
55
+ # Other store kinds should flow through a custom runtime resolver instead of being claimed as built in.
56
+ store:
57
+ ref: store/default
58
+ # Upstream execution feature: backend config passed into the selected backend adapter.
59
+ # Prefer a reusable backend preset via `ref` so backend topology stays declarative and reusable in YAML.
60
+ # The default preset keeps DeepAgent execution semantics upstream-owned:
61
+ # - workspace execution uses a lightweight VFS sandbox
62
+ # - long-term memory under `/memories/*` uses `StoreBackend`
63
+ # - `CompositeBackend` composes those backend instances together
64
+ # The harness injects the resolved store/checkpointer instances, but the backend topology itself stays upstream-shaped.
65
+ # Upstream execution feature: no extra declarative HITL rules by default.
66
+ interruptOn: {}
67
+ # Upstream execution feature: no extra declarative middleware beyond upstream deepagents defaults by default.
68
+ # Common upstream middleware kinds that this harness can compile directly from YAML:
69
+ # - `patchToolCalls`
70
+ # - `summarization`
71
+ # - `dynamicSystemPrompt`
72
+ # - `humanInTheLoop`
73
+ # - `todoList`
74
+ # - `pii`, `piiRedaction`
75
+ #
76
+ # DeepAgents already includes its own filesystem, planning, subagent, and memory semantics.
77
+ # Keep this list empty unless you are intentionally adding extra upstream middleware on top.
78
+ middleware: []
43
79
  config:
44
- # Runtime execution feature: checkpointer config passed into the selected backend adapter.
45
- # This persists resumable graph state for this agent.
46
- # Available `kind` options in this harness: `FileCheckpointer`, `MemorySaver`, `SqliteSaver`.
47
- # `path` is only used by `FileCheckpointer` and `SqliteSaver`; omit it for `MemorySaver`.
48
- checkpointer:
49
- ref: checkpointer/sqlite
50
- # Upstream execution feature: store config passed into the selected backend adapter.
51
- # In the default deepagent adapter this is the LangGraph store used by `StoreBackend` routes.
52
- # Built-in kinds in this harness today: `FileStore`, `InMemoryStore`.
53
- # Other store kinds should flow through a custom runtime resolver instead of being claimed as built in.
54
- store:
55
- ref: store/default
56
- # agent-harness feature: workspace-level durable long-term memory defaults for this host profile.
57
- runtimeMemory:
58
- ref: runtime-memory/default
59
80
  # Upstream execution feature: backend config passed into the selected backend adapter.
60
- # Prefer a reusable backend preset via `ref` so backend topology stays declarative and reusable in YAML.
61
- # The default preset keeps DeepAgent execution semantics upstream-owned:
62
- # - workspace execution uses a lightweight VFS sandbox
63
- # - long-term memory under `/memories/*` uses `StoreBackend`
64
- # - `CompositeBackend` composes those backend instances together
65
- # The harness injects the resolved store/checkpointer instances, but the backend topology itself stays upstream-shaped.
81
+ # Keep this nested under `config` because `execution.backend` already selects the adapter mode.
66
82
  backend:
67
83
  ref: backend/default
68
- # Upstream execution feature: no extra declarative HITL rules by default.
69
- interruptOn: {}
70
- # Upstream execution feature: no extra declarative middleware beyond upstream deepagents defaults by default.
71
- # Common upstream middleware kinds that this harness can compile directly from YAML:
72
- # - `patchToolCalls`
73
- # - `summarization`
74
- # - `dynamicSystemPrompt`
75
- # - `humanInTheLoop`
76
- # - `todoList`
77
- # - `pii`, `piiRedaction`
78
- #
79
- # DeepAgents already includes its own filesystem, planning, subagent, and memory semantics.
80
- # Keep this list empty unless you are intentionally adding extra upstream middleware on top.
81
- middleware: []
82
- # Upstream execution feature: keep the built-in general-purpose subagent enabled.
83
- generalPurposeAgent: true
84
- # Upstream execution feature: bias the general-purpose subagent toward bounded sidecar work and context isolation.
85
- taskDescription: Complete delegated sidecar work and return concise results without bloating the parent context.
86
- # Upstream execution feature: system prompt for the orchestration host.
87
- # This becomes the top-level instruction block for the selected execution backend and should hold the
88
- # agent's durable role, priorities, and behavioral guardrails rather than bulky project facts.
89
- systemPrompt: |-
90
- You are the orchestra agent.
84
+ # Upstream execution feature: system prompt for the orchestration host.
85
+ # This becomes the top-level instruction block for the selected execution backend and should hold the
86
+ # agent's durable role, priorities, and behavioral guardrails rather than bulky project facts.
87
+ systemPrompt: |-
88
+ You are the orchestra agent.
91
89
 
92
- You are the default execution host.
93
- Try to finish the request yourself before delegating.
94
- Use your own tools first when they are sufficient.
95
- Use your own skills first when they are sufficient.
96
- Delegate only when a specialist is a clearly better fit or when your own tools and skills are not enough.
97
- If neither you nor any suitable specialist can do the work, say so plainly.
90
+ You are the default execution host.
91
+ Try to finish the request yourself before delegating.
92
+ Use your own tools first when they are sufficient.
93
+ Use your own skills first when they are sufficient.
94
+ Delegate only when a subagent is a clearly better fit or when your own tools and skills are not enough.
95
+ If neither you nor any suitable subagent can do the work, say so plainly.
98
96
 
99
- Do not delegate by reflex.
100
- Do not delegate just because a task has multiple steps.
101
- Do not delegate when a direct answer or a short local tool pass is enough.
102
- Keep the critical path local when immediate progress depends on it; otherwise delegate bounded sidecar work to
103
- the most appropriate specialist.
97
+ Do not delegate by reflex.
98
+ Do not delegate just because a task has multiple steps.
99
+ Do not delegate when a direct answer or a short local tool pass is enough.
100
+ Keep the critical path local when immediate progress depends on it; otherwise delegate bounded sidecar work to
101
+ the most appropriate subagent.
104
102
 
105
- Use your own tools for lightweight discovery, inventory, and context gathering.
106
- Prefer the structured checkout, indexing, retrieval, and inventory tools that are already attached to you over
107
- ad hoc shell work when those tools are sufficient.
108
- Use the attached specialist descriptions as the source of truth for what each specialist is for.
109
- Do not delegate to a specialist whose description does not clearly match the task.
110
- Integrate specialist results into one coherent answer and do not claim checks or evidence you did not obtain.
103
+ Use your own tools for lightweight discovery, inventory, and context gathering.
104
+ Prefer the structured checkout, indexing, retrieval, and inventory tools that are already attached to you over
105
+ ad hoc shell work when those tools are sufficient.
106
+ Use the attached subagent descriptions as the source of truth for what each subagent is for.
107
+ Do not delegate to a subagent whose description does not clearly match the task.
108
+ Integrate subagent results into one coherent answer and do not claim checks or evidence you did not obtain.
111
109
 
112
- When the user asks about available tools, skills, or agents, use the attached inventory tools instead of
113
- inferring from memory.
110
+ When the user asks about available tools, skills, or agents, use the attached inventory tools instead of
111
+ inferring from memory.
114
112
 
115
- Write to `/memories/*` only when the information is durable, reusable across future runs or threads, and likely
116
- to matter again: user preferences, project conventions, confirmed decisions, reusable summaries, and stable
117
- ownership facts are good candidates.
118
- Do not store transient reasoning, temporary plans, scratch work, one-off search results, or intermediate
119
- outputs that can be cheaply recomputed.
113
+ Write to `/memories/*` only when the information is durable, reusable across future runs or threads, and likely
114
+ to matter again: user preferences, project conventions, confirmed decisions, reusable summaries, and stable
115
+ ownership facts are good candidates.
116
+ Do not store transient reasoning, temporary plans, scratch work, one-off search results, or intermediate
117
+ outputs that can be cheaply recomputed.
@@ -1,7 +1,5 @@
1
1
  export type ExecutionMode = "deepagent" | "langchain-v1";
2
2
  export declare const AUTO_AGENT_ID = "auto";
3
- export type RuntimeModelSlot = "planning" | "execution" | "review" | "final";
4
- export type RuntimeModelRefMap = Partial<Record<RuntimeModelSlot, string>>;
5
3
  export type RuntimeCapabilities = {
6
4
  delegation?: boolean;
7
5
  memory?: boolean;
@@ -315,23 +315,6 @@ export type InternalApprovalRecord = ApprovalRecord & {
315
315
  checkpointRef: string;
316
316
  eventRefs: string[];
317
317
  };
318
- export type DelegationRecord = {
319
- delegationId: string;
320
- threadId: string;
321
- runId: string;
322
- parentRunId: string;
323
- specialistAgentId: string;
324
- specialistName: string;
325
- specialistDescription: string;
326
- status: "requested" | "running" | "completed" | "failed" | "cancelled" | "resumable";
327
- requestedAt: string;
328
- startedAt: string | null;
329
- completedAt: string | null;
330
- checkpointRef: string | null;
331
- inputArtifactRef: string | null;
332
- outputArtifactRef: string | null;
333
- eventRefs: string[];
334
- };
335
318
  export type ArtifactRecord = {
336
319
  artifactId: string;
337
320
  kind: string;
@@ -1,8 +1,8 @@
1
- import type { ExecutionMode, RuntimeCapabilities, RuntimeModelRefMap, RuntimeModelSlot } from "./core.js";
1
+ import type { ExecutionMode, RuntimeCapabilities } from "./core.js";
2
2
  export type ParsedAgentObject = {
3
3
  id: string;
4
4
  executionMode: ExecutionMode;
5
- runtimeModelRefs?: RuntimeModelRefMap;
5
+ runtimeMemory?: Record<string, unknown>;
6
6
  capabilities?: RuntimeCapabilities;
7
7
  description: string;
8
8
  modelRef: string;
@@ -181,10 +181,7 @@ export type DeepAgentParams = {
181
181
  name: string;
182
182
  memory: string[];
183
183
  skills: string[];
184
- generalPurposeAgent?: boolean;
185
- taskDescription?: string;
186
184
  };
187
- export type RuntimeModelMap = Partial<Record<RuntimeModelSlot, CompiledModel>>;
188
185
  export type CompiledAgentBinding = {
189
186
  agent: ParsedAgentObject;
190
187
  adapter?: {
@@ -196,8 +193,6 @@ export type CompiledAgentBinding = {
196
193
  harnessRuntime: {
197
194
  runRoot: string;
198
195
  workspaceRoot?: string;
199
- modelRefs?: RuntimeModelRefMap;
200
- models?: RuntimeModelMap;
201
196
  capabilities?: RuntimeCapabilities;
202
197
  resilience?: Record<string, unknown>;
203
198
  checkpointer?: Record<string, unknown> | boolean;
@@ -47,7 +47,7 @@ function renderReadme(displayName, projectSlug, options) {
47
47
  : "- no provider-native web search by default";
48
48
  const providerEnvLine = options.provider === "openai" ? "export OPENAI_API_KEY=your_key_here\n" : "";
49
49
  const templateLine = options.template === "deep-research"
50
- ? "- a host research agent plus a specialist analyst subagent"
50
+ ? "- a host research agent plus an analyst subagent"
51
51
  : "- a single host research agent for direct iteration";
52
52
  return `# ${displayName}
53
53
 
@@ -194,6 +194,9 @@ metadata:
194
194
  name: research
195
195
  description: Host-facing research agent for investigating and synthesizing answers.
196
196
  spec:
197
+ runtime:
198
+ runtimeMemory:
199
+ ref: runtime-memory/default
197
200
  execution:
198
201
  backend: deepagent
199
202
  modelRef: model/default
@@ -202,9 +205,7 @@ ${toolsBlock} skills:
202
205
  ${subagentsBlock} config:
203
206
  backend:
204
207
  ref: backend/default
205
- runtimeMemory:
206
- ref: runtime-memory/default
207
- systemPrompt: ${prompt}${delegationLine}
208
+ systemPrompt: ${prompt}${delegationLine}
208
209
  `;
209
210
  }
210
211
  function renderResearchAnalystYaml(options) {
@@ -216,8 +217,11 @@ function renderResearchAnalystYaml(options) {
216
217
  kind: Agent
217
218
  metadata:
218
219
  name: research-analyst
219
- description: Specialist subagent for source gathering, comparison, and evidence extraction.
220
+ description: Analyst subagent for source gathering, comparison, and evidence extraction.
220
221
  spec:
222
+ runtime:
223
+ runtimeMemory:
224
+ ref: runtime-memory/default
221
225
  execution:
222
226
  backend: deepagent
223
227
  modelRef: model/default
@@ -226,9 +230,7 @@ ${toolsBlock} skills:
226
230
  config:
227
231
  backend:
228
232
  ref: backend/default
229
- runtimeMemory:
230
- ref: runtime-memory/default
231
- systemPrompt: ${prompt}
233
+ systemPrompt: ${prompt}
232
234
  `;
233
235
  }
234
236
  function renderResourcePackageJson(projectSlug) {
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.110";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.111";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.110";
1
+ export const AGENT_HARNESS_VERSION = "0.0.111";
@@ -1,4 +1,4 @@
1
- import type { ArtifactListing, ArtifactRecord, DelegationRecord, HarnessEvent, InternalApprovalRecord, RunSummary, RunState, ThreadSummary, ThreadRunRecord, TranscriptMessage } from "../contracts/types.js";
1
+ import type { ArtifactListing, ArtifactRecord, HarnessEvent, InternalApprovalRecord, RunSummary, RunState, ThreadSummary, ThreadRunRecord, TranscriptMessage } from "../contracts/types.js";
2
2
  import type { ApprovalFilter, PersistedRunRequest, PersistedRunControlRecord, PersistedRunQueueRecord, PersistenceLifecycle as Lifecycle, RuntimePersistence, RecoveryIntent, PersistenceRunMeta as RunMeta, RunSummaryFilter, ThreadSummaryFilter, PersistenceThreadMeta as ThreadMeta } from "./types.js";
3
3
  type RunIndexRecord = {
4
4
  runId: string;
@@ -13,7 +13,6 @@ export declare class FilePersistence implements RuntimePersistence {
13
13
  private threadIndexPath;
14
14
  private runIndexPath;
15
15
  private approvalIndexPath;
16
- private delegationIndexPath;
17
16
  private runQueuePath;
18
17
  private runControlPath;
19
18
  initialize(): Promise<void>;
@@ -54,11 +53,8 @@ export declare class FilePersistence implements RuntimePersistence {
54
53
  saveRunRequest(threadId: string, runId: string, request: PersistedRunRequest): Promise<void>;
55
54
  getRunRequest(threadId: string, runId: string): Promise<PersistedRunRequest | null>;
56
55
  clearRunRequest(threadId: string, runId: string): Promise<void>;
57
- listDelegations(): Promise<DelegationRecord[]>;
58
56
  createApproval(record: InternalApprovalRecord): Promise<void>;
59
57
  resolveApproval(threadId: string, runId: string, approvalId: string, status: InternalApprovalRecord["status"]): Promise<InternalApprovalRecord>;
60
- createDelegation(record: DelegationRecord): Promise<void>;
61
- updateDelegation(threadId: string, runId: string, delegationId: string, patch: Partial<DelegationRecord>): Promise<DelegationRecord>;
62
58
  createArtifact(threadId: string, runId: string, artifact: ArtifactRecord, content: unknown): Promise<ArtifactRecord>;
63
59
  listArtifacts(threadId: string, runId: string): Promise<ArtifactListing>;
64
60
  appendThreadMessage(threadId: string, message: TranscriptMessage): Promise<void>;
@@ -19,9 +19,6 @@ export class FilePersistence {
19
19
  approvalIndexPath(approvalId) {
20
20
  return path.join(this.runRoot, "indexes", "approvals", `${approvalId}.json`);
21
21
  }
22
- delegationIndexPath(delegationId) {
23
- return path.join(this.runRoot, "indexes", "delegations", `${delegationId}.json`);
24
- }
25
22
  runQueuePath(runId) {
26
23
  return path.join(this.runRoot, "indexes", "queue", `${runId}.json`);
27
24
  }
@@ -33,7 +30,6 @@ export class FilePersistence {
33
30
  "indexes/threads",
34
31
  "indexes/runs",
35
32
  "indexes/approvals",
36
- "indexes/delegations",
37
33
  "indexes/queue",
38
34
  "indexes/run-control",
39
35
  "threads",
@@ -71,7 +67,6 @@ export class FilePersistence {
71
67
  const runDir = this.runDir(input.threadId, input.runId);
72
68
  await ensureDir(path.join(runDir, "events"));
73
69
  await ensureDir(path.join(runDir, "approvals"));
74
- await ensureDir(path.join(runDir, "delegations"));
75
70
  const meta = {
76
71
  runId: input.runId,
77
72
  threadId: input.threadId,
@@ -346,10 +341,9 @@ export class FilePersistence {
346
341
  if (!(await fileExists(threadDir)) && !(await fileExists(threadIndexPath))) {
347
342
  return false;
348
343
  }
349
- const [runIndexes, approvals, delegations] = await Promise.all([
344
+ const [runIndexes, approvals] = await Promise.all([
350
345
  this.listRunIndexes(),
351
346
  this.listApprovals(),
352
- this.listDelegations(),
353
347
  ]);
354
348
  await Promise.all([
355
349
  ...runIndexes
@@ -361,9 +355,6 @@ export class FilePersistence {
361
355
  ...runIndexes
362
356
  .filter((record) => record.threadId === threadId)
363
357
  .flatMap((record) => [rm(this.runQueuePath(record.runId), { force: true }), rm(this.runControlPath(record.runId), { force: true })]),
364
- ...delegations
365
- .filter((record) => record.threadId === threadId)
366
- .map((record) => rm(this.delegationIndexPath(record.delegationId), { force: true })),
367
358
  rm(threadIndexPath, { force: true }),
368
359
  rm(threadDir, { recursive: true, force: true }),
369
360
  ]);
@@ -385,14 +376,6 @@ export class FilePersistence {
385
376
  await rm(requestPath, { force: true });
386
377
  }
387
378
  }
388
- async listDelegations() {
389
- const delegationsDir = path.join(this.runRoot, "indexes", "delegations");
390
- if (!(await fileExists(delegationsDir))) {
391
- return [];
392
- }
393
- const entries = (await readdir(delegationsDir)).sort();
394
- return Promise.all(entries.map((entry) => readJson(path.join(delegationsDir, entry))));
395
- }
396
379
  async createApproval(record) {
397
380
  await Promise.all([
398
381
  writeJson(path.join(this.runDir(record.threadId, record.runId), "approvals", `${record.approvalId}.json`), record),
@@ -413,22 +396,6 @@ export class FilePersistence {
413
396
  ]);
414
397
  return updated;
415
398
  }
416
- async createDelegation(record) {
417
- await Promise.all([
418
- writeJson(path.join(this.runDir(record.threadId, record.runId), "delegations", `${record.delegationId}.json`), record),
419
- writeJson(path.join(this.runRoot, "indexes", "delegations", `${record.delegationId}.json`), record),
420
- ]);
421
- }
422
- async updateDelegation(threadId, runId, delegationId, patch) {
423
- const delegationPath = path.join(this.runDir(threadId, runId), "delegations", `${delegationId}.json`);
424
- const current = await readJson(delegationPath);
425
- const updated = { ...current, ...patch };
426
- await Promise.all([
427
- writeJson(delegationPath, updated),
428
- writeJson(path.join(this.runRoot, "indexes", "delegations", `${delegationId}.json`), updated),
429
- ]);
430
- return updated;
431
- }
432
399
  async createArtifact(threadId, runId, artifact, content) {
433
400
  const runDir = this.runDir(threadId, runId);
434
401
  await writeJson(path.join(runDir, artifact.path), content);
@@ -11,6 +11,12 @@ export declare function materializeDeepAgentSkillSourcePaths(options: {
11
11
  ownerId: string;
12
12
  skillPaths?: string[];
13
13
  }): Promise<string[] | undefined>;
14
+ export declare function resolveDeepAgentSkillSourcePaths(options: {
15
+ workspaceRoot?: string;
16
+ runRoot?: string;
17
+ ownerId: string;
18
+ skillPaths?: string[];
19
+ }): string[] | undefined;
14
20
  export declare function shouldRelaxDeepAgentDelegationPrompt(model: CompiledModel | undefined, params: DelegationPromptCompatibilityParams): boolean;
15
21
  export declare function applyDeepAgentDelegationPromptCompatibility<T extends DelegationPromptCompatibilityParams>(model: CompiledModel | undefined, params: T): T;
16
22
  export {};
@@ -18,6 +18,9 @@ export function relativizeDeepAgentSkillSourcePaths(workspaceRoot, skillPaths) {
18
18
  });
19
19
  }
20
20
  export async function materializeDeepAgentSkillSourcePaths(options) {
21
+ return Promise.resolve(resolveDeepAgentSkillSourcePaths(options));
22
+ }
23
+ export function resolveDeepAgentSkillSourcePaths(options) {
21
24
  const { workspaceRoot, skillPaths } = options;
22
25
  if (!skillPaths) {
23
26
  return skillPaths;
@@ -1,6 +1,6 @@
1
- import type { CompiledAgentBinding, CompiledTool } from "../../contracts/types.js";
2
- import type { ToolNameMapping } from "./tool/tool-name-mapping.js";
3
- import { getBindingPrimaryModel } from "../support/compiled-binding.js";
1
+ import type { CompiledAgentBinding, CompiledTool } from "../../../contracts/types.js";
2
+ import type { ToolNameMapping } from "../tool/tool-name-mapping.js";
3
+ import { getBindingPrimaryModel } from "../../support/compiled-binding.js";
4
4
  export declare function buildBindingToolCatalog(input: {
5
5
  binding: CompiledAgentBinding;
6
6
  getToolNameMapping: (binding: CompiledAgentBinding) => ToolNameMapping;
@@ -32,3 +32,17 @@ export declare function resolveLangChainStreamContext(input: {
32
32
  stream?: (input: unknown) => Promise<AsyncIterable<unknown>>;
33
33
  } | undefined;
34
34
  }>;
35
+ export declare function resolveRuntimeStreamExecutionContext(input: {
36
+ binding: CompiledAgentBinding;
37
+ getToolNameMapping: (binding: CompiledAgentBinding) => ToolNameMapping;
38
+ resolveModel: (model: NonNullable<ReturnType<typeof getBindingPrimaryModel>>) => Promise<unknown>;
39
+ resolveTools: (tools: CompiledTool[], binding?: CompiledAgentBinding) => unknown[];
40
+ }): Promise<{
41
+ primaryTools: CompiledTool[];
42
+ toolNameMapping: ToolNameMapping;
43
+ forceInvokeFallback: boolean;
44
+ canUseDirectModelStream: boolean;
45
+ langChainStreamModel: {
46
+ stream?: (input: unknown) => Promise<AsyncIterable<unknown>>;
47
+ } | undefined;
48
+ }>;