@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.
- package/AGENTS.md +19 -4
- package/README.md +68 -61
- package/dist/examples/README.md +134 -84
- package/dist/examples/autoresearch/README.md +106 -21
- package/dist/examples/autoresearch/REQUIREMENTS.zh.md +14 -6
- package/dist/examples/autoresearch/config.d.ts +48 -5
- package/dist/examples/autoresearch/config.js +57 -23
- package/dist/examples/autoresearch/demo.d.ts +12 -4
- package/dist/examples/autoresearch/demo.js +65 -22
- package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -2
- package/dist/examples/autoresearch/frontiercs2-config.js +13 -2
- package/dist/examples/autoresearch/frontiercs2.d.ts +18 -1
- package/dist/examples/autoresearch/frontiercs2.js +71 -14
- package/dist/examples/autoresearch/prepare-demo.js +34 -3
- package/dist/examples/autoresearch/prepare.d.ts +105 -53
- package/dist/examples/autoresearch/prepare.js +126 -57
- package/dist/examples/autoresearch/project.d.ts +6 -1
- package/dist/examples/autoresearch/project.js +130 -26
- package/dist/examples/autoresearch/research-service.d.ts +16 -1
- package/dist/examples/autoresearch/research-service.js +84 -44
- package/dist/examples/code/config.d.ts +1 -0
- package/dist/examples/first-harness/AGENTS.md +25 -0
- package/dist/examples/first-harness/README.md +136 -0
- package/dist/examples/first-harness/config.d.ts +9 -8
- package/dist/examples/first-harness/config.js +33 -26
- package/dist/examples/first-harness/eject.json +14 -0
- package/dist/examples/first-harness/handoff.js +3 -3
- package/dist/examples/first-harness/harness.d.ts +14 -18
- package/dist/examples/first-harness/harness.js +102 -77
- package/dist/examples/first-harness/input/README.md +7 -0
- package/dist/examples/first-harness/session.js +2 -1
- package/dist/examples/first-harness/tsconfig.json +2 -1
- package/dist/examples/harness-session/README.md +1 -1
- package/dist/examples/lead-worker/README.md +1 -1
- package/dist/examples/lead-worker/project-config.d.ts +1 -0
- package/dist/examples/messages/README.md +2 -2
- package/dist/examples/notes/README.md +2 -2
- package/dist/examples/notes/config.d.ts +1 -0
- package/dist/examples/parallel-swarm/AGENTS.md +32 -0
- package/dist/examples/parallel-swarm/README.md +136 -0
- package/dist/examples/parallel-swarm/board-service.js +25 -8
- package/dist/examples/parallel-swarm/board.d.ts +31 -1
- package/dist/examples/parallel-swarm/board.js +98 -13
- package/dist/examples/parallel-swarm/config.d.ts +11 -0
- package/dist/examples/parallel-swarm/config.js +39 -0
- package/dist/examples/parallel-swarm/eject.json +5 -0
- package/dist/examples/parallel-swarm/harness.d.ts +26 -20
- package/dist/examples/parallel-swarm/harness.js +77 -76
- package/dist/examples/parallel-swarm/report.d.ts +12 -0
- package/dist/examples/parallel-swarm/report.js +30 -0
- package/dist/examples/peermesh/README.md +1 -1
- package/dist/examples/peermesh/project-config.d.ts +1 -0
- package/dist/examples/services/agent-control/README.md +1 -1
- package/dist/examples/services/mathlib-search/README.md +1 -1
- package/dist/examples/services/mcp-managed/README.md +1 -1
- package/dist/examples/services/persistent-board/README.md +1 -1
- package/dist/examples/subagents/AGENTS.md +35 -0
- package/dist/examples/subagents/README.md +129 -93
- package/dist/examples/subagents/config.d.ts +2 -10
- package/dist/examples/subagents/config.js +8 -15
- package/dist/examples/subagents/eject.json +17 -0
- package/dist/examples/subagents/handoff-config.d.ts +41 -0
- package/dist/examples/subagents/handoff-config.js +13 -0
- package/dist/examples/subagents/model.d.ts +3 -0
- package/dist/examples/subagents/model.js +19 -0
- package/dist/examples/substrate/README.md +12 -6
- package/dist/examples/substrate/config.d.ts +1 -0
- package/dist/examples/substrate/project-config.d.ts +1 -0
- package/dist/examples/taskpool/README.md +1 -1
- package/dist/examples/taskpool/config.d.ts +1 -0
- package/dist/examples/taskpool/deploy/service-hosts/service-authority-snapshot.d.ts +4 -4
- package/dist/scripts/anyswarm-progress.js +36 -5
- package/dist/scripts/build-provenance.json +1 -1
- package/dist/scripts/generate-architecture-coverage.js +1 -1
- package/dist/scripts/generate-architecture-prompts.js +18 -10
- package/dist/scripts/local-environment.d.ts +3 -3
- package/dist/scripts/local-environment.js +6 -1
- package/dist/scripts/local-setup.js +25 -18
- package/dist/scripts/pack-release.js +27 -3
- package/dist/src/core/index.js +1 -1
- package/dist/src/core/sandbox/opensandbox-backend.js +10 -4
- package/dist/src/core/sandbox/sandbox-connection.d.ts +9 -2
- package/dist/src/core/sandbox/sandbox-connection.js +22 -7
- package/dist/src/harness/project-harness.js +3 -2
- package/dist/src/harness/project-rpc-client.js +19 -0
- package/dist/src/harness/typescript-loader.d.ts +2 -0
- package/dist/src/harness/typescript-loader.js +26 -8
- package/dist/src/trace-viewer/command.mjs +6 -3
- package/dist/src/trace-viewer/public/app.js +239 -59
- package/dist/src/trace-viewer/public/index.html +5 -0
- package/dist/src/trace-viewer/public/style.css +22 -0
- package/dist/src/trace-viewer/reader.mjs +242 -26
- package/dist/src/trace-viewer/run-root.d.mts +1 -0
- package/dist/src/trace-viewer/run-root.mjs +7 -0
- package/dist/src/trace-viewer/server.mjs +3 -1
- package/docs/INDEX.md +9 -8
- package/docs/architecture/06-observability-experiments.md +21 -7
- package/docs/architecture/07-run-configuration.md +97 -12
- package/docs/architecture/08-prompts.md +21 -2
- package/docs/architecture/10-service-api-reference.md +12 -5
- package/docs/architecture/12-code-coverage.md +129 -86
- package/docs/architecture/15-core-runtime.md +1 -1
- package/docs/architecture/16-pi-opensandbox-backend.md +2 -0
- package/docs/architecture/17-harness-reporting.md +78 -0
- package/docs/architecture/22-website.md +53 -18
- package/docs/architecture/23-project-harness.md +63 -16
- package/docs/architecture/28-autoresearch.md +16 -22
- package/docs/architecture/prompts/11-first-sdk-harness.md +9 -9
- package/docs/architecture/prompts/16-parallel-swarm.md +46 -13
- package/docs/architecture/prompts/22-autoresearch.md +9 -2
- package/docs/architecture/prompts/source-manifest.json +78 -54
- package/docs/architecture/source-map.json +396 -36
- package/docs/designs/core-harness/06-project-harness.md +1 -1
- package/docs/en/autoresearch.md +41 -0
- package/docs/en/blog/100b-tokens.md +157 -0
- package/docs/en/build-your-harness.md +47 -22
- package/docs/en/changelog.md +22 -1
- package/docs/en/first-harness.md +40 -32
- package/docs/en/harnesses/index.md +23 -23
- package/docs/en/harnesses/subagents.md +8 -29
- package/docs/en/latest.md +26 -5
- package/docs/en/overview.md +22 -22
- package/docs/en/quickstart.md +55 -21
- package/docs/en/reference/api.md +1 -1
- package/docs/en/trace-viewer.md +32 -12
- package/docs/operations/trace-viewer.md +25 -10
- package/docs/workflows/development.md +160 -120
- package/docs/workflows/release-and-docs-versioning.md +207 -55
- package/docs/workflows/release-cli-acceptance.md +124 -47
- package/docs/zh/autoresearch.md +41 -0
- package/docs/zh/blog/100b-tokens.md +102 -0
- package/docs/zh/build-your-harness.md +48 -23
- package/docs/zh/changelog.md +22 -1
- package/docs/zh/first-harness.md +43 -35
- package/docs/zh/harnesses/index.md +23 -23
- package/docs/zh/harnesses/subagents.md +8 -29
- package/docs/zh/latest.md +26 -5
- package/docs/zh/overview.md +23 -23
- package/docs/zh/quickstart.md +51 -21
- package/docs/zh/reference/api.md +1 -1
- package/docs/zh/trace-viewer.md +32 -12
- package/examples/README.md +134 -84
- package/examples/autoresearch/README.md +106 -21
- package/examples/autoresearch/REQUIREMENTS.zh.md +14 -6
- package/examples/autoresearch/config.ts +64 -25
- package/examples/autoresearch/demo.ts +75 -22
- package/examples/autoresearch/frontiercs2-config.ts +13 -2
- package/examples/autoresearch/frontiercs2.ts +64 -11
- package/examples/autoresearch/prepare-demo.ts +32 -3
- package/examples/autoresearch/prepare.ts +134 -60
- package/examples/autoresearch/project.ts +119 -26
- package/examples/autoresearch/research-service.ts +91 -41
- package/examples/first-harness/AGENTS.md +25 -0
- package/examples/first-harness/README.md +136 -0
- package/examples/first-harness/config.ts +41 -27
- package/examples/first-harness/eject.json +14 -0
- package/examples/first-harness/handoff.ts +3 -3
- package/examples/first-harness/harness.ts +104 -72
- package/examples/first-harness/input/README.md +7 -0
- package/examples/first-harness/session.ts +2 -1
- package/examples/first-harness/tsconfig.json +2 -1
- package/examples/harness-session/README.md +1 -1
- package/examples/lead-worker/README.md +1 -1
- package/examples/messages/README.md +2 -2
- package/examples/notes/README.md +2 -2
- package/examples/parallel-swarm/AGENTS.md +32 -0
- package/examples/parallel-swarm/README.md +136 -0
- package/examples/parallel-swarm/board-service.ts +28 -9
- package/examples/parallel-swarm/board.ts +107 -13
- package/examples/parallel-swarm/config.ts +47 -0
- package/examples/parallel-swarm/eject.json +5 -0
- package/examples/parallel-swarm/harness.ts +83 -71
- package/examples/parallel-swarm/report.ts +33 -0
- package/examples/peermesh/README.md +1 -1
- package/examples/services/agent-control/README.md +1 -1
- package/examples/services/mathlib-search/README.md +1 -1
- package/examples/services/mcp-managed/README.md +1 -1
- package/examples/services/persistent-board/README.md +1 -1
- package/examples/subagents/AGENTS.md +35 -0
- package/examples/subagents/README.md +129 -93
- package/examples/subagents/config.ts +8 -15
- package/examples/subagents/eject.json +17 -0
- package/examples/subagents/handoff-config.ts +14 -0
- package/examples/subagents/model.ts +20 -0
- package/examples/substrate/README.md +12 -6
- package/examples/taskpool/README.md +1 -1
- package/npm-shrinkwrap.development.json +9 -2
- package/npm-shrinkwrap.json +9 -2
- package/package.development.json +2 -1
- package/package.json +2 -1
- package/scripts/anyswarm-progress.ts +36 -6
- package/scripts/generate-architecture-coverage.ts +1 -1
- package/scripts/generate-architecture-prompts.ts +21 -10
- package/scripts/local-environment.ts +8 -1
- package/scripts/local-setup.ts +22 -17
- package/scripts/pack-release.ts +24 -3
- package/src/core/index.ts +1 -1
- package/src/core/sandbox/opensandbox-backend.ts +10 -4
- package/src/core/sandbox/sandbox-connection.ts +22 -7
- package/src/harness/project-harness.ts +3 -2
- package/src/harness/project-rpc-client.ts +23 -0
- package/src/harness/typescript-loader.ts +28 -8
- package/src/trace-viewer/command.mjs +6 -3
- package/src/trace-viewer/public/app.js +239 -59
- package/src/trace-viewer/public/index.html +5 -0
- package/src/trace-viewer/public/style.css +22 -0
- package/src/trace-viewer/reader.mjs +242 -26
- package/src/trace-viewer/run-root.d.mts +1 -0
- package/src/trace-viewer/run-root.mjs +7 -0
- package/src/trace-viewer/server.mjs +3 -1
package/docs/zh/overview.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 文档总览
|
|
3
|
-
description:
|
|
4
|
-
section:
|
|
3
|
+
description: 使用 AnySwarm 运行有实际用途的多 Agent 工作流、检查证据,并用 TypeScript SDK 定制协作。
|
|
4
|
+
section: GET STARTED
|
|
5
5
|
order: 0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
AnySwarm 是面向多 Agent 团队的 TypeScript SDK 与 CLI,提供独立工作区、共享状态和可检查的结果。**Harness** 定义角色、协作与结束条件;**Runtime** 运行团队、鉴权 Service 调用并收集记录与产物。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## 从一项工作开始
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)。
|
package/docs/zh/quickstart.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 快速上手
|
|
3
|
-
description:
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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.
|
|
135
|
+
## 3. 为真实仓库生成工程交接报告
|
|
117
136
|
|
|
118
|
-
|
|
137
|
+
使用 AnySwarm 0.6.0 或[匹配的源码构建包](#从源码构建并安装main)导出交接示例。下面固定了 [p-limit 真实验收](https://github.com/AnySwarm/anyswarm/issues/358#issuecomment-7385075753)的仓库版本。体验后可把输入路径换成自己仓库中一个聚焦目录。
|
|
119
138
|
|
|
120
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
anyswarm
|
|
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
|
-
|
|
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.
|
|
160
|
+
## 4. 检查报告和背后的协作
|
|
137
161
|
|
|
138
162
|
```bash
|
|
139
|
-
anyswarm trace --root ./runs --port 8787
|
|
163
|
+
anyswarm trace --root ./runs --port 8787
|
|
140
164
|
```
|
|
141
165
|
|
|
142
|
-
|
|
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
|
-
|
|
174
|
+
无需安装或凭据即可打开 [p-limit 真实交接回放](./trace-viewer.md),查看 Root 和两个子成员如何协作,以及他们导出的 `report.md`。
|
|
145
175
|
|
|
146
176
|
## 下一步
|
|
147
177
|
|
|
148
|
-
- [
|
|
149
|
-
- [
|
|
150
|
-
- [
|
|
178
|
+
- [选择示例](harnesses/index.md)——按三层定位了解应用、协作参考与进阶集成。
|
|
179
|
+
- [第一个 SDK Harness](first-harness.md) → [并行 Swarm](build-your-harness.md)——学习 Service 交接、字节检查、并行互评与汇总。
|
|
180
|
+
- [AutoResearch](autoresearch.md)——了解当前研究应用与 Evaluator 要求。
|
package/docs/zh/reference/api.md
CHANGED
|
@@ -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#
|
|
20
|
+
要安装经校验的[源码构建归档](../quickstart.md#从源码构建并安装main),使用下面的命令。[发行版本页](../latest.md#v052)提供固定版本的安装命令。
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
npm install --ignore-scripts /path/to/verified-anyswarm.tgz
|
package/docs/zh/trace-viewer.md
CHANGED
|
@@ -5,27 +5,41 @@ section: 核心构件
|
|
|
5
5
|
order: 8
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
标准 Harness Session 会保存 Run 报告,每个实际创建的 Runtime 则写入自己的结构化轨迹。内置的 **Trace Viewer**(`anyswarm trace`)让你直接在浏览器里检查已记录的 Runtime 活动,**无需安装任何额外前端依赖**。Harness 也可能在创建 Runtime 前完成或失败;这种报告的查看方式见下文版本说明。
|
|
9
9
|
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
18
|
+
- **悬浮与点击检视**:鼠标悬浮任意色块可查看记录中的耗时与摘要;点击任意色块会在右侧滑出 **Evidence Inspector**,支持 **Structured** 与 **Raw JSON** 两种查看方式。
|
|
15
19
|
|
|
16
20
|
## 1. 本地启动 `anyswarm trace`
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
标准 CLI 和 `createHarnessSession()` 的默认根目录是 `${XDG_STATE_HOME:-$HOME/.local/state}/anyswarm/runs`。在已安装 SDK 的项目中,用项目内 CLI 打开该目录:
|
|
19
23
|
|
|
20
24
|
```bash
|
|
21
|
-
#
|
|
22
|
-
anyswarm trace --root
|
|
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
|
-
|
|
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.
|
|
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` |
|
|
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 中的工具结果计数,结果缺少时间戳也会计入。
|
package/examples/README.md
CHANGED
|
@@ -1,41 +1,68 @@
|
|
|
1
1
|
# Examples and Service integrations
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
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
|
-
##
|
|
29
|
+
## Three levels
|
|
26
30
|
|
|
27
|
-
|
|
|
28
|
-
| --- | --- | --- |
|
|
29
|
-
| [subagents](subagents/README.md)
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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.
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
75
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
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
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
and
|
|
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.
|