@botbotgo/agent-harness 0.0.53 → 0.0.55

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 CHANGED
@@ -6,21 +6,27 @@
6
6
 
7
7
  It is not a new agent framework. It is the runtime layer around LangChain v1 and DeepAgents that turns one workspace into one operable application runtime.
8
8
 
9
- The boundary is strict:
9
+ The product boundary is strict:
10
10
 
11
11
  - LangChain v1 and DeepAgents own agent execution semantics
12
- - `agent-harness` owns application-level orchestration and lifecycle management
12
+ - `agent-harness` owns application-level orchestration and lifecycle management stays in the harness
13
13
 
14
14
  That means:
15
15
 
16
16
  - public API stays small
17
17
  - complex setup and operating policy live in YAML
18
- - application-level orchestration and lifecycle management stays in the harness
19
18
  - runtime lifecycle stays stable even if backend implementations change
19
+ - backend internals stay behind adapters
20
+
21
+ The repository also keeps two boundary documents current:
22
+
23
+ - `docs/upstream-feature-matrix.md`
24
+ - `docs/product-boundary.md`
25
+ - `docs/feature-checklist.md`
20
26
 
21
27
  What the runtime provides:
22
28
 
23
- - `createAgentHarness(...)`, `run(...)`, `subscribe(...)`, inspection methods, and `stop(...)`
29
+ - `createAgentHarness(workspaceRoot)`, `run(...)`, `resolveApproval(...)`, `subscribe(...)`, inspection methods, and `stop(...)`
24
30
  - YAML-defined workspace assembly for routing, models, tools, stores, backends, MCP, recovery, and maintenance
25
31
  - backend-adapted execution with current LangChain v1 and DeepAgents adapters
26
32
  - local `resources/tools/` and `resources/skills/` discovery
