@anyswarm/core 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/README.md +11 -10
  2. package/deploy/worker/Dockerfile +12 -4
  3. package/dist/deploy/worker/Dockerfile +12 -4
  4. package/dist/examples/README.md +24 -12
  5. package/dist/examples/authoring/README.md +24 -0
  6. package/dist/examples/authoring/business.d.ts +2 -0
  7. package/dist/examples/authoring/business.js +4 -0
  8. package/dist/examples/authoring/config.d.ts +5 -0
  9. package/dist/examples/authoring/config.js +2 -0
  10. package/dist/examples/authoring/eject.json +5 -0
  11. package/dist/examples/authoring/harness.d.ts +4 -0
  12. package/dist/examples/authoring/harness.js +19 -0
  13. package/dist/examples/autoresearch/README.md +33 -0
  14. package/dist/examples/autoresearch/REQUIREMENTS.zh.md +18 -0
  15. package/dist/examples/autoresearch/config.d.ts +51 -0
  16. package/dist/examples/autoresearch/config.js +57 -0
  17. package/dist/examples/autoresearch/demo.d.ts +11 -0
  18. package/dist/examples/autoresearch/demo.js +52 -0
  19. package/dist/examples/autoresearch/eject.json +15 -0
  20. package/dist/examples/autoresearch/frontiercs2.d.ts +87 -0
  21. package/dist/examples/autoresearch/frontiercs2.js +211 -0
  22. package/dist/examples/autoresearch/prepare.d.ts +95 -0
  23. package/dist/examples/autoresearch/prepare.js +257 -0
  24. package/dist/examples/autoresearch/process.d.ts +13 -0
  25. package/dist/examples/autoresearch/process.js +48 -0
  26. package/dist/examples/autoresearch/project.d.ts +115 -0
  27. package/dist/examples/autoresearch/project.js +410 -0
  28. package/dist/examples/autoresearch/research-service.d.ts +106 -0
  29. package/dist/examples/autoresearch/research-service.js +255 -0
  30. package/dist/examples/code/README.md +25 -0
  31. package/dist/examples/code/REQUIREMENTS.zh.md +11 -0
  32. package/dist/examples/code/candidate.d.ts +19 -0
  33. package/dist/examples/code/candidate.js +80 -0
  34. package/dist/examples/code/config.d.ts +32 -0
  35. package/dist/examples/code/config.js +18 -0
  36. package/dist/examples/code/eject.json +5 -0
  37. package/dist/examples/code/project.d.ts +3 -0
  38. package/dist/examples/code/project.js +605 -0
  39. package/dist/examples/code/prompts.d.ts +5 -0
  40. package/dist/examples/code/prompts.js +12 -0
  41. package/dist/examples/code/verification.d.ts +19 -0
  42. package/dist/examples/code/verification.js +268 -0
  43. package/dist/examples/code/worktree.d.ts +17 -0
  44. package/dist/examples/code/worktree.js +233 -0
  45. package/dist/examples/harness-session/README.md +3 -6
  46. package/dist/examples/lead-worker/harness/dynamic-scheduler.d.ts +2 -1
  47. package/dist/examples/lead-worker/harness/dynamic-scheduler.js +5 -2
  48. package/dist/examples/lead-worker/harness/index.d.ts +60 -0
  49. package/dist/examples/lead-worker/harness/index.js +77 -6
  50. package/dist/examples/lead-worker/project.js +2 -2
  51. package/dist/examples/lead-worker/services/board.d.ts +5 -0
  52. package/dist/examples/lead-worker/services/board.js +19 -1
  53. package/dist/examples/messages/README.md +5 -5
  54. package/dist/examples/messages/handoff.d.ts +2 -0
  55. package/dist/examples/messages/handoff.js +5 -1
  56. package/dist/examples/messages/project.js +52 -2
  57. package/dist/examples/notes/README.md +13 -18
  58. package/dist/examples/notes/project.js +67 -6
  59. package/dist/examples/peermesh/harness/router.js +3 -1
  60. package/dist/examples/peermesh/harness/team.d.ts +8 -0
  61. package/dist/examples/peermesh/harness/team.js +13 -0
  62. package/dist/examples/peermesh/project.js +22 -4
  63. package/dist/examples/services/agent-control/README.md +3 -3
  64. package/dist/examples/services/mathlib-search/Dockerfile +4 -2
  65. package/dist/examples/services/mathlib-search/README.md +1 -1
  66. package/dist/examples/services/mcp-managed/README.md +2 -2
  67. package/dist/examples/services/persistent-board/README.md +13 -3
  68. package/dist/examples/services/persistent-board/business.d.ts +7 -0
  69. package/dist/examples/services/persistent-board/business.js +7 -0
  70. package/dist/examples/services/persistent-board/index.js +10 -0
  71. package/dist/examples/services/persistent-board/live.d.ts +3 -0
  72. package/dist/examples/services/persistent-board/live.js +58 -0
  73. package/dist/examples/subagents/README.md +5 -5
  74. package/dist/examples/subagents/business.js +3 -1
  75. package/dist/examples/subagents/harness/controller.d.ts +15 -0
  76. package/dist/examples/subagents/harness/controller.js +181 -32
  77. package/dist/examples/subagents/project.d.ts +2 -0
  78. package/dist/examples/subagents/project.js +43 -34
  79. package/dist/examples/subagents/prompts/prompts.d.ts +1 -0
  80. package/dist/examples/subagents/prompts/prompts.js +3 -0
  81. package/dist/examples/subagents/services/collaboration-service.d.ts +3 -2
  82. package/dist/examples/subagents/services/collaboration-service.js +14 -2
  83. package/dist/examples/substrate/README.md +2 -2
  84. package/dist/examples/substrate/harness/index.d.ts +1 -1
  85. package/dist/examples/substrate/harness/index.js +77 -12
  86. package/dist/examples/substrate/project.js +4 -1
  87. package/dist/examples/super/README.md +40 -0
  88. package/dist/examples/super/actions.d.ts +95 -0
  89. package/dist/examples/super/actions.js +230 -0
  90. package/dist/examples/super/artifact.d.ts +4 -0
  91. package/dist/examples/super/artifact.js +51 -0
  92. package/dist/examples/super/config.d.ts +80 -0
  93. package/dist/examples/super/config.js +83 -0
  94. package/dist/examples/super/coordinator.d.ts +33 -0
  95. package/dist/examples/super/coordinator.js +151 -0
  96. package/dist/examples/super/daemon.d.ts +11 -0
  97. package/dist/examples/super/daemon.js +109 -0
  98. package/dist/examples/super/decisions.d.ts +8 -0
  99. package/dist/examples/super/decisions.js +52 -0
  100. package/dist/examples/super/eject.json +5 -0
  101. package/dist/examples/super/execution.d.ts +11 -0
  102. package/dist/examples/super/execution.js +136 -0
  103. package/dist/examples/super/github.d.ts +62 -0
  104. package/dist/examples/super/github.js +269 -0
  105. package/dist/examples/super/inbox.d.ts +162 -0
  106. package/dist/examples/super/inbox.js +284 -0
  107. package/dist/examples/super/location.d.ts +5 -0
  108. package/dist/examples/super/location.js +64 -0
  109. package/dist/examples/super/outbox.d.ts +5 -0
  110. package/dist/examples/super/outbox.js +103 -0
  111. package/dist/examples/super/project.d.ts +111 -0
  112. package/dist/examples/super/project.js +253 -0
  113. package/dist/examples/super/prompts.d.ts +3 -0
  114. package/dist/examples/super/prompts.js +25 -0
  115. package/dist/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
  116. package/dist/examples/taskpool/harness/controller.d.ts +35 -6
  117. package/dist/examples/taskpool/harness/controller.js +73 -7
  118. package/dist/examples/taskpool/project.js +18 -2
  119. package/dist/scripts/anyswarm-applications.d.ts +19 -0
  120. package/dist/scripts/anyswarm-applications.js +19 -0
  121. package/dist/scripts/anyswarm-arguments.d.ts +35 -5
  122. package/dist/scripts/anyswarm-arguments.js +87 -23
  123. package/dist/scripts/anyswarm-author.d.ts +5 -0
  124. package/dist/scripts/anyswarm-author.js +24 -0
  125. package/dist/scripts/anyswarm-eject.d.ts +11 -0
  126. package/dist/scripts/anyswarm-eject.js +164 -0
  127. package/dist/scripts/anyswarm-harnesses.d.ts +2 -0
  128. package/dist/scripts/anyswarm-harnesses.js +31 -0
  129. package/dist/scripts/anyswarm-installation.js +19 -13
  130. package/dist/scripts/anyswarm-launch.d.ts +37 -0
  131. package/dist/scripts/anyswarm-launch.js +86 -0
  132. package/dist/scripts/anyswarm-project.d.ts +12 -2
  133. package/dist/scripts/anyswarm-project.js +121 -20
  134. package/dist/scripts/anyswarm-source-runner.d.ts +1 -0
  135. package/dist/scripts/anyswarm-source-runner.js +232 -0
  136. package/dist/scripts/anyswarm-tui-config.d.ts +36 -0
  137. package/dist/scripts/anyswarm-tui-config.js +189 -0
  138. package/dist/scripts/anyswarm-tui-session.d.ts +66 -0
  139. package/dist/scripts/anyswarm-tui-session.js +304 -0
  140. package/dist/scripts/anyswarm-tui-terminal.d.ts +41 -0
  141. package/dist/scripts/anyswarm-tui-terminal.js +154 -0
  142. package/dist/scripts/anyswarm-tui.d.ts +2 -0
  143. package/dist/scripts/anyswarm-tui.js +1012 -0
  144. package/dist/scripts/anyswarm.js +47 -2
  145. package/dist/scripts/build-provenance.json +1 -0
  146. package/dist/scripts/build.js +7 -1
  147. package/dist/scripts/generate-architecture-api.js +2 -0
  148. package/dist/scripts/generate-architecture-prompts.js +24 -2
  149. package/dist/scripts/local-environment.d.ts +6 -1
  150. package/dist/scripts/local-environment.js +52 -16
  151. package/dist/scripts/local-setup-smoke.js +3 -2
  152. package/dist/scripts/local-setup-worker.d.ts +1 -1
  153. package/dist/scripts/local-setup-worker.js +15 -6
  154. package/dist/scripts/local-setup.d.ts +2 -2
  155. package/dist/scripts/local-setup.js +72 -12
  156. package/dist/scripts/opensandbox-agent-worker.js +2 -2
  157. package/dist/scripts/pack-release.d.ts +1 -0
  158. package/dist/scripts/pack-release.js +63 -0
  159. package/dist/scripts/pi-session-bridge.js +11 -3
  160. package/dist/scripts/run-harness.js +3 -1
  161. package/dist/scripts/setup-bootstrap.js +43 -6
  162. package/dist/src/core/allocation-ledger.js +4 -3
  163. package/dist/src/core/host-identity.d.ts +2 -0
  164. package/dist/src/core/host-identity.js +11 -0
  165. package/dist/src/core/index.d.ts +4 -2
  166. package/dist/src/core/index.js +12 -4
  167. package/dist/src/core/mcp-service.js +2 -2
  168. package/dist/src/core/runtime-management.d.ts +6 -0
  169. package/dist/src/core/runtime-management.js +24 -0
  170. package/dist/src/core/sandbox/executor-driver.d.ts +4 -2
  171. package/dist/src/core/sandbox/executor-driver.js +12 -14
  172. package/dist/src/core/sandbox/local-executor.d.ts +13 -1
  173. package/dist/src/core/sandbox/local-executor.js +69 -19
  174. package/dist/src/core/sandbox/local-worker.js +32 -21
  175. package/dist/src/core/sandbox/opensandbox-backend.d.ts +2 -0
  176. package/dist/src/core/sandbox/opensandbox-backend.js +36 -11
  177. package/dist/src/core/sandbox/sandbox-connection.d.ts +2 -0
  178. package/dist/src/core/sandbox/sandbox-connection.js +14 -6
  179. package/dist/src/core/service-live-state.d.ts +14 -0
  180. package/dist/src/core/service-live-state.js +161 -0
  181. package/dist/src/core/service-observation-types.d.ts +21 -1
  182. package/dist/src/core/service-process.d.ts +1 -1
  183. package/dist/src/core/service-process.js +45 -4
  184. package/dist/src/core/service-types.d.ts +5 -1
  185. package/dist/src/core/services.d.ts +1 -1
  186. package/dist/src/core/services.js +8 -3
  187. package/dist/src/core/types.d.ts +3 -0
  188. package/dist/src/core/worker-image.js +3 -3
  189. package/dist/src/harness/harness-session-types.d.ts +10 -0
  190. package/dist/src/harness/harness-session.js +42 -5
  191. package/dist/src/harness/project-harness.d.ts +13 -1
  192. package/dist/src/harness/project-harness.js +36 -10
  193. package/dist/src/harness/project-input.js +81 -15
  194. package/dist/src/harness/project-rpc-client.d.ts +1 -0
  195. package/dist/src/harness/project-rpc-client.js +5 -0
  196. package/dist/src/harness/project-rpc.d.ts +8 -2
  197. package/dist/src/harness/project-rpc.js +31 -7
  198. package/dist/src/harness/project-runtime.js +3 -1
  199. package/dist/src/harness/typescript-loader.d.ts +2 -0
  200. package/dist/src/harness/typescript-loader.js +41 -0
  201. package/dist/src/trace-viewer/public/app.js +6 -5
  202. package/dist/src/trace-viewer/reader.mjs +42 -2
  203. package/docs/INDEX.md +3 -1
  204. package/docs/architecture/00-overview.md +1 -1
  205. package/docs/architecture/01-agent-core.md +1 -1
  206. package/docs/architecture/06-observability-experiments.md +1 -1
  207. package/docs/architecture/07-run-configuration.md +18 -12
  208. package/docs/architecture/08-prompts.md +22 -0
  209. package/docs/architecture/10-service-api-reference.md +53 -18
  210. package/docs/architecture/11-storage-reference.md +18 -1
  211. package/docs/architecture/12-code-coverage.md +148 -84
  212. package/docs/architecture/15-core-runtime.md +8 -0
  213. package/docs/architecture/16-pi-opensandbox-backend.md +5 -5
  214. package/docs/architecture/17-harness-reporting.md +1 -1
  215. package/docs/architecture/19-substrate-harness.md +28 -1
  216. package/docs/architecture/20-lead-worker-harness.md +34 -1
  217. package/docs/architecture/22-website.md +5 -3
  218. package/docs/architecture/23-project-harness.md +124 -5
  219. package/docs/architecture/24-runtime-recovery.md +10 -3
  220. package/docs/architecture/25-foreground-tui.md +51 -0
  221. package/docs/architecture/26-code.md +39 -0
  222. package/docs/architecture/27-personal.md +43 -0
  223. package/docs/architecture/28-autoresearch.md +31 -0
  224. package/docs/architecture/INDEX.md +4 -0
  225. package/docs/architecture/prompts/08-lead-worker-harness.md +4 -2
  226. package/docs/architecture/prompts/08-subagents-harness.md +21 -0
  227. package/docs/architecture/prompts/21-personal.md +44 -0
  228. package/docs/architecture/prompts/22-autoresearch.md +63 -0
  229. package/docs/architecture/prompts/26-code.md +55 -0
  230. package/docs/architecture/prompts/source-manifest.json +152 -33
  231. package/docs/architecture/source-map.json +489 -21
  232. package/docs/designs/core-harness/06-project-harness.md +13 -2
  233. package/docs/designs/core-harness/README.md +5 -0
  234. package/docs/en/agents.md +1 -1
  235. package/docs/en/build-your-harness.md +3 -5
  236. package/docs/en/changelog.md +13 -4
  237. package/docs/en/first-harness.md +8 -11
  238. package/docs/en/harnesses/lead-worker.md +1 -1
  239. package/docs/en/harnesses/peermesh.md +2 -2
  240. package/docs/en/harnesses/subagents.md +2 -2
  241. package/docs/en/harnesses/substrate.md +4 -4
  242. package/docs/en/harnesses/taskpool.md +2 -2
  243. package/docs/en/latest.md +12 -123
  244. package/docs/en/overview.md +1 -1
  245. package/docs/en/quickstart.md +40 -16
  246. package/docs/en/reference/api.md +14 -4
  247. package/docs/en/reference/cli.md +58 -14
  248. package/docs/en/runtime.md +2 -2
  249. package/docs/en/services.md +4 -0
  250. package/docs/third-party-notices.md +1 -0
  251. package/docs/workflows/development.md +17 -12
  252. package/docs/workflows/release-and-docs-versioning.md +76 -0
  253. package/docs/zh/agents.md +1 -1
  254. package/docs/zh/build-your-harness.md +3 -5
  255. package/docs/zh/changelog.md +13 -4
  256. package/docs/zh/first-harness.md +8 -11
  257. package/docs/zh/harnesses/lead-worker.md +1 -1
  258. package/docs/zh/harnesses/peermesh.md +2 -2
  259. package/docs/zh/harnesses/subagents.md +2 -2
  260. package/docs/zh/harnesses/substrate.md +4 -4
  261. package/docs/zh/harnesses/taskpool.md +2 -2
  262. package/docs/zh/latest.md +13 -124
  263. package/docs/zh/overview.md +1 -1
  264. package/docs/zh/quickstart.md +40 -16
  265. package/docs/zh/reference/api.md +14 -4
  266. package/docs/zh/reference/cli.md +58 -14
  267. package/docs/zh/runtime.md +2 -2
  268. package/docs/zh/services.md +4 -0
  269. package/examples/README.md +24 -12
  270. package/examples/authoring/README.md +24 -0
  271. package/examples/authoring/business.ts +4 -0
  272. package/examples/authoring/config.ts +2 -0
  273. package/examples/authoring/eject.json +5 -0
  274. package/examples/authoring/harness.ts +21 -0
  275. package/examples/autoresearch/README.md +33 -0
  276. package/examples/autoresearch/REQUIREMENTS.zh.md +18 -0
  277. package/examples/autoresearch/config.ts +90 -0
  278. package/examples/autoresearch/demo.ts +55 -0
  279. package/examples/autoresearch/eject.json +15 -0
  280. package/examples/autoresearch/frontiercs2.ts +237 -0
  281. package/examples/autoresearch/prepare.ts +267 -0
  282. package/examples/autoresearch/process.ts +50 -0
  283. package/examples/autoresearch/project.ts +397 -0
  284. package/examples/autoresearch/research-service.ts +302 -0
  285. package/examples/code/README.md +25 -0
  286. package/examples/code/REQUIREMENTS.zh.md +11 -0
  287. package/examples/code/candidate.ts +89 -0
  288. package/examples/code/config.ts +19 -0
  289. package/examples/code/eject.json +5 -0
  290. package/examples/code/project.ts +581 -0
  291. package/examples/code/prompts.ts +16 -0
  292. package/examples/code/verification.ts +239 -0
  293. package/examples/code/worktree.ts +188 -0
  294. package/examples/harness-session/README.md +3 -6
  295. package/examples/lead-worker/harness/dynamic-scheduler.ts +6 -3
  296. package/examples/lead-worker/harness/index.ts +61 -6
  297. package/examples/lead-worker/project.ts +2 -2
  298. package/examples/lead-worker/services/board.ts +14 -1
  299. package/examples/messages/README.md +5 -5
  300. package/examples/messages/handoff.ts +6 -2
  301. package/examples/messages/project.ts +47 -2
  302. package/examples/notes/README.md +13 -18
  303. package/examples/notes/project.ts +57 -9
  304. package/examples/peermesh/harness/router.ts +2 -2
  305. package/examples/peermesh/harness/team.ts +11 -0
  306. package/examples/peermesh/project.ts +19 -4
  307. package/examples/services/agent-control/README.md +3 -3
  308. package/examples/services/mathlib-search/Dockerfile +4 -2
  309. package/examples/services/mathlib-search/README.md +1 -1
  310. package/examples/services/mcp-managed/README.md +2 -2
  311. package/examples/services/persistent-board/README.md +13 -3
  312. package/examples/services/persistent-board/business.ts +10 -0
  313. package/examples/services/persistent-board/index.ts +10 -0
  314. package/examples/services/persistent-board/live.ts +54 -0
  315. package/examples/subagents/README.md +5 -5
  316. package/examples/subagents/business.ts +3 -1
  317. package/examples/subagents/harness/controller.ts +161 -29
  318. package/examples/subagents/project.ts +47 -33
  319. package/examples/subagents/prompts/prompts.ts +4 -0
  320. package/examples/subagents/services/collaboration-service.ts +14 -2
  321. package/examples/substrate/README.md +2 -2
  322. package/examples/substrate/harness/index.ts +67 -11
  323. package/examples/substrate/project.ts +5 -1
  324. package/examples/super/README.md +40 -0
  325. package/examples/super/actions.ts +196 -0
  326. package/examples/super/artifact.ts +56 -0
  327. package/examples/super/config.ts +95 -0
  328. package/examples/super/coordinator.ts +158 -0
  329. package/examples/super/daemon.ts +84 -0
  330. package/examples/super/decisions.ts +46 -0
  331. package/examples/super/eject.json +5 -0
  332. package/examples/super/execution.ts +131 -0
  333. package/examples/super/github.ts +242 -0
  334. package/examples/super/inbox.ts +306 -0
  335. package/examples/super/location.ts +54 -0
  336. package/examples/super/outbox.ts +97 -0
  337. package/examples/super/project.ts +227 -0
  338. package/examples/super/prompts.ts +27 -0
  339. package/examples/taskpool/deploy/service-hosts/Dockerfile +4 -2
  340. package/examples/taskpool/harness/controller.ts +59 -7
  341. package/examples/taskpool/project.ts +18 -2
  342. package/npm-shrinkwrap.development.json +2199 -0
  343. package/npm-shrinkwrap.json +86 -1920
  344. package/package.development.json +92 -0
  345. package/package.json +13 -7
  346. package/scripts/anyswarm-applications.ts +39 -0
  347. package/scripts/anyswarm-arguments.ts +94 -28
  348. package/scripts/anyswarm-author.ts +25 -0
  349. package/scripts/anyswarm-eject.ts +145 -0
  350. package/scripts/anyswarm-harnesses.ts +27 -0
  351. package/scripts/anyswarm-installation.ts +19 -13
  352. package/scripts/anyswarm-launch.ts +108 -0
  353. package/scripts/anyswarm-project.ts +114 -21
  354. package/scripts/anyswarm-source-runner.ts +203 -0
  355. package/scripts/anyswarm-tui-config.ts +174 -0
  356. package/scripts/anyswarm-tui-session.ts +295 -0
  357. package/scripts/anyswarm-tui-terminal.ts +147 -0
  358. package/scripts/anyswarm-tui.ts +912 -0
  359. package/scripts/anyswarm.ts +43 -2
  360. package/scripts/build.ts +8 -1
  361. package/scripts/generate-architecture-api.ts +2 -0
  362. package/scripts/generate-architecture-prompts.ts +35 -2
  363. package/scripts/local-environment.ts +55 -17
  364. package/scripts/local-setup-smoke.ts +3 -2
  365. package/scripts/local-setup-worker.ts +17 -7
  366. package/scripts/local-setup.ts +66 -13
  367. package/scripts/opensandbox-agent-worker.ts +2 -2
  368. package/scripts/pack-release.ts +67 -0
  369. package/scripts/pi-session-bridge.ts +10 -2
  370. package/scripts/run-harness.ts +3 -1
  371. package/scripts/setup-bootstrap.ts +41 -6
  372. package/src/core/allocation-ledger.ts +5 -3
  373. package/src/core/host-identity.ts +11 -0
  374. package/src/core/index.ts +12 -6
  375. package/src/core/mcp-service.ts +2 -2
  376. package/src/core/runtime-management.ts +22 -0
  377. package/src/core/sandbox/executor-driver.ts +15 -18
  378. package/src/core/sandbox/local-executor.ts +65 -19
  379. package/src/core/sandbox/local-worker.ts +29 -21
  380. package/src/core/sandbox/opensandbox-backend.ts +36 -11
  381. package/src/core/sandbox/sandbox-connection.ts +14 -5
  382. package/src/core/service-live-state.ts +156 -0
  383. package/src/core/service-observation-types.ts +23 -1
  384. package/src/core/service-process.ts +36 -3
  385. package/src/core/service-types.ts +3 -1
  386. package/src/core/services.ts +8 -3
  387. package/src/core/types.ts +3 -0
  388. package/src/core/worker-image.ts +3 -3
  389. package/src/harness/harness-session-types.ts +13 -1
  390. package/src/harness/harness-session.ts +40 -7
  391. package/src/harness/project-harness.ts +36 -10
  392. package/src/harness/project-input.ts +73 -15
  393. package/src/harness/project-rpc-client.ts +5 -0
  394. package/src/harness/project-rpc.ts +29 -8
  395. package/src/harness/project-runtime.ts +2 -1
  396. package/src/harness/typescript-loader.ts +37 -0
  397. package/src/trace-viewer/public/app.js +6 -5
  398. package/src/trace-viewer/reader.mjs +42 -2
