@anyswarm/core 0.5.2 → 0.6.0

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.
Files changed (210) hide show
  1. package/AGENTS.md +19 -4
  2. package/README.md +68 -61
  3. package/dist/examples/README.md +134 -84
  4. package/dist/examples/autoresearch/README.md +106 -21
  5. package/dist/examples/autoresearch/REQUIREMENTS.zh.md +14 -6
  6. package/dist/examples/autoresearch/config.d.ts +48 -5
  7. package/dist/examples/autoresearch/config.js +57 -23
  8. package/dist/examples/autoresearch/demo.d.ts +12 -4
  9. package/dist/examples/autoresearch/demo.js +65 -22
  10. package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -2
  11. package/dist/examples/autoresearch/frontiercs2-config.js +13 -2
  12. package/dist/examples/autoresearch/frontiercs2.d.ts +18 -1
  13. package/dist/examples/autoresearch/frontiercs2.js +71 -14
  14. package/dist/examples/autoresearch/prepare-demo.js +34 -3
  15. package/dist/examples/autoresearch/prepare.d.ts +105 -53
  16. package/dist/examples/autoresearch/prepare.js +126 -57
  17. package/dist/examples/autoresearch/project.d.ts +6 -1
  18. package/dist/examples/autoresearch/project.js +130 -26
  19. package/dist/examples/autoresearch/research-service.d.ts +16 -1
  20. package/dist/examples/autoresearch/research-service.js +84 -44
  21. package/dist/examples/code/config.d.ts +1 -0
  22. package/dist/examples/first-harness/AGENTS.md +25 -0
  23. package/dist/examples/first-harness/README.md +136 -0
  24. package/dist/examples/first-harness/config.d.ts +9 -8
  25. package/dist/examples/first-harness/config.js +33 -26
  26. package/dist/examples/first-harness/eject.json +14 -0
  27. package/dist/examples/first-harness/handoff.js +3 -3
  28. package/dist/examples/first-harness/harness.d.ts +14 -18
  29. package/dist/examples/first-harness/harness.js +102 -77
  30. package/dist/examples/first-harness/input/README.md +7 -0
  31. package/dist/examples/first-harness/session.js +2 -1
  32. package/dist/examples/first-harness/tsconfig.json +2 -1
  33. package/dist/examples/harness-session/README.md +1 -1
  34. package/dist/examples/lead-worker/README.md +1 -1
  35. package/dist/examples/lead-worker/project-config.d.ts +1 -0
  36. package/dist/examples/messages/README.md +2 -2
  37. package/dist/examples/notes/README.md +2 -2
  38. package/dist/examples/notes/config.d.ts +1 -0
  39. package/dist/examples/parallel-swarm/AGENTS.md +32 -0
  40. package/dist/examples/parallel-swarm/README.md +136 -0
  41. package/dist/examples/parallel-swarm/board-service.js +25 -8
  42. package/dist/examples/parallel-swarm/board.d.ts +31 -1
  43. package/dist/examples/parallel-swarm/board.js +98 -13
  44. package/dist/examples/parallel-swarm/config.d.ts +11 -0
  45. package/dist/examples/parallel-swarm/config.js +39 -0
  46. package/dist/examples/parallel-swarm/eject.json +5 -0
  47. package/dist/examples/parallel-swarm/harness.d.ts +26 -20
  48. package/dist/examples/parallel-swarm/harness.js +77 -76
  49. package/dist/examples/parallel-swarm/report.d.ts +12 -0
  50. package/dist/examples/parallel-swarm/report.js +30 -0
  51. package/dist/examples/peermesh/README.md +1 -1
  52. package/dist/examples/peermesh/project-config.d.ts +1 -0
  53. package/dist/examples/services/agent-control/README.md +1 -1
  54. package/dist/examples/services/mathlib-search/README.md +1 -1
  55. package/dist/examples/services/mcp-managed/README.md +1 -1
  56. package/dist/examples/services/persistent-board/README.md +1 -1
  57. package/dist/examples/subagents/AGENTS.md +35 -0
  58. package/dist/examples/subagents/README.md +129 -93
  59. package/dist/examples/subagents/config.d.ts +2 -10
  60. package/dist/examples/subagents/config.js +8 -15
  61. package/dist/examples/subagents/eject.json +17 -0
  62. package/dist/examples/subagents/handoff-config.d.ts +41 -0
  63. package/dist/examples/subagents/handoff-config.js +13 -0
  64. package/dist/examples/subagents/model.d.ts +3 -0
  65. package/dist/examples/subagents/model.js +19 -0
  66. package/dist/examples/substrate/README.md +12 -6
  67. package/dist/examples/substrate/config.d.ts +1 -0
  68. package/dist/examples/substrate/project-config.d.ts +1 -0
  69. package/dist/examples/taskpool/README.md +1 -1
  70. package/dist/examples/taskpool/config.d.ts +1 -0
  71. package/dist/examples/taskpool/deploy/service-hosts/service-authority-snapshot.d.ts +4 -4
  72. package/dist/scripts/anyswarm-progress.js +36 -5
  73. package/dist/scripts/build-provenance.json +1 -1
  74. package/dist/scripts/generate-architecture-coverage.js +1 -1
  75. package/dist/scripts/generate-architecture-prompts.js +18 -10
  76. package/dist/scripts/local-environment.d.ts +3 -3
  77. package/dist/scripts/local-environment.js +6 -1
  78. package/dist/scripts/local-setup.js +25 -18
  79. package/dist/scripts/pack-release.js +27 -3
  80. package/dist/src/core/index.js +1 -1
  81. package/dist/src/core/sandbox/opensandbox-backend.js +10 -4
  82. package/dist/src/core/sandbox/sandbox-connection.d.ts +9 -2
  83. package/dist/src/core/sandbox/sandbox-connection.js +22 -7
  84. package/dist/src/harness/project-harness.js +3 -2
  85. package/dist/src/harness/project-rpc-client.js +19 -0
  86. package/dist/src/harness/typescript-loader.d.ts +2 -0
  87. package/dist/src/harness/typescript-loader.js +26 -8
  88. package/dist/src/trace-viewer/command.mjs +6 -3
  89. package/dist/src/trace-viewer/public/app.js +239 -59
  90. package/dist/src/trace-viewer/public/index.html +5 -0
  91. package/dist/src/trace-viewer/public/style.css +22 -0
  92. package/dist/src/trace-viewer/reader.mjs +242 -26
  93. package/dist/src/trace-viewer/run-root.d.mts +1 -0
  94. package/dist/src/trace-viewer/run-root.mjs +7 -0
  95. package/dist/src/trace-viewer/server.mjs +3 -1
  96. package/docs/INDEX.md +9 -8
  97. package/docs/architecture/06-observability-experiments.md +21 -7
  98. package/docs/architecture/07-run-configuration.md +97 -12
  99. package/docs/architecture/08-prompts.md +21 -2
  100. package/docs/architecture/10-service-api-reference.md +12 -5
  101. package/docs/architecture/12-code-coverage.md +129 -86
  102. package/docs/architecture/15-core-runtime.md +1 -1
  103. package/docs/architecture/16-pi-opensandbox-backend.md +2 -0
  104. package/docs/architecture/17-harness-reporting.md +78 -0
  105. package/docs/architecture/22-website.md +53 -18
  106. package/docs/architecture/23-project-harness.md +63 -16
  107. package/docs/architecture/28-autoresearch.md +16 -22
  108. package/docs/architecture/prompts/11-first-sdk-harness.md +9 -9
  109. package/docs/architecture/prompts/16-parallel-swarm.md +46 -13
  110. package/docs/architecture/prompts/22-autoresearch.md +9 -2
  111. package/docs/architecture/prompts/source-manifest.json +78 -54
  112. package/docs/architecture/source-map.json +396 -36
  113. package/docs/designs/core-harness/06-project-harness.md +1 -1
  114. package/docs/en/autoresearch.md +41 -0
  115. package/docs/en/blog/100b-tokens.md +157 -0
  116. package/docs/en/build-your-harness.md +47 -22
  117. package/docs/en/changelog.md +22 -1
  118. package/docs/en/first-harness.md +40 -32
  119. package/docs/en/harnesses/index.md +23 -23
  120. package/docs/en/harnesses/subagents.md +8 -29
  121. package/docs/en/latest.md +26 -5
  122. package/docs/en/overview.md +22 -22
  123. package/docs/en/quickstart.md +55 -21
  124. package/docs/en/reference/api.md +1 -1
  125. package/docs/en/trace-viewer.md +32 -12
  126. package/docs/operations/trace-viewer.md +25 -10
  127. package/docs/workflows/development.md +160 -120
  128. package/docs/workflows/release-and-docs-versioning.md +207 -55
  129. package/docs/workflows/release-cli-acceptance.md +124 -47
  130. package/docs/zh/autoresearch.md +41 -0
  131. package/docs/zh/blog/100b-tokens.md +102 -0
  132. package/docs/zh/build-your-harness.md +48 -23
  133. package/docs/zh/changelog.md +22 -1
  134. package/docs/zh/first-harness.md +43 -35
  135. package/docs/zh/harnesses/index.md +23 -23
  136. package/docs/zh/harnesses/subagents.md +8 -29
  137. package/docs/zh/latest.md +26 -5
  138. package/docs/zh/overview.md +23 -23
  139. package/docs/zh/quickstart.md +51 -21
  140. package/docs/zh/reference/api.md +1 -1
  141. package/docs/zh/trace-viewer.md +32 -12
  142. package/examples/README.md +134 -84
  143. package/examples/autoresearch/README.md +106 -21
  144. package/examples/autoresearch/REQUIREMENTS.zh.md +14 -6
  145. package/examples/autoresearch/config.ts +64 -25
  146. package/examples/autoresearch/demo.ts +75 -22
  147. package/examples/autoresearch/frontiercs2-config.ts +13 -2
  148. package/examples/autoresearch/frontiercs2.ts +64 -11
  149. package/examples/autoresearch/prepare-demo.ts +32 -3
  150. package/examples/autoresearch/prepare.ts +134 -60
  151. package/examples/autoresearch/project.ts +119 -26
  152. package/examples/autoresearch/research-service.ts +91 -41
  153. package/examples/first-harness/AGENTS.md +25 -0
  154. package/examples/first-harness/README.md +136 -0
  155. package/examples/first-harness/config.ts +41 -27
  156. package/examples/first-harness/eject.json +14 -0
  157. package/examples/first-harness/handoff.ts +3 -3
  158. package/examples/first-harness/harness.ts +104 -72
  159. package/examples/first-harness/input/README.md +7 -0
  160. package/examples/first-harness/session.ts +2 -1
  161. package/examples/first-harness/tsconfig.json +2 -1
  162. package/examples/harness-session/README.md +1 -1
  163. package/examples/lead-worker/README.md +1 -1
  164. package/examples/messages/README.md +2 -2
  165. package/examples/notes/README.md +2 -2
  166. package/examples/parallel-swarm/AGENTS.md +32 -0
  167. package/examples/parallel-swarm/README.md +136 -0
  168. package/examples/parallel-swarm/board-service.ts +28 -9
  169. package/examples/parallel-swarm/board.ts +107 -13
  170. package/examples/parallel-swarm/config.ts +47 -0
  171. package/examples/parallel-swarm/eject.json +5 -0
  172. package/examples/parallel-swarm/harness.ts +83 -71
  173. package/examples/parallel-swarm/report.ts +33 -0
  174. package/examples/peermesh/README.md +1 -1
  175. package/examples/services/agent-control/README.md +1 -1
  176. package/examples/services/mathlib-search/README.md +1 -1
  177. package/examples/services/mcp-managed/README.md +1 -1
  178. package/examples/services/persistent-board/README.md +1 -1
  179. package/examples/subagents/AGENTS.md +35 -0
  180. package/examples/subagents/README.md +129 -93
  181. package/examples/subagents/config.ts +8 -15
  182. package/examples/subagents/eject.json +17 -0
  183. package/examples/subagents/handoff-config.ts +14 -0
  184. package/examples/subagents/model.ts +20 -0
  185. package/examples/substrate/README.md +12 -6
  186. package/examples/taskpool/README.md +1 -1
  187. package/npm-shrinkwrap.development.json +9 -2
  188. package/npm-shrinkwrap.json +9 -2
  189. package/package.development.json +2 -1
  190. package/package.json +2 -1
  191. package/scripts/anyswarm-progress.ts +36 -6
  192. package/scripts/generate-architecture-coverage.ts +1 -1
  193. package/scripts/generate-architecture-prompts.ts +21 -10
  194. package/scripts/local-environment.ts +8 -1
  195. package/scripts/local-setup.ts +22 -17
  196. package/scripts/pack-release.ts +24 -3
  197. package/src/core/index.ts +1 -1
  198. package/src/core/sandbox/opensandbox-backend.ts +10 -4
  199. package/src/core/sandbox/sandbox-connection.ts +22 -7
  200. package/src/harness/project-harness.ts +3 -2
  201. package/src/harness/project-rpc-client.ts +23 -0
  202. package/src/harness/typescript-loader.ts +28 -8
  203. package/src/trace-viewer/command.mjs +6 -3
  204. package/src/trace-viewer/public/app.js +239 -59
  205. package/src/trace-viewer/public/index.html +5 -0
  206. package/src/trace-viewer/public/style.css +22 -0
  207. package/src/trace-viewer/reader.mjs +242 -26
  208. package/src/trace-viewer/run-root.d.mts +1 -0
  209. package/src/trace-viewer/run-root.mjs +7 -0
  210. package/src/trace-viewer/server.mjs +3 -1
