@anyswarm/core 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -10
- package/deploy/worker/Dockerfile +12 -4
- package/dist/deploy/worker/Dockerfile +12 -4
- package/dist/examples/README.md +24 -12
- package/dist/examples/authoring/README.md +24 -0
- package/dist/examples/authoring/business.d.ts +2 -0
- package/dist/examples/authoring/business.js +4 -0
- package/dist/examples/authoring/config.d.ts +5 -0
- package/dist/examples/authoring/config.js +2 -0
- package/dist/examples/authoring/eject.json +5 -0
- package/dist/examples/authoring/harness.d.ts +4 -0
- package/dist/examples/authoring/harness.js +19 -0
- package/dist/examples/autoresearch/README.md +33 -0
- package/dist/examples/autoresearch/REQUIREMENTS.zh.md +18 -0
- package/dist/examples/autoresearch/config.d.ts +51 -0
- package/dist/examples/autoresearch/config.js +57 -0
- package/dist/examples/autoresearch/demo.d.ts +11 -0
- package/dist/examples/autoresearch/demo.js +52 -0
- package/dist/examples/autoresearch/eject.json +15 -0
- package/dist/examples/autoresearch/frontiercs2.d.ts +87 -0
- package/dist/examples/autoresearch/frontiercs2.js +211 -0
- package/dist/examples/autoresearch/prepare.d.ts +95 -0
- package/dist/examples/autoresearch/prepare.js +257 -0
- package/dist/examples/autoresearch/process.d.ts +13 -0
- package/dist/examples/autoresearch/process.js +48 -0
- package/dist/examples/autoresearch/project.d.ts +115 -0
- package/dist/examples/autoresearch/project.js +410 -0
- package/dist/examples/autoresearch/research-service.d.ts +106 -0
- package/dist/examples/autoresearch/research-service.js +255 -0
- package/dist/examples/code/README.md +25 -0
- package/dist/examples/code/REQUIREMENTS.zh.md +11 -0
- package/dist/examples/code/candidate.d.ts +19 -0
- package/dist/examples/code/candidate.js +80 -0
- package/dist/examples/code/config.d.ts +32 -0
- package/dist/examples/code/config.js +18 -0
- package/dist/examples/code/eject.json +5 -0
- package/dist/examples/code/project.d.ts +3 -0
- package/dist/examples/code/project.js +605 -0
- package/dist/examples/code/prompts.d.ts +5 -0
- package/dist/examples/code/prompts.js +12 -0
- package/dist/examples/code/verification.d.ts +19 -0
- package/dist/examples/code/verification.js +268 -0
- package/dist/examples/code/worktree.d.ts +17 -0
- package/dist/examples/code/worktree.js +233 -0
- package/dist/examples/harness-session/README.md +3 -6
- package/dist/examples/lead-worker/harness/dynamic-scheduler.d.ts +2 -1
- package/dist/examples/lead-worker/harness/dynamic-scheduler.js +5 -2
- package/dist/examples/lead-worker/harness/index.d.ts +60 -0
- package/dist/examples/lead-worker/harness/index.js +77 -6
- package/dist/examples/lead-worker/project.js +2 -2
- package/dist/examples/lead-worker/services/board.d.ts +5 -0
- package/dist/examples/lead-worker/services/board.js +19 -1
- package/dist/examples/messages/README.md +5 -5
- package/dist/examples/messages/handoff.d.ts +2 -0
- package/dist/examples/messages/handoff.js +5 -1
- package/dist/examples/messages/project.js +52 -2
- package/dist/examples/notes/README.md +13 -18
- package/dist/examples/notes/project.js +67 -6
- package/dist/examples/peermesh/harness/router.js +3 -1
- package/dist/examples/peermesh/harness/team.d.ts +8 -0
- package/dist/examples/peermesh/harness/team.js +13 -0
- package/dist/examples/peermesh/project.js +22 -4
- package/dist/examples/services/agent-control/README.md +3 -3
- package/dist/examples/services/mathlib-search/Dockerfile +4 -2
- package/dist/examples/services/mathlib-search/README.md +1 -1
- package/dist/examples/services/mcp-managed/README.md +2 -2
- package/dist/examples/services/persistent-board/README.md +13 -3
- package/dist/examples/services/persistent-board/business.d.ts +7 -0
- package/dist/examples/services/persistent-board/business.js +7 -0
- package/dist/examples/services/persistent-board/index.js +10 -0
- package/dist/examples/services/persistent-board/live.d.ts +3 -0
- package/dist/examples/services/persistent-board/live.js +58 -0
- package/dist/examples/subagents/README.md +5 -5
- package/dist/examples/subagents/business.js +3 -1
- package/dist/examples/subagents/harness/controller.d.ts +15 -0
- package/dist/examples/subagents/harness/controller.js +181 -32
- package/dist/examples/subagents/project.d.ts +2 -0
- package/dist/examples/subagents/project.js +43 -34
- package/dist/examples/subagents/prompts/prompts.d.ts +1 -0
- package/dist/examples/subagents/prompts/prompts.js +3 -0
- package/dist/examples/subagents/services/collaboration-service.d.ts +3 -2
- package/dist/examples/subagents/services/collaboration-service.js +14 -2
- package/dist/examples/substrate/README.md +2 -2
- package/dist/examples/substrate/harness/index.d.ts +1 -1
- package/dist/examples/substrate/harness/index.js +77 -12
- package/dist/examples/substrate/project.js +4 -1
- package/dist/examples/super/README.md +40 -0
- package/dist/examples/super/actions.d.ts +95 -0
- package/dist/examples/super/actions.js +230 -0
- package/dist/examples/super/artifact.d.ts +4 -0
- package/dist/examples/super/artifact.js +51 -0
- package/dist/examples/super/config.d.ts +80 -0
- package/dist/examples/super/config.js +83 -0
- package/dist/examples/super/coordinator.d.ts +33 -0
- package/dist/examples/super/coordinator.js +151 -0
- package/dist/examples/super/daemon.d.ts +11 -0
- package/dist/examples/super/daemon.js +109 -0
- package/dist/examples/super/decisions.d.ts +8 -0
- package/dist/examples/super/decisions.js +52 -0
- package/dist/examples/super/eject.json +5 -0
- package/dist/examples/super/execution.d.ts +11 -0
- package/dist/examples/super/execution.js +136 -0
- package/dist/examples/super/github.d.ts +62 -0
- package/dist/examples/super/github.js +269 -0
- package/dist/examples/super/inbox.d.ts +162 -0
- package/dist/examples/super/inbox.js +284 -0
- package/dist/examples/super/location.d.ts +5 -0
- package/dist/examples/super/location.js +64 -0
- package/dist/examples/super/outbox.d.ts +5 -0
- package/dist/examples/super/outbox.js +103 -0
- package/dist/examples/super/project.d.ts +111 -0
- package/dist/examples/super/project.js +253 -0
- package/dist/examples/super/prompts.d.ts +3 -0
- package/dist/examples/super/prompts.js +25 -0
- package/dist/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
- package/dist/examples/taskpool/harness/controller.d.ts +35 -6
- package/dist/examples/taskpool/harness/controller.js +73 -7
- package/dist/examples/taskpool/project.js +18 -2
- package/dist/scripts/anyswarm-applications.d.ts +19 -0
- package/dist/scripts/anyswarm-applications.js +19 -0
- package/dist/scripts/anyswarm-arguments.d.ts +35 -5
- package/dist/scripts/anyswarm-arguments.js +87 -23
- package/dist/scripts/anyswarm-author.d.ts +5 -0
- package/dist/scripts/anyswarm-author.js +24 -0
- package/dist/scripts/anyswarm-eject.d.ts +11 -0
- package/dist/scripts/anyswarm-eject.js +164 -0
- package/dist/scripts/anyswarm-harnesses.d.ts +2 -0
- package/dist/scripts/anyswarm-harnesses.js +31 -0
- package/dist/scripts/anyswarm-installation.js +19 -13
- package/dist/scripts/anyswarm-launch.d.ts +37 -0
- package/dist/scripts/anyswarm-launch.js +86 -0
- package/dist/scripts/anyswarm-project.d.ts +12 -2
- package/dist/scripts/anyswarm-project.js +121 -20
- package/dist/scripts/anyswarm-source-runner.d.ts +1 -0
- package/dist/scripts/anyswarm-source-runner.js +232 -0
- package/dist/scripts/anyswarm-tui-config.d.ts +36 -0
- package/dist/scripts/anyswarm-tui-config.js +189 -0
- package/dist/scripts/anyswarm-tui-session.d.ts +66 -0
- package/dist/scripts/anyswarm-tui-session.js +304 -0
- package/dist/scripts/anyswarm-tui-terminal.d.ts +41 -0
- package/dist/scripts/anyswarm-tui-terminal.js +154 -0
- package/dist/scripts/anyswarm-tui.d.ts +2 -0
- package/dist/scripts/anyswarm-tui.js +1012 -0
- package/dist/scripts/anyswarm.js +47 -2
- package/dist/scripts/build-provenance.json +1 -0
- package/dist/scripts/build.js +7 -1
- package/dist/scripts/generate-architecture-api.js +2 -0
- package/dist/scripts/generate-architecture-prompts.js +24 -2
- package/dist/scripts/local-environment.d.ts +6 -1
- package/dist/scripts/local-environment.js +52 -16
- package/dist/scripts/local-setup-smoke.js +3 -2
- package/dist/scripts/local-setup-worker.d.ts +1 -1
- package/dist/scripts/local-setup-worker.js +15 -6
- package/dist/scripts/local-setup.d.ts +2 -2
- package/dist/scripts/local-setup.js +72 -12
- package/dist/scripts/opensandbox-agent-worker.js +2 -2
- package/dist/scripts/pack-release.d.ts +1 -0
- package/dist/scripts/pack-release.js +63 -0
- package/dist/scripts/pi-session-bridge.js +11 -3
- package/dist/scripts/run-harness.js +3 -1
- package/dist/scripts/setup-bootstrap.js +43 -6
- package/dist/src/core/allocation-ledger.js +4 -3
- package/dist/src/core/host-identity.d.ts +2 -0
- package/dist/src/core/host-identity.js +11 -0
- package/dist/src/core/index.d.ts +4 -2
- package/dist/src/core/index.js +12 -4
- package/dist/src/core/mcp-service.js +2 -2
- package/dist/src/core/runtime-management.d.ts +6 -0
- package/dist/src/core/runtime-management.js +24 -0
- package/dist/src/core/sandbox/executor-driver.d.ts +4 -2
- package/dist/src/core/sandbox/executor-driver.js +12 -14
- package/dist/src/core/sandbox/local-executor.d.ts +13 -1
- package/dist/src/core/sandbox/local-executor.js +69 -19
- package/dist/src/core/sandbox/local-worker.js +32 -21
- package/dist/src/core/sandbox/opensandbox-backend.d.ts +2 -0
- package/dist/src/core/sandbox/opensandbox-backend.js +36 -11
- package/dist/src/core/sandbox/sandbox-connection.d.ts +2 -0
- package/dist/src/core/sandbox/sandbox-connection.js +14 -6
- package/dist/src/core/service-live-state.d.ts +14 -0
- package/dist/src/core/service-live-state.js +161 -0
- package/dist/src/core/service-observation-types.d.ts +21 -1
- package/dist/src/core/service-process.d.ts +1 -1
- package/dist/src/core/service-process.js +45 -4
- package/dist/src/core/service-types.d.ts +5 -1
- package/dist/src/core/services.d.ts +1 -1
- package/dist/src/core/services.js +8 -3
- package/dist/src/core/types.d.ts +3 -0
- package/dist/src/core/worker-image.js +3 -3
- package/dist/src/harness/harness-session-types.d.ts +10 -0
- package/dist/src/harness/harness-session.js +42 -5
- package/dist/src/harness/project-harness.d.ts +13 -1
- package/dist/src/harness/project-harness.js +36 -10
- package/dist/src/harness/project-input.js +81 -15
- package/dist/src/harness/project-rpc-client.d.ts +1 -0
- package/dist/src/harness/project-rpc-client.js +5 -0
- package/dist/src/harness/project-rpc.d.ts +8 -2
- package/dist/src/harness/project-rpc.js +31 -7
- 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 +41 -0
- package/dist/src/trace-viewer/public/app.js +6 -5
- package/dist/src/trace-viewer/reader.mjs +42 -2
- package/docs/INDEX.md +3 -1
- package/docs/architecture/00-overview.md +1 -1
- package/docs/architecture/01-agent-core.md +1 -1
- package/docs/architecture/06-observability-experiments.md +1 -1
- package/docs/architecture/07-run-configuration.md +18 -12
- package/docs/architecture/08-prompts.md +22 -0
- package/docs/architecture/10-service-api-reference.md +53 -18
- package/docs/architecture/11-storage-reference.md +18 -1
- package/docs/architecture/12-code-coverage.md +148 -84
- package/docs/architecture/15-core-runtime.md +8 -0
- package/docs/architecture/16-pi-opensandbox-backend.md +5 -5
- package/docs/architecture/17-harness-reporting.md +1 -1
- package/docs/architecture/19-substrate-harness.md +28 -1
- package/docs/architecture/20-lead-worker-harness.md +34 -1
- package/docs/architecture/22-website.md +5 -3
- package/docs/architecture/23-project-harness.md +124 -5
- package/docs/architecture/24-runtime-recovery.md +10 -3
- package/docs/architecture/25-foreground-tui.md +51 -0
- package/docs/architecture/26-code.md +39 -0
- package/docs/architecture/27-personal.md +43 -0
- package/docs/architecture/28-autoresearch.md +31 -0
- package/docs/architecture/INDEX.md +4 -0
- package/docs/architecture/prompts/08-lead-worker-harness.md +4 -2
- package/docs/architecture/prompts/08-subagents-harness.md +21 -0
- package/docs/architecture/prompts/21-personal.md +44 -0
- package/docs/architecture/prompts/22-autoresearch.md +63 -0
- package/docs/architecture/prompts/26-code.md +55 -0
- package/docs/architecture/prompts/source-manifest.json +152 -33
- package/docs/architecture/source-map.json +489 -21
- package/docs/designs/core-harness/06-project-harness.md +13 -2
- package/docs/designs/core-harness/README.md +5 -0
- package/docs/en/agents.md +1 -1
- package/docs/en/build-your-harness.md +3 -5
- package/docs/en/changelog.md +13 -4
- package/docs/en/first-harness.md +8 -11
- package/docs/en/harnesses/lead-worker.md +1 -1
- package/docs/en/harnesses/peermesh.md +2 -2
- package/docs/en/harnesses/subagents.md +2 -2
- package/docs/en/harnesses/substrate.md +4 -4
- package/docs/en/harnesses/taskpool.md +2 -2
- package/docs/en/latest.md +12 -123
- package/docs/en/overview.md +1 -1
- package/docs/en/quickstart.md +40 -16
- package/docs/en/reference/api.md +14 -4
- package/docs/en/reference/cli.md +58 -14
- package/docs/en/runtime.md +2 -2
- package/docs/en/services.md +4 -0
- package/docs/third-party-notices.md +1 -0
- package/docs/workflows/development.md +17 -12
- package/docs/workflows/release-and-docs-versioning.md +76 -0
- package/docs/zh/agents.md +1 -1
- package/docs/zh/build-your-harness.md +3 -5
- package/docs/zh/changelog.md +13 -4
- package/docs/zh/first-harness.md +8 -11
- package/docs/zh/harnesses/lead-worker.md +1 -1
- package/docs/zh/harnesses/peermesh.md +2 -2
- package/docs/zh/harnesses/subagents.md +2 -2
- package/docs/zh/harnesses/substrate.md +4 -4
- package/docs/zh/harnesses/taskpool.md +2 -2
- package/docs/zh/latest.md +13 -124
- package/docs/zh/overview.md +1 -1
- package/docs/zh/quickstart.md +40 -16
- package/docs/zh/reference/api.md +14 -4
- package/docs/zh/reference/cli.md +58 -14
- package/docs/zh/runtime.md +2 -2
- package/docs/zh/services.md +4 -0
- package/examples/README.md +24 -12
- package/examples/authoring/README.md +24 -0
- package/examples/authoring/business.ts +4 -0
- package/examples/authoring/config.ts +2 -0
- package/examples/authoring/eject.json +5 -0
- package/examples/authoring/harness.ts +21 -0
- package/examples/autoresearch/README.md +33 -0
- package/examples/autoresearch/REQUIREMENTS.zh.md +18 -0
- package/examples/autoresearch/config.ts +90 -0
- package/examples/autoresearch/demo.ts +55 -0
- package/examples/autoresearch/eject.json +15 -0
- package/examples/autoresearch/frontiercs2.ts +237 -0
- package/examples/autoresearch/prepare.ts +267 -0
- package/examples/autoresearch/process.ts +50 -0
- package/examples/autoresearch/project.ts +397 -0
- package/examples/autoresearch/research-service.ts +302 -0
- package/examples/code/README.md +25 -0
- package/examples/code/REQUIREMENTS.zh.md +11 -0
- package/examples/code/candidate.ts +89 -0
- package/examples/code/config.ts +19 -0
- package/examples/code/eject.json +5 -0
- package/examples/code/project.ts +581 -0
- package/examples/code/prompts.ts +16 -0
- package/examples/code/verification.ts +239 -0
- package/examples/code/worktree.ts +188 -0
- package/examples/harness-session/README.md +3 -6
- package/examples/lead-worker/harness/dynamic-scheduler.ts +6 -3
- package/examples/lead-worker/harness/index.ts +61 -6
- package/examples/lead-worker/project.ts +2 -2
- package/examples/lead-worker/services/board.ts +14 -1
- package/examples/messages/README.md +5 -5
- package/examples/messages/handoff.ts +6 -2
- package/examples/messages/project.ts +47 -2
- package/examples/notes/README.md +13 -18
- package/examples/notes/project.ts +57 -9
- package/examples/peermesh/harness/router.ts +2 -2
- package/examples/peermesh/harness/team.ts +11 -0
- package/examples/peermesh/project.ts +19 -4
- package/examples/services/agent-control/README.md +3 -3
- package/examples/services/mathlib-search/Dockerfile +4 -2
- package/examples/services/mathlib-search/README.md +1 -1
- package/examples/services/mcp-managed/README.md +2 -2
- package/examples/services/persistent-board/README.md +13 -3
- package/examples/services/persistent-board/business.ts +10 -0
- package/examples/services/persistent-board/index.ts +10 -0
- package/examples/services/persistent-board/live.ts +54 -0
- package/examples/subagents/README.md +5 -5
- package/examples/subagents/business.ts +3 -1
- package/examples/subagents/harness/controller.ts +161 -29
- package/examples/subagents/project.ts +47 -33
- package/examples/subagents/prompts/prompts.ts +4 -0
- package/examples/subagents/services/collaboration-service.ts +14 -2
- package/examples/substrate/README.md +2 -2
- package/examples/substrate/harness/index.ts +67 -11
- package/examples/substrate/project.ts +5 -1
- package/examples/super/README.md +40 -0
- package/examples/super/actions.ts +196 -0
- package/examples/super/artifact.ts +56 -0
- package/examples/super/config.ts +95 -0
- package/examples/super/coordinator.ts +158 -0
- package/examples/super/daemon.ts +84 -0
- package/examples/super/decisions.ts +46 -0
- package/examples/super/eject.json +5 -0
- package/examples/super/execution.ts +131 -0
- package/examples/super/github.ts +242 -0
- package/examples/super/inbox.ts +306 -0
- package/examples/super/location.ts +54 -0
- package/examples/super/outbox.ts +97 -0
- package/examples/super/project.ts +227 -0
- package/examples/super/prompts.ts +27 -0
- package/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
- package/examples/taskpool/harness/controller.ts +59 -7
- package/examples/taskpool/project.ts +18 -2
- package/npm-shrinkwrap.development.json +2199 -0
- package/npm-shrinkwrap.json +86 -1920
- package/package.development.json +92 -0
- package/package.json +13 -7
- package/scripts/anyswarm-applications.ts +39 -0
- package/scripts/anyswarm-arguments.ts +94 -28
- package/scripts/anyswarm-author.ts +25 -0
- package/scripts/anyswarm-eject.ts +145 -0
- package/scripts/anyswarm-harnesses.ts +27 -0
- package/scripts/anyswarm-installation.ts +19 -13
- package/scripts/anyswarm-launch.ts +108 -0
- package/scripts/anyswarm-project.ts +114 -21
- package/scripts/anyswarm-source-runner.ts +203 -0
- package/scripts/anyswarm-tui-config.ts +174 -0
- package/scripts/anyswarm-tui-session.ts +295 -0
- package/scripts/anyswarm-tui-terminal.ts +147 -0
- package/scripts/anyswarm-tui.ts +912 -0
- package/scripts/anyswarm.ts +43 -2
- package/scripts/build.ts +8 -1
- package/scripts/generate-architecture-api.ts +2 -0
- package/scripts/generate-architecture-prompts.ts +35 -2
- package/scripts/local-environment.ts +55 -17
- package/scripts/local-setup-smoke.ts +3 -2
- package/scripts/local-setup-worker.ts +17 -7
- package/scripts/local-setup.ts +66 -13
- package/scripts/opensandbox-agent-worker.ts +2 -2
- package/scripts/pack-release.ts +67 -0
- package/scripts/pi-session-bridge.ts +10 -2
- package/scripts/run-harness.ts +3 -1
- package/scripts/setup-bootstrap.ts +41 -6
- package/src/core/allocation-ledger.ts +5 -3
- package/src/core/host-identity.ts +11 -0
- package/src/core/index.ts +12 -6
- package/src/core/mcp-service.ts +2 -2
- package/src/core/runtime-management.ts +22 -0
- package/src/core/sandbox/executor-driver.ts +15 -18
- package/src/core/sandbox/local-executor.ts +65 -19
- package/src/core/sandbox/local-worker.ts +29 -21
- package/src/core/sandbox/opensandbox-backend.ts +36 -11
- package/src/core/sandbox/sandbox-connection.ts +14 -5
- package/src/core/service-live-state.ts +156 -0
- package/src/core/service-observation-types.ts +23 -1
- package/src/core/service-process.ts +36 -3
- package/src/core/service-types.ts +3 -1
- package/src/core/services.ts +8 -3
- package/src/core/types.ts +3 -0
- package/src/core/worker-image.ts +3 -3
- package/src/harness/harness-session-types.ts +13 -1
- package/src/harness/harness-session.ts +40 -7
- package/src/harness/project-harness.ts +36 -10
- package/src/harness/project-input.ts +73 -15
- package/src/harness/project-rpc-client.ts +5 -0
- package/src/harness/project-rpc.ts +29 -8
- package/src/harness/project-runtime.ts +2 -1
- package/src/harness/typescript-loader.ts +37 -0
- package/src/trace-viewer/public/app.js +6 -5
- package/src/trace-viewer/reader.mjs +42 -2
package/docs/en/reference/api.md
CHANGED
|
@@ -5,11 +5,19 @@ section: REFERENCE
|
|
|
5
5
|
order: 15
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
This reference covers the public runtime exports, method contracts, and error recovery rules for **`@anyswarm/core
|
|
8
|
+
This reference covers the public runtime exports, method contracts, and error recovery rules for **`@anyswarm/core`**. For conceptual guides, start with [Runtime & Agents](../runtime.md) and [Services & Permissions](../services.md); for exact TypeScript declarations, see [Types & Source Map](./types.md); for host and container CLIs, see [CLI Reference](./cli.md).
|
|
9
9
|
|
|
10
10
|
## Install the SDK
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Run this command in your Node.js project to add the TypeScript SDK as a dependency. Use Node.js 22.19 or later.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @anyswarm/core
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Import the SDK from `@anyswarm/core`. The same install exposes the project-local CLI through `npm exec -- anyswarm`. To run `anyswarm` directly from any directory, use a [global CLI install](../quickstart.md#1-install-anyswarm).
|
|
19
|
+
|
|
20
|
+
For a verified [source build](../quickstart.md#build-and-install-from-source-main), install its archive with the command below. The [release page](../latest.md#v050) shows how to pin the released SDK.
|
|
13
21
|
|
|
14
22
|
```bash
|
|
15
23
|
npm install --ignore-scripts /path/to/verified-anyswarm.tgz
|
|
@@ -26,9 +34,11 @@ All public values and TypeScript types are imported from the single root entry `
|
|
|
26
34
|
| `createSandbox(config)` | Function | Creates a reusable OpenSandbox connection handle or plugs in a custom `{ provider }` `SandboxProvider`. |
|
|
27
35
|
| `resolveSandboxConnection(overrides?)` | Function | Resolves Lifecycle URL, local token, and image defaults matching the CLI (use only in trusted host config). |
|
|
28
36
|
| `createRuntime(options)` | Async function | Opens a Run control plane (`outputDir/<runtimeId>/`, Service Bridge, Model Gateway) with configurable `executor`, `filePolicy`, and durable persistence options. |
|
|
37
|
+
| `resolveFilePolicy(policy?)` | Function | Validates and fills file budgets with the defaults used by Runtime and the project host. Harness authors can use the resolved limits for local candidate checks. |
|
|
29
38
|
| `recoverRuntime(options)` | Async function | Reopens a durable Run under verified same-host, same-boot ownership; supports cleanup-only mode and dynamic Service restoration. |
|
|
30
39
|
| `createHarnessSession(harness, options)` / `HarnessRpcClient` | Function / Class | Drives a standard `Harness` in-process or over a JSONL child-process pipe with live events, questions, and member controls. |
|
|
31
|
-
| `
|
|
40
|
+
| `runProjectRpc(session, input, write, launchDirectory, initialInput?, options?)` | Function | Serves HarnessSession JSONL over a host-owned stream. `detachOnDisconnect` keeps the Session running when that observer disconnects. |
|
|
41
|
+
| `createPiExecutor({ version })` / `createCodexExecutor({ version })` | Function | Pins an exact built-in executor version when supplied; `'pi'` / `'codex'` shorthands remain supported. |
|
|
32
42
|
| `createExecutorAdapter(declaration)` / `EXECUTOR_ADAPTER_PROTOCOL` | Function / Constant | Declares an image-installed external executor adapter (`anyswarm-executor-v1`). |
|
|
33
43
|
| `DEFAULT_WORKER_IMAGE` / `workerImageFor(selection)` | Constant / Function | Select local Worker preparation for the Runtime’s executor, or select a particular executor and optionally pin its version. |
|
|
34
44
|
| `getExecutorCapabilities(selection)` | Function | Static capability lookup for a configured executor (no network side effects). |
|
|
@@ -88,7 +98,7 @@ const runtime = await createRuntime({
|
|
|
88
98
|
|
|
89
99
|
- **`models`**: defaults to streaming Responses; Pi also supports `protocol: 'chat-completions'` and `capabilities: { contextWindow, maxOutputTokens, tools, reasoning }`; trusted host modules can supply a custom `ModelTransport`. Upstream credentials stay strictly on the host.
|
|
90
100
|
- **`filePolicy`**: independently configure `initial`, `snapshot`, `replace`, `export`, and `session` limits (`maxBytes`, `maxFileBytes`, `maxFiles`, `maxEntries`, `timeoutMs`) plus `controllerSpoolBytes` and `workerSpoolBytes`.
|
|
91
|
-
- **`getExecutorCapabilities(selection)`**: Pi
|
|
101
|
+
- **`getExecutorCapabilities(selection)`**: Pi supports `contextFork`, `activeSteer`, `followUp`, and `one-at-a-time`; Codex supports `activeSteer`, `followUp`, and `all` without context forking.
|
|
92
102
|
|
|
93
103
|
## Agent lifecycle
|
|
94
104
|
|
package/docs/en/reference/cli.md
CHANGED
|
@@ -5,7 +5,9 @@ section: REFERENCE
|
|
|
5
5
|
order: 16
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
`@anyswarm/core` ships
|
|
8
|
+
`@anyswarm/core` ships the synonymous host commands **`anyswarm`** and **`anys`**, plus **`swarm`** inside Worker containers for Service calls over the Bridge. Host aliases share installation, update, help and version behavior.
|
|
9
|
+
|
|
10
|
+
The streaming terminal, generic loader, `run` and `eject` below are available in the [current source build](../quickstart.md#build-and-install-from-source-main). See the [v0.5.0 CLI reference](https://github.com/AnySwarm/anyswarm/blob/v0.5.0/docs/en/reference/cli.md) for the published package.
|
|
9
11
|
|
|
10
12
|
## Host CLI (`anyswarm`)
|
|
11
13
|
|
|
@@ -13,17 +15,48 @@ order: 16
|
|
|
13
15
|
|
|
14
16
|
| Command | Purpose |
|
|
15
17
|
| --- | --- |
|
|
16
|
-
| `anyswarm` |
|
|
18
|
+
| `anyswarm` / `anys` | Opens the streaming composer in an interactive terminal |
|
|
19
|
+
| `anys -u <harness> [prompt]` | Selects a built-in, installed package, or local Harness |
|
|
20
|
+
| `anys -u <harness> --headless [prompt]` | Streams Session activity and the final result as JSONL |
|
|
21
|
+
| `anys -u <harness> --rpc` | Opens the stdio HarnessSession RPC protocol |
|
|
22
|
+
| `anys -u <harness> --cmd "/action [args]"` | Runs a module's standalone Slash Action |
|
|
23
|
+
| `anys run ./harness.ts [arguments]` | Runs trusted TypeScript source with multi-file imports and SDK dependencies |
|
|
24
|
+
| `anys eject <code\|autoresearch\|super\|example> --dir <target>` | Exports editable TypeScript sources and binds their SDK provenance |
|
|
17
25
|
| `anyswarm --version` | Prints the installed `@anyswarm/core` version |
|
|
18
|
-
| `anyswarm setup [--mode existing\|local] [--endpoint <url>] [--public-url <url>] [--backend pi\|codex] [--backend-path <executable>] [--config <module>]` | Starts a managed local OpenSandbox with auto-generated credentials (`--mode local`), or validates and saves an existing service (`--mode existing`); local mode also prepares and probes the selected Worker image |
|
|
26
|
+
| `anyswarm setup [--mode existing\|local] [--endpoint <url>] [--public-url <url>] [--backend pi\|codex] [--backend-path <executable>] [--backend-version <version>] [--config <module>]` | Starts a managed local OpenSandbox with auto-generated credentials (`--mode local`), or validates and saves an existing service (`--mode existing`); local mode also prepares and probes the selected Worker image |
|
|
19
27
|
| `anyswarm doctor [--config <module>] [--smoke]` | Read-only configuration and Lifecycle auth diagnostics; pass `--smoke` for a live Pi/Codex Worker end-to-end probe |
|
|
20
|
-
| `anyswarm update` | Verifies, stages and activates the latest stable CLI in a managed installation. Global npm users
|
|
21
|
-
| `anyswarm --harness <module> --prompt <text> [options]` | Runs a built-in, local ESM, or package Harness in foreground against a project directory |
|
|
28
|
+
| `anyswarm update` | Verifies, stages and activates the latest stable CLI in a managed installation. Global npm users receive an npm command for their install prefix |
|
|
29
|
+
| `anyswarm --harness <module> --prompt <text> [options]` | Runs a built-in, local TypeScript/ESM, or package Harness in foreground against a project directory |
|
|
22
30
|
| `anyswarm --harness <module> --mode rpc [options]` | Runs a Harness over JSONL `stdin`/`stdout` with `ready`, `run`, `status`, `stop`, and member controls |
|
|
23
31
|
| `anyswarm recover --run-dir <dir> --config <module>` | Performs cleanup-only recovery on a durable Run under same-host, same-boot ownership and prints the receipt |
|
|
24
32
|
| `anyswarm trace [--root] <runs-dir> [--port 8787] [--open]` | Starts the built-in browser [Trace Viewer](../trace-viewer.md) on `127.0.0.1` |
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
### Streaming terminal
|
|
35
|
+
|
|
36
|
+
Run `anys` and type `/use <harness> [prompt]`. Use `/code`, `/super` or `/autoresearch` when the corresponding application is bundled. You can also select a trusted local file such as `/use ./harness.ts`, or a package installed in your invocation directory. `anys -u ./harness.ts "task"` selects and submits the first prompt together. `--config ./config.ts` selects trusted configuration, and `/config` and `/doctor` help diagnose startup.
|
|
37
|
+
|
|
38
|
+
On a Linux host, run `anys -u code [prompt]` in a project to edit it with one coding Agent. Ask it in chat to delegate a task when you want a child Agent to work in parallel. In an active Code session, `/diff` streams the latest paths, patch preview and retained patch location. Use `/agents` for the roster, `@<editor> <message>` to steer an active editor, and `/stop <editor>` to stop an editor. Use `/y` or `/n` for inline confirmations and `/reply <id> <answer>` for questions. [Code quickstart](../../../examples/code/README.md)
|
|
39
|
+
|
|
40
|
+
The status rows show the Run's phase, Agent counts and workspace or Harness summary above the scrolling messages. The input area stays at the bottom, with the current Harness and selected Agent in its border. Resizing the terminal rewraps the text and keeps your draft. Press Enter to submit, Alt+Enter for a newline, and Tab for command completion.
|
|
41
|
+
|
|
42
|
+
| In the composer | What it does |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `/use <harness> [prompt]` | Switches modes. Confirm with `/y` to stop and clean up active foreground work before switching. |
|
|
45
|
+
| `/agents`, `/target <agent\|main>` | Lists members and their controls. Use the arrow keys and Enter to choose a target or target one directly. |
|
|
46
|
+
| `@agent message`, `/to agent message` | Steers that member. Use `/to agent --follow-up message` to queue a follow-up. |
|
|
47
|
+
| `/stop [agent]`, Ctrl+C | Stops one member or the whole Run. Ctrl+C interrupts the selected Agent turn or dismisses a pending selection. |
|
|
48
|
+
| `/y`, `/n`, `/reply [id] <answer>` | Answers inline decisions. Use `/approve <id>` or `/reject <id>` when multiple confirms are pending. |
|
|
49
|
+
| `/status` | Shows the Run and artifact paths. |
|
|
50
|
+
| `/trace [records-directory]` | Opens the local Trace Viewer and prints its URL. Use a directory to switch the Viewer to those records. The default foreground output root includes successive Runs. |
|
|
51
|
+
| `/quit` | Exits after foreground cleanup. In background observation, this disconnects the terminal and the background Session continues. You can also submit `q`. |
|
|
52
|
+
|
|
53
|
+
When stdin or stdout is redirected, `-u` automatically selects headless JSONL output. Bare non-TTY invocation prints usage guidance. Explicit `--harness H --mode foreground` and `--mode rpc` retain their transport formats. `anys run <harness> [prompt]` selects the same terminal when interactive. Plain TypeScript scripts can still receive ordinary argv. In a pipe, a local task Harness launched without arguments or with the legacy `--prompt` flag prints a single foreground JSON result. In an ejected project, `npm install` and `npm run start` use the matching project-local CLI.
|
|
54
|
+
|
|
55
|
+
A Harness can suggest slash names through `inputDescriptor.commands`. Unmatched slash input in an active terminal Session goes to its input handler as text. To provide a command before any Session exists, export `slashActions`, for example `export const slashActions = { prepare: ({ args }) => ({ prepared: args }) }`. Invoke it in the composer or with `anys -u H --cmd '/prepare example'`. See the [application module contract](../../architecture/25-foreground-tui.md).
|
|
56
|
+
|
|
57
|
+
### Personal GitHub inbox
|
|
58
|
+
|
|
59
|
+
Select `/super` in the composer, then run `/setup --repo owner/project`, `/start` and `/jobs`. Use `/ask #123 <text>` or `@router #123 <text>` for a task. The terminal displays Router questions and verified patches with Reviewer summaries. Use `/answer #123 <text>`, `/approve #123` or `/reject #123 [reason]`, or an unambiguous work ID prefix. The same actions run noninteractively through `anys -u super --cmd '/jobs #123'`. See the [Personal quickstart](../../../examples/super/README.md) for credentials, permissions, stop and export.
|
|
27
60
|
|
|
28
61
|
### Running Harnesses (`anyswarm --harness`)
|
|
29
62
|
|
|
@@ -34,28 +67,39 @@ anyswarm --harness subagents --prompt "Fix the parser and add regression tests"
|
|
|
34
67
|
# Explicit target directory, custom config module, and output root
|
|
35
68
|
anyswarm --harness taskpool \
|
|
36
69
|
--cwd ./my-project \
|
|
37
|
-
--config ./taskpool.config.
|
|
70
|
+
--config ./taskpool.config.ts \
|
|
38
71
|
--output-dir ./runs \
|
|
39
72
|
--prompt "Resolve all failing unit tests"
|
|
40
73
|
|
|
41
|
-
# Local custom
|
|
42
|
-
anyswarm --harness ./review-harness.
|
|
74
|
+
# Local custom TypeScript Harness module
|
|
75
|
+
anyswarm --harness ./review-harness.ts --prompt "Audit error handling"
|
|
43
76
|
|
|
44
77
|
# JSONL RPC mode (send {"id":"1","operation":"run","input":{"cwd":"...","prompt":"..."}} after ready)
|
|
45
78
|
anyswarm --harness subagents --mode rpc --output-dir ./runs
|
|
46
79
|
```
|
|
47
80
|
|
|
48
81
|
- **Built-in Harness names**: `subagents`, `taskpool`, `peermesh`, `substrate`, `lead-worker`, `notes`, `messages`.
|
|
49
|
-
- **Module resolution**: pass a built-in name, an explicit `.
|
|
50
|
-
- **RPC protocol (`--mode rpc`)**: emits JSONL frames on `stdout` and diagnostics on `stderr`. Wait for `ready`, then send a `run` request containing `cwd` and `prompt`.
|
|
82
|
+
- **Module resolution**: pass a built-in name, an explicit `.ts` / `.mts` or ESM path, or an installed npm package name (resolved from the invocation directory).
|
|
83
|
+
- **RPC protocol (`--rpc` or `--mode rpc`)**: emits JSONL frames on `stdout` and diagnostics on `stderr`. Wait for `ready`, then send a `run` request containing `cwd` and `prompt`.
|
|
51
84
|
|
|
52
85
|
### Session options and controls
|
|
53
86
|
|
|
54
87
|
- **Lifetime (`--lifetime task|interactive`)**: defaults to single-task `task` mode. Harnesses that support ongoing sessions (such as Subagents) accept `interactive`, keeping the session alive until a configured deadline or explicit `stop`.
|
|
55
88
|
- **User questions (`--interaction none|questions`)**: defaults to `none`. Set `questions` when the client can answer authorized mid-Run questions from Agents.
|
|
56
|
-
- **Control channel**: foreground invocations with `--prompt` start immediately; when `interactive` or `questions` is enabled, subsequent commands flow over JSONL. `--mode rpc` waits for a `run` command before starting.
|
|
89
|
+
- **Control channel**: foreground invocations with `--prompt` start immediately; when `interactive` or `questions` is enabled, subsequent commands flow over JSONL. `--rpc` or `--mode rpc` waits for a `run` command before starting.
|
|
57
90
|
- **Supported operations**: `describe` (discover capabilities), `status` (read snapshot), `answer` (respond by `questionId`), and `stop` (close the Run); native member queries and controls include `agent.getState`, `agent.getStats`, `agent.getMessages`, plus `agent.configure`, `agent.compact`, `agent.abortRetry`, `agent.clearQueue`, `agent.send`, `agent.interrupt`, and `agent.stop` (each Harness and executor decides which operations are permitted). The final result records report-save status and cleanup facts separately.
|
|
58
91
|
|
|
92
|
+
### AutoResearch
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
anys -u autoresearch --cmd /prepare
|
|
96
|
+
anys -u autoresearch
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Enter `/demo frontiercs2` in the terminal. The demo runs four equal Kimi K3 peers and shows activity and the live Trace URL in the composer. Use `@peer-2 <suggestion>`, `/interrupt peer-2` or `/stop peer-2` during the Run. To run headlessly, use `anys -u autoresearch --cmd '/demo frontiercs2'`.
|
|
100
|
+
|
|
101
|
+
Use `anys -u autoresearch --config ./research.ts "Your objective"` for a custom trusted evaluator, and `anys eject autoresearch` to export the source. [Quickstart](../../../examples/autoresearch/README.md)
|
|
102
|
+
|
|
59
103
|
## Unified environment variables
|
|
60
104
|
|
|
61
105
|
Built-in CLI Harnesses (`subagents`, `taskpool`, `notes`, `messages`) share one consistent set of host environment variables (explicit configuration takes precedence over process environment and the saved connection):
|
|
@@ -112,7 +156,7 @@ swarm agent stop <agent-id> --request-id stop-1
|
|
|
112
156
|
When working directly inside a built `anyswarm` source checkout, two additional developer scripts drive configured `taskpool` or `peermesh` fixtures over JSON-line `stdin` (`status`, `kickoff`, `input`, `wait`, `stop`) and inspect saved reports offline:
|
|
113
157
|
|
|
114
158
|
```bash
|
|
115
|
-
node dist/scripts/run-harness.js --config <host-config.
|
|
159
|
+
node dist/scripts/run-harness.js --config <host-config.ts>
|
|
116
160
|
node dist/scripts/read-harness-result.js --run-directory <dir> --runtime-id <id>
|
|
117
161
|
```
|
|
118
162
|
|
|
@@ -121,7 +165,7 @@ node dist/scripts/read-harness-result.js --run-directory <dir> --runtime-id <id>
|
|
|
121
165
|
## `anyswarm recover` (durable cleanup recovery)
|
|
122
166
|
|
|
123
167
|
```bash
|
|
124
|
-
anyswarm recover --run-dir /private/runs/original-runtime-id --config /private/recovery.
|
|
168
|
+
anyswarm recover --run-dir /private/runs/original-runtime-id --config /private/recovery.ts
|
|
125
169
|
```
|
|
126
170
|
|
|
127
171
|
The config module default-exports either the original Runtime options object or a zero-argument async factory returning it. This command performs cleanup-only recovery, calls `close()`, prints the receipt, and exits `0` only when cleanup completes. Recovery requires same-host, same-boot exclusive writer ownership and matching durable persistence settings; unresolved resources remain tracked in the ledger until reconciliation confirms stop and deletion. Retry failed required exports before the reported `expiresAt`. See [Runtime durable recovery](../runtime.md#6-durable-recovery-and-kubernetes).
|
package/docs/en/runtime.md
CHANGED
|
@@ -64,7 +64,7 @@ const runtime = await createRuntime({
|
|
|
64
64
|
|
|
65
65
|
`createRuntime()` sets up the run directory, Model Gateway, and Service Bridge, but starts **zero sandboxes** until your Harness explicitly calls `runtime.spawn()` (covered next in [Agents & Profiles](agents.md)).
|
|
66
66
|
|
|
67
|
-
> **Flexible executors & model protocols**: beyond the `'pi'`
|
|
67
|
+
> **Flexible executors & model protocols**: beyond the `'pi'` and `'codex'` shorthands, which use the installed version, use `createPiExecutor({ version: '1.4.0' })`, `createCodexExecutor(...)`, or `createExecutorAdapter(...)` for image-installed executors. Pi supports both **Responses** and **Chat Completions** (see [SDK & API Reference](reference/api.md)).
|
|
68
68
|
|
|
69
69
|
### Custom reasoning models
|
|
70
70
|
|
|
@@ -208,7 +208,7 @@ const runtime = await recoverRuntime({
|
|
|
208
208
|
- **Cleanup-only recovery (CLI)**: To reclaim cleanup authority and finish archiving/deleting sandboxes without resuming work, set `cleanupOnly: true` or run:
|
|
209
209
|
|
|
210
210
|
```bash
|
|
211
|
-
anyswarm recover --run-dir /private/runs/original-runtime-id --config /private/recovery.
|
|
211
|
+
anyswarm recover --run-dir /private/runs/original-runtime-id --config /private/recovery.ts
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
The config module's default export can be the original `options` object or a zero-argument async factory returning it. `anyswarm recover` runs cleanup-only recovery, calls `close()`, prints the receipt, and exits `0` only when cleanup is complete (otherwise `1`, keeping pending items recorded). When a required export fails, the sandbox is retained until `expiresAt` — fix the issue and retry before expiry (check for `retain-at-risk` if the backend could not confirm the requested retention window).
|
package/docs/en/services.md
CHANGED
|
@@ -88,6 +88,10 @@ Use `runtime.services.get/list` to inspect readiness, ownership and available ma
|
|
|
88
88
|
|
|
89
89
|
Close and retire fence new calls and drain in-flight work. The optional `exportState` hook supplies public observation JSON for [Trace Viewer](trace-viewer.md). Optional metadata can give a capture timestamp, business revision, field descriptions, summary values and table columns. The state export is separate from business durability. The Service owns its original database and successful commit. [Runtime recovery](runtime.md) explains the retained Run and storage requirements.
|
|
90
90
|
|
|
91
|
+
To display business state during a Run, implement `ServiceAdapter.readState({ signal })`. Its return value is `{ state, capturedAt, revision?, presentation? }`. Select public fields explicitly and use the signal for any I/O. Supply an ISO capture timestamp and use JSON Pointer paths for summary fields and table columns. SDK and RPC clients can use optional presentation hints to render the returned state.
|
|
92
|
+
|
|
93
|
+
The Runtime owner can call `runtime.services.listState()` and `runtime.services.readState(name)`. A HarnessSession client uses `session.services.list()` and `session.services.read(runtimeId, name)`. Reads are limited to one second and 64 KiB each. A read can return `unsupported`, `unavailable`, `timeout`, or `error`, with the previous capture time when available. The adapter hook is host-only. See the [Persistent Board example](../../examples/services/persistent-board/README.md#watch-a-live-board) for a package-root Service adapter and Harness.
|
|
94
|
+
|
|
91
95
|
## Migrate existing SDK code
|
|
92
96
|
|
|
93
97
|
Replace `registerService({ manifest, adapter })` with `register(name, definition)`. Integrations that still use a legacy hosted manifest can adapt it with `services.register(...serviceFromManifest({ manifest, adapter }))`. Move `Profile.session.tools` to `Profile.tools` and `Profile.prompt` to `Profile.addedSystemPrompt`. Read `.result` from a successful generic CLI reply and use stderr for local usage errors. Existing Trace files remain readable.
|
|
@@ -6,6 +6,7 @@ The terms in [LICENSE](../LICENSE) cover AnySwarm's original code and documentat
|
|
|
6
6
|
| --- | --- |
|
|
7
7
|
| Codex CLI in the Worker image | Apache-2.0. The image installs `@openai/codex` 0.172.0 from OpenAI. [Upstream license](https://github.com/openai/codex/blob/3d86e43b075adeba2193ec5c22ac92f55afd82e6/LICENSE) at the `rust-v0.172.0` revision. |
|
|
8
8
|
| OpenSandbox JavaScript SDK | Apache-2.0. The Controller installs `@alibaba-group/opensandbox` 1.2.1. [Upstream license](https://github.com/opensandbox-group/OpenSandbox/blob/db708c218771a8d311356f0e96552c15df6e097a/LICENSE) |
|
|
9
|
+
| Pi terminal primitives | MIT. The host CLI installs `@earendil-works/pi-tui` 1.3.0. [Package and license metadata](https://www.npmjs.com/package/@earendil-works/pi-tui/v/1.3.0) |
|
|
9
10
|
| Lean module replay driver | Apache-2.0. The [driver notice](../examples/taskpool/services/judge/lean-module-verify.NOTICE.md) identifies the upstream source, copyright and local modifications. [Upstream license copy](../examples/taskpool/services/judge/lean-module-verify.LICENSE.txt) |
|
|
10
11
|
| Agensh Board schema fixture (source-checkout tests) | MIT. [Source attribution and license copy](../test/fixtures/agensh-board-schema.LICENSE.txt) |
|
|
11
12
|
| Agensh reference implementation | Separate Git submodule. See the [upstream license](https://github.com/microsoft/Agensh/blob/2dae4e14a653da48549fd9aa093f834841475d6c/LICENSE) at the recorded revision. |
|
|
@@ -80,7 +80,7 @@ cache and install the packed Core in a temporary consumer before running tests.
|
|
|
80
80
|
export npm_config_cache="$package_dir/npm-cache"
|
|
81
81
|
npm ci --no-audit --no-fund
|
|
82
82
|
npm run typecheck
|
|
83
|
-
npm pack --
|
|
83
|
+
npm run pack:release -- "$package_dir"
|
|
84
84
|
npm install --prefix "$package_dir/consumer" --prefer-offline --omit=dev --ignore-scripts --no-audit --no-fund "$package_dir"/*.tgz
|
|
85
85
|
tar -xzf "$package_dir"/*.tgz -C "$package_dir" package/examples/harness-session/package.json
|
|
86
86
|
npm install --prefix "$package_dir/package/examples/harness-session" --prefer-offline --no-save --ignore-scripts --no-audit --no-fund "$package_dir"/*.tgz
|
|
@@ -90,8 +90,9 @@ cache and install the packed Core in a temporary consumer before running tests.
|
|
|
90
90
|
|
|
91
91
|
`npm ci` can fetch the locked tarballs without caching the registry metadata that
|
|
92
92
|
an offline installation of the packed Core needs. The temporary consumer seeds
|
|
93
|
-
that metadata in the same cache used by the tests.
|
|
94
|
-
install offline.
|
|
93
|
+
that metadata in the same cache used by the tests. Archive-based tests then
|
|
94
|
+
install offline. The by-name install test serves the candidate through a local
|
|
95
|
+
registry and can fetch public dependency metadata from npm.
|
|
95
96
|
|
|
96
97
|
For **Website CI**,
|
|
97
98
|
run `npm ci` inside `website/`, then
|
|
@@ -101,9 +102,15 @@ deploys the merged site separately.
|
|
|
101
102
|
|
|
102
103
|
## Release verification
|
|
103
104
|
|
|
105
|
+
For a local candidate, record the clean source commit, Node and npm versions, the
|
|
106
|
+
`npm ci` and `npm run pack:release` commands, and the archive SHA-256. Use those
|
|
107
|
+
same tool versions when reproducing a candidate. The release pack script builds
|
|
108
|
+
and stages with `umask 022` and normalizes staged regular-file modes to `0755` for
|
|
109
|
+
executables and `0644` for other files, including files from restrictive checkouts.
|
|
110
|
+
|
|
104
111
|
Run the [Release workflow](../../.github/workflows/release.yml) manually to verify a
|
|
105
112
|
candidate and download the two tarball filenames and their SHA-256 checksums from
|
|
106
|
-
the workflow artifact. The verifier installs the exact tarball through the website installer outside the checkout. It runs local setup, the README Quickstart with a controlled model, and the first SDK Harness through the SDK, JSONL RPC and foreground CLI. The README test checks actual file-tool bytes, CLI and installed Viewer agreement, and Sandbox deletion. Manual runs
|
|
113
|
+
the workflow artifact. The verifier installs the exact tarball through the website installer and installs it by package name through a local registry outside the checkout. It runs local setup, the README Quickstart with a controlled model, and the first SDK Harness through the SDK, JSONL RPC and foreground CLI. The README test checks actual file-tool bytes, CLI and installed Viewer agreement, and Sandbox deletion. Manual runs can verify a candidate with the same version as an existing release. Tag runs also perform the public npm publication dry-run, which requires an unused version. After the source repository is
|
|
107
114
|
public and the release owner approves the tested revision, `LuNa-shi` pushes a
|
|
108
115
|
`v<version>` tag for the matching stable package version under the
|
|
109
116
|
[version-tag ruleset](https://github.com/AnySwarm/anyswarm/rules/28373821).
|
|
@@ -115,11 +122,7 @@ The tag job uploads the verified versioned tarball, the byte-identical
|
|
|
115
122
|
publishing it. An older stable tag can still be published as a pinned Release.
|
|
116
123
|
The CLI resolves the latest stable tag once and checks the corresponding versioned archive against its checksum.
|
|
117
124
|
|
|
118
|
-
|
|
119
|
-
installer before publishing the tag. Compare the public installer bytes with
|
|
120
|
-
the reviewed source and verify that the installer still accepts the published
|
|
121
|
-
v0.4.1 archive. A managed v0.4.1 CLI needs to rerun the installer once with
|
|
122
|
-
its existing prefix to cross the package-name change.
|
|
125
|
+
v0.5.0 is the first supported release of `@anyswarm/core`. Check installation and managed CLI updates from supported releases.
|
|
123
126
|
|
|
124
127
|
Download the approved tag's versioned archive and `SHA256SUMS`. Verify the
|
|
125
128
|
digest and the package name and version in the archive. An npm member of the
|
|
@@ -131,9 +134,11 @@ npm publish "./luna-shi-anyswarm-$VERSION.tgz" --access public --registry=https:
|
|
|
131
134
|
|
|
132
135
|
Set `VERSION` to the approved stable tag version without the leading `v`.
|
|
133
136
|
Confirm the registry resolves `@anyswarm/core@$VERSION` and install it
|
|
134
|
-
in a fresh project.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
in a fresh project. Compare the npm archive SHA-256 with the GitHub asset.
|
|
138
|
+
After both distributions are public, update the bilingual release page and
|
|
139
|
+
the documented version in `website/src/components/TopNav.astro`.
|
|
140
|
+
See [Release updates and documentation versions](release-and-docs-versioning.md)
|
|
141
|
+
for retry handling, Trusted Publishing and the proposed website version selector.
|
|
137
142
|
|
|
138
143
|
## Documentation changes
|
|
139
144
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Release updates and documentation versions
|
|
2
|
+
|
|
3
|
+
Research as of 2026-12-01 against repository revision `40132bd47c0609b4149a106f1b97d83f277dd6d4`.
|
|
4
|
+
|
|
5
|
+
`@anyswarm/core@0.5.0` is the first formally supported release. The previous package's release artifacts stay in GitHub history.
|
|
6
|
+
|
|
7
|
+
## Observed release and website behavior
|
|
8
|
+
|
|
9
|
+
- [Release workflow at the baseline](https://github.com/AnySwarm/anyswarm/blob/40132bd47c0609b4149a106f1b97d83f277dd6d4/.github/workflows/release.yml) accepts stable `vX.Y.Z` tags matching `package.json`. It packs once, tests that archive outside the checkout, verifies an installed First Harness, and uploads checksums and two byte-identical archive names. A tag push publishes those assets as a GitHub Release. A manual workflow dispatch verifies a candidate without publishing it. The npm command is **dry-run only**; the publishing job has no `id-token: write`. Publishing to npm is a separate step.
|
|
10
|
+
- [Website deployment at the baseline](https://github.com/AnySwarm/anyswarm/blob/40132bd47c0609b4149a106f1b97d83f277dd6d4/.github/workflows/deploy-website.yml) runs for relevant main changes and successful tag Release workflows. It checks that a public latest GitHub Release contains the installer archive, then builds the current main checkout. A main-only API change can reach the documentation before the corresponding SDK release.
|
|
11
|
+
- [Top navigation](https://github.com/AnySwarm/anyswarm/blob/40132bd47c0609b4149a106f1b97d83f277dd6d4/website/src/components/TopNav.astro) displays a generic Releases link. [Documentation URL helpers](https://github.com/AnySwarm/anyswarm/blob/40132bd47c0609b4149a106f1b97d83f277dd6d4/website/src/lib/i18n.ts) encode language and page slug.
|
|
12
|
+
|
|
13
|
+
## Version policy
|
|
14
|
+
|
|
15
|
+
“First formal release” is a project support decision. SemVer still treats `0.y.z` as initial development, and reserves the stable public API commitment for `1.0.0`. Published versions must not change. For AnySwarm before 1.0, use `0.5.1` for compatible fixes and `0.6.0` for a new API line. Include migration instructions for incompatible changes. Use `1.0.0` when committing to a stable API contract. [SemVer specification](https://semver.org/spec/v2.0.0.html)
|
|
16
|
+
|
|
17
|
+
## Next release with the existing workflow
|
|
18
|
+
|
|
19
|
+
1. Prepare one release PR from current main. Update package and lockfile versions, affected examples, Worker compatibility information, README, both languages, and migration notes. Confirm installed examples come from the exact candidate archive. Keep unshipped APIs out of the supported-release guides.
|
|
20
|
+
2. Verify the reviewed head with required Core and website CI. Run the manual Release workflow to verify its package candidate. After approval and merge, the release owner creates the matching stable tag at the approved merged revision under the repository's tag rules.
|
|
21
|
+
3. Wait for the tag Release workflow. Download the **published** GitHub Release archive and `SHA256SUMS`, check the checksum and package name/version, and preserve those bytes as the canonical release candidate. Do not run `npm pack` again to manufacture the npm input.
|
|
22
|
+
4. Publish that exact `.tgz` using the command in [Release verification](development.md#release-verification). The npm and GitHub Release steps currently require separate actions.
|
|
23
|
+
5. Poll the public registry for the exact version with a bounded timeout, download its `dist.tarball`, and compare its SHA-256 with the GitHub asset. Verify `dist.integrity`, then install that version by package name in a fresh project and in an isolated global npm prefix. Verify the SDK import, both CLI aliases, install warnings and the production audit. npm scans packages before public availability. If the version is still pending after the verification timeout, resume verification later using the same archive. [npm publish-time scanning](https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/)
|
|
24
|
+
6. After the new package is publicly installable, update the bilingual stable guides and version label and verify the Pages deployment. Check npm `latest` and the public CLI installer, and compile the affected examples from the installed SDK. Record the source commit, tag, archive SHA-256, npm version, CI run and deployed Pages revision separately. A GitHub Release, a public npm package and a deployed website are distinct milestones.
|
|
25
|
+
|
|
26
|
+
`npm publish` accepts an existing tarball. The name/version pair cannot be reused, even after unpublishing. Its default distribution tag is `latest`. For maintenance patches on an older line, select a separate dist-tag to preserve the current `latest`. [npm publish reference](https://docs.npmjs.com/cli/v11/commands/npm-publish/)
|
|
27
|
+
|
|
28
|
+
## Trusted Publishing configuration and validation
|
|
29
|
+
|
|
30
|
+
Use GitHub-hosted runners, Node ≥22.14 and npm ≥11.5.1. Bind npm's trusted publisher to `AnySwarm` / `anyswarm` / `release.yml`; the optional environment must match the publishing job. Grant that job `id-token: write`, configure the npm registry, and explicitly allow direct `npm publish` in npm's UI. Verify the setup with the next approved release. New configurations need their first successful OIDC publish within **two days** of creation. Recreate an expired configuration before publishing. Independent `npm dist-tag` changes need their own permission and a supported CLI. The current workflow has yet to publish through OIDC. [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers/)
|
|
31
|
+
|
|
32
|
+
## Failure and retry rules
|
|
33
|
+
|
|
34
|
+
These are operating steps for the maintainer. The proposed release job can enforce them automatically.
|
|
35
|
+
|
|
36
|
+
| Failure point | Recovery |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| Verification fails before publication | Fix and review the candidate. Do not claim a release exists. |
|
|
39
|
+
| GitHub Release exists, npm missing | Reuse the published archive and checksum. Do not substitute a newly packed archive. |
|
|
40
|
+
| npm accepted publication, public registry still pending | Poll within a fixed limit, then report pending. Resume verification later; do not overwrite or increment versions solely for propagation delay. |
|
|
41
|
+
| npm version exists on retry | Download it and compare bytes. If equal, skip publication and resume remaining steps. If different, stop and investigate; never treat matching name/version alone as proof. |
|
|
42
|
+
| npm succeeded, GitHub or Pages failed | Retry finalization/deployment with the same verified package and pinned documentation inputs. Do not republish npm. |
|
|
43
|
+
| Published code is incorrect | Release a new patch or API line with a correction. Do not move the old tag or replace published package bytes. |
|
|
44
|
+
| Older maintenance release finishes later | Keep `latest` on the newest supported line. Serialize promotions and compare semantic versions before changing the dist-tag. |
|
|
45
|
+
|
|
46
|
+
The proposed OIDC job would follow this sequence.
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
protected tag → pack once → verify archive → stage GitHub draft assets
|
|
50
|
+
→ publish those bytes to npm → verify a public npm install
|
|
51
|
+
→ publish GitHub Release → deploy matching docs
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use the stored artifact and checksum on retry. Report which public steps completed if a later step fails.
|
|
55
|
+
|
|
56
|
+
## Website recommendation
|
|
57
|
+
|
|
58
|
+
For the current single supported API line, display **v0.5.0**. Before publishing a second API line that needs different guides, add a version selector and freeze each released set of docs. Docusaurus documents the snapshot pattern and its maintenance cost. The existing Astro site can use the same pattern. [Docusaurus versioning](https://docusaurus.io/docs/versioning)
|
|
59
|
+
|
|
60
|
+
Proposed routes under the site base.
|
|
61
|
+
|
|
62
|
+
| Route before the configured site base | Meaning |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `/docs/<slug>/`, `/zh/docs/<slug>/` | Latest supported released documentation aliases. |
|
|
65
|
+
| `/docs/v0.5.0/<slug>/`, `/zh/docs/v0.5.0/<slug>/` | Frozen exact release snapshot. |
|
|
66
|
+
| `/docs/next/<slug>/`, `/zh/docs/next/<slug>/` | Main documentation, explicitly marked unreleased. |
|
|
67
|
+
|
|
68
|
+
Maintain an explicit release manifest containing package version, immutable package tag/SHA, documentation source SHA and support status. Build each historical route from its pinned documentation revision. The `v0.5.0` tag predates corrections to the npm instructions. Use a reviewed documentation revision compatible with the released package and record both revisions. Publish any correction to a historical snapshot as a tracked documentation revision.
|
|
69
|
+
|
|
70
|
+
Preserve the chosen version in sidebar links, previous/next links, article links, search results and example downloads. Language switching preserves **version and slug**. Version switching preserves **language and slug** when the page exists and goes to the selected version’s overview otherwise. Search uses the selected version by default. The label names the version of the documents being displayed.
|
|
71
|
+
|
|
72
|
+
Group the menu by API line. A compatible patch can share its line’s guides. Keep the exact tag and docs source in the manifest for each release. If a patch needs materially different instructions, publish a snapshot for it. Keep exact version URLs pinned once published.
|
|
73
|
+
|
|
74
|
+
Every Pages deployment must include all retained version routes in its uploaded site artifact. Deploying only the newest snapshot would remove older routes from the deployed site. Preserve sources through Git tags/pinned revisions and build inputs; no repository `archive/` directory is needed. The deployment must gate the stable alias on verified release inputs rather than fetching moving main as its source of released API documentation. [GitHub Pages custom workflow and artifact deployment](https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages)
|
|
75
|
+
|
|
76
|
+
To verify the selector, build both languages for two pinned versions. Open old URLs directly, switch languages and versions on shared and removed pages, and check search and example downloads. Deploy a newer version and confirm old routes and content hashes remain available.
|
package/docs/zh/agents.md
CHANGED
|
@@ -179,7 +179,7 @@ const messages = await runtime.session.getMessages(agent.id, { limit: 50, maxByt
|
|
|
179
179
|
### 订阅会话事件与完整示例
|
|
180
180
|
|
|
181
181
|
- **会话事件流**:在发任务前订阅 `runtime.onEvent()`,会话级事件以 `{ type: 'session', agentId, event }` 推送。流式回复中的 `messageStart`、`textDelta` 和 `messageEnd` 共享同一个 `messageId`(可按消息与内容块增量拼接,收到 `messageEnd` 后用完整消息替换);`toolActivity` 列出当前正在执行的工具调用。会话总用量与当前上下文用量分开统计(分叉继承的历史可能计入会话总量),未配置单价时费用为 `null`。
|
|
182
|
-
- **可运行示例**:仓库自带的 `examples/agent-session.ts` 完整演示了 3 次自动压缩上限策略、`append`/`nextTurn`
|
|
182
|
+
- **可运行示例**:仓库自带的 `examples/agent-session.ts` 完整演示了 3 次自动压缩上限策略、`append`/`nextTurn` 上下文注入以及状态与消息查询。可通过 `anys run ./examples/agent-session.ts /absolute/config.ts worker '你的任务'` 运行(配置模块默认导出完整的 `CreateRuntimeOptions`,工作时限 120 秒、清理时限 30 秒)。
|
|
183
183
|
|
|
184
184
|
---
|
|
185
185
|
|
|
@@ -9,16 +9,15 @@ order: 10
|
|
|
9
9
|
|
|
10
10
|
## 安装示例
|
|
11
11
|
|
|
12
|
-
在空目录中按[第一个 Harness 的安装步骤](first-harness.md#2-安装并连接)
|
|
12
|
+
在空目录中按[第一个 Harness 的安装步骤](first-harness.md#2-安装并连接)安装已校验的源码构建归档,准备 Worker 并配置流式 Responses 端点。从该安装包复制配套 TypeScript 源码。
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
sdk=node_modules/@anyswarm/core
|
|
16
16
|
example="$sdk"/examples
|
|
17
17
|
cp "$example"/parallel-swarm/{board.ts,board-service.ts,harness.ts} .
|
|
18
|
-
cp "$example"/first-harness/tsconfig.json .
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
如果已经在其他目录复制过 First Harness,为这个 Harness 另建空目录。SDK
|
|
20
|
+
如果已经在其他目录复制过 First Harness,为这个 Harness 另建空目录。SDK 与示例源码使用同一安装包的版本。编辑当前仓库源码时,先安装与该源码匹配的[候选归档](../../examples/README.md#run-an-example-from-its-directory),再复制其中的示例。
|
|
22
21
|
|
|
23
22
|
## 通过 Service 共享发现
|
|
24
23
|
|
|
@@ -33,10 +32,9 @@ cp "$example"/first-harness/tsconfig.json .
|
|
|
33
32
|
## 运行并检查报告
|
|
34
33
|
|
|
35
34
|
```bash
|
|
36
|
-
./node_modules/.bin/tsc
|
|
37
35
|
mkdir -p input
|
|
38
36
|
printf 'export const cache = new Map<string, string>();\n' > input/cache.ts
|
|
39
|
-
./node_modules/.bin/
|
|
37
|
+
./node_modules/.bin/anys run ./harness.ts --cwd ./input \
|
|
40
38
|
--prompt '检查 cache.ts 的资源风险并发布具体发现。' --output-dir ./runs
|
|
41
39
|
./node_modules/.bin/anyswarm trace --root ./runs
|
|
42
40
|
```
|
package/docs/zh/changelog.md
CHANGED
|
@@ -5,16 +5,25 @@ section: 版本与更新
|
|
|
5
5
|
order: 16
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
本页同步记录 **AnySwarm**(`@anyswarm/core`)的历次重要变更,与仓库根目录的 [`CHANGELOG.md`](../../CHANGELOG.md)
|
|
8
|
+
本页同步记录 **AnySwarm**(`@anyswarm/core`)的历次重要变更,与仓库根目录的 [`CHANGELOG.md`](../../CHANGELOG.md) 保持一致。当前安装命令见[发行版本](latest.md)。
|
|
9
|
+
|
|
10
|
+
## v0.5.1
|
|
11
|
+
|
|
12
|
+
- AutoResearch 使用四名平级 Kimi K3 成员运行 FrontierCS-2 正式任务,在流式 TUI 和实时 Trace 中展示研究活动。支持配置自定义可信评测器和导出 Harness 源码。[CLI 参考](reference/cli.md#autoresearch)。默认 Kimi K3 路线的端到端验收见 [#337](https://github.com/AnySwarm/anyswarm/issues/337)。
|
|
13
|
+
- Personal 可后台接收 GitHub 请求,由 Router 带领 Agent 处理,在流式终端按工作批准 Draft PR。
|
|
14
|
+
- 支持 macOS 原生 setup 和 Docker Desktop,可接入用户选定的 Pi 或 Codex 安装并固定确切版本。
|
|
15
|
+
- 在 Linux 项目目录运行 `anys -u code` 由主 Agent 直接编辑,按需在聊天中委派,并在共享终端查看补丁。用 `anys eject code` 导出应用源码。[CLI 参考](reference/cli.md)。
|
|
16
|
+
- 安装后的 `anys` 与 `anyswarm` 打开同一个流式终端,支持通用 Harness 加载、内联决策和成员控制。`anys run` 直接加载 TypeScript 源码,`anys eject example` 导出可修改的 Harness 与对应 SDK 候选包。[CLI 参考](reference/cli.md)。
|
|
17
|
+
- 官网提供全局 npm 和安装脚本两种 CLI 安装入口,SDK 通过单独的开发者指南安装。公开包的依赖锁只记录运行依赖。[快速上手](quickstart.md#1-安装-anyswarm)。
|
|
9
18
|
|
|
10
19
|
## v0.5.0
|
|
11
20
|
|
|
12
|
-
-
|
|
21
|
+
- SDK 已发布到 npm,包名和版本为 [`@anyswarm/core@0.5.0`](https://www.npmjs.com/package/@anyswarm/core/v/0.5.0)。迁移时更新项目依赖和导入路径。CLI 首次跨包名升级需使用原前缀重跑官方安装器。
|
|
13
22
|
- Service 支持进程内、普通 HTTP、MCP 和外部 CLI 接入。Pi 支持 direct、code、CLI 工具模式。Profile 的 `prompt` 改为 `addedSystemPrompt`,`session.tools` 移至 `tools`。Runtime 管理单实例,Trace Viewer 可查看导出状态。[Service 指南](services.md)。
|
|
14
23
|
|
|
15
24
|
## v0.4.1
|
|
16
25
|
|
|
17
|
-
- SDK
|
|
26
|
+
- v0.4.1 的 SDK 仍可从 [GitHub 发行归档](https://github.com/AnySwarm/anyswarm/releases/tag/v0.4.1)获取,原包名为 `@anyswarm/anyswarm`。v0.4.0 的 CLI 可以通过官方安装器原路径迁移一次。
|
|
18
27
|
|
|
19
28
|
- 新增 `anyswarm update`,原子更新托管 CLI。全局 npm 用户可通过官方安装器切换一次。项目继续独立选择 SDK 依赖。
|
|
20
29
|
- Linux setup 和 SDK 使用选中的本机 Pi 或 Codex 构建 Worker。重复 setup 会复用或恢复自己管理的 OpenSandbox。
|
|
@@ -25,7 +34,7 @@ order: 16
|
|
|
25
34
|
|
|
26
35
|
## v0.4.0
|
|
27
36
|
|
|
28
|
-
- 项目更名为 AnySwarm,并切换 SDK 包名、宿主 CLI 和 Worker 标识。见[迁移说明](latest.md#从-v030-迁移)。
|
|
37
|
+
- 项目更名为 AnySwarm,并切换 SDK 包名、宿主 CLI 和 Worker 标识。见[迁移说明](https://github.com/AnySwarm/anyswarm/blob/v0.5.0/docs/zh/latest.md#从-v030-迁移)。
|
|
29
38
|
|
|
30
39
|
- 自定义 Pi 模型可将 AnySwarm 推理档位映射到供应商的取值。启动和会话配置会拒绝显式指定的不受支持的档位。
|
|
31
40
|
|
package/docs/zh/first-harness.md
CHANGED
|
@@ -9,7 +9,7 @@ order: 9
|
|
|
9
9
|
|
|
10
10
|
## 1. 选择 SDK 版本
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
本教程使用[当前源码构建的版本](quickstart.md#从源码构建并安装main)提供的 `anys run`。先校验归档的 SHA-256,再将 `ANYSWARM_SDK_ARCHIVE` 设为它的绝对路径,并从该安装包复制示例源码。使用已发布的 v0.5.0 时,请按[对应版本的教程](https://github.com/AnySwarm/anyswarm/blob/v0.5.0/docs/zh/first-harness.md)操作。
|
|
13
13
|
|
|
14
14
|
## 2. 安装并连接
|
|
15
15
|
|
|
@@ -17,9 +17,7 @@ order: 9
|
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
npm init -y
|
|
20
|
-
npm
|
|
21
|
-
npm install "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.0}"
|
|
22
|
-
npm install --save-dev typescript @types/node
|
|
20
|
+
npm install "${ANYSWARM_SDK_ARCHIVE:?请设置已校验 SDK 归档的绝对路径}"
|
|
23
21
|
```
|
|
24
22
|
|
|
25
23
|
新建本地 OpenSandbox 时,先按[快速上手](quickstart.md#2-准备-opensandbox-与-worker)安装支持的 Pi,再运行 `./node_modules/.bin/anyswarm setup --mode local --backend pi`。使用已有部署时,[配置其 endpoint、鉴权、回调和 Worker 镜像](quickstart.md#连接已有-opensandbox),再运行 `./node_modules/.bin/anyswarm setup --mode existing` 和 `./node_modules/.bin/anyswarm doctor --smoke`。
|
|
@@ -38,26 +36,25 @@ read -rsp 'Model API token: ' ANYSWARM_MODEL_TOKEN && export ANYSWARM_MODEL_TOKE
|
|
|
38
36
|
|
|
39
37
|
### 编写并运行标准 Harness
|
|
40
38
|
|
|
41
|
-
从已安装的 SDK
|
|
39
|
+
从已安装的 SDK 复制 TypeScript 源码,安装后的 CLI 可以直接运行。
|
|
42
40
|
|
|
43
41
|
```bash
|
|
44
42
|
sdk=node_modules/@anyswarm/core
|
|
45
43
|
example="$sdk"/examples/first-harness
|
|
46
|
-
cp "$example"/{harness.ts,session.ts,handoff.ts,config.ts
|
|
44
|
+
cp "$example"/{harness.ts,session.ts,handoff.ts,config.ts} .
|
|
47
45
|
```
|
|
48
46
|
|
|
49
47
|
`harness.ts` 默认导出一个 `Harness`,包含 `apiVersion: 1`、`id: 'first-harness'` 和 `run(context)`。[仓库当前版本](../../examples/first-harness/harness.ts)使用新版 Service 注册 API,配套的是从该源码构建的候选包。
|
|
50
48
|
|
|
51
49
|
Harness 负责两个 Profile 和 Handoff Service。发布者在 Sandbox 里读取唯一编号,将编号和问题发布到 Service。公共 `runInput` 等待发布者的排他回合。Harness 核对 Service 认证过的发布者,再将 Agent 身份和 Run 的取消信号交给 `context.askUser`。写作者用自己的权限读取同一个编号,按你的回答生成 `delivery.txt`。Harness 在 Sandbox 里核对文件,要求导出,再核对 Host 导出的字节。Session 管理提问身份、回答准入、观察和最终 Run 报告。
|
|
52
50
|
|
|
53
|
-
`session.ts` 读取终端答案,调用 `respond
|
|
51
|
+
`session.ts` 读取终端答案,调用 `respond`。用 `anys run` 直接通过 SDK、RPC 和显式前台运行同一份 TypeScript 定义。
|
|
54
52
|
|
|
55
53
|
```bash
|
|
56
|
-
./node_modules/.bin/tsc
|
|
57
54
|
mkdir -p input
|
|
58
|
-
|
|
59
|
-
PATH="$PWD/node_modules/.bin:$PATH"
|
|
60
|
-
ANYSWARM_FIRST_CHANNEL=beta-east ./node_modules/.bin/
|
|
55
|
+
./node_modules/.bin/anys run ./session.ts ./input 'Prepare a release handoff.'
|
|
56
|
+
PATH="$PWD/node_modules/.bin:$PATH" ./node_modules/.bin/anys run ./session.ts --rpc ./input 'Prepare a release handoff.'
|
|
57
|
+
ANYSWARM_FIRST_CHANNEL=beta-east ./node_modules/.bin/anys run ./harness.ts --cwd ./input --prompt 'Prepare a release handoff.'
|
|
61
58
|
```
|
|
62
59
|
|
|
63
60
|
使用独立的输入目录,避免采集示例依赖和 Run 输出。前两条命令会提示输入频道,例如 `beta-east`。单次前台命令从 `ANYSWARM_FIRST_CHANNEL` 读取频道并输出最终 JSON。JSONL 客户端也可以用 `--interaction questions` 启动显式前台并按 `questionId` 作答。成功时会看到 `outcome: "completed"`、`acceptance.status: "verified"`、`export.status: "complete"` 和 `cleanup.status: "complete"`。按验收回执找到文件,比较 `channel=` 行及 SHA‑256。完整 Host 报告位于同次 Run 的 `reportPath`。
|
|
@@ -113,7 +113,7 @@ await Promise.all(
|
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
# 配置 run ID、不可变 Worker 镜像、OpenSandbox 地址、Gitea 管理员凭证与模型端点
|
|
116
|
-
|
|
116
|
+
anys run ./benchmarks/lead-worker-orders/main.ts ./benchmarks/lead-worker-orders/config.ts
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
关闭时,宿主先停止接纳 Board 写入,再调用 `runtime.close()`。只有 Core 确认执行已停止且清理完成后,才关闭 Board 连接并撤销自己创建的 Gitea 凭证。若执行状态未知、必需导出失败或 Board 证据写入失败,相关依赖会保持 `pending` 状态,等待后续人工核对与恢复清理。共享仓库、Board 数据库、提交与 PR 保留供检查。`harness-report.json` 分别记录业务失败、已交付和未完成工作、不确定输入、清理和报告保存结果。
|
|
@@ -113,7 +113,7 @@ export ANYSWARM_PEERMESH_MODEL_URL='https://your-model-endpoint/v1/responses'
|
|
|
113
113
|
export ANYSWARM_PEERMESH_PEERS=4
|
|
114
114
|
# 以及 Gitea、Mattermost 与 Board MySQL DSN 等宿主环境变量
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
anys run ./scripts/run-harness.ts --config ./examples/peermesh/config.ts
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
输出 `ready` 后,可通过 `stdin` 逐行发送 JSON 命令查看状态、向指定成员追加输入或提前停止:
|
|
@@ -128,7 +128,7 @@ node dist/scripts/run-harness.js --config dist/examples/peermesh/config.js
|
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
130
|
runtime_id=RUNTIME_ID_FROM_RESULT
|
|
131
|
-
|
|
131
|
+
anys run ./scripts/read-harness-result.ts \
|
|
132
132
|
--run-directory "./peermesh-runs/$runtime_id" \
|
|
133
133
|
--runtime-id "$runtime_id"
|
|
134
134
|
```
|
|
@@ -162,10 +162,10 @@ export ANYSWARM_MODEL_TOKEN='your-bearer-token'
|
|
|
162
162
|
# 可选:覆盖默认本地 Worker 镜像
|
|
163
163
|
# export ANYSWARM_WORKER_IMAGE='your-registry.example/compatible-worker:tag'
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
anys run ./examples/subagents/main.ts ./examples/subagents/config.ts \
|
|
166
166
|
'Split this task into two independent checks and summarize the results.'
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
anys run ./examples/subagents/main.ts ./examples/subagents/config.ts --interactive
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
或在 Node.js 中直接嵌入 `createSubagentsHarness`:
|
|
@@ -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
|
+
anys run ./examples/substrate/main.ts ./examples/substrate/config.ts > substrate-result.json
|
|
100
100
|
|
|
101
101
|
# 无需模型配置,离线检查保存的回执:
|
|
102
102
|
runtime_id=RUNTIME_ID_FROM_RESULT
|
|
103
|
-
|
|
103
|
+
anys 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) 会联合审计 `substrate_contents`、`substrate_references` 和 `substrate_reads` 三张表,检查跨成员复用链:
|
|
@@ -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
|
+
anys run ./benchmarks/fate/main.ts --fate-prepare "$ANYSWARM_FATE_PROJECT" "$ANYSWARM_FATE_LEAN" FATE-X
|
|
131
|
+
anys run ./benchmarks/fate/main.ts --fate-run ./benchmarks/fate/fate-config.ts
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
## 源码索引
|