@@ -1,5 +1,7 @@
1
1
  # 项目 Harness 的共同入口
2
2
 
3
+ [#334](https://github.com/AnySwarm/anyswarm/issues/334) 以 [45775d7 设计修订](https://github.com/AnySwarm/anyswarm/tree/45775d7312e62a791ab8a097c5e7715dc3c9d548/docs/designs/core-harness) 为基线,替代 #280 的冲突条款。已批准的入口使用同义的 `anys` 和 `anyswarm`,交互终端按 [#344 最新决定](https://github.com/AnySwarm/anyswarm/issues/344) 进入单页流式 TUI,使用 `/use` 或 `-u` 选择 Harness,业务命令通过 Slash 路由。Run 拥有者可以控制任意已登记成员,动作以 Agent ID 和 requestId 标识,Harness 负责同步任务与生命周期。Service 显式提供独立的只读实时状态。作者以 TypeScript 源码和配置为入口,发行包继续使用构建产物,显式 JS/MJS 入口保持兼容。三应用用同一个源码导出机制,业务代码及导出清单分别由应用工单交付。安装包、PTY、成员控制、状态变化和导出后的修改验证按 #334 验收。
4
+
3
5
  本页记录随 [#257](https://github.com/AnySwarm/anyswarm/issues/257) 实施 PR 一起评审的共同入口合同;当前实现见 [Project Harness](../../architecture/23-project-harness.md),验收状态由原 Issue/PR 跟踪。Core 文件、事件和停止合同以 [#255](https://github.com/AnySwarm/anyswarm/issues/255) 的最终实现版本为准。仓库的 [Architecture](../../architecture/INDEX.md) 说明已实现的行为。
4
6
 
5
7
  ## #281 作者合同与可恢复的交互
@@ -13,6 +15,10 @@
13
15
 
14
16
  当前实现、预算和失败语义见 [Harness 生命周期](../../architecture/23-project-harness.md)。两种 Pi 及包外候选的验收归 #281。
15
17
 
18
+ ## #337 AutoResearch
19
+
20
+ [#337](https://github.com/AnySwarm/anyswarm/issues/337) 采用 [45775d7 的 Core 和 Harness 合同](https://github.com/AnySwarm/anyswarm/tree/45775d7312e62a791ab8a097c5e7715dc3c9d548/docs/designs/core-harness)。demo 使用四个平级 Kimi K3 成员,成员自行认领方向、交流、复核与采用候选。宿主负责共享预算、可信评测和收尾。后续 [#344](https://github.com/AnySwarm/anyswarm/issues/344) 统一终端和 Slash 入口,终端保留轻量活动与成员控制,Trace Viewer 展示完整研究记录。自定义 evaluator 配置与正式 benchmark 适配复用同一 Harness。包外、正式评测和资源验收沿用 #337。[AutoResearch 实现](../../architecture/28-autoresearch.md)
21
+
16
22
  ## 模块与路径
17
23
 
18
24
  ```ts
@@ -21,7 +27,7 @@ type HarnessInput = { cwd: string; prompt: string };
21
27
 
22
28
  普通命令从启动目录解析相对 `--cwd`、模块路径和包名。省略 `--cwd` 时使用启动目录。解析得到的绝对项目路径和 prompt 原文构成此次任务。模型、Sandbox、Service、并发、期限和输出位置由运行配置提供。
23
29
 
24
- 第一版模块默认导出包含 `apiVersion: 1`、`id` 和 `run(context)` 的对象。加载器先解析内置名、显式本地 ESM 文件或从启动目录解析的已安装包入口,并校验模块形状和版本。模块使用自身的 `import.meta.url` 解析附带资源,导入时保持无运行分配、无终端 I/O。CLI 与模块使用 Node 的已构建 JavaScript 运行。
30
+ 模块默认导出包含 `apiVersion: 1`、`id` 和 `run(context)` 的对象。加载器先解析内置名、显式本地 TypeScript 或 ESM 文件,或从启动目录解析已安装包入口,再校验模块形状和版本。模块使用自身的 `import.meta.url` 解析附带资源,导入时保持无运行分配、无终端 I/O。安装后的 CLI 运行编译产物,显式作者入口支持本地多文件 TypeScript。
25
31
 
26
32
  应用层宿主为 `run` 提供任务、固定初始树及其摘要、运行配置、Run ID、输出目录、AbortSignal 和状态及事件上报函数。Harness 选择用户任务的接收者和文件版本,创建 Runtime 与协作设施,并返回业务、产物和资源回执。Host 保存公共结果和报告。二者通过 AbortSignal 请求停止,资源由创建它的一方收尾。
27
33
 
@@ -32,7 +38,7 @@ type HarnessInput = { cwd: string; prompt: string };
32
38
  1. Host 校验项目目录,选择 Run 输出目录。默认位置在项目外。显式置于项目内的 Run 目录从本次捕获范围排除。
33
39
  2. Git 项目枚举选定目录内实际存在的已跟踪文件和未被忽略的未跟踪文件,读取当前工作树字节。非 Git 项目枚举普通文件。Git 管理路径排除,普通隐藏文件参与相同的选择。
34
40
  3. 按 Core FileTree 校验归一化路径、对象类型、模式、原始字节与配额。使用根目录约束和文件打开前后检查抵御路径替换,在检测到源发生变化时有界重试或明确失败。选定范围内的 Gitlink 报出路径并拒绝。已加载且满足配额的 Git LFS 文件按当前字节读取,尚未加载的 LFS 指针报出路径并拒绝。空目录按 FileTree 规则没有条目。捕获设总时限、路径深度和遍历条目上限。捕获记录包括选择规则、文件数量、字节量和总摘要,并保存每个文件的相对路径、字节量、模式和摘要。目录遍历可以检测到具体变化,整个工作树在遍历期间仍可能发生并发修改。
35
- 4. Harness 每次创建项目 Agent 时显式传入选择的树及版本来源。Core 安装到 Sandbox 的 `/workspace/project` 后才允许首轮任务。初始树捕获一次。后续成员使用它或明确选定的固定业务版本。正常运行中的写入留在 Agent 的私有工作目录,结果保存至 Run 输出目录。
41
+ 4. Harness 每次创建项目 Agent 时显式传入选择的树及版本来源。Core 安装到 Sandbox 的 `/workspace/project` 后才允许首轮任务。初始树捕获一次。后续成员使用它或明确选定的固定业务版本。运行中的成员写入留在私有工作目录。结果保存至 Run 输出目录。Code 可按同一规则重新捕获用户目录,用于后续轮次及候选合并。
36
42
 
37
43
  Team Git 使用同一树初始化固定提交,以单次提交保存字节和模式。Agent 在首轮执行前已有该版本的项目文件。Git 初始化在已填充的目录中建立与固定版本一致的 Git 索引、远端和成员分支,保留现有项目字节。Role 脚本及控制状态存放在运行设施路径。
38
44
 
@@ -42,6 +48,7 @@ Team Git 使用同一树初始化固定提交,以单次提交保存字节和
42
48
 
43
49
  | 控制 | 行为 |
44
50
  | --- | --- |
51
+ | Code | [#336](https://github.com/AnySwarm/anyswarm/issues/336) 默认由可写 Root 在隔离项目副本中直接编辑。用户用自然语言要求委派时,Root 可在本轮最多启动两个独立子 Agent,并收取结果。宿主合并、验证并把授权改动写回当前项目。入口、状态及失败行为见 [Code Architecture](../../architecture/26-code.md)。 |
45
52
  | `run` | RPC 从请求取得任务。复用相同 ID 与参数返回原接纳回执。改参冲突,另一启动请求被拒绝。 |
46
53
  | `status` | 查询当前宿主、已知 Agent 和业务状态。启动前、启动中、运行、停止中与终态分别记录。 |
47
54
  | `input` | 根据 Harness 声明和运行状态路由,串行接纳,保留原请求身份和实际回执。 |
@@ -67,3 +74,7 @@ Harness 在异步捕获、设施或 Agent 创建返回后复核停止状态。
67
74
  ## 验证方式
68
75
 
69
76
  CLI、RPC、Worker 和安装后的调用路径执行 [#257 的 A1–A12](https://github.com/AnySwarm/anyswarm/issues/257)。以两组不同的目录内容和 prompt 验证任务确实改变,并在 Sandbox 核对实际 cwd、字节和模式。失败测试覆盖安装前后、等待中与停止后的创建和输入竞态。以同一个候选 tarball 在 checkout 外测试内置、显式 ESM 文件和已安装包入口。五个主要 Harness 各验证一次有界真实模型协作及其产物和收尾,Notes 与 Messages 验证真实 Service 交接。结果记录绑定候选提交、包摘要和 Worker 版本。
77
+
78
+ ## Personal 后台应用
79
+
80
+ [#338](https://github.com/AnySwarm/anyswarm/issues/338) 和 [#340 的 owner 决定](https://github.com/AnySwarm/anyswarm/pull/340#issuecomment-7346879555) 在 [45775d7 版入口设计](https://github.com/AnySwarm/anyswarm/blob/45775d7312e62a791ab8a097c5e7715dc3c9d548/docs/designs/core-harness/06-project-harness.md) 基础上增加应用拥有的后台生命周期。统一流式 TUI 通过 `observe` 连接既有 Session,Slash Action 提供启动、查询和单笔审批。退出观察客户端后后台继续运行。用户和 Inbox 把业务输入交给 Router。Router 在一个 Runtime 中调度 Worker 和 Reviewer,应用负责来源授权、持久化、工作队列、按任务发布和外部回复。验收通过候选安装包完成真实来源、实际产物、原会话回执及后续修改。详见 [Personal 实现手册](../../architecture/27-personal.md)。
@@ -112,3 +112,8 @@ TaskPool 现有宿主注入 `snapshotProject` 和已支持的公共 Workspace、
112
112
  [#273](https://github.com/AnySwarm/anyswarm/issues/273) 在 #272 的统一 SDK 接入上增加 Kubernetes 部署、资源账本、受限恢复、长轮询和分级验证。核查基线为 `main@b747b89affd2931863c156fc64e70a29f7ba13c9`;本轮 owner 允许 #273 草稿叠加在 #272 实施分支上。该决定不改变一票一个完整 PR,也不授权合并或大规模实验。
113
113
 
114
114
  当前恢复实现采用同主机、同 OS boot 的独占 SQLite writer,拒绝无法证明旧 Controller 已失权的跨节点接管。应用负责可验证的 Harness 和 Service 重建;动态 Service 必须重新解析适配器。关闭意图、未知资源、原始输入身份、事件游标和有限保留截止时间均需持久化。节点 API 404 不证明旧进程停止。实现说明见 [Architecture](../../architecture/24-runtime-recovery.md)。后续 owner 决定将大于等于 32 个 Sandbox 的验证改为 mock API 模拟 Agent,重点验证 Sandbox 的分配、容量占用、游标、输入重放、故障收敛与回收。32/128/1,024 档通过本机 HTTP 模拟外部 Lifecycle、Execd 和 Agent API,不启动 VM、Pod 或真实执行器;CLI 在这些档位拒绝真实集群路径。2/8 档保留至少两个独立 worker VM 上的真实 Worker 闭环、故障、时延与对账验收。模拟档的结果只建立软件合同证据。owner 已授权本轮有界 2/8 档实机验收由执行者自行完成。后续大规模实机实验仍须获得 owner 批准。
115
+
116
+
117
+ ### Local executor version selection
118
+
119
+ For [#339](https://github.com/AnySwarm/anyswarm/issues/339), the owner approved following the selected installed Pi or Codex release by default and allowing an exact user-selected version. The local Worker must use that release for its native Linux platform. Executable identity, guest version, session readiness and the controlled smoke establish compatibility. These requirements supersede the earlier fixed version selection for this path. [Current implementation](../../architecture/07-run-configuration.md#executor-and-file-policy-selection)
package/docs/en/agents.md CHANGED
@@ -179,7 +179,7 @@ To cap automatic context compactions (for example, stopping an Agent before a 4t
179
179
  ### Session events and runnable example
180
180
 
181
181
  - **Session event stream**: Subscribe to `runtime.onEvent()` before sending work. Session events arrive as `{ type: 'session', agentId, event }`. Streaming `messageStart`, `textDelta`, and `messageEnd` events share a `messageId` (accumulate deltas per message and content block, then replace with the final `messageEnd` payload); `toolActivity` lists currently running tool calls. Session totals and current context usage are reported separately (forked history can contribute to session totals), and cost is `null` when model pricing is unconfigured.
182
- - **Runnable example**: See `examples/agent-session.ts` for a complete program demonstrating the 3-compaction stop policy, `append`/`nextTurn` context injection, state/stats/message inspection, and shutdown receipts. After building, run `node dist/examples/agent-session.js /absolute/config.mjs worker 'Your prompt'` (the config module default-exports `CreateRuntimeOptions` with a 120s work window and 30s cleanup window).
182
+ - **Runnable example**: See `examples/agent-session.ts` for a complete program demonstrating the 3-compaction stop policy, `append`/`nextTurn` context injection, state/stats/message inspection, and shutdown receipts. Run `anys run ./examples/agent-session.ts /absolute/config.ts worker 'Your prompt'` (the config module default-exports `CreateRuntimeOptions` with a 120s work window and 30s cleanup window).
183
183
 
184
184
  ---
185
185
 
@@ -9,16 +9,15 @@ This guide uses the same installed SDK and public Harness interface as the [firs
9
9
 
10
10
  ## Install the example
11
11
 
12
- Follow [first Harness setup](first-harness.md#2-install-and-connect) in an empty directory to install the published SDK or a verified candidate archive, prepare the Worker and configure a streaming Responses endpoint. Copy the sources and compiler configuration from that installed SDK.
12
+ Follow [first Harness setup](first-harness.md#2-install-and-connect) in an empty directory to install the verified source archive, prepare the Worker and configure a streaming Responses endpoint. Copy the TypeScript sources from that installed SDK.
13
13
 
14
14
  ```bash
15
15
  sdk=node_modules/@anyswarm/core
16
16
  example="$sdk"/examples
17
17
  cp "$example"/parallel-swarm/{board.ts,board-service.ts,harness.ts} .
18
- cp "$example"/first-harness/tsconfig.json .
19
18
  ```
20
19
 
21
- Use a separate directory for this Harness if you already copied First Harness sources elsewhere. Keep the installed SDK, its copied examples and compiler configuration together. To edit current repository sources, install their matching [source archive](../../examples/README.md#run-an-example-from-its-directory) before copying them.
20
+ Use a separate directory for this Harness if you already copied First Harness sources elsewhere. Keep the installed SDK and its copied TypeScript examples together. To edit current repository sources, install their matching [source archive](../../examples/README.md#run-an-example-from-its-directory) before copying them.
22
21
 
23
22
  ## Share findings through a Service
24
23
 
@@ -33,10 +32,9 @@ The scheduler must reserve each Agent’s input for the duration of its turn. In
33
32
  ## Run it and inspect the report
34
33
 
35
34
  ```bash
36
- ./node_modules/.bin/tsc
37
35
  mkdir -p input
38
36
  printf 'export const cache = new Map<string, string>();\n' > input/cache.ts
39
- ./node_modules/.bin/anyswarm --harness ./dist/harness.js --cwd ./input \
37
+ ./node_modules/.bin/anys run ./harness.ts --cwd ./input \
40
38
  --prompt 'Review cache.ts for resource risks and publish concrete findings.' --output-dir ./runs
41
39
  ./node_modules/.bin/anyswarm trace --root ./runs
42
40
  ```
@@ -5,16 +5,25 @@ section: RELEASES
5
5
  order: 16
6
6
  ---
7
7
 
8
- All notable changes to **AnySwarm** (`@anyswarm/core`) are tracked here and in the repository's [`CHANGELOG.md`](../../CHANGELOG.md). For a quick highlight tour on main, see [Releases and main updates](latest.md).
8
+ All notable changes to **AnySwarm** (`@anyswarm/core`) are tracked here and in the repository's [`CHANGELOG.md`](../../CHANGELOG.md). For the current install commands, see [Releases](latest.md).
9
+
10
+ ## v0.5.1
11
+
12
+ - AutoResearch runs four equal Kimi K3 peers on the official FrontierCS-2 demo and shows research activity in the terminal stream and in live Trace. Configure a trusted evaluator for your project or export the editable Harness. [CLI reference](reference/cli.md#autoresearch). End-to-end acceptance on the default Kimi K3 route is tracked in [#337](https://github.com/AnySwarm/anyswarm/issues/337).
13
+ - Personal receives GitHub requests in a detached Router-led Harness with inline decisions and per-work Draft PR approval.
14
+ - Native macOS setup with Docker Desktop uses the selected Pi or Codex installation and supports exact version pins.
15
+ - On Linux, run `anys -u code` to edit the current project with one Agent and delegate in chat when needed. Inspect patches and answer questions in the shared terminal, or export the application with `anys eject code`. [CLI reference](reference/cli.md)
16
+ - The installed `anys` alias opens the same streaming composer as `anyswarm`, with generic Harness selection, inline decisions and per-member controls. `anys run` loads TypeScript sources and `anys eject example` exports an editable Harness with its SDK candidate. [CLI reference](reference/cli.md).
17
+ - The homepage offers global npm and shell installation for the CLI and links to SDK installation separately. The public package lock excludes checkout-only dependencies. [Quickstart](quickstart.md#1-install-anyswarm).
9
18
 
10
19
  ## v0.5.0
11
20
 
12
- - Source builds produce `@anyswarm/core`. Update the project dependency and imports together. The first managed CLI upgrade across the package rename uses the official installer with the existing prefix.
21
+ - The SDK is available on npm as [`@anyswarm/core@0.5.0`](https://www.npmjs.com/package/@anyswarm/core/v/0.5.0). Update the project dependency and imports together. The first managed CLI upgrade across the package rename uses the official installer with the existing prefix.
13
22
  - Register operation interfaces backed by in-process, HTTP, MCP or external CLI providers. Pi supports direct, code and CLI tool modes. Move Profile `prompt` to `addedSystemPrompt` and `session.tools` to `tools`. Runtime manages a single Service instance and Trace Viewer shows exported state. [Services guide](services.md).
14
23
 
15
24
  ## v0.4.1
16
25
 
17
- - The SDK is available on npm as [`@anyswarm/anyswarm@0.4.1`](https://www.npmjs.com/package/@anyswarm/anyswarm/v/0.4.1). Existing v0.4.0 CLI installations can migrate once through the official installer.
26
+ - The [GitHub release archive](https://github.com/AnySwarm/anyswarm/releases/tag/v0.4.1) contains the v0.4.1 SDK under its original name, `@anyswarm/anyswarm`. Existing v0.4.0 CLI installations can migrate once through the official installer.
18
27
 
19
28
  - Add atomic `anyswarm update` for managed CLI installations. Global npm users can switch once with the official installer. SDK projects select their own dependencies.
20
29
  - Linux setup and the SDK build Workers locally from the selected installed Pi or Codex. Repeated setup reuses or restarts its managed OpenSandbox service.
@@ -25,7 +34,7 @@ All notable changes to **AnySwarm** (`@anyswarm/core`) are tracked here and in t
25
34
 
26
35
  ## v0.4.0
27
36
 
28
- - AnySwarm has a new SDK package, host CLI and Worker namespace. See the [migration guide](latest.md#migrate-from-v030).
37
+ - AnySwarm has a new SDK package, host CLI and Worker namespace. See the [migration guide](https://github.com/AnySwarm/anyswarm/blob/v0.5.0/docs/en/latest.md#migrate-from-v030).
29
38
 
30
39
  - Custom Pi models can map AnySwarm thinking levels to provider values. Startup and session configuration reject explicit unsupported levels.
31
40
 
@@ -9,7 +9,7 @@ A publisher reads a reference from its workspace and asks you where to send it.
9
9
 
10
10
  ## 1. Pick your SDK version
11
11
 
12
- This tutorial uses the `@anyswarm/core@0.5.0` SDK by default. To use a [source build](quickstart.md#build-and-install-from-source-main), verify its SHA-256 and set `ANYSWARM_SDK_ARCHIVE` to the absolute path of the tarball. Copy the example sources from whichever SDK you install. The source build and npm release can expose different APIs even when they share a version number. For v0.4.0, follow its [versioned tutorial](https://github.com/AnySwarm/anyswarm/blob/v0.4.0/docs/en/first-harness.md).
12
+ This tutorial uses `anys run` from the [current source build](quickstart.md#build-and-install-from-source-main). Verify the archive's SHA-256 and set `ANYSWARM_SDK_ARCHIVE` to its absolute path. Copy the examples from that installed package. If you installed the published v0.5.0 package, follow its [versioned tutorial](https://github.com/AnySwarm/anyswarm/blob/v0.5.0/docs/en/first-harness.md).
13
13
 
14
14
  ## 2. Install and connect
15
15
 
@@ -17,9 +17,7 @@ In a fresh directory, install the SDK as a normal dependency and run its own CLI
17
17
 
18
18
  ```bash
19
19
  npm init -y
20
- npm pkg set type=module
21
- npm install "${ANYSWARM_SDK_ARCHIVE:-@anyswarm/core@0.5.0}"
22
- npm install --save-dev typescript @types/node
20
+ npm install "${ANYSWARM_SDK_ARCHIVE:?Set the absolute path to the verified SDK archive}"
23
21
  ```
24
22
 
25
23
  To prepare a new local OpenSandbox, first [install a supported Pi](quickstart.md#2-prepare-opensandbox-and-the-worker), then run `./node_modules/.bin/anyswarm setup --mode local --backend pi`. With an existing deployment, [configure its endpoint, authentication, callback and Worker image](quickstart.md#connect-to-an-existing-opensandbox), then run `./node_modules/.bin/anyswarm setup --mode existing` and `./node_modules/.bin/anyswarm doctor --smoke`.
@@ -38,26 +36,25 @@ read -rsp 'Model API token: ' ANYSWARM_MODEL_TOKEN && export ANYSWARM_MODEL_TOKE
38
36
 
39
37
  ### Add the standard Harness and run it
40
38
 
41
- Copy the source files and compiler configuration from the SDK you installed.
39
+ Copy the TypeScript sources from the SDK you installed. The installed CLI runs them directly.
42
40
 
43
41
  ```bash
44
42
  sdk=node_modules/@anyswarm/core
45
43
  example="$sdk"/examples/first-harness
46
- cp "$example"/{harness.ts,session.ts,handoff.ts,config.ts,tsconfig.json} .
44
+ cp "$example"/{harness.ts,session.ts,handoff.ts,config.ts} .
47
45
  ```
48
46
 
49
47
  The module's default export is a `Harness` with `apiVersion: 1`, `id: 'first-harness'` and `run(context)`. The [current repository version](../../examples/first-harness/harness.ts) uses the new Service registration API and pairs with the archive built from that source.
50
48
 
51
49
  The Harness owns two Profiles and the Handoff Service. The publisher reads the unique reference from its Sandbox and publishes it with a question. `runInput` waits for the exclusive publisher turn. The Harness checks the Service's authenticated publisher, then calls `context.askUser` with that Agent and the Run signal. The writer fetches the same reference with its own permission and uses your answer in `delivery.txt`. The Harness checks the bytes in the Sandbox, requests required export and checks the exported bytes again. The Session manages question identities, answer admission, observation and the final Run report.
52
50
 
53
- `session.ts` handles terminal input and passes the reply to `respond`. Compile the files and run the same definition in process, over RPC, or in one-shot foreground mode.
51
+ `session.ts` handles terminal input and passes the reply to `respond`. Run the TypeScript sources with the same definition in process, over RPC, or in one-shot foreground mode.
54
52
 
55
53
  ```bash
56
- ./node_modules/.bin/tsc
57
54
  mkdir -p input
58
- node dist/session.js ./input 'Prepare a release handoff.'
59
- PATH="$PWD/node_modules/.bin:$PATH" node dist/session.js --rpc ./input 'Prepare a release handoff.'
60
- ANYSWARM_FIRST_CHANNEL=beta-east ./node_modules/.bin/anyswarm --harness ./dist/harness.js --cwd ./input --prompt 'Prepare a release handoff.'
55
+ ./node_modules/.bin/anys run ./session.ts ./input 'Prepare a release handoff.'
56
+ PATH="$PWD/node_modules/.bin:$PATH" ./node_modules/.bin/anys run ./session.ts --rpc ./input 'Prepare a release handoff.'
57
+ ANYSWARM_FIRST_CHANNEL=beta-east ./node_modules/.bin/anys run ./harness.ts --cwd ./input --prompt 'Prepare a release handoff.'
61
58
  ```
62
59
 
63
60
  Use a separate input directory so capture excludes the example's dependencies and Run output. Both clients prompt for a channel such as `beta-east`. The one-shot foreground takes its channel from `ANYSWARM_FIRST_CHANNEL` and prints a final JSON record. JSONL clients may run explicit foreground with `--interaction questions` and answer by `questionId`. A successful run has `outcome: "completed"`, `acceptance.status: "verified"`, `export.status: "complete"` and `cleanup.status: "complete"`. Read the file named by the acceptance receipt, check its `channel=` line and compare its SHA‑256. Use the same Run's `reportPath` for the complete Host report.
@@ -113,7 +113,7 @@ From a built checkout, prepare OpenSandbox, a compatible Pi Worker image, a Gite
113
113
 
114
114
  ```bash
115
115
  # Set run ID, immutable worker image, OpenSandbox URL, Gitea admin credentials, and model URL
116
- node dist/benchmarks/lead-worker-orders/main.js dist/benchmarks/lead-worker-orders/config.js
116
+ anys run ./benchmarks/lead-worker-orders/main.ts ./benchmarks/lead-worker-orders/config.ts
117
117
  ```
118
118
 
119
119
  On close, the host fences new Board writes and calls `runtime.close()`. It closes the Board connection and revokes owned Gitea credentials only after Core confirms stopped execution and complete cleanup. Unknown execution, required export failures or Board evidence failures leave dependencies pending for reconciliation. The shared repository, Board database, commits and PRs remain for review. Inspect `harness-report.json` for business failure, delivered and unfinished work, uncertain inputs, cleanup and report-save outcomes.
@@ -113,7 +113,7 @@ export ANYSWARM_PEERMESH_MODEL_URL='https://your-model-endpoint/v1/responses'
113
113
  export ANYSWARM_PEERMESH_PEERS=4
114
114
  # Plus Gitea, Mattermost, and Board MySQL DSN host variables
115
115
 
116
- node dist/scripts/run-harness.js --config dist/examples/peermesh/config.js
116
+ anys run ./scripts/run-harness.ts --config ./examples/peermesh/config.ts
117
117
  ```
118
118
 
119
119
  Once `ready` is emitted, send JSON-line commands over `stdin` to observe or steer peers, or let the team run to its configured `durationMs`:
@@ -128,7 +128,7 @@ Inspect saved reports, merge receipts, and archive digests afterward:
128
128
 
129
129
  ```bash
130
130
  runtime_id=RUNTIME_ID_FROM_RESULT
131
- node dist/scripts/read-harness-result.js \
131
+ anys run ./scripts/read-harness-result.ts \
132
132
  --run-directory "./peermesh-runs/$runtime_id" \
133
133
  --runtime-id "$runtime_id"
134
134
  ```
@@ -162,10 +162,10 @@ export ANYSWARM_MODEL_TOKEN='your-bearer-token'
162
162
  # Optional: override the default prebuilt Worker image
163
163
  # export ANYSWARM_WORKER_IMAGE='your-registry.example/compatible-worker:tag'
164
164
 
165
- node dist/examples/subagents/main.js dist/examples/subagents/config.js \
165
+ anys run ./examples/subagents/main.ts ./examples/subagents/config.ts \
166
166
  'Split this task into two independent checks and summarize the results.'
167
167
 
168
- node dist/examples/subagents/main.js dist/examples/subagents/config.js --interactive
168
+ anys run ./examples/subagents/main.ts ./examples/subagents/config.ts --interactive
169
169
  ```
170
170
 
171
171
  Or embed `createSubagentsHarness` in Node.js:
@@ -96,11 +96,11 @@ export ANYSWARM_SUBSTRATE_RUN=research-01
96
96
  export ANYSWARM_SUBSTRATE_MODEL_URL='https://your-model-endpoint/v1/responses'
97
97
  export ANYSWARM_SUBSTRATE_MODEL_TOKEN='your-bearer-token'
98
98
 
99
- node dist/examples/substrate/main.js dist/examples/substrate/config.js > substrate-result.json
99
+ anys run ./examples/substrate/main.ts ./examples/substrate/config.ts > substrate-result.json
100
100
 
101
101
  # Read saved receipts without loading model configuration:
102
102
  runtime_id=RUNTIME_ID_FROM_RESULT
103
- node dist/examples/substrate/main.js --result "./substrate-runs/$runtime_id" --runtime-id "$runtime_id"
103
+ anys run ./examples/substrate/main.ts --result "./substrate-runs/$runtime_id" --runtime-id "$runtime_id"
104
104
  ```
105
105
 
106
106
  [collaboration-evidence.ts](https://github.com/AnySwarm/anyswarm/blob/main/examples/substrate/harness/collaboration-evidence.ts) audits `substrate_contents`, `substrate_references`, and `substrate_reads` to inspect a cross-peer reuse chain:
@@ -127,8 +127,8 @@ export ANYSWARM_FATE_BENCHMARK=FATE-X
127
127
  export ANYSWARM_FATE_PROJECT=/path/to/fate-x
128
128
  export ANYSWARM_FATE_LEAN=/path/to/lean-4.28.0
129
129
 
130
- node dist/benchmarks/fate/main.js --fate-prepare "$ANYSWARM_FATE_PROJECT" "$ANYSWARM_FATE_LEAN" FATE-X
131
- node dist/benchmarks/fate/main.js --fate-run dist/benchmarks/fate/fate-config.js
130
+ anys run ./benchmarks/fate/main.ts --fate-prepare "$ANYSWARM_FATE_PROJECT" "$ANYSWARM_FATE_LEAN" FATE-X
131
+ anys run ./benchmarks/fate/main.ts --fate-run ./benchmarks/fate/fate-config.ts
132
132
  ```
133
133
 
134
134
  ## Source files
@@ -84,7 +84,7 @@ For custom store compositions via the repository's foreground runner, provide an
84
84
  After building the repository and creating that host module:
85
85
 
86
86
  ```bash
87
- node dist/scripts/run-harness.js --config ./my-taskpool-config.mjs
87
+ anys run ./scripts/run-harness.ts --config ./my-taskpool-config.ts
88
88
  ```
89
89
 
90
90
  The host accepts JSON-line `status`, Task-directed `input`, and `stop` commands. Task-directed input is resolved against the current Execution owner. It is not an arbitrary direct message to an Agent. The final record contains the Runtime identity and report path; the [foreground protocol](../../architecture/17-harness-reporting.md#foreground-harness-control) defines its commands and result codes.
@@ -92,7 +92,7 @@ The host accepts JSON-line `status`, Task-directed `input`, and `stop` commands.
92
92
  Saved reports can be read without loading model configuration:
93
93
 
94
94
  ```bash
95
- node dist/scripts/read-harness-result.js \
95
+ anys run ./scripts/read-harness-result.ts \
96
96
  --run-directory ./runs/RUNTIME_ID_FROM_RESULT \
97
97
  --runtime-id RUNTIME_ID_FROM_RESULT
98
98
  ```
package/docs/en/latest.md CHANGED
@@ -1,140 +1,29 @@
1
1
  ---
2
- title: Releases and main updates
3
- description: Install the current CLI and SDK, migrate from v0.4.0, and find archived releases.
2
+ title: Releases
3
+ description: Install the current AnySwarm SDK and CLI and find release notes.
4
4
  section: RELEASES
5
5
  order: 15
6
6
  ---
7
7
 
8
- ## Package name on main
8
+ ## v0.5.0
9
9
 
10
- Source builds now produce `@anyswarm/core`. For a project moving to a verified candidate archive, install the archive, update imports to `@anyswarm/core`, and remove `@anyswarm/anyswarm` from the project's dependencies once all imports have migrated. Commit the updated lockfile. Use the installed archive's own examples. The npm install command below continues to install the published v0.4.1 SDK.
10
+ v0.5.0 is the first supported release of `@anyswarm/core`. It introduces the current Service registration and Profile APIs. See the [v0.5.0 changelog](changelog.md#v050) for the changes.
11
11
 
12
- When the first GitHub Release under the new package name ships, upgrade a managed v0.4.1 CLI by rerunning the official installer once with its existing prefix. The v0.4.1 updater looks for its original package name. After this transition, use `anyswarm update` again.
13
-
14
- ## v0.4.1
15
-
16
- AnySwarm v0.4.1 is available on GitHub and npm. It adds managed CLI updates, local Worker builds from supported Pi or Codex installations, and richer Run diagnostics.
17
-
18
- | Distribution | Links |
19
- | --- | --- |
20
- | CLI | [GitHub Release](https://github.com/AnySwarm/anyswarm/releases/tag/v0.4.1) · [SHA256SUMS](https://github.com/AnySwarm/anyswarm/releases/download/v0.4.1/SHA256SUMS) · [Quickstart](quickstart.md) |
21
- | TypeScript SDK | [@anyswarm/anyswarm on npm](https://www.npmjs.com/package/@anyswarm/anyswarm/v/0.4.1) · [First SDK Harness](first-harness.md) |
22
- | Changes | [Changelog](changelog.md#v041) |
23
-
24
- To install this SDK version in a project, run:
25
-
26
- ```bash
27
- npm install @anyswarm/anyswarm@0.4.1
28
- ```
29
-
30
- When moving an existing project from v0.4.0, update its imports from `@luna-shi/anyswarm` to `@anyswarm/anyswarm`, run `npm uninstall @luna-shi/anyswarm` in that project, and commit the updated dependency lock. Update the global CLI separately.
31
-
32
- ## Upgrade from v0.4.0 to the managed installer
33
-
34
- To migrate a v0.4.0 CLI, run the [official installer](quickstart.md#1-install-anyswarm) once. If npm installed your current CLI in a custom writable prefix, set `npm_config_prefix` for the installer to use that directory. The installer reports the active CLI path. Later CLI upgrades use `anyswarm update`.
35
-
36
- The managed release ignores saved v0.4.0 OpenSandbox connection files. Bring forward any custom endpoint explicitly during setup. To prepare a managed service on the previous port, with Pi selected for example, run:
12
+ Install the CLI globally with npm and check the installed version.
37
13
 
38
14
  ```sh
39
- anyswarm setup --mode local --endpoint http://127.0.0.1:18080 --backend pi
40
- ```
41
-
42
- Replace the sample address with your own. If the old container still owns that port and the new CLI cannot verify ownership, finish its Runs with the old version and retire the container before preparing a managed service there. To keep an already-running service, use [existing-service mode](quickstart.md#connect-to-an-existing-opensandbox) with its endpoint and credentials. Pass your old callback URL with `--public-url` if you set a custom one.
43
-
44
- ## Features available in v0.4.0
45
-
46
- ### 1. OpenSandbox SDK 1.2.1, unified callbacks, and Kubernetes support
47
-
48
- - **Official SDK integration**: Both local and remote connections now run through OpenSandbox SDK 1.2.1. `anyswarm setup` persists your endpoint, credentials, and callback URL in owner-only user config shared across `setup`, `doctor`, and built-in Harnesses.
49
- - **Single callback URL (`connection.publicUrl`)**: Each Runtime serves both Service Bridge (`/bridge`) and Model Gateway (`/model/<alias>`) from one callback origin, preserving reverse-proxy path prefixes and replacing the old dual-URL `{port}` templates.
50
- - **Custom providers & Kubernetes guide**: Plug in any external sandbox backend via `createSandbox({ provider })`, use the pinned [OpenSandbox Kubernetes deployment guide](../../deploy/opensandbox-kubernetes/README.md), and enable packet-level allowlists with `egressMode: 'dns+nft'`.
51
-
52
- ### 2. Unified `Harness` contract & `HarnessSession`
53
-
54
- - **Write once, run three ways**: The root `@luna-shi/anyswarm` entry exports the standard `Harness` and `HarnessContext` contract. The same module runs in-process via `createHarnessSession()`, in the foreground CLI (`anyswarm --harness`), and over JSONL RPC via `HarnessRpcClient`.
55
- - **Interactive turns & user questions**: Keep runs interactive with `--lifetime interactive`, request terminal or client input with `--interaction questions` and `context.askUser()`, and inspect or control individual Agents while a run is active.
56
- - **Standalone examples & new walkthrough**: The five collaboration examples can each be installed and built outside the repository against a matching SDK archive. Follow [Build Your First SDK Harness](first-harness.md) for a step-by-step two-Agent handoff tutorial.
57
-
58
- ### 3. Per-Agent session controls & compaction hooks
59
-
60
- - **`runtime.session` API**: Native Pi workers now expose `configure`, `compact`, `abortRetry`, `clearQueue`, `getState`, `getStats`, and `getMessages` for each Agent.
61
- - **Structured context injection**: Send structured context payloads via `runtime.send()` with explicit `delivery` timing (`'append'`, `'nextTurn'`, `'steer'`, or `'followUp'`).
62
- - **Compaction guard (`hooks.beforeCompact`)**: Register a host policy in `createRuntime()` to cap automatic compactions and cleanly stop, archive, and export an Agent before an unwanted compaction cycle (see [Agent session settings and context](agents.md#6-session-controls-and-structured-context)).
63
-
64
- ### 4. Opt-in durable recovery & `anyswarm recover`
65
-
66
- - **Recover interrupted runs**: Enable `persistence` in `createRuntime()` to store durable allocation ownership on the host, then resume an interrupted run on the same Linux host (within the same OS boot) via `recoverRuntime()` and reattach dynamic Services through `restoreService`.
67
- - **Cleanup-only recovery CLI**: Run `anyswarm recover --run-dir <dir> --config <module>` to reclaim cleanup authority, run `close()`, and confirm full archival and sandbox deletion (exits `0` only when cleanup is complete).
68
- - **Cursor-based event streaming & probes**: Workers stream events over bounded cursor long polling, and `runtime.probeWorkerEvent()` measures end-to-end authenticated event latency without calling a model (see [Durable recovery and Kubernetes](runtime.md#6-durable-recovery-and-kubernetes)).
69
-
70
- ### 5. Expanded executors, model protocols, and large-directory transfers
71
-
72
- - **Pluggable executors & Chat Completions**: Select verified Pi versions or image-installed custom executor adapters; Pi now supports streaming **Chat Completions** alongside Responses, and the host accepts custom trusted model transports.
73
- - **Local Worker setup**. `anyswarm setup` reuses a compatible local Worker or builds a missing or incompatible built-in Worker from the installed package. The [Quickstart](quickstart.md) includes the verified README run and Trace Viewer steps.
74
- - **Disk-backed transfers & smoother CLI UX**: Separate import, live-sync, and export file budgets with disk-backed chunked transfers handle larger project folders. The installer now falls back to `$HOME/.local` automatically, `anyswarm --version` reports the installed build, and `swarm service invoke ... --help` prints required fields and derived examples.
75
-
76
- ## Install or upgrade
77
-
78
- To pin the historical v0.4.0 release, verify its archive in a fresh download directory and install it for the current user.
79
-
80
- ```bash
81
- mkdir -p anyswarm-v0.4.0 && cd anyswarm-v0.4.0
82
- curl -fLO https://github.com/AnySwarm/anyswarm/releases/download/v0.4.0/luna-shi-anyswarm-0.4.0.tgz
83
- curl -fLO https://github.com/AnySwarm/anyswarm/releases/download/v0.4.0/SHA256SUMS
84
- sha256sum -c --ignore-missing SHA256SUMS
85
- npm install -g --prefix "$HOME/.local" --ignore-scripts "./luna-shi-anyswarm-0.4.0.tgz"
86
- export PATH="$HOME/.local/bin:$PATH"
15
+ npm install -g @anyswarm/core@0.5.0
87
16
  anyswarm --version
88
17
  ```
89
18
 
90
- Expect version `0.4.0`. Continue with the [v0.4.0 Quickstart](https://github.com/AnySwarm/anyswarm/blob/v0.4.0/docs/en/quickstart.md).
91
-
92
- ## Migrate from v0.3.0
93
-
94
- 1. Finish or recover active Runs with the original Controller and Worker. Confirm Sandbox deletion or record retained ownership before replacing either component. Use `anyswarm trace --root <old-runs-dir>` to read saved Run reports from the previous root.
95
- 2. Remove the old global package from the npm prefix that installed it before installing AnySwarm in the same prefix. npm rejects the install while the previous package owns the shared `swarm` binary. For the user prefix:
96
-
97
- ```sh
98
- npm uninstall --global --prefix "$HOME/.local" @luna-shi/murm
99
- ```
100
-
101
- Install `@luna-shi/anyswarm`, replace the old dependency and SDK imports in each project, update the npm lockfile, and use `anyswarm` in host scripts. The guest command remains `swarm`.
102
- 3. Replace the `MURM_` environment prefix with `ANYSWARM_`. Rerun `anyswarm setup` to populate private configuration under `~/.config/anyswarm/`. If an old local service still occupies port 8080, retire it after confirming its Sandboxes are gone, or select a free port using `ANYSWARM_LIFECYCLE_URL`.
103
- 4. For v0.4.0 use `ghcr.io/luna-shi/anyswarm-worker:0.4.0` or its matching executor-specific tag. Rebuild custom Worker images and executor adapters with the matching AnySwarm protocol. Update custom transports and proxy header allowlists to the matching `x-anyswarm-*` headers. Upgrade separately deployed TaskPool Service hosts with the Controller. The renamed Catalog description changes its manifest hash, so a mixed-version Catalog fails the readiness check. See the [Worker protocol](../architecture/16-pi-opensandbox-backend.md) and [Bridge](../architecture/04-services.md) chapters.
19
+ The [Quickstart](quickstart.md#1-install-anyswarm) also shows how to install a managed CLI from the [v0.5.0 GitHub Release](https://github.com/AnySwarm/anyswarm/releases/tag/v0.5.0).
104
20
 
105
- The [v0.3.0 release](https://github.com/AnySwarm/anyswarm/releases/tag/v0.3.0) still contains its original package and checksums. Use the [versioned v0.3.0 guide](https://github.com/AnySwarm/anyswarm/blob/v0.3.0/docs/en/quickstart.md) for that release.
21
+ To add the SDK as a dependency, run this command in your project.
106
22
 
107
- ## Migrating from v0.2.0 to v0.3.0
108
-
109
- > Need to maintain an existing `v0.2.0` host? See the [v0.2.0 release](https://github.com/AnySwarm/anyswarm/releases/tag/v0.2.0) and the [v0.2.0 host setup guide](https://github.com/AnySwarm/anyswarm/blob/v0.2.0/docs/en/quickstart.md).
110
-
111
- - **Removed built-in `local-docker` and shared host mounts**: The legacy Landlock ABI 5+ / rootful `sudo` `local-docker` backend, exact byte/inode tmpfs quotas, and live shared workspace mounts have been removed from the built-in provider. Use `runtime.files` or shared Services for file handoffs, and OpenSandbox `dns+nft` for IP/port egress allowlists.
112
- - **Worker protocol upgraded to `murm-core-v2`**: Upgrade the host CLI/SDK and Worker image together (run `murm setup` to refresh local images); older worker images fail fast on handshake with a protocol mismatch error.
113
- - **Connection config migration**: Prefer `endpoint` over the deprecated `lifecycleBaseUrl` alias in `createSandbox()`, and migrate dual Bridge/Gateway callback URLs to a single `connection.publicUrl` (see [Sandbox migration table](sandbox.md#4-resources-and-migration-from-v020)).
114
- - **Service CLI syntax & benchmark entrypoints**: Startup prompts now advertise `swarm service invoke <service> <operation>` (TaskPool retains its shorthand commands). Fixed Lead-Worker and FATE benchmark runners moved under `dist/benchmarks/`.
115
-
116
- See the **[Changelog](changelog.md)** for full release history, or try the interactive **[Trace Viewer](trace-viewer.md)**.
117
-
118
- ## Install v0.2.0
119
-
120
- Install the pinned v0.2.0 archive with npm. Its CLI predates `murm --version`, so use npm to verify what installed.
121
-
122
- ```bash
123
- prefix="$HOME/.local"
124
- npm install -g --prefix "$prefix" --ignore-scripts --allow-remote=root \
125
- https://github.com/AnySwarm/anyswarm/releases/download/v0.2.0/luna-shi-murm-0.2.0.tgz
126
- export PATH="$prefix/bin:$PATH"
127
- MURM_ROOT="$(npm root -g --prefix "$prefix")/@luna-shi/murm"
128
- printf '%s\n' "$MURM_ROOT"
129
- npm ls -g --prefix "$prefix" @luna-shi/murm --depth=0
23
+ ```sh
24
+ npm install @anyswarm/core@0.5.0
130
25
  ```
131
26
 
132
- Use the printed package root to locate the package assets for manual deployment. If you used the website installer, use the root it printed for your actual prefix. An administrator must install any helper invoked through sudo in a root-controlled location, including its parent directories.
133
-
134
- A clean Debian 13.8 installation reproduced Agent startup failure after both sudo checks in the v0.2.0 guide passed. This release still requires an administrator-managed strict-local host setup. For a first local Run, use the [Quickstart](quickstart.md), which uses OpenSandbox APIs for Agent startup and cleanup.
135
-
136
- For a project SDK dependency, use the same pinned archive URL without `-g` and `--prefix`. npm 12+ requires `--allow-remote=root` when a lockfile contains the GitHub Release tarball URL.
137
-
138
- ## Host requirements
27
+ See [Install the SDK](reference/api.md#install-the-sdk) for SDK imports and the project-local CLI.
139
28
 
140
- The released v0.2.0 OpenSandbox isolation backend requires a single Linux host (`x86_64` or `aarch64`) with **Linux kernel Landlock ABI >= 5**, **Node.js 22.19+**, local **rootful Docker Engine**, host utilities (`python3`, `nftables`, `util-linux`, `coreutils`, `iproute2`), and least-privilege non-interactive `sudo` rules. See the [v0.2.0 Quickstart](https://github.com/AnySwarm/anyswarm/blob/v0.2.0/docs/en/quickstart.md) for this release’s installation instructions.
29
+ Earlier releases used different npm package names. Their source and release artifacts are in the [GitHub release history](https://github.com/AnySwarm/anyswarm/releases).
@@ -30,6 +30,6 @@ The guide walks through the **six building blocks** from the homepage one by one
30
30
  - [Build Your First SDK Harness](first-harness.md) — build a two-Agent interactive handoff app using the standard `Harness` contract.
31
31
  - [Build a Swarm Harness](build-your-harness.md) — build a parallel multi-agent Research Swarm step by step.
32
32
  4. **Built-in Harnesses**: [Choose a Harness](harnesses/index.md) — run or adapt `Subagents`, `TaskPool`, `PeerMesh`, `Substrate`, and `Lead-Worker`.
33
- 5. **Reference & Releases**: [SDK & API Reference](reference/api.md) · [CLI Reference](reference/cli.md) · [Types & Source Map](reference/types.md) · [Releases and main updates](latest.md) · [Changelog](changelog.md).
33
+ 5. **Reference & Releases**: [SDK & API Reference](reference/api.md) · [CLI Reference](reference/cli.md) · [Types & Source Map](reference/types.md) · [Releases](latest.md) · [Changelog](changelog.md).
34
34
 
35
35
  > Looking for internal implementation details or maintainer specs? See the repository's [Architecture Manual](https://github.com/AnySwarm/anyswarm/blob/main/docs/architecture/INDEX.md).
@@ -9,7 +9,7 @@ To build an application with the TypeScript SDK, follow [Build your first SDK Ha
9
9
 
10
10
  AnySwarm ships its CLI and TypeScript SDK in one package and runs Agents inside [OpenSandbox](sandbox.md) containers. You can run OpenSandbox locally with Docker Engine or connect to an existing OpenSandbox service.
11
11
 
12
- This guide covers the stable release, starting with v0.4.1. If you already use v0.4.0, see [how to upgrade](latest.md#upgrade-from-v040-to-the-managed-installer).
12
+ This guide covers [v0.5.0](latest.md#v050), the first supported release of `@anyswarm/core`.
13
13
 
14
14
  ## Prerequisites
15
15
 
@@ -33,37 +33,54 @@ For an existing OpenSandbox service, install only `git curl ca-certificates` and
33
33
 
34
34
  If the Docker socket denies access, an administrator can run `sudo usermod -aG docker alice`, replacing `alice` with the account that runs AnySwarm. Sign in again as that account and run `id` and `docker info`. The [`docker` group grants root-equivalent access](https://docs.docker.com/engine/install/linux-postinstall/).
35
35
 
36
+ ### Docker on macOS
37
+
38
+ **Before running local setup:** install [Docker Desktop for Mac](https://docs.docker.com/desktop/setup/install/mac-install/), open Docker, and wait for the engine to start. If you already use another local Linux container engine such as [OrbStack](https://orbstack.dev/download), start it instead. The `docker` CLI alone (for example, `brew install docker`) is not enough. AnySwarm installs its npm dependencies, but neither the npm command nor `anyswarm setup` installs or starts Docker Desktop for you.
39
+
40
+ Check that the running engine is selected in the terminal where you will run AnySwarm:
41
+
42
+ ```bash
43
+ docker context ls
44
+ docker context show
45
+ docker info --format '{{.OSType}}/{{.Architecture}}'
46
+ ```
47
+
48
+ If the wrong context is selected, run `docker context use <local-context>` and check whether `DOCKER_CONTEXT` or `DOCKER_HOST` overrides it. The expected daemon is Linux ARM64 on Apple Silicon, or Linux x86-64 on Intel; setup does not use emulation. If a separately installed Docker client reports `docker-credential-desktop` not found, put Docker Desktop's CLI tools on PATH in its settings, or add `/Applications/Docker.app/Contents/Resources/bin` to PATH. Use Node.js 24 LTS for TypeScript author commands; Node.js 26 removed the transform mode they currently use.
49
+
50
+ The published v0.5.0 local setup still requires a Linux Controller. To try native macOS setup, build and install the current source candidate below and select a supported backend. The controlled-model macOS checks for [#339](https://github.com/AnySwarm/anyswarm/issues/339) use Apple Silicon and Docker Desktop, with npm Pi 1.3.0 and 1.7.0 and standalone Codex 0.173.0. Intel and other container engines need separate verification.
51
+
36
52
  ## 1. Install AnySwarm
37
53
 
38
54
  ### Install a published release
39
55
 
56
+ Choose one way to install the AnySwarm CLI. Both require Node.js 22.19+ and npm. The npm command is the same on macOS and Linux; npm installs the package dependencies, and a running Docker engine is not required for this step.
57
+
40
58
  ```bash
41
- curl -fsSL https://anyswarm.github.io/anyswarm/install.sh | sh
59
+ npm install -g @anyswarm/core
60
+ anyswarm --version
42
61
  ```
43
62
 
44
- This command installs the latest GitHub Release and reports the version, CLI path, package root, and archive source. Apply the printed PATH command if needed, then run `anyswarm --version`. For the pinned v0.4.0 download and checksum, see the [release guide](latest.md#install-or-upgrade).
63
+ The `-g` flag installs the command into npm's global bin directory. If your shell cannot find it, check that `$(npm prefix -g)/bin` is on your PATH and that your shell is using the Node.js installation you used to install the CLI.
45
64
 
46
- ### Install the TypeScript SDK in a project
47
-
48
- Run this command in your Node.js project directory.
65
+ You can also install a managed copy of the CLI from GitHub Releases.
49
66
 
50
67
  ```bash
51
- npm install @anyswarm/anyswarm@0.4.1
68
+ curl -fsSL https://anyswarm.github.io/anyswarm/install.sh | sh
52
69
  ```
53
70
 
54
- This installs the published SDK and uses the import path `@anyswarm/anyswarm`. Build the repository archive below for the current `@anyswarm/core` API.
71
+ The script reports the version, CLI path, and verified archive source. Apply the printed PATH command if needed, then run `anyswarm --version`.
55
72
 
56
- For project-local setup and a runnable example, follow the [first SDK Harness tutorial](first-harness.md).
73
+ If you are writing a Harness in TypeScript, follow [Install the SDK](reference/api.md#install-the-sdk) to add it as a project dependency.
57
74
 
58
75
  ### Build and install from source (`main`)
59
76
 
60
- Run these commands from the repository root. `npm ci` installs dependencies, `npm pack` compiles and packages the tarball, and the official installer stages the CLI under `$HOME/.local`:
77
+ Run these commands from the repository root. `npm run pack:release` builds the distribution archive. The installer stages the CLI under `$HOME/.local`.
61
78
 
62
79
  ```bash
63
80
  git clone https://github.com/AnySwarm/anyswarm.git && cd anyswarm
64
81
  npm ci --no-audit --no-fund
65
82
  pack_dir=$(mktemp -d)
66
- npm pack --pack-destination "$pack_dir"
83
+ npm run pack:release -- "$pack_dir"
67
84
  npm_config_prefix="$HOME/.local" sh website/public/install.sh --archive "$pack_dir"/*.tgz
68
85
  export PATH="$HOME/.local/bin:$PATH"
69
86
  anyswarm --version
@@ -71,21 +88,28 @@ anyswarm --version
71
88
 
72
89
  The candidate can share its package version with the release. Record the source commit and the tarball SHA-256 to identify it. Keep the candidate tarball if you want to install the same SDK in an [independent example project](../../examples/README.md).
73
90
 
74
- ### Update a managed CLI
91
+ ### Update the CLI
75
92
 
76
- `anyswarm update` resolves the latest stable release, checks its archive checksum and runs the staged CLI to verify its version before switching the active entry. A failed update leaves the prior CLI available. Global npm installs and releases that predate `update` can switch to managed installation with the official installer. See [upgrading from v0.4.0](latest.md#upgrade-from-v040-to-the-managed-installer) for the CLI and custom OpenSandbox endpoint steps. For other install scopes, the CLI reports the original package path and the applicable command. The command updates CLI software only. Projects keep their own SDK and lockfile, and setup or the consuming SDK prepares new execution materials as needed.
93
+ - Global npm install. Run `npm install -g @anyswarm/core@latest` with the same Node.js installation and npm prefix.
94
+ - Shell installer. Run `anyswarm update` to check the GitHub Release checksum and validate the new CLI before switching. A failed update leaves the prior CLI available.
95
+
96
+ For the first upgrade from a managed v0.5.0 installation, rerun the current shell installer in the same prefix. This adds the `anys` alias. On macOS, it also uses the current activation lock.
97
+
98
+ To update a project's SDK, use its package manager in the project directory.
77
99
 
78
100
  ## 2. Prepare OpenSandbox and the Worker
79
101
 
80
- Choose a supported Linux npm installation of Pi or Codex. For example:
102
+ Use the Pi or Codex installation you already have. On Linux, use a supported npm package layout. On macOS, setup also accepts the standalone Codex executable when the same release is available for Linux from npm. If you need Pi, install it with `npm install --global @earendil-works/pi-coding-agent`. Then select an installed backend.
81
103
 
82
104
  ```bash
83
- npm install --global @earendil-works/pi-coding-agent@1.3.0
84
105
  pi --version
85
106
  anyswarm setup --backend pi
107
+ anyswarm doctor --smoke
86
108
  ```
87
109
 
88
- Setup accepts Pi 1.3.0 or 1.4.0 and Codex 0.172.0 from the `@openai/codex` npm distribution. Use `--backend codex` to select Codex, or `--backend-path /absolute/path/to/bin/pi` to select a specific npm executable. Without a saved selection, an interactive terminal can choose between two detected installs. Use `--backend` for automation when both are installed.
110
+ Bare setup reuses the saved executable path. To choose a different installation, supply `--backend pi --backend-path /absolute/path/to/bin/pi` or the corresponding Codex options. To require an installed version, add `--backend-version 1.7.0` (substitute the version you intend to use). A saved version pin rejects an executable that later reports a different version. Repeat explicit backend selection without a pin to follow upgrades to that installation.
111
+
112
+ On macOS, setup prepares the same release's Linux package inside a native Docker container. It verifies the Worker version and runs the executor startup and controlled protocol smoke before saving the connection. Without a saved selection, an interactive terminal prompts when both backends are installed. Use `--backend` in automation when both are present.
89
113
 
90
114
  For a new local configuration, setup defaults to `127.0.0.1:8080`, builds a Worker from the selected installation and SDK package, and pulls the pinned upstream OpenSandbox 1.2.1 components. It saves the managed connection after a controlled smoke verifies Worker, Bridge, Gateway, files, export and deletion. Expect `"ok": true` and `"infrastructure": "ready"`. Repeating setup restores a stopped managed service and reruns the smoke. Test with `ANYSWARM_CONFIG_DIR=/path/to/private-directory` and a free loopback port if needed.
91
115