@@ -1,35 +1,35 @@
1
1
  ---
2
2
  title: 文档总览
3
- description: 了解 AnySwarm 解决什么问题、文档如何按六大核心构件组织,以及从哪里开始上手。
4
- section: 快速开始
3
+ description: 使用 AnySwarm 运行有实际用途的多 Agent 工作流、检查证据,并用 TypeScript SDK 定制协作。
4
+ section: GET STARTED
5
5
  order: 0
6
6
  ---
7
7
 
8
- **`anyswarm`**(`@anyswarm/core`)是一个本地优先的多智能体框架,用来构建、隔离运行并回放多智能体协作系统。
8
+ AnySwarm 是面向多 Agent 团队的 TypeScript SDK 与 CLI,提供独立工作区、共享状态和可检查的结果。**Harness** 定义角色、协作与结束条件;**Runtime** 运行团队、鉴权 Service 调用并收集记录与产物。
9
9
 
10
- 它把**多智能体协作规则**与**底层隔离运行**拆成两层:
10
+ ## 从一项工作开始
11
11
 
12
- - **你编写 Harness**——定义团队角色、共享协作服务(Services)以及协作流转规则。
13
- - **AnySwarm 提供运行底座**——负责每个 Agent 的隔离容器(Sandbox)、运行控制面(Runtime)、宿主机鉴权网关(Host Gateway),以及内置浏览器轨迹查看器(Trace Viewer)。
12
+ | 工作 | 成员如何协作 | 查看什么 |
13
+ | --- | --- | --- |
14
+ | [仓库工程交接](quickstart.md) | Root 将独立源码检查交给子 Agent,核对引用后编写 `report.md`。 | 子 Agent 的文件阅读、交接发现与导出报告;通用 Subagents 不独立认证内容结论。 |
15
+ | [AutoResearch](autoresearch.md) | Peer 探索并 Review Patch,宿主控制的 Evaluator 给冻结候选评分。 | 候选身份、Review、训练反馈与最终评测。可编辑的双 Peer FrontierCS-2 示例有单独的模型、评测器和资源要求。 |
14
16
 
