@botbotgo/agent-harness 0.0.70 → 0.0.71

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
@@ -184,6 +184,26 @@ const runtime: AgentHarnessRuntime = await createAgentHarness("/absolute/path/to
184
184
 
185
185
  `createAgentHarness(...)` loads the workspace, resolves `resources/`, initializes persistence under `runRoot`, and starts runtime maintenance.
186
186
 
187
+ `createAgentHarness(..., { load })` accepts workspace loading controls.
188
+
189
+ Merge order is deterministic:
190
+
191
+ - framework defaults
192
+ - each `overlayRoots` entry in order
193
+ - workspace root
194
+
195
+ Later values always override earlier values. Arrays are replaced, while plain objects are deep-merged.
196
+
197
+ ```ts
198
+ import { createAgentHarness } from "@botbotgo/agent-harness";
199
+
200
+ const runtime = await createAgentHarness("/path/to/workspace", {
201
+ load: {
202
+ overlayRoots: ["/path/to/framework-defaults", "/path/to/product-overrides"],
203
+ },
204
+ });
205
+ ```
206
+
187
207
  ### Run A Request
188
208
 
189
209
  ```ts
package/README.zh.md CHANGED
@@ -183,6 +183,26 @@ const runtime: AgentHarnessRuntime = await createAgentHarness("/absolute/path/to
183
183
 
184
184
  `createAgentHarness(...)` 会加载工作区、解析 `resources/`、在 `runRoot` 下初始化持久化,并启动运行时维护任务。
185
185
 
186
+ `createAgentHarness(..., { load })` 支持工作区加载控制。
187
+
188
+ 合并顺序是确定性的:
189
+
190
+ - 框架默认配置
191
+ - 每个 `overlayRoots` 条目(按数组顺序)
192
+ - workspace 根目录
193
+
194
+ 后者会覆盖前者;数组会被直接替换,普通对象会执行深度合并。
195
+
196
+ ```ts
197
+ import { createAgentHarness } from "@botbotgo/agent-harness";
198
+
199
+ const runtime = await createAgentHarness("/path/to/workspace", {
200
+ load: {
201
+ overlayRoots: ["/path/to/framework-defaults", "/path/to/product-overrides"],
202
+ },
203
+ });
204
+ ```
205
+
186
206
  ### 发起一次运行
187
207
 
188
208
  ```ts
package/dist/api.d.ts CHANGED
@@ -5,6 +5,10 @@ import type { RequirementAssessmentOptions } from "./runtime/skill-requirements.
5
5
  import type { ToolMcpServerOptions } from "./mcp.js";
6
6
  export { AgentHarnessRuntime } from "./runtime/harness.js";
7
7
  type CreateAgentHarnessOptions = {
8
+ /**
9
+ * Workspace loading behavior.
10
+ * overlayRoots are merged after framework defaults and before workspaceRoot.
11
+ */
8
12
  load?: WorkspaceLoadOptions;
9
13
  adapter?: RuntimeAdapterOptions;
10
14
  };
@@ -220,6 +220,12 @@ export type WorkspaceBundle = {
220
220
  bindings: Map<string, CompiledAgentBinding>;
221
221
  };
222
222
  export type WorkspaceLoadOptions = {
223
+ /**
224
+ * Additional workspace roots to load before the runtime workspace root.
225
+ * Merge order is deterministic:
226
+ * framework defaults -> each overlayRoot (in order) -> workspaceRoot.
227
+ * Later values always override earlier values.
228
+ */
223
229
  overlayRoots?: string[];
224
230
  resourceSources?: string[];
225
231
  };
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.69";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.70";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.69";
1
+ export const AGENT_HARNESS_VERSION = "0.0.70";
@@ -17,5 +17,17 @@ export declare function readToolModuleItems(root: string): Promise<Array<{
17
17
  item: Record<string, unknown>;
18
18
  sourcePath: string;
19
19
  }>>;
20
+ /**
21
+ * Load and merge workspace objects in deterministic order:
22
+ * 1) framework workspace defaults
23
+ * 2) overlay roots in order
24
+ * 3) workspaceRoot
25
+ *
26
+ * Merge semantics:
27
+ * - later sources override earlier sources
28
+ * - arrays are replaced, not concatenated
29
+ * - plain objects are merged recursively
30
+ * - scalars and non-plain objects are replaced
31
+ */
20
32
  export declare function loadWorkspaceObjects(workspaceRoot: string, options?: WorkspaceLoadOptions): Promise<WorkspaceObjects>;
21
33
  export {};
@@ -624,6 +624,18 @@ export async function readToolModuleItems(root) {
624
624
  function inferExecutionMode(item, current) {
625
625
  return resolveExecutionBackend(item, current);
626
626
  }
627
+ /**
628
+ * Load and merge workspace objects in deterministic order:
629
+ * 1) framework workspace defaults
630
+ * 2) overlay roots in order
631
+ * 3) workspaceRoot
632
+ *
633
+ * Merge semantics:
634
+ * - later sources override earlier sources
635
+ * - arrays are replaced, not concatenated
636
+ * - plain objects are merged recursively
637
+ * - scalars and non-plain objects are replaced
638
+ */
627
639
  export async function loadWorkspaceObjects(workspaceRoot, options = {}) {
628
640
  const refs = new Map();
629
641
  const mergedAgents = new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",