@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,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-staleness detection for linked dev builds.
|
|
3
|
+
*
|
|
4
|
+
* When `repoos` is run from a linked dev install (both `src/` and `dist/`
|
|
5
|
+
* exist beside the running binary), compares a hash of `src/` against the
|
|
6
|
+
* marker written by the build pipeline. Stale builds produce a warning or
|
|
7
|
+
* error; published installs (no `src/`) are a silent no-op.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
10
|
+
import { dirname, join } from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the package root relative to the running binary.
|
|
15
|
+
* Same resolution pattern as findUiHtml in server.ts.
|
|
16
|
+
*/
|
|
17
|
+
export function findPackageRoot() {
|
|
18
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
// compiled: dist/core/build.js -> repo root is ../..
|
|
20
|
+
// dev: src/core/build.ts -> repo root is ../..
|
|
21
|
+
const parent = dirname(here);
|
|
22
|
+
const grandparent = dirname(parent);
|
|
23
|
+
if (existsSync(join(grandparent, "package.json")))
|
|
24
|
+
return grandparent;
|
|
25
|
+
// fallback: try one more level up
|
|
26
|
+
const great = dirname(grandparent);
|
|
27
|
+
if (existsSync(join(great, "package.json")))
|
|
28
|
+
return great;
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
/** Compute a sha256 hash of every file under src/. Returns null if src/ absent. */
|
|
32
|
+
function hashSrcDir(root) {
|
|
33
|
+
const srcDir = join(root, "src");
|
|
34
|
+
if (!existsSync(srcDir))
|
|
35
|
+
return null;
|
|
36
|
+
const hash = createHash("sha256");
|
|
37
|
+
const files = [];
|
|
38
|
+
function walk(dir) {
|
|
39
|
+
let entries;
|
|
40
|
+
try {
|
|
41
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
for (const e of entries) {
|
|
47
|
+
const full = join(dir, e.name);
|
|
48
|
+
if (e.isDirectory()) {
|
|
49
|
+
if (e.name === "node_modules")
|
|
50
|
+
continue;
|
|
51
|
+
walk(full);
|
|
52
|
+
}
|
|
53
|
+
else if (e.isFile()) {
|
|
54
|
+
files.push(full);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
walk(srcDir);
|
|
59
|
+
files.sort();
|
|
60
|
+
for (const f of files) {
|
|
61
|
+
hash.update(f.slice(root.length + 1));
|
|
62
|
+
hash.update(readFileSync(f));
|
|
63
|
+
}
|
|
64
|
+
return hash.digest("hex");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Staleness check against an explicit repo root — used for a task's worktree
|
|
68
|
+
* before previewing it. A worktree is stale when its `src/` hash no longer
|
|
69
|
+
* matches its own `dist/.build-info.json` (or the marker is missing). A
|
|
70
|
+
* checkout with no `src/` is treated as published (nothing to check).
|
|
71
|
+
*/
|
|
72
|
+
export function checkBuildForRoot(root) {
|
|
73
|
+
if (!root) {
|
|
74
|
+
return { stale: false, message: null, code: "published", applicable: false };
|
|
75
|
+
}
|
|
76
|
+
const distDir = join(root, "dist");
|
|
77
|
+
const srcDir = join(root, "src");
|
|
78
|
+
if (!existsSync(srcDir)) {
|
|
79
|
+
return { stale: false, message: null, code: "published", applicable: false };
|
|
80
|
+
}
|
|
81
|
+
if (!existsSync(distDir)) {
|
|
82
|
+
return {
|
|
83
|
+
stale: true,
|
|
84
|
+
message: "No dist/ build — this checkout isn't using RepoOS's build pipeline; skipping staleness check.",
|
|
85
|
+
code: "no-build",
|
|
86
|
+
applicable: false,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const marker = join(distDir, ".build-info.json");
|
|
90
|
+
if (!existsSync(marker)) {
|
|
91
|
+
return {
|
|
92
|
+
stale: true,
|
|
93
|
+
message: "No .build-info.json marker — this checkout isn't using RepoOS's build pipeline; skipping staleness check.",
|
|
94
|
+
code: "no-marker",
|
|
95
|
+
applicable: false,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
let recorded;
|
|
99
|
+
try {
|
|
100
|
+
recorded = JSON.parse(readFileSync(marker, "utf8"));
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return {
|
|
104
|
+
stale: true,
|
|
105
|
+
message: "Build marker is corrupt. Run `bun run build` to regenerate.",
|
|
106
|
+
code: "corrupt",
|
|
107
|
+
applicable: true,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const currentHash = hashSrcDir(root);
|
|
111
|
+
if (!currentHash) {
|
|
112
|
+
return { stale: false, message: null, code: "published", applicable: false };
|
|
113
|
+
}
|
|
114
|
+
if (recorded.hash !== currentHash) {
|
|
115
|
+
return {
|
|
116
|
+
stale: true,
|
|
117
|
+
message: "Stale build: src/ has changed since the last `bun run build`.\n" +
|
|
118
|
+
" You are running OLD compiled code, and `repoos serve` serves the OLD UI.\n" +
|
|
119
|
+
" Run `bun run build` to update.",
|
|
120
|
+
code: "stale",
|
|
121
|
+
applicable: true,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return { stale: false, message: null, code: "fresh", applicable: true };
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Whether a build invocation may skip its work entirely. Only a checkout whose
|
|
128
|
+
* marker proves `src/` is unchanged (`code: "fresh"`) may skip; every other
|
|
129
|
+
* outcome — a missing or mismatched marker, a missing `dist/`, a published
|
|
130
|
+
* install — must build. `force` (the `--force` flag / `REPOOS_FORCE_BUILD=1`)
|
|
131
|
+
* always builds, even when the marker says fresh.
|
|
132
|
+
*
|
|
133
|
+
* This is the single decision every build caller shares. `scripts/build.mjs`
|
|
134
|
+
* turns it into the skip; `repoos check` calls `bun run build` and inherits it,
|
|
135
|
+
* so staleness is never silently absorbed (check reports staleness first in its
|
|
136
|
+
* own step, then the build step repairs).
|
|
137
|
+
*/
|
|
138
|
+
export function shouldSkipBuild(result, force = false) {
|
|
139
|
+
return !force && result.code === "fresh";
|
|
140
|
+
}
|
|
141
|
+
export function checkBuild() {
|
|
142
|
+
const root = findPackageRoot();
|
|
143
|
+
if (!root) {
|
|
144
|
+
return { stale: false, message: null, code: "published", applicable: false };
|
|
145
|
+
}
|
|
146
|
+
const distDir = join(root, "dist");
|
|
147
|
+
const srcDir = join(root, "src");
|
|
148
|
+
const marker = join(distDir, ".build-info.json");
|
|
149
|
+
// Detect dev mode: running from src/, not from compiled dist/
|
|
150
|
+
const binPath = fileURLToPath(import.meta.url);
|
|
151
|
+
if (binPath.includes(`${pathSep}src${pathSep}`)) {
|
|
152
|
+
return { stale: false, message: null, code: "dev-mode", applicable: false };
|
|
153
|
+
}
|
|
154
|
+
return checkBuildForRoot(root);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Read the build timestamp for a checkout. The timestamp lives in
|
|
158
|
+
* `dist/.build-stamp.json` (gitignored) rather than `dist/.build-info.json`,
|
|
159
|
+
* so the marker that staleness and reload compare stays byte-identical across
|
|
160
|
+
* rebuilds of identical source. Falls back to a legacy inline `generatedAt` in
|
|
161
|
+
* the marker so installs built before the split still report a build age.
|
|
162
|
+
* Best-effort: null when neither file is readable.
|
|
163
|
+
*/
|
|
164
|
+
export function readBuildStamp(root) {
|
|
165
|
+
const read = (file) => {
|
|
166
|
+
try {
|
|
167
|
+
const info = JSON.parse(readFileSync(file, "utf8"));
|
|
168
|
+
return typeof info.generatedAt === "string" && info.generatedAt ? info.generatedAt : null;
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
return (read(join(root, "dist", ".build-stamp.json")) ?? read(join(root, "dist", ".build-info.json")));
|
|
175
|
+
}
|
|
176
|
+
function readGeneratedAt(file) {
|
|
177
|
+
try {
|
|
178
|
+
const info = JSON.parse(readFileSync(file, "utf8"));
|
|
179
|
+
return typeof info.generatedAt === "string" && info.generatedAt ? info.generatedAt : null;
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Build version + timestamp for the running install, resolved relative to THIS
|
|
187
|
+
* module so it works for every layout:
|
|
188
|
+
*
|
|
189
|
+
* - standalone (curl / `repoos upgrade`): <installRoot>/core/build.js
|
|
190
|
+
* → `.build-info.json` + `.build-stamp.json` sit at <installRoot>
|
|
191
|
+
* - linked dev build (compiled): <repo>/dist/core/build.js
|
|
192
|
+
* → both files sit at <repo>/dist
|
|
193
|
+
* - source run (`bun src/cli/index.ts`): <repo>/src/core/build.ts
|
|
194
|
+
* → no marker beside it; fall back to <repo>/dist, then package.json
|
|
195
|
+
*
|
|
196
|
+
* The old path read `package.json` only — but the release tarball
|
|
197
|
+
* (`tar -C dist .`) ships `.build-info.json` (`{ hash, version }`) and
|
|
198
|
+
* `.build-stamp.json`, NOT `package.json`, so every standalone install
|
|
199
|
+
* reported its version as "unknown". `.build-info.json` is the source of truth
|
|
200
|
+
* here; `package.json` is just the last-resort fallback for a source checkout.
|
|
201
|
+
*/
|
|
202
|
+
export function readBuildMeta() {
|
|
203
|
+
const here = dirname(fileURLToPath(import.meta.url)); // <x>/core
|
|
204
|
+
return readBuildMetaFrom(dirname(here)); // <x>: installRoot | repo/dist | repo/src
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The dir-relative core of {@link readBuildMeta}, split out so it can be tested
|
|
208
|
+
* against synthetic layouts. `markerDir` is where `.build-info.json` /
|
|
209
|
+
* `.build-stamp.json` are expected to sit (with `<markerDir>/../dist` tried as
|
|
210
|
+
* the source-checkout fallback).
|
|
211
|
+
*/
|
|
212
|
+
export function readBuildMetaFrom(markerDir) {
|
|
213
|
+
const dirs = [markerDir, join(markerDir, "..", "dist")];
|
|
214
|
+
let version = null;
|
|
215
|
+
let buildAt = null;
|
|
216
|
+
for (const dir of dirs) {
|
|
217
|
+
if (version === null) {
|
|
218
|
+
try {
|
|
219
|
+
const info = JSON.parse(readFileSync(join(dir, ".build-info.json"), "utf8"));
|
|
220
|
+
if (typeof info.version === "string" && info.version)
|
|
221
|
+
version = info.version;
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
/* no marker in this dir */
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
if (buildAt === null) {
|
|
228
|
+
buildAt =
|
|
229
|
+
readGeneratedAt(join(dir, ".build-stamp.json")) ??
|
|
230
|
+
readGeneratedAt(join(dir, ".build-info.json"));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (version === null) {
|
|
234
|
+
const root = findPackageRoot();
|
|
235
|
+
if (root) {
|
|
236
|
+
try {
|
|
237
|
+
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
238
|
+
if (typeof pkg.version === "string" && pkg.version)
|
|
239
|
+
version = pkg.version;
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
/* package.json unreadable */
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return { version, buildAt };
|
|
247
|
+
}
|
|
248
|
+
/** Platform path separator pattern for import.meta.url detection. */
|
|
249
|
+
const pathSep = process.platform === "win32" ? "\\\\" : "/";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canary counter for the end-to-end flow smoke test (draft → inbox → ready →
|
|
3
|
+
* active → review → merge → done). The only thing a canary task does is bump
|
|
4
|
+
* this number, wrapping 9 back to 0 — see CANARY_PROMPT below, which is the
|
|
5
|
+
* exact, unchanging freeform explanation used to create that task every time.
|
|
6
|
+
* A trivial, single-line diff means any failure surfaced by the run is the
|
|
7
|
+
* pipeline's fault, not the change's.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CANARY_COUNTER = 2;
|
|
10
|
+
export declare const CANARY_PROMPT: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canary counter for the end-to-end flow smoke test (draft → inbox → ready →
|
|
3
|
+
* active → review → merge → done). The only thing a canary task does is bump
|
|
4
|
+
* this number, wrapping 9 back to 0 — see CANARY_PROMPT below, which is the
|
|
5
|
+
* exact, unchanging freeform explanation used to create that task every time.
|
|
6
|
+
* A trivial, single-line diff means any failure surfaced by the run is the
|
|
7
|
+
* pipeline's fault, not the change's.
|
|
8
|
+
*/
|
|
9
|
+
export const CANARY_COUNTER = 2;
|
|
10
|
+
export const CANARY_PROMPT = "This is the repoos canary task: a deliberately trivial change used to smoke-test the full flow " +
|
|
11
|
+
"(draft, inbox, ready, active, review, merge, done) end to end. The only change to make is in " +
|
|
12
|
+
"src/core/canary.ts: increment the exported CANARY_COUNTER constant by 1, wrapping from 9 back to 0. " +
|
|
13
|
+
"Do not touch anything else, do not add tests or comments beyond what's already there, and do not " +
|
|
14
|
+
"change CANARY_PROMPT itself.";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull the useful, human-readable diagnosis out of a Vitest failure block.
|
|
3
|
+
*
|
|
4
|
+
* Full check output can be large and often ends with a coloured received-vs-
|
|
5
|
+
* expected diff. That diff is valuable in the expandable log, but it makes a
|
|
6
|
+
* poor headline: it can begin halfway through a JSON object and hide the test
|
|
7
|
+
* that actually failed. Keep the test name, source location, and error kind
|
|
8
|
+
* together for compact status surfaces.
|
|
9
|
+
*/
|
|
10
|
+
export declare function summarizeCheckFailure(output: string): string | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull the useful, human-readable diagnosis out of a Vitest failure block.
|
|
3
|
+
*
|
|
4
|
+
* Full check output can be large and often ends with a coloured received-vs-
|
|
5
|
+
* expected diff. That diff is valuable in the expandable log, but it makes a
|
|
6
|
+
* poor headline: it can begin halfway through a JSON object and hide the test
|
|
7
|
+
* that actually failed. Keep the test name, source location, and error kind
|
|
8
|
+
* together for compact status surfaces.
|
|
9
|
+
*/
|
|
10
|
+
export function summarizeCheckFailure(output) {
|
|
11
|
+
const lines = output
|
|
12
|
+
.split("\n")
|
|
13
|
+
.map((line) => line.trim())
|
|
14
|
+
.filter(Boolean);
|
|
15
|
+
let failureIndex = -1;
|
|
16
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
17
|
+
if (/^(?:[❯×]\s*)?FAIL\s+/.test(lines[i])) {
|
|
18
|
+
failureIndex = i;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (failureIndex === -1)
|
|
23
|
+
return null;
|
|
24
|
+
const heading = lines[failureIndex].replace(/^(?:[❯×]\s*)?FAIL\s+/, "");
|
|
25
|
+
const block = lines.slice(failureIndex + 1);
|
|
26
|
+
const location = block.find((line) => /(?:^|\s)(?:[^\s:]+\/)?[^\s:]+\.(?:test|spec)\.[cm]?[jt]sx?:\d+:\d+/.test(line));
|
|
27
|
+
const error = block.find((line) => /^(?:[A-Za-z]*Error|Error):/.test(line));
|
|
28
|
+
const parts = [heading];
|
|
29
|
+
if (location)
|
|
30
|
+
parts.push(`at ${location.replace(/^[❯×]\s*/, "")}`);
|
|
31
|
+
if (error)
|
|
32
|
+
parts.push(error);
|
|
33
|
+
return parts.join(" — ");
|
|
34
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { Agent, BuiltInAgentConfig, PreviewConfig, RepoOSConfig } from "./types.js";
|
|
2
|
+
/** Coding agents an Agent can run under. */
|
|
3
|
+
export declare const AGENT_CLIS: readonly ["opencode", "claude code", "qwen code", "kiro", "codex", "github copilot"];
|
|
4
|
+
/** Models an Agent can pin (or "default" for the coding agent's default). */
|
|
5
|
+
export declare const AGENT_MODELS: readonly ["default", "big pickle", "deepseek v4"];
|
|
6
|
+
/** Built-in agents, seeded at runtime when the config has none. */
|
|
7
|
+
export declare const DEFAULT_AGENTS: Agent[];
|
|
8
|
+
/** Default agent names — these are seeded and cannot be removed. */
|
|
9
|
+
export declare const DEFAULT_AGENT_NAMES: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Add Ross to an existing stored agent list without replacing user edits.
|
|
12
|
+
* When the stored config has the legacy "RepoOS Guide" name, rename it to "Ross"
|
|
13
|
+
* so the chat continues working. The other defaults deliberately are not
|
|
14
|
+
* re-seeded: a user may have removed one of those roles from an older configuration.
|
|
15
|
+
*/
|
|
16
|
+
export declare function agentsForConfig(config: Pick<RepoOSConfig, "agents">): Agent[];
|
|
17
|
+
/**
|
|
18
|
+
* "Auto" default for `maxConcurrentAgents`. An agent's own test pool
|
|
19
|
+
* is capped separately (vite.config.ts `test.poolOptions.forks.maxForks: 2`),
|
|
20
|
+
* so one agent's worst-case footprint is bounded rather than "the whole
|
|
21
|
+
* machine" — this can size off total cores directly instead of dividing them
|
|
22
|
+
* away defensively. `cores / 2` leaves headroom for that ~2-worker pool plus
|
|
23
|
+
* the agent process's own overhead per concurrent agent; capped at 8 so a
|
|
24
|
+
* many-core desktop doesn't queue dozens of agents whose non-test work (tool
|
|
25
|
+
* calls, I/O) still contends over shared resources like the git index.
|
|
26
|
+
*/
|
|
27
|
+
export declare function defaultMaxConcurrentAgents(): number;
|
|
28
|
+
export declare const DEFAULT_CONFIG: Omit<RepoOSConfig, "root">;
|
|
29
|
+
/**
|
|
30
|
+
* Sibling directory that holds per-task agent worktrees, e.g.
|
|
31
|
+
* `/path/to/repoos` -> `/path/to/repoos-worktrees/`. Kept OUTSIDE the repo
|
|
32
|
+
* root so a linked worktree can never dirty the main checkout or confuse
|
|
33
|
+
* `repoos check` staleness. `<branch>` path segments are kept so a worktree
|
|
34
|
+
* for `feat/123-x` lives at `<dir>/feat/123-x`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function worktreesDir(root: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* A stable default serve port for a repo, derived from its canonical root
|
|
39
|
+
* path (djb2 hash → `${DERIVED_PORT_BASE}`..`${DERIVED_PORT_BASE + DERIVED_PORT_SPAN - 1}`).
|
|
40
|
+
* Deterministic per checkout, so two repos on one machine don't both default
|
|
41
|
+
* to 7171 and reap each other. Exported for tests.
|
|
42
|
+
*/
|
|
43
|
+
export declare function deriveServePort(root: string): number;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the port `repoos serve` should bind: an explicit `--port` flag wins,
|
|
46
|
+
* then `servePort` in repoos.toml, then a stable per-repo derived port.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveServePort(root: string, config: {
|
|
49
|
+
servePort?: number;
|
|
50
|
+
}, portFlag?: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* Load `.env` from the repo root into `process.env`, if present. Zero
|
|
53
|
+
* runtime deps (no dotenv package) — a minimal `KEY=value` parser, one line
|
|
54
|
+
* per variable. Real env vars already set take precedence over the file, so
|
|
55
|
+
* e.g. a systemd unit's `Environment=` still wins. Safe to call more than
|
|
56
|
+
* once; safe when `.env` doesn't exist.
|
|
57
|
+
*/
|
|
58
|
+
export declare function loadDotEnv(root?: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* Persist a local secret to the gitignored `.env` at the repo root, keeping
|
|
61
|
+
* the same env-var-secret convention `loadDotEnv` reads back (dev backdoor
|
|
62
|
+
* code, auth provider keys, model-provider API keys). An empty `value`
|
|
63
|
+
* removes the line entirely so a cleared secret can't linger as `KEY=`.
|
|
64
|
+
* Also updates `process.env` directly: `loadDotEnv` skips keys already
|
|
65
|
+
* present in the environment, so a re-`loadConfig` alone would never refresh
|
|
66
|
+
* a value the booting process had already seen.
|
|
67
|
+
*
|
|
68
|
+
* Only ever called with the fixed secret names this codebase owns (the
|
|
69
|
+
* model-provider keys today) — callers validate that before calling. The
|
|
70
|
+
* value is written raw, one `KEY=value` line, exactly what `loadDotEnv`
|
|
71
|
+
* parses back.
|
|
72
|
+
*/
|
|
73
|
+
export declare function setDotEnvSecret(root: string, key: string, value: string): void;
|
|
74
|
+
/** Walk upward from `start` to find the repo root (nearest .git or repoos.toml). */
|
|
75
|
+
export declare function findRepoRoot(start?: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* True when `dir` is a LINKED WORKTREE root rather than a real repo root: a
|
|
78
|
+
* worktree's `.git` is a FILE reading `gitdir: …`, while a real root's `.git`
|
|
79
|
+
* is a directory. Cheap — one stat, no git subprocess.
|
|
80
|
+
*
|
|
81
|
+
* `findRepoRoot` does not make this distinction (it matches any `.git`), which
|
|
82
|
+
* is exactly why board reads run from inside a worktree used to silently
|
|
83
|
+
* resolve to the worktree's own copy of the task files instead of the live
|
|
84
|
+
* board's main checkout (the #0068 false-positive).
|
|
85
|
+
*/
|
|
86
|
+
export declare function isLinkedWorktreeRoot(dir: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The MAIN checkout root for a linked worktree, or null when `dir` is not a
|
|
89
|
+
* linked worktree root. A worktree's `.git` file points at
|
|
90
|
+
* `<main>/.git/worktrees/<name>` (absolute, or relative to the worktree); the
|
|
91
|
+
* main root is the first ancestor of that pointer whose own `.git` is a
|
|
92
|
+
* directory. Fail-soft: any anomaly yields null and callers fall back to the
|
|
93
|
+
* resolved root.
|
|
94
|
+
*/
|
|
95
|
+
export declare function mainCheckoutRoot(dir: string): string | null;
|
|
96
|
+
/**
|
|
97
|
+
* The root LIVE-BOARD reads (`repoos show`/`list`/`index`) should resolve to:
|
|
98
|
+
* the MAIN checkout even when the CLI runs inside a task worktree, so a
|
|
99
|
+
* readback can never false-positive on the worktree's own copy. `fromWorktree`
|
|
100
|
+
* signals that resolution jumped the main checkout — callers surface it so the
|
|
101
|
+
* behavior is never silent. Mutating commands keep `findRepoRoot` semantics
|
|
102
|
+
* (they must act on the directory they run in).
|
|
103
|
+
*/
|
|
104
|
+
export declare function boardRoot(start?: string): {
|
|
105
|
+
root: string;
|
|
106
|
+
fromWorktree: boolean;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Parse the `[preview]` section (plus `[[preview.targets]]` tables) from flat
|
|
110
|
+
* TOML. Exported for tests; `loadConfig` merges the result into the config.
|
|
111
|
+
* Rows without a usable `command` are dropped rather than poisoning resolution.
|
|
112
|
+
*/
|
|
113
|
+
export declare function parsePreviewConfig(parsed: Record<string, unknown>): PreviewConfig | undefined;
|
|
114
|
+
export declare function loadConfig(rootArg?: string): RepoOSConfig;
|
|
115
|
+
/** Metadata describing a single config field for the Settings UI. */
|
|
116
|
+
export interface ConfigFieldMeta {
|
|
117
|
+
key: string;
|
|
118
|
+
label: string;
|
|
119
|
+
type: "string" | "boolean" | "select" | "array";
|
|
120
|
+
tier: "live" | "restart" | "guarded";
|
|
121
|
+
/**
|
|
122
|
+
* Which primary Settings section a field belongs to. Defaults to "general"
|
|
123
|
+
* for non-guarded fields and "advanced" for guarded ones. "voice" carves out
|
|
124
|
+
* a dedicated, always-visible "Voice transcription" section so the feature
|
|
125
|
+
* is discoverable without opening Advanced.
|
|
126
|
+
*/
|
|
127
|
+
group?: "general" | "voice";
|
|
128
|
+
restartRequired: boolean;
|
|
129
|
+
default: unknown;
|
|
130
|
+
options?: {
|
|
131
|
+
value: string;
|
|
132
|
+
label: string;
|
|
133
|
+
}[];
|
|
134
|
+
description: string;
|
|
135
|
+
}
|
|
136
|
+
export declare function getConfigSchema(): ConfigFieldMeta[];
|
|
137
|
+
/**
|
|
138
|
+
* Patch a repoos.toml file with the given key-value pairs, preserving all
|
|
139
|
+
* other lines (comments, formatting, unknown keys).
|
|
140
|
+
*/
|
|
141
|
+
export declare function patchTomlConfig(tomlPath: string, patch: Record<string, unknown>): void;
|
|
142
|
+
/**
|
|
143
|
+
* Absolute path of the built-in agent state sidecar (a JSON file living next
|
|
144
|
+
* to the cache dir). It holds runtime state — enabled/schedule/last run — that
|
|
145
|
+
* the Tech Debt Agent's server-side scheduler reads and the Agents page
|
|
146
|
+
* writes; it is deliberately NOT part of repoos.toml.
|
|
147
|
+
*/
|
|
148
|
+
export declare function builtInAgentsPath(root: string, cacheDir?: string): string;
|
|
149
|
+
/** Coerce an unknown PATCH/read value into a sane BuiltInAgentConfig. */
|
|
150
|
+
export declare function sanitizeBuiltInAgent(value: unknown): BuiltInAgentConfig | null;
|
|
151
|
+
/**
|
|
152
|
+
* Coerce a whole record of built-in agent state (as read from the sidecar or
|
|
153
|
+
* sent via PATCH) into a safe shape. Invalid entries are dropped; a valid
|
|
154
|
+
* entry with no recognized fields is dropped too.
|
|
155
|
+
*/
|
|
156
|
+
export declare function sanitizeBuiltInAgents(value: unknown): Record<string, BuiltInAgentConfig>;
|
|
157
|
+
/** Read the built-in agent state sidecar, or undefined when absent/unreadable. */
|
|
158
|
+
export declare function loadBuiltInAgentsConfig(root: string, cacheDir?: string): Record<string, BuiltInAgentConfig> | undefined;
|
|
159
|
+
/** Persist the built-in agent state sidecar, creating the cache dir as needed. */
|
|
160
|
+
export declare function saveBuiltInAgentsConfig(root: string, state: Record<string, BuiltInAgentConfig>, cacheDir?: string): void;
|