@@ -90,6 +96,14 @@ try {
90
96
  - MCP bridge support for agent-declared MCP servers
91
97
  - MCP server support for exposing harness tools outward
92
98
 
99
+ ## Design Notes
100
+
101
+ - `agent-harness` is not a third agent framework
102
+ - LangChain v1 and DeepAgents own agent execution semantics
103
+ - `agent-harness` owns workspace assembly, runtime lifecycle, approvals, inspection, recovery, and operations
104
+ - when upstream already has the feature, prefer passthrough or light YAML adaptation over a new harness abstraction
105
+ - when a feature can be expressed in YAML, prefer YAML over expanding the public API
106
+
93
107
  ## How To Use
94
108
 
95
109
  ### Create A Runtime
@@ -124,12 +138,12 @@ const result = await run(runtime, {
124
138
  });
125
139
  ```
126
140
 
127
- `run(runtime, { ... })` creates or continues a persisted thread and returns `threadId`, `runId`, `state`, and a simple text `output`. When upstream returns richer output, the runtime also preserves `outputContent`, `contentBlocks`, and `structuredResponse` without making the basic API larger.
141
+ `run(runtime, { ... })` creates or continues a persisted thread and returns `threadId`, `runId`, `state`, and a compact text `output`. Richer upstream results remain available through `outputContent`, `contentBlocks`, and `structuredResponse` without expanding the main facade.
128
142
 
129
143
  Use `invocation` as the runtime-facing request envelope:
130
144
 
131
145
  - `invocation.context` for request-scoped execution context
132
- - `invocation.inputs` for additional structured runtime inputs
146
+ - `invocation.inputs` for structured runtime inputs
133
147
  - `invocation.attachments` for attachment-like payloads that the active backend can interpret
134
148
 
135
149
  ### Let The Runtime Route
@@ -141,7 +155,7 @@ const result = await run(runtime, {
141
155
  });
142
156
  ```
143
157
 
144
- `agentId: "auto"` evaluates ordered `routing.rules`, then `routing.defaultAgentId`, and only falls back to model routing when `routing.modelRouting: true`.
158
+ `agentId: "auto"` evaluates ordered routing rules in `config/workspace.yaml`, then `routing.defaultAgentId`, and only falls back to model routing when `routing.modelRouting: true`.
145
159
 
146
160
  ### Stream Output And Events
147
161
 
@@ -183,12 +197,20 @@ import {
183
197
  getThread,
184
198
  listApprovals,
185
199
  listThreads,
200
+ resolveApproval,
186
201
  } from "@botbotgo/agent-harness";
187
202
 
188
203
  const threads = await listThreads(runtime);
189
204
  const thread = await getThread(runtime, threads[0]!.threadId);
190
205
  const approvals = await listApprovals(runtime, { status: "pending" });
191
206
  const approval = approvals[0] ? await getApproval(runtime, approvals[0].approvalId) : null;
207
+
208
+ if (approval) {
209
+ await resolveApproval(runtime, {
210
+ approvalId: approval.approvalId,
211
+ decision: "approve",
212
+ });
213
+ }
192
214
  ```
193
215
 
194
216
  These methods return runtime-facing records, not raw persistence or backend checkpoint objects.
@@ -279,8 +301,6 @@ Primary fields:
279
301
 
280
302
  If `runRoot` is omitted, the runtime defaults to `<workspace-root>/run-data`.
281
303
 
282
- Queued runs are persisted under `runRoot` and continue after process restart. `running` runs are only replayed on startup when the bound tools are retryable.
283
-
284
304
  ### `config/agent-context.md`
285
305
 
286
306
  Use this file for shared bootstrap context loaded into agents at construction time.
@@ -301,7 +321,7 @@ spec:
301
321
  temperature: 0.2
302
322
  ```
303
323
 
304
- These load as `model/<name>`.
324
+ These load as `model/default`.
305
325
 
306
326
  ### `config/embedding-models.yaml`
307
327
 
@@ -332,19 +352,6 @@ spec:
332
352
  path: checkpoints.sqlite
333
353
  ```
334
354
 
335
- Built-in store kinds today:
336
-
337
- - `FileStore`
338
- - `InMemoryStore`
339
-
340
- Built-in checkpointer kinds today:
341
-
342
- - `MemorySaver`
343
- - `FileCheckpointer`
344
- - `SqliteSaver`
345
-
346
- If you need other store or checkpointer implementations, inject them through runtime resolvers instead of treating them as built-in harness features.
347
-
348
355
  ### `config/backends.yaml`
349
356
 
350
357
  Use reusable DeepAgent backend presets so filesystem and long-term memory topology stays in YAML instead of application code:
@@ -370,17 +377,9 @@ spec:
370
377
 
371
378
  Use this file for reusable tool objects.
372
379
 
373
- Supported tool families in the built-in runtime include:
374
-
375
- - function tools
376
- - backend tools
377
- - MCP tools
378
- - provider-native tools
379
- - bundles
380
-
381
- Provider-native tools are declared in YAML and resolved directly to upstream provider tool factories such as OpenAI and Anthropic tool objects.
380
+ Supported tool families in the built-in runtime include function tools, backend tools, MCP tools, provider-native tools, and bundles.
382
381
 
383
- Use `retryable` carefully. Mark a tool retryable only when repeated execution is safe or intentionally idempotent.
382
+ Provider-native tools are declared in YAML and resolved directly to upstream provider tool factories.
384
383
 
385
384
  ### `config/mcp.yaml`
386
385
 
@@ -457,36 +456,7 @@ spec:
457
456
  taskDescription: Complete delegated sidecar work and return concise results.
458
457
  ```
459
458
 
460
- Client-configurable agent fields include:
461
-
462
- - `metadata.name`
463
- - `metadata.description`
464
- - `spec.execution.backend`
465
- - `spec.runtime.runRoot`
466
- - `spec.execution.modelRef`
467
- - `spec.execution.tools`
468
- - `spec.execution.skills`
469
- - `spec.execution.memory`
470
- - `spec.execution.subagents`
471
- - `spec.execution.mcpServers`
472
- - `spec.execution.config.systemPrompt`
473
- - `spec.execution.config.checkpointer`
474
- - `spec.execution.config.store`
475
- - `spec.execution.config.backend`
476
- - `spec.execution.config.middleware`
477
- - `spec.execution.config.responseFormat`
478
- - `spec.execution.config.contextSchema`
479
- - `spec.execution.config.stateSchema`
480
- - `spec.execution.config.interruptOn`
481
- - `spec.execution.config.filesystem`
482
- - `spec.execution.config.taskDescription`
483
- - `spec.execution.config.generalPurposeAgent`
484
- - `spec.execution.config.includeAgentName`
485
- - `spec.execution.config.version`
486
-
487
- For backend-specific agent options, prefer passing the upstream concept directly inside `spec.execution.config`. The loader keeps a small stable product shape, but it also preserves adapter-facing passthrough fields so new LangChain v1 or DeepAgents parameters can flow into adapters without expanding the public API surface.
488
-
489
- Upstream feature coverage is tracked in [docs/upstream-feature-matrix.md](docs/upstream-feature-matrix.md).
459
+ For backend-specific agent 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).
490
460
 
