@botbotgo/agent-harness 0.0.25 → 0.0.27
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 +44 -0
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/resource/resource-impl.js +18 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -106,6 +106,13 @@ Or pass a prebuilt `WorkspaceBundle`:
|
|
|
106
106
|
const harness = await createAgentHarness(workspaceBundle);
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
Implementation details:
|
|
110
|
+
|
|
111
|
+
- `createAgentHarness(workspaceRoot)` loads and compiles one `WorkspaceBundle` before the runtime starts
|
|
112
|
+
- the loader reads `config/workspace.yaml`, `config/models.yaml`, `config/agent-context.md`, and every `config/agents/*.yaml` entry file, then validates the final topology
|
|
113
|
+
- local resource refs are hydrated after config load, so `resources/tools/`, `resources/skills/`, and agent-declared MCP servers are resolved before the harness accepts runs
|
|
114
|
+
- after compilation, the harness initializes persistence under the resolved `runRoot`, wires the runtime adapter, starts thread-memory syncing, and starts checkpoint maintenance when configured
|
|
115
|
+
|
|
109
116
|
### Run A Request
|
|
110
117
|
|
|
111
118
|
```ts
|
|
@@ -124,6 +131,13 @@ The result includes:
|
|
|
124
131
|
- `state`
|
|
125
132
|
- `output`
|
|
126
133
|
|
|
134
|
+
Runtime behavior:
|
|
135
|
+
|
|
136
|
+
- every `run(...)` call creates or continues a persisted thread under `runRoot`
|
|
137
|
+
- the harness stores thread metadata, run lifecycle, streamed events, approvals, delegations, and artifacts on disk so `getThread(...)` can reconstruct the session later
|
|
138
|
+
- when a store is configured, the harness also mirrors thread status and open approvals into `/memories/threads/<threadId>/`
|
|
139
|
+
- `stop(...)` should always be called so background persistence and maintenance loops shut down cleanly
|
|
140
|
+
|
|
127
141
|
### Let The Harness Choose The Host Agent
|
|
128
142
|
|
|
129
143
|
Use `agentId: "auto"` when your workspace defines routing:
|
|
@@ -135,6 +149,12 @@ const result = await run(harness, {
|
|
|
135
149
|
});
|
|
136
150
|
```
|
|
137
151
|
|
|
152
|
+
Implementation details:
|
|
153
|
+
|
|
154
|
+
- `agentId: "auto"` asks the runtime adapter to classify between the primary and secondary host bindings discovered from the workspace
|
|
155
|
+
- when the run belongs to an existing thread, the router includes recent conversation turns so follow-up requests can stay on the correct lane
|
|
156
|
+
- if no model-driven routing prompt is configured, the harness falls back to heuristic routing for obvious research or implementation-style requests
|
|
157
|
+
|
|
138
158
|
### Stream Output And Events
|
|
139
159
|
|
|
140
160
|
```ts
|
|
@@ -166,6 +186,13 @@ spec:
|
|
|
166
186
|
- ref: tool/local-toolset
|
|
167
187
|
```
|
|
168
188
|
|
|
189
|
+
Tool implementation details:
|
|
190
|
+
|
|
191
|
+
- tool modules are discovered from `resources/tools/*.js`, `resources/tools/*.mjs`, and `resources/tools/*.cjs`
|
|
192
|
+
- the preferred format is exporting `tool({...})`; the harness also accepts exported functions plus `nameSchema`, `nameSchemaShape`, or generic `schema` metadata
|
|
193
|
+
- when a module exports exactly one tool function, generic `schema` or `schemaShape` metadata can describe that function
|
|
194
|
+
- keep runtime dependencies for local tools in `resources/package.json`, because the resource package is the execution boundary for those modules
|
|
195
|
+
|
|
169
196
|
### Bridge MCP Servers Into Agents
|
|
170
197
|
|
|
171
198
|
Use `mcpServers:` inside agent YAML to bridge MCP servers into the agent's tool list:
|
|
@@ -245,6 +272,12 @@ Use this file for workspace-wide behavior such as:
|
|
|
245
272
|
- routing via `routing.systemPrompt`
|
|
246
273
|
- background checkpoint maintenance via `maintenance.checkpoints.*`
|
|
247
274
|
|
|
275
|
+
Implementation details:
|
|
276
|
+
|
|
277
|
+
- if `runRoot` is omitted, the harness defaults to `<workspace-root>/run-data`
|
|
278
|
+
- the resolved `runRoot` stores thread indexes, per-thread transcripts, per-run events, approvals, delegations, artifacts, and checkpoint references
|
|
279
|
+
- checkpoint maintenance only starts when `maintenance.checkpoints.enabled: true`; for SQLite checkpoints, cleanup policies can sweep old rows and optionally `VACUUM` the database
|
|
280
|
+
|
|
248
281
|
### `config/agent-context.md`
|
|
249
282
|
|
|
250
283
|
Use this file for shared bootstrap context that agents read at construction time.
|
|
@@ -276,8 +309,19 @@ Use `resources/` for executable extensions:
|
|
|
276
309
|
|
|
277
310
|
Each resource package should include its own `package.json`.
|
|
278
311
|
|
|
312
|
+
Implementation details:
|
|
313
|
+
|
|
314
|
+
- keep runtime extension source under `resources/`; keep tests outside the published source tree, for example under the repository `test/` folder
|
|
315
|
+
- `resources/package.json` is the module resolution boundary used when local tools import third-party packages or skill-local scripts
|
|
316
|
+
- SKILL packages stay file-based, so prompts, templates, helper scripts, and metadata can ship together without extra registration steps
|
|
317
|
+
|
|
279
318
|
### Skills And MCP
|
|
280
319
|
|
|
281
320
|
- Use `resources/skills/` for SKILL packages that carry reusable instructions, templates, scripts, and metadata
|
|
282
321
|
- Use `mcpServers:` in `config/agents/*.yaml` when you want the harness to bridge external MCP tools into an agent
|
|
283
322
|
- Use `createToolMcpServer(...)` or `serveToolsOverStdio(...)` when you want the harness itself to act as an MCP server for another client
|
|
323
|
+
|
|
324
|
+
Implementation details:
|
|
325
|
+
|
|
326
|
+
- agent-declared `mcpServers:` entries are hydrated into concrete MCP tool refs during workspace compilation, then validated against the collected MCP server definitions
|
|
327
|
+
- `createToolMcpServer(...)` exposes the selected agent toolset through one MCP server surface; `serveToolsOverStdio(...)` is the stdio transport wrapper around that same server construction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.26";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.26";
|
|
@@ -133,12 +133,26 @@ function createInlineBackendResolver(workspace) {
|
|
|
133
133
|
inheritEnv: config?.inheritEnv !== false,
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
+
case "VfsSandbox": {
|
|
137
|
+
const rootDir = resolveBackendRootDir(config?.rootDir);
|
|
138
|
+
mkdirSync(rootDir, { recursive: true });
|
|
139
|
+
return new LocalShellBackend({
|
|
140
|
+
rootDir,
|
|
141
|
+
virtualMode: config?.virtualMode === false ? false : true,
|
|
142
|
+
timeout: typeof config?.timeout === "number" ? config.timeout : undefined,
|
|
143
|
+
maxOutputBytes: typeof config?.maxOutputBytes === "number" ? config.maxOutputBytes : undefined,
|
|
144
|
+
env: typeof config?.env === "object" && config.env
|
|
145
|
+
? Object.fromEntries(Object.entries(config.env).filter((entry) => typeof entry[1] === "string"))
|
|
146
|
+
: undefined,
|
|
147
|
+
inheritEnv: config?.inheritEnv !== false,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
136
150
|
case "StateBackend":
|
|
137
151
|
return new StateBackend(runtimeLike);
|
|
138
152
|
case "StoreBackend":
|
|
139
153
|
return new StoreBackend(runtimeLike);
|
|
140
154
|
default:
|
|
141
|
-
throw new Error(`Unsupported DeepAgent backend kind "${kind}". Supported inline kinds: LocalShellBackend, StateBackend, StoreBackend, CompositeBackend.`);
|
|
155
|
+
throw new Error(`Unsupported DeepAgent backend kind "${kind}". Supported inline kinds: LocalShellBackend, VfsSandbox, StateBackend, StoreBackend, CompositeBackend.`);
|
|
142
156
|
}
|
|
143
157
|
};
|
|
144
158
|
return (runtimeLike) => {
|
|
@@ -146,6 +160,8 @@ function createInlineBackendResolver(workspace) {
|
|
|
146
160
|
switch (kind) {
|
|
147
161
|
case "LocalShellBackend":
|
|
148
162
|
return createBackend("LocalShellBackend", backendConfig, runtimeLike);
|
|
163
|
+
case "VfsSandbox":
|
|
164
|
+
return createBackend("VfsSandbox", backendConfig, runtimeLike);
|
|
149
165
|
case "StateBackend":
|
|
150
166
|
return new StateBackend(runtimeLike);
|
|
151
167
|
case "StoreBackend":
|
|
@@ -165,7 +181,7 @@ function createInlineBackendResolver(workspace) {
|
|
|
165
181
|
return new CompatibleCompositeBackend(createBackend(defaultBackendKind, stateConfig, runtimeLike), mappedRoutes);
|
|
166
182
|
}
|
|
167
183
|
default:
|
|
168
|
-
throw new Error(`Unsupported DeepAgent backend kind "${kind}". Supported inline kinds: LocalShellBackend, StateBackend, StoreBackend, CompositeBackend.`);
|
|
184
|
+
throw new Error(`Unsupported DeepAgent backend kind "${kind}". Supported inline kinds: LocalShellBackend, VfsSandbox, StateBackend, StoreBackend, CompositeBackend.`);
|
|
169
185
|
}
|
|
170
186
|
};
|
|
171
187
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botbotgo/agent-harness",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "Agent Harness framework package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "npm@10.9.2",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
33
32
|
"@langchain/anthropic": "^1.1.0",
|
|
34
33
|
"@langchain/community": "^1.1.24",
|
|
35
34
|
"@langchain/core": "^1.1.33",
|
|
@@ -39,7 +38,8 @@
|
|
|
39
38
|
"@langchain/ollama": "^1.2.6",
|
|
40
39
|
"@langchain/openai": "^1.1.0",
|
|
41
40
|
"@libsql/client": "^0.17.0",
|
|
42
|
-
"@llamaindex/ollama": "^0.1.
|
|
41
|
+
"@llamaindex/ollama": "^0.1.23",
|
|
42
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
43
43
|
"deepagents": "1.8.4",
|
|
44
44
|
"langchain": "1.2.34",
|
|
45
45
|
"llamaindex": "^0.12.1",
|
|
@@ -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/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/tool-extension-gaps.test.ts test/checkpoint-maintenance.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/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/tool-extension-gaps.test.ts test/checkpoint-maintenance.test.ts test/llamaindex-dependency-compat.test.ts",
|
|
54
54
|
"release:prepare": "npm version patch --no-git-tag-version && node ./scripts/sync-example-version.mjs",
|
|
55
55
|
"release:pack": "npm pack --dry-run",
|
|
56
56
|
"release:publish": "npm publish --access public --registry https://registry.npmjs.org/"
|