@botbotgo/agent-harness 0.0.53 → 0.0.54

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,21 @@
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
20
 
21
21
  What the runtime provides:
22
22
 
23
- - `createAgentHarness(...)`, `run(...)`, `subscribe(...)`, inspection methods, and `stop(...)`
23
+ - `createAgentHarness(workspaceRoot)`, `run(...)`, `resolveApproval(...)`, `subscribe(...)`, inspection methods, and `stop(...)`
24
24
  - YAML-defined workspace assembly for routing, models, tools, stores, backends, MCP, recovery, and maintenance
25
25
  - backend-adapted execution with current LangChain v1 and DeepAgents adapters
26
26
  - local `resources/tools/` and `resources/skills/` discovery
@@ -124,12 +124,12 @@ const result = await run(runtime, {
124
124
  });
125
125
  ```
126
126
 
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.
127
+ `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
128
 
129
129
  Use `invocation` as the runtime-facing request envelope:
130
130
 
131
131
  - `invocation.context` for request-scoped execution context
132
- - `invocation.inputs` for additional structured runtime inputs
132
+ - `invocation.inputs` for structured runtime inputs
133
133
  - `invocation.attachments` for attachment-like payloads that the active backend can interpret
134
134
 
135
135
  ### Let The Runtime Route
@@ -141,7 +141,7 @@ const result = await run(runtime, {
141
141
  });
142
142
  ```
143
143
 
144
- `agentId: "auto"` evaluates ordered `routing.rules`, then `routing.defaultAgentId`, and only falls back to model routing when `routing.modelRouting: true`.
144
+ `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
145
 
146
146
  ### Stream Output And Events
147
147
 
@@ -183,12 +183,20 @@ import {
183
183
  getThread,
184
184
  listApprovals,
185
185
  listThreads,
186
+ resolveApproval,
186
187
  } from "@botbotgo/agent-harness";
187
188
 
188
189
  const threads = await listThreads(runtime);
189
190
  const thread = await getThread(runtime, threads[0]!.threadId);
190
191
  const approvals = await listApprovals(runtime, { status: "pending" });
191
192
  const approval = approvals[0] ? await getApproval(runtime, approvals[0].approvalId) : null;
193
+
194
+ if (approval) {
195
+ await resolveApproval(runtime, {
196
+ approvalId: approval.approvalId,
197
+ decision: "approve",
198
+ });
199
+ }
192
200
  ```
193
201
 
194
202
  These methods return runtime-facing records, not raw persistence or backend checkpoint objects.
@@ -279,8 +287,6 @@ Primary fields:
279
287
 
280
288
  If `runRoot` is omitted, the runtime defaults to `<workspace-root>/run-data`.
281
289
 
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
290
  ### `config/agent-context.md`
285
291
 
286
292
  Use this file for shared bootstrap context loaded into agents at construction time.
@@ -301,7 +307,7 @@ spec:
301
307
  temperature: 0.2
302
308
  ```
303
309
 
304
- These load as `model/<name>`.
310
+ These load as `model/default`.
305
311
 
306
312
  ### `config/embedding-models.yaml`
307
313
 
@@ -332,19 +338,6 @@ spec:
332
338
  path: checkpoints.sqlite
333
339
  ```
334
340
 
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
341
  ### `config/backends.yaml`
349
342
 
350
343
  Use reusable DeepAgent backend presets so filesystem and long-term memory topology stays in YAML instead of application code:
@@ -370,17 +363,9 @@ spec:
370
363
 
371
364
  Use this file for reusable tool objects.
372
365
 
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
366
+ Supported tool families in the built-in runtime include function tools, backend tools, MCP tools, provider-native tools, and bundles.
380
367
 
381
- Provider-native tools are declared in YAML and resolved directly to upstream provider tool factories such as OpenAI and Anthropic tool objects.
382
-
383
- Use `retryable` carefully. Mark a tool retryable only when repeated execution is safe or intentionally idempotent.
368
+ Provider-native tools are declared in YAML and resolved directly to upstream provider tool factories.
384
369
 
385
370
  ### `config/mcp.yaml`
386
371
 
@@ -457,36 +442,7 @@ spec:
457
442
  taskDescription: Complete delegated sidecar work and return concise results.
458
443
  ```
459
444
 
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).
445
+ 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
446
 
491
447
  ### `resources/`
492
448
 
@@ -497,10 +453,6 @@ Use `resources/` for executable local extensions:
497
453
 
498
454
  Tool modules are discovered from `resources/tools/*.js`, `resources/tools/*.mjs`, and `resources/tools/*.cjs`.
499
455
 
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
456
  ## Design Notes
505
457
 
506
458
  - public runtime contract stays generic and small
@@ -518,6 +470,7 @@ Primary exports:
518
470
 
519
471
  - `createAgentHarness`
520
472
  - `run`
473
+ - `resolveApproval`
521
474
  - `subscribe`
522
475
  - `listThreads`
523
476
  - `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.53";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.52";
1
+ export const AGENT_HARNESS_VERSION = "0.0.53";
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.54",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",