@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 +54 -51
- package/README.zh.md +55 -49
- package/dist/config/agents/direct.yaml +70 -71
- package/dist/config/agents/orchestra.yaml +90 -91
- package/dist/contracts/workspace.d.ts +2 -2
- package/dist/extensions.js +5 -1
- package/dist/init-project.js +19 -21
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/resource/resource-impl.js +1 -1
- package/dist/tool-modules.d.ts +5 -0
- package/dist/tool-modules.js +10 -0
- package/dist/workspace/compile.js +139 -11
- package/dist/workspace/object-loader.js +118 -120
- package/dist/workspace/support/source-collectors.js +1 -1
- package/dist/workspace/support/workspace-ref-utils.d.ts +1 -0
- package/dist/workspace/support/workspace-ref-utils.js +9 -0
- package/dist/workspace/yaml-object-reader.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -423,13 +423,12 @@ kind: Agent
|
|
|
423
423
|
metadata:
|
|
424
424
|
name: orchestra
|
|
425
425
|
spec:
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
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.
|
|
663
|
+
Agents always use `kind: Agent` plus `spec.backend`.
|
|
664
664
|
|
|
665
|
-
Use two
|
|
665
|
+
Use two sections:
|
|
666
666
|
|
|
667
667
|
- `spec.runtime` for harness-owned runtime placement such as `spec.runtime.runRoot`
|
|
668
|
-
- `spec
|
|
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
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
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
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
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.
|
|
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
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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.
|
|
652
|
+
Agent 始终使用 `kind: Agent` 以及 `spec.backend`。
|
|
650
653
|
|
|
651
|
-
|
|
654
|
+
两个区块:
|
|
652
655
|
|
|
653
656
|
- `spec.runtime`:harness 侧运行时放置,例如 `spec.runtime.runRoot`
|
|
654
|
-
- `spec
|
|
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
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
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
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
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.
|
|
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
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
checkpointer
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
store
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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.
|