@anyswarm/core 0.5.0 → 0.5.2
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 +1 -1
- package/README.md +21 -13
- package/deploy/worker/Dockerfile +12 -4
- package/dist/deploy/worker/Dockerfile +12 -4
- package/dist/examples/README.md +35 -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 +40 -0
- package/dist/examples/autoresearch/REQUIREMENTS.zh.md +11 -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 +17 -0
- package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -0
- package/dist/examples/autoresearch/frontiercs2-config.js +3 -0
- package/dist/examples/autoresearch/frontiercs2.d.ts +87 -0
- package/dist/examples/autoresearch/frontiercs2.js +211 -0
- package/dist/examples/autoresearch/prepare-demo.d.ts +1 -0
- package/dist/examples/autoresearch/prepare-demo.js +15 -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 +21 -0
- package/dist/examples/autoresearch/project.js +392 -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 +33 -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 +16 -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/config.js +3 -3
- 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 +52 -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/operator.d.ts +1 -0
- package/dist/examples/super/operator.js +31 -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 +4 -0
- package/dist/examples/super/project.js +251 -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-arguments.d.ts +18 -6
- package/dist/scripts/anyswarm-arguments.js +88 -52
- 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 +1 -0
- package/dist/scripts/anyswarm-harnesses.js +10 -0
- package/dist/scripts/anyswarm-installation.d.ts +7 -40
- package/dist/scripts/anyswarm-installation.js +17 -285
- package/dist/scripts/anyswarm-launch.d.ts +7 -0
- package/dist/scripts/anyswarm-launch.js +37 -0
- package/dist/scripts/anyswarm-progress.d.ts +6 -0
- package/dist/scripts/anyswarm-progress.js +102 -0
- package/dist/scripts/anyswarm-project.d.ts +3 -1
- package/dist/scripts/anyswarm-project.js +49 -35
- package/dist/scripts/anyswarm-source-runner.d.ts +1 -0
- package/dist/scripts/anyswarm-source-runner.js +200 -0
- package/dist/scripts/anyswarm.js +28 -3
- 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 +13 -2
- package/dist/scripts/local-environment.js +111 -28
- 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 +5 -2
- package/dist/scripts/local-setup.js +167 -79
- package/dist/scripts/opensandbox-agent-worker.js +2 -2
- package/dist/scripts/pack-release.d.ts +1 -0
- package/dist/scripts/pack-release.js +66 -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 +14 -1
- package/dist/src/harness/project-harness.js +38 -12
- 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 +6 -2
- 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 +5 -2
- package/docs/architecture/00-overview.md +1 -1
- package/docs/architecture/01-agent-core.md +1 -1
- package/docs/architecture/04-services.md +1 -1
- package/docs/architecture/06-observability-experiments.md +1 -1
- package/docs/architecture/07-run-configuration.md +38 -18
- 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 +152 -89
- 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 -6
- package/docs/architecture/23-project-harness.md +152 -8
- package/docs/architecture/24-runtime-recovery.md +10 -3
- package/docs/architecture/26-code.md +54 -0
- package/docs/architecture/27-personal.md +58 -0
- package/docs/architecture/28-autoresearch.md +43 -0
- package/docs/architecture/INDEX.md +3 -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 +473 -25
- package/docs/designs/core-harness/01-core.md +2 -2
- package/docs/designs/core-harness/06-project-harness.md +13 -2
- package/docs/designs/core-harness/README.md +7 -2
- package/docs/en/agents.md +1 -1
- package/docs/en/build-your-harness.md +3 -5
- package/docs/en/changelog.md +20 -4
- package/docs/en/first-harness.md +9 -12
- 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 +14 -121
- package/docs/en/overview.md +1 -1
- package/docs/en/quickstart.md +42 -39
- package/docs/en/reference/api.md +14 -4
- package/docs/en/reference/cli.md +53 -47
- package/docs/en/runtime.md +2 -2
- package/docs/en/sandbox.md +3 -3
- package/docs/en/services.md +4 -0
- package/docs/operations/trace-viewer.md +1 -1
- package/docs/workflows/development.md +28 -21
- package/docs/workflows/release-and-docs-versioning.md +77 -0
- package/docs/workflows/release-cli-acceptance.md +85 -0
- package/docs/zh/agents.md +1 -1
- package/docs/zh/build-your-harness.md +3 -5
- package/docs/zh/changelog.md +20 -4
- package/docs/zh/first-harness.md +9 -12
- 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 +15 -122
- package/docs/zh/overview.md +1 -1
- package/docs/zh/quickstart.md +42 -39
- package/docs/zh/reference/api.md +14 -4
- package/docs/zh/reference/cli.md +24 -40
- package/docs/zh/runtime.md +2 -2
- package/docs/zh/sandbox.md +3 -3
- package/docs/zh/services.md +4 -0
- package/examples/README.md +35 -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 +40 -0
- package/examples/autoresearch/REQUIREMENTS.zh.md +11 -0
- package/examples/autoresearch/config.ts +90 -0
- package/examples/autoresearch/demo.ts +55 -0
- package/examples/autoresearch/eject.json +17 -0
- package/examples/autoresearch/frontiercs2-config.ts +4 -0
- package/examples/autoresearch/frontiercs2.ts +237 -0
- package/examples/autoresearch/prepare-demo.ts +15 -0
- package/examples/autoresearch/prepare.ts +267 -0
- package/examples/autoresearch/process.ts +50 -0
- package/examples/autoresearch/project.ts +380 -0
- package/examples/autoresearch/research-service.ts +302 -0
- package/examples/code/README.md +33 -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 +16 -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/config.ts +4 -3
- 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 +52 -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/operator.ts +28 -0
- package/examples/super/outbox.ts +97 -0
- package/examples/super/project.ts +225 -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 +700 -0
- package/npm-shrinkwrap.json +95 -1969
- package/package.development.json +88 -0
- package/package.json +11 -8
- package/scripts/anyswarm-arguments.ts +91 -54
- package/scripts/anyswarm-author.ts +25 -0
- package/scripts/anyswarm-eject.ts +145 -0
- package/scripts/anyswarm-harnesses.ts +10 -0
- package/scripts/anyswarm-installation.ts +18 -288
- package/scripts/anyswarm-launch.ts +36 -0
- package/scripts/anyswarm-progress.ts +95 -0
- package/scripts/anyswarm-project.ts +35 -34
- package/scripts/anyswarm-source-runner.ts +176 -0
- package/scripts/anyswarm.ts +24 -3
- 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 +117 -28
- package/scripts/local-setup-smoke.ts +3 -2
- package/scripts/local-setup-worker.ts +17 -7
- package/scripts/local-setup.ts +166 -73
- package/scripts/opensandbox-agent-worker.ts +2 -2
- package/scripts/pack-release.ts +70 -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 +38 -12
- 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 +4 -2
- 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/AGENTS.md
CHANGED
|
@@ -6,7 +6,7 @@ These instructions apply to **Coding Agents developing AnySwarm**, not research
|
|
|
6
6
|
|
|
7
7
|
The [architecture manual](docs/architecture/INDEX.md) is the maintained description of the current implementation. The [SDK and user guides](docs/INDEX.md) describe its supported public surface and are also the website's content source. Current code and schemas establish exact behavior; tests and experiments establish what has been verified. Keep these sources aligned in the same PR.
|
|
8
8
|
|
|
9
|
-
The [Core / Harness design](docs/designs/core-harness/README.md) and its linked extensions record reviewed product requirements and acceptance. Read them together with the relevant Issue and the owner's later explicit decisions; a later explicit decision supersedes an older conflicting clause without changing unrelated acceptance or resource limits. When an authorized change updates the design, include the design, implementation, migration, tests and documentation in the same PR. The design index links the [dynamic Lead-Worker extension](docs/designs/dynamic-lead-worker.md) and the
|
|
9
|
+
The [Core / Harness design](docs/designs/core-harness/README.md) and its linked extensions record reviewed product requirements and acceptance. Read them together with the relevant Issue and the owner's later explicit decisions; a later explicit decision supersedes an older conflicting clause without changing unrelated acceptance or resource limits. When an authorized change updates the design, include the design, implementation, migration, tests and documentation in the same PR. The design index links the [dynamic Lead-Worker extension](docs/designs/dynamic-lead-worker.md) and the scoped CLI work in [#351](https://github.com/AnySwarm/anyswarm/issues/351); current implemented behavior belongs in Architecture.
|
|
10
10
|
|
|
11
11
|
Human-approved GitHub Issues and explicit user instructions define work requirements, scope, acceptance and resources. Read the full relevant Issue, linked tickets, comments and accepted Agent Brief. Cite the exact revision of any reviewed design and preserve its acceptance. Superseded phase plans remain in Git history and linked Issues. Resource, research, merge and publication permissions follow the project rules below.
|
|
12
12
|
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<p>
|
|
23
23
|
<a href="https://anyswarm.github.io/anyswarm/">Website</a> ·
|
|
24
24
|
<a href="docs/en/quickstart.md">Quickstart</a> ·
|
|
25
|
-
<a href="docs/en/latest.md">Releases
|
|
25
|
+
<a href="docs/en/latest.md">Releases</a> ·
|
|
26
26
|
<a href="docs/en/changelog.md">Changelog</a> ·
|
|
27
27
|
<a href="docs/en/build-your-harness.md">Build a Swarm Harness</a> ·
|
|
28
28
|
<a href="docs/zh/overview.md">中文文档</a>
|
|
@@ -37,22 +37,21 @@ AnySwarm separates **how Agents collaborate** from **how Agents are isolated and
|
|
|
37
37
|
## Why AnySwarm
|
|
38
38
|
|
|
39
39
|
- **One Runtime, any topology** — Swap between recursive Subagents, leased TaskPool, PeerMesh, Substrate, or Lead-Worker without modifying the Runtime.
|
|
40
|
-
- **Sandbox Provider interface** — Run `anyswarm setup
|
|
41
|
-
- **Configurable executors, models and file budgets** —
|
|
42
|
-
- **Single unified package** — `@anyswarm/core` bundles the TypeScript SDK, `anyswarm` CLI,
|
|
40
|
+
- **Sandbox Provider interface** — Run `anyswarm setup` to prepare OpenSandbox on your machine. Supply a custom Provider through the root SDK when you need a different Sandbox integration. Model API keys and external Service tokens stay on the trusted Controller.
|
|
41
|
+
- **Configurable executors, models and file budgets** — Use an installed Pi or Codex, optionally pin its exact version, or select an image-installed adapter. Use Responses with Pi or Codex, Chat Completions with Pi, or a trusted Host transport. Configure import, live file operations and export separately.
|
|
42
|
+
- **Single unified package** — `@anyswarm/core` bundles the TypeScript SDK, `anyswarm` host CLI, internal Worker tooling, built-in Harnesses, and the zero-dependency browser Trace Viewer (`anyswarm trace`).
|
|
43
43
|
|
|
44
44
|
## Quick start
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Install the CLI with Node.js 22.19+ and npm. Setup checks the host and looks for a local Docker engine and an installed Pi or Codex. On macOS, start [Docker Desktop or your local container engine](docs/en/quickstart.md#docker-on-macos) before setup.
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
# 1. Install the released CLI
|
|
50
|
-
|
|
51
|
-
# Apply the installer’s PATH command if needed.
|
|
50
|
+
npm install -g @anyswarm/core
|
|
52
51
|
anyswarm --version
|
|
53
52
|
|
|
54
53
|
# 2. Prepare OpenSandbox and save its connection
|
|
55
|
-
anyswarm setup
|
|
54
|
+
anyswarm setup
|
|
56
55
|
|
|
57
56
|
# 3. Point AnySwarm at any streaming OpenAI Responses-compatible endpoint
|
|
58
57
|
export ANYSWARM_MODEL_URL="https://api.openai.com/v1/responses"
|
|
@@ -69,22 +68,31 @@ anyswarm --harness subagents --prompt 'Read README.md and report its heading.' -
|
|
|
69
68
|
anyswarm trace --root ./runs --port 8787
|
|
70
69
|
```
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
For npm prefix and PATH help, see the [Quickstart](docs/en/quickstart.md#1-install-anyswarm). Update with `npm install -g @anyswarm/core@latest`.
|
|
72
|
+
|
|
73
|
+
The installed SDK builds the local Worker using its bundled materials and the selected host executor. Set `ANYSWARM_WORKER_IMAGE` when using a custom Worker image. Use `--harness` to select any built-in (`subagents`, `autoresearch`, `taskpool`, `peermesh`, `substrate`, `lead-worker`, `notes`, `messages`), a local ESM module, or an installed package. In `--mode rpc`, tasks arrive over JSONL with live `status` and `stop` control.
|
|
73
74
|
|
|
74
75
|
## Build with the TypeScript SDK
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
Install the TypeScript SDK in your Node.js project.
|
|
77
78
|
|
|
78
79
|
```sh
|
|
79
|
-
npm install @anyswarm/core
|
|
80
|
+
npm install @anyswarm/core
|
|
80
81
|
```
|
|
81
82
|
|
|
82
|
-
Import Runtime, Service and Sandbox Provider APIs from
|
|
83
|
+
[v0.5.0](docs/en/latest.md#v050) is the first supported release of `@anyswarm/core`. Import Runtime, Service and Sandbox Provider APIs from this package. The [SDK reference](docs/en/reference/api.md#install-the-sdk) also covers verified source archives. The [First Harness tutorial](docs/en/first-harness.md) copies examples from the installed SDK.
|
|
83
84
|
|
|
84
85
|
- Core building blocks & Swarm tutorial: [Sandboxes](docs/en/sandbox.md) · [Runtime](docs/en/runtime.md) · [Agents](docs/en/agents.md) · [Host Gateway](docs/en/gateway.md) · [Services](docs/en/services.md) · [Build a Swarm Harness](docs/en/build-your-harness.md)
|
|
85
86
|
- Minimal runnable two-Agent script: [`examples/messages/handoff.ts`](examples/messages/handoff.ts)
|
|
86
87
|
- Exact signatures, CLI flags, and types: [API Reference](docs/en/reference/api.md) · [CLI Reference](docs/en/reference/cli.md) · [Types & Source Map](docs/en/reference/types.md)
|
|
87
88
|
|
|
89
|
+
## AutoResearch showcase
|
|
90
|
+
|
|
91
|
+
[AutoResearch](examples/autoresearch/README.md) runs a team of equal peers on
|
|
92
|
+
a finite research task. They share findings, review candidates and submit
|
|
93
|
+
patches to a trusted evaluator. The guide includes the pinned FrontierCS-2
|
|
94
|
+
demo, a custom evaluator path and the Trace records to inspect.
|
|
95
|
+
|
|
88
96
|
## Built-in Harnesses
|
|
89
97
|
|
|
90
98
|
The repository includes five substantial Harnesses sharing the same Runtime with different collaboration policies:
|
|
@@ -117,7 +125,7 @@ When started inside an SSH session, `anyswarm trace` prints the matching `ssh -N
|
|
|
117
125
|
|
|
118
126
|
## Releases & documentation
|
|
119
127
|
|
|
120
|
-
- **Releases
|
|
128
|
+
- **Releases**: [Current release](docs/en/latest.md) · [发行版本 (中文)](docs/zh/latest.md) · [GitHub Releases](https://github.com/AnySwarm/anyswarm/releases)
|
|
121
129
|
- **Changelog**: [CHANGELOG.md](CHANGELOG.md) · [Website Changelog](docs/en/changelog.md) · [更新日志 (中文)](docs/zh/changelog.md)
|
|
122
130
|
- **Architecture & research**: [Architecture Manual](docs/architecture/INDEX.md) · [Research Context](docs/PROJECT.md) · [ProgramBench Pastel](benchmarks/programbench-pastel/README.md) · [PutnamBench TaskPool](benchmarks/putnambench-taskpool/README.md)
|
|
123
131
|
|
package/deploy/worker/Dockerfile
CHANGED
|
@@ -15,9 +15,13 @@ ARG WORKER_EXECUTOR
|
|
|
15
15
|
LABEL org.opencontainers.image.source="https://github.com/AnySwarm/anyswarm" \
|
|
16
16
|
org.opencontainers.image.description="AnySwarm OpenSandbox Worker with the selected local executor"
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
&&
|
|
18
|
+
# The slim base has Node's bundled CA roots but not the OS CA bundle yet.
|
|
19
|
+
RUN node -e 'console.log(require("node:tls").rootCertificates.join("\n"))' > /tmp/apt-bootstrap-ca.pem \
|
|
20
|
+
&& sed -i 's@http://deb.debian.org/@https://deb.debian.org/@g' /etc/apt/sources.list.d/debian.sources \
|
|
21
|
+
&& apt-get -o Acquire::https::CaInfo=/tmp/apt-bootstrap-ca.pem -o Acquire::https::Timeout=30 update \
|
|
22
|
+
&& apt-get -o Acquire::https::CaInfo=/tmp/apt-bootstrap-ca.pem -o Acquire::https::Timeout=30 \
|
|
23
|
+
install --no-install-recommends --yes bash ca-certificates curl git jq python3 python-is-python3 ripgrep util-linux \
|
|
24
|
+
&& rm -rf /var/lib/apt/lists/* /tmp/apt-bootstrap-ca.pem
|
|
21
25
|
|
|
22
26
|
WORKDIR /opt/anyswarm
|
|
23
27
|
COPY --chown=0:0 package.json npm-shrinkwrap.json ./
|
|
@@ -57,7 +61,11 @@ RUN chmod 0755 /opt/anyswarm \
|
|
|
57
61
|
&& ln -s /opt/anyswarm/dist/scripts/swarm.js /usr/local/bin/swarm \
|
|
58
62
|
&& ln -s /opt/anyswarm/dist/scripts/opensandbox-agent-worker.js /opt/anyswarm/agent-worker.mjs \
|
|
59
63
|
&& ln -s /opt/anyswarm/dist/scripts/sandbox-project.js /opt/anyswarm/sandbox-project.mjs \
|
|
60
|
-
&& mkdir -p /workspace /opt/anyswarm/pi-agent
|
|
64
|
+
&& mkdir -p /workspace /opt/anyswarm/pi-agent \
|
|
65
|
+
&& case "$WORKER_EXECUTOR" in \
|
|
66
|
+
pi) node /opt/anyswarm/dist/scripts/pi-session-bridge.js --check-sdk ;; \
|
|
67
|
+
codex) /opt/anyswarm/executor/node_modules/.bin/codex app-server --help >/dev/null ;; \
|
|
68
|
+
esac
|
|
61
69
|
|
|
62
70
|
ENV PATH="/opt/anyswarm/executor/node_modules/.bin:/opt/anyswarm/node_modules/.bin:${PATH}" \
|
|
63
71
|
PI_CODING_AGENT_DIR="/opt/anyswarm/pi-agent" \
|
|
@@ -15,9 +15,13 @@ ARG WORKER_EXECUTOR
|
|
|
15
15
|
LABEL org.opencontainers.image.source="https://github.com/AnySwarm/anyswarm" \
|
|
16
16
|
org.opencontainers.image.description="AnySwarm OpenSandbox Worker with the selected local executor"
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
&&
|
|
18
|
+
# The slim base has Node's bundled CA roots but not the OS CA bundle yet.
|
|
19
|
+
RUN node -e 'console.log(require("node:tls").rootCertificates.join("\n"))' > /tmp/apt-bootstrap-ca.pem \
|
|
20
|
+
&& sed -i 's@http://deb.debian.org/@https://deb.debian.org/@g' /etc/apt/sources.list.d/debian.sources \
|
|
21
|
+
&& apt-get -o Acquire::https::CaInfo=/tmp/apt-bootstrap-ca.pem -o Acquire::https::Timeout=30 update \
|
|
22
|
+
&& apt-get -o Acquire::https::CaInfo=/tmp/apt-bootstrap-ca.pem -o Acquire::https::Timeout=30 \
|
|
23
|
+
install --no-install-recommends --yes bash ca-certificates curl git jq python3 python-is-python3 ripgrep util-linux \
|
|
24
|
+
&& rm -rf /var/lib/apt/lists/* /tmp/apt-bootstrap-ca.pem
|
|
21
25
|
|
|
22
26
|
WORKDIR /opt/anyswarm
|
|
23
27
|
COPY --chown=0:0 package.json npm-shrinkwrap.json ./
|
|
@@ -57,7 +61,11 @@ RUN chmod 0755 /opt/anyswarm \
|
|
|
57
61
|
&& ln -s /opt/anyswarm/dist/scripts/swarm.js /usr/local/bin/swarm \
|
|
58
62
|
&& ln -s /opt/anyswarm/dist/scripts/opensandbox-agent-worker.js /opt/anyswarm/agent-worker.mjs \
|
|
59
63
|
&& ln -s /opt/anyswarm/dist/scripts/sandbox-project.js /opt/anyswarm/sandbox-project.mjs \
|
|
60
|
-
&& mkdir -p /workspace /opt/anyswarm/pi-agent
|
|
64
|
+
&& mkdir -p /workspace /opt/anyswarm/pi-agent \
|
|
65
|
+
&& case "$WORKER_EXECUTOR" in \
|
|
66
|
+
pi) node /opt/anyswarm/dist/scripts/pi-session-bridge.js --check-sdk ;; \
|
|
67
|
+
codex) /opt/anyswarm/executor/node_modules/.bin/codex app-server --help >/dev/null ;; \
|
|
68
|
+
esac
|
|
61
69
|
|
|
62
70
|
ENV PATH="/opt/anyswarm/executor/node_modules/.bin:/opt/anyswarm/node_modules/.bin:${PATH}" \
|
|
63
71
|
PI_CODING_AGENT_DIR="/opt/anyswarm/pi-agent" \
|
package/dist/examples/README.md
CHANGED
|
@@ -12,6 +12,16 @@ artifact export. Its same default definition is used by SDK, foreground and
|
|
|
12
12
|
RPC. [HarnessSession clients](harness-session/README.md) exercise the public
|
|
13
13
|
protocol with a zero-Runtime fixture.
|
|
14
14
|
|
|
15
|
+
## AutoResearch showcase
|
|
16
|
+
|
|
17
|
+
[AutoResearch](autoresearch/README.md) runs equal peers through a finite
|
|
18
|
+
research task with shared budgets, a trusted evaluator and browser Trace
|
|
19
|
+
records. The guide includes the pinned FrontierCS-2 demo and a configurable
|
|
20
|
+
evaluator path.
|
|
21
|
+
|
|
22
|
+
[Code](code/README.md), [Personal](super/README.md), and
|
|
23
|
+
[HarnessSession](harness-session/README.md) are advanced SDK examples.
|
|
24
|
+
|
|
15
25
|
## Choose a collaboration example
|
|
16
26
|
|
|
17
27
|
| Directory | Coordination | Services created by the example | Facilities you supply |
|
|
@@ -39,18 +49,15 @@ number.
|
|
|
39
49
|
```sh
|
|
40
50
|
npm init -y
|
|
41
51
|
npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.0}"
|
|
42
|
-
npm install --save-dev typescript @types/node
|
|
43
52
|
sdk=node_modules/@anyswarm/core
|
|
44
53
|
cp -R "$sdk"/examples/subagents demo
|
|
45
54
|
cd demo
|
|
46
|
-
|
|
47
|
-
npm run build
|
|
48
|
-
npm run start -- --cwd /absolute/path/to/project --prompt 'Implement and verify the requested change'
|
|
55
|
+
../node_modules/.bin/anyswarm run ./project.ts --cwd /absolute/path/to/project --prompt 'Implement and verify the requested change'
|
|
49
56
|
```
|
|
50
57
|
|
|
51
58
|
For another collaboration mechanism, replace `subagents` in the copy command
|
|
52
59
|
with `taskpool`, `peermesh`, `lead-worker` or `substrate`. The copied project
|
|
53
|
-
resolves the SDK
|
|
60
|
+
resolves the SDK from its parent installation. The CLI loads TS directly, including multi-file imports and TS configuration.
|
|
54
61
|
|
|
55
62
|
For current repository sources, build the matching SDK archive from that
|
|
56
63
|
checkout's root first. Record its commit and SHA-256, and set the absolute
|
|
@@ -59,27 +66,43 @@ archive path before running the commands above.
|
|
|
59
66
|
```sh
|
|
60
67
|
npm ci --ignore-scripts
|
|
61
68
|
pack_dir=$(mktemp -d)
|
|
62
|
-
archive=$(npm
|
|
63
|
-
sha256sum "$
|
|
64
|
-
export ANYSWARM_SDK_ARCHIVE="$
|
|
69
|
+
archive=$(npm run --silent pack:release -- "$pack_dir")
|
|
70
|
+
sha256sum "$archive"
|
|
71
|
+
export ANYSWARM_SDK_ARCHIVE="$archive"
|
|
65
72
|
```
|
|
66
73
|
|
|
67
74
|
When editing an existing example directly in this checkout, install this
|
|
68
75
|
archive with `npm install --no-save "$ANYSWARM_SDK_ARCHIVE"` in that example's
|
|
69
|
-
directory before its
|
|
76
|
+
directory before running its TypeScript entry.
|
|
70
77
|
|
|
71
78
|
Use the example's README for its configuration and external facilities.
|
|
72
|
-
Run `anyswarm
|
|
79
|
+
Run `anyswarm run /absolute/path/to/example/project.ts --prompt '…'` from
|
|
73
80
|
the input project to use the same editable example from elsewhere. The
|
|
74
81
|
CLI also includes each example's built-in name as a convenience. The host
|
|
75
82
|
captures the initial directory and writes outputs outside it by default.
|
|
76
|
-
Use `--config` for trusted
|
|
83
|
+
Use `--config ./config.ts` for trusted TypeScript run configuration.
|
|
77
84
|
|
|
78
85
|
The model, executor and Sandbox environment variables are documented in
|
|
79
86
|
[Quickstart](../docs/en/quickstart.md). Existing scoped variables remain
|
|
80
87
|
fallbacks. Separate benchmarks take explicit configuration and fixtures.
|
|
81
88
|
See [FATE](../benchmarks/fate/README.md) and [Lead–Worker Orders](../benchmarks/lead-worker-orders/README.md).
|
|
82
89
|
|
|
90
|
+
## Export an editable Harness
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
anyswarm eject example --dir ./my-harness
|
|
94
|
+
cd my-harness
|
|
95
|
+
npm install
|
|
96
|
+
npm run start
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Edit `business.ts` and run it again to see your own result. Export includes the
|
|
100
|
+
complete source and an SDK archive dependency bound to that package's contents.
|
|
101
|
+
Run `npm install` to install that local archive when moving the export to another
|
|
102
|
+
machine. `anyswarm-source.json` records source revision, SDK source, content and
|
|
103
|
+
archive digests. Application teams register the same source manifest for
|
|
104
|
+
`anyswarm eject code`, `anyswarm eject autoresearch` and `anyswarm eject super`.
|
|
105
|
+
|
|
83
106
|
## Smaller SDK tutorials
|
|
84
107
|
|
|
85
108
|
| Example | Host entry | What to verify |
|
|
@@ -98,7 +121,7 @@ The [Service examples index](services/README.md) also links the optional
|
|
|
98
121
|
|
|
99
122
|
Read the Host entry for Worker settings, the named registrations and each
|
|
100
123
|
Profile’s grants. Follow the runner for Agent input, business checks and the
|
|
101
|
-
close receipt. Each example's README gives its
|
|
124
|
+
close receipt. Each example's README gives its launch and evidence paths.
|
|
102
125
|
|
|
103
126
|
## Repository boundaries
|
|
104
127
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Editable TypeScript Harness
|
|
2
|
+
|
|
3
|
+
Run this complete example with the installed AnySwarm CLI.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
anyswarm run ./harness.ts
|
|
7
|
+
anyswarm run ./harness.ts --config ./config.ts --prompt 'Create a greeting'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Edit `business.ts` and run the command again to change the result. `harness.ts`
|
|
11
|
+
defines the Harness lifecycle, `business.ts` contains its rule, and `config.ts`
|
|
12
|
+
provides its default public configuration. This example uses no model or Sandbox.
|
|
13
|
+
|
|
14
|
+
`anyswarm eject example --dir ./my-harness` exports these sources and a local SDK
|
|
15
|
+
archive. The generated package depends on that archive, so `npm install` retains
|
|
16
|
+
the exact candidate SDK. Direct `anyswarm run` can also resolve the invoking CLI's SDK.
|
|
17
|
+
Use the same candidate CLI recorded in `anyswarm-source.json`.
|
|
18
|
+
|
|
19
|
+
Application authors use the same export mechanism by providing `eject.json` in
|
|
20
|
+
`examples/code`, `examples/autoresearch`, or `examples/super`. Its `apiVersion`
|
|
21
|
+
is `1`, `entry` names the runnable TS entry, and `files` explicitly lists every
|
|
22
|
+
relative source, prompt, Service, public config and README needed by that app.
|
|
23
|
+
Credentials, `.env`, runtime records, dependencies and build directories are
|
|
24
|
+
excluded by the engine. Exporting into a nonempty directory fails.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { greeting } from './business.js';
|
|
2
|
+
import defaults from './config.js';
|
|
3
|
+
/** A complete finite Harness with editable business logic and no external resources. */
|
|
4
|
+
const harness = {
|
|
5
|
+
apiVersion: 1,
|
|
6
|
+
id: 'editable-typescript-example',
|
|
7
|
+
lifetimes: ['task'],
|
|
8
|
+
async run(context) {
|
|
9
|
+
context.markRunning();
|
|
10
|
+
const config = (context.configuration ?? defaults);
|
|
11
|
+
const message = greeting(config.name);
|
|
12
|
+
context.updateStatus({ business: { message } });
|
|
13
|
+
return {
|
|
14
|
+
outcome: 'completed', reason: 'greeting-created', result: { message }, artifacts: [],
|
|
15
|
+
export: { status: 'complete' }, cleanup: { status: 'complete' },
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default harness;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# AutoResearch
|
|
2
|
+
|
|
3
|
+
An AutoResearch Run starts equal peers in separate AnySwarm Sandboxes. Each peer chooses a direction, writes a patch, and can read, review and build on another peer's patch. The Harness provides the shared research Service and enforces the team's budget. A trusted evaluator decides whether a candidate is valid and returns the score used for selection.
|
|
4
|
+
|
|
5
|
+
## FrontierCS-2 quickstart
|
|
6
|
+
|
|
7
|
+
Use a Linux x86-64 machine with Git LFS, Python 3, a local Docker daemon and an existing authenticated OpenSandbox deployment with `dns+nft` egress. Prepare a supported Pi Worker using the normal AnySwarm setup flow. Configure the existing Kimi K3 Responses route using `ANYSWARM_MODEL_URL`, `ANYSWARM_MODEL_TOKEN`, `ANYSWARM_MODEL_PROVIDER=kimi_proxy` and `ANYSWARM_MODEL_ID=k3`. Keep the token in trusted host configuration if your proxy requires one.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
anyswarm eject autoresearch --dir ./research-demo
|
|
11
|
+
cd ./research-demo
|
|
12
|
+
npm install
|
|
13
|
+
npm exec -- anyswarm run ./prepare-demo.ts
|
|
14
|
+
npm run start -- --config ./frontiercs2-config.ts --prompt "Run the prepared FrontierCS-2 task." --output-dir ./runs
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Preparation prints prerequisite checks and the resource plan. It reports K3 configuration and HTTP route reachability separately, and reports inference as not attempted. It fetches only the pinned task and shared dependencies, checks the Pumpkin release hash, builds images, completes an independent no-model reference run and checks the authorized submission role. Initial image builds can take several minutes. Rerunning preparation reuses verified materials and images. Reference records are environment evidence. The model receives a clean starter and only public train feedback.
|
|
18
|
+
|
|
19
|
+
The demo configuration selects the clean pinned starter and trusted FrontierCS-2 evaluator. The
|
|
20
|
+
terminal prints Run and Agent milestones. Use `anyswarm trace --root ./runs`
|
|
21
|
+
during or after the Run for peer claims, patches, reviews, train scores and final
|
|
22
|
+
records. For a remote controller, forward the Trace port over SSH.
|
|
23
|
+
|
|
24
|
+
The default smoke budget is four Kimi K3 peers, a shared twelve-minute work window and eight train admissions. The demo records actual model usage without capping the request count. The application reserves additional time for final and cleanup. The result includes every frozen candidate, its hash and author, best candidate, Pumpkin record, final result and cleanup receipt. A valid candidate with a low score is a completed evaluation. A run without a valid candidate returns failure, even when it records an official zero for a selected invalid candidate.
|
|
25
|
+
|
|
26
|
+
## Run your own project
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
anyswarm --harness autoresearch --config ./research.ts --prompt "Your objective" --output-dir ./runs
|
|
30
|
+
anyswarm eject autoresearch --dir ./my-research
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The trusted TypeScript configuration exports a `ResearchConfiguration` object. Set `targetPath` relative to the invocation directory, `goal`, `direction` (`max` or `min`), optional `targetScore`, shared `budget` with an optional `maxModelRequests`, `model`, `executor`, `image`, `sandbox` and `connection`. The evaluator receives an immutable copy of the patch. Its `train(patch, signal, admitted)` returns `{valid, score, feedback}`. Call `admitted` with the trusted job identifier when one exists. `final(patch, signal)` returns the result of the independent final evaluation. The optional `start` and `close` own evaluator resources. All callbacks run as trusted host code. Run candidate code only inside an evaluator-owned isolated environment. Apply the patch to a fresh copy of the baseline, keep evaluator rules inaccessible to it and honor each supplied abort signal.
|
|
34
|
+
|
|
35
|
+
The exported `project.ts` is the editable Harness. Run `npm install` in the export directory
|
|
36
|
+
to install the pinned SDK, then run
|
|
37
|
+
`npm run start -- --cwd /path/to/project --config ./research.ts --prompt "Your objective"`.
|
|
38
|
+
The export includes the FrontierCS-2 preparation and adapter sources.
|
|
39
|
+
|
|
40
|
+
See [the requirements](REQUIREMENTS.zh.md).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# AutoResearch 需求
|
|
2
|
+
|
|
3
|
+
用户配置目标、可信评测和总预算后,团队自动研究、评测、选择候选并收尾。单次命令显示运行阶段和清理结果。Trace 提供认领方向、候选、train 反馈、消息、复核和回执,可在运行中查看,结束后回放。SDK 和 RPC 客户端可以向成员发送建议、中断当前轮次或停止成员。
|
|
4
|
+
|
|
5
|
+
FrontierCS-2 demo 固定 `7e48965c7cef2a567c2669c8e2f10b06386289c9` 的 `binary_fuse_filter` 和该版本的 Pumpkin。团队至少四名平级 AnySwarm Worker,同一次 Run 使用真实 `kimi_proxy/k3`,没有统一 Lead。成员自行认领研究方向、交流和选择沿用的成果。Harness 管理资源、共享预算与可信评测。demo 的研究窗口为 12 分钟,官方 train 额度为 8 次,记录模型请求数但不限制次数。官方 train 公开反馈进入看板,final 结果只写入用户记录。
|
|
6
|
+
|
|
7
|
+
参照[快速上手](README.md)准备并运行。
|
|
8
|
+
|
|
9
|
+
验收从候选包开始。独立 reference 完成无模型 train/final。实际 demo 从干净 starter 开始,保存四路真实 K3 活动重叠的证据、至少一次可关联到具体候选的同行复核或采用,以及 Worker 候选、官方 train、最终保存、final 和资源回收的关联记录。记录全队的资源、模型用量与费用。未知回执和待清理资源保留可核对的标识。官方零分作为求解结果记录。
|
|
10
|
+
|
|
11
|
+
研究范围以 [#337](https://github.com/AnySwarm/anyswarm/issues/337) 和随后确认的四成员、Agensh 式扁平协作、实时 Trace 为准。宿主入口遵循 [#351](https://github.com/AnySwarm/anyswarm/issues/351)。
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ExecutorSelection, type ModelConfig, type RuntimeConnectionOptions, type SandboxConfig } from '@anyswarm/core';
|
|
2
|
+
import type { Evaluator } from './research-service.js';
|
|
3
|
+
export interface ResearchBudget {
|
|
4
|
+
workers: number;
|
|
5
|
+
workMs: number;
|
|
6
|
+
maxModelRequests?: number;
|
|
7
|
+
maxEvaluations: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ResearchConfiguration {
|
|
10
|
+
targetPath?: string;
|
|
11
|
+
requiredFiles?: readonly string[];
|
|
12
|
+
goal: string;
|
|
13
|
+
direction: 'max' | 'min';
|
|
14
|
+
targetScore?: number;
|
|
15
|
+
budget: ResearchBudget;
|
|
16
|
+
evaluator: Evaluator;
|
|
17
|
+
executor: ExecutorSelection;
|
|
18
|
+
image: string;
|
|
19
|
+
model: ModelConfig;
|
|
20
|
+
sandbox: SandboxConfig;
|
|
21
|
+
connection: RuntimeConnectionOptions;
|
|
22
|
+
evaluationTimeoutMs?: number;
|
|
23
|
+
closeTimeoutMs?: number;
|
|
24
|
+
restrictNetwork?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const demoBudget: Readonly<ResearchBudget>;
|
|
27
|
+
export declare function frontierBudget(saved?: ResearchBudget): ResearchBudget;
|
|
28
|
+
export declare const demoGoal = "Solve the official FrontierCS-2 binary_fuse_filter task described in README.md. The 8-bit and 16-bit population routines in include/binaryfusefilter.h are stubs. Implement both routines and send a complete first patch to public train promptly. If a local C compiler is unavailable, use train for compile and correctness feedback. Then explore memory, construction or lookup performance. Change only include/, coordinate directly and review peers\u2019 patches against the official public train feedback.";
|
|
29
|
+
export declare const demoCloseTimeoutMs = 365000;
|
|
30
|
+
export declare function frontierHome(): string;
|
|
31
|
+
export declare function defaultResearchConnection(): {
|
|
32
|
+
executor: import("@anyswarm/core").ExecutorKind;
|
|
33
|
+
image: string;
|
|
34
|
+
sandbox: {
|
|
35
|
+
lifecycleBaseUrl: string;
|
|
36
|
+
apiKey: string | undefined;
|
|
37
|
+
useServerProxy: boolean | undefined;
|
|
38
|
+
egressMode: "dns+nft" | undefined;
|
|
39
|
+
resourceLimits: {
|
|
40
|
+
cpu: string;
|
|
41
|
+
memory: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
connection: {
|
|
45
|
+
publicUrl: string | undefined;
|
|
46
|
+
advertiseHost: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare function kimiModel(): ModelConfig;
|
|
50
|
+
export declare function checkBudget(budget: ResearchBudget, minimum?: number): ResearchBudget;
|
|
51
|
+
export default undefined;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ProjectPreflightError, resolveSandboxConnection, workerImageFor } from '@anyswarm/core';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join, resolve } from 'node:path';
|
|
4
|
+
export const demoBudget = Object.freeze({
|
|
5
|
+
workers: 4, workMs: 720_000, maxEvaluations: 8,
|
|
6
|
+
});
|
|
7
|
+
export function frontierBudget(saved = demoBudget) {
|
|
8
|
+
const { workers, workMs, maxEvaluations } = saved;
|
|
9
|
+
return checkBudget({ workers, workMs, maxEvaluations }, 4);
|
|
10
|
+
}
|
|
11
|
+
export const demoGoal = 'Solve the official FrontierCS-2 binary_fuse_filter task described in README.md. The 8-bit and 16-bit population routines in include/binaryfusefilter.h are stubs. Implement both routines and send a complete first patch to public train promptly. If a local C compiler is unavailable, use train for compile and correctness feedback. Then explore memory, construction or lookup performance. Change only include/, coordinate directly and review peers’ patches against the official public train feedback.';
|
|
12
|
+
export const demoCloseTimeoutMs = 365_000;
|
|
13
|
+
export function frontierHome() {
|
|
14
|
+
return resolve(process.env.ANYSWARM_AUTORESEARCH_STATE_DIR ??
|
|
15
|
+
join(process.env.XDG_STATE_HOME ?? join(homedir(), '.local', 'state'), 'anyswarm', 'autoresearch', 'frontiercs2'));
|
|
16
|
+
}
|
|
17
|
+
export function defaultResearchConnection() {
|
|
18
|
+
const saved = resolveSandboxConnection({}, 'AUTORESEARCH');
|
|
19
|
+
return {
|
|
20
|
+
executor: saved.executor ?? 'pi',
|
|
21
|
+
image: saved.image ?? workerImageFor(saved.executor ?? 'pi'),
|
|
22
|
+
sandbox: {
|
|
23
|
+
lifecycleBaseUrl: saved.lifecycleBaseUrl, apiKey: saved.apiKey,
|
|
24
|
+
useServerProxy: saved.useServerProxy, egressMode: saved.egressMode,
|
|
25
|
+
resourceLimits: { cpu: '2', memory: '4Gi' },
|
|
26
|
+
},
|
|
27
|
+
connection: { publicUrl: saved.publicUrl, advertiseHost: saved.advertiseHost },
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function kimiModel() {
|
|
31
|
+
const url = process.env.ANYSWARM_MODEL_URL;
|
|
32
|
+
if (!url)
|
|
33
|
+
throw new ProjectPreflightError('AUTORESEARCH_MODEL_REQUIRED', 'Set ANYSWARM_MODEL_URL for the Kimi K3 route and ANYSWARM_MODEL_TOKEN if required by your proxy.');
|
|
34
|
+
const provider = process.env.ANYSWARM_MODEL_PROVIDER ?? 'kimi_proxy';
|
|
35
|
+
const model = process.env.ANYSWARM_MODEL_ID ?? 'k3';
|
|
36
|
+
if (provider !== 'kimi_proxy' || model !== 'k3') {
|
|
37
|
+
throw new ProjectPreflightError('AUTORESEARCH_K3_REQUIRED', 'Select the kimi_proxy/k3 model for the FrontierCS-2 demo.');
|
|
38
|
+
}
|
|
39
|
+
const endpoint = URL.canParse(url) ? new URL(url) : undefined;
|
|
40
|
+
if (!endpoint || !['http:', 'https:'].includes(endpoint.protocol) || endpoint.username || endpoint.password ||
|
|
41
|
+
endpoint.search || endpoint.hash || !endpoint.pathname.endsWith('/v1/responses')) {
|
|
42
|
+
throw new ProjectPreflightError('AUTORESEARCH_MODEL_URL_INVALID', 'Set ANYSWARM_MODEL_URL to a fixed HTTP(S) /v1/responses endpoint without credentials, query or fragment.');
|
|
43
|
+
}
|
|
44
|
+
const token = process.env.ANYSWARM_MODEL_TOKEN;
|
|
45
|
+
return { provider, model, upstream: { url: endpoint.href, headers: token ? { authorization: `Bearer ${token}` } : {} } };
|
|
46
|
+
}
|
|
47
|
+
export function checkBudget(budget, minimum = 1) {
|
|
48
|
+
const bounded = (value, min, max) => Number.isSafeInteger(value) && value >= min && value <= max;
|
|
49
|
+
if (!budget || !bounded(budget.workers, minimum, 8) || !bounded(budget.workMs, 10_000, 18_000_000) ||
|
|
50
|
+
!bounded(budget.maxEvaluations, 1, 100) ||
|
|
51
|
+
(budget.maxModelRequests !== undefined && !bounded(budget.maxModelRequests, budget.workers, 10_000))) {
|
|
52
|
+
throw new ProjectPreflightError('AUTORESEARCH_BUDGET_INVALID', 'Set a valid shared worker, time and evaluation budget, and a valid model-request cap if supplied.');
|
|
53
|
+
}
|
|
54
|
+
const { workers, workMs, maxEvaluations, maxModelRequests } = budget;
|
|
55
|
+
return { workers, workMs, maxEvaluations, ...(maxModelRequests === undefined ? {} : { maxModelRequests }) };
|
|
56
|
+
}
|
|
57
|
+
export default undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JsonValue } from '@anyswarm/core';
|
|
2
|
+
import { type ResearchConfiguration } from './config.js';
|
|
3
|
+
export declare function frontierTrainEvaluation(returned: Record<string, unknown>): {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
score: number | null;
|
|
6
|
+
feedback: JsonValue;
|
|
7
|
+
};
|
|
8
|
+
export declare function frontierDemo(): Promise<{
|
|
9
|
+
configuration: ResearchConfiguration;
|
|
10
|
+
starter: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { defaultResearchConnection, demoCloseTimeoutMs, demoGoal, kimiModel } from './config.js';
|
|
3
|
+
import { FrontierRun, frontierFinalTimeMs, frontierSubmission, judgeTimeMs } from './frontiercs2.js';
|
|
4
|
+
import { loadPrepared, resourcePlan } from './prepare.js';
|
|
5
|
+
export function frontierTrainEvaluation(returned) {
|
|
6
|
+
const observed = returned.raw_score;
|
|
7
|
+
const score = typeof observed === 'number' && Number.isFinite(observed) ? observed : null;
|
|
8
|
+
return {
|
|
9
|
+
// This task's valid benchmark score is strictly positive. Some construction
|
|
10
|
+
// failures return only a zero score and omit both failure and rejected.
|
|
11
|
+
valid: score !== null && score > 0 && !returned.rejected && !returned.failure,
|
|
12
|
+
score,
|
|
13
|
+
feedback: returned,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export async function frontierDemo() {
|
|
17
|
+
const ready = await loadPrepared().catch(() => { throw new Error('Prepare the pinned demo first with anyswarm run ./prepare-demo.ts.'); });
|
|
18
|
+
const { budget, paths, saved, starter } = ready;
|
|
19
|
+
const defaults = defaultResearchConnection();
|
|
20
|
+
const model = kimiModel();
|
|
21
|
+
let frontier;
|
|
22
|
+
const configuration = {
|
|
23
|
+
...defaults, model, restrictNetwork: true, goal: demoGoal, direction: 'max', budget,
|
|
24
|
+
sandbox: { ...defaults.sandbox, timeoutSeconds: Math.ceil((budget.workMs + demoCloseTimeoutMs) / 1000) + 60 },
|
|
25
|
+
targetPath: starter,
|
|
26
|
+
requiredFiles: ['README.md', 'include/binaryfusefilter.h'],
|
|
27
|
+
evaluationTimeoutMs: judgeTimeMs + 25_000,
|
|
28
|
+
closeTimeoutMs: demoCloseTimeoutMs,
|
|
29
|
+
evaluator: {
|
|
30
|
+
async start(directory, signal) {
|
|
31
|
+
frontier = new FrontierRun(paths, join(directory, 'pumpkin'));
|
|
32
|
+
await frontier.start(Math.ceil((budget.workMs + frontierFinalTimeMs) / 1000), signal);
|
|
33
|
+
if (frontier.imageId !== saved.bridgeImage || JSON.stringify(frontier.judges) !== JSON.stringify(saved.judges)) {
|
|
34
|
+
throw new Error('Pumpkin image identity changed after preparation');
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
async train(patch, signal, admitted) {
|
|
38
|
+
const receipt = await frontier.train(frontierSubmission(patch), signal, admitted);
|
|
39
|
+
return frontierTrainEvaluation(receipt.returned);
|
|
40
|
+
},
|
|
41
|
+
async final(patch, signal) {
|
|
42
|
+
return await frontier.finish(frontierSubmission(patch), signal);
|
|
43
|
+
},
|
|
44
|
+
async close() { return frontier ? await frontier.close() : 'complete'; },
|
|
45
|
+
evidence() {
|
|
46
|
+
return { reference: saved.referenceRecord, record: frontier?.record ?? null, bridgeImage: frontier?.imageId ?? null, judges: frontier?.judges ?? null,
|
|
47
|
+
benchmark: saved.revision, pumpkin: saved.pumpkin, resources: resourcePlan(budget) };
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
return { configuration, starter };
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiVersion": 1,
|
|
3
|
+
"entry": "project.ts",
|
|
4
|
+
"files": [
|
|
5
|
+
"README.md",
|
|
6
|
+
"REQUIREMENTS.zh.md",
|
|
7
|
+
"project.ts",
|
|
8
|
+
"config.ts",
|
|
9
|
+
"research-service.ts",
|
|
10
|
+
"demo.ts",
|
|
11
|
+
"prepare.ts",
|
|
12
|
+
"prepare-demo.ts",
|
|
13
|
+
"frontiercs2-config.ts",
|
|
14
|
+
"frontiercs2.ts",
|
|
15
|
+
"process.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|