@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,124 @@
|
|
|
1
|
+
import { json } from "./utils.js";
|
|
2
|
+
async function transcribeWithGroq(apiKey, audioBuffer, mimeType) {
|
|
3
|
+
const formData = new FormData();
|
|
4
|
+
const blob = new Blob([new Uint8Array(audioBuffer)], { type: mimeType });
|
|
5
|
+
const extension = mimeType.split("/")[1] || "webm";
|
|
6
|
+
formData.append("file", blob, `audio.${extension}`);
|
|
7
|
+
formData.append("model", "whisper-large-v3");
|
|
8
|
+
const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: {
|
|
11
|
+
Authorization: `Bearer ${apiKey}`,
|
|
12
|
+
},
|
|
13
|
+
body: formData,
|
|
14
|
+
});
|
|
15
|
+
if (!response.ok) {
|
|
16
|
+
const error = await response.text();
|
|
17
|
+
throw new Error(`Groq transcription failed: ${response.status} ${error}`);
|
|
18
|
+
}
|
|
19
|
+
const result = (await response.json());
|
|
20
|
+
return result.text || "";
|
|
21
|
+
}
|
|
22
|
+
async function transcribeWithOpenAI(apiKey, audioBuffer, mimeType) {
|
|
23
|
+
const formData = new FormData();
|
|
24
|
+
const blob = new Blob([new Uint8Array(audioBuffer)], { type: mimeType });
|
|
25
|
+
const extension = mimeType.split("/")[1] || "webm";
|
|
26
|
+
formData.append("file", blob, `audio.${extension}`);
|
|
27
|
+
formData.append("model", "whisper-1");
|
|
28
|
+
const response = await fetch("https://api.openai.com/v1/audio/transcriptions", {
|
|
29
|
+
method: "POST",
|
|
30
|
+
headers: {
|
|
31
|
+
Authorization: `Bearer ${apiKey}`,
|
|
32
|
+
},
|
|
33
|
+
body: formData,
|
|
34
|
+
});
|
|
35
|
+
if (!response.ok) {
|
|
36
|
+
const error = await response.text();
|
|
37
|
+
throw new Error(`OpenAI transcription failed: ${response.status} ${error}`);
|
|
38
|
+
}
|
|
39
|
+
const result = (await response.json());
|
|
40
|
+
return result.text || "";
|
|
41
|
+
}
|
|
42
|
+
function parseMultipart(buffer, boundary) {
|
|
43
|
+
const parts = new Map();
|
|
44
|
+
const bufferStr = buffer.toString("binary");
|
|
45
|
+
const delimiter = `--${boundary}`;
|
|
46
|
+
const sections = bufferStr.split(delimiter);
|
|
47
|
+
for (const section of sections) {
|
|
48
|
+
if (!section.trim() || section.trim() === "--")
|
|
49
|
+
continue;
|
|
50
|
+
const headerEnd = section.indexOf("\r\n\r\n");
|
|
51
|
+
if (headerEnd === -1)
|
|
52
|
+
continue;
|
|
53
|
+
const headers = section.slice(0, headerEnd);
|
|
54
|
+
const body = section.slice(headerEnd + 4); // skip \r\n\r\n
|
|
55
|
+
// Remove trailing \r\n-- if present
|
|
56
|
+
const cleanBody = body.replace(/\r\n--$/, "");
|
|
57
|
+
const nameMatch = headers.match(/name="([^"]+)"/);
|
|
58
|
+
if (!nameMatch)
|
|
59
|
+
continue;
|
|
60
|
+
const name = nameMatch[1];
|
|
61
|
+
const mimeMatch = headers.match(/Content-Type:\s*([^\r\n]+)/i);
|
|
62
|
+
const mimeType = mimeMatch ? mimeMatch[1].trim() : undefined;
|
|
63
|
+
parts.set(name, {
|
|
64
|
+
data: Buffer.from(cleanBody, "binary"),
|
|
65
|
+
mimeType,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return parts;
|
|
69
|
+
}
|
|
70
|
+
export const transcribe = async (ctx, req, res) => {
|
|
71
|
+
const { config } = ctx;
|
|
72
|
+
// Check if whisper is configured
|
|
73
|
+
const provider = config.whisper?.provider || "none";
|
|
74
|
+
const apiKey = config.whisper?.apiKey || "";
|
|
75
|
+
if (!provider || provider === "none" || !apiKey) {
|
|
76
|
+
return json(res, 400, { error: "Voice transcription not configured" });
|
|
77
|
+
}
|
|
78
|
+
// Parse multipart form data
|
|
79
|
+
const chunks = [];
|
|
80
|
+
for await (const chunk of req) {
|
|
81
|
+
chunks.push(chunk);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const buffer = Buffer.concat(chunks);
|
|
85
|
+
const contentType = req.headers["content-type"] || "";
|
|
86
|
+
const boundaryMatch = contentType.match(/boundary=([^;]+)/);
|
|
87
|
+
const boundary = boundaryMatch ? boundaryMatch[1] : "";
|
|
88
|
+
let audioBuffer = null;
|
|
89
|
+
let mimeType = "audio/webm";
|
|
90
|
+
if (boundary) {
|
|
91
|
+
const parts = parseMultipart(buffer, boundary);
|
|
92
|
+
const audioPart = parts.get("audio");
|
|
93
|
+
if (audioPart) {
|
|
94
|
+
audioBuffer = audioPart.data;
|
|
95
|
+
if (audioPart.mimeType)
|
|
96
|
+
mimeType = audioPart.mimeType;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
// If no boundary, assume the entire body is audio
|
|
101
|
+
audioBuffer = buffer;
|
|
102
|
+
}
|
|
103
|
+
if (!audioBuffer || audioBuffer.length === 0) {
|
|
104
|
+
return json(res, 400, { error: "No audio data provided" });
|
|
105
|
+
}
|
|
106
|
+
let text = "";
|
|
107
|
+
if (provider === "groq") {
|
|
108
|
+
text = await transcribeWithGroq(apiKey, audioBuffer, mimeType);
|
|
109
|
+
}
|
|
110
|
+
else if (provider === "openai") {
|
|
111
|
+
text = await transcribeWithOpenAI(apiKey, audioBuffer, mimeType);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return json(res, 400, { error: `Unknown provider: ${provider}` });
|
|
115
|
+
}
|
|
116
|
+
return json(res, 200, { text: text || "" });
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
console.error("Transcription error:", err);
|
|
120
|
+
return json(res, 500, {
|
|
121
|
+
error: `Transcription failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import type { RepoOSConfig, Task, Status } from "../../core/types.js";
|
|
3
|
+
import type { RepoOS } from "../../core/repoos.js";
|
|
4
|
+
import type { LiveIndex, RepoEvent } from "../live-index.js";
|
|
5
|
+
import type { AgentRunner } from "../agents.js";
|
|
6
|
+
import type { PreviewManager } from "../preview.js";
|
|
7
|
+
import type { ReviewManager } from "../review.js";
|
|
8
|
+
import type { CTOManager } from "../cto.js";
|
|
9
|
+
import type { CloseOutLock } from "../done.js";
|
|
10
|
+
import type { RootLock } from "../repo-lock.js";
|
|
11
|
+
import type { ReloadManager } from "../reload.js";
|
|
12
|
+
import type { JobCoordinator } from "../integration-job.js";
|
|
13
|
+
import type { Logger } from "../../core/logger.js";
|
|
14
|
+
import type { DoneStep } from "../done.js";
|
|
15
|
+
import type { RemoteValidator } from "../remote-validation.js";
|
|
16
|
+
export interface SyncResult {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
conflicts: string[];
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RouteContext {
|
|
22
|
+
config: RepoOSConfig;
|
|
23
|
+
index: LiveIndex;
|
|
24
|
+
/**
|
|
25
|
+
* Resolves once the full background index build finishes on server boot
|
|
26
|
+
* (the `refreshAllAsync` kicked off in `startServer`). Index-reading routes
|
|
27
|
+
* (board, tasks, index) await this so a request racing the boot-time
|
|
28
|
+
* asynchronous reindex — the exact shape that left the board showing a
|
|
29
|
+
* stale/partial snapshot after a reload handoff (0285) — can never answer
|
|
30
|
+
* against a half-built index.
|
|
31
|
+
*/
|
|
32
|
+
indexReady: Promise<void>;
|
|
33
|
+
runner: AgentRunner;
|
|
34
|
+
previews: PreviewManager;
|
|
35
|
+
reviews: ReviewManager;
|
|
36
|
+
cto: CTOManager;
|
|
37
|
+
repoos: RepoOS;
|
|
38
|
+
logger: Logger;
|
|
39
|
+
emitEvent: (e: RepoEvent) => void;
|
|
40
|
+
closeOutLock: CloseOutLock;
|
|
41
|
+
rootLock: RootLock;
|
|
42
|
+
jobCoordinator: JobCoordinator;
|
|
43
|
+
/** Remote Validation Runner (docs/remote-validation.md). Undefined when not configured. */
|
|
44
|
+
remoteValidator?: RemoteValidator;
|
|
45
|
+
/**
|
|
46
|
+
* Live progress step last reported by the close-out orchestrator for each
|
|
47
|
+
* in-flight task (the same map `emitIntegration`'s SSE push uses) — keyed
|
|
48
|
+
* by task id. A route that builds a pipeline snapshot for an
|
|
49
|
+
* ALREADY-in-flight job (the GET hydration endpoint) must read this rather
|
|
50
|
+
* than pass `{}`, or the stage shown falls back to a coarse per-phase
|
|
51
|
+
* guess (e.g. "validating" always reads as "merge", even mid-test-run)
|
|
52
|
+
* until the next SSE event happens to correct it — misleading on a page
|
|
53
|
+
* refresh mid-pipeline (0207 follow-up).
|
|
54
|
+
*/
|
|
55
|
+
reportedStages: Record<string, DoneStep>;
|
|
56
|
+
triggerJobProcessing: () => void;
|
|
57
|
+
pendingReview: Set<string>;
|
|
58
|
+
uiDir: string | null;
|
|
59
|
+
reload: ReloadManager | null;
|
|
60
|
+
syncTaskBranch: (task: Task) => Promise<SyncResult>;
|
|
61
|
+
onServerStatusChange: (task: Task, prev: Status, next: Status) => void;
|
|
62
|
+
}
|
|
63
|
+
export type RouteHandler = (ctx: RouteContext, req: IncomingMessage, res: ServerResponse, params: Record<string, string>) => Promise<void> | void;
|
|
64
|
+
export interface Route {
|
|
65
|
+
method: string;
|
|
66
|
+
path: string | RegExp;
|
|
67
|
+
handler: RouteHandler;
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RouteHandler } from "./types.js";
|
|
2
|
+
export declare const serveManifest: RouteHandler;
|
|
3
|
+
export declare const serveStaticFile: RouteHandler;
|
|
4
|
+
export declare function setIconRenderer(fn: (size: number, color?: string) => Buffer): void;
|
|
5
|
+
export declare const serveIcon: RouteHandler;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
import { serveStaticUi } from "./helpers.js";
|
|
3
|
+
/** Read the optional repo color from the `c` query param, or null when absent/invalid. */
|
|
4
|
+
function colorFromUrl(req) {
|
|
5
|
+
const url = req.url ? new URL(req.url, "http://localhost") : null;
|
|
6
|
+
const c = url?.searchParams.get("c");
|
|
7
|
+
return c && /^#[0-9a-f]{6}$/i.test(c) ? c.toLowerCase() : null;
|
|
8
|
+
}
|
|
9
|
+
export const serveManifest = (ctx, req, res) => {
|
|
10
|
+
const { config } = ctx;
|
|
11
|
+
const name = basename(config.root) || "repoos";
|
|
12
|
+
const c = colorFromUrl(req);
|
|
13
|
+
const suffix = c ? `?c=${c}` : "";
|
|
14
|
+
const manifest = JSON.stringify({
|
|
15
|
+
id: "/",
|
|
16
|
+
name: `RepoOS · ${name}`,
|
|
17
|
+
short_name: `RepoOS · ${name}`,
|
|
18
|
+
description: `Repo-native task tracking for ${name}`,
|
|
19
|
+
start_url: "/",
|
|
20
|
+
scope: "/",
|
|
21
|
+
display: "standalone",
|
|
22
|
+
orientation: "portrait-primary",
|
|
23
|
+
background_color: "#070a12",
|
|
24
|
+
theme_color: "#070a12",
|
|
25
|
+
icons: [
|
|
26
|
+
{ src: `/icons/icon-192.png${suffix}`, sizes: "192x192", type: "image/png" },
|
|
27
|
+
{ src: `/icons/icon-512.png${suffix}`, sizes: "512x512", type: "image/png" },
|
|
28
|
+
{
|
|
29
|
+
src: `/icons/icon-512.png${suffix}`,
|
|
30
|
+
sizes: "512x512",
|
|
31
|
+
type: "image/png",
|
|
32
|
+
purpose: "maskable",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
}, null, 2);
|
|
36
|
+
res.writeHead(200, {
|
|
37
|
+
"Content-Type": "application/manifest+json; charset=utf-8",
|
|
38
|
+
"Cache-Control": "no-cache",
|
|
39
|
+
"Access-Control-Allow-Origin": "*",
|
|
40
|
+
});
|
|
41
|
+
res.end(manifest);
|
|
42
|
+
};
|
|
43
|
+
export const serveStaticFile = (ctx, _req, res, params) => {
|
|
44
|
+
const { uiDir } = ctx;
|
|
45
|
+
if (!uiDir) {
|
|
46
|
+
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
47
|
+
res.end("UI not found");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const urlPath = params.path ?? "/";
|
|
51
|
+
if (!serveStaticUi(res, uiDir, urlPath)) {
|
|
52
|
+
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
53
|
+
res.end("Not found");
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
// Icon rendering function - will be called from main server with SVG generation logic
|
|
57
|
+
let renderIconFn = null;
|
|
58
|
+
export function setIconRenderer(fn) {
|
|
59
|
+
renderIconFn = fn;
|
|
60
|
+
}
|
|
61
|
+
export const serveIcon = (_ctx, req, res, params) => {
|
|
62
|
+
if (!renderIconFn) {
|
|
63
|
+
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
64
|
+
res.end("Icon renderer not initialized");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const size = params.param1 ? parseInt(params.param1, 10) : 0;
|
|
68
|
+
if (!size || (size !== 192 && size !== 512)) {
|
|
69
|
+
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
70
|
+
res.end("Invalid icon size");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const color = colorFromUrl(req);
|
|
74
|
+
const png = renderIconFn(size, color ?? undefined);
|
|
75
|
+
res.writeHead(200, {
|
|
76
|
+
"Content-Type": "image/png",
|
|
77
|
+
"Cache-Control": "max-age=86400",
|
|
78
|
+
"Access-Control-Allow-Origin": "*",
|
|
79
|
+
});
|
|
80
|
+
res.end(png);
|
|
81
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function json(res, status, body) {
|
|
2
|
+
const payload = JSON.stringify(body);
|
|
3
|
+
res.writeHead(status, {
|
|
4
|
+
"Content-Type": "application/json",
|
|
5
|
+
"Access-Control-Allow-Origin": "*",
|
|
6
|
+
"Access-Control-Allow-Methods": "GET,POST,PATCH,PUT,OPTIONS",
|
|
7
|
+
"Access-Control-Allow-Headers": "Content-Type",
|
|
8
|
+
});
|
|
9
|
+
res.end(payload);
|
|
10
|
+
}
|
|
11
|
+
export async function readBody(req) {
|
|
12
|
+
const chunks = [];
|
|
13
|
+
for await (const c of req)
|
|
14
|
+
chunks.push(c);
|
|
15
|
+
if (chunks.length === 0)
|
|
16
|
+
return {};
|
|
17
|
+
try {
|
|
18
|
+
return JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export interface ServeLockInfo {
|
|
2
|
+
pid: number;
|
|
3
|
+
port: number;
|
|
4
|
+
host: string;
|
|
5
|
+
startedAt: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Manages a single lockfile that tracks the live serve process for a repo.
|
|
9
|
+
* At startup, detects and reaps stale processes. Prevents port conflicts.
|
|
10
|
+
* Skip cleanup when spawned as a reload replacement (REPOOS_RELOAD=1) so
|
|
11
|
+
* the parent can exit gracefully through its close handler.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ServeReaper {
|
|
14
|
+
private readonly lockPath;
|
|
15
|
+
private readonly pid;
|
|
16
|
+
private readonly repoRoot;
|
|
17
|
+
/** Ephemeral test/harness servers must never touch the control-plane lock. */
|
|
18
|
+
private readonly enabled;
|
|
19
|
+
private registered;
|
|
20
|
+
private rootWatch;
|
|
21
|
+
/**
|
|
22
|
+
* A preview child (`repoos serve --port <ephemeral>` rooted at a task
|
|
23
|
+
* worktree) is NOT the control-plane server, so the single-per-repo serve
|
|
24
|
+
* lockfile and its stale-reaping/conflict logic don't apply to it. If it ran
|
|
25
|
+
* `cleanupStale`, it would reap whatever sibling preview happens to be in the
|
|
26
|
+
* worktree's lockfile (killing a booting preview mid-health-check → "did not
|
|
27
|
+
* become ready"), and because ephemeral ports can be reused, `detectConflict`
|
|
28
|
+
* could even refuse to bind a port that is already stale in the lockfile.
|
|
29
|
+
* Disable the reaper entirely for preview children (#0183).
|
|
30
|
+
*/
|
|
31
|
+
private readonly previewChild;
|
|
32
|
+
constructor(repoRoot: string, cacheDir?: string, enabled?: boolean, port?: number);
|
|
33
|
+
/**
|
|
34
|
+
* Close this server when the checkout it serves disappears. Fixture and
|
|
35
|
+
* preview roots are frequently removed before their child process receives
|
|
36
|
+
* its normal shutdown signal; a lockfile inside that deleted root can no
|
|
37
|
+
* longer help a later startup reap it. The watch is deliberately owned by
|
|
38
|
+
* the server process, so it also covers standalone fixture `serve` calls.
|
|
39
|
+
*
|
|
40
|
+
* A real repo root can be momentarily invisible (a rename while the dir is
|
|
41
|
+
* moved, a network-FS blip) without being gone — tearing the server down on
|
|
42
|
+
* such a transient miss would kill the live control plane. The root must
|
|
43
|
+
* be missing for `missesRequired` consecutive checks before `onMissing`
|
|
44
|
+
* fires; a deleted fixture/preview root stays gone, so this only delays the
|
|
45
|
+
* self-close by `missesRequired × intervalMs`.
|
|
46
|
+
*/
|
|
47
|
+
watchRoot(onMissing: () => void, intervalMs?: number, missesRequired?: number): () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a process with the given PID is still running and matches our
|
|
50
|
+
* expected serve characteristics (the repoos CLI binary in the command line).
|
|
51
|
+
* On Windows, the check is limited to existence (kill -0).
|
|
52
|
+
*/
|
|
53
|
+
private isProcessAlive;
|
|
54
|
+
/**
|
|
55
|
+
* Boot-time cleanup: detect and reap stale processes from the lockfile.
|
|
56
|
+
* SKIPPED when spawned as a reload replacement (REPOOS_RELOAD=1) so the
|
|
57
|
+
* parent process can exit gracefully without being killed mid-shutdown.
|
|
58
|
+
* This is safe to call multiple times and always succeeds (best-effort).
|
|
59
|
+
*/
|
|
60
|
+
cleanupStale(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Reap historical fixture/preview servers whose deleted root also took their
|
|
63
|
+
* lockfile with it. This is intentionally narrower than a generic process
|
|
64
|
+
* sweep: it requires the RepoOS CLI's `serve` command shape AND a cwd under
|
|
65
|
+
* the system temp dir that no longer exists — the exact shape of every
|
|
66
|
+
* observed orphan (`/var/folders/.../repoos-release-*`, `.../repoos-autoprev-*`).
|
|
67
|
+
* A user's live control plane, every healthy preview, and a sibling project
|
|
68
|
+
* that happens to be briefly unmounted or renamed therefore remain untouched
|
|
69
|
+
* (a real repo never lives under tmpdir).
|
|
70
|
+
*
|
|
71
|
+
* Async and best-effort so a boot full of accumulated orphans can never
|
|
72
|
+
* block serve startup: the `ps` scan and the per-process `lsof` cwd lookups
|
|
73
|
+
* run off the event loop, with the lookups capped in flight. Returns the
|
|
74
|
+
* number of processes killed.
|
|
75
|
+
*/
|
|
76
|
+
cleanupOrphanedRoots(): Promise<number>;
|
|
77
|
+
/**
|
|
78
|
+
* Detect if a port is already bound by a live serve process.
|
|
79
|
+
* Returns a human-readable error message if there's a conflict, null otherwise.
|
|
80
|
+
*
|
|
81
|
+
* Two independent signals are consulted:
|
|
82
|
+
* 1. The live port probe (new): is *something* actually listening? Consulted
|
|
83
|
+
* first so a missing/stale/corrupt lockfile can no longer mask a live
|
|
84
|
+
* listener — the single source of truth for "is the port taken" is the
|
|
85
|
+
* port itself, not the lockfile (#0284).
|
|
86
|
+
* 2. The lockfile (existing): when it names a live process for this exact
|
|
87
|
+
* port/host, that yields the most specific conflict (PID + start time).
|
|
88
|
+
*
|
|
89
|
+
* The probe matters because binding a port a lockfile-less-but-live process
|
|
90
|
+
* owns would otherwise either EADDRINUSE with a confusing error or, worse,
|
|
91
|
+
* silently steal a port mid-drain during another process's reload.
|
|
92
|
+
*/
|
|
93
|
+
detectConflict(port: number, host: string): Promise<string | null>;
|
|
94
|
+
/**
|
|
95
|
+
* Register the current process as serving on the given port.
|
|
96
|
+
* Call this after successful bind. Idempotent.
|
|
97
|
+
*/
|
|
98
|
+
register(port: number, host: string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Unregister the current process. Call on shutdown.
|
|
101
|
+
* Idempotent: unregistering when not registered is a no-op.
|
|
102
|
+
*/
|
|
103
|
+
unregister(): void;
|
|
104
|
+
private removeLock;
|
|
105
|
+
private stopWatchingRoot;
|
|
106
|
+
/** Read a process cwd from lsof's machine-readable output, best-effort. */
|
|
107
|
+
private processCwdAsync;
|
|
108
|
+
/** The command line of `pid`, or null when the process is already gone. */
|
|
109
|
+
private commandOf;
|
|
110
|
+
private killProcess;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* True when a TCP connection can be established to host:port — i.e. some
|
|
114
|
+
* process is actually listening there. This is the ground truth for "is the
|
|
115
|
+
* port taken", consulted alongside the lockfile so a missing/stale/corrupt
|
|
116
|
+
* lockfile can't mask a live listener (#0284). Best-effort and async: any
|
|
117
|
+
* connect error (connection refused, timeout, unroutable host) resolves false,
|
|
118
|
+
* and an invalid port resolves false immediately.
|
|
119
|
+
*/
|
|
120
|
+
export declare function isPortListening(port: number, host: string, timeoutMs?: number): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* True when a process command line has the RepoOS CLI `serve` shape — the
|
|
123
|
+
* compiled `.../cli/index.js serve` or dev `.../src/cli/index.ts serve`. The
|
|
124
|
+
* orphan sweep requires this shape in addition to a deleted temp-dir root, so
|
|
125
|
+
* unrelated processes are never touched.
|
|
126
|
+
*/
|
|
127
|
+
export declare function isOrphanServeCommand(command: string): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* True when `cwd` is a deleted root under the system temp dir — the exact
|
|
130
|
+
* shape of every observed orphan (fixture/preview temp dirs). A real repo —
|
|
131
|
+
* the live control plane, a preview worktree, any sibling project — never
|
|
132
|
+
* lives under tmpdir, so a briefly-unmounted or renamed repo cannot be
|
|
133
|
+
* mistaken for an orphan and killed. Exported for testing.
|
|
134
|
+
*/
|
|
135
|
+
export declare function isOrphanRoot(cwd: string): boolean;
|