@runweave/server-linux-x64 0.1.8 → 0.1.10
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/manifest.json +1494 -161
- package/native.tar.gz +0 -0
- package/package.json +1 -1
- package/payload/.agents/plugins/marketplace.json +20 -0
- package/payload/app-server/build-info.json +4 -4
- package/payload/app-server/index.cjs +6 -2
- package/payload/app-server/index.cjs.map +1 -1
- package/payload/backend/activity-sqlite-worker.cjs +2 -0
- package/payload/backend/build-info.json +4 -4
- package/payload/backend/dev-resources/control.cjs +5 -1
- package/payload/backend/index.cjs +466 -295
- package/payload/backend/ios-simulators/pool.py +3 -3
- package/payload/backend/scheduled-tasks-sqlite-worker.cjs +2 -0
- package/payload/frontend/dist/assets/{_baseUniq-vo4uuhMd.js → _baseUniq--CWv8e7O.js} +1 -1
- package/payload/frontend/dist/assets/{access-_jCu7Rgu.js → access-BCF23Qto.js} +1 -1
- package/payload/frontend/dist/assets/{advanced-CqOhObYj.js → advanced-D8viCLue.js} +1 -1
- package/payload/frontend/dist/assets/{appearance-CrrD5gzC.js → appearance-wPVMx-tB.js} +1 -1
- package/payload/frontend/dist/assets/{arc-dbfyHSF0.js → arc-BXffHD7A.js} +1 -1
- package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-CntSCAsO.js → architectureDiagram-Q4EWVU46-BXHN9QCj.js} +1 -1
- package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-Chp0D4qy.js → blockDiagram-DXYQGD6D-DoZjab_0.js} +1 -1
- package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-CF91pOuW.js → c4Diagram-AHTNJAMY-Ds2E62Z8.js} +1 -1
- package/payload/frontend/dist/assets/channel-83CTXkVl.js +1 -0
- package/payload/frontend/dist/assets/{chunk-4BX2VUAB-B1gxlVu2.js → chunk-4BX2VUAB-Dk1H2-5_.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-4TB4RGXK-Cxt3mj9b.js → chunk-4TB4RGXK-Sg0gzSvg.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-55IACEB6-BJT6qNik.js → chunk-55IACEB6-Du_EJG4S.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-EDXVE4YY-yI59bCa0.js → chunk-EDXVE4YY-BM1Cs5dU.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-FMBD7UC4-CDvncKKJ.js → chunk-FMBD7UC4-BM9thfyY.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-OYMX7WX6-BblOIU57.js → chunk-OYMX7WX6-C9Bvn4fo.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-QZHKN3VN-rODzNdO0.js → chunk-QZHKN3VN-CaakbFhJ.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-YZCP3GAM-B6D4wQwk.js → chunk-YZCP3GAM-DkVNrd40.js} +1 -1
- package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-oR8IYJwC.js +1 -0
- package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-oR8IYJwC.js +1 -0
- package/payload/frontend/dist/assets/clone-BIDF-bd9.js +1 -0
- package/payload/frontend/dist/assets/connection-DIdF_3aa.js +12 -0
- package/payload/frontend/dist/assets/{connections-DqDmxS-O.js → connections-DBYC8SFl.js} +1 -1
- package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-BvwVWp29.js → cose-bilkent-S5V4N54A-B4-fwllY.js} +1 -1
- package/payload/frontend/dist/assets/{dagre-KV5264BT-h_K1TH11.js → dagre-KV5264BT-Byu4wqLk.js} +1 -1
- package/payload/frontend/dist/assets/{desktop-BQ3kGtKG.js → desktop-aESkh0HL.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-5BDNPKRD-B8g2SV6L.js → diagram-5BDNPKRD-DJW8DuCX.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-BOEnrqYm.js → diagram-G4DWMVQ6-DTBvds5J.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-MMDJMWI5-DlaN_z71.js → diagram-MMDJMWI5-D42e4xzm.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-TYMM5635-C_pSKftn.js → diagram-TYMM5635-BjV43-C_.js} +1 -1
- package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-C2dL-h3I.js → erDiagram-SMLLAGMA-DE47Ibp_.js} +1 -1
- package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-BmXhKWFj.js → flowDiagram-DWJPFMVM-CjGBlzS4.js} +1 -1
- package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-D_Odnssf.js → ganttDiagram-T4ZO3ILL-vfj40KZi.js} +1 -1
- package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-DcQdcwKZ.js → gitGraphDiagram-UUTBAWPF-DT5xfRNb.js} +1 -1
- package/payload/frontend/dist/assets/{graph-C_XsxefA.js → graph-D-AF6yQT.js} +1 -1
- package/payload/frontend/dist/assets/{image-D3hgVr8O.js → image-D9gtSsD9.js} +1 -1
- package/payload/frontend/dist/assets/{index-CEUsFFQq.js → index-BPVP2P-2.js} +95 -105
- package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-C6TnRyMi.js → infoDiagram-42DDH7IO-C7ew_uLJ.js} +1 -1
- package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-BL7rfALJ.js → ishikawaDiagram-UXIWVN3A-B6-YebU9.js} +1 -1
- package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-C_6407GW.js → journeyDiagram-VCZTEJTY-BOFgJDA5.js} +1 -1
- package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-CK61Fd0p.js → kanban-definition-6JOO6SKY-jh06wZYz.js} +1 -1
- package/payload/frontend/dist/assets/{layout-DVn6JKbl.js → layout-B4p7V5fB.js} +1 -1
- package/payload/frontend/dist/assets/{linear-DyWskq8H.js → linear-D2JWfvdc.js} +1 -1
- package/payload/frontend/dist/assets/main-CuRgiPQf.js +706 -0
- package/payload/frontend/dist/assets/main-D4_uoZQa.css +33 -0
- package/payload/frontend/dist/assets/{min-apbLpSJ3.js → min--jD4Arnm.js} +1 -1
- package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-MVHZZbma.js → mindmap-definition-QFDTVHPH-DmzjmSuf.js} +1 -1
- package/payload/frontend/dist/assets/{monitoring-BApsVez_.js → monitoring-Tvvk6TfB.js} +1 -1
- package/payload/frontend/dist/assets/{notifications-CjxSNLU1.js → notifications-CqP2AQrW.js} +1 -1
- package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-Dhbb0AYU.js → pieDiagram-DEJITSTG-B79qIVe5.js} +1 -1
- package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-Yk6LOF0S.js → quadrantDiagram-34T5L4WZ-DIOj1DhE.js} +1 -1
- package/payload/frontend/dist/assets/{record-content-BCJ80KS5.js → record-content-CzGGCbNs.js} +1 -1
- package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-BUhS0PEq.js → requirementDiagram-MS252O5E-C-n1j3tN.js} +1 -1
- package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-D2sdxz14.js → sankeyDiagram-XADWPNL6-BVKqWE6C.js} +1 -1
- package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-CRere4Fy.js → sequenceDiagram-FGHM5R23-B980Icqs.js} +1 -1
- package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-_pk-OMlm.js → stateDiagram-FHFEXIEX-C-mJHzhL.js} +1 -1
- package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-B4L4fK9G.js +1 -0
- package/payload/frontend/dist/assets/{status-Dk5rRVQF.js → status-Bv4Czr9-.js} +1 -1
- package/payload/frontend/dist/assets/suiji-DyzQqRTE.js +1 -0
- package/payload/frontend/dist/assets/{svg-X7YkMMvx.js → svg-C6Aj62ig.js} +1 -1
- package/payload/frontend/dist/assets/{tabs-BmKbcPVh.js → tabs-BTUOhdAF.js} +1 -1
- package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-BPsI2pMC.js → timeline-definition-GMOUNBTQ-Dr9yRuVq.js} +1 -1
- package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-BNJkZ1Az.js → vennDiagram-DHZGUBPP-B0Xsg1-Z.js} +1 -1
- package/payload/frontend/dist/assets/{wardley-RL74JXVD-CVcYeATS.js → wardley-RL74JXVD-BjIKKaA_.js} +1 -1
- package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-BpLJ0alk.js → wardleyDiagram-NUSXRM2D-DMJ7MEA9.js} +1 -1
- package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-BdsYYk4M.js → xychartDiagram-5P7HB3ND-2tvgfdab.js} +1 -1
- package/payload/frontend/dist/build-info.json +4 -4
- package/payload/frontend/dist/companion.html +1 -1
- package/payload/frontend/dist/index.html +3 -3
- package/payload/packages/agent-bridge/src/install-pi.mjs +81 -0
- package/payload/plugins/pi/dist/SKILL.md +22 -0
- package/payload/plugins/pi/dist/bridge/app-server-client.cjs +82 -0
- package/payload/plugins/pi/dist/bridge/feishu_stop_notify.sh +169 -0
- package/payload/plugins/pi/dist/bridge/runweave-hook-bridge.cjs +583 -0
- package/payload/plugins/pi/dist/bridge/runweave-hook-completion.cjs +42 -0
- package/payload/plugins/pi/dist/bridge/runweave-hook-payload.cjs +578 -0
- package/payload/plugins/pi/dist/bridge/runweave-task-supervision.cjs +167 -0
- package/payload/plugins/pi/dist/runweave.js +316 -0
- package/payload/plugins/toolkit/.codex-plugin/plugin.json +31 -0
- package/payload/plugins/toolkit/README.md +185 -0
- package/payload/plugins/toolkit/hooks/AGENTS.md +6 -0
- package/payload/plugins/toolkit/hooks/app-server-client.cjs +82 -0
- package/payload/plugins/toolkit/hooks/feishu_stop_notify.sh +169 -0
- package/payload/plugins/toolkit/hooks/runweave-hook-bridge.cjs +583 -0
- package/payload/plugins/toolkit/hooks/runweave-hook-completion.cjs +42 -0
- package/payload/plugins/toolkit/hooks/runweave-hook-dispatch.cjs +123 -0
- package/payload/plugins/toolkit/hooks/runweave-hook-payload.cjs +578 -0
- package/payload/plugins/toolkit/hooks/runweave-task-supervision.cjs +167 -0
- package/payload/plugins/toolkit/hooks.json +108 -0
- package/payload/plugins/toolkit/skills/acceptance/SKILL.md +70 -0
- package/payload/plugins/toolkit/skills/acceptance/agents/openai.yaml +4 -0
- package/payload/plugins/toolkit/skills/acceptance/references/capture.md +38 -0
- package/payload/plugins/toolkit/skills/acceptance/references/delivery.md +54 -0
- package/payload/plugins/toolkit/skills/acceptance/references/gallery-contract.md +84 -0
- package/payload/plugins/toolkit/skills/acceptance/references/gallery-copy.md +34 -0
- package/payload/plugins/toolkit/skills/acceptance/references/video.md +52 -0
- package/payload/plugins/toolkit/skills/acceptance/scripts/capture.py +137 -0
- package/payload/plugins/toolkit/skills/acceptance/scripts/common.py +63 -0
- package/payload/plugins/toolkit/skills/acceptance/scripts/gallery.py +353 -0
- package/payload/plugins/toolkit/skills/acceptance/scripts/preview.py +109 -0
- package/payload/plugins/toolkit/skills/acceptance/scripts/video.py +283 -0
- package/payload/plugins/toolkit/skills/acceptance/templates/reader.css +576 -0
- package/payload/plugins/toolkit/skills/acceptance/templates/reader.html +63 -0
- package/payload/plugins/toolkit/skills/acceptance/templates/reader.js +326 -0
- package/payload/plugins/toolkit/skills/acceptance/templates/viewer.css +55 -0
- package/payload/plugins/toolkit/skills/acceptance-gallery/SKILL.md +8 -0
- package/payload/plugins/toolkit/skills/acceptance-gallery/agents/openai.yaml +6 -0
- package/payload/plugins/toolkit/skills/acceptance-gallery/references/capture-and-copy.md +3 -0
- package/payload/plugins/toolkit/skills/acceptance-gallery/references/content-contract.md +3 -0
- package/payload/plugins/toolkit/skills/acceptance-gallery/scripts/gallery.py +9 -0
- package/payload/plugins/toolkit/skills/acceptance-video/SKILL.md +8 -0
- package/payload/plugins/toolkit/skills/acceptance-video/agents/openai.yaml +6 -0
- package/payload/plugins/toolkit/skills/acceptance-video/references/input-and-capture.md +3 -0
- package/payload/plugins/toolkit/skills/acceptance-video/references/mobile-review.md +3 -0
- package/payload/plugins/toolkit/skills/acceptance-video/scripts/capture.py +9 -0
- package/payload/plugins/toolkit/skills/acceptance-video/scripts/video.py +9 -0
- package/payload/plugins/toolkit/skills/agent-device/SKILL.md +86 -0
- package/payload/plugins/toolkit/skills/agent-device/agents/openai.yaml +4 -0
- package/payload/plugins/toolkit/skills/agent-device/references/ios-setup.md +36 -0
- package/payload/plugins/toolkit/skills/agent-device/scripts/device.py +398 -0
- package/payload/plugins/toolkit/skills/agent-device/scripts/resources.py +248 -0
- package/payload/plugins/toolkit/skills/architecture-flow-prototyping/SKILL.md +128 -0
- package/payload/plugins/toolkit/skills/architecture-flow-prototyping/agents/openai.yaml +4 -0
- package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-checklist.md +59 -0
- package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-guide.md +135 -0
- package/payload/plugins/toolkit/skills/architecture-flow-prototyping/references/architecture-flow-handoff-template.md +57 -0
- package/payload/plugins/toolkit/skills/ask-first/SKILL.md +81 -0
- package/payload/plugins/toolkit/skills/brainstorming/SKILL.md +41 -0
- package/payload/plugins/toolkit/skills/browse-record/SKILL.md +35 -0
- package/payload/plugins/toolkit/skills/browse-record/references/app-usage.md +19 -0
- package/payload/plugins/toolkit/skills/browse-record/references/daily-reporting.md +115 -0
- package/payload/plugins/toolkit/skills/browse-record/references/zhihu.md +33 -0
- package/payload/plugins/toolkit/skills/browse-record/scripts/app_usage.py +110 -0
- package/payload/plugins/toolkit/skills/browse-record/scripts/browse_job.py +385 -0
- package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu-read.js +126 -0
- package/payload/plugins/toolkit/skills/browse-record/scripts/zhihu_http.py +273 -0
- package/payload/plugins/toolkit/skills/clear-technical-explanations/LICENSE +21 -0
- package/payload/plugins/toolkit/skills/clear-technical-explanations/SKILL.md +103 -0
- package/payload/plugins/toolkit/skills/code-grounded-requirements/SKILL.md +54 -0
- package/payload/plugins/toolkit/skills/daily-doc-maintenance/SKILL.md +151 -0
- package/payload/plugins/toolkit/skills/daily-record/SKILL.md +63 -0
- package/payload/plugins/toolkit/skills/daily-record/agents/openai.yaml +4 -0
- package/payload/plugins/toolkit/skills/daily-record/references/browser-history.md +6 -0
- package/payload/plugins/toolkit/skills/daily-record/references/feishu.md +90 -0
- package/payload/plugins/toolkit/skills/daily-record/references/scheduled-reporting.md +144 -0
- package/payload/plugins/toolkit/skills/daily-record/references/scheduled-task.template.json +15 -0
- package/payload/plugins/toolkit/skills/daily-record/references/suiji-work-records.md +57 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/feishu.py +280 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/job.py +416 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/job_browser.py +77 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/job_facts.py +132 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/job_isolation.py +69 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/job_materials.py +154 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/job_screen.py +77 -0
- package/payload/plugins/toolkit/skills/daily-record/scripts/job_state.py +309 -0
- package/payload/plugins/toolkit/skills/daily-refactor/SKILL.md +101 -0
- package/payload/plugins/toolkit/skills/daily-refactor/scripts/compare-architecture-reports.mjs +168 -0
- package/payload/plugins/toolkit/skills/debugging-strategies/SKILL.md +38 -0
- package/payload/plugins/toolkit/skills/debugging-strategies/resources/implementation-playbook.md +520 -0
- package/payload/plugins/toolkit/skills/diagnostic-log-debugging/SKILL.md +79 -0
- package/payload/plugins/toolkit/skills/doc-coauthoring/SKILL.md +64 -0
- package/payload/plugins/toolkit/skills/eli5/LICENSE +21 -0
- package/payload/plugins/toolkit/skills/eli5/SKILL.md +18 -0
- package/payload/plugins/toolkit/skills/experience/SKILL.md +71 -0
- package/payload/plugins/toolkit/skills/experience/package.json +13 -0
- package/payload/plugins/toolkit/skills/git-advanced-workflows/SKILL.md +457 -0
- package/payload/plugins/toolkit/skills/github-pr/SKILL.md +109 -0
- package/payload/plugins/toolkit/skills/github-pr/scripts/github-access.mjs +292 -0
- package/payload/plugins/toolkit/skills/github-pr/scripts/preflight.mjs +191 -0
- package/payload/plugins/toolkit/skills/github-pr/scripts/source-worktree.mjs +354 -0
- package/payload/plugins/toolkit/skills/grill-with-docs/SKILL.md +66 -0
- package/payload/plugins/toolkit/skills/grill-with-docs/agents/openai.yaml +6 -0
- package/payload/plugins/toolkit/skills/grilling/SKILL.md +14 -0
- package/payload/plugins/toolkit/skills/handoff/SKILL.md +98 -0
- package/payload/plugins/toolkit/skills/karpathy-guidelines/SKILL.md +73 -0
- package/payload/plugins/toolkit/skills/playwright-cli/SKILL.md +562 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/element-attributes.md +23 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/request-mocking.md +87 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/running-code.md +240 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/session-management.md +226 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/spec-driven-testing.md +312 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/storage-state.md +275 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/test-generation.md +138 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/tracing.md +142 -0
- package/payload/plugins/toolkit/skills/playwright-cli/references/video-recording.md +157 -0
- package/payload/plugins/toolkit/skills/playwright-cli/templates/standalone.config.json +7 -0
- package/payload/plugins/toolkit/skills/product-exploration/SKILL.md +64 -0
- package/payload/plugins/toolkit/skills/product-exploration/agents/openai.yaml +5 -0
- package/payload/plugins/toolkit/skills/prototype-first-development/SKILL.md +134 -0
- package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/README.md +88 -0
- package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/app.js +145 -0
- package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/index.html +229 -0
- package/payload/plugins/toolkit/skills/prototype-first-development/references/html-prototype-template/mock-state.json +60 -0
- package/payload/plugins/toolkit/skills/prototype-first-development/references/implementation-plan-handoff-template.md +61 -0
- package/payload/plugins/toolkit/skills/prototype-first-development/references/prototype-workflow-checklist.md +64 -0
- package/payload/plugins/toolkit/skills/publish-runweave-server/SKILL.md +69 -0
- package/payload/plugins/toolkit/skills/publish-runweave-server/agents/openai.yaml +4 -0
- package/payload/plugins/toolkit/skills/react-best-practices/AGENTS.md +3227 -0
- package/payload/plugins/toolkit/skills/react-best-practices/README.md +127 -0
- package/payload/plugins/toolkit/skills/react-best-practices/SKILL.md +143 -0
- package/payload/plugins/toolkit/skills/react-best-practices/metadata.json +15 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/event-handler-refs.md +55 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/init-once.md +42 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/advanced/use-latest.md +39 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/async/api-routes.md +38 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/async/defer-await.md +80 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/async/dependencies.md +52 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/async/parallel.md +28 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/async/suspense-boundaries.md +99 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/barrel-imports.md +59 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/conditional.md +37 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/defer-third-party.md +49 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/dynamic-imports.md +35 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/bundle/preload.md +46 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/client/event-listeners.md +78 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/client/localstorage-schema.md +77 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/client/passive-event-listeners.md +48 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/client/swr-dedup.md +56 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/batch-dom-css.md +110 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-function-results.md +80 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-property-access.md +28 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/cache-storage.md +70 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/combine-iterations.md +32 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/early-exit.md +50 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/flatmap-filter.md +55 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/hoist-regexp.md +45 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/index-maps.md +37 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/length-check-first.md +50 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/min-max-loop.md +82 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/set-map-lookups.md +24 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/js/tosorted-immutable.md +57 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/sections.md +46 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/meta/template.md +28 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/activity.md +26 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/animate-svg-wrapper.md +38 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/conditional-render.md +32 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/content-visibility.md +38 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hoist-jsx.md +36 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-no-flicker.md +72 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/hydration-suppress-warning.md +26 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/resource-hints.md +89 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/script-defer-async.md +71 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/svg-precision.md +28 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rendering/usetransition-loading.md +75 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/defer-reads.md +39 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/dependencies.md +45 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state-no-effect.md +40 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/derived-state.md +29 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/functional-setstate.md +77 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/lazy-state-init.md +58 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo-with-default-value.md +36 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/memo.md +44 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/move-effect-to-event.md +45 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/no-inline-components.md +83 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/simple-expression-in-memo.md +35 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/transitions.md +40 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/rerender/use-ref-transient-values.md +73 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/after-nonblocking.md +74 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/auth-actions.md +96 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-lru.md +41 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/cache-react.md +76 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/dedup-props.md +65 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/hoist-static-io.md +139 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/parallel-fetching.md +83 -0
- package/payload/plugins/toolkit/skills/react-best-practices/rules/server/serialization.md +38 -0
- package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/SKILL.md +8 -0
- package/payload/plugins/toolkit/skills/recorded-browser-mcp-verification/agents/openai.yaml +6 -0
- package/payload/plugins/toolkit/skills/reproduce-before-fix/SKILL.md +93 -0
- package/payload/plugins/toolkit/skills/reproduce-before-fix/agents/openai.yaml +7 -0
- package/payload/plugins/toolkit/skills/review-only/SKILL.md +72 -0
- package/payload/plugins/toolkit/skills/review-with-runtime-evidence/SKILL.md +134 -0
- package/payload/plugins/toolkit/skills/review-with-runtime-evidence/agents/openai.yaml +7 -0
- package/payload/plugins/toolkit/skills/review-with-runtime-evidence/references/contracts.md +114 -0
- package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/classify-runtime-verdict.mjs +140 -0
- package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/run-static-review.mjs +389 -0
- package/payload/plugins/toolkit/skills/review-with-runtime-evidence/scripts/static-review-contract.mjs +243 -0
- package/payload/plugins/toolkit/skills/run-test-cases/SKILL.md +63 -0
- package/payload/plugins/toolkit/skills/runweave-change-validation/SKILL.md +196 -0
- package/payload/plugins/toolkit/skills/runweave-change-validation/agents/openai.yaml +7 -0
- package/payload/plugins/toolkit/skills/runweave-change-validation/scripts/assert-dev-session-status.mjs +181 -0
- package/payload/plugins/toolkit/skills/runweave-dev-session/SKILL.md +126 -0
- package/payload/plugins/toolkit/skills/runweave-dev-session/agents/openai.yaml +7 -0
- package/payload/plugins/toolkit/skills/runweave-management/SKILL.md +47 -0
- package/payload/plugins/toolkit/skills/scheduled-task/SKILL.md +35 -0
- package/payload/plugins/toolkit/skills/shadcn/SKILL.md +245 -0
- package/payload/plugins/toolkit/skills/shadcn/agents/openai.yml +5 -0
- package/payload/plugins/toolkit/skills/shadcn/assets/shadcn-small.png +0 -0
- package/payload/plugins/toolkit/skills/shadcn/assets/shadcn.png +0 -0
- package/payload/plugins/toolkit/skills/shadcn/cli.md +276 -0
- package/payload/plugins/toolkit/skills/shadcn/customization.md +209 -0
- package/payload/plugins/toolkit/skills/shadcn/evals/evals.json +47 -0
- package/payload/plugins/toolkit/skills/shadcn/mcp.md +94 -0
- package/payload/plugins/toolkit/skills/shadcn/rules/base-vs-radix.md +310 -0
- package/payload/plugins/toolkit/skills/shadcn/rules/composition.md +197 -0
- package/payload/plugins/toolkit/skills/shadcn/rules/forms.md +198 -0
- package/payload/plugins/toolkit/skills/shadcn/rules/icons.md +101 -0
- package/payload/plugins/toolkit/skills/shadcn/rules/styling.md +163 -0
- package/payload/plugins/toolkit/skills/suiji/SKILL.md +54 -0
- package/payload/plugins/toolkit/skills/suiji/references/api.md +72 -0
- package/payload/plugins/toolkit/skills/suiji/references/source-adapter.md +40 -0
- package/payload/plugins/toolkit/skills/suiji/references/work-records.md +36 -0
- package/payload/plugins/toolkit/skills/suiji/scripts/source_adapter.py +46 -0
- package/payload/plugins/toolkit/skills/suiji/scripts/suiji.py +358 -0
- package/payload/plugins/toolkit/skills/suiji/scripts/work_records.py +328 -0
- package/payload/plugins/toolkit/skills/suiji/scripts/work_reports.py +75 -0
- package/payload/plugins/toolkit/skills/sync-branch-hard-reset/SKILL.md +59 -0
- package/payload/plugins/toolkit/skills/update-runweave-backend/SKILL.md +90 -0
- package/payload/plugins/toolkit/skills/update-runweave-backend/agents/openai.yaml +4 -0
- package/payload/plugins/toolkit/skills/update-runweave-backend/references/npm-update.md +68 -0
- package/payload/plugins/toolkit/skills/update-runweave-backend/references/systemd.md +34 -0
- package/payload/plugins/toolkit/skills/update-runweave-desktop/SKILL.md +102 -0
- package/payload/plugins/toolkit/skills/update-runweave-ios/SKILL.md +16 -0
- package/payload/plugins/toolkit/skills/update-runweave-ios/references/ios-wireless-recovery.md +54 -0
- package/payload/plugins/toolkit/skills/using-rw/SKILL.md +265 -0
- package/payload/plugins/toolkit/skills/write-plan/SKILL.md +72 -0
- package/payload/plugins/toolkit/skills/write-test-cases/SKILL.md +100 -0
- package/payload/plugins/toolkit/skills/write-test-cases/assets/test-plan-template.yaml +15 -0
- package/payload/plugins/toolkit/skills/write-test-cases/references/coverage-checklist.md +75 -0
- package/payload/plugins/toolkit/skills/write-test-cases/references/design-techniques.md +91 -0
- package/payload/plugins/toolkit/skills/youtube-reading/SKILL.md +35 -0
- package/payload/plugins/toolkit/skills/youtube-reading/agents/openai.yaml +4 -0
- package/payload/plugins/toolkit/skills/youtube-reading/assets/runtime-lock.json +92 -0
- package/payload/plugins/toolkit/skills/youtube-reading/references/content-contract.md +52 -0
- package/payload/plugins/toolkit/skills/youtube-reading/references/setup.md +70 -0
- package/payload/plugins/toolkit/skills/youtube-reading/requirements.lock +9 -0
- package/payload/plugins/toolkit/skills/youtube-reading/scripts/artifacts.py +206 -0
- package/payload/plugins/toolkit/skills/youtube-reading/scripts/runtime.py +424 -0
- package/payload/plugins/toolkit/skills/youtube-reading/scripts/youtube_reading.py +314 -0
- package/payload/plugins/toolkit-release.json +1 -0
- package/payload/pty-host/index.cjs +99 -31
- package/payload/scripts/toolkit/codex-state.mjs +75 -0
- package/payload/scripts/toolkit/release.mjs +210 -0
- package/payload/scripts/toolkit/sync-runtime.mjs +108 -0
- package/payload/scripts/toolkit/sync.mjs +585 -0
- package/payload/server/index.cjs +5 -1
- package/payload/frontend/dist/assets/channel-Bf3IeONI.js +0 -1
- package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-CFsG2SvG.js +0 -1
- package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-CFsG2SvG.js +0 -1
- package/payload/frontend/dist/assets/clone-CeQXm2YN.js +0 -1
- package/payload/frontend/dist/assets/connection-XriXysSc.js +0 -12
- package/payload/frontend/dist/assets/main-Cg6Oo1xK.css +0 -33
- package/payload/frontend/dist/assets/main-H5R-3_w1.js +0 -696
- package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-CzpdUl_0.js +0 -1
- package/payload/frontend/dist/assets/suiji-CO_L5W1X.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* runweave:build-info */var __RUNWEAVE_BUILD_INFO__={"version":"0.1.0","buildId":"
|
|
1
|
+
/* runweave:build-info */var __RUNWEAVE_BUILD_INFO__={"version":"0.1.0","buildId":"20261109T090925467Z-6f2a49bf","sourceRevision":"6f2a49bfb02ee8031c9c170e14df4160d8b9faf0","sourceDirty":false,"builtAt":"2026-11-09T09:09:25.467Z","contentSha256":"7874c6584384404ed511ce5d811e6033eaf8006408bbe8a66670749b796354b8"};
|
|
2
2
|
const __IMPORT_META_URL__ = require('url').pathToFileURL(__filename).href;
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -33601,7 +33601,7 @@ var require_has_flag = __commonJS({
|
|
|
33601
33601
|
var require_supports_colors = __commonJS({
|
|
33602
33602
|
"node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
|
|
33603
33603
|
"use strict";
|
|
33604
|
-
var
|
|
33604
|
+
var os24 = require("os");
|
|
33605
33605
|
var hasFlag = require_has_flag();
|
|
33606
33606
|
var env = process.env;
|
|
33607
33607
|
var forceColor = void 0;
|
|
@@ -33639,7 +33639,7 @@ var require_supports_colors = __commonJS({
|
|
|
33639
33639
|
}
|
|
33640
33640
|
var min = forceColor ? 1 : 0;
|
|
33641
33641
|
if (process.platform === "win32") {
|
|
33642
|
-
var osRelease =
|
|
33642
|
+
var osRelease = os24.release().split(".");
|
|
33643
33643
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
33644
33644
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
33645
33645
|
}
|
|
@@ -38665,7 +38665,7 @@ var require_winston_transport = __commonJS({
|
|
|
38665
38665
|
var require_console = __commonJS({
|
|
38666
38666
|
"node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/transports/console.js"(exports2, module2) {
|
|
38667
38667
|
"use strict";
|
|
38668
|
-
var
|
|
38668
|
+
var os24 = require("os");
|
|
38669
38669
|
var { LEVEL, MESSAGE } = require_triple_beam();
|
|
38670
38670
|
var TransportStream = require_winston_transport();
|
|
38671
38671
|
module2.exports = class Console extends TransportStream {
|
|
@@ -38679,7 +38679,7 @@ var require_console = __commonJS({
|
|
|
38679
38679
|
this.name = options.name || "console";
|
|
38680
38680
|
this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
|
|
38681
38681
|
this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
|
|
38682
|
-
this.eol = typeof options.eol === "string" ? options.eol :
|
|
38682
|
+
this.eol = typeof options.eol === "string" ? options.eol : os24.EOL;
|
|
38683
38683
|
this.forceConsole = options.forceConsole || false;
|
|
38684
38684
|
this._consoleLog = console.log.bind(console);
|
|
38685
38685
|
this._consoleWarn = console.warn.bind(console);
|
|
@@ -41480,7 +41480,7 @@ var require_file = __commonJS({
|
|
|
41480
41480
|
var { Stream, PassThrough } = require_readable();
|
|
41481
41481
|
var TransportStream = require_winston_transport();
|
|
41482
41482
|
var debug = require_node3()("winston:file");
|
|
41483
|
-
var
|
|
41483
|
+
var os24 = require("os");
|
|
41484
41484
|
var tailFile = require_tail_file();
|
|
41485
41485
|
module2.exports = class File extends TransportStream {
|
|
41486
41486
|
/**
|
|
@@ -41518,7 +41518,7 @@ var require_file = __commonJS({
|
|
|
41518
41518
|
this.rotationFormat = options.rotationFormat || false;
|
|
41519
41519
|
this.zippedArchive = options.zippedArchive || false;
|
|
41520
41520
|
this.maxFiles = options.maxFiles || null;
|
|
41521
|
-
this.eol = typeof options.eol === "string" ? options.eol :
|
|
41521
|
+
this.eol = typeof options.eol === "string" ? options.eol : os24.EOL;
|
|
41522
41522
|
this.tailable = options.tailable || false;
|
|
41523
41523
|
this.lazy = options.lazy || false;
|
|
41524
41524
|
this._size = 0;
|
|
@@ -42321,7 +42321,7 @@ var require_stream3 = __commonJS({
|
|
|
42321
42321
|
"use strict";
|
|
42322
42322
|
var isStream = require_is_stream();
|
|
42323
42323
|
var { MESSAGE } = require_triple_beam();
|
|
42324
|
-
var
|
|
42324
|
+
var os24 = require("os");
|
|
42325
42325
|
var TransportStream = require_winston_transport();
|
|
42326
42326
|
module2.exports = class Stream extends TransportStream {
|
|
42327
42327
|
/**
|
|
@@ -42337,7 +42337,7 @@ var require_stream3 = __commonJS({
|
|
|
42337
42337
|
this._stream = options.stream;
|
|
42338
42338
|
this._stream.setMaxListeners(Infinity);
|
|
42339
42339
|
this.isObjectMode = options.stream._writableState.objectMode;
|
|
42340
|
-
this.eol = typeof options.eol === "string" ? options.eol :
|
|
42340
|
+
this.eol = typeof options.eol === "string" ? options.eol : os24.EOL;
|
|
42341
42341
|
}
|
|
42342
42342
|
/**
|
|
42343
42343
|
* Core logging method exposed to Winston.
|
|
@@ -42720,7 +42720,7 @@ var require_exception_stream = __commonJS({
|
|
|
42720
42720
|
var require_exception_handler = __commonJS({
|
|
42721
42721
|
"node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/exception-handler.js"(exports2, module2) {
|
|
42722
42722
|
"use strict";
|
|
42723
|
-
var
|
|
42723
|
+
var os24 = require("os");
|
|
42724
42724
|
var asyncForEach = require_forEach();
|
|
42725
42725
|
var debug = require_node3()("winston:exception");
|
|
42726
42726
|
var once = require_one_time();
|
|
@@ -42815,8 +42815,8 @@ var require_exception_handler = __commonJS({
|
|
|
42815
42815
|
*/
|
|
42816
42816
|
getOsInfo() {
|
|
42817
42817
|
return {
|
|
42818
|
-
loadavg:
|
|
42819
|
-
uptime:
|
|
42818
|
+
loadavg: os24.loadavg(),
|
|
42819
|
+
uptime: os24.uptime()
|
|
42820
42820
|
};
|
|
42821
42821
|
}
|
|
42822
42822
|
/**
|
|
@@ -42958,7 +42958,7 @@ var require_rejection_stream = __commonJS({
|
|
|
42958
42958
|
var require_rejection_handler = __commonJS({
|
|
42959
42959
|
"node_modules/.pnpm/winston@3.19.0/node_modules/winston/lib/winston/rejection-handler.js"(exports2, module2) {
|
|
42960
42960
|
"use strict";
|
|
42961
|
-
var
|
|
42961
|
+
var os24 = require("os");
|
|
42962
42962
|
var asyncForEach = require_forEach();
|
|
42963
42963
|
var debug = require_node3()("winston:rejection");
|
|
42964
42964
|
var once = require_one_time();
|
|
@@ -43055,8 +43055,8 @@ var require_rejection_handler = __commonJS({
|
|
|
43055
43055
|
*/
|
|
43056
43056
|
getOsInfo() {
|
|
43057
43057
|
return {
|
|
43058
|
-
loadavg:
|
|
43059
|
-
uptime:
|
|
43058
|
+
loadavg: os24.loadavg(),
|
|
43059
|
+
uptime: os24.uptime()
|
|
43060
43060
|
};
|
|
43061
43061
|
}
|
|
43062
43062
|
/**
|
|
@@ -48810,7 +48810,7 @@ var require_FileStreamRotator = __commonJS({
|
|
|
48810
48810
|
var require_daily_rotate_file = __commonJS({
|
|
48811
48811
|
"node_modules/.pnpm/winston-daily-rotate-file@5.0.0_winston@3.19.0/node_modules/winston-daily-rotate-file/daily-rotate-file.js"(exports2, module2) {
|
|
48812
48812
|
var fs2 = require("fs");
|
|
48813
|
-
var
|
|
48813
|
+
var os24 = require("os");
|
|
48814
48814
|
var path130 = require("path");
|
|
48815
48815
|
var util2 = require("util");
|
|
48816
48816
|
var zlib = require("zlib");
|
|
@@ -48821,7 +48821,7 @@ var require_daily_rotate_file = __commonJS({
|
|
|
48821
48821
|
var loggerDefaults = {
|
|
48822
48822
|
json: false,
|
|
48823
48823
|
colorize: false,
|
|
48824
|
-
eol:
|
|
48824
|
+
eol: os24.EOL,
|
|
48825
48825
|
logstash: null,
|
|
48826
48826
|
prettyPrint: false,
|
|
48827
48827
|
label: null,
|
|
@@ -49494,11 +49494,11 @@ var require_codegen = __commonJS({
|
|
|
49494
49494
|
const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
49495
49495
|
return `${varKind} ${this.name}${rhs};` + _n;
|
|
49496
49496
|
}
|
|
49497
|
-
optimizeNames(names,
|
|
49497
|
+
optimizeNames(names, constants17) {
|
|
49498
49498
|
if (!names[this.name.str])
|
|
49499
49499
|
return;
|
|
49500
49500
|
if (this.rhs)
|
|
49501
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
49501
|
+
this.rhs = optimizeExpr(this.rhs, names, constants17);
|
|
49502
49502
|
return this;
|
|
49503
49503
|
}
|
|
49504
49504
|
get names() {
|
|
@@ -49515,10 +49515,10 @@ var require_codegen = __commonJS({
|
|
|
49515
49515
|
render({ _n }) {
|
|
49516
49516
|
return `${this.lhs} = ${this.rhs};` + _n;
|
|
49517
49517
|
}
|
|
49518
|
-
optimizeNames(names,
|
|
49518
|
+
optimizeNames(names, constants17) {
|
|
49519
49519
|
if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
|
|
49520
49520
|
return;
|
|
49521
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
49521
|
+
this.rhs = optimizeExpr(this.rhs, names, constants17);
|
|
49522
49522
|
return this;
|
|
49523
49523
|
}
|
|
49524
49524
|
get names() {
|
|
@@ -49579,8 +49579,8 @@ var require_codegen = __commonJS({
|
|
|
49579
49579
|
optimizeNodes() {
|
|
49580
49580
|
return `${this.code}` ? this : void 0;
|
|
49581
49581
|
}
|
|
49582
|
-
optimizeNames(names,
|
|
49583
|
-
this.code = optimizeExpr(this.code, names,
|
|
49582
|
+
optimizeNames(names, constants17) {
|
|
49583
|
+
this.code = optimizeExpr(this.code, names, constants17);
|
|
49584
49584
|
return this;
|
|
49585
49585
|
}
|
|
49586
49586
|
get names() {
|
|
@@ -49609,12 +49609,12 @@ var require_codegen = __commonJS({
|
|
|
49609
49609
|
}
|
|
49610
49610
|
return nodes.length > 0 ? this : void 0;
|
|
49611
49611
|
}
|
|
49612
|
-
optimizeNames(names,
|
|
49612
|
+
optimizeNames(names, constants17) {
|
|
49613
49613
|
const { nodes } = this;
|
|
49614
49614
|
let i = nodes.length;
|
|
49615
49615
|
while (i--) {
|
|
49616
49616
|
const n = nodes[i];
|
|
49617
|
-
if (n.optimizeNames(names,
|
|
49617
|
+
if (n.optimizeNames(names, constants17))
|
|
49618
49618
|
continue;
|
|
49619
49619
|
subtractNames(names, n.names);
|
|
49620
49620
|
nodes.splice(i, 1);
|
|
@@ -49667,12 +49667,12 @@ var require_codegen = __commonJS({
|
|
|
49667
49667
|
return void 0;
|
|
49668
49668
|
return this;
|
|
49669
49669
|
}
|
|
49670
|
-
optimizeNames(names,
|
|
49670
|
+
optimizeNames(names, constants17) {
|
|
49671
49671
|
var _a;
|
|
49672
|
-
this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names,
|
|
49673
|
-
if (!(super.optimizeNames(names,
|
|
49672
|
+
this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants17);
|
|
49673
|
+
if (!(super.optimizeNames(names, constants17) || this.else))
|
|
49674
49674
|
return;
|
|
49675
|
-
this.condition = optimizeExpr(this.condition, names,
|
|
49675
|
+
this.condition = optimizeExpr(this.condition, names, constants17);
|
|
49676
49676
|
return this;
|
|
49677
49677
|
}
|
|
49678
49678
|
get names() {
|
|
@@ -49695,10 +49695,10 @@ var require_codegen = __commonJS({
|
|
|
49695
49695
|
render(opts) {
|
|
49696
49696
|
return `for(${this.iteration})` + super.render(opts);
|
|
49697
49697
|
}
|
|
49698
|
-
optimizeNames(names,
|
|
49699
|
-
if (!super.optimizeNames(names,
|
|
49698
|
+
optimizeNames(names, constants17) {
|
|
49699
|
+
if (!super.optimizeNames(names, constants17))
|
|
49700
49700
|
return;
|
|
49701
|
-
this.iteration = optimizeExpr(this.iteration, names,
|
|
49701
|
+
this.iteration = optimizeExpr(this.iteration, names, constants17);
|
|
49702
49702
|
return this;
|
|
49703
49703
|
}
|
|
49704
49704
|
get names() {
|
|
@@ -49734,10 +49734,10 @@ var require_codegen = __commonJS({
|
|
|
49734
49734
|
render(opts) {
|
|
49735
49735
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
|
|
49736
49736
|
}
|
|
49737
|
-
optimizeNames(names,
|
|
49738
|
-
if (!super.optimizeNames(names,
|
|
49737
|
+
optimizeNames(names, constants17) {
|
|
49738
|
+
if (!super.optimizeNames(names, constants17))
|
|
49739
49739
|
return;
|
|
49740
|
-
this.iterable = optimizeExpr(this.iterable, names,
|
|
49740
|
+
this.iterable = optimizeExpr(this.iterable, names, constants17);
|
|
49741
49741
|
return this;
|
|
49742
49742
|
}
|
|
49743
49743
|
get names() {
|
|
@@ -49779,11 +49779,11 @@ var require_codegen = __commonJS({
|
|
|
49779
49779
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
|
|
49780
49780
|
return this;
|
|
49781
49781
|
}
|
|
49782
|
-
optimizeNames(names,
|
|
49782
|
+
optimizeNames(names, constants17) {
|
|
49783
49783
|
var _a, _b;
|
|
49784
|
-
super.optimizeNames(names,
|
|
49785
|
-
(_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names,
|
|
49786
|
-
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names,
|
|
49784
|
+
super.optimizeNames(names, constants17);
|
|
49785
|
+
(_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants17);
|
|
49786
|
+
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants17);
|
|
49787
49787
|
return this;
|
|
49788
49788
|
}
|
|
49789
49789
|
get names() {
|
|
@@ -50084,7 +50084,7 @@ var require_codegen = __commonJS({
|
|
|
50084
50084
|
function addExprNames(names, from) {
|
|
50085
50085
|
return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
|
|
50086
50086
|
}
|
|
50087
|
-
function optimizeExpr(expr, names,
|
|
50087
|
+
function optimizeExpr(expr, names, constants17) {
|
|
50088
50088
|
if (expr instanceof code_1.Name)
|
|
50089
50089
|
return replaceName(expr);
|
|
50090
50090
|
if (!canOptimize(expr))
|
|
@@ -50099,14 +50099,14 @@ var require_codegen = __commonJS({
|
|
|
50099
50099
|
return items;
|
|
50100
50100
|
}, []));
|
|
50101
50101
|
function replaceName(n) {
|
|
50102
|
-
const c =
|
|
50102
|
+
const c = constants17[n.str];
|
|
50103
50103
|
if (c === void 0 || names[n.str] !== 1)
|
|
50104
50104
|
return n;
|
|
50105
50105
|
delete names[n.str];
|
|
50106
50106
|
return c;
|
|
50107
50107
|
}
|
|
50108
50108
|
function canOptimize(e) {
|
|
50109
|
-
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 &&
|
|
50109
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants17[c.str] !== void 0);
|
|
50110
50110
|
}
|
|
50111
50111
|
}
|
|
50112
50112
|
function subtractNames(names, from) {
|
|
@@ -63800,6 +63800,8 @@ var CONFIGURATION_FIELDS = [
|
|
|
63800
63800
|
{ "path": "agents.companion.binary", "type": "string", "domain": "agents.companion", "sensitive": false, "remote": false, "apply": "restart", "description": "\u4F34\u968F\u7A97\u53E3 Agent \u53EF\u6267\u884C\u6587\u4EF6", "environmentKeys": ["RUNWEAVE_COMPANION_AGENT_EXECUTABLE"], "owner": "electron/companion", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u4F7F\u7528\u5DF2\u5B89\u88C5 Codex App \u81EA\u5E26\u6267\u884C\u5165\u53E3\uFF1B\u663E\u5F0F\u503C\u5FC5\u987B\u53EF\u6267\u884C\u3002" }, "migrationSources": ["RUNWEAVE_COMPANION_AGENT_EXECUTABLE"] },
|
|
63801
63801
|
{ "path": "agents.codex.sessionsDirectory", "type": "string", "domain": "agents.codex", "sensitive": false, "remote": false, "apply": "restart", "description": "\u5916\u90E8 Codex \u4F1A\u8BDD\u76EE\u5F55\u5F15\u7528", "environmentKeys": ["RUNWEAVE_CODEX_SESSIONS_DIR"], "owner": "backend+app-server", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u5916\u90E8\u5DE5\u5177\u62E5\u6709\u7684 CODEX_HOME/sessions \u6216\u64CD\u4F5C\u7CFB\u7EDF\u7528\u6237\u76EE\u5F55\u4E0B .codex/sessions\uFF0C\u4EC5\u5F15\u7528\u3002" }, "migrationSources": ["RUNWEAVE_CODEX_SESSIONS_DIR"] },
|
|
63802
63802
|
{ "path": "agents.traex.sessionsDirectory", "type": "string", "domain": "agents.traex", "sensitive": false, "remote": false, "apply": "restart", "description": "\u5916\u90E8 Trae \u4F1A\u8BDD\u76EE\u5F55\u5F15\u7528", "environmentKeys": ["RUNWEAVE_TRAE_SESSIONS_DIR"], "owner": "backend+app-server", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u64CD\u4F5C\u7CFB\u7EDF\u7528\u6237\u76EE\u5F55\u4E0B .trae/cli/sessions\uFF0C\u4EC5\u5F15\u7528\u3002" }, "migrationSources": ["RUNWEAVE_TRAE_SESSIONS_DIR"] },
|
|
63803
|
+
{ "path": "terminal.defaultShell.command", "type": "string", "domain": "terminal.defaultShell", "sensitive": false, "remote": false, "apply": "reload", "description": "\u5F53\u524D\u7535\u8111\u65B0\u7EC8\u7AEF\u7684\u9ED8\u8BA4\u53EF\u6267\u884C\u6587\u4EF6\uFF1B\u7F3A\u7701\u4F7F\u7528\u7CFB\u7EDF Shell\uFF0C\u542F\u52A8\u4E0D\u53EF\u7528\u65F6\u56DE\u9000\u7CFB\u7EDF\u9ED8\u8BA4", "environmentKeys": [], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u7CFB\u7EDF\u8D26\u6237\u767B\u5F55 Shell\uFF1BWindows \u4F7F\u7528 ComSpec\uFF1B\u4E0D\u53EF\u7528\u65F6\u91C7\u7528\u5E73\u53F0\u515C\u5E95" }, "migrationSources": ["new-field:no-legacy-source"] },
|
|
63804
|
+
{ "path": "terminal.defaultShell.args", "type": "array<string>", "domain": "terminal.defaultShell", "sensitive": false, "remote": false, "apply": "reload", "description": "\u9ED8\u8BA4 Shell \u7684\u542F\u52A8\u53C2\u6570\uFF1B\u7A7A\u6570\u7EC4\u660E\u786E\u4E0D\u52A0\u53C2\u6570\uFF0C\u7F3A\u7701\u4FDD\u7559 bash/zsh \u7684 -l \u884C\u4E3A", "environmentKeys": [], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "\u6839\u636E\u6240\u9009\u7A0B\u5E8F\u89E3\u6790\uFF1Bbash/zsh \u4E3A [-l]\uFF0C\u5176\u4ED6\u4E3A\u7A7A\u6570\u7EC4" }, "migrationSources": ["new-field:no-legacy-source"] },
|
|
63803
63805
|
{ "path": "terminal.tmux.enabled", "type": "boolean", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "tmux \u6301\u4E45\u7EC8\u7AEF\u5F00\u5173", "environmentKeys": ["TERMINAL_TMUX_ENABLED"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "value": true }, "migrationSources": ["TERMINAL_TMUX_ENABLED"] },
|
|
63804
63806
|
{ "path": "terminal.tmux.binary", "type": "string", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "tmux \u53EF\u6267\u884C\u6587\u4EF6", "environmentKeys": ["TMUX_BINARY"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "value": "tmux" }, "migrationSources": ["TMUX_BINARY"] },
|
|
63805
63807
|
{ "path": "terminal.tmux.shutdownPolicy", "type": "string", "domain": "terminal", "sensitive": false, "remote": false, "apply": "restart", "description": "\u9000\u51FA\u65F6 tmux \u4FDD\u7559\u7B56\u7565", "environmentKeys": ["TERMINAL_TMUX_SHUTDOWN_POLICY"], "owner": "backend/terminal", "scope": "instance", "storage": "settings.yaml", "default": { "rule": "Stable \u4E3A preserve\uFF0CDev \u4E3A cleanup\u3002" }, "migrationSources": ["TERMINAL_TMUX_SHUTDOWN_POLICY"] },
|
|
@@ -64123,7 +64125,9 @@ function validateDomains(value, context) {
|
|
|
64123
64125
|
issue2(key2, "CONFIG_FIELD_TYPE_INVALID");
|
|
64124
64126
|
continue;
|
|
64125
64127
|
}
|
|
64126
|
-
if (
|
|
64128
|
+
if (["backend.taskSupervision.model", "terminal.defaultShell.command"].includes(key2) && typeof entry === "string" && !entry.trim()) issue2(key2, "CONFIG_FIELD_VALUE_INVALID");
|
|
64129
|
+
if (key2 === "terminal.defaultShell.command" && typeof entry === "string" && /[\\/]/.test(entry) && !import_node_path4.default.isAbsolute(entry.trim())) issue2(key2, "CONFIG_FIELD_VALUE_INVALID");
|
|
64130
|
+
if (key2.startsWith("terminal.defaultShell.") && (typeof entry === "string" ? entry.includes("\0") : Array.isArray(entry) && entry.some((item) => typeof item === "string" && item.includes("\0")))) issue2(key2, "CONFIG_FIELD_VALUE_INVALID");
|
|
64127
64131
|
if (CONFIGURATION_ENUMS[key2] && !CONFIGURATION_ENUMS[key2].includes(String(entry))) issue2(key2, "CONFIG_FIELD_ENUM_INVALID");
|
|
64128
64132
|
if (configurationServiceOrigin(key2) && typeof entry === "string") {
|
|
64129
64133
|
try {
|
|
@@ -71874,6 +71878,21 @@ var aiDiagnosticLog = createAiDiagnosticLog({
|
|
|
71874
71878
|
source: "backend"
|
|
71875
71879
|
});
|
|
71876
71880
|
|
|
71881
|
+
// packages/shared/src/terminal/shell.ts
|
|
71882
|
+
function terminalShellName(command) {
|
|
71883
|
+
return (command.split(/[\\/]/).at(-1) ?? command).toLowerCase().replace(/\.exe$/, "");
|
|
71884
|
+
}
|
|
71885
|
+
function isInteractiveShellLaunch(launch) {
|
|
71886
|
+
const name = terminalShellName(launch.command);
|
|
71887
|
+
if (!["sh", "bash", "zsh", "dash", "ksh", "fish", "powershell", "pwsh", "cmd"].includes(name)) return false;
|
|
71888
|
+
return !(launch.args ?? []).some((arg) => {
|
|
71889
|
+
const value = arg.toLowerCase();
|
|
71890
|
+
if (name === "cmd") return !/^\/(?:d|q|a|u|e:(?:on|off)|f:(?:on|off)|v:(?:on|off))$/.test(value);
|
|
71891
|
+
if (name === "powershell" || name === "pwsh") return !["-nologo", "-noprofile", "-noexit", "-login", "-l"].includes(value);
|
|
71892
|
+
return ["--help", "--version"].includes(value) || !value.startsWith("-") || value === "--" || /^-[^-]*[cs]/.test(value) || /^--(?:command|init-command)(?:=|$)/.test(value);
|
|
71893
|
+
});
|
|
71894
|
+
}
|
|
71895
|
+
|
|
71877
71896
|
// backend/src/terminal/runtime/pty-host-client.ts
|
|
71878
71897
|
var import_node_crypto15 = require("node:crypto");
|
|
71879
71898
|
|
|
@@ -72085,6 +72104,7 @@ async function createHostedPty(options) {
|
|
|
72085
72104
|
early.push(event);
|
|
72086
72105
|
return;
|
|
72087
72106
|
}
|
|
72107
|
+
if (event.type === "launch" && options.onLaunch) void options.onLaunch(event.launch).catch(disconnected);
|
|
72088
72108
|
if (event.type === "output") emitFrame(event);
|
|
72089
72109
|
if (event.type === "resize") {
|
|
72090
72110
|
grid = { cols: event.cols, rows: event.rows };
|
|
@@ -72108,6 +72128,15 @@ async function createHostedPty(options) {
|
|
|
72108
72128
|
client.disconnected.delete(disconnected);
|
|
72109
72129
|
throw error2;
|
|
72110
72130
|
}
|
|
72131
|
+
if (attached.session.launch && options.onLaunch) {
|
|
72132
|
+
try {
|
|
72133
|
+
await options.onLaunch(attached.session.launch);
|
|
72134
|
+
} catch (error2) {
|
|
72135
|
+
client.events.delete(receive);
|
|
72136
|
+
client.disconnected.delete(disconnected);
|
|
72137
|
+
throw error2;
|
|
72138
|
+
}
|
|
72139
|
+
}
|
|
72111
72140
|
cursor = attached.snapshot.cursor;
|
|
72112
72141
|
grid = { cols: attached.snapshot.cols, rows: attached.snapshot.rows };
|
|
72113
72142
|
for (const frame of attached.frames) emitFrame(frame);
|
|
@@ -72203,8 +72232,8 @@ async function disconnectPtyHost() {
|
|
|
72203
72232
|
var import_node_crypto16 = require("node:crypto");
|
|
72204
72233
|
|
|
72205
72234
|
// backend/src/terminal/runtime/pty-service.ts
|
|
72206
|
-
var
|
|
72207
|
-
var
|
|
72235
|
+
var import_node_fs15 = require("node:fs");
|
|
72236
|
+
var import_node_path24 = __toESM(require("node:path"), 1);
|
|
72208
72237
|
var import_node_module = require("node:module");
|
|
72209
72238
|
|
|
72210
72239
|
// backend/src/terminal/runtime/node-pty-path.ts
|
|
@@ -72301,8 +72330,85 @@ function isDisabledColorFlag(value) {
|
|
|
72301
72330
|
}
|
|
72302
72331
|
|
|
72303
72332
|
// backend/src/terminal/runtime/shell-integration.ts
|
|
72333
|
+
var import_node_child_process4 = require("node:child_process");
|
|
72334
|
+
var import_node_fs14 = require("node:fs");
|
|
72335
|
+
var import_node_path23 = __toESM(require("node:path"), 1);
|
|
72336
|
+
|
|
72337
|
+
// backend/src/terminal/runtime/default-shell.ts
|
|
72304
72338
|
var import_node_fs13 = require("node:fs");
|
|
72339
|
+
var import_node_os9 = __toESM(require("node:os"), 1);
|
|
72305
72340
|
var import_node_path22 = __toESM(require("node:path"), 1);
|
|
72341
|
+
function isExecutable(file) {
|
|
72342
|
+
try {
|
|
72343
|
+
(0, import_node_fs13.accessSync)(file, process.platform === "win32" ? import_node_fs13.constants.F_OK : import_node_fs13.constants.X_OK);
|
|
72344
|
+
return (0, import_node_fs13.statSync)(file).isFile();
|
|
72345
|
+
} catch {
|
|
72346
|
+
return false;
|
|
72347
|
+
}
|
|
72348
|
+
}
|
|
72349
|
+
function resolveTerminalExecutable(command, env = process.env) {
|
|
72350
|
+
if (import_node_path22.default.isAbsolute(command) || /[\\/]/.test(command)) return isExecutable(command) ? command : void 0;
|
|
72351
|
+
const suffixes = process.platform === "win32" ? ["", ".exe", ".com"] : [""];
|
|
72352
|
+
for (const directory3 of (env.PATH ?? "").split(import_node_path22.default.delimiter).filter(Boolean)) {
|
|
72353
|
+
for (const suffix of suffixes) {
|
|
72354
|
+
const candidate = import_node_path22.default.join(directory3, command + suffix);
|
|
72355
|
+
if (isExecutable(candidate)) return candidate;
|
|
72356
|
+
}
|
|
72357
|
+
}
|
|
72358
|
+
return void 0;
|
|
72359
|
+
}
|
|
72360
|
+
function resolveSystemTerminalLaunchConfig() {
|
|
72361
|
+
const env = process.env;
|
|
72362
|
+
let candidates;
|
|
72363
|
+
if (process.platform === "win32") {
|
|
72364
|
+
candidates = [env.ComSpec, env.COMSPEC, "powershell.exe", "cmd.exe"];
|
|
72365
|
+
} else {
|
|
72366
|
+
let loginShell = null;
|
|
72367
|
+
try {
|
|
72368
|
+
loginShell = import_node_os9.default.userInfo().shell;
|
|
72369
|
+
} catch {
|
|
72370
|
+
}
|
|
72371
|
+
candidates = [loginShell, env.SHELL, "/bin/bash", "/bin/sh"];
|
|
72372
|
+
}
|
|
72373
|
+
const command = candidates.map((candidate) => candidate?.trim()).find((candidate) => candidate && resolveTerminalExecutable(candidate));
|
|
72374
|
+
if (!command) throw new Error("No executable system shell found");
|
|
72375
|
+
return { command, args: resolveDefaultTerminalArgs(command) };
|
|
72376
|
+
}
|
|
72377
|
+
function resolveDefaultTerminalArgs(command) {
|
|
72378
|
+
return ["zsh", "bash"].includes(terminalShellName(command)) ? ["-l"] : [];
|
|
72379
|
+
}
|
|
72380
|
+
function resolveTerminalLaunchConfig(overrides = {}) {
|
|
72381
|
+
const explicitCommand = overrides.command?.trim();
|
|
72382
|
+
if (explicitCommand) return { command: explicitCommand, args: overrides.args ?? resolveDefaultTerminalArgs(explicitCommand) };
|
|
72383
|
+
const launch = resolveDefaultTerminalLaunchConfig();
|
|
72384
|
+
return { command: launch.command, args: overrides.args ?? launch.args };
|
|
72385
|
+
}
|
|
72386
|
+
function resolveDefaultTerminalLaunchConfig() {
|
|
72387
|
+
const config3 = configuration();
|
|
72388
|
+
config3.requireDomain("terminal.defaultShell");
|
|
72389
|
+
const command = config3.get("terminal.defaultShell.command")?.trim();
|
|
72390
|
+
const args = config3.get("terminal.defaultShell.args");
|
|
72391
|
+
if (command && !resolveTerminalExecutable(command)) {
|
|
72392
|
+
const fallback = resolveSystemTerminalLaunchConfig();
|
|
72393
|
+
logger.warn("terminal.default-shell.unavailable", { message: "Configured shell is unavailable; using system shell", command, fallbackCommand: fallback.command });
|
|
72394
|
+
return fallback;
|
|
72395
|
+
}
|
|
72396
|
+
const selected = command ?? resolveSystemTerminalLaunchConfig().command;
|
|
72397
|
+
return { command: selected, args: args ?? resolveDefaultTerminalArgs(selected) };
|
|
72398
|
+
}
|
|
72399
|
+
function resolveTerminalFallbackLaunchConfig(current) {
|
|
72400
|
+
if (!isInteractiveShellLaunch(current)) return null;
|
|
72401
|
+
let fallback;
|
|
72402
|
+
try {
|
|
72403
|
+
fallback = resolveSystemTerminalLaunchConfig();
|
|
72404
|
+
} catch {
|
|
72405
|
+
return null;
|
|
72406
|
+
}
|
|
72407
|
+
const args = current.args ?? [];
|
|
72408
|
+
return current.command.trim() === fallback.command && args.length === fallback.args.length && args.every((arg, i) => arg === fallback.args[i]) ? null : fallback;
|
|
72409
|
+
}
|
|
72410
|
+
|
|
72411
|
+
// backend/src/terminal/runtime/shell-integration.ts
|
|
72306
72412
|
var ESC = "\\u001b";
|
|
72307
72413
|
var BEL = "\\u0007";
|
|
72308
72414
|
var OSC_7_PATTERN = new RegExp(
|
|
@@ -72317,7 +72423,7 @@ var ZSH_HOOK_PREFIX = "runweave-zsh-";
|
|
|
72317
72423
|
function isManagedZshHookDirectory(value) {
|
|
72318
72424
|
const normalized = value?.trim();
|
|
72319
72425
|
return Boolean(
|
|
72320
|
-
normalized &&
|
|
72426
|
+
normalized && import_node_path23.default.basename(normalized).startsWith(ZSH_HOOK_PREFIX)
|
|
72321
72427
|
);
|
|
72322
72428
|
}
|
|
72323
72429
|
function resolveOriginalZdotdir(env) {
|
|
@@ -72343,7 +72449,8 @@ function createShellPromptTracker(initialState) {
|
|
|
72343
72449
|
(_match, rawUrl) => {
|
|
72344
72450
|
try {
|
|
72345
72451
|
const parsedUrl = new URL(rawUrl);
|
|
72346
|
-
const
|
|
72452
|
+
const pathname = decodeURIComponent(parsedUrl.pathname);
|
|
72453
|
+
const nextCwd = process.platform === "win32" && /^\/[a-z]:\//i.test(pathname) ? import_node_path23.default.win32.normalize(pathname.slice(1)) : pathname;
|
|
72347
72454
|
if (nextCwd !== state.cwd) {
|
|
72348
72455
|
state.cwd = nextCwd;
|
|
72349
72456
|
metadataChanged = true;
|
|
@@ -72382,21 +72489,36 @@ function extractShellPromptMetadata(chunk) {
|
|
|
72382
72489
|
activeCommand: metadata.activeCommand
|
|
72383
72490
|
};
|
|
72384
72491
|
}
|
|
72385
|
-
var
|
|
72386
|
-
function
|
|
72387
|
-
if (
|
|
72388
|
-
|
|
72389
|
-
|
|
72390
|
-
const
|
|
72391
|
-
|
|
72392
|
-
|
|
72393
|
-
|
|
72492
|
+
var cachedZshHookDirs = /* @__PURE__ */ new Map();
|
|
72493
|
+
function shellPath(value, command, env) {
|
|
72494
|
+
if (process.platform !== "win32" || !value) return value;
|
|
72495
|
+
const executable = resolveTerminalExecutable(command, env);
|
|
72496
|
+
if (!executable) throw new Error("Cannot resolve zsh executable for path conversion");
|
|
72497
|
+
const converted = (0, import_node_child_process4.execFileSync)(import_node_path23.default.join(import_node_path23.default.dirname(executable), "cygpath.exe"), ["-u", "-a", "--", value], {
|
|
72498
|
+
env,
|
|
72499
|
+
encoding: "utf8",
|
|
72500
|
+
timeout: 2e3,
|
|
72501
|
+
maxBuffer: 64 * 1024,
|
|
72502
|
+
windowsHide: true
|
|
72503
|
+
}).trim();
|
|
72504
|
+
if (!converted) throw new Error("cygpath returned an empty path");
|
|
72505
|
+
return converted;
|
|
72506
|
+
}
|
|
72507
|
+
function ensureZshHookDirectory(command, env) {
|
|
72508
|
+
const key2 = process.platform === "win32" ? resolveTerminalExecutable(command, env) ?? command : "posix";
|
|
72509
|
+
const cached3 = cachedZshHookDirs.get(key2);
|
|
72510
|
+
if (cached3) return cached3;
|
|
72511
|
+
const runtimeRoot = import_node_path23.default.join(configuration().context.configRoot, "runtime");
|
|
72512
|
+
(0, import_node_fs14.mkdirSync)(runtimeRoot, { recursive: true, mode: 448 });
|
|
72513
|
+
const hookDir = (0, import_node_fs14.mkdtempSync)(import_node_path23.default.join(runtimeRoot, ZSH_HOOK_PREFIX));
|
|
72514
|
+
const hookShellDir = shellPath(hookDir, command, env);
|
|
72515
|
+
const boundBin = shellPath(import_node_path23.default.join(runtimeRoot, "bin"), command, env).replace(/'/g, "'\\''");
|
|
72394
72516
|
const sourceOriginalScript = (startupFile) => [
|
|
72395
72517
|
'_runweave_original_zdotdir="${RUNWEAVE_ORIGINAL_ZDOTDIR:-${BROWSER_VIEWER_ORIGINAL_ZDOTDIR:-$HOME}}"',
|
|
72396
72518
|
`if [[ "$_runweave_original_zdotdir" != */${ZSH_HOOK_PREFIX}* && -r "$_runweave_original_zdotdir/${startupFile}" ]]; then`,
|
|
72397
72519
|
` source "$_runweave_original_zdotdir/${startupFile}"`,
|
|
72398
72520
|
"fi",
|
|
72399
|
-
`export ZDOTDIR=
|
|
72521
|
+
`export ZDOTDIR='${hookShellDir.replace(/'/g, "'\\''")}'`,
|
|
72400
72522
|
""
|
|
72401
72523
|
].join("\n");
|
|
72402
72524
|
const zshrcScript = [
|
|
@@ -72434,7 +72556,10 @@ function ensureZshHookDirectory() {
|
|
|
72434
72556
|
" fi",
|
|
72435
72557
|
"}",
|
|
72436
72558
|
"_runweave_emit_cwd() {",
|
|
72437
|
-
|
|
72559
|
+
...process.platform === "win32" ? [
|
|
72560
|
+
` local cwd="$( '${shellPath(import_node_path23.default.join(import_node_path23.default.dirname(resolveTerminalExecutable(command, env) ?? command), "cygpath.exe"), command, env).replace(/'/g, "'\\''")}' -m -- "$PWD" )"`,
|
|
72561
|
+
' printf "\\033]7;file://%s/%s\\007" "${HOST:-localhost}" "$cwd"'
|
|
72562
|
+
] : [' printf "\\033]7;file://%s%s\\007" "${HOST:-localhost}" "$PWD"'],
|
|
72438
72563
|
"}",
|
|
72439
72564
|
"_runweave_precmd() {",
|
|
72440
72565
|
" _runweave_clear_command",
|
|
@@ -72454,26 +72579,32 @@ function ensureZshHookDirectory() {
|
|
|
72454
72579
|
// source the user's original files before restoring this instance's PATH.
|
|
72455
72580
|
""
|
|
72456
72581
|
].join("\n");
|
|
72457
|
-
(0,
|
|
72458
|
-
(0,
|
|
72459
|
-
|
|
72582
|
+
(0, import_node_fs14.writeFileSync)(import_node_path23.default.join(hookDir, ".zshenv"), sourceOriginalScript(".zshenv"), "utf8");
|
|
72583
|
+
(0, import_node_fs14.writeFileSync)(
|
|
72584
|
+
import_node_path23.default.join(hookDir, ".zprofile"),
|
|
72460
72585
|
sourceOriginalScript(".zprofile"),
|
|
72461
72586
|
"utf8"
|
|
72462
72587
|
);
|
|
72463
|
-
(0,
|
|
72464
|
-
|
|
72465
|
-
return
|
|
72588
|
+
(0, import_node_fs14.writeFileSync)(import_node_path23.default.join(hookDir, ".zshrc"), zshrcScript, "utf8");
|
|
72589
|
+
cachedZshHookDirs.set(key2, hookShellDir);
|
|
72590
|
+
return hookShellDir;
|
|
72466
72591
|
}
|
|
72467
72592
|
function applyShellIntegration(command, env) {
|
|
72468
|
-
const shellName =
|
|
72593
|
+
const shellName = terminalShellName(command);
|
|
72469
72594
|
if (shellName === "zsh") {
|
|
72470
|
-
|
|
72471
|
-
|
|
72472
|
-
|
|
72473
|
-
|
|
72474
|
-
|
|
72475
|
-
|
|
72476
|
-
|
|
72595
|
+
try {
|
|
72596
|
+
const hookDir = ensureZshHookDirectory(command, env);
|
|
72597
|
+
const originalZdotdir = shellPath(resolveOriginalZdotdir(env), command, env);
|
|
72598
|
+
return {
|
|
72599
|
+
...env,
|
|
72600
|
+
RUNWEAVE_ORIGINAL_ZDOTDIR: originalZdotdir,
|
|
72601
|
+
BROWSER_VIEWER_ORIGINAL_ZDOTDIR: originalZdotdir,
|
|
72602
|
+
ZDOTDIR: hookDir
|
|
72603
|
+
};
|
|
72604
|
+
} catch (error2) {
|
|
72605
|
+
logger.warn("terminal.shell-integration.unavailable", { message: "Cannot prepare zsh integration paths; starting without integration", command, error: error2 });
|
|
72606
|
+
return env;
|
|
72607
|
+
}
|
|
72477
72608
|
}
|
|
72478
72609
|
if (shellName === "bash") {
|
|
72479
72610
|
const emitBashHooks = [
|
|
@@ -72588,12 +72719,12 @@ var QUICK_EXIT_FALLBACK_THRESHOLD_MS = 1e3;
|
|
|
72588
72719
|
var TERMINAL_PROGRAM_NAME = "runweave";
|
|
72589
72720
|
var ptyLogger = logger.child({ component: "terminal" });
|
|
72590
72721
|
var require2 = (0, import_node_module.createRequire)(
|
|
72591
|
-
|
|
72722
|
+
import_node_path24.default.join(process.cwd(), "__runweave_node_pty_loader__.cjs")
|
|
72592
72723
|
);
|
|
72593
72724
|
function loadNodePtyModule() {
|
|
72594
72725
|
const configuredDir = resolveNodePtyDirectory(process.env);
|
|
72595
72726
|
if (configuredDir) {
|
|
72596
|
-
return require2(
|
|
72727
|
+
return require2(import_node_path24.default.join(configuredDir, "lib", "index.js"));
|
|
72597
72728
|
}
|
|
72598
72729
|
return require2("node-pty");
|
|
72599
72730
|
}
|
|
@@ -72602,17 +72733,17 @@ function ensureSpawnHelperExecutable() {
|
|
|
72602
72733
|
return;
|
|
72603
72734
|
}
|
|
72604
72735
|
try {
|
|
72605
|
-
const nodePtyDir = resolveNodePtyDirectory(process.env) ??
|
|
72606
|
-
const helperPath =
|
|
72736
|
+
const nodePtyDir = resolveNodePtyDirectory(process.env) ?? import_node_path24.default.dirname(require2.resolve("node-pty/package.json"));
|
|
72737
|
+
const helperPath = import_node_path24.default.join(
|
|
72607
72738
|
nodePtyDir,
|
|
72608
72739
|
"prebuilds",
|
|
72609
72740
|
`darwin-${process.arch}`,
|
|
72610
72741
|
"spawn-helper"
|
|
72611
72742
|
);
|
|
72612
|
-
const currentMode = (0,
|
|
72743
|
+
const currentMode = (0, import_node_fs15.statSync)(helperPath).mode & 511;
|
|
72613
72744
|
const executableMode = currentMode | 73;
|
|
72614
72745
|
if (currentMode !== executableMode) {
|
|
72615
|
-
(0,
|
|
72746
|
+
(0, import_node_fs15.chmodSync)(helperPath, executableMode);
|
|
72616
72747
|
}
|
|
72617
72748
|
} catch (error2) {
|
|
72618
72749
|
ptyLogger.error("terminal.pty.spawn-helper.prepare.failed", {
|
|
@@ -72634,7 +72765,7 @@ function normalizePathForAppImage(env) {
|
|
|
72634
72765
|
}
|
|
72635
72766
|
const appDir = env.APPDIR.trim();
|
|
72636
72767
|
const currentPath = env.PATH ?? "";
|
|
72637
|
-
env.PATH = currentPath.split(
|
|
72768
|
+
env.PATH = currentPath.split(import_node_path24.default.delimiter).filter((entry) => entry && !entry.startsWith(appDir)).join(import_node_path24.default.delimiter);
|
|
72638
72769
|
delete env.APPIMAGE;
|
|
72639
72770
|
delete env.APPDIR;
|
|
72640
72771
|
}
|
|
@@ -72664,7 +72795,7 @@ function buildPtyEnv(baseEnv, sessionEnv, command) {
|
|
|
72664
72795
|
if (!isUnsetEnvValue(baseEnv.GOOGLE_API_KEY) && merged.GOOGLE_API_KEY === baseEnv.GOOGLE_API_KEY) {
|
|
72665
72796
|
delete merged.GOOGLE_API_KEY;
|
|
72666
72797
|
}
|
|
72667
|
-
if (process.platform === "win32" &&
|
|
72798
|
+
if (process.platform === "win32" && import_node_path24.default.basename(command).toLowerCase() === "powershell.exe") {
|
|
72668
72799
|
for (const key2 of Object.keys(merged)) {
|
|
72669
72800
|
if (key2.toLowerCase() === "psmodulepath") delete merged[key2];
|
|
72670
72801
|
}
|
|
@@ -72683,7 +72814,7 @@ var PtyService = class {
|
|
|
72683
72814
|
const dataListeners = /* @__PURE__ */ new Set();
|
|
72684
72815
|
const exitListeners = /* @__PURE__ */ new Set();
|
|
72685
72816
|
const normalizedArgs = [...options.args ?? []];
|
|
72686
|
-
const fallback = options.fallback ? {
|
|
72817
|
+
const fallback = options.fallback && isInteractiveShellLaunch(options) ? {
|
|
72687
72818
|
command: options.fallback.command,
|
|
72688
72819
|
args: [...options.fallback.args]
|
|
72689
72820
|
} : null;
|
|
@@ -72693,6 +72824,7 @@ var PtyService = class {
|
|
|
72693
72824
|
let currentPid = -1;
|
|
72694
72825
|
let disposed = false;
|
|
72695
72826
|
let fallbackActivated = false;
|
|
72827
|
+
let inputStarted = false;
|
|
72696
72828
|
let launchStartedAt = Date.now();
|
|
72697
72829
|
let lastWriteAt = null;
|
|
72698
72830
|
let writeSequence = 0;
|
|
@@ -72775,7 +72907,7 @@ var PtyService = class {
|
|
|
72775
72907
|
};
|
|
72776
72908
|
};
|
|
72777
72909
|
const activateFallback = (reasonLines, error2) => {
|
|
72778
|
-
if (!fallback || fallbackActivated || disposed) {
|
|
72910
|
+
if (!fallback || fallbackActivated || disposed || inputStarted) {
|
|
72779
72911
|
if (reasonLines.length > 0) {
|
|
72780
72912
|
emitData(formatFallbackMessage(reasonLines));
|
|
72781
72913
|
}
|
|
@@ -72857,7 +72989,7 @@ var PtyService = class {
|
|
|
72857
72989
|
return;
|
|
72858
72990
|
}
|
|
72859
72991
|
const runDuration = Date.now() - launchStartedAt;
|
|
72860
|
-
const shouldFallback = !usingFallback && !fallbackActivated && event.exitCode > 0 && runDuration < QUICK_EXIT_FALLBACK_THRESHOLD_MS;
|
|
72992
|
+
const shouldFallback = !usingFallback && !fallbackActivated && !inputStarted && event.exitCode > 0 && runDuration < QUICK_EXIT_FALLBACK_THRESHOLD_MS;
|
|
72861
72993
|
if (shouldFallback) {
|
|
72862
72994
|
ptyLogger.warn("terminal.pty.quick-exit", {
|
|
72863
72995
|
message: "Terminal pty exited quickly",
|
|
@@ -72910,6 +73042,7 @@ var PtyService = class {
|
|
|
72910
73042
|
}
|
|
72911
73043
|
},
|
|
72912
73044
|
write(data) {
|
|
73045
|
+
inputStarted = true;
|
|
72913
73046
|
writeSequence += 1;
|
|
72914
73047
|
lastWriteAt = Date.now();
|
|
72915
73048
|
logTerminalPerf("pty.write", {
|
|
@@ -72925,6 +73058,7 @@ var PtyService = class {
|
|
|
72925
73058
|
currentRuntime?.resize(cols, rows);
|
|
72926
73059
|
},
|
|
72927
73060
|
signal(signal) {
|
|
73061
|
+
inputStarted = true;
|
|
72928
73062
|
currentRuntime?.signal(signal);
|
|
72929
73063
|
},
|
|
72930
73064
|
dispose() {
|
|
@@ -73050,9 +73184,15 @@ function ensureHostedTerminal(options) {
|
|
|
73050
73184
|
binding = { hostInstanceId: (await getPtyHost()).descriptor.hostInstanceId, sessionInstanceId: (0, import_node_crypto16.randomUUID)() };
|
|
73051
73185
|
await terminalSessionManager.updateRuntimeMetadata(session.id, { runtimeKind: "pty", ptyHost: binding, recoverable: true });
|
|
73052
73186
|
}
|
|
73187
|
+
const fallback = creating ? resolveTerminalFallbackLaunchConfig(session) : null;
|
|
73188
|
+
const terminalEnv = buildTerminalRuntimeEnvironment({ terminalSessionId: session.id, projectId: session.projectId, source: session.source });
|
|
73053
73189
|
const runtime = await createHostedPty({
|
|
73054
73190
|
terminalSessionId: session.id,
|
|
73055
73191
|
binding,
|
|
73192
|
+
onLaunch: async (launch2) => {
|
|
73193
|
+
if (launch2.fallbackReason) logger.warn("terminal.pty-host.fallback.activated", { terminalSessionId: session.id, command: launch2.command, reason: launch2.fallbackReason });
|
|
73194
|
+
await terminalSessionManager.updateSessionLaunch(session.id, { command: launch2.command, args: launch2.args });
|
|
73195
|
+
},
|
|
73056
73196
|
create: creating ? {
|
|
73057
73197
|
sessionInstanceId: binding.sessionInstanceId,
|
|
73058
73198
|
terminalSessionId: session.id,
|
|
@@ -73062,11 +73202,8 @@ function ensureHostedTerminal(options) {
|
|
|
73062
73202
|
cwd: session.cwd,
|
|
73063
73203
|
cols: 80,
|
|
73064
73204
|
rows: 24,
|
|
73065
|
-
env: buildPtyEnv(process.env,
|
|
73066
|
-
|
|
73067
|
-
projectId: session.projectId,
|
|
73068
|
-
source: session.source
|
|
73069
|
-
}), session.command)
|
|
73205
|
+
env: buildPtyEnv(process.env, terminalEnv, session.command),
|
|
73206
|
+
...fallback ? { fallback: { ...fallback, env: buildPtyEnv(process.env, terminalEnv, fallback.command) } } : {}
|
|
73070
73207
|
} : void 0
|
|
73071
73208
|
});
|
|
73072
73209
|
runtimeRegistry.createRuntime(session.id, runtime);
|
|
@@ -73099,71 +73236,6 @@ async function reconcileHostedTerminals(manager, registry2) {
|
|
|
73099
73236
|
}
|
|
73100
73237
|
}
|
|
73101
73238
|
|
|
73102
|
-
// backend/src/terminal/runtime/default-shell.ts
|
|
73103
|
-
var import_node_fs15 = require("node:fs");
|
|
73104
|
-
var import_node_path24 = __toESM(require("node:path"), 1);
|
|
73105
|
-
function normalizeCommand(command) {
|
|
73106
|
-
return command.trim();
|
|
73107
|
-
}
|
|
73108
|
-
function resolveDefaultTerminalCommand() {
|
|
73109
|
-
if (process.platform === "win32") {
|
|
73110
|
-
return "powershell.exe";
|
|
73111
|
-
}
|
|
73112
|
-
const configured = process.env.SHELL?.trim();
|
|
73113
|
-
if (configured) {
|
|
73114
|
-
return configured;
|
|
73115
|
-
}
|
|
73116
|
-
return "/bin/bash";
|
|
73117
|
-
}
|
|
73118
|
-
function resolveDefaultTerminalArgs(command) {
|
|
73119
|
-
const shellName = import_node_path24.default.basename(command);
|
|
73120
|
-
if (shellName === "zsh" || shellName === "bash") {
|
|
73121
|
-
return ["-l"];
|
|
73122
|
-
}
|
|
73123
|
-
return [];
|
|
73124
|
-
}
|
|
73125
|
-
function launchConfigsEqual(left, right) {
|
|
73126
|
-
return left.command === right.command && left.args.length === right.args.length && left.args.every((arg, index) => arg === right.args[index]);
|
|
73127
|
-
}
|
|
73128
|
-
function resolveDefaultTerminalLaunchConfig() {
|
|
73129
|
-
const command = resolveDefaultTerminalCommand();
|
|
73130
|
-
return {
|
|
73131
|
-
command,
|
|
73132
|
-
args: resolveDefaultTerminalArgs(command)
|
|
73133
|
-
};
|
|
73134
|
-
}
|
|
73135
|
-
function resolvePlatformFallbackCommands() {
|
|
73136
|
-
if (process.platform === "win32") {
|
|
73137
|
-
return ["powershell.exe", "cmd.exe"];
|
|
73138
|
-
}
|
|
73139
|
-
return ["/bin/zsh", "/bin/bash", "/bin/sh"].filter(
|
|
73140
|
-
(command) => (0, import_node_fs15.existsSync)(command)
|
|
73141
|
-
);
|
|
73142
|
-
}
|
|
73143
|
-
function resolveTerminalFallbackLaunchConfig(current) {
|
|
73144
|
-
const command = normalizeCommand(current.command);
|
|
73145
|
-
const args = current.args ?? [];
|
|
73146
|
-
const currentLaunch = { command, args };
|
|
73147
|
-
const defaultArgs = resolveDefaultTerminalArgs(command);
|
|
73148
|
-
const sameCommandDefaultLaunch = {
|
|
73149
|
-
command,
|
|
73150
|
-
args: defaultArgs
|
|
73151
|
-
};
|
|
73152
|
-
if (!launchConfigsEqual(currentLaunch, sameCommandDefaultLaunch)) {
|
|
73153
|
-
return sameCommandDefaultLaunch;
|
|
73154
|
-
}
|
|
73155
|
-
for (const candidateCommand of resolvePlatformFallbackCommands()) {
|
|
73156
|
-
const candidateLaunch = {
|
|
73157
|
-
command: candidateCommand,
|
|
73158
|
-
args: resolveDefaultTerminalArgs(candidateCommand)
|
|
73159
|
-
};
|
|
73160
|
-
if (!launchConfigsEqual(currentLaunch, candidateLaunch)) {
|
|
73161
|
-
return candidateLaunch;
|
|
73162
|
-
}
|
|
73163
|
-
}
|
|
73164
|
-
return null;
|
|
73165
|
-
}
|
|
73166
|
-
|
|
73167
73239
|
// backend/src/terminal/tmux/pane-service.ts
|
|
73168
73240
|
var import_promises10 = require("node:fs/promises");
|
|
73169
73241
|
|
|
@@ -73182,6 +73254,12 @@ var TmuxRebuildLimitError = class extends Error {
|
|
|
73182
73254
|
this.name = "TmuxRebuildLimitError";
|
|
73183
73255
|
}
|
|
73184
73256
|
};
|
|
73257
|
+
var TmuxShellStartupError = class extends Error {
|
|
73258
|
+
constructor(cause) {
|
|
73259
|
+
super(`Terminal shell startup failed: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
|
|
73260
|
+
this.name = "TmuxShellStartupError";
|
|
73261
|
+
}
|
|
73262
|
+
};
|
|
73185
73263
|
|
|
73186
73264
|
// backend/src/terminal/tmux/session-service.ts
|
|
73187
73265
|
var import_node_fs18 = require("node:fs");
|
|
@@ -73190,9 +73268,9 @@ var import_promises9 = require("node:fs/promises");
|
|
|
73190
73268
|
// backend/src/terminal/tmux/process.ts
|
|
73191
73269
|
var import_node_fs17 = require("node:fs");
|
|
73192
73270
|
var import_promises8 = require("node:fs/promises");
|
|
73193
|
-
var
|
|
73271
|
+
var import_node_child_process5 = require("node:child_process");
|
|
73194
73272
|
var import_node_crypto17 = require("node:crypto");
|
|
73195
|
-
var
|
|
73273
|
+
var import_node_os10 = __toESM(require("node:os"), 1);
|
|
73196
73274
|
var import_node_path26 = __toESM(require("node:path"), 1);
|
|
73197
73275
|
var import_node_util = require("node:util");
|
|
73198
73276
|
|
|
@@ -73433,11 +73511,7 @@ function formatShellCommand(launchCommand) {
|
|
|
73433
73511
|
return commandParts.map((part) => shellQuote2(part)).join(" ");
|
|
73434
73512
|
}
|
|
73435
73513
|
function isInteractiveShellLaunchCommand(launchCommand) {
|
|
73436
|
-
|
|
73437
|
-
if (!["bash", "zsh", "sh", "fish"].includes(commandName)) {
|
|
73438
|
-
return false;
|
|
73439
|
-
}
|
|
73440
|
-
return !launchCommand.args.some((arg) => arg === "-c" || arg === "-lc");
|
|
73514
|
+
return isInteractiveShellLaunch(launchCommand);
|
|
73441
73515
|
}
|
|
73442
73516
|
function normalizePaneCommand(paneCommand, shellCommand) {
|
|
73443
73517
|
const command = paneCommand.trim();
|
|
@@ -73472,7 +73546,7 @@ function shellQuote2(value) {
|
|
|
73472
73546
|
}
|
|
73473
73547
|
|
|
73474
73548
|
// backend/src/terminal/tmux/process.ts
|
|
73475
|
-
var execFileAsync = (0, import_node_util.promisify)(
|
|
73549
|
+
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process5.execFile);
|
|
73476
73550
|
var TmuxProcess = class {
|
|
73477
73551
|
execFileImpl;
|
|
73478
73552
|
env;
|
|
@@ -73534,7 +73608,7 @@ var TmuxProcess = class {
|
|
|
73534
73608
|
};
|
|
73535
73609
|
try {
|
|
73536
73610
|
await this.runTmux(
|
|
73537
|
-
["new-session", "-d", "-s", probeName, "-c",
|
|
73611
|
+
["new-session", "-d", "-s", probeName, "-c", import_node_os10.default.homedir()],
|
|
73538
73612
|
target2
|
|
73539
73613
|
);
|
|
73540
73614
|
await this.runTmux(["has-session", "-t", probeName], target2);
|
|
@@ -73574,7 +73648,7 @@ var TmuxProcess = class {
|
|
|
73574
73648
|
return ["-S", socketPath, "-f", this.configPath];
|
|
73575
73649
|
}
|
|
73576
73650
|
buildShellIntegrationEnvArgs(launchCommand) {
|
|
73577
|
-
if (launchCommand
|
|
73651
|
+
if (!isInteractiveShellLaunchCommand(launchCommand)) {
|
|
73578
73652
|
return [];
|
|
73579
73653
|
}
|
|
73580
73654
|
const integratedEnv = applyShellIntegration(launchCommand.command, {
|
|
@@ -73635,6 +73709,55 @@ var TmuxProcess = class {
|
|
|
73635
73709
|
args.push("-e", `COLORTERM=${this.env.COLORTERM?.trim() || "truecolor"}`);
|
|
73636
73710
|
return args;
|
|
73637
73711
|
}
|
|
73712
|
+
/** Called only for a newly allocated pane, before it is exposed to input. */
|
|
73713
|
+
async startShellInPane(target2, cwd, launch, fallback) {
|
|
73714
|
+
const spawn10 = (next, message2) => this.runTmux([
|
|
73715
|
+
"respawn-pane",
|
|
73716
|
+
"-k",
|
|
73717
|
+
"-t",
|
|
73718
|
+
target2.paneId,
|
|
73719
|
+
"-c",
|
|
73720
|
+
cwd,
|
|
73721
|
+
...this.buildShellIntegrationEnvArgs(next),
|
|
73722
|
+
...this.buildLaunchEnvArgs(next.env),
|
|
73723
|
+
message2 ? `printf '%s\\r\\n' ${shellQuote2(message2)}; exec ${formatShellCommand(next)}` : formatShellCommand(next)
|
|
73724
|
+
], target2);
|
|
73725
|
+
const wait = async () => {
|
|
73726
|
+
const deadline = Date.now() + 1e3;
|
|
73727
|
+
do {
|
|
73728
|
+
const result = await this.runTmux(["display-message", "-p", "-t", target2.paneId, "#{pane_dead}:#{pane_dead_status}"], target2, { sensitiveOutput: true });
|
|
73729
|
+
const [dead, status] = result.stdout.trim().split(":");
|
|
73730
|
+
if (dead === "1") return Number(status);
|
|
73731
|
+
await delay(100);
|
|
73732
|
+
} while (Date.now() < deadline);
|
|
73733
|
+
return null;
|
|
73734
|
+
};
|
|
73735
|
+
try {
|
|
73736
|
+
await this.runTmux(["set-option", "-p", "-t", target2.paneId, "remain-on-exit", "on"], target2);
|
|
73737
|
+
let actual = launch;
|
|
73738
|
+
await spawn10(launch);
|
|
73739
|
+
const exit = await wait();
|
|
73740
|
+
if (exit !== null) {
|
|
73741
|
+
if (exit === 0) throw new Error("Shell exited during startup (code 0)");
|
|
73742
|
+
const message2 = `Runweave: shell exited with code ${exit}; using system default ${fallback.command}`;
|
|
73743
|
+
actual = { ...fallback, env: launch.env, fallbackReason: message2 };
|
|
73744
|
+
tmuxLogger.warn("terminal.tmux.shell-fallback", { message: message2, command: launch.command, fallbackCommand: fallback.command, paneId: target2.paneId });
|
|
73745
|
+
await spawn10(actual, message2);
|
|
73746
|
+
const fallbackExit = await wait();
|
|
73747
|
+
if (fallbackExit !== null) throw new Error(`System shell exited during startup (code ${fallbackExit})`);
|
|
73748
|
+
}
|
|
73749
|
+
await this.runTmux(["set-option", "-p", "-u", "-t", target2.paneId, "remain-on-exit"], target2);
|
|
73750
|
+
return actual;
|
|
73751
|
+
} catch (error2) {
|
|
73752
|
+
await this.runTmux(["kill-pane", "-t", target2.paneId], target2).catch((cleanupError) => {
|
|
73753
|
+
tmuxLogger.warn("terminal.tmux.shell-startup.cleanup-failed", { paneId: target2.paneId, error: cleanupError });
|
|
73754
|
+
});
|
|
73755
|
+
throw new TmuxShellStartupError(error2);
|
|
73756
|
+
}
|
|
73757
|
+
}
|
|
73758
|
+
shellFallback(launch) {
|
|
73759
|
+
return resolveTerminalFallbackLaunchConfig(launch);
|
|
73760
|
+
}
|
|
73638
73761
|
async runTmux(args, target2, options) {
|
|
73639
73762
|
await this.ensureSocketDirectory();
|
|
73640
73763
|
const serverArgs = target2 ? this.buildServerArgs(target2.socketPath) : this.buildServerArgs(this.socketPath);
|
|
@@ -73762,6 +73885,7 @@ var TmuxSessionService = class extends TmuxProcess {
|
|
|
73762
73885
|
};
|
|
73763
73886
|
}
|
|
73764
73887
|
async createDetachedSession(target2, cwd, launchCommand) {
|
|
73888
|
+
const fallback = this.shellFallback(launchCommand);
|
|
73765
73889
|
await this.runTmux(
|
|
73766
73890
|
[
|
|
73767
73891
|
...TMUX_SANITIZE_ENV_ARGS,
|
|
@@ -73776,10 +73900,20 @@ var TmuxSessionService = class extends TmuxProcess {
|
|
|
73776
73900
|
...this.buildExtraEnvArgs(),
|
|
73777
73901
|
"-c",
|
|
73778
73902
|
cwd,
|
|
73779
|
-
|
|
73903
|
+
// A bounded staging process keeps the pane alive while its startup
|
|
73904
|
+
// retention is installed; no user shell or queued input runs here.
|
|
73905
|
+
...fallback ? ["/bin/sleep", "30"] : [formatShellCommand(launchCommand)]
|
|
73780
73906
|
],
|
|
73781
73907
|
target2
|
|
73782
73908
|
);
|
|
73909
|
+
if (!fallback) return launchCommand;
|
|
73910
|
+
try {
|
|
73911
|
+
const pane = await this.runTmux(["display-message", "-p", "-t", target2.sessionName, "#{pane_id}"], target2);
|
|
73912
|
+
return await this.startShellInPane({ ...target2, paneId: pane.stdout.trim() }, cwd, launchCommand, fallback);
|
|
73913
|
+
} catch (error2) {
|
|
73914
|
+
await this.killSession(target2);
|
|
73915
|
+
throw error2;
|
|
73916
|
+
}
|
|
73783
73917
|
}
|
|
73784
73918
|
async syncSessionEnvironment(target2, env) {
|
|
73785
73919
|
const args = Object.entries(env).flatMap(
|
|
@@ -73997,9 +74131,12 @@ var TmuxPaneService = class extends TmuxSessionService {
|
|
|
73997
74131
|
}).filter((pane) => pane.paneId.startsWith("%") && pane.cwd);
|
|
73998
74132
|
}
|
|
73999
74133
|
async splitPane(target2, params) {
|
|
74134
|
+
const launch = params.command ? { command: params.command, args: params.args ?? [], env: params.env } : void 0;
|
|
74135
|
+
const fallback = launch ? this.shellFallback(launch) : null;
|
|
74000
74136
|
const result = await this.runTmux(
|
|
74001
74137
|
[
|
|
74002
74138
|
"split-window",
|
|
74139
|
+
...fallback ? ["-d"] : [],
|
|
74003
74140
|
params.direction === "right" ? "-h" : "-v",
|
|
74004
74141
|
"-P",
|
|
74005
74142
|
"-F",
|
|
@@ -74008,7 +74145,7 @@ var TmuxPaneService = class extends TmuxSessionService {
|
|
|
74008
74145
|
target2.paneId,
|
|
74009
74146
|
"-c",
|
|
74010
74147
|
params.cwd,
|
|
74011
|
-
...params.command ? [
|
|
74148
|
+
...fallback ? [""] : params.command ? [
|
|
74012
74149
|
formatShellCommand({
|
|
74013
74150
|
command: params.command,
|
|
74014
74151
|
args: params.args ?? [],
|
|
@@ -74022,11 +74159,9 @@ var TmuxPaneService = class extends TmuxSessionService {
|
|
|
74022
74159
|
if (!paneId.startsWith("%")) {
|
|
74023
74160
|
throw new Error(`tmux split did not return a pane id: ${paneId}`);
|
|
74024
74161
|
}
|
|
74025
|
-
|
|
74026
|
-
|
|
74027
|
-
|
|
74028
|
-
paneId
|
|
74029
|
-
};
|
|
74162
|
+
const launchTarget = { ...target2, paneId };
|
|
74163
|
+
const actual = fallback && launch ? await this.startShellInPane(launchTarget, params.cwd, launch, fallback) : void 0;
|
|
74164
|
+
return { ...launchTarget, ...actual ? { launch: { command: actual.command, args: actual.args } } : {} };
|
|
74030
74165
|
}
|
|
74031
74166
|
async respawnPane(target2, params) {
|
|
74032
74167
|
await this.runTmux(
|
|
@@ -74458,7 +74593,7 @@ async function ensureTerminalRuntime(options) {
|
|
|
74458
74593
|
sessionAlreadyPresent: hasSession
|
|
74459
74594
|
});
|
|
74460
74595
|
}
|
|
74461
|
-
const wasInteractiveShellLaunch =
|
|
74596
|
+
const wasInteractiveShellLaunch = isInteractiveShellLaunch2(
|
|
74462
74597
|
currentSession.command,
|
|
74463
74598
|
currentSession.args
|
|
74464
74599
|
);
|
|
@@ -74574,7 +74709,7 @@ async function ensureTerminalRuntime(options) {
|
|
|
74574
74709
|
source: currentSession.source,
|
|
74575
74710
|
tmuxSessionName: target2.sessionName
|
|
74576
74711
|
});
|
|
74577
|
-
await options.tmuxService.createDetachedSession(
|
|
74712
|
+
const actualLaunch = await options.tmuxService.createDetachedSession(
|
|
74578
74713
|
target2,
|
|
74579
74714
|
currentSession.cwd,
|
|
74580
74715
|
{
|
|
@@ -74583,7 +74718,11 @@ async function ensureTerminalRuntime(options) {
|
|
|
74583
74718
|
env: terminalEnvironment
|
|
74584
74719
|
}
|
|
74585
74720
|
);
|
|
74586
|
-
if (
|
|
74721
|
+
if (actualLaunch.fallbackReason) {
|
|
74722
|
+
currentSession = await options.terminalSessionManager.updateSessionLaunch(currentSession.id, actualLaunch) ?? currentSession;
|
|
74723
|
+
warning = actualLaunch.fallbackReason;
|
|
74724
|
+
}
|
|
74725
|
+
if (isInteractiveShellLaunch2(currentSession.command, currentSession.args)) {
|
|
74587
74726
|
await options.tmuxService.waitForPaneReady(target2);
|
|
74588
74727
|
}
|
|
74589
74728
|
if (agentThreadToResume) {
|
|
@@ -74693,12 +74832,8 @@ async function ensureTerminalRuntime(options) {
|
|
|
74693
74832
|
);
|
|
74694
74833
|
return { runtime };
|
|
74695
74834
|
}
|
|
74696
|
-
function
|
|
74697
|
-
|
|
74698
|
-
if (!["bash", "zsh", "sh", "fish"].includes(commandName)) {
|
|
74699
|
-
return false;
|
|
74700
|
-
}
|
|
74701
|
-
return !args.some((arg) => arg === "-c" || arg === "-lc");
|
|
74835
|
+
function isInteractiveShellLaunch2(command, args) {
|
|
74836
|
+
return isInteractiveShellLaunch({ command, args });
|
|
74702
74837
|
}
|
|
74703
74838
|
function resolveAgentThreadToResume(session) {
|
|
74704
74839
|
const activeProvider = getAgentForCommand(session.activeCommand);
|
|
@@ -76186,7 +76321,7 @@ var import_express8 = __toESM(require_express2(), 1);
|
|
|
76186
76321
|
var import_node_url = require("node:url");
|
|
76187
76322
|
|
|
76188
76323
|
// backend/src/resource-monitor/counters.ts
|
|
76189
|
-
var
|
|
76324
|
+
var import_node_os11 = __toESM(require("node:os"), 1);
|
|
76190
76325
|
function parse2(output) {
|
|
76191
76326
|
const lines = output.trim().split("\n");
|
|
76192
76327
|
const clock = lines[0]?.split(" ");
|
|
@@ -76236,7 +76371,7 @@ var ResourceCounters = class {
|
|
|
76236
76371
|
}
|
|
76237
76372
|
}
|
|
76238
76373
|
this.previous = frame;
|
|
76239
|
-
const cpus =
|
|
76374
|
+
const cpus = import_node_os11.default.cpus();
|
|
76240
76375
|
const times = cpus.reduce(
|
|
76241
76376
|
(sum, cpu) => {
|
|
76242
76377
|
const busy = cpu.times.user + cpu.times.nice + cpu.times.sys + cpu.times.irq;
|
|
@@ -76263,9 +76398,9 @@ var ResourceCounters = class {
|
|
|
76263
76398
|
};
|
|
76264
76399
|
|
|
76265
76400
|
// backend/src/resource-monitor/sampler.ts
|
|
76266
|
-
var
|
|
76401
|
+
var import_node_child_process6 = require("node:child_process");
|
|
76267
76402
|
var import_node_crypto21 = require("node:crypto");
|
|
76268
|
-
var
|
|
76403
|
+
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
76269
76404
|
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
76270
76405
|
|
|
76271
76406
|
// packages/shared/src/monitoring/device-status.ts
|
|
@@ -76324,7 +76459,7 @@ function signedBatteryCurrent(value) {
|
|
|
76324
76459
|
// backend/src/resource-monitor/sampler.ts
|
|
76325
76460
|
function runCommand(command, args, signal) {
|
|
76326
76461
|
return new Promise((resolve, reject) => {
|
|
76327
|
-
(0,
|
|
76462
|
+
(0, import_node_child_process6.execFile)(
|
|
76328
76463
|
command,
|
|
76329
76464
|
args,
|
|
76330
76465
|
{
|
|
@@ -76545,9 +76680,9 @@ function createResourceSampler(helperPath) {
|
|
|
76545
76680
|
platform: "darwin",
|
|
76546
76681
|
cpu,
|
|
76547
76682
|
memory: {
|
|
76548
|
-
totalMb: Math.round(
|
|
76683
|
+
totalMb: Math.round(import_node_os12.default.totalmem() / 1048576),
|
|
76549
76684
|
usedMb: Math.round(
|
|
76550
|
-
pageSize && pages ? pageSize * pages / 1048576 : (
|
|
76685
|
+
pageSize && pages ? pageSize * pages / 1048576 : (import_node_os12.default.totalmem() - import_node_os12.default.freemem()) / 1048576
|
|
76551
76686
|
),
|
|
76552
76687
|
pressure: { "1": "normal", "2": "warn", "4": "critical" }[pressure.trim()] ?? "unknown",
|
|
76553
76688
|
swapUsedMb: swapMatch ? round(
|
|
@@ -79374,12 +79509,12 @@ async function readFinalReply(read, event, signal) {
|
|
|
79374
79509
|
}
|
|
79375
79510
|
|
|
79376
79511
|
// backend/src/task-supervision/deliverables.ts
|
|
79377
|
-
var
|
|
79512
|
+
var import_node_child_process7 = require("node:child_process");
|
|
79378
79513
|
var import_node_fs19 = require("node:fs");
|
|
79379
79514
|
var import_promises13 = require("node:fs/promises");
|
|
79380
79515
|
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
79381
79516
|
var import_node_util2 = require("node:util");
|
|
79382
|
-
var run = (0, import_node_util2.promisify)(
|
|
79517
|
+
var run = (0, import_node_util2.promisify)(import_node_child_process7.execFile);
|
|
79383
79518
|
var MAX_ITEMS = 5;
|
|
79384
79519
|
var MAX_DOCUMENT_BYTES = 24e3;
|
|
79385
79520
|
var MAX_TOTAL_BYTES = 48e3;
|
|
@@ -80548,7 +80683,7 @@ var import_promises16 = require("node:fs/promises");
|
|
|
80548
80683
|
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
80549
80684
|
|
|
80550
80685
|
// backend/src/evolution/providers/process-runner.ts
|
|
80551
|
-
var
|
|
80686
|
+
var import_node_child_process8 = require("node:child_process");
|
|
80552
80687
|
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
80553
80688
|
|
|
80554
80689
|
// backend/src/evolution/providers/output.ts
|
|
@@ -80634,7 +80769,7 @@ async function runProviderProcess(params) {
|
|
|
80634
80769
|
params.request.workingDirectory,
|
|
80635
80770
|
"last-message.json"
|
|
80636
80771
|
);
|
|
80637
|
-
const child = (0,
|
|
80772
|
+
const child = (0, import_node_child_process8.spawn)(
|
|
80638
80773
|
params.binary,
|
|
80639
80774
|
[...params.args, "--output-last-message", outputFile, "-"],
|
|
80640
80775
|
{
|
|
@@ -82287,6 +82422,8 @@ function initializeBackendConfiguration(resources) {
|
|
|
82287
82422
|
logDir: loggerState.logDir,
|
|
82288
82423
|
logToFile: loggerState.logToFile
|
|
82289
82424
|
});
|
|
82425
|
+
resources.defer("terminal-shell-configuration", config3.register("terminal.defaultShell", () => {
|
|
82426
|
+
}));
|
|
82290
82427
|
return config3;
|
|
82291
82428
|
}
|
|
82292
82429
|
|
|
@@ -82648,12 +82785,12 @@ var feedbackSchema = external_exports.object({
|
|
|
82648
82785
|
var cwdSchema = external_exports.string().trim().min(1).max(4e3);
|
|
82649
82786
|
|
|
82650
82787
|
// backend/src/repository/identity.ts
|
|
82651
|
-
var
|
|
82788
|
+
var import_node_child_process9 = require("node:child_process");
|
|
82652
82789
|
var import_node_crypto32 = require("node:crypto");
|
|
82653
82790
|
var import_promises20 = require("node:fs/promises");
|
|
82654
82791
|
var import_node_path38 = __toESM(require("node:path"), 1);
|
|
82655
82792
|
var import_node_util3 = require("node:util");
|
|
82656
|
-
var exec = (0, import_node_util3.promisify)(
|
|
82793
|
+
var exec = (0, import_node_util3.promisify)(import_node_child_process9.execFile);
|
|
82657
82794
|
async function resolveRepositoryIdentity(cwd) {
|
|
82658
82795
|
if (!import_node_path38.default.isAbsolute(cwd)) throw new Error("repository_cwd_must_be_absolute");
|
|
82659
82796
|
const env = { ...process.env };
|
|
@@ -86297,7 +86434,7 @@ function createAuthRouter(authService, options) {
|
|
|
86297
86434
|
var import_express21 = __toESM(require_express2(), 1);
|
|
86298
86435
|
|
|
86299
86436
|
// backend/src/terminal/git/home-branch-status.ts
|
|
86300
|
-
var
|
|
86437
|
+
var import_node_child_process10 = require("node:child_process");
|
|
86301
86438
|
var import_promises23 = require("node:fs/promises");
|
|
86302
86439
|
var import_node_util5 = require("node:util");
|
|
86303
86440
|
|
|
@@ -86310,7 +86447,7 @@ var BranchUpdatesTargetChangedError = class extends Error {
|
|
|
86310
86447
|
super("Branch updates target changed");
|
|
86311
86448
|
}
|
|
86312
86449
|
};
|
|
86313
|
-
var exec2 = (0, import_node_util5.promisify)(
|
|
86450
|
+
var exec2 = (0, import_node_util5.promisify)(import_node_child_process10.execFile);
|
|
86314
86451
|
var TTL = 10 * 6e4;
|
|
86315
86452
|
var RECHECK_TTL = 2e3;
|
|
86316
86453
|
async function git(cwd, args) {
|
|
@@ -87169,7 +87306,7 @@ function createAgentModelCatalogRouter(service) {
|
|
|
87169
87306
|
var import_express25 = __toESM(require_express2(), 1);
|
|
87170
87307
|
|
|
87171
87308
|
// backend/src/race/race-service.ts
|
|
87172
|
-
var
|
|
87309
|
+
var import_node_child_process12 = require("node:child_process");
|
|
87173
87310
|
var import_node_crypto39 = require("node:crypto");
|
|
87174
87311
|
|
|
87175
87312
|
// packages/shared/src/terminal/project-context.ts
|
|
@@ -87305,8 +87442,7 @@ async function createTerminalPanelSplit(terminalSessionManager, session, options
|
|
|
87305
87442
|
sourcePanel
|
|
87306
87443
|
);
|
|
87307
87444
|
const panelId = (0, import_node_crypto37.randomUUID)();
|
|
87308
|
-
const command
|
|
87309
|
-
const args = params.args ?? resolveDefaultTerminalArgs(command);
|
|
87445
|
+
const { command, args } = resolveTerminalLaunchConfig(params);
|
|
87310
87446
|
const cwd = params.cwd?.trim() || sourcePanel.cwd || session.cwd;
|
|
87311
87447
|
const previousWorkspace = terminalSessionManager.getPanelWorkspace(
|
|
87312
87448
|
session.id
|
|
@@ -87355,7 +87491,7 @@ async function createTerminalPanelSplit(terminalSessionManager, session, options
|
|
|
87355
87491
|
});
|
|
87356
87492
|
if (!params.skipPaneReadyWait) {
|
|
87357
87493
|
await tmuxService.waitForPaneReady(splitTarget);
|
|
87358
|
-
const metadata = await tmuxService.readPaneMetadata(splitTarget, command);
|
|
87494
|
+
const metadata = await tmuxService.readPaneMetadata(splitTarget, splitTarget.launch?.command ?? command);
|
|
87359
87495
|
provisionalPanel.cwd = metadata?.cwd || cwd;
|
|
87360
87496
|
const nextActiveCommand = metadata?.activeCommand ?? null;
|
|
87361
87497
|
await terminalSessionManager.observePanelActiveCommand(
|
|
@@ -87436,7 +87572,7 @@ var PANE_OUTPUT_BOUNDARY_POLL_INTERVAL_MS = 10;
|
|
|
87436
87572
|
function shouldWatchSession(session) {
|
|
87437
87573
|
return session.runtimeKind === "tmux" && session.status === "running";
|
|
87438
87574
|
}
|
|
87439
|
-
function
|
|
87575
|
+
function isInteractiveShellLaunch3(command, args) {
|
|
87440
87576
|
const commandName = command.split(/[\\/]/).at(-1) ?? command;
|
|
87441
87577
|
if (!["bash", "zsh", "sh", "fish"].includes(commandName)) {
|
|
87442
87578
|
return false;
|
|
@@ -87507,10 +87643,10 @@ function waitForPaneOutputBoundary() {
|
|
|
87507
87643
|
|
|
87508
87644
|
// backend/src/terminal/application/staged-agent-launch.ts
|
|
87509
87645
|
var import_promises25 = require("node:fs/promises");
|
|
87510
|
-
var
|
|
87646
|
+
var import_node_os13 = require("node:os");
|
|
87511
87647
|
var import_node_path45 = __toESM(require("node:path"), 1);
|
|
87512
87648
|
async function withStagedAgentLaunch(command, submit) {
|
|
87513
|
-
const directory3 = await (0, import_promises25.mkdtemp)(import_node_path45.default.join((0,
|
|
87649
|
+
const directory3 = await (0, import_promises25.mkdtemp)(import_node_path45.default.join((0, import_node_os13.tmpdir)(), "rw-agent-"));
|
|
87514
87650
|
const file = import_node_path45.default.join(directory3, "launch.sh");
|
|
87515
87651
|
const quoted = `'${file.replace(/'/g, "'\\''")}'`;
|
|
87516
87652
|
try {
|
|
@@ -87709,7 +87845,7 @@ async function prepareTerminalAgent(terminalSessionManager, session, options, re
|
|
|
87709
87845
|
}
|
|
87710
87846
|
try {
|
|
87711
87847
|
if (reusingPanel && (!resumingThread || resetPanelBeforeResume)) {
|
|
87712
|
-
if (!
|
|
87848
|
+
if (!isInteractiveShellLaunch3(session.command, session.args)) {
|
|
87713
87849
|
throw new Error(
|
|
87714
87850
|
"Terminal session command is not a persistent interactive shell"
|
|
87715
87851
|
);
|
|
@@ -87949,7 +88085,7 @@ function delay5(ms) {
|
|
|
87949
88085
|
}
|
|
87950
88086
|
|
|
87951
88087
|
// backend/src/race/race-worktree-supply.ts
|
|
87952
|
-
var
|
|
88088
|
+
var import_node_child_process11 = require("node:child_process");
|
|
87953
88089
|
var import_promises26 = require("node:fs/promises");
|
|
87954
88090
|
var import_node_path46 = __toESM(require("node:path"), 1);
|
|
87955
88091
|
var MAX_GIT_OUTPUT_BYTES = 4 * 1024 * 1024;
|
|
@@ -87962,7 +88098,7 @@ var RaceWorktreeSupplyError = class extends Error {
|
|
|
87962
88098
|
};
|
|
87963
88099
|
function runGit(cwd, args, timeout = 3e4) {
|
|
87964
88100
|
return new Promise((resolve, reject) => {
|
|
87965
|
-
(0,
|
|
88101
|
+
(0, import_node_child_process11.execFile)(
|
|
87966
88102
|
"git",
|
|
87967
88103
|
["-C", cwd, ...args],
|
|
87968
88104
|
{
|
|
@@ -88239,7 +88375,7 @@ function parseTraexModels(output) {
|
|
|
88239
88375
|
}
|
|
88240
88376
|
function listTraexModels() {
|
|
88241
88377
|
return new Promise((resolve) => {
|
|
88242
|
-
(0,
|
|
88378
|
+
(0, import_node_child_process12.execFile)(
|
|
88243
88379
|
"traex",
|
|
88244
88380
|
["models"],
|
|
88245
88381
|
{
|
|
@@ -88362,11 +88498,10 @@ var RaceService = class {
|
|
|
88362
88498
|
return;
|
|
88363
88499
|
}
|
|
88364
88500
|
try {
|
|
88365
|
-
const
|
|
88501
|
+
const launch = resolveDefaultTerminalLaunchConfig();
|
|
88366
88502
|
const session = await this.options.terminalSessionManager.createSession({
|
|
88367
88503
|
projectId: worker.worktreeId,
|
|
88368
|
-
|
|
88369
|
-
args: resolveDefaultTerminalArgs(command),
|
|
88504
|
+
...launch,
|
|
88370
88505
|
cwd: worker.worktreePath
|
|
88371
88506
|
});
|
|
88372
88507
|
worker.terminalSessionId = session.id;
|
|
@@ -90329,7 +90464,7 @@ function recordTerminalSessionDeleted(activity, session) {
|
|
|
90329
90464
|
|
|
90330
90465
|
// backend/src/terminal/application/create-defaults.ts
|
|
90331
90466
|
var import_node_fs25 = require("node:fs");
|
|
90332
|
-
var
|
|
90467
|
+
var import_node_os14 = __toESM(require("node:os"), 1);
|
|
90333
90468
|
var TerminalCreateDefaultsError = class extends Error {
|
|
90334
90469
|
constructor(message2, statusCode) {
|
|
90335
90470
|
super(message2);
|
|
@@ -90338,7 +90473,7 @@ var TerminalCreateDefaultsError = class extends Error {
|
|
|
90338
90473
|
}
|
|
90339
90474
|
};
|
|
90340
90475
|
function resolveTerminalCreateDefaults(payload, terminalSessionManager) {
|
|
90341
|
-
const command
|
|
90476
|
+
const { command, args } = resolveTerminalLaunchConfig(payload);
|
|
90342
90477
|
const inheritedSession = payload.inheritFromTerminalSessionId ? terminalSessionManager.getSession(payload.inheritFromTerminalSessionId) : void 0;
|
|
90343
90478
|
if (payload.inheritFromTerminalSessionId && !inheritedSession) throw new TerminalCreateDefaultsError("Inherited terminal session not found", 404);
|
|
90344
90479
|
const projectId = payload.projectId ?? inheritedSession?.projectId ?? terminalSessionManager.listProjects().find((project) => project.isDefault)?.id;
|
|
@@ -90347,8 +90482,8 @@ function resolveTerminalCreateDefaults(payload, terminalSessionManager) {
|
|
|
90347
90482
|
const context = terminalSessionManager.getProjectContext(projectId);
|
|
90348
90483
|
throw new TerminalCreateDefaultsError(context ? "Terminal project context is unavailable" : "Terminal project not found", context ? 409 : 404);
|
|
90349
90484
|
}
|
|
90350
|
-
const cwd = payload.cwd?.trim() || (isExistingDirectory(inheritedSession?.cwd) ? inheritedSession?.cwd : void 0) || projectPath ||
|
|
90351
|
-
return { projectId, command, args
|
|
90485
|
+
const cwd = payload.cwd?.trim() || (isExistingDirectory(inheritedSession?.cwd) ? inheritedSession?.cwd : void 0) || projectPath || import_node_os14.default.homedir();
|
|
90486
|
+
return { projectId, command, args, cwd };
|
|
90352
90487
|
}
|
|
90353
90488
|
function isExistingDirectory(value) {
|
|
90354
90489
|
if (!value) return false;
|
|
@@ -90382,7 +90517,7 @@ async function createTerminalSession(manager, request2, options, source2) {
|
|
|
90382
90517
|
try {
|
|
90383
90518
|
await ensureTerminalRuntime({ session: launchSession, terminalSessionManager: manager, runtimeRegistry: options.runtimeRegistry, ptyService: options.ptyService, tmuxService: options.tmuxService, tmuxOutputWatcher: options.tmuxOutputWatcher, allowMissingTmuxSession: true });
|
|
90384
90519
|
} catch (error2) {
|
|
90385
|
-
if (preference !== "auto" || !options.tmuxService || !isTmuxBackedSession(launchSession)) throw error2;
|
|
90520
|
+
if (error2 instanceof TmuxShellStartupError || preference !== "auto" || !options.tmuxService || !isTmuxBackedSession(launchSession)) throw error2;
|
|
90386
90521
|
terminalLogger3.warn("terminal.session.runtime.tmux-launch-fallback", { terminalSessionId: session.id, error: String(error2) });
|
|
90387
90522
|
if (attemptedTarget) await options.tmuxService.killSession(attemptedTarget);
|
|
90388
90523
|
launchSession = await manager.updateRuntimeMetadata(session.id, { runtimeKind: "pty", tmuxUnavailableReason: "tmux launch failed; fell back to pty", recoverable: false }) ?? session;
|
|
@@ -91590,7 +91725,7 @@ function registerBrowserAssistanceRoutes(router, manager, options) {
|
|
|
91590
91725
|
}
|
|
91591
91726
|
|
|
91592
91727
|
// backend/src/terminal/preview/change-content.ts
|
|
91593
|
-
var
|
|
91728
|
+
var import_node_child_process13 = require("node:child_process");
|
|
91594
91729
|
var import_node_crypto47 = require("node:crypto");
|
|
91595
91730
|
var import_node_fs26 = require("node:fs");
|
|
91596
91731
|
var import_promises28 = require("node:fs/promises");
|
|
@@ -91630,7 +91765,7 @@ function detectImageMimeType(buffer, filePath) {
|
|
|
91630
91765
|
}
|
|
91631
91766
|
|
|
91632
91767
|
// backend/src/terminal/preview/change-content.ts
|
|
91633
|
-
var exec3 = (0, import_node_util6.promisify)(
|
|
91768
|
+
var exec3 = (0, import_node_util6.promisify)(import_node_child_process13.execFile);
|
|
91634
91769
|
var TEXT_LIMIT = 1024 * 1024;
|
|
91635
91770
|
async function git2(root, args, maxBuffer = 1024 * 1024) {
|
|
91636
91771
|
return (await exec3("git", args, {
|
|
@@ -91769,11 +91904,11 @@ async function readChangeContent(options) {
|
|
|
91769
91904
|
}
|
|
91770
91905
|
|
|
91771
91906
|
// backend/src/terminal/preview/git.ts
|
|
91772
|
-
var
|
|
91907
|
+
var import_node_child_process14 = require("node:child_process");
|
|
91773
91908
|
var import_promises29 = require("node:fs/promises");
|
|
91774
91909
|
var import_node_path50 = __toESM(require("node:path"), 1);
|
|
91775
91910
|
var import_node_util7 = require("node:util");
|
|
91776
|
-
var execFileAsync2 = (0, import_node_util7.promisify)(
|
|
91911
|
+
var execFileAsync2 = (0, import_node_util7.promisify)(import_node_child_process14.execFile);
|
|
91777
91912
|
var GitRepositoryMissingError = class extends TerminalPreviewError {
|
|
91778
91913
|
constructor() {
|
|
91779
91914
|
super("This project is not a Git repository.", 400);
|
|
@@ -92066,11 +92201,11 @@ var import_promises31 = require("node:fs/promises");
|
|
|
92066
92201
|
var import_node_path52 = __toESM(require("node:path"), 1);
|
|
92067
92202
|
|
|
92068
92203
|
// backend/src/terminal/preview/search-candidates.ts
|
|
92069
|
-
var
|
|
92204
|
+
var import_node_child_process15 = require("node:child_process");
|
|
92070
92205
|
var import_promises30 = require("node:fs/promises");
|
|
92071
92206
|
var import_node_path51 = __toESM(require("node:path"), 1);
|
|
92072
92207
|
var import_node_util8 = require("node:util");
|
|
92073
|
-
var execFileAsync3 = (0, import_node_util8.promisify)(
|
|
92208
|
+
var execFileAsync3 = (0, import_node_util8.promisify)(import_node_child_process15.execFile);
|
|
92074
92209
|
var terminalPreviewLogger = logger.child({ component: "terminal-preview" });
|
|
92075
92210
|
var RG_SEARCH_TIMEOUT_MS = 15e3;
|
|
92076
92211
|
var RG_SEARCH_MAX_BUFFER_BYTES = 32 * 1024 * 1024;
|
|
@@ -92856,7 +92991,7 @@ async function searchPreviewFolders(params) {
|
|
|
92856
92991
|
}
|
|
92857
92992
|
|
|
92858
92993
|
// backend/src/terminal/preview/content-search.ts
|
|
92859
|
-
var
|
|
92994
|
+
var import_node_child_process16 = require("node:child_process");
|
|
92860
92995
|
var import_promises32 = require("node:fs/promises");
|
|
92861
92996
|
var import_node_path54 = __toESM(require("node:path"), 1);
|
|
92862
92997
|
var DEFAULT_CONTENT_SEARCH_LIMIT = 50;
|
|
@@ -93012,7 +93147,7 @@ function findLiteralRanges(params) {
|
|
|
93012
93147
|
function searchContentWithRipgrep(params) {
|
|
93013
93148
|
throwIfSearchStopped(params.signal);
|
|
93014
93149
|
return new Promise((resolve, reject) => {
|
|
93015
|
-
const child = (0,
|
|
93150
|
+
const child = (0, import_node_child_process16.spawn)("rg", buildRgContentArgs(params.query), {
|
|
93016
93151
|
cwd: params.projectPath,
|
|
93017
93152
|
stdio: ["ignore", "pipe", "pipe"]
|
|
93018
93153
|
});
|
|
@@ -94090,7 +94225,7 @@ function registerTerminalPreviewRoutes(router, terminalSessionManager) {
|
|
|
94090
94225
|
}
|
|
94091
94226
|
|
|
94092
94227
|
// backend/src/routes/terminal/projects/index.ts
|
|
94093
|
-
var
|
|
94228
|
+
var import_node_child_process17 = require("node:child_process");
|
|
94094
94229
|
var import_node_util9 = require("node:util");
|
|
94095
94230
|
|
|
94096
94231
|
// backend/src/terminal/workspace-service/errors.ts
|
|
@@ -94243,7 +94378,7 @@ async function resolveMainBranchInput(raw) {
|
|
|
94243
94378
|
const branch = raw?.trim() || null;
|
|
94244
94379
|
if (branch === null) return null;
|
|
94245
94380
|
try {
|
|
94246
|
-
const { stdout } = await (0, import_node_util9.promisify)(
|
|
94381
|
+
const { stdout } = await (0, import_node_util9.promisify)(import_node_child_process17.execFile)("git", ["check-ref-format", "--branch", branch], { timeout: 5e3 });
|
|
94247
94382
|
if (stdout.trim() === branch) return branch;
|
|
94248
94383
|
} catch {
|
|
94249
94384
|
}
|
|
@@ -94421,17 +94556,17 @@ function registerTerminalProjectRoutes(router, terminalSessionManager, options)
|
|
|
94421
94556
|
}
|
|
94422
94557
|
|
|
94423
94558
|
// backend/src/terminal/workspace-service/worktree-deletion.ts
|
|
94424
|
-
var
|
|
94559
|
+
var import_node_child_process19 = require("node:child_process");
|
|
94425
94560
|
var import_promises36 = require("node:fs/promises");
|
|
94426
94561
|
var import_node_path59 = __toESM(require("node:path"), 1);
|
|
94427
94562
|
|
|
94428
94563
|
// backend/src/terminal/workspace-service/dev-session-cleanup.ts
|
|
94429
|
-
var
|
|
94564
|
+
var import_node_child_process18 = require("node:child_process");
|
|
94430
94565
|
var import_promises35 = require("node:fs/promises");
|
|
94431
|
-
var
|
|
94566
|
+
var import_node_os15 = __toESM(require("node:os"), 1);
|
|
94432
94567
|
var import_node_path58 = __toESM(require("node:path"), 1);
|
|
94433
94568
|
var import_node_util10 = require("node:util");
|
|
94434
|
-
var execFileAsync4 = (0, import_node_util10.promisify)(
|
|
94569
|
+
var execFileAsync4 = (0, import_node_util10.promisify)(import_node_child_process18.execFile);
|
|
94435
94570
|
var CLEANUP_TIMEOUT_MS = 3e4;
|
|
94436
94571
|
function isReleased(manifest) {
|
|
94437
94572
|
return manifest.state === "stopped" || manifest.state === "failed" && manifest.failure?.leaseRetained === false;
|
|
@@ -94451,7 +94586,7 @@ function cleanupFailureMessage(error2) {
|
|
|
94451
94586
|
}
|
|
94452
94587
|
async function cleanupWorktreeDevSessions(sourceRoot, env) {
|
|
94453
94588
|
const registryRoot = import_node_path58.default.resolve(
|
|
94454
|
-
env.RUNWEAVE_DEV_SESSION_HOME?.trim() || import_node_path58.default.join(
|
|
94589
|
+
env.RUNWEAVE_DEV_SESSION_HOME?.trim() || import_node_path58.default.join(import_node_os15.default.homedir(), ".runweave", "dev-sessions")
|
|
94455
94590
|
);
|
|
94456
94591
|
let entries;
|
|
94457
94592
|
try {
|
|
@@ -94555,7 +94690,7 @@ var TerminalWorktreeDeletionError = class extends Error {
|
|
|
94555
94690
|
};
|
|
94556
94691
|
function runGit3(cwd, args) {
|
|
94557
94692
|
return new Promise((resolve, reject) => {
|
|
94558
|
-
(0,
|
|
94693
|
+
(0, import_node_child_process19.execFile)(
|
|
94559
94694
|
"git",
|
|
94560
94695
|
["-C", cwd, ...args],
|
|
94561
94696
|
{
|
|
@@ -96888,7 +97023,7 @@ async function recoverTerminalAgent(terminalSessionManager, session, options, re
|
|
|
96888
97023
|
"Only an idle Codex or Pi panel can be recovered"
|
|
96889
97024
|
);
|
|
96890
97025
|
}
|
|
96891
|
-
if (!
|
|
97026
|
+
if (!isInteractiveShellLaunch3(session.command, session.args)) {
|
|
96892
97027
|
throw new TerminalPanelError(
|
|
96893
97028
|
409,
|
|
96894
97029
|
"Terminal session command is not a persistent interactive shell"
|
|
@@ -97371,7 +97506,7 @@ function registerTerminalPanelRoutes(router, terminalSessionManager, options) {
|
|
|
97371
97506
|
// backend/src/routes/terminal/input/clipboard-image.ts
|
|
97372
97507
|
var import_node_crypto50 = require("node:crypto");
|
|
97373
97508
|
var import_promises40 = require("node:fs/promises");
|
|
97374
|
-
var
|
|
97509
|
+
var import_node_os16 = __toESM(require("node:os"), 1);
|
|
97375
97510
|
var import_node_path63 = __toESM(require("node:path"), 1);
|
|
97376
97511
|
|
|
97377
97512
|
// backend/src/terminal/preview/clipboard-image.ts
|
|
@@ -97427,7 +97562,7 @@ function registerTerminalClipboardImageRoutes(router, terminalSessionManager) {
|
|
|
97427
97562
|
const extension = resolveClipboardImageExtension(parsed.data.mimeType);
|
|
97428
97563
|
const fileName = buildClipboardImageFileName(/* @__PURE__ */ new Date(), extension);
|
|
97429
97564
|
const terminalTempDir = import_node_path63.default.join(
|
|
97430
|
-
|
|
97565
|
+
import_node_os16.default.tmpdir(),
|
|
97431
97566
|
"runweave-terminal-images"
|
|
97432
97567
|
);
|
|
97433
97568
|
const filePath = import_node_path63.default.join(terminalTempDir, fileName);
|
|
@@ -97471,10 +97606,10 @@ var TERMINAL_CLIPBOARD_FILE_MAX_BYTES = 100 * 1024 * 1024;
|
|
|
97471
97606
|
// backend/src/terminal/attachments/clipboard-file.ts
|
|
97472
97607
|
var import_node_crypto51 = require("node:crypto");
|
|
97473
97608
|
var import_promises41 = require("node:fs/promises");
|
|
97474
|
-
var
|
|
97609
|
+
var import_node_os17 = __toESM(require("node:os"), 1);
|
|
97475
97610
|
var import_node_path64 = __toESM(require("node:path"), 1);
|
|
97476
97611
|
async function saveTerminalClipboardFile(terminalSessionId, fileName, data) {
|
|
97477
|
-
const directory3 = import_node_path64.default.join(
|
|
97612
|
+
const directory3 = import_node_path64.default.join(import_node_os17.default.tmpdir(), "runweave-terminal-files", terminalSessionId, (0, import_node_crypto51.randomUUID)());
|
|
97478
97613
|
const filePath = import_node_path64.default.join(directory3, fileName);
|
|
97479
97614
|
await (0, import_promises41.mkdir)(directory3, { recursive: true, mode: 448 });
|
|
97480
97615
|
try {
|
|
@@ -97813,12 +97948,12 @@ function registerTerminalInputRoutes(router, terminalSessionManager, options) {
|
|
|
97813
97948
|
var import_node_crypto52 = require("node:crypto");
|
|
97814
97949
|
|
|
97815
97950
|
// backend/src/agent-model-catalog/types.ts
|
|
97816
|
-
var
|
|
97951
|
+
var import_node_child_process20 = require("node:child_process");
|
|
97817
97952
|
var CATALOG_COMMAND_TIMEOUT_MS = 15e3;
|
|
97818
97953
|
var CATALOG_COMMAND_MAX_BUFFER = 8 * 1024 * 1024;
|
|
97819
97954
|
function runCatalogCommand(command, args, env) {
|
|
97820
97955
|
return new Promise((resolve, reject) => {
|
|
97821
|
-
(0,
|
|
97956
|
+
(0, import_node_child_process20.execFile)(
|
|
97822
97957
|
command,
|
|
97823
97958
|
args,
|
|
97824
97959
|
{
|
|
@@ -99514,7 +99649,7 @@ function registerRuntimeStatusRoutes(app, requireAuth, status) {
|
|
|
99514
99649
|
var import_express38 = __toESM(require_express2(), 1);
|
|
99515
99650
|
|
|
99516
99651
|
// backend/src/dev-resources/control.ts
|
|
99517
|
-
var
|
|
99652
|
+
var import_node_child_process21 = require("node:child_process");
|
|
99518
99653
|
var import_node_fs30 = require("node:fs");
|
|
99519
99654
|
var import_node_path67 = __toESM(require("node:path"), 1);
|
|
99520
99655
|
var import_node_url2 = require("node:url");
|
|
@@ -99542,7 +99677,7 @@ async function runDevResourceControl(payload, onSpawn) {
|
|
|
99542
99677
|
ELECTRON_RUN_AS_NODE: "1"
|
|
99543
99678
|
};
|
|
99544
99679
|
delete environment2.RUNWEAVE_DEV_SESSION_ID;
|
|
99545
|
-
const child = (0,
|
|
99680
|
+
const child = (0, import_node_child_process21.spawn)(process.execPath, [entry], {
|
|
99546
99681
|
stdio: ["pipe", "pipe", "ignore"],
|
|
99547
99682
|
env: environment2
|
|
99548
99683
|
});
|
|
@@ -111369,7 +111504,7 @@ function requireIdempotencyKey(value) {
|
|
|
111369
111504
|
|
|
111370
111505
|
// backend/src/server/cors.ts
|
|
111371
111506
|
var import_node_net3 = __toESM(require("node:net"), 1);
|
|
111372
|
-
var
|
|
111507
|
+
var import_node_os18 = __toESM(require("node:os"), 1);
|
|
111373
111508
|
var ALWAYS_ALLOWED_APP_ORIGINS = /* @__PURE__ */ new Set([
|
|
111374
111509
|
"runweave://app",
|
|
111375
111510
|
"browser-viewer://app",
|
|
@@ -111379,7 +111514,7 @@ var ALWAYS_ALLOWED_APP_ORIGINS = /* @__PURE__ */ new Set([
|
|
|
111379
111514
|
var LOCAL_DEV_SERVER_PORTS = /* @__PURE__ */ new Set(["5173", "5174"]);
|
|
111380
111515
|
function getLocalInterfaceHosts() {
|
|
111381
111516
|
const hosts = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1"]);
|
|
111382
|
-
for (const addresses of Object.values(
|
|
111517
|
+
for (const addresses of Object.values(import_node_os18.default.networkInterfaces())) {
|
|
111383
111518
|
for (const address of addresses ?? []) {
|
|
111384
111519
|
if (address.family === "IPv4" || address.family === "IPv6") {
|
|
111385
111520
|
hosts.add(address.address);
|
|
@@ -111595,17 +111730,17 @@ function createHttpUpgradeRouter(server) {
|
|
|
111595
111730
|
|
|
111596
111731
|
// backend/src/server/profile-lock.ts
|
|
111597
111732
|
var import_node_crypto54 = require("node:crypto");
|
|
111598
|
-
var
|
|
111733
|
+
var import_node_child_process23 = require("node:child_process");
|
|
111599
111734
|
var import_promises43 = require("node:fs/promises");
|
|
111600
111735
|
var import_node_path69 = __toESM(require("node:path"), 1);
|
|
111601
111736
|
|
|
111602
111737
|
// backend/src/server/windows-profile-owner.ts
|
|
111603
|
-
var
|
|
111738
|
+
var import_node_child_process22 = require("node:child_process");
|
|
111604
111739
|
function isWindowsProfileOwnerLive(owner) {
|
|
111605
111740
|
if (!Number.isSafeInteger(owner.pid) || owner.pid < 1) return true;
|
|
111606
111741
|
const script = `$ErrorActionPreference='Stop'; try { $p=[Diagnostics.Process]::GetProcessById(${owner.pid}) } catch [ArgumentException] { 'exited'; exit 0 }; if ($p.HasExited) { 'exited' } else { $p.StartTime.ToUniversalTime().Ticks }`;
|
|
111607
111742
|
try {
|
|
111608
|
-
const identity2 = (0,
|
|
111743
|
+
const identity2 = (0, import_node_child_process22.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
|
|
111609
111744
|
encoding: "utf8",
|
|
111610
111745
|
stdio: ["ignore", "pipe", "ignore"],
|
|
111611
111746
|
timeout: 5e3,
|
|
@@ -111663,7 +111798,7 @@ async function acquireBackendProfileLock(options) {
|
|
|
111663
111798
|
const owner = createBackendProfileLockOwner(options);
|
|
111664
111799
|
if (process.platform === "win32") owner.processStartedAt = processStartIdentity(process.pid) ?? void 0;
|
|
111665
111800
|
try {
|
|
111666
|
-
owner.processSignature = (0,
|
|
111801
|
+
owner.processSignature = (0, import_node_child_process23.execFileSync)(
|
|
111667
111802
|
"/bin/ps",
|
|
111668
111803
|
["-p", String(process.pid), "-o", "lstart=", "-o", "command="],
|
|
111669
111804
|
{
|
|
@@ -114175,7 +114310,7 @@ child.once('error',()=>cleanup(1));child.once('close',code=>cleanup(stopped?124:
|
|
|
114175
114310
|
`;
|
|
114176
114311
|
|
|
114177
114312
|
// backend/src/screen-recording-analysis/provider.ts
|
|
114178
|
-
var
|
|
114313
|
+
var import_node_child_process24 = require("node:child_process");
|
|
114179
114314
|
var import_node_util11 = require("node:util");
|
|
114180
114315
|
var import_promises46 = require("node:fs/promises");
|
|
114181
114316
|
var import_node_path73 = __toESM(require("node:path"), 1);
|
|
@@ -114288,7 +114423,7 @@ var AnalysisProvider = class {
|
|
|
114288
114423
|
usage;
|
|
114289
114424
|
async probe() {
|
|
114290
114425
|
if (this.probed) return;
|
|
114291
|
-
const { stdout } = await (0, import_node_util11.promisify)(
|
|
114426
|
+
const { stdout } = await (0, import_node_util11.promisify)(import_node_child_process24.execFile)(this.config.binary, ["exec", "--help"], { timeout: 5e3, maxBuffer: 128 * 1024 });
|
|
114292
114427
|
for (const flag of ["--image", "--output-schema", "--output-last-message", "--ephemeral", "--ignore-user-config"]) if (!stdout.includes(flag)) throw new Error("PROVIDER_UNSUPPORTED");
|
|
114293
114428
|
this.probed = true;
|
|
114294
114429
|
}
|
|
@@ -114334,7 +114469,7 @@ var AnalysisProvider = class {
|
|
|
114334
114469
|
if (value !== void 0) environment2[key2] = value;
|
|
114335
114470
|
}
|
|
114336
114471
|
const deadline = Math.min(Date.now() + 12e4, ...manifest.captures.map((frame) => frame.availableUntilMs));
|
|
114337
|
-
const child = (0,
|
|
114472
|
+
const child = (0, import_node_child_process24.spawn)(process.execPath, ["-e", analysisProviderRunner, this.config.binary, JSON.stringify(args), directory3, String(deadline)], { cwd: directory3, stdio: ["pipe", "pipe", "pipe", "ipc"], detached: process.platform !== "win32", env: environment2 });
|
|
114338
114473
|
let reason, bytes = 0, killTimer;
|
|
114339
114474
|
const kill = (force) => {
|
|
114340
114475
|
if (!child.pid || child.exitCode !== null) return;
|
|
@@ -114629,7 +114764,7 @@ var import_node_crypto63 = require("node:crypto");
|
|
|
114629
114764
|
|
|
114630
114765
|
// backend/src/side-chat/provider.ts
|
|
114631
114766
|
var import_node_crypto62 = require("node:crypto");
|
|
114632
|
-
var
|
|
114767
|
+
var import_node_child_process25 = require("node:child_process");
|
|
114633
114768
|
var import_node_fs33 = require("node:fs");
|
|
114634
114769
|
var import_node_path75 = __toESM(require("node:path"), 1);
|
|
114635
114770
|
var import_node_url3 = require("node:url");
|
|
@@ -114697,7 +114832,7 @@ var SideChatProvider = class {
|
|
|
114697
114832
|
for (const key2 of Object.keys(env)) {
|
|
114698
114833
|
if (key2.startsWith("RUNWEAVE_") || key2 === "TMUX" || key2 === "TMUX_PANE" || key2.startsWith("CODEX_THREAD") || key2.startsWith("CODEX_INTERNAL")) delete env[key2];
|
|
114699
114834
|
}
|
|
114700
|
-
const child = (0,
|
|
114835
|
+
const child = (0, import_node_child_process25.spawn)(this.binary, [...args, "app-server", "--stdio"], { cwd, env, stdio: ["pipe", "pipe", "pipe"] });
|
|
114701
114836
|
this.child = child;
|
|
114702
114837
|
this.exit = new Promise((resolve) => child.once("close", () => resolve()));
|
|
114703
114838
|
child.stdout.setEncoding("utf8");
|
|
@@ -116195,12 +116330,12 @@ async function createAuthRuntime(storagePaths, resources) {
|
|
|
116195
116330
|
var import_node_crypto69 = require("node:crypto");
|
|
116196
116331
|
var import_node_fs36 = require("node:fs");
|
|
116197
116332
|
var import_promises52 = __toESM(require("node:fs/promises"), 1);
|
|
116198
|
-
var
|
|
116333
|
+
var import_node_os19 = __toESM(require("node:os"), 1);
|
|
116199
116334
|
var import_node_path81 = __toESM(require("node:path"), 1);
|
|
116200
|
-
var
|
|
116335
|
+
var import_node_child_process26 = require("node:child_process");
|
|
116201
116336
|
function signature(pid) {
|
|
116202
116337
|
try {
|
|
116203
|
-
return (0,
|
|
116338
|
+
return (0, import_node_child_process26.execFileSync)(
|
|
116204
116339
|
"ps",
|
|
116205
116340
|
["-p", String(pid), "-o", "lstart=", "-o", "command="],
|
|
116206
116341
|
{
|
|
@@ -116216,7 +116351,7 @@ function signature(pid) {
|
|
|
116216
116351
|
var DevResourcesService = class {
|
|
116217
116352
|
generation = (0, import_node_crypto69.randomUUID)();
|
|
116218
116353
|
directory = import_node_path81.default.join(
|
|
116219
|
-
|
|
116354
|
+
import_node_os19.default.homedir(),
|
|
116220
116355
|
".runweave",
|
|
116221
116356
|
"dev-resources",
|
|
116222
116357
|
"operations"
|
|
@@ -116225,7 +116360,7 @@ var DevResourcesService = class {
|
|
|
116225
116360
|
disposed = false;
|
|
116226
116361
|
activeResources = /* @__PURE__ */ new Map();
|
|
116227
116362
|
async safeDirectory(create3 = false) {
|
|
116228
|
-
let current =
|
|
116363
|
+
let current = import_node_os19.default.homedir();
|
|
116229
116364
|
for (const name of [".runweave", "dev-resources", "operations"]) {
|
|
116230
116365
|
current = import_node_path81.default.join(current, name);
|
|
116231
116366
|
if (create3)
|
|
@@ -116450,12 +116585,12 @@ var import_promises55 = require("node:fs/promises");
|
|
|
116450
116585
|
var import_node_path85 = __toESM(require("node:path"), 1);
|
|
116451
116586
|
|
|
116452
116587
|
// backend/src/terminal/code-review/snapshot.ts
|
|
116453
|
-
var
|
|
116588
|
+
var import_node_child_process27 = require("node:child_process");
|
|
116454
116589
|
var import_node_crypto70 = require("node:crypto");
|
|
116455
116590
|
var import_promises53 = require("node:fs/promises");
|
|
116456
116591
|
var import_node_path82 = __toESM(require("node:path"), 1);
|
|
116457
116592
|
var import_node_util12 = require("node:util");
|
|
116458
|
-
var exec4 = (0, import_node_util12.promisify)(
|
|
116593
|
+
var exec4 = (0, import_node_util12.promisify)(import_node_child_process27.execFile);
|
|
116459
116594
|
var reviewDigest = (value) => (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(value)).digest("hex");
|
|
116460
116595
|
async function git3(root, args) {
|
|
116461
116596
|
return (await exec4("git", args, {
|
|
@@ -116735,7 +116870,7 @@ ${finding.impact}`),
|
|
|
116735
116870
|
}
|
|
116736
116871
|
|
|
116737
116872
|
// backend/src/terminal/code-review/hooks.ts
|
|
116738
|
-
var
|
|
116873
|
+
var import_node_child_process28 = require("node:child_process");
|
|
116739
116874
|
var import_node_path84 = __toESM(require("node:path"), 1);
|
|
116740
116875
|
var hookList = external_exports.object({ data: external_exports.array(external_exports.object({
|
|
116741
116876
|
cwd: external_exports.string(),
|
|
@@ -116744,7 +116879,7 @@ var hookList = external_exports.object({ data: external_exports.array(external_e
|
|
|
116744
116879
|
warnings: external_exports.array(external_exports.string())
|
|
116745
116880
|
})) });
|
|
116746
116881
|
async function listReviewerHooks(cwd, command) {
|
|
116747
|
-
const child = (0,
|
|
116882
|
+
const child = (0, import_node_child_process28.spawn)(command, ["app-server", "--listen", "stdio://"], {
|
|
116748
116883
|
cwd,
|
|
116749
116884
|
env: process.env,
|
|
116750
116885
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -118228,17 +118363,17 @@ var DesktopBadgeAccess = class {
|
|
|
118228
118363
|
var import_node_crypto77 = require("node:crypto");
|
|
118229
118364
|
|
|
118230
118365
|
// backend/src/terminal/questions/executor.ts
|
|
118231
|
-
var
|
|
118366
|
+
var import_node_child_process30 = require("node:child_process");
|
|
118232
118367
|
var import_node_util14 = require("node:util");
|
|
118233
118368
|
var import_promises60 = require("node:fs/promises");
|
|
118234
118369
|
|
|
118235
118370
|
// backend/src/terminal/attachments/codex-execution.ts
|
|
118236
|
-
var
|
|
118371
|
+
var import_node_child_process29 = require("node:child_process");
|
|
118237
118372
|
var import_node_util13 = require("node:util");
|
|
118238
118373
|
var import_node_path90 = __toESM(require("node:path"), 1);
|
|
118239
118374
|
var import_node_url5 = require("node:url");
|
|
118240
118375
|
var import_promises59 = require("node:fs/promises");
|
|
118241
|
-
var exec5 = (0, import_node_util13.promisify)(
|
|
118376
|
+
var exec5 = (0, import_node_util13.promisify)(import_node_child_process29.execFile);
|
|
118242
118377
|
var directory2 = import_node_path90.default.dirname((0, import_node_url5.fileURLToPath)(__IMPORT_META_URL__));
|
|
118243
118378
|
var helper = import_node_path90.default.basename(directory2) === "attachments" ? import_node_path90.default.resolve(directory2, "../../../.native-artifacts/resource-sampler") : import_node_path90.default.join(directory2, "resource-sampler");
|
|
118244
118379
|
async function readCodexProcessArguments(pid) {
|
|
@@ -118264,7 +118399,7 @@ async function readCodexProcessArguments(pid) {
|
|
|
118264
118399
|
}
|
|
118265
118400
|
|
|
118266
118401
|
// backend/src/terminal/questions/executor.ts
|
|
118267
|
-
var exec6 = (0, import_node_util14.promisify)(
|
|
118402
|
+
var exec6 = (0, import_node_util14.promisify)(import_node_child_process30.execFile);
|
|
118268
118403
|
function remoteSocket(args) {
|
|
118269
118404
|
const values = /* @__PURE__ */ new Set(["-c", "--config", "-m", "--model", "-p", "--profile", "-C", "--cd", "--enable", "--disable", "--add-dir", "-i", "--image", "--local-provider", "--sandbox", "-s", "--ask-for-approval", "-a"]);
|
|
118270
118405
|
let socket = null;
|
|
@@ -118402,7 +118537,7 @@ var TerminalQuestionsService = class {
|
|
|
118402
118537
|
};
|
|
118403
118538
|
|
|
118404
118539
|
// backend/src/resource-monitor/service.ts
|
|
118405
|
-
var
|
|
118540
|
+
var import_node_os20 = __toESM(require("node:os"), 1);
|
|
118406
118541
|
var import_node_crypto79 = require("node:crypto");
|
|
118407
118542
|
|
|
118408
118543
|
// backend/src/resource-monitor/observations.ts
|
|
@@ -118633,7 +118768,7 @@ var ResourceMonitorService = class {
|
|
|
118633
118768
|
return {
|
|
118634
118769
|
protocolVersion: 1,
|
|
118635
118770
|
hostId: this.hostId,
|
|
118636
|
-
hostName:
|
|
118771
|
+
hostName: import_node_os20.default.hostname(),
|
|
118637
118772
|
streamId: this.streamId,
|
|
118638
118773
|
revision: this.revision,
|
|
118639
118774
|
sampleAgeMs: this.observedMonotonic === null ? null : Math.max(0, this.clock() - this.observedMonotonic),
|
|
@@ -119131,7 +119266,7 @@ ${references2.join("\n")}`,
|
|
|
119131
119266
|
};
|
|
119132
119267
|
|
|
119133
119268
|
// backend/src/bootstrap/knowledge-inbox.ts
|
|
119134
|
-
var
|
|
119269
|
+
var import_node_os21 = __toESM(require("node:os"), 1);
|
|
119135
119270
|
var import_node_path93 = __toESM(require("node:path"), 1);
|
|
119136
119271
|
|
|
119137
119272
|
// backend/src/knowledge-inbox/projection.ts
|
|
@@ -119868,7 +120003,7 @@ var ExperienceInboxSource = class {
|
|
|
119868
120003
|
// backend/src/bootstrap/knowledge-inbox.ts
|
|
119869
120004
|
function createKnowledgeInbox(resources, dependencies) {
|
|
119870
120005
|
const storage = resolveExperienceStorage();
|
|
119871
|
-
const home = process.env.RUNWEAVE_EXPERIENCE_TEST_MODE === "true" ? import_node_path93.default.join(storage.home, "knowledge-inbox") : import_node_path93.default.join(
|
|
120006
|
+
const home = process.env.RUNWEAVE_EXPERIENCE_TEST_MODE === "true" ? import_node_path93.default.join(storage.home, "knowledge-inbox") : import_node_path93.default.join(import_node_os21.default.homedir(), ".runweave", "knowledge-inbox");
|
|
119872
120007
|
const inboxStorage = new InboxStorage(import_node_path93.default.join(home, storage.namespace));
|
|
119873
120008
|
const service = new KnowledgeInboxService(
|
|
119874
120009
|
inboxStorage,
|
|
@@ -120667,9 +120802,9 @@ function matchesCron(cron, value) {
|
|
|
120667
120802
|
}
|
|
120668
120803
|
|
|
120669
120804
|
// backend/src/evolution/providers/availability.ts
|
|
120670
|
-
var
|
|
120805
|
+
var import_node_child_process31 = require("node:child_process");
|
|
120671
120806
|
var import_node_util15 = require("node:util");
|
|
120672
|
-
var execFileAsync5 = (0, import_node_util15.promisify)(
|
|
120807
|
+
var execFileAsync5 = (0, import_node_util15.promisify)(import_node_child_process31.execFile);
|
|
120673
120808
|
var PROBE_TIMEOUT_MS = 5e3;
|
|
120674
120809
|
var CACHE_TTL_MS = 3e4;
|
|
120675
120810
|
var EvolutionProviderAvailabilityService = class {
|
|
@@ -121634,9 +121769,9 @@ async function auditRepositoryMigration(dataDir) {
|
|
|
121634
121769
|
}
|
|
121635
121770
|
|
|
121636
121771
|
// backend/src/evolution/storage/repository-migration-files.ts
|
|
121637
|
-
var
|
|
121772
|
+
var import_node_os22 = __toESM(require("node:os"), 1);
|
|
121638
121773
|
var import_node_fs39 = require("node:fs");
|
|
121639
|
-
var
|
|
121774
|
+
var import_node_child_process32 = require("node:child_process");
|
|
121640
121775
|
var import_node_fs40 = require("node:fs");
|
|
121641
121776
|
var import_node_path97 = __toESM(require("node:path"), 1);
|
|
121642
121777
|
function privateJson(file, value) {
|
|
@@ -121649,7 +121784,7 @@ function assertOffline(files) {
|
|
|
121649
121784
|
for (const file of files) {
|
|
121650
121785
|
let output = "";
|
|
121651
121786
|
try {
|
|
121652
|
-
output = (0,
|
|
121787
|
+
output = (0, import_node_child_process32.execFileSync)(
|
|
121653
121788
|
process.platform === "darwin" ? "/usr/sbin/lsof" : "lsof",
|
|
121654
121789
|
["-t", "--", file, `${file}-wal`, `${file}-shm`],
|
|
121655
121790
|
{ encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }
|
|
@@ -121709,7 +121844,7 @@ function currentFingerprints(files) {
|
|
|
121709
121844
|
}
|
|
121710
121845
|
function databaseClone(file) {
|
|
121711
121846
|
const directory3 = (0, import_node_fs39.mkdtempSync)(
|
|
121712
|
-
import_node_path97.default.join(
|
|
121847
|
+
import_node_path97.default.join(import_node_os22.default.tmpdir(), "runweave-migration-verify-")
|
|
121713
121848
|
);
|
|
121714
121849
|
const clone2 = import_node_path97.default.join(directory3, "expected.sqlite");
|
|
121715
121850
|
(0, import_node_fs39.copyFileSync)(file, clone2);
|
|
@@ -122582,11 +122717,11 @@ var BatteryAlerts = class {
|
|
|
122582
122717
|
var import_node_crypto90 = require("node:crypto");
|
|
122583
122718
|
|
|
122584
122719
|
// backend/src/device-monitor/sampler.ts
|
|
122585
|
-
var
|
|
122720
|
+
var import_node_child_process33 = require("node:child_process");
|
|
122586
122721
|
var sampleBattery = async (signal) => {
|
|
122587
122722
|
if (process.platform !== "darwin") return null;
|
|
122588
122723
|
const output = await new Promise((resolve, reject) => {
|
|
122589
|
-
(0,
|
|
122724
|
+
(0, import_node_child_process33.execFile)(
|
|
122590
122725
|
"/usr/bin/pmset",
|
|
122591
122726
|
["-g", "batt"],
|
|
122592
122727
|
{
|
|
@@ -125919,7 +126054,7 @@ var TmuxOutputPoller = class {
|
|
|
125919
126054
|
async reconcileSessionLifecycle(watched) {
|
|
125920
126055
|
const isCurrent = () => !this.isDisposed() && this.watchedPanes.get(resolvePaneWatcherKey(watched.terminalSessionId, watched.target.paneId)) === watched;
|
|
125921
126056
|
const session = this.terminalSessionManager.getSession(watched.terminalSessionId);
|
|
125922
|
-
if (!isCurrent() || !session || !shouldWatchSession(session) || !session.activeCommand ||
|
|
126057
|
+
if (!isCurrent() || !session || !shouldWatchSession(session) || !session.activeCommand || isInteractiveShellLaunch3(session.command, session.args)) {
|
|
125923
126058
|
return false;
|
|
125924
126059
|
}
|
|
125925
126060
|
let metadata;
|
|
@@ -126069,7 +126204,7 @@ var TmuxOutputWatcher = class {
|
|
|
126069
126204
|
const target2 = resolveTmuxTarget2(session, this.tmuxService);
|
|
126070
126205
|
const hasSession = await this.tmuxService.hasSession(target2).catch(() => true);
|
|
126071
126206
|
if (this.disposed) return;
|
|
126072
|
-
if (!
|
|
126207
|
+
if (!isInteractiveShellLaunch3(session.command, session.args) && !hasSession) {
|
|
126073
126208
|
await this.terminalSessionManager.updateSessionMetadata(session.id, {
|
|
126074
126209
|
cwd: session.cwd,
|
|
126075
126210
|
activeCommand: null
|
|
@@ -126892,12 +127027,12 @@ function hashPrompt2(text5) {
|
|
|
126892
127027
|
}
|
|
126893
127028
|
|
|
126894
127029
|
// backend/src/terminal/workspace-service/worktree-project-registry.ts
|
|
126895
|
-
var
|
|
127030
|
+
var import_node_child_process34 = require("node:child_process");
|
|
126896
127031
|
var import_promises69 = require("node:fs/promises");
|
|
126897
127032
|
var import_node_path113 = __toESM(require("node:path"), 1);
|
|
126898
127033
|
function runGitWorktreeList(projectPath) {
|
|
126899
127034
|
return new Promise((resolve, reject) => {
|
|
126900
|
-
(0,
|
|
127035
|
+
(0, import_node_child_process34.execFile)(
|
|
126901
127036
|
"git",
|
|
126902
127037
|
["-C", projectPath, "worktree", "list", "--porcelain", "-z"],
|
|
126903
127038
|
{ encoding: "utf8", maxBuffer: 4 * 1024 * 1024 },
|
|
@@ -128828,7 +128963,7 @@ function isWorkspaceServiceHostnameCandidate(hostname2) {
|
|
|
128828
128963
|
}
|
|
128829
128964
|
|
|
128830
128965
|
// backend/src/terminal/workspace-service/owned-process.ts
|
|
128831
|
-
var
|
|
128966
|
+
var import_node_child_process35 = require("node:child_process");
|
|
128832
128967
|
var OUTPUT_TAIL_BYTES = 8 * 1024;
|
|
128833
128968
|
var SUPERVISOR_START_TIMEOUT_MS = 5e3;
|
|
128834
128969
|
var SUPERVISOR_SOURCE = String.raw`
|
|
@@ -128922,7 +129057,7 @@ function signalSupervisor(child) {
|
|
|
128922
129057
|
if (child.connected) child.send({ type: "stop" });
|
|
128923
129058
|
}
|
|
128924
129059
|
async function startOwnedWorkspaceServiceProcess(input2) {
|
|
128925
|
-
const supervisor = (0,
|
|
129060
|
+
const supervisor = (0, import_node_child_process35.spawn)(process.execPath, ["-e", SUPERVISOR_SOURCE], {
|
|
128926
129061
|
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" },
|
|
128927
129062
|
stdio: ["ignore", "pipe", "pipe", "ipc"]
|
|
128928
129063
|
});
|
|
@@ -133481,9 +133616,9 @@ var package_default2 = {
|
|
|
133481
133616
|
};
|
|
133482
133617
|
|
|
133483
133618
|
// backend/src/runtime-status/cli-version.ts
|
|
133484
|
-
var
|
|
133619
|
+
var import_node_child_process36 = require("node:child_process");
|
|
133485
133620
|
var import_node_util17 = require("node:util");
|
|
133486
|
-
var execute = (0, import_node_util17.promisify)(
|
|
133621
|
+
var execute = (0, import_node_util17.promisify)(import_node_child_process36.execFile);
|
|
133487
133622
|
var cached2 = null;
|
|
133488
133623
|
var pending = null;
|
|
133489
133624
|
async function readNodeCliVersion() {
|
|
@@ -133960,11 +134095,39 @@ var import_node_path127 = __toESM(require("node:path"), 1);
|
|
|
133960
134095
|
|
|
133961
134096
|
// backend/src/scheduled-tasks/migration.ts
|
|
133962
134097
|
var import_node_crypto114 = require("node:crypto");
|
|
133963
|
-
var
|
|
134098
|
+
var import_node_child_process38 = require("node:child_process");
|
|
133964
134099
|
var import_node_fs47 = require("node:fs");
|
|
133965
134100
|
var import_node_path123 = __toESM(require("node:path"), 1);
|
|
133966
134101
|
var import_better_sqlite34 = __toESM(require("better-sqlite3"), 1);
|
|
133967
134102
|
|
|
134103
|
+
// backend/src/scheduled-tasks/windows-database-offline.ts
|
|
134104
|
+
var import_node_child_process37 = require("node:child_process");
|
|
134105
|
+
function assertWindowsDatabaseOffline(databasePath) {
|
|
134106
|
+
const script = `
|
|
134107
|
+
$ErrorActionPreference = 'Stop'
|
|
134108
|
+
$handles = [System.Collections.Generic.List[System.IDisposable]]::new()
|
|
134109
|
+
try {
|
|
134110
|
+
$database = $env:RUNWEAVE_MIGRATION_DATABASE_PATH
|
|
134111
|
+
foreach ($file in @($database, ($database + '-wal'), ($database + '-shm'))) {
|
|
134112
|
+
try {
|
|
134113
|
+
$handles.Add([System.IO.File]::Open($file, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::None))
|
|
134114
|
+
} catch {
|
|
134115
|
+
$cause = $_.Exception.GetBaseException()
|
|
134116
|
+
if ($cause -isnot [System.IO.FileNotFoundException]) { throw }
|
|
134117
|
+
if ($file -eq $database) { throw }
|
|
134118
|
+
}
|
|
134119
|
+
}
|
|
134120
|
+
} finally {
|
|
134121
|
+
foreach ($handle in $handles) { $handle.Dispose() }
|
|
134122
|
+
}
|
|
134123
|
+
`;
|
|
134124
|
+
(0, import_node_child_process37.execFileSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")], {
|
|
134125
|
+
env: { ...process.env, RUNWEAVE_MIGRATION_DATABASE_PATH: databasePath },
|
|
134126
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
134127
|
+
timeout: 1e4
|
|
134128
|
+
});
|
|
134129
|
+
}
|
|
134130
|
+
|
|
133968
134131
|
// backend/src/scheduled-tasks/storage/migrations.ts
|
|
133969
134132
|
var import_node_crypto113 = require("node:crypto");
|
|
133970
134133
|
var import_better_sqlite33 = __toESM(require("better-sqlite3"), 1);
|
|
@@ -134826,9 +134989,17 @@ var ScheduledTaskMigration = class {
|
|
|
134826
134989
|
}
|
|
134827
134990
|
}
|
|
134828
134991
|
assertOffline() {
|
|
134992
|
+
if (process.platform === "win32") {
|
|
134993
|
+
try {
|
|
134994
|
+
assertWindowsDatabaseOffline(this.databasePath);
|
|
134995
|
+
} catch {
|
|
134996
|
+
throw failure2("migration_busy", "\u65E0\u6CD5\u72EC\u5360\u6253\u5F00\u4EFB\u52A1\u6570\u636E\u5E93\u6216 WAL/SHM\uFF1B\u8BF7\u505C\u6B62\u65E7\u4EFB\u52A1\u670D\u52A1\uFF0C\u5E76\u786E\u8BA4 PowerShell \u53EF\u7528\u540E\u91CD\u8BD5\u3002");
|
|
134997
|
+
}
|
|
134998
|
+
return;
|
|
134999
|
+
}
|
|
134829
135000
|
let output;
|
|
134830
135001
|
try {
|
|
134831
|
-
output = (0,
|
|
135002
|
+
output = (0, import_node_child_process38.execFileSync)(process.platform === "darwin" ? "/usr/sbin/lsof" : "lsof", ["-t", "--", this.databasePath, `${this.databasePath}-wal`, `${this.databasePath}-shm`], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 5e3 });
|
|
134832
135003
|
} catch (error2) {
|
|
134833
135004
|
const result = error2;
|
|
134834
135005
|
if (result.status !== 1) throw failure2("migration_busy", "\u65E0\u6CD5\u786E\u8BA4\u65E7\u6570\u636E\u5E93 owner \u5DF2\u505C\u6B62\uFF1B\u9700\u8981\u53EF\u7528\u7684 lsof\u3002");
|
|
@@ -134845,11 +135016,11 @@ function failure2(code, message2) {
|
|
|
134845
135016
|
}
|
|
134846
135017
|
|
|
134847
135018
|
// backend/src/scheduled-tasks/providers/capabilities.ts
|
|
134848
|
-
var
|
|
135019
|
+
var import_node_child_process41 = require("node:child_process");
|
|
134849
135020
|
var import_node_util19 = require("node:util");
|
|
134850
135021
|
|
|
134851
135022
|
// backend/src/scheduled-tasks/providers/codex-resume.ts
|
|
134852
|
-
var
|
|
135023
|
+
var import_node_child_process39 = require("node:child_process");
|
|
134853
135024
|
var import_promises79 = require("node:fs/promises");
|
|
134854
135025
|
var import_node_util18 = require("node:util");
|
|
134855
135026
|
|
|
@@ -134880,7 +135051,7 @@ function codexScheduledArgs(config3) {
|
|
|
134880
135051
|
}
|
|
134881
135052
|
|
|
134882
135053
|
// backend/src/scheduled-tasks/providers/codex-resume.ts
|
|
134883
|
-
var exec7 = (0, import_node_util18.promisify)(
|
|
135054
|
+
var exec7 = (0, import_node_util18.promisify)(import_node_child_process39.execFile);
|
|
134884
135055
|
async function checkpointCodexResume(threadId, cwd) {
|
|
134885
135056
|
try {
|
|
134886
135057
|
const result = await codexAppServerClient.sendRequest("thread/read", {
|
|
@@ -135007,9 +135178,9 @@ async function ownsResumeHistory(pid, checkpoint, cwd) {
|
|
|
135007
135178
|
}
|
|
135008
135179
|
|
|
135009
135180
|
// backend/src/scheduled-tasks/providers/codex.ts
|
|
135010
|
-
var
|
|
135181
|
+
var import_node_child_process40 = require("node:child_process");
|
|
135011
135182
|
var import_promises80 = require("node:fs/promises");
|
|
135012
|
-
var
|
|
135183
|
+
var import_node_os23 = __toESM(require("node:os"), 1);
|
|
135013
135184
|
var import_node_path124 = __toESM(require("node:path"), 1);
|
|
135014
135185
|
var import_node_string_decoder3 = require("node:string_decoder");
|
|
135015
135186
|
var TERMINATION_GRACE_MS2 = 3e3;
|
|
@@ -135027,7 +135198,7 @@ var CodexScheduledTaskProvider = class {
|
|
|
135027
135198
|
if (request2.executionPolicy === "full-access" && !this.fullAccessSupported)
|
|
135028
135199
|
throw new Error("execution_policy_unavailable");
|
|
135029
135200
|
const directory3 = await (0, import_promises80.mkdtemp)(
|
|
135030
|
-
import_node_path124.default.join(
|
|
135201
|
+
import_node_path124.default.join(import_node_os23.default.tmpdir(), "runweave-scheduled-result-")
|
|
135031
135202
|
);
|
|
135032
135203
|
try {
|
|
135033
135204
|
const schemaPath = import_node_path124.default.join(directory3, "result-schema.json");
|
|
@@ -135060,7 +135231,7 @@ var CodexScheduledTaskProvider = class {
|
|
|
135060
135231
|
...request2.resumeThreadId ? ["resume", request2.resumeThreadId] : [],
|
|
135061
135232
|
"-"
|
|
135062
135233
|
];
|
|
135063
|
-
const child = (0,
|
|
135234
|
+
const child = (0, import_node_child_process40.spawn)(this.binary, args, {
|
|
135064
135235
|
cwd: request2.workingDirectory,
|
|
135065
135236
|
env: codexScheduledEnvironment(
|
|
135066
135237
|
process.env,
|
|
@@ -135292,7 +135463,7 @@ function waitForExit2(child) {
|
|
|
135292
135463
|
}
|
|
135293
135464
|
|
|
135294
135465
|
// backend/src/scheduled-tasks/providers/capabilities.ts
|
|
135295
|
-
var execFileAsync6 = (0, import_node_util19.promisify)(
|
|
135466
|
+
var execFileAsync6 = (0, import_node_util19.promisify)(import_node_child_process41.execFile);
|
|
135296
135467
|
function detectCodexScheduledFeatures(help) {
|
|
135297
135468
|
return {
|
|
135298
135469
|
autoReview: help.includes("--approve-for-me"),
|
|
@@ -137346,14 +137517,14 @@ function createDelivery(id7, run2, subscriptionId) {
|
|
|
137346
137517
|
|
|
137347
137518
|
// backend/src/bootstrap/tmux-paths.ts
|
|
137348
137519
|
var import_node_crypto120 = require("node:crypto");
|
|
137349
|
-
var
|
|
137520
|
+
var import_node_os24 = __toESM(require("node:os"), 1);
|
|
137350
137521
|
var import_node_path128 = __toESM(require("node:path"), 1);
|
|
137351
137522
|
function profileId(browserProfileDir) {
|
|
137352
137523
|
return (0, import_node_crypto120.createHash)("sha256").update(browserProfileDir).digest("hex").slice(0, 12);
|
|
137353
137524
|
}
|
|
137354
137525
|
function resolvePersistentTmuxSocketPath(browserProfileDir) {
|
|
137355
137526
|
return import_node_path128.default.join(
|
|
137356
|
-
|
|
137527
|
+
import_node_os24.default.homedir(),
|
|
137357
137528
|
".runweave",
|
|
137358
137529
|
"tmux",
|
|
137359
137530
|
profileId(browserProfileDir),
|
|
@@ -137362,7 +137533,7 @@ function resolvePersistentTmuxSocketPath(browserProfileDir) {
|
|
|
137362
137533
|
}
|
|
137363
137534
|
function resolveDefaultTmuxSocketPath(browserProfileDir, runtimeChannel) {
|
|
137364
137535
|
return runtimeChannel === "stable" ? resolvePersistentTmuxSocketPath(browserProfileDir) : import_node_path128.default.join(
|
|
137365
|
-
|
|
137536
|
+
import_node_os24.default.tmpdir(),
|
|
137366
137537
|
`rw-tmux-${profileId(browserProfileDir)}`,
|
|
137367
137538
|
"tmux.sock"
|
|
137368
137539
|
);
|