15
- TypeScript SDK、宿主机 `anyswarm` CLI、容器内 `swarm` CLI 与 `anyswarm trace` 全部打包在同一个 `@anyswarm/core` 安装包中。
17
+ 无需安装即可打开[真实 p-limit 交接回放](https://anyswarm.github.io/anyswarm/trace-demo/index.html?run=p-limit-handoff)。在 **Files & Results** 中可以阅读原始报告。
16
18
 
17
- ## 文档结构一览
19
+ ## 三层示例路径
18
20
 
19
- 文档完全按照首页心智模型的 **6 个核心构件** 逐篇展开,再通过两篇由浅入深的动手实战串联起来:
21
+ 1. **Tier 1——运行任务或学习 SDK。** 用[快速上手](quickstart.md)检查自己的仓库;编写 Harness 时按[第一个 Harness](first-harness.md) → [并行 Swarm](build-your-harness.md)学习。SDK 教程使用 0.6.0 或匹配的源码构建包。
22
+ 2. **Tier 2——应用与协作参考。** 了解 [AutoResearch](autoresearch.md),再按需求研究 [Subagents](harnesses/subagents.md)、[TaskPool](harnesses/taskpool.md)、[Substrate](harnesses/substrate.md)。这三种拓扑在共同 Runtime 环境之上,由宿主创建本地业务 Services。
23
+ 3. **Tier 3——进阶源码与集成。** `super`、`code`、`harness-session` 和各个 Service 示例供开发者查阅,Code 开发暂时暂停。[PeerMesh](harnesses/peermesh.md) 需要 Gitea、Mattermost、MySQL 与 Board 进程;[Lead-Worker](harnesses/lead-worker.md) 需要 Gitea。完整清单见[示例目录](../../examples/README.md)。
20
24
 
21
- 1. **快速开始**:[快速上手](quickstart.md)(安装并跑通第一次运行)→ [核心概念](concepts.md)(一张图看懂全局)。
22
- 2. **核心构件**:
23
- - [Sandbox 隔离沙箱](sandbox.md)——每个 Agent 的独立沙箱、网络策略、资源限额与 Kubernetes 部署。
24
- - [Runtime 运行控制面](runtime.md)——运行配置、文件快照同步、事件监控、动态管理、安全收尾与持久化恢复。
25
- - [Agent 与 Profile](agents.md)——角色定义、持久会话、发消息、中断、会话控制与自动压缩策略。
26
- - [Host Gateway 宿主机网关](gateway.md)——Service 鉴权校验、统一回调入口与模型密钥隔离。
27
- - [Services 与权限](services.md)——为什么不用本地 Tools 做协作、如何接入业务类或外部 HTTP 服务、静态与动态授权。
28
- - [Trace Viewer 观测与调试](trace-viewer.md)——内嵌真实可缩放泳道图,回放模型调用、协作交接与导出文件。
29
- 3. **动手实战**:
30
- - [搭建第一个 SDK Harness](first-harness.md)——用标准 `Harness` 接口跑通双 Agent 终端交互交接与产物校验。
31
- - [实战:构建 Swarm Harness](build-your-harness.md)——从零搭建并行调研 + 综合的多智能体 Swarm。
32
- 4. **内置 Harness**:[选择 Harness](harnesses/index.md)——直接运行或参考 `Subagents`、`TaskPool`、`PeerMesh`、`Substrate` 与 `Lead-Worker`。
33
- 5. **参考手册与版本**:[SDK 与 API 参考](reference/api.md) · [CLI 参考](reference/cli.md) · [类型定义与源码映射](reference/types.md) · [发行版本](latest.md) · [更新日志](changelog.md)。
25
+ ## 理解底座
34
26
 
35
- > 需要查阅底层协议或仓库维护说明?请参阅仓库中的[架构实现手册](https://github.com/AnySwarm/anyswarm/blob/main/docs/architecture/INDEX.md)。
27
+ 先读[核心概念](concepts.md),再按需查阅 [Sandbox](sandbox.md)、[Runtime](runtime.md)、[Agent 与 Profile](agents.md)、[Host Gateway](gateway.md)、[Services 与权限](services.md)、[Trace Viewer](trace-viewer.md)。普通多 Agent Harness 用一个 Runtime 管理整个团队,不需要为每位成员建立一个宿主应用。
28
+
29
+ 本地输入在 Run 开始时捕获,再复制到各自独立的 Sandbox。协作 Service 显式管理共享状态。产物导出、清理回执与业务验收分别记录,输出不会自动覆盖输入目录。
30
+
31
+ ## 交给你的 Coding Agent 定制
32
+
33
+ [可复制的作者 Prompt](build-your-harness.md#coding-agent-prompt) 会导出真正的 `parallel-swarm` 工程,读取其中面向使用者的 `AGENTS.md` 和已安装 SDK 类型,再根据业务需求修改。AnySwarm 仓库维护者指引不作为你的业务应用指南。
34
+
35
+ 准确 API 与参数见 [SDK 与 API 参考](reference/api.md)、[CLI 参考](reference/cli.md)、[类型与源码映射](reference/types.md)。已发布行为见[发行版本](latest.md),内部实现与边界见[架构手册](../architecture/INDEX.md)。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: 快速上手
3
- description: 在 Linux 或 macOS 上准备环境、安装 AnySwarm、初始化 OpenSandbox 与 Worker,并完成首次 Sandbox 与文件读取检查。
3
+ description: 准备共同运行环境,再用 Subagents 检查真实仓库,导出带文件依据的工程交接报告。
4
4
  section: GET STARTED
5
5
  order: 1
6
6
  ---
@@ -9,14 +9,16 @@ order: 1
9
9
 
10
10
  `anyswarm` 将 CLI 与 TypeScript SDK 打包在同一个安装包中,并在 [OpenSandbox](sandbox.md) 隔离沙箱中运行 Agent。本指南使用 Docker 在本机运行 OpenSandbox 和 Worker。
11
11
 
12
- 本指南适用于 [AnySwarm v0.5.1](latest.md#v051)。
12
+ GitHub 的 `main` 分支与网站 **Next** 频道中的本指南跟随当前开发。
13
+ 使用正式发行包时,请阅读[稳定版快速上手](https://anyswarm.github.io/anyswarm/zh/docs/quickstart/)。
14
+ 稳定版网站的版本标签对应已发布的包;Next 文档可能领先于最后一次发布的 npm 预览包。
13
15
 
14
16
  ## 前置要求
15
17
 
16
18
  | 依赖 | 要求与说明 | 检查命令 |
17
19
  | --- | --- | --- |
18
20
  | **Linux 或 macOS** | 控制器宿主机(如 Ubuntu、Debian 或运行 Docker Desktop 的 macOS) | `uname -s` |
19
- | **Node.js** | `>= 22.19`(Ubuntu 24.04、Debian 13 等软件源默认版本偏旧,请从 [nodejs.org](https://nodejs.org/en/download) 安装 LTS) | `node --version` |
21
+ | **Node.js** | `>= 22.19`,推荐 Node.js 24(Ubuntu 24.04、Debian 13 等软件源默认版本偏旧,请从 [nodejs.org](https://nodejs.org/en/download) 安装 LTS) | `node --version` |
20
22
  | **npm** | 随 Node.js 安装 | `npm --version` |
21
23
  | **Git** | 用于检出源码与捕获项目 | `git --version` |
22
24
  | **Docker Engine** | 本机运行的 Linux 容器引擎([安装指南](https://docs.docker.com/engine/install/)) | `docker info` |
@@ -42,7 +44,7 @@ docker context show
42
44
  docker info --format '{{.OSType}}/{{.Architecture}}'
43
45
  ```
44
46
 
45
- 若 context 不正确,执行 `docker context use <本地-context>`,并检查 `DOCKER_CONTEXT` 或 `DOCKER_HOST` 是否覆盖了该选择。Apple Silicon 对应 Linux ARM64,Intel 对应 Linux x86-64;setup 不会切换到模拟执行。若单独安装的 Docker 客户端提示找不到 `docker-credential-desktop`,在 Docker Desktop 设置中把 CLI 工具加入 PATH,或将 `/Applications/Docker.app/Contents/Resources/bin` 加入 PATH。运行 TypeScript 作者命令请用 Node.js 24 LTS;Node.js 26 已移除这些命令使用的 transform 模式。
47
+ 若 context 不正确,执行 `docker context use <本地-context>`,并检查 `DOCKER_CONTEXT` 或 `DOCKER_HOST` 是否覆盖了该选择。Apple Silicon 对应 Linux ARM64,Intel 对应 Linux x86-64;setup 不会切换到模拟执行。若单独安装的 Docker 客户端提示找不到 `docker-credential-desktop`,在 Docker Desktop 设置中把 CLI 工具加入 PATH,或将 `/Applications/Docker.app/Contents/Resources/bin` 加入 PATH。
46
48
 
47
49
  v0.5.1 支持 macOS 原生 setup。请选择兼容的 backend。[#339](https://github.com/AnySwarm/anyswarm/issues/339) 的 macOS 受控模型验证在 Apple Silicon 和 Docker Desktop 上进行,覆盖 npm Pi 1.3.0、1.7.0 及独立 Codex 0.173.0;Intel、其他引擎和其他 backend 版本还没有在 macOS 上验收。
48
50
 
@@ -61,6 +63,21 @@ anyswarm --version
61
63
 
62
64
  如果你要用 TypeScript 编写 Harness,请按[安装 SDK](reference/api.md#安装-sdk)把它加到项目依赖里。
63
65
 
66
+ ### 显式试用预览包(`next`)
67
+
68
+ 需要测试尚未正式发布的改动时,选择这个频道:
69
+
70
+ ```bash
71
+ npm install -g @anyswarm/core@next
72
+ anyswarm --version
73
+ ```
74
+
75
+ 反馈问题时记录实际安装的预发布版本。项目 SDK 使用
76
+ `npm install --save-exact @anyswarm/core@next`,并保留 lockfile。
77
+ Next 网站跟随 `main`;若它领先于安装包,请以该包自带的示例和文档复现。
78
+ 使用同一 npm prefix 执行 `npm install -g @anyswarm/core@latest` 可回到稳定版。
79
+ 预览包由维护者显式发布,合入 `main` 的改动不一定已经出现在 `next` 中。
80
+
64
81
  ### 从源码构建并安装(`main`)
65
82
 
66
83
  在仓库根目录执行以下命令。`npm run pack:release` 构建发行包,最后一条安装命令将归档装入指定的 npm prefix。
@@ -75,10 +92,12 @@ export PATH="$HOME/.local/bin:$PATH"
75
92
  anyswarm --version
76
93
  ```
77
94
 
78
- 候选包可能和发行版显示同一个版本号。请记录提交号和 tarball 的 SHA-256。如果要在[独立示例项目](../../examples/README.md)中使用同一份 SDK,请保留生成的候选版 tarball。
95
+ 源码专用教程或尚未合并的改动,需要在打包前检出对应已审阅分支或提交;默认检出的 `main` 只包含已合并工作。候选包可能和发行版显示同一个版本号。请记录提交号和 tarball 的 SHA-256。如果要在[独立示例项目](../../examples/README.md)中使用同一份 SDK,请保留生成的候选版 tarball。
79
96
 
80
97
  ### 更新 CLI
81
98
 
99
+ 两个通道都沿用安装时的 npm prefix。`anyswarm update` 显示稳定版的更新命令。要继续使用预览版,请再次显式安装 `@anyswarm/core@next`。
100
+
82
101
  用同一套 Node.js 和 npm prefix 执行 `npm install -g @anyswarm/core@latest` 更新,或执行 `npm uninstall -g @anyswarm/core` 卸载。如果 npm 报 `EACCES`,请改用用户目录下的 Node,或用 `npm install -g --prefix "$HOME/.local" @anyswarm/core` 安装到有写权限的目录。将 `$HOME/.local/bin` 加入 PATH,后续更新和卸载继续使用该 prefix。
83
102
 
84
103
  如果曾用旧版脚本安装 v0.5.0 或 v0.5.1,请检查 `$(npm prefix -g)/bin` 下的 `anyswarm`、`anys` 和 `swarm`。只清理指向旧安装 `lib/anyswarm/current` 的链接,再用 npm 安装。AnySwarm 配置存放在 CLI 安装目录之外。
@@ -113,38 +132,49 @@ setup 显示正在准备的镜像及当前阶段的等待时间。显式 Worker
113
132
 
114
133
  本地构建失败时可根据报告定位阶段并修复对应依赖。setup 会报告 SDK 的版本与内容、所选执行器及其身份、Worker 镜像 ID 和构建或复用结果。
115
134
 
116
- ## 3. 检查 Sandbox 与文件读取
135
+ ## 3. 为真实仓库生成工程交接报告
117
136
 
118
- setup 自检使用受控模型响应。下面的示例使用实际模型端点,运行一个 Agent。[浏览器回放](https://anyswarm.github.io/anyswarm/trace-demo/)无需模型凭据。
137
+ 使用 AnySwarm 0.6.0 或[匹配的源码构建包](#从源码构建并安装main)导出交接示例。下面固定了 [p-limit 真实验收](https://github.com/AnySwarm/anyswarm/issues/358#issuecomment-7385075753)的仓库版本。体验后可把输入路径换成自己仓库中一个聚焦目录。
119
138
 
120
- 配置任意兼容 OpenAI Responses 流式协议的模型端点与 API Key(下面以 OpenAI 为例),在新建目录中运行一次内置 `subagents`:
139
+ 先配置支持流式响应和工具调用的模型及凭据。命令以 OpenAI Responses 为例。独立 VM 验收通过配置的 Responses 服务使用 GPT-6.1 Sol。其他协议和执行器可查阅 [CLI 参考](reference/cli.md)。
121
140
 
122
141
  ```bash
123
142
  export ANYSWARM_MODEL_URL='https://api.openai.com/v1/responses'
124
143
  export ANYSWARM_MODEL_ID='gpt-5-mini'
125
144
  export ANYSWARM_MODEL_TOKEN='<your-api-key>'
126
145
 
127
- mkdir -p anyswarm-first-example && cd anyswarm-first-example
128
- printf '# Hello from AnySwarm\n' > README.md
129
- anyswarm --harness subagents --prompt 'Read README.md and report its heading.' --output-dir ./runs
146
+ git clone https://github.com/sindresorhus/p-limit.git ./handoff-input
147
+ git -C ./handoff-input checkout --detach a8a6fbec4e0e866d6d779b10889bb4f5567e70eb
148
+ anyswarm eject subagents --dir ./handoff
149
+ (
150
+ cd ./handoff
151
+ npm install
152
+ npm start -- --config ./handoff-config.ts --cwd ../handoff-input \
153
+ --prompt 'Prepare an engineering handoff for this repository. Assign two different children: ask one to find its public entry points, exported types and how to run the repository checks, and ask the other to identify scheduling flow, core state and test coverage. Have both return independent concrete findings to Root with file paths and line numbers. Wait for both; cross-check their citations. Write a useful report.md with the architecture, verified commands, risks and open questions. Only create report.md; do not modify source, install dependencies or claim to have run checks you only read about.' \
154
+ --output-dir ../runs
155
+ )
130
156
  ```
131
157
 
132
- 如需切换其他模型服务商或执行器(如 Codex),请查看 [CLI 参考](reference/cli.md)。
133
-
134
- 预期退出码为 0,`outcome: "completed"`,业务输出包含标题 `# Hello from AnySwarm`,并记录 `cleanup.status: "complete"`。Trace Viewer 可查看 `read` 工具的结果。
158
+ 该配置允许 360 秒工作、70 秒单次模型请求和 60 秒清理,最多运行 Root 与两名直属子成员,要求导出不超过 1 MiB 的 `report.md`。实际耗时取决于输入、模型及运行环境。通用内置 Subagents 有自己的较短默认值。宿主捕获输入快照,Agent 在各自的副本工作,结果导出到 `./runs`。按终端给出的产物路径查看报告。
135
159
 
136
- ## 4. 在 Trace Viewer 中回放
160
+ ## 4. 检查报告和背后的协作
137
161
 
138
162
  ```bash
139
- anyswarm trace --root ./runs --port 8787 --open
163
+ anyswarm trace --root ./runs --port 8787
140
164
  ```
141
165
 
142
- 在客户端复用原本能登录的 SSH 目标与连接选项。比如原来用 `ssh -p 2222 dev@vm-host` 登录,就执行 `ssh -p 2222 -N -L 8787:127.0.0.1:8787 dev@vm-host`,再打开 `http://127.0.0.1:8787`。在 **Files & results** 中核对同一次 Run 的业务结果与清理状态。
166
+ 打开终端打印的本地地址。远程宿主可使用 SSH 转发,例如 `ssh -N -L 8787:127.0.0.1:8787 user@host`,然后在本地打开 `http://127.0.0.1:8787`。
167
+
168
+ 针对同一次 Run,分别核对:
169
+
170
+ - **工作过程:** Root 是否创建了要求的子 Agent,各自是否读取了不同部分,Root 是否收到他们的发现。时间线可以确认工作是否真正重叠。
171
+ - **报告:** 从最终产物路径或 **Files & results** 找到 `report.md`,对照捕获文件检查路径与行号范围。只从文档找到的命令应与实际执行过的命令区分。
172
+ - **状态:** 分别查看业务结果、导出和清理。Agent 完成回合不等于报告质量经过独立验收。通用 Subagents 的 `acceptance.status` 为 `"not-run"`,内容结论仍需判断;有最终答复也不能忽略缺文件、导出不完整或 cleanup pending。
143
173
 
144
- 沿用同一模型,在 Trace Viewer [验收父子 Agent 委派](harnesses/subagents.md#验收父子-agent-委派)。[双 Agent SDK Harness](first-harness.md) 还可以验收 Service 交接,并核对交付文件包含你的终端回复。
174
+ 无需安装或凭据即可打开 [p-limit 真实交接回放](./trace-viewer.md),查看 Root 和两个子成员如何协作,以及他们导出的 `report.md`。
145
175
 
146
176
  ## 下一步
147
177
 
148
- - [核心概念](concepts.md):2 分钟看懂 6 个核心组件如何协同。
149
- - [选择 Harness](harnesses/index.md):对比 5 种内置多智能体协作模式。
150
- - [构建自己的 Swarm Harness](build-your-harness.md):结合 [TypeScript SDK](reference/api.md) 定制你自己的多智能体编排。
178
+ - [选择示例](harnesses/index.md)——按三层定位了解应用、协作参考与进阶集成。
179
+ - [第一个 SDK Harness](first-harness.md) → [并行 Swarm](build-your-harness.md)——学习 Service 交接、字节检查、并行互评与汇总。
180
+ - [AutoResearch](autoresearch.md)——了解当前研究应用与 Evaluator 要求。
@@ -17,7 +17,7 @@ npm install @anyswarm/core
17
17
 
18
18
  在代码中从 `@anyswarm/core` 导入 SDK。在项目目录运行 `npm exec -- anyswarm` 可调用随依赖安装的 CLI。要在任意目录直接运行 `anyswarm`,请按[全局 CLI 安装](../quickstart.md#1-安装-anyswarm)操作。
19
19
 
20
- 要安装经校验的[源码构建归档](../quickstart.md#从源码构建并安装main),使用下面的命令。[发行版本页](../latest.md#v051)提供固定版本的安装命令。
20
+ 要安装经校验的[源码构建归档](../quickstart.md#从源码构建并安装main),使用下面的命令。[发行版本页](../latest.md#v052)提供固定版本的安装命令。
21
21
 
22
22
  ```bash
23
23
  npm install --ignore-scripts /path/to/verified-anyswarm.tgz
@@ -5,27 +5,41 @@ section: 核心构件
5
5
  order: 8
6
6
  ---
7
7
 
8
- 每一次 `anyswarm` 运行都会将结构化轨迹写入 `outputDir/<runtimeId>/`。内置的 **Trace Viewer**(`anyswarm trace`)让你直接在浏览器里回放已完成或正在进行的 Run,**无需安装任何额外前端依赖**。
8
+ 标准 Harness Session 会保存 Run 报告,每个实际创建的 Runtime 则写入自己的结构化轨迹。内置的 **Trace Viewer**(`anyswarm trace`)让你直接在浏览器里检查已记录的 Runtime 活动,**无需安装任何额外前端依赖**。Harness 也可能在创建 Runtime 前完成或失败;这种报告的查看方式见下文版本说明。
9
9
 
10
- 上方展示的是由内置 `release-notes`(`Subagents`)演示轨迹驱动的**真实交互式泳道组件**——无需滚动内框,直接就能上手操作:
10
+ 上方回放的是在独立 VM 上针对 [p-limit `a8a6fbec`](https://github.com/sindresorhus/p-limit/tree/a8a6fbec4e0e866d6d779b10889bb4f5567e70eb) 完成的一次 Subagents 仓库交接。Root 和两个子成员通过 Pi 与 OpenSandbox 发出了 28 次 GPT-6.1 Sol 请求。公开回放选取同一次运行的输入、模型和 Service 元数据,省略消息正文、提示词、工具事件及私有 Runtime 文件。
11
11
 
12
- - **切换展示视图**:通过外侧顶栏按钮在 **泳道时间线**、**协作交接** 与 **产物与文件** 之间切换,或点击 **打开完整版 ↗** 进入完整工作台(含左侧 Run 列表与全量事件账本)。
12
+ 打开 **产物与文件** 可查看原始 `report.md`(12,093 字节)和 SHA-256。独立 VM 核验了导出字节与资源清理。通用 Harness 记录的验收状态是 `not-run`,报告结论仍需对照源码判断。[VM 验收记录](https://github.com/AnySwarm/anyswarm/issues/358#issuecomment-7385075753)
13
+
14
+ 无需安装即可操作。
15
+
16
+ - **切换展示视图**:通过外侧顶栏按钮在 **泳道时间线**、**运行事件** 与 **产物与文件** 之间切换,或点击 **打开完整版 ↗** 使用 Run 列表与搜索。
13
17
  - **泳道缩放与平移**:在泳道上滚动滚轮即可围绕光标精确缩放,拖拽泳道或缩略小地图平移,也可使用 `W`/`S`(缩放)、`A`/`D`(平移)和 `0`(重置)。
14
- - **悬浮与点击检视**:鼠标悬浮任意色块可实时查看模型/工具耗时与摘要;点击任意色块会在右侧滑出 **Evidence Inspector**,支持 **Structured** 与 **Raw JSON** 两种查看方式。
18
+ - **悬浮与点击检视**:鼠标悬浮任意色块可查看记录中的耗时与摘要;点击任意色块会在右侧滑出 **Evidence Inspector**,支持 **Structured** 与 **Raw JSON** 两种查看方式。
15
19
 
16
20
  ## 1. 本地启动 `anyswarm trace`
17
21
 
18
- 把 `anyswarm trace` 指向包含多次运行的父目录(自动发现目录内所有 Run,包括新启动的)或单个 Run 目录:
22
+ 标准 CLI 和 `createHarnessSession()` 的默认根目录是 `${XDG_STATE_HOME:-$HOME/.local/state}/anyswarm/runs`。在已安装 SDK 的项目中,用项目内 CLI 打开该目录:
19
23
 
20
24
  ```bash
21
- # 查看某个 Harness 的全部运行记录
22
- anyswarm trace --root ./runs --port 8787 --open
25
+ # 查看标准 Harness 的默认输出目录
26
+ ./node_modules/.bin/anyswarm trace --root "${XDG_STATE_HOME:-$HOME/.local/state}/anyswarm/runs" --port 8787 --open
23
27
 
24
- # 也可以直接把目录作为位置参数传入
25
- anyswarm trace ./runs --port 8787
28
+ # 仅在 Run 显式使用 --output-dir ./runs 或 outputRoot: './runs' 时
29
+ ./node_modules/.bin/anyswarm trace ./runs --port 8787
26
30
  ```
27
31
 
28
- 在浏览器打开 `http://127.0.0.1:8787`。Trace Viewer 只读取本地文件,**不需要 Docker、OpenSandbox 或模型密钥**;对正在进行的 Run 会通过 SSE 自动实时刷新。
32
+ 全局安装时,可把 `./node_modules/.bin/anyswarm` 换成 `anyswarm`。CLI 的 `--output-dir` 和 Harness Session 的 `outputRoot` 会覆盖默认值。默认目录不可用或位于被采集的工作区内时,Harness 可能改用私有临时目录;此时使用实际打印的回放命令,或把保存结果中 `reportPath` 所在的目录传给 `--root`。
33
+
34
+ 在浏览器打开 `http://127.0.0.1:8787`。Trace Viewer 读取存盘文件,**不需要 Docker、OpenSandbox 或模型密钥**。`--port 0` 会选择可用端口,以启动时打印的 URL 为准。公开 npm **0.5.2** 要求根目录已经存在;新增 Run 后需要手动刷新列表,发现运行依赖 `runtime.json`。选中的 Runtime 可以通过 SSE 实时更新。若该次 Run 只有 `project-run.json`,在 0.5.2 中请直接读取报告文件。
35
+
36
+ ### 0.6.0 的 Run 发现功能
37
+
38
+ 0.6.0 纳入了 [#360](https://github.com/AnySwarm/anyswarm/issues/360) 的 Run 发现和报告查看改进。
39
+
40
+ - 不传根目录的 `anyswarm trace` 使用标准 Harness 状态目录。目录尚不存在时进入等待状态,页面显示正在读取的实际路径。
41
+ - 页面可见时约每两秒检查新增 Run。列表更新保留当前 Run、筛选、时间窗口和键盘焦点;读取失败时保留上次成功的列表,并显示错误。
42
+ - 尚未确认匹配的 Runtime 关联时,也可打开有效的 `project-run.json`。**Files & results** 展示报告中已有的业务结果、原因、失败、返回值、验收、导出和清理事实。缺口说明会区分身份缺失、记录不可用和关联无法确认等情况,不代表其他位置一定没有 Runtime。页面不会补出 Agent 数量、时间线、费用或耗时;一致且唯一的 Runtime 关联会提供跳转入口。
29
43
 
30
44
  ## 2. 远程 Linux 服务器查看(SSH 端口转发)
31
45
 
@@ -41,7 +55,11 @@ ssh -N -L 8787:127.0.0.1:8787 user@your-linux-host
41
55
 
42
56
  随后在本机访问 `http://127.0.0.1:8787`。运行记录包含私有提示词与源码,请始终通过 SSH 转发查看,不要直接暴露公网端口。
43
57
 
44
- ## 3. `outputDir/<runtimeId>/` 里记录了什么?
58
+ ## 3. 报告与 Runtime 文件保存在哪里?
59
+
60
+ 标准 Harness 将 `project-run.json` 保存在 `<root>/<runId>/`。Harness 使用该目录作为 Runtime 输出根时,Runtime 文件位于 `<root>/<runId>/<runtimeId>/`。
61
+
62
+ 直接调用 SDK 的 `createRuntime()` 仍须显式设置 `outputDir`,轨迹写入 `<outputDir>/<runtimeId>/`。用 `./node_modules/.bin/anyswarm trace --root <outputDir>` 打开该目录;Harness 的状态目录默认值不会替直接 SDK 程序选择输出目录。下表路径均相对于 Runtime 目录:
45
63
 
46
64
  | 路径 | 内容 |
47
65
  | --- | --- |
@@ -52,10 +70,12 @@ ssh -N -L 8787:127.0.0.1:8787 user@your-linux-host
52
70
  | `service-state.<id>.<uuid>.json` | close/retire 时导出的公开状态,以及 Service 提供的采集信息和展示配置 |
53
71
  | `model-trace/` | 经 Model Gateway 转发的原始 Responses / Chat Completions 请求与流式响应 |
54
72
  | `<agentId>/session/` 与 `artifacts/` | 归档的 Pi / Codex 原生会话与 `Profile.collect` 导出的工作区文件 |
55
- | `harness-report.json` | 内置 Harness 生成的业务结果与验收报告 |
73
+ | `harness-report.json` | Harness 写入的业务结果与验收报告(如有) |
56
74
 
57
75
  在 Run 顶部打开 **Service states**,或选择一条 Service 调用,即可检查已导出的状态。详情显示导出状态、实例身份和框架导出时间窗。Service 主动提供采集时间和业务版本后才显示对应值。未提供状态、采集失败、内容截断和文件缺失分别保留状态。close/retire 快照展示自己的观测时间窗,查看较早调用时也会保留该说明。Service 可以提供数据形式的摘要和表格,原始 JSON 同时可读。持久 Board 示例提供条目数与 Entries 表格。[运行 Board 示例](../../examples/services/persistent-board/README.md)。
58
76
 
77
+ 在**文件与结果**中,打开带 SHA-256 的归档文件会核对原记录版本。**加载后续 64 KB**从上一页字节边界续读,**复制**包含已加载的全部文本。网站回放可以只保留部分文件预览,剩余内容可在已安装的 Viewer 中打开原 Run 查看。
78
+
59
79
  ## 4. 在长任务中检索
60
80
 
61
81
  顶部的 **Model / Service / Tool** 统计覆盖整次 Run,不受当前时间窗口影响。一次模型请求、Service 调用尝试或工具执行各计一次,开始与结束事件不会重复计数。缺少原生工具边界的旧格式 Run 使用归档 Session 中的工具结果计数,结果缺少时间戳也会计入。
@@ -1,41 +1,68 @@
1
1
  # Examples and Service integrations
2
2
 
3
- The five collaboration examples demonstrate different policies built on the
4
- public `@anyswarm/core` Runtime, Sandbox and Service APIs. Choose one mechanism,
5
- prepare its listed dependencies, and give it a **project directory and prompt**.
6
- A Task/Mission database, Board, chat service or Git workflow belongs to the
7
- example that uses it.
3
+ Choose an example by the task and the collaboration policy you need. A normal
4
+ Harness uses one Runtime to own its Agents, private Sandboxes and authenticated
5
+ Services. The examples also retain direct Runtime scripts, Service adapters and
6
+ zero-Runtime protocol fixtures where those teach a specific API more clearly.
8
7
 
9
- Start with the [first SDK Harness](../docs/en/first-harness.md) for one real
10
- Publisher and Writer, their Service handoff, a user answer and verified
11
- artifact export. Its same default definition is used by SDK, foreground and
12
- RPC. [HarnessSession clients](harness-session/README.md) exercise the public
13
- protocol with a zero-Runtime fixture.
8
+ ## Start with a real repository question
14
9
 
15
- ## AutoResearch showcase
10
+ [Subagents](subagents/README.md) can prepare an engineering handoff for a real
11
+ local repository: Root delegates entry/configuration and modules/tests reading,
12
+ receives child findings, then writes a source-backed `report.md`. Replace the
13
+ question or directory to investigate your own work. There is no planted defect
14
+ or predetermined report.
16
15
 
17
- [AutoResearch](autoresearch/README.md) runs equal peers through a finite
18
- research task with shared budgets, a trusted evaluator and browser Trace
19
- records. The guide includes the pinned FrontierCS-2 demo and a configurable
20
- evaluator path.
16
+ ```sh
17
+ anyswarm --harness subagents --cwd /absolute/path/to/project \
18
+ --prompt 'Prepare an engineering handoff. Delegate entry points and configuration to one child, and modules and tests to another. Check their findings and write report.md with relative source paths and line ranges. Separate facts, inferences and checks not performed. Do not modify project source.' \
19
+ --output-dir /absolute/path/to/runs
20
+ anyswarm trace --root /absolute/path/to/runs --open
21
+ ```
21
22
 
22
- [Code](code/README.md), [Personal](super/README.md), and
23
- [HarnessSession](harness-session/README.md) are advanced SDK examples.
23
+ Complete `anyswarm setup` and configure a tool-capable model first. The host
24
+ captures one input snapshot; members work in separate copies, and exported
25
+ results do not overwrite the local source. Generic Subagents reports business
26
+ acceptance as `not-run`. Inspect the contributions, citations, exported report
27
+ and original cleanup receipt. A finished model turn is not a quality verdict.
24
28
 
25
- ## Choose a collaboration example
29
+ ## Three levels
26
30
 
27
- | Directory | Coordination | Services created by the example | Facilities you supply |
28
- | --- | --- | --- | --- |
29
- | [subagents](subagents/README.md) · [Host](subagents/business.ts) | A root delegates to children and integrates their replies. | In-process collaboration Service. | OpenSandbox, Worker image and model endpoint. |
30
- | [taskpool](taskpool/README.md) · [Host](taskpool/harness/harness.ts) | Agents discover and exclusively claim Tasks against a Mission Workspace. | Task/Context stores and Workspace coordination in the run directory. | Common infrastructure; optional checker/search dependencies only when explicitly configured. |
31
- | [peermesh](peermesh/README.md) · [Host](peermesh/harness/team.ts) | Peers coordinate through Board, chat and Git. | Per-run identities, repository/channel, Board process and Service adapters. | Gitea, Mattermost, pinned Board source/Python dependencies and initialized MySQL. |
32
- | [lead-worker](lead-worker/README.md) · [Host](lead-worker/harness/index.ts) | A Lead assigns work and integrates Worker output. | SQLite Board, scoped Git identities and adapters; optional dynamic checker service. | Gitea; Docker checker image for dynamic mode. |
33
- | [substrate](substrate/README.md) · [Host](substrate/harness/index.ts) | Peers publish, retrieve and cite contributions. | SQLite publication Service. | Common infrastructure. The explicit FATE benchmark also needs Lean/Mathlib/checker dependencies. |
31
+ | Level | Examples | Purpose and facilities |
32
+ | --- | --- | --- |
33
+ | 1: first use and SDK learning | [subagents](subagents/README.md), then [first-harness](first-harness/README.md) and [parallel-swarm](parallel-swarm/README.md) | A useful repository task; authenticated Service handoff and exact bytes; fixed parallel investigation and peer review. Saved Sandbox/executor plus a model endpoint, with no additional business services. |
34
+ | 2: applications and built-in coordination | [autoresearch](autoresearch/README.md); [subagents](subagents/README.md), [taskpool](taskpool/README.md), [substrate](substrate/README.md) | AutoResearch's research/evaluator application; dynamic delegation, exclusive Task leases and Workspace integration, or an immutable citation DAG. FrontierCS-2 has substantial judge/build resources; see #337 for the configurable example and real-model evidence. |
35
+ | 3: advanced source and integrations | [super](super/README.md), [code](code/README.md), [harness-session](harness-session/README.md), [peermesh](peermesh/README.md), [lead-worker](lead-worker/README.md) | Background routing, candidate patches and SDK/RPC questions; heavy Git/chat/database integrations. These are not equivalent first-run choices. Code core development is paused. |
36
+
37
+ AutoResearch's complete application and new real-model acceptance are owned by
38
+ [#337](https://github.com/AnySwarm/anyswarm/issues/337). This examples update does
39
+ not change its evaluator, provider, resources or acceptance criteria.
40
+
41
+ ## Source and verification inventory
34
42
 
35
- PeerMesh and Lead-Worker require an enforced network allowlist for native Git.
36
- Use an OpenSandbox deployment configured for `dns+nft`, and verify that the
37
- Workers can reach the configured Git origin under its platform policy. See the
38
- [deployment requirements](../docs/architecture/16-pi-opensandbox-backend.md).
43
+ The table records what was changed or deliberately retained in #335. Follow the
44
+ local README for full commands and evidence. “Controlled tests” describe API and
45
+ failure-path coverage, not an assertion that a new real-model run succeeded.
46
+
47
+ | Example / treatment | Input and output | Main editable source | Objective checks and limits |
48
+ | --- | --- | --- | --- |
49
+ | [subagents](subagents/README.md): retain controller; add real task recipe and full eject | Captured directory + prompt → Root's collected files and collaboration state. | `project.ts`, `business.ts`, `config.ts`, `harness/controller.ts`, `services/`, `prompts/` | Existing caller, delivery, collection and pending-cleanup tests; source/export tests. Generic acceptance remains `not-run`; [Two real repository handoffs verified](https://github.com/AnySwarm/anyswarm/issues/358#issuecomment-7385075753). |
50
+ | [first-harness](first-harness/README.md): simplify lifecycle/configuration; default no questions; add eject | Prompt + preset/explicit channel → Publisher/Service/Writer handoff and `delivery.txt`. | `harness.ts`, `config.ts`, `handoff.ts`, `session.ts` | Authenticated publication/retrieval and exact sandbox/exported bytes. Explicit SDK/RPC questions remain. Controlled regression and installed-client gates are separate from native/model evidence. |
51
+ | [parallel-swarm](parallel-swarm/README.md): configure, verify evidence, preserve receipts; add eject | Captured repository + question → three investigators, two rounds, Board findings, synthesized `report.md`. | `harness.ts`, `config.ts`, `board.ts`, `board-service.ts`, `report.ts` | Each member contributes and cross-reviews; source path/line/excerpt checks; required report export. Does not prove semantic correctness or completeness. [Two real-model runs verified collaboration and export](https://github.com/AnySwarm/anyswarm/issues/335#issuecomment-7399586208). |
52
+ | [taskpool](taskpool/README.md): retain normal Harness | Directory + Mission prompt → Tasks, exclusive Execution leases, Workspace revisions and integrated files. | `project.ts`, `config.ts`, `harness/`, `services/` | Existing lease, fencing, publication and collection tests. No independent domain checker by default: acceptance `not-run`. Stores are created locally by the Harness. |
53
+ | [substrate](substrate/README.md): retain normal Harness | Directory + question → immutable publications and references in a citation DAG. | `project.ts`, `project-config.ts`, `harness/`, `services/` | Existing publication identity/reference/idempotency and cleanup tests. Local SQLite; generic acceptance `not-run`. The FATE benchmark has its own dependencies and checker. |
54
+ | [lead-worker](lead-worker/README.md): retain heavy integration | Captured project + assignments → scoped Git branches, read feedback and Lead submission. | `project.ts`, `project-config.ts`, `harness/`, `services/` | Existing Board/Git delivery checks and package tests. Requires Gitea; dynamic checker requires its Docker image. Fixture acceptance does not establish arbitrary task correctness. |
55
+ | [peermesh](peermesh/README.md): retain heavy integration | Captured project + work window → Board/chat/Git coordination and pinned main export. | `project.ts`, `project-config.ts`, `harness/`, `services/` | Existing identity, routed input, merge and cleanup tests. Requires Gitea, Mattermost, pinned Board/Python dependencies and initialized MySQL. |
56
+ | [notes](notes/README.md): retain both entries; correct stale helper description | Project observation, or explicit fixed fact → Service handoff and reader/follow-up files. | `project.ts`, `main.ts`, `config.ts`, `notes.ts` | Actual author/read records and exact exported bytes. Shared input/report helpers come from the public SDK, not removed adjacent files. |
57
+ | [messages](messages/README.md): retain adapter and direct host | Project observation, or random handoff text → exact received file. | `project.ts`, `handoff.ts`, `handoff-config.ts`, `messages.ts` | In-process or attached HTTP Service, per-role grants and bytes. An attached service keeps its original owner; close does not stop it. |
58
+ | [agent-session.ts](agent-session.ts): retain direct Runtime script | Explicit Runtime configuration, Profile and prompt → session observations and raw stop/close receipts. | `agent-session.ts` | Demonstrates configuration, context delivery, message/stat reads and bounded waits. It is not a business acceptance Harness. |
59
+ | [services](services/README.md): retain individual adapters | Operation-specific input → Service responses/state or controlled process lifecycle. | Each directory's `host.ts`, `run.ts`, adapters and manifests | Persistent Board, Agent Control and MCP have distinct lifecycle/authorization checks. GitHub Issues needs authenticated `gh`; Mathlib Search needs its explicit provider. |
60
+ | [harness-session](harness-session/README.md), [authoring](authoring/README.md): retain fixtures | Questions/input or simple configuration → deterministic local result. | `harness.ts` and SDK/RPC clients; authoring `business.ts` | Zero Runtime: protocol and source-authoring examples, not evidence of multi-Agent execution. |
61
+ | [super](super/README.md), [code](code/README.md): retain advanced applications | GitHub routing or bounded patch work with application-specific facilities. | Local README and source manifests | Core product changes are outside this ticket; no interactive Code first-run promotion. |
62
+
63
+ PeerMesh and Lead-Worker need the documented native-Git network policy in
64
+ addition to their services. They are heavy integration references, not
65
+ “zero-dependency” alternatives.
39
66
 
40
67
  ## Run an example from its directory
41
68
 
@@ -44,26 +71,38 @@ Prepare OpenSandbox, the Worker and a model route using
44
71
  checkout. Install either the published SDK or a verified candidate archive,
45
72
  then copy that installed SDK's example sources into your project. This keeps
46
73
  the source and API together even when a candidate and release share a version
47
- number.
74
+ number. The stable example below pins `0.5.2` and uses its supported `run`
75
+ command. Examples checked out from `main` must use a matching source candidate
76
+ rather than an older installed SDK.
48
77
 
49
78
  ```sh
50
79
  npm init -y
51
- npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.0}"
80
+ npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.2}"
52
81
  sdk=node_modules/@anyswarm/core
53
82
  cp -R "$sdk"/examples/subagents demo
54
83
  cd demo
55
84
  ../node_modules/.bin/anyswarm run ./project.ts --cwd /absolute/path/to/project --prompt 'Implement and verify the requested change'
56
85
  ```
57
86
 
87
+ To test a published preview instead, install `@anyswarm/core@next` with
88
+ `--save-exact` in the empty project, then copy the examples from that installed
89
+ package as above. Record the resolved prerelease version and preserve the lockfile.
90
+ The website's Next channel follows `main` and can be ahead of that package; its
91
+ bundled documentation and examples describe the installed revision.
92
+
58
93
  For another collaboration mechanism, replace `subagents` in the copy command
59
94
  with `taskpool`, `peermesh`, `lead-worker` or `substrate`. The copied project
60
95
  resolves the SDK from its parent installation. The CLI loads TS directly, including multi-file imports and TS configuration.
61
96
 
62
- For current repository sources, build the matching SDK archive from that
63
- checkout's root first. Record its commit and SHA-256, and set the absolute
64
- archive path before running the commands above.
97
+ ### Build and eject this checkout’s source
98
+
99
+ For a released built-in, use the normal CLI alias. For editable examples, install
100
+ a matching SDK candidate outside the checkout. The new `first-harness`,
101
+ `parallel-swarm` and `subagents` eject manifests are **not included in 0.5.2**.
102
+ Until a release includes them, build or obtain a candidate from this source:
65
103
 
66
104
  ```sh
105
+ # From the candidate source checkout:
67
106
  npm ci --ignore-scripts
68
107
  pack_dir=$(mktemp -d)
69
108
  archive=$(npm run --silent pack:release -- "$pack_dir")
@@ -71,61 +110,72 @@ sha256sum "$archive"
71
110
  export ANYSWARM_SDK_ARCHIVE="$archive"
72
111
  ```
73
112
 
74
- When editing an existing example directly in this checkout, install this
75
- archive with `npm install --no-save "$ANYSWARM_SDK_ARCHIVE"` in that example's
76
- directory before running its TypeScript entry.
113
+ Record the source commit and archive digest. In an empty directory outside that
114
+ checkout, install those exact bytes:
77
115
 
78
- Use the example's README for its configuration and external facilities.
79
- Run `anyswarm run /absolute/path/to/example/project.ts --prompt '…'` from
80
- the input project to use the same editable example from elsewhere. The
81
- CLI also includes each example's built-in name as a convenience. The host
82
- captures the initial directory and writes outputs outside it by default.
83
- Use `--config ./config.ts` for trusted TypeScript run configuration.
116
+ ```sh
117
+ npm init -y
118
+ npm install --ignore-scripts "$ANYSWARM_SDK_ARCHIVE"
119
+ npm exec -- anyswarm eject parallel-swarm --dir ./my-swarm
120
+ cd my-swarm
121
+ npm install
122
+ npm start -- --cwd /absolute/path/to/project \
123
+ --prompt 'Explain the execution path, configuration and test coverage for the behavior we plan to change.' \
124
+ --output-dir /absolute/path/to/runs
125
+ ```
84
126
 
85
- The model, executor and Sandbox environment variables are documented in
86
- [Quickstart](../docs/en/quickstart.md). Existing scoped variables remain
87
- fallbacks. Separate benchmarks take explicit configuration and fixtures.
88
- See [FATE](../benchmarks/fate/README.md) and [Lead–Worker Orders](../benchmarks/lead-worker-orders/README.md).
127
+ Common model/executor environment settings take precedence over scoped
128
+ fallbacks; setup supplies the saved Sandbox connection and executor. Explicit
129
+ `--config ./config.ts` selects the complete trusted configuration. Input files,
130
+ model credentials and output directories have separate roles: keep credentials
131
+ on the host and put Run output outside the investigated repository.
89
132
 
90
- ## Export an editable Harness
133
+ For other collaboration examples, copy the complete directory from the same
134
+ installed SDK and run its local `project.ts` with `anyswarm run`. The existing
135
+ per-example package/build route remains supported:
91
136
 
92
137
  ```sh
93
- anyswarm eject example --dir ./my-harness
94
- cd my-harness
95
- npm install
96
- npm run start
138
+ sdk=node_modules/@anyswarm/core
139
+ cp -R "$sdk"/examples/taskpool demo
140
+ cd demo
141
+ ../node_modules/.bin/anyswarm run ./project.ts \
142
+ --cwd /absolute/path/to/project --prompt 'Your actual task'
97
143
  ```
98
144
 
99
- Edit `business.ts` and run it again to see your own result. Export includes the
100
- complete source and an SDK archive dependency bound to that package's contents.
101
- Run `npm install` to install that local archive when moving the export to another
102
- machine. `anyswarm-source.json` records source revision, SDK source, content and
103
- archive digests. Application teams register the same source manifest for
104
- `anyswarm eject code`, `anyswarm eject autoresearch` and `anyswarm eject super`.
105
-
106
- ## Smaller SDK tutorials
145
+ ## Export an editable Harness
107
146
 
108
- | Example | Host entry | What to verify |
109
- | --- | --- | --- |
110
- | [First Harness](../docs/en/first-harness.md) | [harness.ts](first-harness/harness.ts) | Publisher and Writer handoff, answer, and exact exported bytes. |
111
- | [Parallel Swarm](../docs/en/build-your-harness.md) | [harness.ts](parallel-swarm/harness.ts) | Parallel research, peer review and synthesis through a shared Board. |
112
- | [Notes](notes/README.md) | [main.ts](notes/main.ts) | Writer and reader share a custom Service and verify the result. |
113
- | [Messages](messages/README.md) | [handoff.ts](messages/handoff.ts) | Two-Agent handoff and file verification with an in-process or attached HTTP Service. |
114
- | [Persistent Board](services/persistent-board/README.md) | [run.ts](services/persistent-board/run.ts) | A replacement reader sees the original committed entry. The local adapter exports state for the Viewer. |
115
- | [Agent Control](services/agent-control/README.md) | [main.ts](services/agent-control/main.ts) and [run.ts](services/agent-control/run.ts) | The lead creates, reads, sends to and stops its child. The Host reports the close receipt. |
116
- | [Managed MCP and process](services/mcp-managed/README.md) | [host.ts](services/mcp-managed/host.ts) and [run.ts](services/mcp-managed/run.ts) | MCP results, owned and attached lifecycles, and original-process cleanup after Controller loss. |
117
-
118
- The [Service examples index](services/README.md) also links the optional
119
- [GitHub Issues](services/github-issues/README.md) and
120
- [Mathlib Search](services/mathlib-search/README.md) providers.
121
-
122
- Read the Host entry for Worker settings, the named registrations and each
123
- Profile’s grants. Follow the runner for Agent input, business checks and the
124
- close receipt. Each example's README gives its launch and evidence paths.
125
-
126
- ## Repository boundaries
127
-
128
- Each project owns its collaboration and Services. Its TypeScript imports the
129
- package root and uses a local ESM project entry. The CLI built-in aliases load
130
- the bundled copies of those same entries. See the [Harness author contract](../docs/architecture/23-project-harness.md#authoring-an-example)
131
- and the [repository migration](../docs/designs/repository-layout.md).
147
+ Use **`parallel-swarm`** to start from readable fixed collaboration, `subagents`
148
+ for dynamic delegation, or `first-harness` to learn Service handoff. Their source
149
+ manifests include the actual configuration, business/controller code, Services
150
+ and an application-author `AGENTS.md`. No export depends on a sibling example.
151
+
152
+ `anyswarm-source.json` records source and SDK content/archive identity;
153
+ `.anyswarm-sdk/core.tgz` is the local SDK dependency. Run `npm install` and use
154
+ the exported project's `npm start` to preserve that identity. Edit the visible
155
+ business source and test the changed behavior with a real question. The root
156
+ repository's maintainer `AGENTS.md` is not the downstream author guide.
157
+
158
+ `anyswarm eject example --dir ./protocol-example` continues to export the
159
+ zero-Runtime authoring fixture. Code, Super and AutoResearch retain their own
160
+ application manifests and dependency requirements.
161
+
162
+ ## Evidence handoff and remaining real runs
163
+
164
+ The new source-export/configuration/Board tests are deterministic API checks.
165
+ Installed-package checks execute copied source outside repository ancestry and
166
+ verify matching SDK bytes. Record their exact command and candidate identity in
167
+ the implementation PR. They do not substitute for native Sandbox execution.
168
+
169
+ Before publishing a new real-use Trace, run the Subagents handoff on a real
170
+ repository and a second question or directory; inspect child contributions,
171
+ Root's citations and report. Run the exported Parallel Swarm with a real model,
172
+ then change its question or visible business code and inspect the new findings.
173
+ Keep the model/executor, source snapshot, duration, artifacts and cleanup with
174
+ each Run. The owner has deferred these real-model acceptance runs; do not relabel
175
+ the website's current controlled Trace fixture as that evidence.
176
+
177
+ The [public guides](../docs/INDEX.md) and website consume these contracts under
178
+ [#358](https://github.com/AnySwarm/anyswarm/issues/358). Source code, configurations
179
+ and checks remain owned by the examples. See the
180
+ [Harness author contract](../docs/architecture/23-project-harness.md#authoring-an-example)
181
+ for the public SDK and lifecycle boundaries.