@anyswarm/core 0.5.1 → 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.
Files changed (171) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +13 -6
  3. package/dist/examples/README.md +16 -5
  4. package/dist/examples/authoring/README.md +4 -4
  5. package/dist/examples/autoresearch/README.md +15 -8
  6. package/dist/examples/autoresearch/REQUIREMENTS.zh.md +3 -10
  7. package/dist/examples/autoresearch/demo.js +1 -1
  8. package/dist/examples/autoresearch/eject.json +2 -0
  9. package/dist/examples/autoresearch/frontiercs2-config.d.ts +2 -0
  10. package/dist/examples/autoresearch/frontiercs2-config.js +3 -0
  11. package/dist/examples/autoresearch/prepare-demo.d.ts +1 -0
  12. package/dist/examples/autoresearch/prepare-demo.js +15 -0
  13. package/dist/examples/autoresearch/prepare.js +3 -3
  14. package/dist/examples/autoresearch/project.d.ts +0 -94
  15. package/dist/examples/autoresearch/project.js +2 -20
  16. package/dist/examples/code/README.md +25 -17
  17. package/dist/examples/code/REQUIREMENTS.zh.md +3 -3
  18. package/dist/examples/harness-session/README.md +3 -3
  19. package/dist/examples/messages/README.md +1 -1
  20. package/dist/examples/notes/README.md +3 -3
  21. package/dist/examples/services/mathlib-search/README.md +1 -1
  22. package/dist/examples/services/persistent-board/README.md +5 -2
  23. package/dist/examples/subagents/README.md +2 -2
  24. package/dist/examples/subagents/config.js +3 -3
  25. package/dist/examples/substrate/README.md +2 -2
  26. package/dist/examples/super/README.md +34 -22
  27. package/dist/examples/super/actions.d.ts +1 -1
  28. package/dist/examples/super/actions.js +11 -11
  29. package/dist/examples/super/config.js +3 -3
  30. package/dist/examples/super/eject.json +1 -1
  31. package/dist/examples/super/location.js +1 -1
  32. package/dist/examples/super/operator.d.ts +1 -0
  33. package/dist/examples/super/operator.js +31 -0
  34. package/dist/examples/super/project.d.ts +0 -107
  35. package/dist/examples/super/project.js +1 -3
  36. package/dist/scripts/anyswarm-arguments.d.ts +7 -25
  37. package/dist/scripts/anyswarm-arguments.js +69 -97
  38. package/dist/scripts/anyswarm-eject.js +1 -1
  39. package/dist/scripts/anyswarm-harnesses.d.ts +0 -1
  40. package/dist/scripts/anyswarm-harnesses.js +1 -22
  41. package/dist/scripts/anyswarm-installation.d.ts +7 -40
  42. package/dist/scripts/anyswarm-installation.js +17 -291
  43. package/dist/scripts/anyswarm-launch.d.ts +6 -36
  44. package/dist/scripts/anyswarm-launch.js +32 -81
  45. package/dist/scripts/anyswarm-progress.d.ts +6 -0
  46. package/dist/scripts/anyswarm-progress.js +102 -0
  47. package/dist/scripts/anyswarm-project.d.ts +1 -9
  48. package/dist/scripts/anyswarm-project.js +40 -127
  49. package/dist/scripts/anyswarm-source-runner.js +9 -41
  50. package/dist/scripts/anyswarm.js +6 -26
  51. package/dist/scripts/build-provenance.json +1 -1
  52. package/dist/scripts/local-environment.d.ts +10 -4
  53. package/dist/scripts/local-environment.js +67 -20
  54. package/dist/scripts/local-setup.d.ts +3 -0
  55. package/dist/scripts/local-setup.js +135 -107
  56. package/dist/scripts/pack-release.js +4 -1
  57. package/dist/src/core/worker-image.js +1 -1
  58. package/dist/src/harness/project-harness.d.ts +1 -0
  59. package/dist/src/harness/project-harness.js +2 -2
  60. package/dist/src/harness/project-runtime.js +3 -1
  61. package/docs/INDEX.md +2 -1
  62. package/docs/architecture/04-services.md +1 -1
  63. package/docs/architecture/07-run-configuration.md +28 -14
  64. package/docs/architecture/12-code-coverage.md +56 -57
  65. package/docs/architecture/17-harness-reporting.md +1 -1
  66. package/docs/architecture/22-website.md +4 -7
  67. package/docs/architecture/23-project-harness.md +48 -23
  68. package/docs/architecture/26-code.md +20 -5
  69. package/docs/architecture/27-personal.md +23 -8
  70. package/docs/architecture/28-autoresearch.md +18 -6
  71. package/docs/architecture/INDEX.md +1 -2
  72. package/docs/architecture/prompts/source-manifest.json +5 -5
  73. package/docs/architecture/source-map.json +51 -71
  74. package/docs/designs/core-harness/01-core.md +2 -2
  75. package/docs/designs/core-harness/06-project-harness.md +3 -3
  76. package/docs/designs/core-harness/README.md +2 -2
  77. package/docs/en/agents.md +1 -1
  78. package/docs/en/build-your-harness.md +1 -1
  79. package/docs/en/changelog.md +7 -0
  80. package/docs/en/first-harness.md +6 -6
  81. package/docs/en/harnesses/lead-worker.md +1 -1
  82. package/docs/en/harnesses/peermesh.md +2 -2
  83. package/docs/en/harnesses/subagents.md +2 -2
  84. package/docs/en/harnesses/substrate.md +4 -4
  85. package/docs/en/harnesses/taskpool.md +2 -2
  86. package/docs/en/latest.md +9 -5
  87. package/docs/en/quickstart.md +20 -41
  88. package/docs/en/reference/api.md +1 -1
  89. package/docs/en/reference/cli.md +47 -85
  90. package/docs/en/sandbox.md +3 -3
  91. package/docs/operations/trace-viewer.md +1 -1
  92. package/docs/third-party-notices.md +0 -1
  93. package/docs/workflows/development.md +14 -12
  94. package/docs/workflows/release-and-docs-versioning.md +13 -12
  95. package/docs/workflows/release-cli-acceptance.md +85 -0
  96. package/docs/zh/agents.md +1 -1
  97. package/docs/zh/build-your-harness.md +1 -1
  98. package/docs/zh/changelog.md +8 -1
  99. package/docs/zh/first-harness.md +7 -7
  100. package/docs/zh/harnesses/lead-worker.md +1 -1
  101. package/docs/zh/harnesses/peermesh.md +2 -2
  102. package/docs/zh/harnesses/subagents.md +2 -2
  103. package/docs/zh/harnesses/substrate.md +4 -4
  104. package/docs/zh/harnesses/taskpool.md +2 -2
  105. package/docs/zh/latest.md +9 -5
  106. package/docs/zh/quickstart.md +20 -41
  107. package/docs/zh/reference/api.md +1 -1
  108. package/docs/zh/reference/cli.md +19 -79
  109. package/docs/zh/sandbox.md +3 -3
  110. package/examples/README.md +16 -5
  111. package/examples/authoring/README.md +4 -4
  112. package/examples/autoresearch/README.md +15 -8
  113. package/examples/autoresearch/REQUIREMENTS.zh.md +3 -10
  114. package/examples/autoresearch/demo.ts +1 -1
  115. package/examples/autoresearch/eject.json +2 -0
  116. package/examples/autoresearch/frontiercs2-config.ts +4 -0
  117. package/examples/autoresearch/prepare-demo.ts +15 -0
  118. package/examples/autoresearch/prepare.ts +3 -3
  119. package/examples/autoresearch/project.ts +2 -19
  120. package/examples/code/README.md +25 -17
  121. package/examples/code/REQUIREMENTS.zh.md +3 -3
  122. package/examples/harness-session/README.md +3 -3
  123. package/examples/messages/README.md +1 -1
  124. package/examples/notes/README.md +3 -3
  125. package/examples/services/mathlib-search/README.md +1 -1
  126. package/examples/services/persistent-board/README.md +5 -2
  127. package/examples/subagents/README.md +2 -2
  128. package/examples/subagents/config.ts +4 -3
  129. package/examples/substrate/README.md +2 -2
  130. package/examples/super/README.md +34 -22
  131. package/examples/super/actions.ts +11 -11
  132. package/examples/super/config.ts +3 -3
  133. package/examples/super/eject.json +1 -1
  134. package/examples/super/location.ts +1 -1
  135. package/examples/super/operator.ts +28 -0
  136. package/examples/super/project.ts +1 -3
  137. package/npm-shrinkwrap.development.json +42 -1541
  138. package/npm-shrinkwrap.json +3 -43
  139. package/package.development.json +2 -6
  140. package/package.json +2 -5
  141. package/scripts/anyswarm-arguments.ts +67 -96
  142. package/scripts/anyswarm-eject.ts +1 -1
  143. package/scripts/anyswarm-harnesses.ts +1 -18
  144. package/scripts/anyswarm-installation.ts +18 -294
  145. package/scripts/anyswarm-launch.ts +30 -102
  146. package/scripts/anyswarm-progress.ts +95 -0
  147. package/scripts/anyswarm-project.ts +31 -123
  148. package/scripts/anyswarm-source-runner.ts +9 -36
  149. package/scripts/anyswarm.ts +4 -24
  150. package/scripts/local-environment.ts +71 -20
  151. package/scripts/local-setup.ts +134 -94
  152. package/scripts/pack-release.ts +4 -1
  153. package/src/core/worker-image.ts +1 -1
  154. package/src/harness/project-harness.ts +2 -2
  155. package/src/harness/project-runtime.ts +2 -1
  156. package/dist/scripts/anyswarm-applications.d.ts +0 -19
  157. package/dist/scripts/anyswarm-applications.js +0 -19
  158. package/dist/scripts/anyswarm-tui-config.d.ts +0 -36
  159. package/dist/scripts/anyswarm-tui-config.js +0 -189
  160. package/dist/scripts/anyswarm-tui-session.d.ts +0 -66
  161. package/dist/scripts/anyswarm-tui-session.js +0 -304
  162. package/dist/scripts/anyswarm-tui-terminal.d.ts +0 -41
  163. package/dist/scripts/anyswarm-tui-terminal.js +0 -154
  164. package/dist/scripts/anyswarm-tui.d.ts +0 -2
  165. package/dist/scripts/anyswarm-tui.js +0 -1012
  166. package/docs/architecture/25-foreground-tui.md +0 -51
  167. package/scripts/anyswarm-applications.ts +0 -39
  168. package/scripts/anyswarm-tui-config.ts +0 -174
  169. package/scripts/anyswarm-tui-session.ts +0 -295
  170. package/scripts/anyswarm-tui-terminal.ts +0 -147
  171. package/scripts/anyswarm-tui.ts +0 -912
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 open CLI/TUI work; current implemented behavior belongs in Architecture.
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
@@ -37,13 +37,13 @@ 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 --mode local`, or save an existing OpenSandbox endpoint and one Runtime callback with `anyswarm setup --mode existing`. 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.
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
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` CLI, `swarm` container CLI, built-in Harnesses, and the zero-dependency browser Trace Viewer (`anyswarm trace`).
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
- Install the current stable CLI with Node.js 22.19+ and npm on Linux or macOS. Local OpenSandbox is separate: the current release requires a Linux Controller, Docker Engine and a supported npm-installed Pi or Codex. For native macOS local setup ([#339](https://github.com/AnySwarm/anyswarm/issues/339)), [install and start Docker Desktop for Mac](docs/en/quickstart.md#docker-on-macos) or start your existing local Linux container engine. The npm command does not install the engine.
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
@@ -51,7 +51,7 @@ npm install -g @anyswarm/core
51
51
  anyswarm --version
52
52
 
53
53
  # 2. Prepare OpenSandbox and save its connection
54
- anyswarm setup --backend pi
54
+ anyswarm setup
55
55
 
56
56
  # 3. Point AnySwarm at any streaming OpenAI Responses-compatible endpoint
57
57
  export ANYSWARM_MODEL_URL="https://api.openai.com/v1/responses"
@@ -68,9 +68,9 @@ anyswarm --harness subagents --prompt 'Read README.md and report its heading.' -
68
68
  anyswarm trace --root ./runs --port 8787
69
69
  ```
70
70
 
71
- The [shell installer](docs/en/quickstart.md#1-install-anyswarm) also installs the CLI and enables `anyswarm update`. For an npm global install, update with `npm install -g @anyswarm/core@latest`.
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
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`, `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
+ 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.
74
74
 
75
75
  ## Build with the TypeScript SDK
76
76
 
@@ -86,6 +86,13 @@ npm install @anyswarm/core
86
86
  - Minimal runnable two-Agent script: [`examples/messages/handoff.ts`](examples/messages/handoff.ts)
87
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)
88
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
+
89
96
  ## Built-in Harnesses
90
97
 
91
98
  The repository includes five substantial Harnesses sharing the same Runtime with different collaboration policies:
@@ -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 |
@@ -42,7 +52,7 @@ npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.0}"
42
52
  sdk=node_modules/@anyswarm/core
43
53
  cp -R "$sdk"/examples/subagents demo
44
54
  cd demo
45
- ../node_modules/.bin/anys run ./project.ts --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'
46
56
  ```
47
57
 
48
58
  For another collaboration mechanism, replace `subagents` in the copy command
@@ -66,7 +76,7 @@ archive with `npm install --no-save "$ANYSWARM_SDK_ARCHIVE"` in that example's
66
76
  directory before running its TypeScript entry.
67
77
 
68
78
  Use the example's README for its configuration and external facilities.
69
- Run `anys run /absolute/path/to/example/project.ts --prompt '…'` from
79
+ Run `anyswarm run /absolute/path/to/example/project.ts --prompt '…'` from
70
80
  the input project to use the same editable example from elsewhere. The
71
81
  CLI also includes each example's built-in name as a convenience. The host
72
82
  captures the initial directory and writes outputs outside it by default.
@@ -80,9 +90,10 @@ See [FATE](../benchmarks/fate/README.md) and [Lead–Worker Orders](../benchmark
80
90
  ## Export an editable Harness
81
91
 
82
92
  ```sh
83
- anys eject example --dir ./my-harness
93
+ anyswarm eject example --dir ./my-harness
84
94
  cd my-harness
85
- anys run ./harness.ts
95
+ npm install
96
+ npm run start
86
97
  ```
87
98
 
88
99
  Edit `business.ts` and run it again to see your own result. Export includes the
@@ -90,7 +101,7 @@ complete source and an SDK archive dependency bound to that package's contents.
90
101
  Run `npm install` to install that local archive when moving the export to another
91
102
  machine. `anyswarm-source.json` records source revision, SDK source, content and
92
103
  archive digests. Application teams register the same source manifest for
93
- `anys eject code`, `anys eject autoresearch` and `anys eject super`.
104
+ `anyswarm eject code`, `anyswarm eject autoresearch` and `anyswarm eject super`.
94
105
 
95
106
  ## Smaller SDK tutorials
96
107
 
@@ -3,17 +3,17 @@
3
3
  Run this complete example with the installed AnySwarm CLI.
4
4
 
5
5
  ```sh
6
- anys run ./harness.ts
7
- anys run ./harness.ts --config ./config.ts --prompt 'Create a greeting'
6
+ anyswarm run ./harness.ts
7
+ anyswarm run ./harness.ts --config ./config.ts --prompt 'Create a greeting'
8
8
  ```
9
9
 
10
10
  Edit `business.ts` and run the command again to change the result. `harness.ts`
11
11
  defines the Harness lifecycle, `business.ts` contains its rule, and `config.ts`
12
12
  provides its default public configuration. This example uses no model or Sandbox.
13
13
 
14
- `anys eject example --dir ./my-harness` exports these sources and a local SDK
14
+ `anyswarm eject example --dir ./my-harness` exports these sources and a local SDK
15
15
  archive. The generated package depends on that archive, so `npm install` retains
16
- the exact candidate SDK. Direct `anys run` can also resolve the invoking CLI's SDK.
16
+ the exact candidate SDK. Direct `anyswarm run` can also resolve the invoking CLI's SDK.
17
17
  Use the same candidate CLI recorded in `anyswarm-source.json`.
18
18
 
19
19
  Application authors use the same export mechanism by providing `eject.json` in
@@ -7,27 +7,34 @@ An AutoResearch Run starts equal peers in separate AnySwarm Sandboxes. Each peer
7
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
8
 
9
9
  ```sh
10
- anys -u autoresearch --cmd /prepare
11
- anys -u autoresearch
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
12
15
  ```
13
16
 
14
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.
15
18
 
16
- Type `/demo frontiercs2` in the composer. The stream shows peer claims, submitted candidates, patch reads, reviews and train scores. When a candidate becomes available, eligible peers receive a prompt to read and review its exact version. The live Trace shows detailed research, peer messages and reviews. Use `@peer-2 <suggestion>`, `/interrupt peer-2` or `/stop peer-2` to control one peer. The Trace link serves the current Run on loopback. For a remote controller, forward its port over SSH. After the CLI exits, use the printed replay command.
17
-
18
- For a script or pipe, use `anys -u autoresearch --cmd '/demo frontiercs2'`. The live Trace URL goes to stderr. Session events and the final result go to stdout as JSONL.
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.
19
23
 
20
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.
21
25
 
22
26
  ## Run your own project
23
27
 
24
28
  ```sh
25
- anys -u autoresearch --config ./research.ts "Your objective"
26
- anys eject autoresearch --dir ./my-research
29
+ anyswarm --harness autoresearch --config ./research.ts --prompt "Your objective" --output-dir ./runs
30
+ anyswarm eject autoresearch --dir ./my-research
27
31
  ```
28
32
 
29
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.
30
34
 
31
- The exported `project.ts` is the editable Harness. Install its pinned SDK archive with `npm install` in the export directory, then run `anys -u ./project.ts --cwd /path/to/project --config ./research.ts "Your objective"`. The export includes the FrontierCS-2 adapter and preparation source. The installed CLI hosts the terminal and live Trace.
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.
32
39
 
33
40
  See [the requirements](REQUIREMENTS.zh.md).
@@ -1,18 +1,11 @@
1
1
  # AutoResearch 需求
2
2
 
3
- 用户配置目标、可信评测和总预算后,团队自动研究、评测、选择候选并收尾。流式终端显示认领方向、提交候选和 train 反馈,支持向单个成员发送建议、中断当前轮次和停止成员。实时 Trace 提供消息、复核、候选沿用和回执,结束后可回放。
3
+ 用户配置目标、可信评测和总预算后,团队自动研究、评测、选择候选并收尾。单次命令显示运行阶段和清理结果。Trace 提供认领方向、候选、train 反馈、消息、复核和回执,可在运行中查看,结束后回放。SDK 和 RPC 客户端可以向成员发送建议、中断当前轮次或停止成员。
4
4
 
5
5
  FrontierCS-2 demo 固定 `7e48965c7cef2a567c2669c8e2f10b06386289c9` 的 `binary_fuse_filter` 和该版本的 Pumpkin。团队至少四名平级 AnySwarm Worker,同一次 Run 使用真实 `kimi_proxy/k3`,没有统一 Lead。成员自行认领研究方向、交流和选择沿用的成果。Harness 管理资源、共享预算与可信评测。demo 的研究窗口为 12 分钟,官方 train 额度为 8 次,记录模型请求数但不限制次数。官方 train 公开反馈进入看板,final 结果只写入用户记录。
6
6
 
7
- ```sh
8
- anys -u autoresearch --cmd /prepare
9
- anys -u autoresearch --cmd "/demo frontiercs2"
10
- anys -u autoresearch --config ./research.ts "研究目标"
11
- anys eject autoresearch --dir ./my-research
12
- ```
7
+ 参照[快速上手](README.md)准备并运行。
13
8
 
14
9
  验收从候选包开始。独立 reference 完成无模型 train/final。实际 demo 从干净 starter 开始,保存四路真实 K3 活动重叠的证据、至少一次可关联到具体候选的同行复核或采用,以及 Worker 候选、官方 train、最终保存、final 和资源回收的关联记录。记录全队的资源、模型用量与费用。未知回执和待清理资源保留可核对的标识。官方零分作为求解结果记录。
15
10
 
16
- 在交互入口 `anys -u autoresearch` 也可输入 `/prepare` 和 `/demo frontiercs2`。
17
-
18
- 范围以 [#337](https://github.com/AnySwarm/anyswarm/issues/337) 和随后确认的四成员、Agensh 式扁平协作、实时 Trace 为准。终端交互遵循 [#344](https://github.com/AnySwarm/anyswarm/issues/344)。
11
+ 研究范围以 [#337](https://github.com/AnySwarm/anyswarm/issues/337) 和随后确认的四成员、Agensh 式扁平协作、实时 Trace 为准。宿主入口遵循 [#351](https://github.com/AnySwarm/anyswarm/issues/351)。
@@ -14,7 +14,7 @@ export function frontierTrainEvaluation(returned) {
14
14
  };
15
15
  }
16
16
  export async function frontierDemo() {
17
- const ready = await loadPrepared().catch(() => { throw new Error('Prepare the pinned demo first with anys -u autoresearch --cmd /prepare.'); });
17
+ const ready = await loadPrepared().catch(() => { throw new Error('Prepare the pinned demo first with anyswarm run ./prepare-demo.ts.'); });
18
18
  const { budget, paths, saved, starter } = ready;
19
19
  const defaults = defaultResearchConnection();
20
20
  const model = kimiModel();
@@ -9,6 +9,8 @@
9
9
  "research-service.ts",
10
10
  "demo.ts",
11
11
  "prepare.ts",
12
+ "prepare-demo.ts",
13
+ "frontiercs2-config.ts",
12
14
  "frontiercs2.ts",
13
15
  "process.ts"
14
16
  ]
@@ -0,0 +1,2 @@
1
+ declare const configuration: import("./config.js").ResearchConfiguration;
2
+ export default configuration;
@@ -0,0 +1,3 @@
1
+ import { frontierDemo } from './demo.js';
2
+ const { configuration } = await frontierDemo();
3
+ export default configuration;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { prepareFrontier } from './prepare.js';
2
+ const controller = new AbortController();
3
+ const interrupt = (signal) => {
4
+ process.exitCode = signal === 'SIGINT' ? 130 : 143;
5
+ controller.abort();
6
+ };
7
+ process.on('SIGINT', interrupt).on('SIGTERM', interrupt);
8
+ try {
9
+ const report = await prepareFrontier({ signal: controller.signal, progress: console.error });
10
+ console.log(JSON.stringify(report, null, 2));
11
+ process.exitCode ??= report.ok ? 0 : 2;
12
+ }
13
+ finally {
14
+ process.off('SIGINT', interrupt).off('SIGTERM', interrupt);
15
+ }
@@ -56,7 +56,7 @@ export async function loadPrepared(home = frontierHome()) {
56
56
  const saved = JSON.parse(await readFile(join(home, 'prepared.json'), 'utf8'));
57
57
  if (saved.version !== 2 || saved.revision !== frontierRevision || saved.pumpkin !== pumpkinPin ||
58
58
  !/^[a-zA-Z0-9._-]+$/.test(saved.dockerContext))
59
- throw new Error('Run anys autoresearch demo frontiercs2 --prepare to refresh this demo.');
59
+ throw new Error('Run anyswarm autoresearch demo frontiercs2 --prepare to refresh this demo.');
60
60
  const locations = paths(home, saved.dockerContext);
61
61
  const reference = join(home, 'reference');
62
62
  const [bridgeDigest, sourceDigest] = await Promise.all([treeDigest(locations.source), treeDigest(reference)]);
@@ -198,12 +198,12 @@ export async function prepareFrontier({ signal, progress, home = frontierHome()
198
198
  ]);
199
199
  const ok = Boolean(sandbox.apiKey && authenticated.ok && [401, 403].includes(anonymous.status) && sandbox.egressMode === 'dns+nft');
200
200
  await Promise.all([authenticated.body?.cancel(), anonymous.body?.cancel()]);
201
- check('opensandbox', ok, ok ? 'Authenticated Lifecycle endpoint.' : 'Configure an authenticated OpenSandbox with dns+nft egress and run anys doctor.');
201
+ check('opensandbox', ok, ok ? 'Authenticated Lifecycle endpoint.' : 'Configure an authenticated OpenSandbox with dns+nft egress and run anyswarm doctor.');
202
202
  const worker = validContext && await command('docker', ['--context', dockerContext, 'image', 'inspect', '--format', '{{.Id}}', image], { timeoutMs: 8000, signal }).catch(() => undefined);
203
203
  check('worker-image', !!worker && worker.code === 0, worker && worker.code === 0 ? worker.stdout.trim() : 'Select the prepared AnySwarm Worker image for this Docker daemon.');
204
204
  }
205
205
  catch (error) {
206
- check('opensandbox', false, `Check the existing endpoint with anys doctor. ${error.name}`);
206
+ check('opensandbox', false, `Check the existing endpoint with anyswarm doctor. ${error.name}`);
207
207
  }
208
208
  const report = { ok: false, benchmark: frontierRevision, pumpkin: pumpkinPin, budget, resources, checks, home, modelInference: 'not-attempted' };
209
209
  if (checks.some(row => !row.ok))
@@ -1,102 +1,8 @@
1
1
  import { type HarnessContext, type HarnessJson } from '@anyswarm/core';
2
- import { type ResearchConfiguration } from './config.js';
3
2
  export declare function resolveWorkspace({ cwd, configuration }: {
4
3
  cwd: string;
5
4
  configuration?: unknown;
6
5
  }): string;
7
- export declare const slashActions: {
8
- prepare({ args, signal, progress }: {
9
- args: string;
10
- signal: AbortSignal;
11
- progress?: (message: string) => void;
12
- }): Promise<{
13
- ok: boolean;
14
- benchmark: string;
15
- pumpkin: string;
16
- budget: import("./config.js").ResearchBudget;
17
- resources: {
18
- roles: {
19
- role: string;
20
- count: number;
21
- cpu: number;
22
- memoryGiB: number;
23
- }[];
24
- cpu: number;
25
- memoryGiB: number;
26
- diskGiB: number;
27
- gpu: number;
28
- };
29
- checks: import("./prepare.js").Check[];
30
- home: string;
31
- modelInference: 'not-attempted';
32
- } | {
33
- kind: 'action-report';
34
- exitCode: number;
35
- result: {
36
- ok: boolean;
37
- benchmark: string;
38
- pumpkin: string;
39
- budget: import("./config.js").ResearchBudget;
40
- resources: {
41
- roles: {
42
- role: string;
43
- count: number;
44
- cpu: number;
45
- memoryGiB: number;
46
- }[];
47
- cpu: number;
48
- memoryGiB: number;
49
- diskGiB: number;
50
- gpu: number;
51
- };
52
- checks: import("./prepare.js").Check[];
53
- home: string;
54
- modelInference: 'not-attempted';
55
- } | {
56
- benchmark: string;
57
- pumpkin: string;
58
- budget: import("./config.js").ResearchBudget;
59
- resources: {
60
- roles: {
61
- role: string;
62
- count: number;
63
- cpu: number;
64
- memoryGiB: number;
65
- }[];
66
- cpu: number;
67
- memoryGiB: number;
68
- diskGiB: number;
69
- gpu: number;
70
- };
71
- checks: import("./prepare.js").Check[];
72
- home: string;
73
- modelInference: 'not-attempted';
74
- ok: boolean;
75
- reused: boolean;
76
- prepared: {
77
- version: 2;
78
- revision: string;
79
- pumpkin: string;
80
- sourceDigest: string;
81
- bridgeDigest: string;
82
- bridgeImage: string;
83
- judges: import("./frontiercs2.js").JudgeImages;
84
- dockerContext: string;
85
- referenceRecord: string;
86
- budget: import("./config.js").ResearchBudget;
87
- };
88
- };
89
- }>;
90
- demo({ args, signal }: {
91
- args: string;
92
- signal: AbortSignal;
93
- }): Promise<{
94
- kind: 'start-run';
95
- cwd: string;
96
- prompt: string;
97
- configuration: ResearchConfiguration;
98
- }>;
99
- };
100
6
  declare const _default: {
101
7
  apiVersion: 1;
102
8
  id: string;
@@ -2,9 +2,7 @@ import { mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
2
2
  import { join, resolve } from 'node:path';
3
3
  import { setTimeout as delay } from 'node:timers/promises';
4
4
  import { createRuntime, createSandbox, getExecutorCapabilities, observeProjectRuntime, ProjectPreflightError, runInput, ServiceRegistry } from '@anyswarm/core';
5
- import { checkBudget, demoGoal } from './config.js';
6
- import { frontierDemo } from './demo.js';
7
- import { prepareFrontier } from './prepare.js';
5
+ import { checkBudget } from './config.js';
8
6
  import { appendResearchEvent, candidatePath, createResearch, researchOperations, withDeadline } from './research-service.js';
9
7
  const instructions = `You are one of several equal research peers exploring the same goal. Choose your own concrete direction and coordinate directly with peers.
10
8
  Use the following CLI directly in your private project. The host already provides this Service.
@@ -35,7 +33,7 @@ function configuration(value) {
35
33
  !config.evaluator || typeof config.evaluator.train !== 'function' || typeof config.evaluator.final !== 'function' ||
36
34
  !config.executor || !config.image || !config.model || !config.sandbox || !config.connection ||
37
35
  (config.targetScore !== undefined && !Number.isFinite(config.targetScore))) {
38
- throw new ProjectPreflightError('AUTORESEARCH_CONFIG_REQUIRED', 'Use anys -u autoresearch --config ./research.ts with a goal, trusted evaluator and runtime settings, or run /demo frontiercs2.');
36
+ throw new ProjectPreflightError('AUTORESEARCH_CONFIG_REQUIRED', 'Run anyswarm --harness autoresearch --config ./research.ts --prompt <goal> with a trusted evaluator and runtime settings.');
39
37
  }
40
38
  for (const ms of [config.evaluationTimeoutMs, config.closeTimeoutMs]) {
41
39
  if (ms !== undefined && (!Number.isSafeInteger(ms) || ms < 1 || ms > 2_147_483_647)) {
@@ -48,21 +46,6 @@ export function resolveWorkspace({ cwd, configuration }) {
48
46
  const target = configuration?.targetPath;
49
47
  return typeof target === 'string' && target.trim() ? resolve(cwd, target) : cwd;
50
48
  }
51
- export const slashActions = {
52
- async prepare({ args, signal, progress = console.error }) {
53
- if (args && args !== 'frontiercs2')
54
- throw new Error('Usage: /prepare [frontiercs2]');
55
- const result = await prepareFrontier({ signal, progress });
56
- return result.ok ? result : { kind: 'action-report', exitCode: 2, result };
57
- },
58
- async demo({ args, signal }) {
59
- if (args !== 'frontiercs2')
60
- throw new Error('Usage: /demo frontiercs2');
61
- const { configuration, starter } = await frontierDemo();
62
- signal.throwIfAborted();
63
- return { kind: 'start-run', cwd: starter, prompt: demoGoal, configuration };
64
- },
65
- };
66
49
  const streamedEvents = new Set([
67
50
  'peer.ready', 'peer.claim', 'peer.steer', 'peer.interrupt', 'peer.stop', 'peer.turn-ended', 'team.ready',
68
51
  'peer.review-notice', 'peer.read-patch', 'peer.review', 'candidate.queued', 'candidate.built-on', 'candidate.best', 'train.returned', 'train.unknown', 'final.selected', 'final.returned',
@@ -281,7 +264,6 @@ export default {
281
264
  : { status: 'unknown', requestId: request.requestId };
282
265
  },
283
266
  });
284
- context.emit({ kind: 'trace.request', runDirectory: context.outputDir });
285
267
  status = 'spawning peers';
286
268
  research.event('run.start');
287
269
  const setup = await Promise.allSettled(peerLabels.map(async (label) => {
@@ -1,25 +1,33 @@
1
- # Code quickstart
1
+ # Code SDK example
2
2
 
3
- Prepare an OpenSandbox connection, a Pi or Codex Worker, and a model route using AnySwarm's CLI quickstart. On the Linux host that holds your project, open its directory and run:
3
+ Code runs a coding Agent in a writable Sandbox, verifies a candidate on the Linux
4
+ host and applies authorized edits to the project. Ask the lead Agent to delegate
5
+ a separable task when you want an editor to work in parallel. Between turns,
6
+ Code reconciles edits made by the user and returns conflicting paths for review.
4
7
 
5
- ```sh
6
- anys -u code
7
- anys -u code "Add a test for the empty-input case"
8
- ```
9
-
10
- You can also start `anys` and enter `/code`. Enter sends, Alt+Enter adds a line, Ctrl+C interrupts the current task, and `/quit` closes the team. `/diff` prints the latest completed turn's paths, patch preview and full patch location into the conversation. Use `/agents` for the member roster, `@<editor> <message>` to steer an active editor, and `/stop <editor>` to stop that editor. Answer inline verification confirmations with `/y` or `/n`, and editor questions with `/reply <id> <answer>`. Use `/config` and `/doctor` for setup information and `/trace` for Trace Viewer.
11
-
12
- The main Agent edits and tests a copy of your current project in one writable Sandbox. Follow-up requests reuse its conversation. AnySwarm reconciles your files before each turn, including edits you made between turns. To delegate, write a request such as “Ask a subagent to write the regression test while you fix the implementation.” The main Agent can continue while the child works in a separate Sandbox, then collect and review the result. The host checks the integrated changes before writeback. If an edit conflicts with yours, resolve the reported path before retrying.
13
-
14
- The default configuration reads `ANYSWARM_MODEL_URL`, optional `ANYSWARM_MODEL_TOKEN`, `ANYSWARM_MODEL_ID` and `ANYSWARM_MODEL_PROVIDER`. Code-specific `ANYSWARM_CODE_*` equivalents take precedence. Use `anys -u code --config ./trusted.ts` for an explicit model/Sandbox configuration. The application can ask before running a detected `npm test` or `make test`. Set `check` to an argv array in a trusted config to authorize it for each candidate, or set `check: false` to skip verification. Checks run locally with your permissions in a temporary copy. Code copies a supported existing Node dependency installation into that copy. Install the project's dependencies first if the checker reports an unavailable environment. A failed verification leaves the original project files in place. After a successful task, `/quit` returns 0 when cleanup completes and keeps the report location visible.
15
-
16
- To edit the application itself:
8
+ Prepare OpenSandbox, a supported Pi or Codex Worker and a model route. Export the
9
+ source outside the target project and install its pinned SDK.
17
10
 
18
11
  ```sh
19
- anys eject code --dir ./my-code
12
+ anyswarm eject code --dir ./my-code
20
13
  cd ./my-code
21
14
  npm install
22
- anys run ./project.ts --mode tui --lifetime interactive --cwd /path/to/project
15
+ npm run start -- --cwd /path/to/project --config ./trusted.ts --prompt "Add a test for empty input" --output-dir ./runs
16
+ anyswarm trace --root ./runs
23
17
  ```
24
18
 
25
- The exported package uses the SDK bytes from the installed AnySwarm package. Edit `prompts.ts` or `project.ts` and run the same command again to use your version. Keep the exported source outside the project directory if you do not want its files in the project scope.
19
+ The default configuration reads `ANYSWARM_MODEL_URL`, optional
20
+ `ANYSWARM_MODEL_TOKEN`, `ANYSWARM_MODEL_ID` and `ANYSWARM_MODEL_PROVIDER`.
21
+ Code-specific `ANYSWARM_CODE_*` values take precedence. The example command uses
22
+ an explicit trusted config. Set `check` to an argv array to authorize
23
+ verification, or set `check: false` to skip it. Checks run with the host user's
24
+ permissions in a temporary copy and can reuse a supported Node dependency
25
+ installation. A failed check or writeback conflict retains the original files.
26
+ The Run report includes verification, changed paths and the retained diff.
27
+
28
+ For follow-up turns and questions, import the Harness in an application and
29
+ drive it through `createHarnessSession`, or connect to
30
+ `npm run start -- --mode rpc --lifetime interactive --interaction questions`
31
+ with `HarnessRpcClient`. Send the target directory in the RPC `run` input.
32
+ See [HarnessSession clients](../harness-session/README.md) for the protocol and
33
+ [Code architecture](../../docs/architecture/26-code.md) for writeback rules.
@@ -1,11 +1,11 @@
1
1
  # Code 用户需求
2
2
 
3
- 适用范围见 [#336](https://github.com/AnySwarm/anyswarm/issues/336)。用户在自己的项目目录运行 `anys -u code [任务]`,也可以打开 `anys` 后输入 `/code`。共享界面显示项目、执行器和模型。用户可以回答内联问题、用 `/diff` 查看最近一轮的改动,或继续输入。退出时提供清理结果。
3
+ 适用范围见 [#336](https://github.com/AnySwarm/anyswarm/issues/336)。[#351](https://github.com/AnySwarm/anyswarm/issues/351) 将 Code 保留为进阶 SDK 示例。单次运行接收任务和显式配置,多轮输入、问答、差异和成员控制由 SDK 或 RPC 客户端处理。
4
4
 
5
5
  - 一个会话由一个 Runtime 管理。主 Agent 默认在一个可写的隔离工作区读项目、改代码并运行检查。用户可以在聊天中要求委派,主 Agent 可以和独立子 Agent 同时工作,收取结果并审查。用户可针对任意活跃成员发消息、中断或停止。
6
6
  - 每轮以用户当前目录的内容为起点,包含已跟踪文件的未提交修改和未忽略的新文件。宿主比较主 Agent、已收取的子 Agent 结果和实时工作树,合并后按任务授权写回。用户改动冲突时显示路径并保留原文件。
7
7
  - 用户可见改动文件和实际 diff。宿主监督配置或用户确认的检查,并展示命令、退出码和状态。Node 检查可复用受支持的现有依赖安装,缺失时显示校验环境问题。无命令时显示未验证。校验失败时保留原项目文件。
8
- - `Ctrl+C` 请求中断当前轮,之后可以继续输入。`/quit` 等待资源清理。空闲时在成功任务后退出,清理确认后返回 0。会话收尾保留报告、检查结果、已写入的路径和 Trace。
9
- - `anys eject code` 导出完整 TS 应用。作者能在仓库外直接运行、修改并重新执行其副本。
8
+ - 多轮客户端可以请求中断当前轮,之后继续输入,也可停止整个会话并等待清理。单次运行在任务完成、清理确认后返回 0。会话收尾保留报告、检查结果、已写入的路径和 Trace。
9
+ - `anyswarm eject code` 导出完整 TS 应用。作者能在仓库外直接运行、修改并重新执行其副本。
10
10
 
11
11
  验收使用同一个仓库外安装的候选包。用真实项目覆盖默认单 Agent 两轮编辑、用户明确要求并行委派、中断后继续、验证失败、并行成员控制、退出清理和导出源码。记录每轮文件上传下载字节数、实际容器数、峰值内存和最终检查结果。ProgramBench 使用同一 Code 应用,运行状态和官方评分单独记录。
@@ -15,9 +15,9 @@ npm install --ignore-scripts "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.0}"
15
15
  sdk=node_modules/@anyswarm/core
16
16
  cp -R "$sdk"/examples/harness-session demo
17
17
  cd demo
18
- ../node_modules/.bin/anys run ./sdk.ts /absolute/path/to/project 'Run the direct SDK example'
19
- ../node_modules/.bin/anys run ./rpc.ts /absolute/path/to/project 'Run the RPC example'
20
- ../node_modules/.bin/anys run ./terminal.ts /absolute/path/to/project 'Ask me the two business questions'
18
+ ../node_modules/.bin/anyswarm run ./sdk.ts /absolute/path/to/project 'Run the direct SDK example'
19
+ ../node_modules/.bin/anyswarm run ./rpc.ts /absolute/path/to/project 'Run the RPC example'
20
+ ../node_modules/.bin/anyswarm run ./terminal.ts /absolute/path/to/project 'Ask me the two business questions'
21
21
  ```
22
22
 
23
23
  The SDK and RPC programs answer both questions and send a subsequent input
@@ -116,7 +116,7 @@ The external Service remains running after the Harness closes.
116
116
 
117
117
  [`project.ts`](project.ts) consumes the user's directory and prompt.
118
118
  [`handoff.ts`](handoff.ts) is a separate fixed-payload diagnostic, invoked from
119
- the checkout root with `anys run ./examples/messages/handoff.ts`. It seeds a
119
+ the checkout root with `anyswarm run ./examples/messages/handoff.ts`. It seeds a
120
120
  value in the writer's files, then compares the reader's exported `received.txt`
121
121
  byte for byte. Its report goes under `handoff-runs/` unless `ANYSWARM_SDK_OUTPUT`
122
122
  overrides it. The common project runner has its own input and report handling.
@@ -41,8 +41,8 @@ Set `ANYSWARM_NOTES_IMAGE` to your compatible worker image ID and `ANYSWARM_NOTE
41
41
  The sample uses Pi and the configured common model route by default (`openai` / `gpt-5.4` when model labels are omitted). Common `ANYSWARM_MODEL_*` and `ANYSWARM_EXECUTOR` variables take precedence over scoped Notes variables. To run Codex, set `ANYSWARM_NOTES_EXECUTOR=codex` and `ANYSWARM_NOTES_MODEL_ID` to the model served by your endpoint. `ANYSWARM_NOTES_MODEL_PROVIDER` labels the model and defaults to `openai` for Codex. For a custom configuration module, set `executor` and its `models` mapping. The same Reader thread handles both reader inputs. See the [backend guide](../../docs/architecture/16-pi-opensandbox-backend.md#codex-app-server) for the credential and trace contract.
42
42
 
43
43
  ```sh
44
- node_modules/.bin/anys run "$example/main.ts" --help
45
- node_modules/.bin/anys run "$example/main.ts" "$example/config.ts" > notes-result.json
44
+ node_modules/.bin/anyswarm run "$example/main.ts" --help
45
+ node_modules/.bin/anyswarm run "$example/main.ts" "$example/config.ts" > notes-result.json
46
46
  ```
47
47
 
48
48
  `main.ts` imports Runtime, Service Registry and the configurable OpenSandbox backend from the public package exports. `run-input.ts`, `run-report.ts` and `read-result.ts` are editable host modules. The Harness owns the turn order, the Notes manifest and adapter, the role grants and verification. It uses `followUp` on an idle Agent after subscribing, with one input source and a fresh ID. An unknown or queued submission remains explicit and sends no replacement.
@@ -56,7 +56,7 @@ Read the final CLI report from `notes-result.json`. It contains the Runtime iden
56
56
  ```sh
57
57
  runtime_id=$(node -e 'const fs=require("node:fs"); console.log(JSON.parse(fs.readFileSync("notes-result.json","utf8")).runtimeId)')
58
58
  run_dir=$(node -e 'const fs=require("node:fs"),path=require("node:path"); console.log(path.dirname(JSON.parse(fs.readFileSync("notes-result.json","utf8")).reportPath))')
59
- node_modules/.bin/anys run "$example/main.ts" --result "$run_dir" --runtime-id "$runtime_id"
59
+ node_modules/.bin/anyswarm run "$example/main.ts" --result "$run_dir" --runtime-id "$runtime_id"
60
60
  ```
61
61
 
62
62
  Result inspection reads `harness-report.json` and `runtime.json`, checks both recorded identities, and projects business failure, recorded Core status, per-Agent execution/cleanup, pending count and artifact availability. It reports the Harness result's location without printing its content or interpreting business acceptance. Open the indicated Harness report's `result.verifiedFiles` and reader archive to inspect the actual checked deliverables. A pending receipt remains pending even if another recorded receipt later reports complete. This command reads saved files and does not contact or control a running Runtime.
@@ -39,7 +39,7 @@ process. See the maintained [Mathlib service implementation](../../../docs/archi
39
39
 
40
40
  To run the host without a container after building the checkout, use
41
41
  `npm run service:mathlib-search` from the root, or
42
- `../../../node_modules/.bin/anys run ./main.ts` from this directory.
42
+ `../../../node_modules/.bin/anyswarm run ./main.ts` from this directory.
43
43
  The caller supplies the host token with `MATHLIB_SEARCH_TOKEN`, and configures
44
44
  the endpoint in its own service adapter. The application/operator owns the
45
45
  external provider's lifecycle and persistent data; Runtime close does not remove it.
@@ -56,10 +56,13 @@ Open the completed Run, expand **Service states**, and inspect the Board export.
56
56
  Copy this example from the installed SDK as shown above. Configure OpenSandbox and select an installed Worker with setup or `ANYSWARM_WORKER_IMAGE`. Open the example in a regular terminal and run:
57
57
 
58
58
  ```sh
59
- anys -u ./live.ts 'Watch the persistent Board'
59
+ anyswarm --harness ./live.ts --mode rpc --lifetime interactive
60
60
  ```
61
61
 
62
- Enter two short findings in the composer. Each commit appears in the stream with its row ID, and the status header updates the committed count. Use `/stop` to finish and `/trace` to inspect the saved Run. The example uses SQLite and does not spawn an Agent or call a model. SDK and RPC clients can read the live count, recent IDs and commit times through the Service observation hook. The final export remains available to Trace Viewer after the Harness closes.
62
+ Use a [Harness RPC client](../../harness-session/README.md) to start the Run
63
+ and submit two short findings with its input operation. Each commit emits the
64
+ row ID and updates the committed count. Stop the Session, then inspect its saved
65
+ records with `anyswarm trace`.
63
66
 
64
67
  ## Author a different Service
65
68
 
@@ -52,7 +52,7 @@ The example defaults to a local OpenSandbox lifecycle URL of `http://127.0.0.1:8
52
52
  From `examples/subagents/`, run one task.
53
53
 
54
54
  ```sh
55
- ../../node_modules/.bin/anys run ./main.ts \
55
+ ../../node_modules/.bin/anyswarm run ./main.ts \
56
56
  ./config.ts \
57
57
  'Suggest two checks to make before merging a pull request.'
58
58
  ```
@@ -80,7 +80,7 @@ Install the published SDK or a matching source archive as described above. The e
80
80
  ```sh
81
81
  sdk=node_modules/@anyswarm/core
82
82
  example="$sdk"/examples/subagents
83
- node_modules/.bin/anys run "$example/main.ts" "$example/config.ts" --interactive
83
+ node_modules/.bin/anyswarm run "$example/main.ts" "$example/config.ts" --interactive
84
84
  ```
85
85
 
86
86
  The configured `doctor --smoke` path covers Pi projects. The installed Codex example runs through the same local OpenSandbox provider and its own executor. [Codex startup and capabilities](../../docs/architecture/16-pi-opensandbox-backend.md#codex-app-server)