491
461
  ### `resources/`
492
462
 
@@ -497,10 +467,6 @@ Use `resources/` for executable local extensions:
497
467
 
498
468
  Tool modules are discovered from `resources/tools/*.js`, `resources/tools/*.mjs`, and `resources/tools/*.cjs`.
499
469
 
500
- The preferred tool module format is exporting `tool({...})`.
501
-
502
- SKILL packages are discovered from `resources/skills/` and attached to agents through YAML.
503
-
504
470
  ## Design Notes
505
471
 
506
472
  - public runtime contract stays generic and small
@@ -518,6 +484,7 @@ Primary exports:
518
484
 
519
485
  - `createAgentHarness`
520
486
  - `run`
487
+ - `resolveApproval`
521
488
  - `subscribe`
522
489
  - `listThreads`
523
490
  - `getThread`
package/dist/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ApprovalRecord, RunOptions, RuntimeAdapterOptions, ThreadSummary, ThreadRecord, WorkspaceLoadOptions, WorkspaceBundle } from "./contracts/types.js";
1
+ import type { ApprovalRecord, RunOptions, ResumeOptions, RuntimeAdapterOptions, ThreadSummary, ThreadRecord, WorkspaceLoadOptions } from "./contracts/types.js";
2
2
  import { AgentHarnessRuntime } from "./runtime/harness.js";
3
3
  import type { ToolMcpServerOptions } from "./mcp.js";
4
4
  export { AgentHarnessRuntime } from "./runtime/harness.js";
@@ -8,7 +8,6 @@ type CreateAgentHarnessOptions = {
8
8
  };
9
9
  export declare function createAgentHarness(): Promise<AgentHarnessRuntime>;
10
10
  export declare function createAgentHarness(workspaceRoot: string, options?: CreateAgentHarnessOptions): Promise<AgentHarnessRuntime>;
11
- export declare function createAgentHarness(workspace: WorkspaceBundle, options?: CreateAgentHarnessOptions): Promise<AgentHarnessRuntime>;
12
11
  export declare function run(runtime: AgentHarnessRuntime, options: RunOptions): Promise<import("./contracts/types.js").RunResult>;
13
12
  export declare function subscribe(runtime: AgentHarnessRuntime, listener: Parameters<AgentHarnessRuntime["subscribe"]>[0]): () => void;
14
13
  export declare function listThreads(runtime: AgentHarnessRuntime, filter?: Parameters<AgentHarnessRuntime["listThreads"]>[0]): Promise<ThreadSummary[]>;
