@botbotgo/agent-harness 0.0.135 → 0.0.136

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
@@ -423,13 +423,12 @@ kind: Agent
423
423
  metadata:
424
424
  name: orchestra
425
425
  spec:
426
- execution:
427
- backend: deepagent
428
- modelRef: model/default
429
- mcpServers:
430
- - name: browser
431
- command: node
432
- args: ["./mcp-browser-server.mjs"]
426
+ backend: deepagent
427
+ modelRef: model/default
428
+ mcpServers:
429
+ - name: browser
430
+ command: node
431
+ args: ["./mcp-browser-server.mjs"]
433
432
  ```
434
433
 
435
434
  Expose harness tools as an MCP server:
@@ -478,7 +477,8 @@ Any other local module shape is not supported, and unsupported shapes are reject
478
477
 
479
478
  Default wiring guidance:
480
479
 
481
- - prefer agent-local wiring for workspace-owned function tools
480
+ - let workspace startup scan local and attached `resources` packages into one registry
481
+ - let agents whitelist tools and skills by name
482
482
  - keep `config/catalogs/tools.yaml` for reusable shared tools
483
483
  - keep `config/catalogs/mcp.yaml` for shared MCP server definitions
484
484
  - let agents select MCP tools and apply per-usage MCP overrides where needed
@@ -635,7 +635,7 @@ Use this file for reusable tool objects.
635
635
 
636
636
  Built-in tool families include function tools, backend tools, MCP tools, bundles, and provider-native tools. Provider-native tools are declared in YAML and resolved directly to upstream factories.
637
637
 
638
- For workspace-owned function tools, prefer agent-side wiring first. Keep `config/catalogs/tools.yaml` for reusable shared tool objects rather than making it the default path for every local tool.
638
+ Keep `config/catalogs/tools.yaml` for reusable shared tool objects rather than making it the default path for every local tool. Workspace-owned function tools should normally be discovered from `resources/tools/` and then whitelisted by name in each agent.
639
639
 
640
640
  ### `config/catalogs/mcp.yaml`
641
641
 
@@ -660,12 +660,12 @@ spec:
660
660
 
661
661
  ### `config/agents/*.yaml`
662
662
 
663
- Agents always use `kind: Agent` plus `spec.execution.backend`.
663
+ Agents always use `kind: Agent` plus `spec.backend`.
664
664
 
665
- Use two nested sections:
665
+ Use two sections:
666
666
 
667
667
  - `spec.runtime` for harness-owned runtime placement such as `spec.runtime.runRoot`
668
- - `spec.execution` for upstream execution semantics and adapter-facing config
668
+ - top-level `spec` fields for upstream execution semantics and adapter-facing config
669
669
 
670
670
  Example direct host:
671
671
 
@@ -677,26 +677,28 @@ metadata:
677
677
  spec:
678
678
  runtime:
679
679
  runRoot: ./.agent
680
- execution:
681
- backend: langchain-v1
682
- modelRef: model/default
683
- tools: []
684
- skills: []
685
- memory: []
686
- subagents: []
687
- mcpServers: []
688
- config:
689
- checkpointer:
690
- ref: checkpointer/default
691
- store:
692
- ref: store/default
693
- interruptOn: {}
694
- filesystem:
695
- rootDir: .
696
- virtualMode: true
697
- maxFileSizeMb: 10
698
- middleware: []
699
- systemPrompt: Answer simple requests directly.
680
+ backend: langchain-v1
681
+ modelRef: model/default
682
+ tools:
683
+ - write_file:
684
+ subprocess: true
685
+ skills:
686
+ - code-review
687
+ memory: []
688
+ subagents: []
689
+ mcpServers: []
690
+ config:
691
+ checkpointer:
692
+ ref: checkpointer/default
693
+ store:
694
+ ref: store/default
695
+ interruptOn: {}
696
+ filesystem:
697
+ rootDir: .
698
+ virtualMode: true
699
+ maxFileSizeMb: 10
700
+ middleware: []
701
+ systemPrompt: Answer simple requests directly.
700
702
  ```
701
703
 
702
704
  Example orchestra host:
@@ -709,27 +711,28 @@ metadata:
709
711
  spec:
710
712
  runtime:
711
713
  runRoot: ./.agent
712
- execution:
713
- backend: deepagent
714
- modelRef: model/default
715
- memory:
716
- - path: config/agent-context.md
717
- tools: []
718
- skills: []
719
- subagents: []
720
- mcpServers: []
721
- config:
722
- store:
723
- ref: store/default
724
- checkpointer:
725
- ref: checkpointer/default
726
- backend:
727
- ref: backend/default
728
- interruptOn: {}
729
- middleware: []
714
+ backend: deepagent
715
+ modelRef: model/default
716
+ memory:
717
+ - path: config/agent-context.md
718
+ tools:
719
+ - stock_snapshot
720
+ skills:
721
+ - stock-research
722
+ subagents: []
723
+ mcpServers: []
724
+ config:
725
+ store:
726
+ ref: store/default
727
+ checkpointer:
728
+ ref: checkpointer/default
729
+ backend:
730
+ ref: backend/default
731
+ interruptOn: {}
732
+ middleware: []
730
733
  ```
731
734
 
732
- 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).
735
+ For backend-specific options, prefer the upstream concept directly inside `spec.config`. Upstream feature coverage is tracked in [docs/upstream-feature-matrix.md](docs/upstream-feature-matrix.md).
733
736
 
734
737
  ## Design Notes
735
738
 
package/README.zh.md CHANGED
@@ -423,13 +423,12 @@ kind: Agent
423
423
  metadata:
424
424
  name: orchestra
425
425
  spec:
426
- execution:
427
- backend: deepagent
428
- modelRef: model/default
429
- mcpServers:
430
- - name: browser
431
- command: node
432
- args: ["./mcp-browser-server.mjs"]
426
+ backend: deepagent
427
+ modelRef: model/default
428
+ mcpServers:
429
+ - name: browser
430
+ command: node
431
+ args: ["./mcp-browser-server.mjs"]
433
432
  ```
434
433
 
435
434
  将 harness 工具作为 MCP 服务对外暴露:
@@ -478,6 +477,8 @@ await stop(runtime);
478
477
 
479
478
  主要有三层配置:
480
479
 
480
+ - 先由 workspace 启动时扫描本地和附加的 `resources` 包,建立统一 registry
481
+ - agent 再按名字白名单选择 tools 与 skills
481
482
  - `config/runtime/workspace.yaml` 中的运行时策略
482
483
  - `config/catalogs/*.yaml` 中的可复用对象目录
483
484
  - `config/agents/*.yaml` 中的 agent 装配
@@ -625,6 +626,8 @@ spec:
625
626
 
626
627
  内置工具族包括函数工具、后端工具、MCP 工具、bundle 与原生 provider 工具。原生 provider 工具在 YAML 中声明并直接解析到上游工厂。
627
628
 
629
+ `config/catalogs/tools.yaml` 更适合放可复用共享工具对象,而不应成为每个本地工具的默认入口。工作区自有函数工具通常应从 `resources/tools/` 发现,再由各 agent 按名字白名单启用。
630
+
628
631
  ### `config/catalogs/mcp.yaml`
629
632
 
630
633
  命名 MCP 服务预设。
@@ -646,12 +649,12 @@ spec:
646
649
 
647
650
  ### `config/agents/*.yaml`
648
651
 
649
- Agent 始终使用 `kind: Agent` 以及 `spec.execution.backend`。
652
+ Agent 始终使用 `kind: Agent` 以及 `spec.backend`。
650
653
 
651
- 两个嵌套区块:
654
+ 两个区块:
652
655
 
653
656
  - `spec.runtime`:harness 侧运行时放置,例如 `spec.runtime.runRoot`
654
- - `spec.execution`:上游执行语义与面向适配器的配置
657
+ - `spec` 顶层字段:上游执行语义与面向适配器的配置
655
658
 
656
659
  direct 主机示例:
657
660
 
@@ -663,26 +666,28 @@ metadata:
663
666
  spec:
664
667
  runtime:
665
668
  runRoot: ./.agent
666
- execution:
667
- backend: langchain-v1
668
- modelRef: model/default
669
- tools: []
670
- skills: []
671
- memory: []
672
- subagents: []
673
- mcpServers: []
674
- config:
675
- checkpointer:
676
- ref: checkpointer/default
677
- store:
678
- ref: store/default
679
- interruptOn: {}
680
- filesystem:
681
- rootDir: .
682
- virtualMode: true
683
- maxFileSizeMb: 10
684
- middleware: []
685
- systemPrompt: Answer simple requests directly.
669
+ backend: langchain-v1
670
+ modelRef: model/default
671
+ tools:
672
+ - write_file:
673
+ subprocess: true
674
+ skills:
675
+ - code-review
676
+ memory: []
677
+ subagents: []
678
+ mcpServers: []
679
+ config:
680
+ checkpointer:
681
+ ref: checkpointer/default
682
+ store:
683
+ ref: store/default
684
+ interruptOn: {}
685
+ filesystem:
686
+ rootDir: .
687
+ virtualMode: true
688
+ maxFileSizeMb: 10
689
+ middleware: []
690
+ systemPrompt: Answer simple requests directly.
686
691
  ```
687
692
 
688
693
  orchestra 主机示例:
@@ -695,27 +700,28 @@ metadata:
695
700
  spec:
696
701
  runtime:
697
702
  runRoot: ./.agent
698
- execution:
699
- backend: deepagent
700
- modelRef: model/default
701
- memory:
702
- - path: config/agent-context.md
703
- tools: []
704
- skills: []
705
- subagents: []
706
- mcpServers: []
707
- config:
708
- store:
709
- ref: store/default
710
- checkpointer:
711
- ref: checkpointer/default
712
- backend:
713
- ref: backend/default
714
- interruptOn: {}
715
- middleware: []
703
+ backend: deepagent
704
+ modelRef: model/default
705
+ memory:
706
+ - path: config/agent-context.md
707
+ tools:
708
+ - stock_snapshot
709
+ skills:
710
+ - stock-research
711
+ subagents: []
712
+ mcpServers: []
713
+ config:
714
+ store:
715
+ ref: store/default
716
+ checkpointer:
717
+ ref: checkpointer/default
718
+ backend:
719
+ ref: backend/default
720
+ interruptOn: {}
721
+ middleware: []
716
722
  ```
717
723
 
718
- 后端相关选项优先直接写在 `spec.execution.config` 中沿用上游概念。上游能力覆盖见 [docs/upstream-feature-matrix.md](docs/upstream-feature-matrix.md)。
724
+ 后端相关选项优先直接写在 `spec.config` 中沿用上游概念。上游能力覆盖见 [docs/upstream-feature-matrix.md](docs/upstream-feature-matrix.md)。
719
725
 
720
726
  ## 设计说明
721
727
 
@@ -1,7 +1,7 @@
1
1
  # agent-harness feature: schema version for this declarative config object.
2
2
  apiVersion: agent-harness/v1alpha1
3
3
  # agent-harness feature: object type discriminator.
4
- # Prefer the generic `Agent` form and select the concrete execution backend under `spec.execution`.
4
+ # Prefer the generic `Agent` form and place execution fields directly under `spec`.
5
5
  kind: Agent
6
6
  metadata:
7
7
  # agent-harness feature: stable object id used for refs and host-agent selection.
@@ -19,74 +19,73 @@ spec:
19
19
  # =====================
20
20
  # Runtime Agent Features
21
21
  # =====================
22
- execution:
23
- # Current backend adapter for this host profile.
24
- backend: langchain-v1
25
- # Upstream execution feature: model ref for the underlying LLM used by the direct-response agent.
26
- # This should point at a cheap, fast, general-purpose chat model, because `direct` is intended
27
- # to be the low-latency path for simple requests.
28
- modelRef: model/default
29
- # Upstream execution feature: direct host starts with no attached explicit tools by default.
30
- tools: []
31
- # Upstream execution feature: direct host starts with no attached local skill packages by default.
32
- skills: []
33
- # Upstream execution feature: direct host does not bootstrap project memory by default.
34
- memory: []
35
- # Upstream execution feature: direct host does not predeclare subagents by default.
36
- subagents: []
37
- # Upstream execution feature: direct host does not attach MCP servers by default.
38
- mcpServers: []
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.
22
+ # Current backend adapter for this host profile.
23
+ backend: langchain-v1
24
+ # Upstream execution feature: model ref for the underlying LLM used by the direct-response agent.
25
+ # This should point at a cheap, fast, general-purpose chat model, because `direct` is intended
26
+ # to be the low-latency path for simple requests.
27
+ modelRef: model/default
28
+ # Upstream execution feature: direct host starts with no attached explicit tools by default.
29
+ tools: []
30
+ # Upstream execution feature: direct host starts with no attached local skill packages by default.
31
+ skills: []
32
+ # Upstream execution feature: direct host does not bootstrap project memory by default.
33
+ memory: []
34
+ # Upstream execution feature: direct host does not predeclare subagents by default.
35
+ subagents: []
36
+ # Upstream execution feature: direct host does not attach MCP servers by default.
37
+ mcpServers: []
38
+ # Runtime execution feature: checkpointer config passed into the selected backend adapter.
39
+ # Even the lightweight direct path can benefit from resumable state during interactive use.
40
+ # Available `kind` options in this harness: `FileCheckpointer`, `MemorySaver`, `SqliteSaver`.
41
+ # `path` is only used by `FileCheckpointer` and `SqliteSaver`; omit it for `MemorySaver`.
42
+ checkpointer:
43
+ ref: checkpointer/sqlite
44
+ # Upstream execution feature: LangGraph store available to middleware and runtime context hooks.
45
+ # The default direct host keeps this enabled so middleware can use the same durable store surface as other hosts.
46
+ store:
47
+ ref: store/default
48
+ # Upstream execution feature: no declarative HITL tool routing by default.
49
+ interruptOn: {}
50
+ # Upstream execution feature: filesystem middleware settings for LangChain v1 agents.
51
+ # This only becomes active when `middleware` includes `{ kind: filesystem }`, or when
52
+ # automatic upstream middleware such as skills or memory need a filesystem backend.
53
+ # Keep the default root inside the workspace so file-aware middleware stays bounded.
54
+ filesystem:
55
+ rootDir: .
56
+ virtualMode: true
57
+ maxFileSizeMb: 10
58
+ # Upstream execution feature: no extra declarative middleware beyond the runtime's automatic injections.
59
+ # Common upstream middleware kinds that this harness can compile directly from YAML:
60
+ # - `filesystem`
61
+ # - `patchToolCalls`
62
+ # - `summarization`
63
+ # - `dynamicSystemPrompt`
64
+ # - `humanInTheLoop`
65
+ # - `todoList`
66
+ # - `pii`, `piiRedaction`
67
+ #
68
+ # Keep the default empty so the lightweight direct host stays minimal.
69
+ middleware: []
70
+ # Upstream execution feature: system prompt for the lightweight direct-response host.
71
+ # This prompt should keep the agent focused on:
72
+ # - answering simple requests in one turn
73
+ # - staying lightweight instead of planning or orchestrating
74
+ # - avoiding delegation-heavy decomposition unless the caller explicitly switches agents
75
+ #
76
+ # The direct host is intentionally narrower than the orchestra host:
77
+ # - `direct` is optimized for latency and straightforward completion
78
+ # - `orchestra` is optimized for multi-step work, tools, and delegation
79
+ #
80
+ # Keep this prompt biased toward concise, self-contained answers. If richer routing policy is
81
+ # needed for choosing between host agents, configure that separately via `Runtime.spec.routing`
82
+ # rather than overloading the direct host prompt with classifier behavior.
83
+ systemPrompt: |-
84
+ You are the direct agent.
86
85
 
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.
86
+ This is a manual low-latency host.
87
+ Answer simple requests directly.
88
+ Keep the path lightweight.
89
+ Do not delegate.
90
+ Do not perform broad multi-step execution.
91
+ Do not behave like the default execution host.