@repo-os/repoos 0.5.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +110 -0
- package/README.md +272 -0
- package/dist/.build-info.json +4 -0
- package/dist/.build-stamp.json +3 -0
- package/dist/cli/colors.d.ts +13 -0
- package/dist/cli/colors.js +37 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +221 -0
- package/dist/commands/check.d.ts +170 -0
- package/dist/commands/check.js +1227 -0
- package/dist/commands/docs.d.ts +2 -0
- package/dist/commands/docs.js +70 -0
- package/dist/commands/gc.d.ts +1 -0
- package/dist/commands/gc.js +57 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +699 -0
- package/dist/commands/screenshots.d.ts +7 -0
- package/dist/commands/screenshots.js +77 -0
- package/dist/commands/serve.d.ts +55 -0
- package/dist/commands/serve.js +204 -0
- package/dist/commands/status.d.ts +140 -0
- package/dist/commands/status.js +569 -0
- package/dist/commands/stop.d.ts +1 -0
- package/dist/commands/stop.js +59 -0
- package/dist/commands/tasks.d.ts +47 -0
- package/dist/commands/tasks.js +334 -0
- package/dist/commands/tunnel.d.ts +1 -0
- package/dist/commands/tunnel.js +1271 -0
- package/dist/commands/ui-harness.d.ts +53 -0
- package/dist/commands/ui-harness.js +62 -0
- package/dist/commands/ui-smoke.d.ts +6 -0
- package/dist/commands/ui-smoke.js +220 -0
- package/dist/commands/upgrade.d.ts +15 -0
- package/dist/commands/upgrade.js +188 -0
- package/dist/core/auth-store.d.ts +81 -0
- package/dist/core/auth-store.js +530 -0
- package/dist/core/auth.d.ts +75 -0
- package/dist/core/auth.js +124 -0
- package/dist/core/bootstrap.d.ts +41 -0
- package/dist/core/bootstrap.js +236 -0
- package/dist/core/build.d.ts +92 -0
- package/dist/core/build.js +249 -0
- package/dist/core/canary.d.ts +10 -0
- package/dist/core/canary.js +14 -0
- package/dist/core/check-failure-summary.d.ts +10 -0
- package/dist/core/check-failure-summary.js +34 -0
- package/dist/core/config.d.ts +160 -0
- package/dist/core/config.js +1288 -0
- package/dist/core/context-pack.d.ts +74 -0
- package/dist/core/context-pack.js +778 -0
- package/dist/core/db.d.ts +236 -0
- package/dist/core/db.js +747 -0
- package/dist/core/detect.d.ts +69 -0
- package/dist/core/detect.js +251 -0
- package/dist/core/docs.d.ts +76 -0
- package/dist/core/docs.js +225 -0
- package/dist/core/frontmatter.d.ts +29 -0
- package/dist/core/frontmatter.js +215 -0
- package/dist/core/git.d.ts +505 -0
- package/dist/core/git.js +1453 -0
- package/dist/core/indexer.d.ts +33 -0
- package/dist/core/indexer.js +282 -0
- package/dist/core/input.d.ts +66 -0
- package/dist/core/input.js +222 -0
- package/dist/core/logger.d.ts +70 -0
- package/dist/core/logger.js +138 -0
- package/dist/core/models.d.ts +45 -0
- package/dist/core/models.js +291 -0
- package/dist/core/net-probe.d.ts +4 -0
- package/dist/core/net-probe.js +20 -0
- package/dist/core/providers/deepinfra.d.ts +23 -0
- package/dist/core/providers/deepinfra.js +44 -0
- package/dist/core/providers/index.d.ts +24 -0
- package/dist/core/providers/index.js +59 -0
- package/dist/core/providers/openrouter.d.ts +28 -0
- package/dist/core/providers/openrouter.js +82 -0
- package/dist/core/providers/spend.d.ts +86 -0
- package/dist/core/providers/spend.js +286 -0
- package/dist/core/providers/types.d.ts +56 -0
- package/dist/core/providers/types.js +39 -0
- package/dist/core/repoos.d.ts +59 -0
- package/dist/core/repoos.js +221 -0
- package/dist/core/runtime.d.ts +35 -0
- package/dist/core/runtime.js +167 -0
- package/dist/core/skills-registry.d.ts +39 -0
- package/dist/core/skills-registry.js +148 -0
- package/dist/core/skills-registry.test.d.ts +1 -0
- package/dist/core/skills-registry.test.js +52 -0
- package/dist/core/sysmem.d.ts +7 -0
- package/dist/core/sysmem.js +55 -0
- package/dist/core/tailscale.d.ts +2 -0
- package/dist/core/tailscale.js +19 -0
- package/dist/core/task.d.ts +53 -0
- package/dist/core/task.js +310 -0
- package/dist/core/toml-line.d.ts +20 -0
- package/dist/core/toml-line.js +52 -0
- package/dist/core/toml-validate.d.ts +44 -0
- package/dist/core/toml-validate.js +335 -0
- package/dist/core/tunnel-assistant.d.ts +30 -0
- package/dist/core/tunnel-assistant.js +65 -0
- package/dist/core/tunnel-registry.d.ts +96 -0
- package/dist/core/tunnel-registry.js +267 -0
- package/dist/core/tunnel-registry.test.d.ts +1 -0
- package/dist/core/tunnel-registry.test.js +309 -0
- package/dist/core/tunnel.d.ts +103 -0
- package/dist/core/tunnel.js +320 -0
- package/dist/core/types.d.ts +811 -0
- package/dist/core/types.js +27 -0
- package/dist/core/worktree-gc.d.ts +57 -0
- package/dist/core/worktree-gc.js +194 -0
- package/dist/server/__tests__/integration-job.test.d.ts +1 -0
- package/dist/server/__tests__/integration-job.test.js +129 -0
- package/dist/server/agents.d.ts +1020 -0
- package/dist/server/agents.js +4070 -0
- package/dist/server/attachments.d.ts +51 -0
- package/dist/server/attachments.js +130 -0
- package/dist/server/auto-engineering.d.ts +45 -0
- package/dist/server/auto-engineering.js +275 -0
- package/dist/server/branchless-release.d.ts +22 -0
- package/dist/server/branchless-release.js +67 -0
- package/dist/server/built-in-agents.d.ts +305 -0
- package/dist/server/built-in-agents.js +1838 -0
- package/dist/server/cto-monitor.d.ts +35 -0
- package/dist/server/cto-monitor.js +281 -0
- package/dist/server/cto.d.ts +125 -0
- package/dist/server/cto.js +590 -0
- package/dist/server/deployments.d.ts +119 -0
- package/dist/server/deployments.js +325 -0
- package/dist/server/diff-snapshot.d.ts +20 -0
- package/dist/server/diff-snapshot.js +73 -0
- package/dist/server/done.d.ts +160 -0
- package/dist/server/done.js +488 -0
- package/dist/server/freeform.d.ts +55 -0
- package/dist/server/freeform.js +179 -0
- package/dist/server/handoff.d.ts +99 -0
- package/dist/server/handoff.js +575 -0
- package/dist/server/hetzner.d.ts +45 -0
- package/dist/server/hetzner.js +117 -0
- package/dist/server/icons.d.ts +8 -0
- package/dist/server/icons.js +195 -0
- package/dist/server/integration-job.d.ts +75 -0
- package/dist/server/integration-job.js +144 -0
- package/dist/server/integration-orchestrator.d.ts +211 -0
- package/dist/server/integration-orchestrator.js +1299 -0
- package/dist/server/integration-status.d.ts +48 -0
- package/dist/server/integration-status.js +71 -0
- package/dist/server/live-index.d.ts +295 -0
- package/dist/server/live-index.js +452 -0
- package/dist/server/model-test.d.ts +20 -0
- package/dist/server/model-test.js +100 -0
- package/dist/server/ntfy.d.ts +57 -0
- package/dist/server/ntfy.js +112 -0
- package/dist/server/pm-attachments.d.ts +35 -0
- package/dist/server/pm-attachments.js +181 -0
- package/dist/server/pm-runs.d.ts +58 -0
- package/dist/server/pm-runs.js +80 -0
- package/dist/server/preview.d.ts +174 -0
- package/dist/server/preview.js +641 -0
- package/dist/server/release.d.ts +88 -0
- package/dist/server/release.js +449 -0
- package/dist/server/reload.d.ts +194 -0
- package/dist/server/reload.js +586 -0
- package/dist/server/remote-validation.d.ts +132 -0
- package/dist/server/remote-validation.js +478 -0
- package/dist/server/repo-lock.d.ts +36 -0
- package/dist/server/repo-lock.js +141 -0
- package/dist/server/review-guard.d.ts +14 -0
- package/dist/server/review-guard.js +159 -0
- package/dist/server/review.d.ts +243 -0
- package/dist/server/review.js +1211 -0
- package/dist/server/routes/agents.d.ts +6 -0
- package/dist/server/routes/agents.js +28 -0
- package/dist/server/routes/auth.d.ts +60 -0
- package/dist/server/routes/auth.js +755 -0
- package/dist/server/routes/config.d.ts +20 -0
- package/dist/server/routes/config.js +347 -0
- package/dist/server/routes/debugger.d.ts +33 -0
- package/dist/server/routes/debugger.js +360 -0
- package/dist/server/routes/deployments.d.ts +3 -0
- package/dist/server/routes/deployments.js +16 -0
- package/dist/server/routes/docs.d.ts +8 -0
- package/dist/server/routes/docs.js +135 -0
- package/dist/server/routes/helpers.d.ts +21 -0
- package/dist/server/routes/helpers.js +171 -0
- package/dist/server/routes/index.d.ts +19 -0
- package/dist/server/routes/index.js +18 -0
- package/dist/server/routes/info.d.ts +17 -0
- package/dist/server/routes/info.js +177 -0
- package/dist/server/routes/inputs.d.ts +7 -0
- package/dist/server/routes/inputs.js +125 -0
- package/dist/server/routes/model-providers.d.ts +27 -0
- package/dist/server/routes/model-providers.js +94 -0
- package/dist/server/routes/models.d.ts +3 -0
- package/dist/server/routes/models.js +36 -0
- package/dist/server/routes/notify.d.ts +2 -0
- package/dist/server/routes/notify.js +17 -0
- package/dist/server/routes/playground.d.ts +29 -0
- package/dist/server/routes/playground.js +81 -0
- package/dist/server/routes/release.d.ts +20 -0
- package/dist/server/routes/release.js +86 -0
- package/dist/server/routes/router.d.ts +12 -0
- package/dist/server/routes/router.js +32 -0
- package/dist/server/routes/skill-registry.d.ts +5 -0
- package/dist/server/routes/skill-registry.js +51 -0
- package/dist/server/routes/tasks.d.ts +58 -0
- package/dist/server/routes/tasks.js +1442 -0
- package/dist/server/routes/transcribe.d.ts +2 -0
- package/dist/server/routes/transcribe.js +124 -0
- package/dist/server/routes/types.d.ts +68 -0
- package/dist/server/routes/types.js +1 -0
- package/dist/server/routes/ui.d.ts +5 -0
- package/dist/server/routes/ui.js +81 -0
- package/dist/server/routes/utils.d.ts +3 -0
- package/dist/server/routes/utils.js +23 -0
- package/dist/server/serve-reaper.d.ts +135 -0
- package/dist/server/serve-reaper.js +491 -0
- package/dist/server/server.d.ts +49 -0
- package/dist/server/server.js +2171 -0
- package/dist/server/supervisor.d.ts +89 -0
- package/dist/server/supervisor.js +231 -0
- package/dist/server/system.d.ts +198 -0
- package/dist/server/system.js +480 -0
- package/dist/server/task-check.d.ts +45 -0
- package/dist/server/task-check.js +71 -0
- package/dist/server/task-transitions.d.ts +51 -0
- package/dist/server/task-transitions.js +78 -0
- package/dist/server/task-watchdog.d.ts +158 -0
- package/dist/server/task-watchdog.js +681 -0
- package/dist/server/test-run.d.ts +28 -0
- package/dist/server/test-run.js +81 -0
- package/dist/server/watcher.d.ts +21 -0
- package/dist/server/watcher.js +194 -0
- package/dist/server/write.d.ts +94 -0
- package/dist/server/write.js +345 -0
- package/dist/ui/assets/AgentsView-CF4wRvHh.css +1 -0
- package/dist/ui/assets/AgentsView-D-myL-kA.js +1 -0
- package/dist/ui/assets/ContextView-D3TC-RSp.css +1 -0
- package/dist/ui/assets/ContextView-DsOqAdyE.js +4 -0
- package/dist/ui/assets/DashboardView-BOhsIJqO.js +1 -0
- package/dist/ui/assets/DashboardView-Ck9o0RP2.css +1 -0
- package/dist/ui/assets/DeploymentsView--iIUVfEH.css +1 -0
- package/dist/ui/assets/DeploymentsView-DXu_FYR2.js +1 -0
- package/dist/ui/assets/InputsView-24HVbVPk.js +1 -0
- package/dist/ui/assets/InputsView-BLb7GHtx.css +1 -0
- package/dist/ui/assets/LoginView-6QlGg6cx.css +1 -0
- package/dist/ui/assets/LoginView-BqupI0Lt.js +1 -0
- package/dist/ui/assets/ReleasesView-BEG1A0YH.css +1 -0
- package/dist/ui/assets/ReleasesView-CAgMuxpe.js +3 -0
- package/dist/ui/assets/SettingsView-CA-NYSMK.css +1 -0
- package/dist/ui/assets/SettingsView-O3iZSnjg.js +3 -0
- package/dist/ui/assets/WorkView-D8Tl6qwy.js +1 -0
- package/dist/ui/assets/WorkView-DMYL2s3W.css +1 -0
- package/dist/ui/assets/abnfDiagram-VCTEODGH-J5lkSnEE.js +1 -0
- package/dist/ui/assets/arc-BHZnmhhM.js +1 -0
- package/dist/ui/assets/architecture-7GRP2DOG-pLdFt-xS.js +1 -0
- package/dist/ui/assets/architectureDiagram-5GKGNRK7-C3k89uKX.js +36 -0
- package/dist/ui/assets/array-BifhSqXX.js +1 -0
- package/dist/ui/assets/blockDiagram-I7D4REHJ-AWNoBzop.js +129 -0
- package/dist/ui/assets/button-lbikqSph.js +1 -0
- package/dist/ui/assets/c4Diagram-7LVT6UL2-DKG1D5gd.js +38 -0
- package/dist/ui/assets/channel-gA4qBv3A.js +1 -0
- package/dist/ui/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/dist/ui/assets/chunk-4HAMMTFA-D1YR8lF_.js +62 -0
- package/dist/ui/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/dist/ui/assets/chunk-75Z2AOVW-5GuBxfsL.js +2 -0
- package/dist/ui/assets/chunk-DU6HZSFF-DfdNNqwa.js +127 -0
- package/dist/ui/assets/chunk-F27PBJKO-BPZzinQ4.js +1 -0
- package/dist/ui/assets/chunk-FOHPRMQF-l2z4K2jD.js +161 -0
- package/dist/ui/assets/chunk-GMAD6QVW-DGWvSKj5.js +72 -0
- package/dist/ui/assets/chunk-GVQU2GXP-D6Aw75wJ.js +1 -0
- package/dist/ui/assets/chunk-IMKFNOWR-B8mMBKCW.js +231 -0
- package/dist/ui/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/dist/ui/assets/chunk-L3NEJ4N5-D5OJuXYE.js +1 -0
- package/dist/ui/assets/chunk-OSK3NFVY-B7r9w2UW.js +10 -0
- package/dist/ui/assets/chunk-P2QGCYS3-C74X4AQX.js +1 -0
- package/dist/ui/assets/chunk-POPQ4Y6H-C5_u1gUS.js +1 -0
- package/dist/ui/assets/chunk-PWAF6VOD-DfoTLtxn.js +1 -0
- package/dist/ui/assets/chunk-SHT3W25Y-D40m2eqz.js +168 -0
- package/dist/ui/assets/chunk-SVP7TREG-euxi0Kap.js +88 -0
- package/dist/ui/assets/chunk-TICWLB2K-fkdxngzN.js +206 -0
- package/dist/ui/assets/chunk-XXDRQBXY-DFBUG-OT.js +1 -0
- package/dist/ui/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/dist/ui/assets/classDiagram-ZZMXUADV-BzW8bq2P.js +1 -0
- package/dist/ui/assets/classDiagram-v2-VYDZK3BY-BzW8bq2P.js +1 -0
- package/dist/ui/assets/cose-bilkent-JH36ORCC-BTcgMon1.js +1 -0
- package/dist/ui/assets/cynefin-OW5HDTMX-B5m_COsS.js +1 -0
- package/dist/ui/assets/cynefinDiagram-5FMLGOSQ-C-AG6CGe.js +62 -0
- package/dist/ui/assets/cytoscape.esm-FBntH-9t.js +321 -0
- package/dist/ui/assets/dagre-GXQ25YYZ-DDfDnp8L.js +4 -0
- package/dist/ui/assets/dagre-PrKaheQc.js +1 -0
- package/dist/ui/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/dist/ui/assets/diagram-S7CK7UJ4-DjQZAlEY.js +30 -0
- package/dist/ui/assets/diagram-UQ7AKVKN-DAZ9yp1B.js +41 -0
- package/dist/ui/assets/diagram-VSXAHHWV-BWepUKJD.js +3 -0
- package/dist/ui/assets/diagram-VX7I27RA-EcV1J81b.js +24 -0
- package/dist/ui/assets/diagram-Z3DM3KII-Dbz7XU_K.js +24 -0
- package/dist/ui/assets/dist-DTg6UBE_.js +1 -0
- package/dist/ui/assets/ebnfDiagram-PWID7BFC-BUyQw8Mm.js +1 -0
- package/dist/ui/assets/erDiagram-RLTQ6QDP-WVf8ukKt.js +99 -0
- package/dist/ui/assets/eventmodeling-NTZA5JFV-DHqyLOAn.js +1 -0
- package/dist/ui/assets/flowDiagram-HODETNUW-CYk_ze5K.js +1 -0
- package/dist/ui/assets/ganttDiagram-EL5Y4UJY-rB4MZuB-.js +292 -0
- package/dist/ui/assets/gitGraph-4MIJSDKK-BOTWM8dY.js +1 -0
- package/dist/ui/assets/gitGraphDiagram-WWUBYQGX-eYscuhtP.js +106 -0
- package/dist/ui/assets/graphlib-DS17s2tU.js +1 -0
- package/dist/ui/assets/index-BACBfnga.css +1 -0
- package/dist/ui/assets/index-BOQ-ust6.js +26 -0
- package/dist/ui/assets/info-A6RAGUB7-_67wOORe.js +1 -0
- package/dist/ui/assets/infoDiagram-27XIBGKW-XVXbddTA.js +2 -0
- package/dist/ui/assets/init-C-OQMol4.js +1 -0
- package/dist/ui/assets/ishikawaDiagram-5VMMS53U-ClLNiEru.js +70 -0
- package/dist/ui/assets/journeyDiagram-3NMN7TZE-NRawjR6i.js +139 -0
- package/dist/ui/assets/kanban-definition-UXKFOSKX-BgSzBfIx.js +89 -0
- package/dist/ui/assets/katex-DolUETbr.js +257 -0
- package/dist/ui/assets/line-KAyfuul4.js +1 -0
- package/dist/ui/assets/linear-cCCPOpu7.js +1 -0
- package/dist/ui/assets/mermaid-parser.core-CgXZk1iN.js +7 -0
- package/dist/ui/assets/mermaid.core-BUUkChHW.js +44 -0
- package/dist/ui/assets/mindmap-definition-YA3MSWOX-Cpn7vW4r.js +96 -0
- package/dist/ui/assets/ordinal-BDEzSJ7C.js +1 -0
- package/dist/ui/assets/packet-AYTQ26CC-0lZwM-d6.js +1 -0
- package/dist/ui/assets/path-COt_16Va.js +1 -0
- package/dist/ui/assets/pegDiagram-XKGWAZYB-impy0inn.js +1 -0
- package/dist/ui/assets/pie-WAS4IAKB-CqfdGHYg.js +1 -0
- package/dist/ui/assets/pieDiagram-E7YTZNPT-CxjL4I1h.js +39 -0
- package/dist/ui/assets/quadrantDiagram-AXDQQJYC-Cjd1QMIe.js +7 -0
- package/dist/ui/assets/radar-RG4KPBEZ-CRkQIwiv.js +1 -0
- package/dist/ui/assets/railroad-74A4TZTK-i67XSWTB.js +1 -0
- package/dist/ui/assets/railroad-abnf-HS5TGJTU-Cv9m5aS3.js +1 -0
- package/dist/ui/assets/railroad-ebnf-LZEXJU2U-C5ZIn-Jh.js +1 -0
- package/dist/ui/assets/railroad-peg-WCYAUIDC-CGra9Oq-.js +1 -0
- package/dist/ui/assets/railroadDiagram-O6MQD6OU-_pK0qyaY.js +1 -0
- package/dist/ui/assets/releases-B0WNV-SY.js +1 -0
- package/dist/ui/assets/repoos-cto-square.webp +0 -0
- package/dist/ui/assets/repoos-helpful-pm-square.webp +0 -0
- package/dist/ui/assets/repoos-orchestrator-square.webp +0 -0
- package/dist/ui/assets/repoos-performance-agent-square.webp +0 -0
- package/dist/ui/assets/repoos-ross-from-friends-square.webp +0 -0
- package/dist/ui/assets/repoos-tech-debt-agent-square.webp +0 -0
- package/dist/ui/assets/requirementDiagram-BXWQKSXE-CRrFX-yw.js +84 -0
- package/dist/ui/assets/rough.esm-By172zw-.js +1 -0
- package/dist/ui/assets/sankeyDiagram-P5KCCOFB-X_xFRj9E.js +40 -0
- package/dist/ui/assets/sequenceDiagram-WJ2MYXX4-Byb49lKf.js +162 -0
- package/dist/ui/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- package/dist/ui/assets/src-BH-TyZbA.js +1 -0
- package/dist/ui/assets/stateDiagram-D77RDMKH-CzaPrqYF.js +1 -0
- package/dist/ui/assets/stateDiagram-v2-MP3YSRHH-BCXckz7K.js +1 -0
- package/dist/ui/assets/swimlanes-42K2YHIH-Cx_1lnqr.js +1 -0
- package/dist/ui/assets/swimlanesDiagram-VR7AAH4N-54qsKi6A.js +8 -0
- package/dist/ui/assets/timeline-definition-24CTP7MA-B1IbZPQ-.js +120 -0
- package/dist/ui/assets/treeView-Q6P3EWNA-DFWhVE3d.js +1 -0
- package/dist/ui/assets/treemap-WGGIJYW6-BmbYPThn.js +1 -0
- package/dist/ui/assets/vendor-ui-DPm7zLxi.js +3 -0
- package/dist/ui/assets/vendor-vue-CobgyEJp.js +1 -0
- package/dist/ui/assets/vennDiagram-4TSXK5OY-Ae2AtRpt.js +34 -0
- package/dist/ui/assets/wardley-WFR3VGLG-BtD4X4tL.js +1 -0
- package/dist/ui/assets/wardleyDiagram-VM6X3IG4-B3YN2fTd.js +78 -0
- package/dist/ui/assets/xychartDiagram-S5SC5T6Z-CIzJfMKA.js +7 -0
- package/dist/ui/favicon.svg +11 -0
- package/dist/ui/index.html +49 -0
- package/dist/ui/sw.js +48 -0
- package/package.json +91 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** The full 12-edge allow-list. Absence of a `(from, to)` pair here means the
|
|
2
|
+
* transition is rejected, from every caller, with no exceptions. */
|
|
3
|
+
export const TRANSITIONS = {
|
|
4
|
+
draft: {
|
|
5
|
+
inbox: { effect: "none", via: "generic-patch" },
|
|
6
|
+
},
|
|
7
|
+
inbox: {
|
|
8
|
+
draft: { effect: "none", via: "generic-patch" },
|
|
9
|
+
ready: { effect: "none", via: "generic-patch" },
|
|
10
|
+
},
|
|
11
|
+
ready: {
|
|
12
|
+
inbox: { effect: "none", via: "generic-patch" },
|
|
13
|
+
active: {
|
|
14
|
+
effect: "provision branch/worktree if new; clear needsInput; spawn agent",
|
|
15
|
+
via: "action:start",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
active: {
|
|
19
|
+
active: { effect: "resume agent on existing worktree", via: "action:start" },
|
|
20
|
+
review: {
|
|
21
|
+
effect: "commit + validate diff; auto-sync branch; kick off automatic review",
|
|
22
|
+
via: "generic-patch",
|
|
23
|
+
},
|
|
24
|
+
ready: { effect: "stop agent if running; worktree kept, not deleted", via: "action:abandon" },
|
|
25
|
+
},
|
|
26
|
+
review: {
|
|
27
|
+
active: {
|
|
28
|
+
effect: "resume engineer with reviewer feedback as instruction",
|
|
29
|
+
via: "generic-patch",
|
|
30
|
+
},
|
|
31
|
+
done: {
|
|
32
|
+
effect: "close-out job: merge, build, check, cleanup worktree+branch",
|
|
33
|
+
via: "action:done",
|
|
34
|
+
},
|
|
35
|
+
ready: { effect: "cancel running review; worktree kept, not deleted", via: "action:abandon" },
|
|
36
|
+
},
|
|
37
|
+
done: {
|
|
38
|
+
ready: {
|
|
39
|
+
effect: "clear stale branch reference + needsInput; re-provisioning happens on the next Start",
|
|
40
|
+
via: "action:reopen",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
/** Edges the generic write path (PATCH /api/tasks/:id, and therefore the task
|
|
45
|
+
* drawer's status dropdown and board drag-drop) may perform directly. Every
|
|
46
|
+
* other edge above requires its dedicated action endpoint. */
|
|
47
|
+
const GENERIC_PATCH_EDGES = new Set(Object.entries(TRANSITIONS).flatMap(([from, tos]) => Object.entries(tos ?? {})
|
|
48
|
+
.filter(([, edge]) => edge.via === "generic-patch")
|
|
49
|
+
.map(([to]) => `${from}->${to}`)));
|
|
50
|
+
/** Where a rejected target status should actually be requested, for a useful error message. */
|
|
51
|
+
const SUGGESTED_ACTION = {
|
|
52
|
+
active: "POST /api/tasks/:id/start",
|
|
53
|
+
done: "POST /api/tasks/:id/done",
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Whether a bare status write (no accompanying action) from `from` to `to`
|
|
57
|
+
* is allowed. `from === to` is always fine (no-op). Returns a reason and a
|
|
58
|
+
* pointer to the right endpoint when rejected.
|
|
59
|
+
*/
|
|
60
|
+
export function checkGenericStatusPatch(from, to) {
|
|
61
|
+
if (from === to)
|
|
62
|
+
return { ok: true };
|
|
63
|
+
const edge = TRANSITIONS[from]?.[to];
|
|
64
|
+
if (!edge) {
|
|
65
|
+
return {
|
|
66
|
+
ok: false,
|
|
67
|
+
reason: `cannot move a task from "${from}" directly to "${to}" — no such transition exists`,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (edge.via !== "generic-patch") {
|
|
71
|
+
const suggestion = SUGGESTED_ACTION[to];
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
reason: `"${from}" → "${to}" requires ${suggestion ?? `the ${edge.via.replace("action:", "")} action`}, not a direct status write`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return { ok: true };
|
|
78
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { RepoOSConfig, Task } from "../core/types.js";
|
|
2
|
+
import type { LiveIndex } from "./live-index.js";
|
|
3
|
+
import type { AgentRunner } from "./agents.js";
|
|
4
|
+
import type { ReviewReport, ReviewRunResult } from "./review.js";
|
|
5
|
+
/** Why a dead/stalled active task's agent session stopped. */
|
|
6
|
+
export type DeadAgentReason = "never-started" | "crashed" | "exited-without-handoff";
|
|
7
|
+
/** The dead-session classification plus the exact transcript reason string. */
|
|
8
|
+
export interface DeadAgentClassification {
|
|
9
|
+
kind: DeadAgentReason;
|
|
10
|
+
reason: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Best-effort next-step suggestion for an escalation note, matched from the
|
|
14
|
+
* captured failure reason. A generic fallback beats a wrong diagnosis.
|
|
15
|
+
*/
|
|
16
|
+
export declare function suggestNextStep(reason: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Pure stuck-detection over a task's Activity log. True when the log has a
|
|
19
|
+
* `status →active` transition and no Activity entry after it for at least
|
|
20
|
+
* `stalenessMs` (a task with zero entries after going active is the purest
|
|
21
|
+
* stuck shape — its clock runs from the transition itself).
|
|
22
|
+
*/
|
|
23
|
+
export declare function isStuckActiveTask(body: string, stalenessMs: number, now: number): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Pure stuck-detection over a task's Activity log for the `review` status.
|
|
26
|
+
* Mirrors `isStuckActiveTask` but bounds the episode by the most recent
|
|
27
|
+
* `status →review` transition: a review task is candidate-stuck when no
|
|
28
|
+
* Activity entry after it (or none at all) exists for at least `stalenessMs`.
|
|
29
|
+
*
|
|
30
|
+
* This is deliberately only the Activity-log staleness half of the decision.
|
|
31
|
+
* The "the review actually completed" half (a report file exists) and the
|
|
32
|
+
* "a review is genuinely in flight" half live in `isStuck`, because they need
|
|
33
|
+
* the `ReviewManager` and filesystem, not just the body string.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isStuckReviewTask(body: string, stalenessMs: number, now: number): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* True when a task's worktree has a file modified within `stalenessMs` of
|
|
38
|
+
* `now` — evidence of a genuinely live agent independent of the in-memory
|
|
39
|
+
* runner registry.
|
|
40
|
+
*
|
|
41
|
+
* The registry (`AgentRunner.isRunning`) is a plain in-memory Map: it goes
|
|
42
|
+
* empty on every server restart, with no record of which PID belonged to
|
|
43
|
+
* which task (#0214). During this repo's own reload-churn-heavy sessions that
|
|
44
|
+
* makes `isRunning()` report false for a still-working agent constantly, not
|
|
45
|
+
* as a rare edge case — the exact false-positive #0203 was filed against
|
|
46
|
+
* ("the agent was never dead: it kept running... and kept writing source
|
|
47
|
+
* files"). The registry cannot be trusted alone; the worktree's own file
|
|
48
|
+
* mtimes are a signal that survives a restart because they live on disk, not
|
|
49
|
+
* in server memory.
|
|
50
|
+
*/
|
|
51
|
+
export declare function hasRecentWorktreeActivity(root: string, branch: string | undefined, stalenessMs: number, now: number): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Classify why an active task's agent session is dead. The `task` is the
|
|
54
|
+
* freshly-parsed on-disk Task (its Activity log may carry a persisted
|
|
55
|
+
* `handoff failed · …` entry); `runner.output(id)` reveals whether the task
|
|
56
|
+
* ever had a session (in-memory or persisted) at all.
|
|
57
|
+
*/
|
|
58
|
+
export declare function classifyDeadAgentReason(task: Task, runner: AgentRunner): DeadAgentClassification;
|
|
59
|
+
/**
|
|
60
|
+
* Where a stuck task lands when surfaced: `review` whenever its worktree holds
|
|
61
|
+
* any work (committed branch commits OR uncommitted changes — either way it is
|
|
62
|
+
* reviewable, and moving it to `ready` could discard it on a clean restart),
|
|
63
|
+
* else `ready` to go back in the pile. Without a branch/worktree there is no
|
|
64
|
+
* work to look at, so `ready`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function autoTransitionTarget(config: RepoOSConfig, task: Task): "ready" | "review";
|
|
67
|
+
export interface TaskWatchdogOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Observed each scan; when it returns false the scan is skipped entirely.
|
|
70
|
+
* The server uses this to make the watchdog never fire mid-reload (#0180).
|
|
71
|
+
*/
|
|
72
|
+
canRun?: () => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* When true (default), a stuck task is auto-transitioned to a visible state
|
|
75
|
+
* (`review`/`ready`). When false, the #0156 fallback applies instead: the
|
|
76
|
+
* task is escalated to `needsInput` and left `active`.
|
|
77
|
+
*/
|
|
78
|
+
autoTransition?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* The review manager surface, when the watchdog should also recover dead
|
|
81
|
+
* REVIEWER sessions (#0286). Without it (or when a report already exists),
|
|
82
|
+
* review tasks are left alone entirely — the review is either complete or
|
|
83
|
+
* out of scope for this watchdog.
|
|
84
|
+
*/
|
|
85
|
+
reviews?: WatchdogReviewManager;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The minimal `ReviewManager` surface the watchdog's reviewer-recovery path
|
|
89
|
+
* depends on. Kept structural (not the concrete class) so the watchdog only
|
|
90
|
+
* couples to what it acts on and tests can substitute a fake.
|
|
91
|
+
*/
|
|
92
|
+
export interface WatchdogReviewManager {
|
|
93
|
+
/** Whether a reviewer run is currently in flight for the task. */
|
|
94
|
+
isRunning(taskId: string): boolean;
|
|
95
|
+
/** The stored review report for the task, or null when none ever completed. */
|
|
96
|
+
read(taskId: string): ReviewReport | null;
|
|
97
|
+
/** Kick off a fresh review run (the same action the human's "Review again" does). */
|
|
98
|
+
run(task: Task): Promise<ReviewRunResult>;
|
|
99
|
+
}
|
|
100
|
+
export declare class TaskWatchdog {
|
|
101
|
+
private config;
|
|
102
|
+
private index;
|
|
103
|
+
private runner;
|
|
104
|
+
private readonly autoTransition;
|
|
105
|
+
private readonly canRun?;
|
|
106
|
+
private readonly reviews?;
|
|
107
|
+
private timer;
|
|
108
|
+
private stalenessThresholdMs;
|
|
109
|
+
/** Re-entry guard: a scan already in flight is skipped by the next tick. */
|
|
110
|
+
private scanning;
|
|
111
|
+
constructor(config: RepoOSConfig, index: LiveIndex, runner: AgentRunner, stalenessThresholdMs?: number, opts?: TaskWatchdogOptions);
|
|
112
|
+
start(): void;
|
|
113
|
+
stop(): void;
|
|
114
|
+
/** Run one full scan now (used by the timer and by tests). */
|
|
115
|
+
checkNow(): Promise<void>;
|
|
116
|
+
private isStuck;
|
|
117
|
+
/**
|
|
118
|
+
* The `review`-status half of stuck detection. A review task is stuck when
|
|
119
|
+
* its reviewer session ended without ever producing a report for THIS round
|
|
120
|
+
* and no review is in flight — the silent-death shape (#0286). A report that
|
|
121
|
+
* EXISTS for the current episode (written after the current `→review`
|
|
122
|
+
* transition) means the review already completed and surfaced itself, so it
|
|
123
|
+
* is not stuck even if it "failed"; only a round that produced nothing at all
|
|
124
|
+
* needs the watchdog.
|
|
125
|
+
*/
|
|
126
|
+
private isStuckReview;
|
|
127
|
+
private handleStuck;
|
|
128
|
+
/**
|
|
129
|
+
* Recover a task whose REVIEWER session died silently mid-review (#0286).
|
|
130
|
+
*
|
|
131
|
+
* Unlike the `active` path (which resumes/restarts the ENGINEER), a dead
|
|
132
|
+
* reviewer is recovered by kicking off a FRESH reviewer run — the same
|
|
133
|
+
* action the human takes manually via "Review again". It never touches
|
|
134
|
+
* engineer state: the task stays in `review` for a human to sign off.
|
|
135
|
+
*
|
|
136
|
+
* Bounded the same way the `active` path is bounded: one automatic retry per
|
|
137
|
+
* review episode (persisted Activity marker, scoped to the current
|
|
138
|
+
* `→review` transition). If the retry is exhausted and the task is still
|
|
139
|
+
* stuck — no report, no running review — it is escalated to `needsInput`
|
|
140
|
+
* for a human instead of looping forever on a genuinely broken reviewer.
|
|
141
|
+
*/
|
|
142
|
+
private handleStuckReview;
|
|
143
|
+
/**
|
|
144
|
+
* Move a stuck task out of the silent `active` state: write the status +
|
|
145
|
+
* reason in one Activity entry, then commit so main stays mergeable and the
|
|
146
|
+
* indexing write surfaces the change to the board + ntfy notification.
|
|
147
|
+
*/
|
|
148
|
+
private surfaceTask;
|
|
149
|
+
/**
|
|
150
|
+
* Escalate a stuck task (#0156 fallback): set `needsInput: true` (which
|
|
151
|
+
* surfaces on the board and fires the existing `notifyNeedsInput`
|
|
152
|
+
* notification) and append an Activity entry with the failure reason and a
|
|
153
|
+
* suggested next step. The task stays `active` — visible, not silent.
|
|
154
|
+
*/
|
|
155
|
+
private escalateToNeedsInput;
|
|
156
|
+
private readCurrent;
|
|
157
|
+
private writeTask;
|
|
158
|
+
}
|