@@ -16,6 +15,7 @@ export declare function getThread(runtime: AgentHarnessRuntime, threadId: string
16
15
  export declare function deleteThread(runtime: AgentHarnessRuntime, threadId: string): Promise<boolean>;
17
16
  export declare function listApprovals(runtime: AgentHarnessRuntime, filter?: Parameters<AgentHarnessRuntime["listApprovals"]>[0]): Promise<ApprovalRecord[]>;
18
17
  export declare function getApproval(runtime: AgentHarnessRuntime, approvalId: string): Promise<ApprovalRecord | null>;
18
+ export declare function resolveApproval(runtime: AgentHarnessRuntime, options: ResumeOptions): Promise<import("./contracts/types.js").RunResult>;
19
19
  export declare function stop(runtime: AgentHarnessRuntime): Promise<void>;
20
20
  export declare function createToolMcpServer(runtime: AgentHarnessRuntime, options: ToolMcpServerOptions): Promise<import("@modelcontextprotocol/sdk/server/mcp.js").McpServer>;
21
21
  export declare function serveToolsOverStdio(runtime: AgentHarnessRuntime, options: ToolMcpServerOptions): Promise<import("@modelcontextprotocol/sdk/server/mcp.js").McpServer>;
package/dist/api.js CHANGED
@@ -1,10 +1,8 @@
1
1
  import { AgentHarnessRuntime } from "./runtime/harness.js";
2
2
  import { loadWorkspace } from "./workspace/compile.js";
3
3
  export { AgentHarnessRuntime } from "./runtime/harness.js";
4
- export async function createAgentHarness(input = process.cwd(), options = {}) {
5
- const workspace = typeof input === "string"
6
- ? await loadWorkspace(input, options.load ?? {})
7
- : input;
4
+ export async function createAgentHarness(workspaceRoot = process.cwd(), options = {}) {
5
+ const workspace = await loadWorkspace(workspaceRoot, options.load ?? {});
8
6
  const harness = new AgentHarnessRuntime(workspace, options.adapter ?? {});
9
7
  await harness.initialize();
10
8
  return harness;
@@ -30,6 +28,9 @@ export async function listApprovals(runtime, filter) {
30
28
  export async function getApproval(runtime, approvalId) {
31
29
  return runtime.getApproval(approvalId);
32
30
  }
31
+ export async function resolveApproval(runtime, options) {
32
+ return runtime.resume(options);
33
+ }
33
34
  export async function stop(runtime) {
34
35
  return runtime.stop();
35
36
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { AgentHarnessRuntime, createAgentHarness, createToolMcpServer, deleteThread, getApproval, getThread, listApprovals, listThreads, run, serveToolsOverStdio, subscribe, stop, } from "./api.js";
1
+ export { AgentHarnessRuntime, createAgentHarness, createToolMcpServer, deleteThread, getApproval, getThread, listApprovals, listThreads, resolveApproval, run, serveToolsOverStdio, subscribe, stop, } from "./api.js";
2
2
  export type { ToolMcpServerOptions } from "./mcp.js";
3
3
  export { tool } from "./tools.js";
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { AgentHarnessRuntime, createAgentHarness, createToolMcpServer, deleteThread, getApproval, getThread, listApprovals, listThreads, run, serveToolsOverStdio, subscribe, stop, } from "./api.js";
1
+ export { AgentHarnessRuntime, createAgentHarness, createToolMcpServer, deleteThread, getApproval, getThread, listApprovals, listThreads, resolveApproval, run, serveToolsOverStdio, subscribe, stop, } from "./api.js";
2
2
  export { tool } from "./tools.js";
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.52";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.54";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.52";
1
+ export const AGENT_HARNESS_VERSION = "0.0.54";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",
@@ -50,7 +50,7 @@
50
50
  "scripts": {
51
51
  "build": "rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json && cp -R config dist/",
52
52
  "check": "tsc -p tsconfig.json --noEmit",
53
- "test": "vitest run test/public-api.test.ts test/resource-optional-provider.test.ts test/resource-isolation.test.ts test/stock-research-app-load-harness.test.ts test/stock-research-app-run.test.ts test/stock-research-app-config.test.ts test/release-workflow.test.ts test/release-version.test.ts test/gitignore.test.ts test/package-lock.test.ts test/readme.test.ts test/runtime-adapter-regressions.test.ts test/runtime-capabilities.test.ts test/runtime-recovery.test.ts test/tool-extension-gaps.test.ts test/checkpoint-maintenance.test.ts test/llamaindex-dependency-compat.test.ts test/skill-standard.test.ts test/routing-config.test.ts test/workspace-compat-regressions.test.ts test/upstream-compat-regressions.test.ts test/yaml-format.test.ts",
53
+ "test": "vitest run test/public-api.test.ts test/resource-optional-provider.test.ts test/resource-isolation.test.ts test/stock-research-app-load-harness.test.ts test/stock-research-app-run.test.ts test/stock-research-app-config.test.ts test/release-workflow.test.ts test/release-version.test.ts test/gitignore.test.ts test/package-lock.test.ts test/readme.test.ts test/product-boundary-docs.test.ts test/runtime-adapter-regressions.test.ts test/runtime-capabilities.test.ts test/runtime-recovery.test.ts test/tool-extension-gaps.test.ts test/checkpoint-maintenance.test.ts test/llamaindex-dependency-compat.test.ts test/skill-standard.test.ts test/routing-config.test.ts test/workspace-compat-regressions.test.ts test/upstream-compat-regressions.test.ts test/yaml-format.test.ts",
54
54
  "test:real-providers": "vitest run test/real-provider-harness.test.ts",
55
55
  "release:prepare": "npm version patch --no-git-tag-version && node ./scripts/sync-example-version.mjs",
56
56
  "release:pack": "npm pack --dry-run",