@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
@@ -0,0 +1,80 @@
1
+ export interface PersonalSettings {
2
+ repository: string;
3
+ account: string;
4
+ users: string[];
5
+ paths: string[];
6
+ publish: boolean;
7
+ pollMs: number;
8
+ since: string;
9
+ }
10
+ export type PersonalStartupFailure = {
11
+ phase: 'github-identity' | 'backend-configuration' | 'runtime-initialization' | 'processing';
12
+ code: string;
13
+ hint: string;
14
+ launchId?: string;
15
+ };
16
+ export declare const defaults: {
17
+ pollMs: number;
18
+ maxWork: number;
19
+ maxTurns: number;
20
+ fileBytes: number;
21
+ };
22
+ export declare class PersonalConfigurationError extends Error {
23
+ readonly code: string;
24
+ constructor(code: string, hint: string);
25
+ }
26
+ export declare function backendDiagnostic(error: unknown): {
27
+ code: string;
28
+ hint: string;
29
+ };
30
+ export declare function runtimeOptions(outputDir: string): {
31
+ options: {
32
+ executor: "pi";
33
+ sandbox: import("@anyswarm/core").Sandbox;
34
+ outputDir: string;
35
+ connection: {
36
+ advertiseHost: string | undefined;
37
+ publicUrl: string | undefined;
38
+ bindPort?: number | undefined;
39
+ bindHost?: string | undefined;
40
+ modelGateway: {
41
+ requestTimeoutMs: number;
42
+ maxOutputTokens: number;
43
+ maxRequests: number;
44
+ };
45
+ };
46
+ models: {
47
+ default: {
48
+ provider: string;
49
+ model: string;
50
+ capabilities: {
51
+ contextWindow: number;
52
+ maxOutputTokens: number;
53
+ tools: boolean;
54
+ reasoning: boolean;
55
+ } | undefined;
56
+ upstream: {
57
+ url: string;
58
+ headers: Record<string, string>;
59
+ };
60
+ };
61
+ };
62
+ persistence?: {
63
+ deploymentId: string;
64
+ contract: string;
65
+ } | undefined;
66
+ };
67
+ image: string;
68
+ };
69
+ export declare function inspectBackendConfiguration(outputDir: string): {
70
+ readonly configuration: 'valid';
71
+ readonly executor: 'pi';
72
+ readonly connectivity: 'unverified';
73
+ } | {
74
+ readonly code: string;
75
+ readonly hint: string;
76
+ readonly executor?: undefined;
77
+ readonly configuration: 'invalid';
78
+ readonly connectivity: 'unverified';
79
+ };
80
+ export default defaults;
@@ -0,0 +1,83 @@
1
+ import { createSandbox, resolveSandboxConnection, workerImageFor } from '@anyswarm/core';
2
+ export const defaults = { pollMs: 15_000, maxWork: 2, maxTurns: 8, fileBytes: 128 * 1024 };
3
+ export class PersonalConfigurationError extends Error {
4
+ code;
5
+ constructor(code, hint) {
6
+ super(hint);
7
+ this.code = code;
8
+ }
9
+ }
10
+ export function backendDiagnostic(error) {
11
+ if (error instanceof PersonalConfigurationError)
12
+ return { code: error.code, hint: error.message };
13
+ return { code: 'PERSONAL_BACKEND_CONFIG_INVALID', hint: 'Review the Pi and OpenSandbox configuration with anys doctor. Select Pi with anys setup --backend pi.' };
14
+ }
15
+ export function runtimeOptions(outputDir) {
16
+ if (process.env.ANYSWARM_EXECUTOR && process.env.ANYSWARM_EXECUTOR !== 'pi') {
17
+ throw new PersonalConfigurationError('PERSONAL_PI_REQUIRED', 'Personal requires Pi. Run anys setup --backend pi and select Pi in ANYSWARM_EXECUTOR.');
18
+ }
19
+ const { image, executor: configured, advertiseHost, publicUrl, endpointSource: _source, ...sandbox } = resolveSandboxConnection({}, 'SUPER');
20
+ const executor = process.env.ANYSWARM_EXECUTOR ?? configured ?? 'pi';
21
+ if (executor !== 'pi')
22
+ throw new PersonalConfigurationError('PERSONAL_PI_REQUIRED', 'Personal requires Pi. Run anys setup --backend pi.');
23
+ const url = process.env.ANYSWARM_MODEL_URL;
24
+ const model = process.env.ANYSWARM_MODEL_ID;
25
+ if (!url || !model)
26
+ throw new PersonalConfigurationError('PERSONAL_MODEL_CONFIG_MISSING', 'Set ANYSWARM_MODEL_URL and ANYSWARM_MODEL_ID using your existing backend settings.');
27
+ const endpoint = URL.parse(url);
28
+ if (!endpoint || !['http:', 'https:'].includes(endpoint.protocol)) {
29
+ throw new PersonalConfigurationError('PERSONAL_MODEL_URL_INVALID', 'Set ANYSWARM_MODEL_URL to the full HTTP or HTTPS Responses endpoint.');
30
+ }
31
+ const provider = process.env.ANYSWARM_MODEL_PROVIDER ?? 'openai';
32
+ const reasoning = process.env.ANYSWARM_MODEL_REASONING;
33
+ if (reasoning !== undefined && reasoning !== 'true' && reasoning !== 'false') {
34
+ throw new PersonalConfigurationError('PERSONAL_MODEL_REASONING_INVALID', 'ANYSWARM_MODEL_REASONING must be true or false.');
35
+ }
36
+ const capabilities = reasoning === undefined ? undefined : {
37
+ contextWindow: 64_000, maxOutputTokens: 3072, tools: true, reasoning: reasoning === 'true',
38
+ };
39
+ const token = process.env.ANYSWARM_MODEL_TOKEN;
40
+ let extra = {};
41
+ try {
42
+ if (process.env.ANYSWARM_MODEL_HEADERS_JSON)
43
+ extra = JSON.parse(process.env.ANYSWARM_MODEL_HEADERS_JSON);
44
+ }
45
+ catch {
46
+ extra = null;
47
+ }
48
+ if (!extra || typeof extra !== 'object' || Array.isArray(extra) ||
49
+ Object.values(extra).some(value => typeof value !== 'string')) {
50
+ throw new PersonalConfigurationError('PERSONAL_MODEL_HEADERS_INVALID', 'ANYSWARM_MODEL_HEADERS_JSON must be a JSON object of strings.');
51
+ }
52
+ const headers = { ...extra, ...(token && { authorization: `Bearer ${token}` }) };
53
+ const bindPort = process.env.ANYSWARM_SUPER_CALLBACK_PORT === undefined ? undefined : Number(process.env.ANYSWARM_SUPER_CALLBACK_PORT);
54
+ const host = process.env.ANYSWARM_ADVERTISE_HOST ?? advertiseHost;
55
+ if (bindPort !== undefined && (!host || publicUrl || !Number.isInteger(bindPort) || bindPort < 1024 || bindPort > 65535)) {
56
+ throw new PersonalConfigurationError('PERSONAL_CALLBACK_CONFIG_INVALID', 'Durable cleanup requires a fixed callback port and a Worker-reachable ANYSWARM_ADVERTISE_HOST.');
57
+ }
58
+ return {
59
+ options: {
60
+ executor, sandbox: createSandbox(sandbox), outputDir,
61
+ connection: {
62
+ advertiseHost: host,
63
+ publicUrl: bindPort ? `http://${host}:${bindPort}` : publicUrl,
64
+ ...(bindPort && { bindPort, bindHost: host }),
65
+ modelGateway: { requestTimeoutMs: 90_000, maxOutputTokens: 3072, maxRequests: 80 },
66
+ },
67
+ models: { default: { provider, model, capabilities,
68
+ upstream: { url, headers } } },
69
+ ...(bindPort && { persistence: { deploymentId: 'personal-super-v1', contract: 'personal-super-v1' } }),
70
+ },
71
+ image: image ?? workerImageFor(executor),
72
+ };
73
+ }
74
+ export function inspectBackendConfiguration(outputDir) {
75
+ try {
76
+ runtimeOptions(outputDir);
77
+ return { configuration: 'valid', executor: 'pi', connectivity: 'unverified' };
78
+ }
79
+ catch (error) {
80
+ return { configuration: 'invalid', connectivity: 'unverified', ...backendDiagnostic(error) };
81
+ }
82
+ }
83
+ export default defaults;
@@ -0,0 +1,33 @@
1
+ import type { Artifact, Entry, Inbox } from './inbox.js';
2
+ export type Role = 'worker' | 'reviewer';
3
+ export type MemberResult = {
4
+ summary: string;
5
+ files?: Record<string, string>;
6
+ };
7
+ export interface ActiveMember {
8
+ id: string;
9
+ result: Promise<MemberResult>;
10
+ steer(text: string): Promise<string>;
11
+ stop(): Promise<string>;
12
+ }
13
+ export interface WorkSession {
14
+ route(input: object): Promise<string>;
15
+ start(role: Role, text: string, files: Record<string, string>): Promise<ActiveMember>;
16
+ close(): Promise<void>;
17
+ }
18
+ export interface WorkBackend {
19
+ open(entry: Entry, signal: AbortSignal): Promise<WorkSession>;
20
+ }
21
+ export type Baseline = {
22
+ base: string;
23
+ files: Record<string, string>;
24
+ };
25
+ export interface WorkProject {
26
+ baseline(entry: Entry, signal: AbortSignal): Promise<Baseline>;
27
+ export(entry: Entry, baseline: Baseline, files: Record<string, string>): Promise<Artifact | undefined>;
28
+ }
29
+ export declare function coordinate(inbox: Inbox, backend: WorkBackend, project: WorkProject, publish: boolean, changed: () => void): {
30
+ dispatch: () => void;
31
+ stopWork(id: string): number;
32
+ close(): Promise<void>;
33
+ };
@@ -0,0 +1,151 @@
1
+ import { Buffer } from 'node:buffer';
2
+ import { defaults } from './config.js';
3
+ function decision(message) {
4
+ const json = JSON.parse(message.trim().replace(/^```(?:json)?\s*|\s*```$/g, ''));
5
+ if (!json || typeof json !== 'object')
6
+ throw new Error('Invalid Router response');
7
+ const text = typeof json.text === 'string' && json.text.trim() && Buffer.byteLength(json.text) <= 8192;
8
+ const member = typeof json.member === 'string' && json.member.length > 0 && json.member.length <= 128;
9
+ if (text && (json.action === 'delegate' || json.action === 'start') && (json.role === 'worker' || json.role === 'reviewer'))
10
+ return json;
11
+ if (text && (json.action === 'ask' || json.action === 'reply'))
12
+ return json;
13
+ if (member && ((text && json.action === 'steer') || json.action === 'stop' || json.action === 'wait'))
14
+ return json;
15
+ throw new Error('Unsupported Router decision');
16
+ }
17
+ export function coordinate(inbox, backend, project, publish, changed) {
18
+ const active = new Map();
19
+ let stopping = false;
20
+ async function run(entry, signal) {
21
+ let session;
22
+ let delivery;
23
+ try {
24
+ session = await backend.open(entry, signal);
25
+ let baseline;
26
+ let files;
27
+ let feedback;
28
+ let review;
29
+ let member;
30
+ async function collect() {
31
+ const active = member;
32
+ const result = await active.handle.result;
33
+ member = undefined;
34
+ const puts = result.files ?? {};
35
+ if (Object.entries(puts).some(([path, text]) => !Object.hasOwn(files, path) || Buffer.byteLength(text) > defaults.fileBytes)) {
36
+ throw new Error('Worker changed a file outside the approved scope');
37
+ }
38
+ const changed = Object.keys(puts).filter(path => files[path] !== puts[path]);
39
+ if (active.role === 'worker') {
40
+ files = { ...files, ...puts };
41
+ if (changed.length)
42
+ review = undefined;
43
+ }
44
+ else
45
+ review = result.summary.trim().slice(0, 1200);
46
+ return { role: active.role, summary: result.summary.slice(0, 8192), changed };
47
+ }
48
+ for (let step = 0; step < defaults.maxTurns; step++) {
49
+ signal.throwIfAborted();
50
+ const route = decision(await session.route(step === 0 ? {
51
+ issue: entry.job.thread, work: entry.job.id, message: entry.input.text,
52
+ previousQuestion: entry.job.question, previousTurns: entry.history, previousChanges: Object.keys(entry.job.last?.files ?? {}),
53
+ } : { work: entry.job.id, feedback, activeMember: member?.handle.id, remaining: defaults.maxTurns - step - 1 }));
54
+ signal.throwIfAborted();
55
+ if (route.action === 'delegate' || route.action === 'start') {
56
+ if (member) {
57
+ feedback = { error: 'Wait for or stop the active member first' };
58
+ continue;
59
+ }
60
+ baseline ??= await project.baseline(entry, signal);
61
+ files ??= Object.fromEntries(Object.entries(baseline.files).map(([path, text]) => [path, entry.job.last?.files[path] ?? text]));
62
+ const handle = await session.start(route.role, route.text, files);
63
+ member = { handle, role: route.role };
64
+ feedback = route.action === 'delegate' ? await collect() : { started: handle.id, role: route.role };
65
+ continue;
66
+ }
67
+ if ('member' in route) {
68
+ if (!member || route.member !== member.handle.id) {
69
+ feedback = { error: 'Invalid member for this work' };
70
+ continue;
71
+ }
72
+ if (route.action === 'wait')
73
+ feedback = await collect();
74
+ else if (route.action === 'steer')
75
+ feedback = { steer: await member.handle.steer(route.text) };
76
+ else {
77
+ feedback = { stop: await member.handle.stop() };
78
+ member = undefined;
79
+ }
80
+ continue;
81
+ }
82
+ if (member) {
83
+ feedback = { error: 'Wait for or stop the active member before replying' };
84
+ continue;
85
+ }
86
+ const modified = baseline && files && Object.keys(files).some(path => files[path] !== (entry.job.last?.files[path] ?? baseline.files[path]));
87
+ if (modified && !review) {
88
+ feedback = { error: 'Delegate a read-only Reviewer to check the current edited files before asking or replying.' };
89
+ continue;
90
+ }
91
+ const patch = modified ? await project.export(entry, baseline, files) : undefined;
92
+ const artifact = patch && { ...patch, review };
93
+ signal.throwIfAborted();
94
+ if (route.action !== 'ask' && route.action !== 'reply')
95
+ throw new Error('Invalid Router final action');
96
+ delivery = {
97
+ text: route.text, reply: 'queued', result: route.action === 'ask' ? 'waiting' : 'completed',
98
+ ...(route.action === 'ask' && { question: route.text }),
99
+ ...(artifact && { artifact, publish: publish ? 'queued' : 'approval' }),
100
+ };
101
+ break;
102
+ }
103
+ if (!delivery)
104
+ throw new Error('Router did not finish within the action budget');
105
+ }
106
+ catch {
107
+ if (!signal.aborted) {
108
+ delivery = {
109
+ text: 'Personal could not complete this request. Check the Run Trace or send a follow-up to retry.',
110
+ reply: 'queued', result: 'failed',
111
+ };
112
+ }
113
+ }
114
+ finally {
115
+ await session?.close().catch(() => { });
116
+ }
117
+ if (delivery && !signal.aborted)
118
+ inbox.prepare(entry, delivery);
119
+ }
120
+ function dispatch() {
121
+ if (stopping)
122
+ return;
123
+ while (active.size < defaults.maxWork) {
124
+ const entry = inbox.claim([...active.keys()]);
125
+ if (!entry)
126
+ break;
127
+ const controller = new AbortController();
128
+ const done = run(entry, controller.signal).finally(() => {
129
+ active.delete(entry.job.id);
130
+ if (!stopping)
131
+ dispatch();
132
+ changed();
133
+ });
134
+ active.set(entry.job.id, { controller, done });
135
+ }
136
+ }
137
+ return {
138
+ dispatch,
139
+ stopWork(id) {
140
+ const changed = inbox.stop(id);
141
+ active.get(id)?.controller.abort();
142
+ return changed;
143
+ },
144
+ async close() {
145
+ stopping = true;
146
+ for (const item of active.values())
147
+ item.controller.abort();
148
+ await Promise.allSettled([...active.values()].map(item => item.done));
149
+ },
150
+ };
151
+ }
@@ -0,0 +1,11 @@
1
+ import { type Socket } from 'node:net';
2
+ import { HarnessRpcClient, type Harness } from '@anyswarm/core';
3
+ export declare function observe({ cwd, signal }: {
4
+ cwd: string;
5
+ signal: AbortSignal;
6
+ }): Promise<{
7
+ session: HarnessRpcClient;
8
+ close: () => Socket;
9
+ traceRoot: string;
10
+ } | undefined>;
11
+ export declare function serve(definition: Harness, directory: string, launchDirectory: string, signal: AbortSignal): Promise<void>;
@@ -0,0 +1,109 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { lstatSync, mkdirSync, unlinkSync } from 'node:fs';
3
+ import { connect, createServer } from 'node:net';
4
+ import { join } from 'node:path';
5
+ import { createHarnessSession, HarnessRpcClient, runProjectRpc } from '@anyswarm/core';
6
+ import { lockPersonalState, privateDirectory, stateDirectory } from './location.js';
7
+ export async function observe({ cwd, signal }) {
8
+ signal.throwIfAborted();
9
+ const directory = stateDirectory(cwd);
10
+ privateDirectory(directory);
11
+ const socket = connect(join(directory, 'rpc'));
12
+ let code;
13
+ socket.on('error', (error) => { code = error.code; });
14
+ const session = new HarnessRpcClient({
15
+ stdin: socket, stdout: socket, on: socket.on.bind(socket), off: socket.off.bind(socket),
16
+ }, { timeoutMs: 3000 });
17
+ const close = () => socket.destroy();
18
+ signal.addEventListener('abort', close, { once: true });
19
+ try {
20
+ await session.ready;
21
+ }
22
+ catch (error) {
23
+ close();
24
+ signal.throwIfAborted();
25
+ if (code === 'ENOENT' || code === 'ECONNREFUSED')
26
+ return;
27
+ throw error;
28
+ }
29
+ finally {
30
+ signal.removeEventListener('abort', close);
31
+ }
32
+ return { session, close, traceRoot: join(directory, 'runs') };
33
+ }
34
+ export async function serve(definition, directory, launchDirectory, signal) {
35
+ signal.throwIfAborted();
36
+ const release = lockPersonalState(directory);
37
+ const path = join(directory, 'rpc');
38
+ let session;
39
+ const clients = new Set();
40
+ const server = createServer(socket => {
41
+ clients.add(socket);
42
+ socket.on('error', () => { }).once('close', () => clients.delete(socket));
43
+ const write = (record) => {
44
+ if (socket.destroyed || socket.writableLength > 1024 * 1024) {
45
+ socket.destroy();
46
+ return Promise.resolve();
47
+ }
48
+ return new Promise(done => socket.write(JSON.stringify(record) + '\n', () => done()));
49
+ };
50
+ void runProjectRpc(session, socket, write, launchDirectory, undefined, { detachOnDisconnect: true })
51
+ .catch(() => { }).finally(() => socket.end());
52
+ });
53
+ server.maxConnections = 16;
54
+ const stop = () => { void session?.stop({ requestId: randomUUID(), reason: 'personal-signal' }).catch(() => { }); };
55
+ try {
56
+ // The ownership lock fences this SDK version. Also recognize a live socket from an older candidate.
57
+ const existing = await observe({ cwd: launchDirectory, signal: AbortSignal.any([signal, AbortSignal.timeout(3500)]) });
58
+ if (existing) {
59
+ existing.close();
60
+ throw new Error('Personal already has a live observer socket.');
61
+ }
62
+ try {
63
+ const stat = lstatSync(path);
64
+ if (!stat.isSocket() || stat.uid !== process.getuid?.())
65
+ throw new Error('Refusing to replace a foreign Personal socket path.');
66
+ unlinkSync(path);
67
+ }
68
+ catch (error) {
69
+ if (error.code !== 'ENOENT')
70
+ throw error;
71
+ }
72
+ const cwd = join(directory, 'launch');
73
+ mkdirSync(cwd, { mode: 0o700, recursive: true });
74
+ session = createHarnessSession(definition, {
75
+ launchDirectory: cwd, outputRoot: join(directory, 'reports'), lifetime: 'interactive', stopTimeoutMs: 55_000,
76
+ clientCapabilities: { questions: true },
77
+ });
78
+ signal.throwIfAborted();
79
+ signal.addEventListener('abort', stop, { once: true });
80
+ await session.start({ cwd, prompt: 'Run Personal GitHub inbox.' }, { requestId: randomUUID() });
81
+ await new Promise((resolve, reject) => {
82
+ server.once('error', reject).listen(path, () => {
83
+ server.removeListener('error', reject);
84
+ server.on('error', stop);
85
+ resolve();
86
+ });
87
+ });
88
+ console.error(JSON.stringify({ event: 'personal_listening', at: new Date().toISOString() }));
89
+ const result = await session.completion;
90
+ console.error(JSON.stringify({ event: 'personal_exit', outcome: result.outcome, reason: result.reason,
91
+ cleanup: result.cleanup.status, at: new Date().toISOString() }));
92
+ }
93
+ finally {
94
+ signal.removeEventListener('abort', stop);
95
+ if (session?.completion) {
96
+ stop();
97
+ await session.completion.catch(() => { });
98
+ }
99
+ const disconnect = setTimeout(() => { for (const socket of clients)
100
+ socket.destroy(); }, 1000);
101
+ try {
102
+ await new Promise(done => server.close(() => done()));
103
+ }
104
+ finally {
105
+ clearTimeout(disconnect);
106
+ release();
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,8 @@
1
+ import type { HarnessContext } from '@anyswarm/core';
2
+ import { type Inbox } from './inbox.js';
3
+ type Decision = ReturnType<Inbox['decisions']>[number];
4
+ export declare function personalDecisions(context: HarnessContext, inbox: Inbox, respond: (decision: Decision, answer: string | boolean, id: string) => void): {
5
+ refresh(): void;
6
+ close: () => void;
7
+ };
8
+ export {};
@@ -0,0 +1,52 @@
1
+ import { digest } from './inbox.js';
2
+ export function personalDecisions(context, inbox, respond) {
3
+ const cards = new Map();
4
+ const shown = new Set();
5
+ const identity = ({ entry, kind }) => kind + '-' + digest(entry.input.id).slice(0, 16);
6
+ const close = () => { for (const card of cards.values())
7
+ card.abort(); cards.clear(); };
8
+ return {
9
+ refresh() {
10
+ if (context.signal.aborted)
11
+ return;
12
+ const decisions = inbox.decisions();
13
+ const active = new Set(decisions.map(identity));
14
+ for (const [id, card] of cards)
15
+ if (!active.has(id)) {
16
+ card.abort();
17
+ cards.delete(id);
18
+ }
19
+ for (const decision of decisions) {
20
+ const id = identity(decision);
21
+ if (shown.has(id))
22
+ continue;
23
+ shown.add(id);
24
+ if (shown.size > 4096)
25
+ shown.delete(shown.values().next().value);
26
+ const { entry, kind } = decision;
27
+ const selector = '#' + entry.job.thread;
28
+ const delivery = entry.delivery;
29
+ const prompt = kind === 'publication' ? [
30
+ `Approve the patch for ${selector} (${entry.job.id.slice(0, 8)})?`,
31
+ 'Changes: ' + (delivery.artifact?.summary ?? delivery.text.slice(0, 500)),
32
+ 'Reviewer: ' + (delivery.artifact?.review ?? 'This saved patch predates recorded Reviewer summaries.'),
33
+ `/approve ${selector} or /reject ${selector} [reason]`,
34
+ ].join('\n') : `${selector} · ${delivery.question.slice(0, 1200)}\n/answer ${selector} <text> or @router ${selector} <text>`;
35
+ context.emit({ kind: 'personal-decision', summary: prompt });
36
+ if (!context.clientCapabilities.questions)
37
+ continue;
38
+ const controller = new AbortController();
39
+ cards.set(id, controller);
40
+ void context.askUser({ requestId: id, questionId: id, kind: kind === 'publication' ? 'confirm' : 'text', text: prompt,
41
+ businessRef: { work: entry.job.id, issue: entry.job.thread }, timeoutMs: 3_600_000 }, { id, signal: AbortSignal.any([controller.signal, context.signal]) }).then(answer => {
42
+ if (!controller.signal.aborted && !context.signal.aborted)
43
+ respond(decision, answer, id);
44
+ }).catch(() => {
45
+ // The durable decision remains available through /jobs and the same Slash Actions.
46
+ }).finally(() => { if (cards.get(id) === controller)
47
+ cards.delete(id); });
48
+ }
49
+ },
50
+ close,
51
+ };
52
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "apiVersion": 1,
3
+ "entry": "project.ts",
4
+ "files": ["project.ts", "config.ts", "prompts.ts", "inbox.ts", "outbox.ts", "github.ts", "artifact.ts", "coordinator.ts", "execution.ts", "location.ts", "actions.ts", "daemon.ts", "decisions.ts", "README.md"]
5
+ }
@@ -0,0 +1,11 @@
1
+ import { type JsonValue, type Runtime } from '@anyswarm/core';
2
+ import type { WorkBackend } from './coordinator.js';
3
+ export declare function personalRuntime(outputDir: string, status: () => JsonValue): {
4
+ durable: boolean;
5
+ create: () => Promise<Runtime>;
6
+ recover(runDirectory: string): Promise<import("@anyswarm/core").CloseReceipt | {
7
+ cleanup: string;
8
+ reason: string;
9
+ }>;
10
+ };
11
+ export declare function memberBackend(runtime: Runtime, members: Map<string, string>): WorkBackend;