@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,505 @@
|
|
|
1
|
+
import type { TaskGitInfo } from "./types.js";
|
|
2
|
+
export interface GitRun {
|
|
3
|
+
status: number | null;
|
|
4
|
+
stdout: string;
|
|
5
|
+
stderr: string;
|
|
6
|
+
/** True when the child was SIGKILLed because it exceeded the timeout. */
|
|
7
|
+
timedOut?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Non-blocking `spawn` that resolves with the exit status and captured output.
|
|
11
|
+
* Never throws; a timeout kills the child. Unlike `spawnSync` this does not
|
|
12
|
+
* freeze the server's event loop, so SSE progress events can flush in real
|
|
13
|
+
* time while a long command (merge, build, check) is in flight.
|
|
14
|
+
*/
|
|
15
|
+
export declare function runGit(root: string, args: string[], timeout: number): Promise<GitRun>;
|
|
16
|
+
export declare function isGitRepo(root: string): boolean;
|
|
17
|
+
export declare function currentBranch(root: string): string | null;
|
|
18
|
+
/** ISO-8601 commit date of HEAD at `root` (a worktree or the main checkout), or null. */
|
|
19
|
+
export declare function headCommitISO(root: string): string | null;
|
|
20
|
+
/** Set of local branch names, fetched once and reused across tasks. */
|
|
21
|
+
export declare function localBranches(root: string): Set<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Commits-ahead count for EVERY local branch relative to `base`, in a single
|
|
24
|
+
* `git for-each-ref` call. The indexer needs "does this task's branch have
|
|
25
|
+
* unmerged commits" for every task; the per-branch alternative
|
|
26
|
+
* (`git rev-list --count base..branch` once per task) was ~2.5s of the index
|
|
27
|
+
* build on a repo with ~40 task branches.
|
|
28
|
+
*
|
|
29
|
+
* `%(ahead-behind:<base>)` needs git ≥ 2.41 (2023-06); on older git the field
|
|
30
|
+
* renders empty and this returns an empty map, so callers fall back to
|
|
31
|
+
* `rev-list` per branch. Fail-soft: empty map when git is missing.
|
|
32
|
+
*/
|
|
33
|
+
export declare function branchAheadCounts(root: string, base: string | null): Map<string, number>;
|
|
34
|
+
/** Last commit subject + ISO date touching a specific file. */
|
|
35
|
+
export declare function lastCommitForFile(root: string, relPath: string): {
|
|
36
|
+
subject: string | null;
|
|
37
|
+
date: string | null;
|
|
38
|
+
};
|
|
39
|
+
/** Async counterpart of lastCommitForFile - see gitAsync. */
|
|
40
|
+
export declare function lastCommitForFileAsync(root: string, relPath: string): Promise<{
|
|
41
|
+
subject: string | null;
|
|
42
|
+
date: string | null;
|
|
43
|
+
}>;
|
|
44
|
+
export type LastCommit = {
|
|
45
|
+
subject: string | null;
|
|
46
|
+
date: string | null;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Last commit subject + ISO date for EVERY tracked file under `relDir`, in a
|
|
50
|
+
* SINGLE `git log` pass. The indexer needs this for every task file; calling
|
|
51
|
+
* `lastCommitForFile` per task instead runs one full history walk per file,
|
|
52
|
+
* which was a large share of RepoOS's slow index build at 200+ tasks (#0271
|
|
53
|
+
* follow-up). Keys are paths relative to `root`, matching `Task.path`.
|
|
54
|
+
* Fail-soft: an empty map when git is missing or the walk fails.
|
|
55
|
+
*/
|
|
56
|
+
export declare function lastCommitsForDir(root: string, relDir: string): Map<string, LastCommit>;
|
|
57
|
+
/** Async counterpart of `lastCommitsForDir` - see `gitAsync`. */
|
|
58
|
+
export declare function lastCommitsForDirAsync(root: string, relDir: string): Promise<Map<string, LastCommit>>;
|
|
59
|
+
/**
|
|
60
|
+
* Turn on git's own fast-status machinery for `root` (and, since worktrees
|
|
61
|
+
* share `.git/config`, every task worktree cut from it). RepoOS runs
|
|
62
|
+
* `git status --porcelain` once per task worktree on every index build; on a
|
|
63
|
+
* large monorepo each of those is a full tree stat-walk. `core.fsmonitor`
|
|
64
|
+
* lets git's builtin file-system-monitor daemon (git ≥ 2.37, macOS/Windows/
|
|
65
|
+
* Linux) skip unchanged directories, and `core.untrackedCache` caches the
|
|
66
|
+
* per-directory untracked-file scan. Both are opt-in per repo and safe:
|
|
67
|
+
* git falls back to a full scan if the daemon is unavailable.
|
|
68
|
+
*
|
|
69
|
+
* Idempotent, best-effort, and cheap — call it once at startup. Skips any key
|
|
70
|
+
* already set to the desired value, so a repo that has been tuned once pays
|
|
71
|
+
* only two `git config --get` reads on subsequent boots.
|
|
72
|
+
*/
|
|
73
|
+
export declare function tuneRepoForScale(root: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* True when git tracks `relPath` in the checkout at `root` and its working
|
|
76
|
+
* copy matches HEAD — i.e. whatever the file currently shows is backed by a
|
|
77
|
+
* commit, not a stray mid-edit. Untracked or dirty files return false.
|
|
78
|
+
* Used to prove a worktree's committed task-file state before trusting it.
|
|
79
|
+
*/
|
|
80
|
+
export declare function fileCommittedClean(root: string, relPath: string): boolean;
|
|
81
|
+
export declare function emptyGitInfo(): TaskGitInfo;
|
|
82
|
+
export interface EnsureWorktreeResult {
|
|
83
|
+
ok: boolean;
|
|
84
|
+
/** Absolute path of the working directory the agent should use. */
|
|
85
|
+
path: string;
|
|
86
|
+
/** True when a brand-new worktree was created. */
|
|
87
|
+
created: boolean;
|
|
88
|
+
/** Human-readable failure reason (when not ok). */
|
|
89
|
+
reason?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface WorktreeEntry {
|
|
92
|
+
/** Absolute path of the linked worktree. */
|
|
93
|
+
path: string;
|
|
94
|
+
/** The commit SHA the worktree currently has checked out. */
|
|
95
|
+
head: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Branch -> { path, head } for every registered linked worktree, derived from
|
|
99
|
+
* a single `git worktree list --porcelain`. Empty map when git is missing.
|
|
100
|
+
* Callers resolving several branches at once (indexer, live index) MUST call
|
|
101
|
+
* this once and reuse the map — every call shells out to git.
|
|
102
|
+
*
|
|
103
|
+
* `head` lets a caller skip an expensive per-worktree `git status` when the
|
|
104
|
+
* worktree has not moved since a cached check (see the indexer's worktree
|
|
105
|
+
* dirty-status cache).
|
|
106
|
+
*/
|
|
107
|
+
export declare function worktreeList(root: string): Map<string, WorktreeEntry>;
|
|
108
|
+
export interface WorktreeInfo {
|
|
109
|
+
/** Absolute path of the linked worktree (as git reports it). */
|
|
110
|
+
path: string;
|
|
111
|
+
/** Checked-out branch, or null for a detached HEAD. */
|
|
112
|
+
branch: string | null;
|
|
113
|
+
/** The commit SHA the worktree currently has checked out. */
|
|
114
|
+
head: string;
|
|
115
|
+
/** True for the repository's own main checkout (`git worktree list` lists it first). */
|
|
116
|
+
isMain: boolean;
|
|
117
|
+
/** True for a bare repository entry. */
|
|
118
|
+
isBare: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Every entry from `git worktree list --porcelain`, including detached-HEAD and
|
|
122
|
+
* bare entries that `worktreeList` (branch-keyed) necessarily drops. The garbage
|
|
123
|
+
* collector needs the full picture so it can also prune worktrees that lost
|
|
124
|
+
* their branch ref. Empty when git is missing.
|
|
125
|
+
*/
|
|
126
|
+
export declare function listWorktrees(root: string): WorktreeInfo[];
|
|
127
|
+
/**
|
|
128
|
+
* Branch -> worktree path for every registered linked worktree. Thin
|
|
129
|
+
* projection of `worktreeList` kept for the many callers that only need the
|
|
130
|
+
* path; prefer `worktreeList` when you also want the checked-out SHA.
|
|
131
|
+
*/
|
|
132
|
+
export declare function worktreePaths(root: string): Map<string, string>;
|
|
133
|
+
/**
|
|
134
|
+
* Absolute path of the worktree that has `branch` checked out, or null when the
|
|
135
|
+
* branch has no linked worktree (or git is missing). The main checkout's own
|
|
136
|
+
* branch resolves to the repo root. Uses `git worktree list --porcelain` —
|
|
137
|
+
* never string concatenation — so branch names with `/` and exotic characters
|
|
138
|
+
* resolve correctly.
|
|
139
|
+
*/
|
|
140
|
+
export declare function worktreePathForBranch(root: string, branch: string): string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Make sure the agent for `branch` has a dedicated working directory WITHOUT
|
|
143
|
+
* touching the main worktree's checkout. Three outcomes:
|
|
144
|
+
*
|
|
145
|
+
* - branch is what the main worktree already has checked out -> use root
|
|
146
|
+
* - branch already has a linked worktree -> reuse it (idempotent)
|
|
147
|
+
* - otherwise -> `git worktree add` a sibling directory for it
|
|
148
|
+
*
|
|
149
|
+
* Fail-soft like the branch-switching predecessor: returns `{ ok: false,
|
|
150
|
+
* reason }` when git is missing or the worktree can't be created, so agent
|
|
151
|
+
* launch degrades gracefully instead of crashing the server.
|
|
152
|
+
*
|
|
153
|
+
* `taskRelPath`, when given, is the task's own file path relative to `root`
|
|
154
|
+
* (e.g. `work/0151-....md`). Whichever worktree is resolved — new or reused —
|
|
155
|
+
* is healed if that file is missing from it; see `healMissingTaskFile`.
|
|
156
|
+
*/
|
|
157
|
+
export declare function ensureWorktree(root: string, branch: string, taskRelPath?: string): EnsureWorktreeResult;
|
|
158
|
+
export interface WorktreeStatus {
|
|
159
|
+
/** Absolute path of the linked worktree for `branch`, or null. */
|
|
160
|
+
path: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Whether a clean restart would discard prior work: the linked worktree has
|
|
163
|
+
* uncommitted changes, or the branch has commits not in the main checkout's
|
|
164
|
+
* branch. False when no linked worktree exists — the main checkout itself
|
|
165
|
+
* is never a task worktree.
|
|
166
|
+
*/
|
|
167
|
+
dirty: boolean;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Best-effort facts about a task's worktree, derived from `git worktree list`
|
|
171
|
+
* plus a status check inside the worktree. Fail-soft: any git failure yields
|
|
172
|
+
* a safe `{ path: null, dirty: false }`.
|
|
173
|
+
*
|
|
174
|
+
* `opts.worktrees`/`opts.baseBranch` let a caller looping over many tasks
|
|
175
|
+
* against the same repo (e.g. `buildIndex`) pass in a `worktreePaths`/
|
|
176
|
+
* `currentBranch` result it already fetched once, instead of this function
|
|
177
|
+
* re-running those two `git` spawns on every single task (#0271 follow-up:
|
|
178
|
+
* this redundancy was a large share of RepoOS's slow boot with 260+ tasks).
|
|
179
|
+
* Omit them and behavior is unchanged — each call fetches fresh.
|
|
180
|
+
*/
|
|
181
|
+
export declare function worktreeStatus(root: string, branch: string, opts?: {
|
|
182
|
+
worktrees?: Map<string, string>;
|
|
183
|
+
baseBranch?: string | null;
|
|
184
|
+
}): WorktreeStatus;
|
|
185
|
+
/** Async counterpart of `worktreeStatus` — see `gitAsync`. */
|
|
186
|
+
export declare function worktreeStatusAsync(root: string, branch: string, opts?: {
|
|
187
|
+
worktrees?: Map<string, string>;
|
|
188
|
+
baseBranch?: string | null;
|
|
189
|
+
}): Promise<WorktreeStatus>;
|
|
190
|
+
/** Per-branch working-tree dirtiness, keyed to the SHA it was checked at. */
|
|
191
|
+
export interface WorktreeDirtyEntry {
|
|
192
|
+
/** The worktree HEAD SHA this `uncommitted` value was computed against. */
|
|
193
|
+
head: string;
|
|
194
|
+
/** True when `git status --porcelain` in the worktree was non-empty. */
|
|
195
|
+
uncommitted: boolean;
|
|
196
|
+
}
|
|
197
|
+
export type WorktreeDirtyCache = Map<string, WorktreeDirtyEntry>;
|
|
198
|
+
/**
|
|
199
|
+
* Resolve `WorktreeStatus` for MANY branches with a bounded number of git
|
|
200
|
+
* spawns instead of three per branch:
|
|
201
|
+
*
|
|
202
|
+
* - one `git worktree list --porcelain` (paths + HEAD SHAs)
|
|
203
|
+
* - one `git for-each-ref` for every branch's ahead count
|
|
204
|
+
* - one `git status --porcelain` per worktree WHOSE HEAD MOVED since `cache`
|
|
205
|
+
* (all of them on a cold cache; usually none on a server reload)
|
|
206
|
+
*
|
|
207
|
+
* `opts.cache` is consulted and updated in place; `changed` says whether it
|
|
208
|
+
* needs persisting. `opts.skipStatus` returns the cached dirtiness verbatim
|
|
209
|
+
* and never runs `git status` — the fast boot path, paired with a later
|
|
210
|
+
* reconcile sweep. Fail-soft throughout: a git failure yields
|
|
211
|
+
* `{ path: null, dirty: false }` for that branch, matching `worktreeStatus`.
|
|
212
|
+
*/
|
|
213
|
+
export declare function resolveWorktreeStatuses(root: string, branches: Iterable<string>, opts: {
|
|
214
|
+
baseBranch: string | null;
|
|
215
|
+
cache?: WorktreeDirtyCache;
|
|
216
|
+
skipStatus?: boolean;
|
|
217
|
+
}): Promise<{
|
|
218
|
+
statuses: Map<string, WorktreeStatus>;
|
|
219
|
+
cache: WorktreeDirtyCache;
|
|
220
|
+
changed: boolean;
|
|
221
|
+
}>;
|
|
222
|
+
/**
|
|
223
|
+
* Discard a task's worktree AND its branch so the next `ensureWorktree`
|
|
224
|
+
* re-creates both from the main checkout's HEAD — a clean restart. The main
|
|
225
|
+
* checkout itself is never touched. Fail-soft: false when git is missing,
|
|
226
|
+
* the branch is the main checkout, or a removal step failed.
|
|
227
|
+
*/
|
|
228
|
+
export declare function resetWorktree(root: string, branch: string): boolean;
|
|
229
|
+
export interface BranchChangesSinceBase {
|
|
230
|
+
/** Short ref of the branch point (merge-base), or null when undeterminable. */
|
|
231
|
+
base: string | null;
|
|
232
|
+
/** Paths that differ from the branch point, committed or uncommitted. */
|
|
233
|
+
paths: string[];
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* What the branch checked out in `worktree` has changed relative to its branch
|
|
237
|
+
* point — the merge-base with `baseBranch` — combining already-committed
|
|
238
|
+
* changes with the current uncommitted working-tree diff. This is the correct
|
|
239
|
+
* base for "did the agent implement anything": diffing against `baseBranch`
|
|
240
|
+
* itself would count unrelated main drift as the branch's own work. When the
|
|
241
|
+
* base cannot be resolved (no git, or the two branches share no ancestor)
|
|
242
|
+
* returns `{ base: null, paths: [] }` so callers can fail soft rather than
|
|
243
|
+
* block on a false positive.
|
|
244
|
+
*/
|
|
245
|
+
export declare function branchChangesSinceBase(worktree: string, baseBranch: string): BranchChangesSinceBase;
|
|
246
|
+
export interface DiffStats {
|
|
247
|
+
filesChanged: number;
|
|
248
|
+
additions: number;
|
|
249
|
+
deletions: number;
|
|
250
|
+
}
|
|
251
|
+
export interface DiffResult {
|
|
252
|
+
patch: string;
|
|
253
|
+
truncated: boolean;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get diff statistics comparing a branch point to the current worktree.
|
|
257
|
+
* This deliberately includes committed, staged, and unstaged source edits so
|
|
258
|
+
* the task drawer can show an agent's work before its handoff commit.
|
|
259
|
+
* Generated build output is excluded because it is not task source.
|
|
260
|
+
* Returns file count and line additions/deletions.
|
|
261
|
+
*/
|
|
262
|
+
export declare function getDiffStats(worktree: string, baseBranch: string): DiffStats;
|
|
263
|
+
/**
|
|
264
|
+
* Non-blocking counterpart to `getDiffStats`, built on `runGit` (`spawn`)
|
|
265
|
+
* instead of `git`'s `execFileSync`. Every task card on the Work board fetches
|
|
266
|
+
* its diff stats on mount (`TaskCard.vue`), so a board with N cards fires N
|
|
267
|
+
* of these on every reload/tab-switch; the synchronous version froze the
|
|
268
|
+
* entire server's event loop for the duration of all of them serially —
|
|
269
|
+
* including whatever `GET /api/tasks/:id` a drawer-opening click was waiting
|
|
270
|
+
* on — which is what made the drawer take several seconds to appear.
|
|
271
|
+
*/
|
|
272
|
+
export declare function getDiffStatsAsync(worktree: string, baseBranch: string): Promise<DiffStats>;
|
|
273
|
+
/**
|
|
274
|
+
* Get the full patch diff from a branch point to the current worktree.
|
|
275
|
+
* This includes committed, staged, and unstaged source edits, while leaving
|
|
276
|
+
* generated build output out of the task-facing code review view.
|
|
277
|
+
* Bounded at MAX_DIFF_BYTES to avoid sending giant payloads.
|
|
278
|
+
*/
|
|
279
|
+
export declare function getDiff(worktree: string, baseBranch: string): Promise<DiffResult>;
|
|
280
|
+
/**
|
|
281
|
+
* The paths changed between `baseBranch` and the current worktree HEAD
|
|
282
|
+
* (`git diff --name-only <baseBranch> HEAD`), used by the close-out gate's
|
|
283
|
+
* docs-only fast path (#0355) to decide whether the full build/check gate can
|
|
284
|
+
* be skipped.
|
|
285
|
+
*
|
|
286
|
+
* Unlike `getDiff`/`getDiffStats`, this deliberately does NOT go through
|
|
287
|
+
* `merge-base`: the caller wants the cumulative difference between the base
|
|
288
|
+
* branch tip and the candidate commit (which already contains the merge), not
|
|
289
|
+
* the branch's own commits. Returns `null` — never `[]` — when git errors or
|
|
290
|
+
* times out, so a caller can distinguish "no changes" from "could not tell"
|
|
291
|
+
* and fail safe by running the full gate.
|
|
292
|
+
*/
|
|
293
|
+
export declare function getChangedFilePaths(worktree: string, baseBranch: string, timeout?: number): Promise<string[] | null>;
|
|
294
|
+
/** Whether git is installed at all (independent of being inside a repo). */
|
|
295
|
+
export declare function gitAvailable(root: string): boolean;
|
|
296
|
+
/** `git config --get <key>` value, or null when unset or git is missing. */
|
|
297
|
+
export declare function gitConfig(root: string, key: string): string | null;
|
|
298
|
+
/** Run `git init` in root. True on success. */
|
|
299
|
+
export declare function gitInit(root: string): boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Commit the ENTIRE working tree. Only for a freshly scaffolded repo where
|
|
302
|
+
* nothing else is pre-staged (the guided `repoos init` flow) — do NOT use this
|
|
303
|
+
* where 0023's surgical `commitNewFile` applies. Fail-soft: null on failure.
|
|
304
|
+
*/
|
|
305
|
+
export declare function gitCommitAll(root: string, message: string): string | null;
|
|
306
|
+
export interface CommitNewFileResult {
|
|
307
|
+
ok: boolean;
|
|
308
|
+
/** Short commit hash (when committed). */
|
|
309
|
+
hash?: string;
|
|
310
|
+
/** Human-readable failure reason (when not committed). */
|
|
311
|
+
reason?: string;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Surgically commit a single new file with the user's own git identity.
|
|
315
|
+
*
|
|
316
|
+
* `git commit --only` refuses paths git doesn't know, so we first run
|
|
317
|
+
* `git add -N` (intent-to-add): it registers the path WITHOUT staging any
|
|
318
|
+
* content, then `git commit -o -m <msg> -- <file>` commits only that file's
|
|
319
|
+
* working-tree content and IGNORES whatever else is staged or dirty. Never
|
|
320
|
+
* `git add -A`, never a plain `git commit`, never amend/force, hooks run.
|
|
321
|
+
*
|
|
322
|
+
* Fail-soft: never throws, never leaves content partially staged. On any
|
|
323
|
+
* problem it returns `{ ok: false, reason }` and the caller keeps the file.
|
|
324
|
+
*/
|
|
325
|
+
export declare function commitNewFile(root: string, absPath: string, message: string): CommitNewFileResult;
|
|
326
|
+
/**
|
|
327
|
+
* Whether `ancestor` is an ancestor of `descendant` (i.e. a fast-forward merge
|
|
328
|
+
* of `descendant` into a checkout on `ancestor` is possible). Uses
|
|
329
|
+
* `git merge-base --is-ancestor` exit codes; null when git is missing or the
|
|
330
|
+
* refs are invalid.
|
|
331
|
+
*/
|
|
332
|
+
export declare function isAncestor(root: string, ancestor: string, descendant: string): boolean | null;
|
|
333
|
+
export interface MergeBranchResult {
|
|
334
|
+
/** Whether the branch was merged into the current checkout. */
|
|
335
|
+
merged: boolean;
|
|
336
|
+
/** Whether the merge was a fast-forward (or the branch was already in). */
|
|
337
|
+
ff: boolean;
|
|
338
|
+
/** Files with merge conflicts when the merge aborted. */
|
|
339
|
+
conflicts: string[];
|
|
340
|
+
/** Human-readable failure reason (not merged and not a conflict). */
|
|
341
|
+
reason?: string;
|
|
342
|
+
}
|
|
343
|
+
export interface PreflightMergeResult {
|
|
344
|
+
/** True when the merge would complete without source conflicts. */
|
|
345
|
+
ok: boolean;
|
|
346
|
+
/** True when main is not an ancestor of the branch (a merge commit would be required). */
|
|
347
|
+
drifted: boolean;
|
|
348
|
+
/** Conflicted source file paths when `ok` is false. */
|
|
349
|
+
conflicts: string[];
|
|
350
|
+
/** Human-readable failure reason. */
|
|
351
|
+
reason?: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Cheap, non-destructive pre-flight for merging `branch` into the CURRENT
|
|
355
|
+
* checkout. Uses `git merge --no-commit` and always aborts, so the working
|
|
356
|
+
* tree is left untouched (blocking files may be committed first, as the real
|
|
357
|
+
* `mergeBranch` does, to keep the pre-flight honest).
|
|
358
|
+
*
|
|
359
|
+
* Returns `ok: true` for a clean merge (fast-forward or merge commit), and
|
|
360
|
+
* `ok: false` with the conflict file list when source files would conflict.
|
|
361
|
+
* `drifted` is true whenever main is not an ancestor of the branch.
|
|
362
|
+
*/
|
|
363
|
+
export declare function preflightMerge(root: string, branch: string, opts?: {
|
|
364
|
+
autoResolve?: string[];
|
|
365
|
+
}): Promise<PreflightMergeResult>;
|
|
366
|
+
/**
|
|
367
|
+
* Commit a single task file in the main checkout, tracking it first when it is
|
|
368
|
+
* untracked. Task files are the one path that is routinely edited on both sides
|
|
369
|
+
* of a close-out merge: an untracked file aborts `git merge` outright, and a
|
|
370
|
+
* dirty one aborts it with "local changes would be overwritten". Committing the
|
|
371
|
+
* main copy up front (fail-soft) removes both failure modes — the content is
|
|
372
|
+
* preserved in history either way. Returns false when git failed and the file
|
|
373
|
+
* is not clean; callers should treat that as a merge blocker.
|
|
374
|
+
*/
|
|
375
|
+
export declare function commitTaskFile(root: string, absPath: string, message: string): boolean;
|
|
376
|
+
/**
|
|
377
|
+
* The dirty/uncommitted file paths in a checkout (`git status --porcelain`),
|
|
378
|
+
* including tracked modifications and untracked files, in repo-relative form.
|
|
379
|
+
* Used by the close-out flow to check `main` before merging: a dirty tree
|
|
380
|
+
* aborts `git merge`, so the UI surfaces these so it can offer to commit them.
|
|
381
|
+
*
|
|
382
|
+
* FAILS CLOSED: returns `[]` only for a genuinely clean tree (git exit 0 with
|
|
383
|
+
* empty output). Any git failure — a non-zero exit, a timeout, or git being
|
|
384
|
+
* unavailable — throws `GitDirtyCheckError` instead, so a caller cannot
|
|
385
|
+
* mistake an unknown state for a clean tree and silently proceed into a merge
|
|
386
|
+
* that git will abort. This is the fix for #0211, where the old fail-open
|
|
387
|
+
* behaved that way under load.
|
|
388
|
+
*/
|
|
389
|
+
export declare class GitDirtyCheckError extends Error {
|
|
390
|
+
readonly causeKind: "timeout" | "git-error" | "no-repo";
|
|
391
|
+
constructor(causeKind: "timeout" | "git-error" | "no-repo", detail?: string);
|
|
392
|
+
}
|
|
393
|
+
export declare function dirtyFiles(root: string): Promise<string[]>;
|
|
394
|
+
/**
|
|
395
|
+
* Stage and commit every dirty/uncommitted file in a checkout with a single
|
|
396
|
+
* checkpoint commit so the tree is left clean and mergeable. Used before a
|
|
397
|
+
* close-out merge when the user opts in ("Commit & continue"). Returns the
|
|
398
|
+
* list of committed dirty files on success (matching `dirtyFiles`), or an
|
|
399
|
+
* empty array when the tree was clean or the commit failed.
|
|
400
|
+
*/
|
|
401
|
+
export declare function commitDirtyFiles(root: string, message: string): Promise<string[]>;
|
|
402
|
+
/**
|
|
403
|
+
* Merge `branch` into the CURRENT checkout — the main worktree, never the
|
|
404
|
+
* task's worktree. Default merge semantics: fast-forward when main is an
|
|
405
|
+
* ancestor of the branch, otherwise a merge commit (`--no-edit` so we never
|
|
406
|
+
* block on an editor). Longer timeout than `git()`: real merges are slow.
|
|
407
|
+
*
|
|
408
|
+
* A dirty working tree aborts `git merge` outright (e.g. the build marker that
|
|
409
|
+
* `repoos check` regenerates on every run). Rather than fail, the exact files
|
|
410
|
+
* git refuses to overwrite are committed and the merge is retried once.
|
|
411
|
+
*
|
|
412
|
+
* On a conflict the merge is aborted (`git merge --abort`) so nothing is left
|
|
413
|
+
* half-applied; the conflicted file list is returned and the branch stays
|
|
414
|
+
* untouched. The exception: when every conflicted path is listed in
|
|
415
|
+
* `opts.autoResolve`, the branch's version is taken (`--theirs`) and the merge
|
|
416
|
+
* is completed — used for the task file, which always changes on both sides of
|
|
417
|
+
* a close-out merge and whose branch version is authoritative for the task's
|
|
418
|
+
* final state.
|
|
419
|
+
*
|
|
420
|
+
* `opts.dryRun` answers the same conflict question non-destructively (see
|
|
421
|
+
* `dryRunMergeBranch`) — no commit, no branch move, the checkout restored.
|
|
422
|
+
*/
|
|
423
|
+
export declare function mergeBranch(root: string, branch: string, opts?: {
|
|
424
|
+
autoResolve?: string[];
|
|
425
|
+
autoResolveOurs?: string[];
|
|
426
|
+
dryRun?: boolean;
|
|
427
|
+
}): Promise<MergeBranchResult>;
|
|
428
|
+
export interface SyncBranchResult {
|
|
429
|
+
/** Whether the branch was synced (main merged into its worktree). */
|
|
430
|
+
ok: boolean;
|
|
431
|
+
/** Files that conflicted when the sync merge was aborted. */
|
|
432
|
+
conflicts: string[];
|
|
433
|
+
/** Human-readable failure reason (when not ok). */
|
|
434
|
+
reason?: string;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Sync `branch` with main: merge the main checkout's current branch into
|
|
438
|
+
* `branch`'s linked worktree. This is the repository's existing "sync with
|
|
439
|
+
* main" operation — the same `mergeBranch` semantics the review-transition
|
|
440
|
+
* auto-sync uses, so the automatic done-flow fallback and the manual route
|
|
441
|
+
* never diverge. On conflict the merge is aborted (nothing half-applied) and
|
|
442
|
+
* the conflict list is returned. Fail-soft: false when the branch has no
|
|
443
|
+
* linked worktree or git is missing.
|
|
444
|
+
*/
|
|
445
|
+
export declare function syncBranchWithMain(root: string, branch: string, opts?: {
|
|
446
|
+
autoResolve?: string[];
|
|
447
|
+
}): Promise<SyncBranchResult>;
|
|
448
|
+
/**
|
|
449
|
+
* Delete a local branch. The close-out flow only ever deletes a branch that
|
|
450
|
+
* was just merged into main, so `-d` (refuses unless fully merged) is the
|
|
451
|
+
* default. Pass `force: true` for a throwaway branch (a `repoos/integrate/*`
|
|
452
|
+
* candidate) that git will not see as merged.
|
|
453
|
+
* Fail-soft: false when the branch is gone, not merged, or git is missing —
|
|
454
|
+
* the caller treats it as best-effort cleanup.
|
|
455
|
+
*/
|
|
456
|
+
export declare function deleteBranch(root: string, branch: string, opts?: {
|
|
457
|
+
force?: boolean;
|
|
458
|
+
}): boolean;
|
|
459
|
+
/** `git worktree prune` — clears metadata for worktrees whose directory is gone. */
|
|
460
|
+
export declare function pruneWorktrees(root: string): void;
|
|
461
|
+
/**
|
|
462
|
+
* Remove the linked worktree for `branch` and make sure it is really gone.
|
|
463
|
+
* Forced when dirty — close-out content is preserved in the merged main, so
|
|
464
|
+
* nothing is lost.
|
|
465
|
+
*
|
|
466
|
+
* Handles the two states a leak actually shows up in:
|
|
467
|
+
* - directory + metadata present -> `git worktree remove --force`
|
|
468
|
+
* - directory gone, metadata stale -> `remove` fails ("is not a working
|
|
469
|
+
* tree"), so fall back to `git worktree prune`, then `rm -rf` any leftover
|
|
470
|
+
* directory and prune once more.
|
|
471
|
+
*
|
|
472
|
+
* Returns false (without forcing anything) when `branch` is checked out in a
|
|
473
|
+
* DIFFERENT worktree than expected, or is the main checkout — the caller asked
|
|
474
|
+
* to remove the wrong thing.
|
|
475
|
+
*/
|
|
476
|
+
export declare function removeWorktree(root: string, branch: string): boolean;
|
|
477
|
+
export interface EnsureHotfixResult {
|
|
478
|
+
ok: boolean;
|
|
479
|
+
/** Always config.root — the hotfix runs in the main checkout. */
|
|
480
|
+
path: string;
|
|
481
|
+
/** The branch created or reused. */
|
|
482
|
+
branch: string;
|
|
483
|
+
/** Human-readable failure reason. */
|
|
484
|
+
reason?: string;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Prepare the main checkout for a hotfix task.
|
|
488
|
+
*
|
|
489
|
+
* 1. Create a `hotfix/<id>-<slug>` branch from main (when hotfixTarget is
|
|
490
|
+
* "branch") or stay on main (when target is "main").
|
|
491
|
+
* 2. Refuse if the main checkout is dirty.
|
|
492
|
+
* 3. Return config.root as the working directory — the agent runs here.
|
|
493
|
+
*/
|
|
494
|
+
export declare function ensureHotfix(root: string, branch: string, hotfixTarget: "branch" | "main"): EnsureHotfixResult;
|
|
495
|
+
/**
|
|
496
|
+
* Reset the main checkout back to `main` after a hotfix, discarding any
|
|
497
|
+
* in-flight work. Only touches root when it's on a hotfix branch.
|
|
498
|
+
*/
|
|
499
|
+
export declare function resetHotfix(root: string, branch: string): boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Get agent-touched files in the working directory: the union of tracked
|
|
502
|
+
* worktree-changed files and newly-added files since the last ref, excluding
|
|
503
|
+
* dist/ and screenshots/. Returns an empty list on git failure.
|
|
504
|
+
*/
|
|
505
|
+
export declare function agentTouchedFiles(root: string, sinceRef: string): string[];
|