@anyswarm/core 0.5.1 → 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 +20 -5
- package/README.md +69 -55
- package/dist/examples/README.md +138 -77
- package/dist/examples/authoring/README.md +4 -4
- package/dist/examples/autoresearch/README.md +108 -16
- package/dist/examples/autoresearch/REQUIREMENTS.zh.md +13 -12
- 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/eject.json +2 -0
- package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -0
- package/dist/examples/autoresearch/frontiercs2-config.js +14 -0
- package/dist/examples/autoresearch/frontiercs2.d.ts +18 -1
- package/dist/examples/autoresearch/frontiercs2.js +71 -14
- package/dist/examples/autoresearch/prepare-demo.d.ts +1 -0
- package/dist/examples/autoresearch/prepare-demo.js +46 -0
- 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 -95
- package/dist/examples/autoresearch/project.js +131 -45
- package/dist/examples/autoresearch/research-service.d.ts +16 -1
- package/dist/examples/autoresearch/research-service.js +84 -44
- package/dist/examples/code/README.md +25 -17
- package/dist/examples/code/REQUIREMENTS.zh.md +3 -3
- 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 +4 -4
- 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 +5 -5
- 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 +6 -3
- 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 +9 -16
- 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/super/README.md +34 -22
- package/dist/examples/super/actions.d.ts +1 -1
- package/dist/examples/super/actions.js +11 -11
- package/dist/examples/super/config.js +3 -3
- package/dist/examples/super/eject.json +1 -1
- package/dist/examples/super/location.js +1 -1
- package/dist/examples/super/operator.d.ts +1 -0
- package/dist/examples/super/operator.js +31 -0
- package/dist/examples/super/project.d.ts +0 -107
- package/dist/examples/super/project.js +1 -3
- 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-arguments.d.ts +7 -25
- package/dist/scripts/anyswarm-arguments.js +69 -97
- package/dist/scripts/anyswarm-eject.js +1 -1
- package/dist/scripts/anyswarm-harnesses.d.ts +0 -1
- package/dist/scripts/anyswarm-harnesses.js +1 -22
- package/dist/scripts/anyswarm-installation.d.ts +7 -40
- package/dist/scripts/anyswarm-installation.js +17 -291
- package/dist/scripts/anyswarm-launch.d.ts +6 -36
- package/dist/scripts/anyswarm-launch.js +32 -81
- package/dist/scripts/anyswarm-progress.d.ts +6 -0
- package/dist/scripts/anyswarm-progress.js +133 -0
- package/dist/scripts/anyswarm-project.d.ts +1 -9
- package/dist/scripts/anyswarm-project.js +40 -127
- package/dist/scripts/anyswarm-source-runner.js +9 -41
- package/dist/scripts/anyswarm.js +6 -26
- 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 +13 -7
- package/dist/scripts/local-environment.js +73 -21
- package/dist/scripts/local-setup.d.ts +3 -0
- package/dist/scripts/local-setup.js +153 -118
- package/dist/scripts/pack-release.js +31 -4
- 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/core/worker-image.js +1 -1
- package/dist/src/harness/project-harness.d.ts +1 -0
- package/dist/src/harness/project-harness.js +5 -4
- package/dist/src/harness/project-rpc-client.js +19 -0
- package/dist/src/harness/project-runtime.js +3 -1
- 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 +11 -9
- package/docs/architecture/04-services.md +1 -1
- package/docs/architecture/06-observability-experiments.md +21 -7
- package/docs/architecture/07-run-configuration.md +118 -19
- 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 +157 -115
- 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 +79 -1
- package/docs/architecture/22-website.md +52 -20
- package/docs/architecture/23-project-harness.md +109 -37
- package/docs/architecture/26-code.md +20 -5
- package/docs/architecture/27-personal.md +23 -8
- package/docs/architecture/28-autoresearch.md +18 -12
- package/docs/architecture/INDEX.md +1 -2
- 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 +76 -52
- package/docs/architecture/source-map.json +445 -105
- package/docs/designs/core-harness/01-core.md +2 -2
- package/docs/designs/core-harness/06-project-harness.md +3 -3
- package/docs/designs/core-harness/README.md +2 -2
- package/docs/en/agents.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 +29 -1
- package/docs/en/first-harness.md +40 -32
- package/docs/en/harnesses/index.md +23 -23
- package/docs/en/harnesses/lead-worker.md +1 -1
- package/docs/en/harnesses/peermesh.md +2 -2
- package/docs/en/harnesses/subagents.md +10 -31
- package/docs/en/harnesses/substrate.md +4 -4
- package/docs/en/harnesses/taskpool.md +2 -2
- package/docs/en/latest.md +30 -5
- package/docs/en/overview.md +22 -22
- package/docs/en/quickstart.md +69 -56
- package/docs/en/reference/api.md +1 -1
- package/docs/en/reference/cli.md +47 -85
- package/docs/en/sandbox.md +3 -3
- package/docs/en/trace-viewer.md +32 -12
- package/docs/operations/trace-viewer.md +26 -11
- package/docs/third-party-notices.md +0 -1
- package/docs/workflows/development.md +160 -118
- package/docs/workflows/release-and-docs-versioning.md +207 -54
- package/docs/workflows/release-cli-acceptance.md +162 -0
- package/docs/zh/agents.md +1 -1
- 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 +29 -1
- package/docs/zh/first-harness.md +43 -35
- package/docs/zh/harnesses/index.md +23 -23
- package/docs/zh/harnesses/lead-worker.md +1 -1
- package/docs/zh/harnesses/peermesh.md +2 -2
- package/docs/zh/harnesses/subagents.md +10 -31
- package/docs/zh/harnesses/substrate.md +4 -4
- package/docs/zh/harnesses/taskpool.md +2 -2
- package/docs/zh/latest.md +30 -5
- package/docs/zh/overview.md +23 -23
- package/docs/zh/quickstart.md +66 -57
- package/docs/zh/reference/api.md +1 -1
- package/docs/zh/reference/cli.md +19 -79
- package/docs/zh/sandbox.md +3 -3
- package/docs/zh/trace-viewer.md +32 -12
- package/examples/README.md +138 -77
- package/examples/authoring/README.md +4 -4
- package/examples/autoresearch/README.md +108 -16
- package/examples/autoresearch/REQUIREMENTS.zh.md +13 -12
- package/examples/autoresearch/config.ts +64 -25
- package/examples/autoresearch/demo.ts +75 -22
- package/examples/autoresearch/eject.json +2 -0
- package/examples/autoresearch/frontiercs2-config.ts +15 -0
- package/examples/autoresearch/frontiercs2.ts +64 -11
- package/examples/autoresearch/prepare-demo.ts +44 -0
- package/examples/autoresearch/prepare.ts +134 -60
- package/examples/autoresearch/project.ts +120 -44
- package/examples/autoresearch/research-service.ts +91 -41
- package/examples/code/README.md +25 -17
- package/examples/code/REQUIREMENTS.zh.md +3 -3
- 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 +4 -4
- package/examples/lead-worker/README.md +1 -1
- package/examples/messages/README.md +2 -2
- package/examples/notes/README.md +5 -5
- 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 +6 -3
- package/examples/subagents/AGENTS.md +35 -0
- package/examples/subagents/README.md +129 -93
- package/examples/subagents/config.ts +9 -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/super/README.md +34 -22
- package/examples/super/actions.ts +11 -11
- package/examples/super/config.ts +3 -3
- package/examples/super/eject.json +1 -1
- package/examples/super/location.ts +1 -1
- package/examples/super/operator.ts +28 -0
- package/examples/super/project.ts +1 -3
- package/examples/taskpool/README.md +1 -1
- package/npm-shrinkwrap.development.json +46 -1538
- package/npm-shrinkwrap.json +10 -43
- package/package.development.json +3 -6
- package/package.json +3 -5
- package/scripts/anyswarm-arguments.ts +67 -96
- package/scripts/anyswarm-eject.ts +1 -1
- package/scripts/anyswarm-harnesses.ts +1 -18
- package/scripts/anyswarm-installation.ts +18 -294
- package/scripts/anyswarm-launch.ts +30 -102
- package/scripts/anyswarm-progress.ts +125 -0
- package/scripts/anyswarm-project.ts +31 -123
- package/scripts/anyswarm-source-runner.ts +9 -36
- package/scripts/anyswarm.ts +4 -24
- package/scripts/generate-architecture-coverage.ts +1 -1
- package/scripts/generate-architecture-prompts.ts +21 -10
- package/scripts/local-environment.ts +79 -21
- package/scripts/local-setup.ts +150 -105
- package/scripts/pack-release.ts +28 -4
- 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/core/worker-image.ts +1 -1
- package/src/harness/project-harness.ts +5 -4
- package/src/harness/project-rpc-client.ts +23 -0
- package/src/harness/project-runtime.ts +2 -1
- 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/dist/scripts/anyswarm-applications.d.ts +0 -19
- package/dist/scripts/anyswarm-applications.js +0 -19
- package/dist/scripts/anyswarm-tui-config.d.ts +0 -36
- package/dist/scripts/anyswarm-tui-config.js +0 -189
- package/dist/scripts/anyswarm-tui-session.d.ts +0 -66
- package/dist/scripts/anyswarm-tui-session.js +0 -304
- package/dist/scripts/anyswarm-tui-terminal.d.ts +0 -41
- package/dist/scripts/anyswarm-tui-terminal.js +0 -154
- package/dist/scripts/anyswarm-tui.d.ts +0 -2
- package/dist/scripts/anyswarm-tui.js +0 -1012
- package/docs/architecture/25-foreground-tui.md +0 -51
- package/scripts/anyswarm-applications.ts +0 -39
- package/scripts/anyswarm-tui-config.ts +0 -174
- package/scripts/anyswarm-tui-session.ts +0 -295
- package/scripts/anyswarm-tui-terminal.ts +0 -147
- package/scripts/anyswarm-tui.ts +0 -912
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Choose
|
|
3
|
-
description:
|
|
4
|
-
section:
|
|
2
|
+
title: Choose an example
|
|
3
|
+
description: Choose a useful first task, SDK tutorial, application, collaboration reference, or advanced integration with explicit prerequisites.
|
|
4
|
+
section: EXAMPLES
|
|
5
5
|
order: 10
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
A **Harness** defines how a
|
|
8
|
+
A **Harness** defines how a team divides work, shares information, checks results and ends. Choose an example by the job you want to do, then read the underlying collaboration policy. The [example catalog](../../../examples/README.md) owns the complete source, dependency and status inventory.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Three tiers
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
| Tier | Purpose | Examples |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| **1 · Start and learn** | Run one useful task; learn the SDK in two steps. | [Repository handoff with Subagents](../quickstart.md); [First Harness](../first-harness.md) → [Parallel Swarm](../build-your-harness.md). The SDK tutorials use 0.6.0 or a matching source build. |
|
|
15
|
+
| **2 · Applications and reference topologies** | Explore an application or adapt a collaboration mechanism. | [AutoResearch](../autoresearch.md), with its current FrontierCS-2 setup; [Subagents](subagents.md), [TaskPool](taskpool.md), [Substrate](substrate.md). |
|
|
16
|
+
| **3 · Advanced source and integrations** | Study a protocol, daemon or external service integration. | `super`, `code`, `harness-session`, focused Service examples; [PeerMesh](peermesh.md) and [Lead-Worker](lead-worker.md). Code development is paused. |
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
cd my-project
|
|
20
|
-
anyswarm --harness subagents --prompt "Fix the parser and add tests"
|
|
21
|
-
```
|
|
18
|
+
## Know the prerequisites before you choose
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
All live Agent examples need OpenSandbox, a compatible Worker/executor and model access. `anyswarm setup` prepares the common Runtime deployment. It does not deploy each application’s external services.
|
|
24
21
|
|
|
25
22
|
| Examples | Additional facilities |
|
|
26
23
|
| --- | --- |
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
24
|
+
| First Harness, Parallel Swarm, Subagents, TaskPool, ordinary Substrate | Their entrypoints create in-process Services and local stores. No additional business service deployment. |
|
|
25
|
+
| AutoResearch / FrontierCS-2 | Linux x86-64, Git LFS, Python, local Docker, prepared benchmark/checker images and the configured K3 route. See its [current requirements](../autoresearch.md). |
|
|
26
|
+
| PeerMesh | Gitea, Mattermost, MySQL and the upstream Board process. |
|
|
27
|
+
| Lead-Worker | Gitea; optional dynamic mode also needs the checking Service and candidate verifier image. |
|
|
28
|
+
| Optional Lean workloads | Their checker/toolchain and, where configured, [Mathlib Search](../../../examples/services/mathlib-search/README.md). |
|
|
29
|
+
|
|
30
|
+
PeerMesh and Lead-Worker require an OpenSandbox deployment enforcing Git network allowlists with `dns+nft`. See [deployment ownership](../../../deploy/README.md).
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
## Run or adapt a Harness
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Follow [Quickstart](../quickstart.md) to produce `report.md` from your repository with the existing `subagents` entrypoint. Built-in names also include `autoresearch`, `taskpool`, `peermesh`, `substrate`, `lead-worker`, `notes` and `messages`; each loads its example’s standard Harness module and still needs its configuration and prerequisites.
|
|
35
35
|
|
|
36
|
-
The
|
|
36
|
+
The shared CLI handles loading, initial directory capture, session lifecycle and RPC framing. The example owns its roles, Services and acceptance. Private Sandbox copies do not stay synchronized with the original directory, and exported results do not automatically overwrite it.
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
To customize, use the [SDK tutorials and author prompt](../build-your-harness.md), respecting the version boundary documented there. An ordinary team shares one Runtime. Task completion, independent business acceptance, export and cleanup remain separate facts.
|
|
39
39
|
|
|
40
40
|
## Five collaboration patterns at a glance
|
|
41
41
|
|
|
@@ -113,7 +113,7 @@ From a built checkout, prepare OpenSandbox, a compatible Pi Worker image, a Gite
|
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
# Set run ID, immutable worker image, OpenSandbox URL, Gitea admin credentials, and model URL
|
|
116
|
-
|
|
116
|
+
anyswarm run ./benchmarks/lead-worker-orders/main.ts ./benchmarks/lead-worker-orders/config.ts
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
On close, the host fences new Board writes and calls `runtime.close()`. It closes the Board connection and revokes owned Gitea credentials only after Core confirms stopped execution and complete cleanup. Unknown execution, required export failures or Board evidence failures leave dependencies pending for reconciliation. The shared repository, Board database, commits and PRs remain for review. Inspect `harness-report.json` for business failure, delivered and unfinished work, uncertain inputs, cleanup and report-save outcomes.
|
|
@@ -113,7 +113,7 @@ export ANYSWARM_PEERMESH_MODEL_URL='https://your-model-endpoint/v1/responses'
|
|
|
113
113
|
export ANYSWARM_PEERMESH_PEERS=4
|
|
114
114
|
# Plus Gitea, Mattermost, and Board MySQL DSN host variables
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
anyswarm run ./scripts/run-harness.ts --config ./examples/peermesh/config.ts
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Once `ready` is emitted, send JSON-line commands over `stdin` to observe or steer peers, or let the team run to its configured `durationMs`:
|
|
@@ -128,7 +128,7 @@ Inspect saved reports, merge receipts, and archive digests afterward:
|
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
130
|
runtime_id=RUNTIME_ID_FROM_RESULT
|
|
131
|
-
|
|
131
|
+
anyswarm run ./scripts/read-harness-result.ts \
|
|
132
132
|
--run-directory "./peermesh-runs/$runtime_id" \
|
|
133
133
|
--runtime-id "$runtime_id"
|
|
134
134
|
```
|
|
@@ -7,46 +7,25 @@ order: 10
|
|
|
7
7
|
|
|
8
8
|
**Subagents** models a hierarchical team where a lead Agent (`/root`) breaks down work, spawns named child Agents recursively (up to `maxDepth`), steers busy children without waking idle ones, and integrates child results. Source: [examples/subagents](https://github.com/AnySwarm/anyswarm/tree/main/examples/subagents).
|
|
9
9
|
|
|
10
|
-
## Quick run
|
|
10
|
+
## Quick run: repository handoff
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Follow [Quickstart](../quickstart.md) to inspect your own repository and export `report.md`. Root receives your prompt and decides how to delegate. The suggested task asks separate children to inspect entry points and run commands, then modules and tests, before Root checks file references and integrates the findings.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
cd my-project
|
|
16
|
-
anyswarm --harness subagents --prompt "Fix the parser using the project tests"
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Subagents sends your prompt to `/root` and seeds each Sandbox with the captured project tree (separate isolated directories per Agent). In `--mode rpc`, follow-up user inputs route directly to `/root`. See the sections below for its interactive session controls, `collaboration` Service protocol, mailbox controller, and source-level embedding.
|
|
14
|
+
`--cwd` selects the directory captured at Run start. Each Agent receives a private copy; new local edits are not synchronized, and Sandbox changes are not written back. Results are collected into the Run output. Generic Subagents does not independently grade the report (`acceptance.status: "not-run"`). A task-lifetime run closes the team after its final outcome; ongoing client sessions are an advanced SDK/RPC option.
|
|
20
15
|
|
|
21
|
-
##
|
|
16
|
+
## Advanced SDK/RPC sessions and controls
|
|
22
17
|
|
|
23
18
|
The Subagents module default-exports a standard `Harness` (see [Your First SDK Harness](../first-harness.md)) shared across SDK `createHarnessSession`, explicit foreground CLI, and JSONL RPC, owning both workflow coordination and resource cleanup:
|
|
24
19
|
|
|
25
|
-
- **Continuous conversation (`--lifetime interactive`)**: keeps `/root` alive across replies, accepts plain text or `{ text, mode }` inputs, and exposes currently permitted settings and structured context controls via `describe()`.
|
|
20
|
+
- **Continuous RPC conversation (`--mode rpc --lifetime interactive`)**: keeps `/root` alive across replies, accepts plain text or `{ text, mode }` inputs, and exposes currently permitted settings and structured context controls via `describe()`.
|
|
26
21
|
- **Safe interruption**: interrupting `/root` fences its previous execution while allowing active children to finish; child results arriving after an interrupt stay queued in the inbox until the next explicit user input.
|
|
27
|
-
- **
|
|
22
|
+
- **RPC user questions (`--mode rpc --interaction questions`)**: when enabled, Agents can invoke `swarm service invoke user-interaction ask` to pose authorized questions to the client.
|
|
28
23
|
|
|
29
24
|
### Verify parent-child delegation
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
The child spawn Service call allows up to 60 seconds within the default 120-second Run work deadline. For a slower host, set `workTimeoutMs` in your Subagents configuration and pass the file with `anyswarm --config`.
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
mkdir -p anyswarm-delegation-check && cd anyswarm-delegation-check
|
|
36
|
-
printf '# Release checklist\n' > README.md
|
|
37
|
-
prompt=$(cat <<'PROMPT'
|
|
38
|
-
Delegate the README heading check to one child and report the exact heading the child returns. Let the child read the file. Use the bash tool with a 75 second tool timeout for each command. First run:
|
|
39
|
-
swarm collaboration spawn_agent --task-name reviewer --message 'Use the read tool to read README.md and return its exact first heading.' --fork-turns none --request-id reviewer-start --timeout-ms 65000
|
|
40
|
-
After spawn succeeds, run:
|
|
41
|
-
printf '{"timeout_ms":60000}\n' | swarm collaboration wait_agent --stdin --request-id wait-reviewer --timeout-ms 65000
|
|
42
|
-
Wait for the reviewer result before reporting the heading.
|
|
43
|
-
PROMPT
|
|
44
|
-
)
|
|
45
|
-
anyswarm --harness subagents --prompt "$prompt" --output-dir ./runs
|
|
46
|
-
anyswarm trace --root ./runs --port 8787 --open
|
|
47
|
-
```
|
|
26
|
+
After the repository task, use Trace Viewer to inspect the actual `collaboration.spawn_agent` calls, distinct child identities and file-read results. Confirm Root received each child's findings, and open the exported `report.md` through its recorded artifact path. Check whether child activity overlapped rather than inferring parallelism from the prompt.
|
|
48
27
|
|
|
49
|
-
|
|
28
|
+
The child spawn Service call allows up to 60 seconds within the default 120-second work deadline. Configure `workTimeoutMs` for a slower model or host. Export and cleanup must be inspected separately from business outcome. The default root collection covers the workspace up to 16 MiB; a focused configuration can require only `report.md`. These checks establish what happened and which bytes were retained, not whether every engineering conclusion is correct.
|
|
50
29
|
|
|
51
30
|
## 1. Registered Service (`collaboration`)
|
|
52
31
|
|
|
@@ -162,10 +141,10 @@ export ANYSWARM_MODEL_TOKEN='your-bearer-token'
|
|
|
162
141
|
# Optional: override the default prebuilt Worker image
|
|
163
142
|
# export ANYSWARM_WORKER_IMAGE='your-registry.example/compatible-worker:tag'
|
|
164
143
|
|
|
165
|
-
|
|
144
|
+
anyswarm run ./examples/subagents/main.ts ./examples/subagents/config.ts \
|
|
166
145
|
'Split this task into two independent checks and summarize the results.'
|
|
167
146
|
|
|
168
|
-
|
|
147
|
+
anyswarm run ./examples/subagents/main.ts ./examples/subagents/config.ts --interactive
|
|
169
148
|
```
|
|
170
149
|
|
|
171
150
|
Or embed `createSubagentsHarness` in Node.js:
|
|
@@ -96,11 +96,11 @@ export ANYSWARM_SUBSTRATE_RUN=research-01
|
|
|
96
96
|
export ANYSWARM_SUBSTRATE_MODEL_URL='https://your-model-endpoint/v1/responses'
|
|
97
97
|
export ANYSWARM_SUBSTRATE_MODEL_TOKEN='your-bearer-token'
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
anyswarm run ./examples/substrate/main.ts ./examples/substrate/config.ts > substrate-result.json
|
|
100
100
|
|
|
101
101
|
# Read saved receipts without loading model configuration:
|
|
102
102
|
runtime_id=RUNTIME_ID_FROM_RESULT
|
|
103
|
-
|
|
103
|
+
anyswarm run ./examples/substrate/main.ts --result "./substrate-runs/$runtime_id" --runtime-id "$runtime_id"
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
[collaboration-evidence.ts](https://github.com/AnySwarm/anyswarm/blob/main/examples/substrate/harness/collaboration-evidence.ts) audits `substrate_contents`, `substrate_references`, and `substrate_reads` to inspect a cross-peer reuse chain:
|
|
@@ -127,8 +127,8 @@ export ANYSWARM_FATE_BENCHMARK=FATE-X
|
|
|
127
127
|
export ANYSWARM_FATE_PROJECT=/path/to/fate-x
|
|
128
128
|
export ANYSWARM_FATE_LEAN=/path/to/lean-4.28.0
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
anyswarm run ./benchmarks/fate/main.ts --fate-prepare "$ANYSWARM_FATE_PROJECT" "$ANYSWARM_FATE_LEAN" FATE-X
|
|
131
|
+
anyswarm run ./benchmarks/fate/main.ts --fate-run ./benchmarks/fate/fate-config.ts
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
## Source files
|
|
@@ -84,7 +84,7 @@ For custom store compositions via the repository's foreground runner, provide an
|
|
|
84
84
|
After building the repository and creating that host module:
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
|
-
|
|
87
|
+
anyswarm run ./scripts/run-harness.ts --config ./my-taskpool-config.ts
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
The host accepts JSON-line `status`, Task-directed `input`, and `stop` commands. Task-directed input is resolved against the current Execution owner. It is not an arbitrary direct message to an Agent. The final record contains the Runtime identity and report path; the [foreground protocol](../../architecture/17-harness-reporting.md#foreground-harness-control) defines its commands and result codes.
|
|
@@ -92,7 +92,7 @@ The host accepts JSON-line `status`, Task-directed `input`, and `stop` commands.
|
|
|
92
92
|
Saved reports can be read without loading model configuration:
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
|
|
95
|
+
anyswarm run ./scripts/read-harness-result.ts \
|
|
96
96
|
--run-directory ./runs/RUNTIME_ID_FROM_RESULT \
|
|
97
97
|
--runtime-id RUNTIME_ID_FROM_RESULT
|
|
98
98
|
```
|
package/docs/en/latest.md
CHANGED
|
@@ -5,25 +5,50 @@ section: RELEASES
|
|
|
5
5
|
order: 15
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
## v0.
|
|
8
|
+
## v0.6.0
|
|
9
|
+
|
|
10
|
+
This distribution includes editable Harness exports, live and saved Trace improvements, and Node 26 TypeScript support. See the [v0.6.0 changelog](changelog.md#v060). When the version is available in the public registry, install it with npm:
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
```sh
|
|
13
|
+
npm install -g @anyswarm/core@0.6.0
|
|
14
|
+
anyswarm --version
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
In your project directory, install the SDK:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm install @anyswarm/core@0.6.0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For a prepublication candidate, follow the [source installation instructions](quickstart.md#build-and-install-from-source-main).
|
|
24
|
+
|
|
25
|
+
## v0.5.2
|
|
26
|
+
|
|
27
|
+
v0.5.2 makes npm the installation and upgrade path. Running `anyswarm` without arguments prints Quickstart. One-shot Harness runs show progress and a browser Trace command. See the [v0.5.2 changelog](changelog.md#v052) for migration instructions.
|
|
11
28
|
|
|
12
29
|
Install the CLI globally with npm and check the installed version.
|
|
13
30
|
|
|
14
31
|
```sh
|
|
15
|
-
npm install -g @anyswarm/core@0.5.
|
|
32
|
+
npm install -g @anyswarm/core@0.5.2
|
|
16
33
|
anyswarm --version
|
|
17
34
|
```
|
|
18
35
|
|
|
19
|
-
The [
|
|
36
|
+
The [v0.5.2 GitHub Release](https://github.com/AnySwarm/anyswarm/releases/tag/v0.5.2) also includes the npm archive.
|
|
20
37
|
|
|
21
38
|
To add the SDK as a dependency, run this command in your project.
|
|
22
39
|
|
|
23
40
|
```sh
|
|
24
|
-
npm install @anyswarm/core@0.5.
|
|
41
|
+
npm install @anyswarm/core@0.5.2
|
|
25
42
|
```
|
|
26
43
|
|
|
27
44
|
See [Install the SDK](reference/api.md#install-the-sdk) for SDK imports and the project-local CLI.
|
|
28
45
|
|
|
46
|
+
## v0.5.1
|
|
47
|
+
|
|
48
|
+
See the [v0.5.1 changelog](changelog.md#v051) for the previous CLI and platform support.
|
|
49
|
+
|
|
50
|
+
## v0.5.0
|
|
51
|
+
|
|
52
|
+
v0.5.0 was the first supported release of `@anyswarm/core`. See the [v0.5.0 changelog](changelog.md#v050) for that release.
|
|
53
|
+
|
|
29
54
|
Earlier releases used different npm package names. Their source and release artifacts are in the [GitHub release history](https://github.com/AnySwarm/anyswarm/releases).
|
package/docs/en/overview.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Overview
|
|
3
|
-
description:
|
|
3
|
+
description: Run useful multi-agent workflows, inspect their evidence, and adapt collaboration with the AnySwarm TypeScript SDK.
|
|
4
4
|
section: GET STARTED
|
|
5
5
|
order: 0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
AnySwarm is a TypeScript SDK and CLI for teams of Agents that need isolated workspaces, shared state, and inspectable results. A **Harness** defines the roles, collaboration and stopping rules. A **Runtime** runs the team, authenticates its Service calls and collects its records and artifacts.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Start from a job
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
| Job | How members work | What to inspect |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| [Repository handoff](quickstart.md) | Root delegates independent source inspection to children, checks their references and writes `report.md`. | The children’s file reads, returned findings and exported report. Generic Subagents does not independently certify its conclusions. |
|
|
15
|
+
| [AutoResearch](autoresearch.md) | Peers explore and review patches; a host-controlled Evaluator scores frozen candidates. | Candidate identities, reviews, training feedback and final evaluation. The editable two-peer FrontierCS-2 example has its own model, evaluator and resource requirements. |
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
Open the [recorded p-limit handoff](https://anyswarm.github.io/anyswarm/trace-demo/index.html?run=p-limit-handoff) without installing anything. Choose **Files & Results** to read the original report.
|
|
16
18
|
|
|
17
|
-
##
|
|
19
|
+
## Three paths through the examples
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
1. **Tier 1 — run a task or learn the SDK.** Use [Quickstart](quickstart.md) on your repository. To author a Harness, follow [First Harness](first-harness.md) → [Parallel Swarm](build-your-harness.md). The SDK tutorials use 0.6.0 or a matching source build.
|
|
22
|
+
2. **Tier 2 — applications and collaboration references.** Read [AutoResearch](autoresearch.md), then study [Subagents](harnesses/subagents.md), [TaskPool](harnesses/taskpool.md) or [Substrate](harnesses/substrate.md). These three topology entrypoints create their business Services locally, on top of the shared Runtime setup.
|
|
23
|
+
3. **Tier 3 — advanced source and integrations.** `super`, `code`, `harness-session` and individual Service examples are developer references. Code development is paused. [PeerMesh](harnesses/peermesh.md) requires Gitea, Mattermost, MySQL and its Board process; [Lead-Worker](harnesses/lead-worker.md) requires Gitea. See the [complete example catalog](../../examples/README.md).
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
2. **Core Building Blocks**:
|
|
23
|
-
- [Sandboxes](sandbox.md) — per-Agent sandboxes, network policies, resource limits, and Kubernetes deployment.
|
|
24
|
-
- [Runtime](runtime.md) — creating a run, syncing files, subscribing to events, live updates, clean shutdown, and durable recovery.
|
|
25
|
-
- [Agents & Profiles](agents.md) — role templates, persistent sessions, sending messages, interrupts, session controls, and compaction hooks.
|
|
26
|
-
- [Host Gateway](gateway.md) — how Service Bridge and Model Gateway guard identity, schemas, callbacks, and API keys.
|
|
27
|
-
- [Services & Permissions](services.md) — why coordination uses host Services instead of local tools, wrapping your own classes or HTTP APIs, and static/dynamic permissions.
|
|
28
|
-
- [Trace Viewer](trace-viewer.md) — interactive swimlane demo right in the docs, plus launching `anyswarm trace` locally or over SSH.
|
|
29
|
-
3. **Tutorials**:
|
|
30
|
-
- [Build Your First SDK Harness](first-harness.md) — build a two-Agent interactive handoff app using the standard `Harness` contract.
|
|
31
|
-
- [Build a Swarm Harness](build-your-harness.md) — build a parallel multi-agent Research Swarm step by step.
|
|
32
|
-
4. **Built-in Harnesses**: [Choose a Harness](harnesses/index.md) — run or adapt `Subagents`, `TaskPool`, `PeerMesh`, `Substrate`, and `Lead-Worker`.
|
|
33
|
-
5. **Reference & Releases**: [SDK & API Reference](reference/api.md) · [CLI Reference](reference/cli.md) · [Types & Source Map](reference/types.md) · [Releases](latest.md) · [Changelog](changelog.md).
|
|
25
|
+
## Understand the building blocks
|
|
34
26
|
|
|
35
|
-
|
|
27
|
+
Read [Core Concepts](concepts.md), then use the reference you need: [Sandboxes](sandbox.md), [Runtime](runtime.md), [Agents & Profiles](agents.md), [Host Gateway](gateway.md), [Services & Permissions](services.md), or [Trace Viewer](trace-viewer.md). An ordinary multi-agent Harness uses one Runtime for the team; Agents do not require separate host applications.
|
|
28
|
+
|
|
29
|
+
Local input is captured at the beginning of a Run and copied into private Sandboxes. Collaboration Services make shared state explicit. Exported artifacts and cleanup receipts are separate from business acceptance, and outputs do not automatically overwrite the input directory.
|
|
30
|
+
|
|
31
|
+
## Customize with your coding agent
|
|
32
|
+
|
|
33
|
+
The [copyable author prompt](build-your-harness.md#coding-agent-prompt) exports a real `parallel-swarm` project, reads its consumer `AGENTS.md` and installed SDK types, then adapts the workflow to your requirements. It does not use the AnySwarm maintainer instructions as your application guide.
|
|
34
|
+
|
|
35
|
+
Exact APIs and supported flags are in [SDK & API Reference](reference/api.md), [CLI Reference](reference/cli.md) and [Types & Source Map](reference/types.md). Check [Releases](latest.md) for published behavior. The [Architecture Manual](../architecture/INDEX.md) explains the implementation and its boundaries.
|
package/docs/en/quickstart.md
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Quickstart
|
|
3
|
-
description: Prepare
|
|
3
|
+
description: Prepare the shared Runtime, then use Subagents to inspect a real repository and export an engineering handoff report.
|
|
4
4
|
section: GET STARTED
|
|
5
5
|
order: 1
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
To build an application with the TypeScript SDK, follow [Build your first SDK Harness](first-harness.md).
|
|
9
9
|
|
|
10
|
-
AnySwarm ships its CLI and TypeScript SDK in one package and runs Agents inside [OpenSandbox](sandbox.md) containers.
|
|
10
|
+
AnySwarm ships its CLI and TypeScript SDK in one package and runs Agents inside [OpenSandbox](sandbox.md) containers. This guide runs OpenSandbox and Workers on your machine using Docker.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
On GitHub's `main` branch and in the site's **Next** channel, this guide follows
|
|
13
|
+
current development. Use the [stable Quickstart](https://anyswarm.github.io/anyswarm/docs/quickstart/)
|
|
14
|
+
for the supported published package. The stable site's version label identifies
|
|
15
|
+
its package; Next documentation can be ahead of the last npm preview.
|
|
13
16
|
|
|
14
17
|
## Prerequisites
|
|
15
18
|
|
|
16
19
|
| Dependency | Requirement | Verify |
|
|
17
20
|
| --- | --- | --- |
|
|
18
|
-
| **Linux** | Controller host (e.g., Ubuntu
|
|
19
|
-
| **Node.js** | `>= 22.19
|
|
21
|
+
| **Linux or macOS** | Controller host (e.g., Ubuntu, Debian, or macOS with Docker Desktop) | `uname -s` |
|
|
22
|
+
| **Node.js** | `>= 22.19`; Node.js 24 is recommended (install LTS from [nodejs.org](https://nodejs.org/en/download); Ubuntu 24.04 and Debian 13 repos ship older versions) | `node --version` |
|
|
20
23
|
| **npm** | Install with Node.js | `npm --version` |
|
|
21
24
|
| **Git** | Required for the source checkout and project capture | `git --version` |
|
|
22
|
-
| **
|
|
23
|
-
| **Docker Engine** | Required for local OpenSandbox only; skip when using an existing service ([install guide](https://docs.docker.com/engine/install/)) | `docker info` |
|
|
25
|
+
| **Docker Engine** | A running local Linux container engine ([install guide](https://docs.docker.com/engine/install/)) | `docker info` |
|
|
24
26
|
|
|
25
27
|
On Ubuntu or Debian with local Docker, install the system dependencies and start Docker:
|
|
26
28
|
|
|
27
29
|
```bash
|
|
28
|
-
sudo apt-get update && sudo apt-get install -y docker.io git
|
|
30
|
+
sudo apt-get update && sudo apt-get install -y docker.io git ca-certificates
|
|
29
31
|
sudo systemctl enable --now docker.service
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
Linux rootless Docker needs Engine 29.5 or newer for the host-network port used by managed OpenSandbox. An existing endpoint is also supported. [Docker rootless networking](https://docs.docker.com/engine/security/rootless/troubleshoot/#--nethost-doesnt-listen-ports-on-the-host-network-namespace)
|
|
33
35
|
|
|
34
36
|
If the Docker socket denies access, an administrator can run `sudo usermod -aG docker alice`, replacing `alice` with the account that runs AnySwarm. Sign in again as that account and run `id` and `docker info`. The [`docker` group grants root-equivalent access](https://docs.docker.com/engine/install/linux-postinstall/).
|
|
35
37
|
|
|
@@ -45,15 +47,15 @@ docker context show
|
|
|
45
47
|
docker info --format '{{.OSType}}/{{.Architecture}}'
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
If the wrong context is selected, run `docker context use <local-context>` and check whether `DOCKER_CONTEXT` or `DOCKER_HOST` overrides it. The expected daemon is Linux ARM64 on Apple Silicon, or Linux x86-64 on Intel; setup does not use emulation. If a separately installed Docker client reports `docker-credential-desktop` not found, put Docker Desktop's CLI tools on PATH in its settings, or add `/Applications/Docker.app/Contents/Resources/bin` to PATH.
|
|
50
|
+
If the wrong context is selected, run `docker context use <local-context>` and check whether `DOCKER_CONTEXT` or `DOCKER_HOST` overrides it. The expected daemon is Linux ARM64 on Apple Silicon, or Linux x86-64 on Intel; setup does not use emulation. If a separately installed Docker client reports `docker-credential-desktop` not found, put Docker Desktop's CLI tools on PATH in its settings, or add `/Applications/Docker.app/Contents/Resources/bin` to PATH.
|
|
49
51
|
|
|
50
|
-
The
|
|
52
|
+
The v0.5.1 release supports native macOS setup with a supported backend. The controlled-model macOS checks for [#339](https://github.com/AnySwarm/anyswarm/issues/339) use Apple Silicon and Docker Desktop, with npm Pi 1.3.0 and 1.7.0 and standalone Codex 0.173.0. Intel and other container engines need separate verification.
|
|
51
53
|
|
|
52
54
|
## 1. Install AnySwarm
|
|
53
55
|
|
|
54
56
|
### Install a published release
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
Install the CLI with Node.js 22.19 or newer and npm. The command is the same on Linux and macOS. Docker is needed when you run setup.
|
|
57
59
|
|
|
58
60
|
```bash
|
|
59
61
|
npm install -g @anyswarm/core
|
|
@@ -62,71 +64,71 @@ anyswarm --version
|
|
|
62
64
|
|
|
63
65
|
The `-g` flag installs the command into npm's global bin directory. If your shell cannot find it, check that `$(npm prefix -g)/bin` is on your PATH and that your shell is using the Node.js installation you used to install the CLI.
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
If you are writing a Harness in TypeScript, follow [Install the SDK](reference/api.md#install-the-sdk) to add it as a project dependency.
|
|
68
|
+
|
|
69
|
+
### Opt into a published preview (`next`)
|
|
70
|
+
|
|
71
|
+
Use this channel only when you want to test unreleased changes:
|
|
66
72
|
|
|
67
73
|
```bash
|
|
68
|
-
|
|
74
|
+
npm install -g @anyswarm/core@next
|
|
75
|
+
anyswarm --version
|
|
69
76
|
```
|
|
70
77
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
Record the resolved prerelease version when reporting a problem. For a project
|
|
79
|
+
SDK, use `npm install --save-exact @anyswarm/core@next` and keep the lockfile.
|
|
80
|
+
The Next website follows `main`, so use the installed package's examples and
|
|
81
|
+
bundled docs when its source differs from the current page. Return to stable
|
|
82
|
+
with `npm install -g @anyswarm/core@latest` using the same npm prefix. Preview
|
|
83
|
+
publication is deliberate; a change on `main` may not yet be available on `next`.
|
|
74
84
|
|
|
75
85
|
### Build and install from source (`main`)
|
|
76
86
|
|
|
77
|
-
Run these commands from the repository root. `npm run pack:release` builds the distribution archive. The
|
|
87
|
+
Run these commands from the repository root. `npm run pack:release` builds the distribution archive. The last command installs the archive into the selected npm prefix.
|
|
78
88
|
|
|
79
89
|
```bash
|
|
80
90
|
git clone https://github.com/AnySwarm/anyswarm.git && cd anyswarm
|
|
81
91
|
npm ci --no-audit --no-fund
|
|
82
92
|
pack_dir=$(mktemp -d)
|
|
83
93
|
npm run pack:release -- "$pack_dir"
|
|
84
|
-
|
|
94
|
+
npm install -g --prefix "$HOME/.local" "$pack_dir"/*.tgz
|
|
85
95
|
export PATH="$HOME/.local/bin:$PATH"
|
|
86
96
|
anyswarm --version
|
|
87
97
|
```
|
|
88
98
|
|
|
89
|
-
The candidate can share its package version with the release. Record the source commit and the tarball SHA-256 to identify it. Keep the candidate tarball if you want to install the same SDK in an [independent example project](../../examples/README.md).
|
|
99
|
+
For a source-only tutorial or an unmerged change, check out its reviewed branch or commit before packaging; the default `main` checkout contains only merged work. The candidate can share its package version with the release. Record the source commit and the tarball SHA-256 to identify it. Keep the candidate tarball if you want to install the same SDK in an [independent example project](../../examples/README.md).
|
|
90
100
|
|
|
91
101
|
### Update the CLI
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
Use the same npm prefix for both channels. `anyswarm update` prints the stable update command. To stay on the preview channel, explicitly install `@anyswarm/core@next` again.
|
|
104
|
+
|
|
105
|
+
Run `npm install -g @anyswarm/core@latest` to update or `npm uninstall -g @anyswarm/core` to uninstall. Use the same Node.js installation and npm prefix. If npm reports `EACCES`, switch to a user-owned Node installation or install to a writable prefix, for example `npm install -g --prefix "$HOME/.local" @anyswarm/core`. Add `$HOME/.local/bin` to PATH and reuse that prefix for updates and removal.
|
|
95
106
|
|
|
96
|
-
|
|
107
|
+
If you used the old shell installer for v0.5.0 or v0.5.1, check the `anyswarm`, `anys`, and `swarm` links in `$(npm prefix -g)/bin`. Clear only links that point into the old AnySwarm installation under `lib/anyswarm/current`, then install with npm. AnySwarm configuration lives outside the CLI installation.
|
|
97
108
|
|
|
98
109
|
To update a project's SDK, use its package manager in the project directory.
|
|
99
110
|
|
|
100
111
|
## 2. Prepare OpenSandbox and the Worker
|
|
101
112
|
|
|
102
|
-
|
|
113
|
+
Run setup on the machine where you want OpenSandbox and the Worker to run.
|
|
103
114
|
|
|
104
115
|
```bash
|
|
105
|
-
|
|
106
|
-
anyswarm setup --backend pi
|
|
107
|
-
anyswarm doctor --smoke
|
|
116
|
+
anyswarm setup
|
|
108
117
|
```
|
|
109
118
|
|
|
119
|
+
Setup detects the OS and Node version, checks the local Docker engine, and looks for your saved settings or an installed Pi or Codex backend. If a prerequisite is missing, follow the reported commands and rerun setup. Use `anyswarm doctor` for a read-only check of the same local prerequisites and Lifecycle connection.
|
|
120
|
+
|
|
121
|
+
If you need a backend, install Pi with `npm install -g @earendil-works/pi-coding-agent` or Codex with `npm install -g @openai/codex`. On macOS, setup also accepts standalone Codex when the same release is available for Linux from npm. Setup selects the only compatible backend when it finds one. When both are compatible, terminal setup can ask you to choose. In automation, use `anyswarm setup --backend pi` or `anyswarm setup --backend codex`.
|
|
122
|
+
|
|
110
123
|
Bare setup reuses the saved executable path. To choose a different installation, supply `--backend pi --backend-path /absolute/path/to/bin/pi` or the corresponding Codex options. To require an installed version, add `--backend-version 1.7.0` (substitute the version you intend to use). A saved version pin rejects an executable that later reports a different version. Repeat explicit backend selection without a pin to follow upgrades to that installation.
|
|
111
124
|
|
|
112
125
|
On macOS, setup prepares the same release's Linux package inside a native Docker container. It verifies the Worker version and runs the executor startup and controlled protocol smoke before saving the connection. Without a saved selection, an interactive terminal prompts when both backends are installed. Use `--backend` in automation when both are present.
|
|
113
126
|
|
|
114
127
|
For a new local configuration, setup defaults to `127.0.0.1:8080`, builds a Worker from the selected installation and SDK package, and pulls the pinned upstream OpenSandbox 1.2.1 components. It saves the managed connection after a controlled smoke verifies Worker, Bridge, Gateway, files, export and deletion. Expect `"ok": true` and `"infrastructure": "ready"`. Repeating setup restores a stopped managed service and reruns the smoke. Test with `ANYSWARM_CONFIG_DIR=/path/to/private-directory` and a free loopback port if needed.
|
|
115
128
|
|
|
116
|
-
Setup builds AnySwarm Workers locally. A matching Docker image is reused by content identity. Base image, apt and npm dependencies can require Internet access. Model routes and credentials still come from your explicit AnySwarm environment or project configuration. The controlled setup smoke does not verify those model credentials.
|
|
129
|
+
Setup builds AnySwarm Workers locally. A matching Docker image is reused by content identity. Base image, apt and npm dependencies can require Internet access. Model routes and credentials still come from your explicit AnySwarm environment or project configuration. The controlled setup smoke does not verify those model credentials. Use `anyswarm doctor --smoke` to repeat the controlled probe.
|
|
117
130
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
export OPEN_SANDBOX_API_KEY='<operator-provided-key>'
|
|
122
|
-
anyswarm setup --mode existing --endpoint https://sandbox.example.net \
|
|
123
|
-
--public-url https://runtime.example.net/anyswarm
|
|
124
|
-
anyswarm doctor --smoke
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Existing setup verifies authentication and saves the endpoint, key and callback in owner-only user configuration. The remote Controller needs Node and network access. Its operator prepares a matching Worker image on the service. Set `ANYSWARM_WORKER_IMAGE` to that image before the probe and your project run. `doctor` performs a read-only configuration and Lifecycle check. `doctor --smoke` allocates a temporary Sandbox and verifies Controller-to-Worker and Sandbox-to-Runtime traffic before confirming export and deletion. An unavailable saved remote connection produces an error for that connection.
|
|
128
|
-
|
|
129
|
-
`connection.publicUrl` is one callback address for Bridge and model requests. A reverse proxy should forward that path prefix to the Runtime's `bindHost` and fixed `bindPort`. Local setup discovers its reachable host and available port. See [Sandboxes](sandbox.md) and [Host Gateway](gateway.md).
|
|
131
|
+
The local service runs on the same machine as the CLI. To use a service you operate, see [Connect an existing OpenSandbox service](sandbox.md).
|
|
130
132
|
|
|
131
133
|
### Diagnose image availability
|
|
132
134
|
|
|
@@ -134,38 +136,49 @@ Setup prints the image it is preparing and reports elapsed time while a phase is
|
|
|
134
136
|
|
|
135
137
|
For a local Worker, read the reported build phase and retry after fixing its prerequisite. Setup reports the SDK version and content, the selected executable and its identity, the Worker image ID, and whether it built or reused the image.
|
|
136
138
|
|
|
137
|
-
## 3.
|
|
139
|
+
## 3. Prepare an engineering handoff for your repository
|
|
138
140
|
|
|
139
|
-
|
|
141
|
+
Use AnySwarm 0.6.0 or a [matching source build](#build-and-install-from-source-main) to export the same settings used for the [recorded p-limit run](https://github.com/AnySwarm/anyswarm/issues/358#issuecomment-7385075753). The command uses a small, pinned public repository. Once you have tried it, replace the input path with a focused directory in your own project.
|
|
140
142
|
|
|
141
|
-
|
|
143
|
+
Set your streaming model endpoint and credentials before running. The example below uses OpenAI Responses. The recorded VM Run used GPT-6.1 Sol through its configured Responses provider. See the [CLI Reference](reference/cli.md) for protocol and executor options.
|
|
142
144
|
|
|
143
145
|
```bash
|
|
144
146
|
export ANYSWARM_MODEL_URL='https://api.openai.com/v1/responses'
|
|
145
147
|
export ANYSWARM_MODEL_ID='gpt-5-mini'
|
|
146
148
|
export ANYSWARM_MODEL_TOKEN='<your-api-key>'
|
|
147
149
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
anyswarm
|
|
150
|
+
git clone https://github.com/sindresorhus/p-limit.git ./handoff-input
|
|
151
|
+
git -C ./handoff-input checkout --detach a8a6fbec4e0e866d6d779b10889bb4f5567e70eb
|
|
152
|
+
anyswarm eject subagents --dir ./handoff
|
|
153
|
+
(
|
|
154
|
+
cd ./handoff
|
|
155
|
+
npm install
|
|
156
|
+
npm start -- --config ./handoff-config.ts --cwd ../handoff-input \
|
|
157
|
+
--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.' \
|
|
158
|
+
--output-dir ../runs
|
|
159
|
+
)
|
|
151
160
|
```
|
|
152
161
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
See the [CLI Reference](reference/cli.md) for other model providers and executor options (such as Codex).
|
|
162
|
+
The handoff configuration allows 360 seconds of work, 70 seconds per model request and 60 seconds for cleanup. It sets room for Root and two immediate children and requires one `report.md` of up to 1 MiB. These are limits. Running time depends on the model, environment and input. The generic built-in Harness keeps its own shorter defaults. The host captures a snapshot, each Agent works in a private copy, and the result is exported under `./runs`. Follow the printed artifact path to the report.
|
|
156
163
|
|
|
157
|
-
## 4. Inspect the
|
|
164
|
+
## 4. Inspect the report and the work behind it
|
|
158
165
|
|
|
159
166
|
```bash
|
|
160
|
-
anyswarm trace --root ./runs --port 8787
|
|
167
|
+
anyswarm trace --root ./runs --port 8787
|
|
161
168
|
```
|
|
162
169
|
|
|
163
|
-
|
|
170
|
+
Open the printed local URL. For a remote host, use SSH forwarding, for example `ssh -N -L 8787:127.0.0.1:8787 user@host`, then open `http://127.0.0.1:8787` locally.
|
|
171
|
+
|
|
172
|
+
For the same Run, check:
|
|
173
|
+
|
|
174
|
+
- **Work:** Root created the requested children, they inspected different parts of the repository, and Root received their findings. The timeline shows whether their work actually overlapped.
|
|
175
|
+
- **Report:** find `report.md` through the final artifact paths or **Files & results**. Check cited paths and line ranges against the captured files. Commands that were only found in documentation must be distinguished from commands actually executed.
|
|
176
|
+
- **Status:** read business outcome, artifact export and cleanup separately. A completed Agent turn is not an independent check of report quality. Generic Subagents reports `acceptance.status: "not-run"`; the conclusions still need review. Missing files, incomplete export or pending cleanup require attention even when a final answer exists.
|
|
164
177
|
|
|
165
|
-
|
|
178
|
+
Open the [recorded p-limit handoff](./trace-viewer.md) to inspect how Root and two children worked on a public repository and to read their exported `report.md`. The replay needs no installation or credentials.
|
|
166
179
|
|
|
167
180
|
## Next steps
|
|
168
181
|
|
|
169
|
-
- [
|
|
170
|
-
- [
|
|
171
|
-
- [
|
|
182
|
+
- [Choose an example](harnesses/index.md) — applications, collaboration references and advanced integrations in three tiers.
|
|
183
|
+
- [First SDK Harness](first-harness.md) → [Parallel Swarm](build-your-harness.md) — learn the Service handoff, byte checks, parallel review and synthesis.
|
|
184
|
+
- [AutoResearch](autoresearch.md) — understand the current research application and its evaluator requirements.
|