@runweave/server-linux-x64 0.1.8 → 0.1.9
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 +1482 -151
- 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 +3 -3
- package/payload/app-server/index.cjs +1 -1
- package/payload/backend/build-info.json +4 -4
- package/payload/backend/index.cjs +45 -9
- package/payload/backend/ios-simulators/pool.py +3 -3
- package/payload/frontend/dist/assets/{_baseUniq-vo4uuhMd.js → _baseUniq-qHFga5V8.js} +1 -1
- package/payload/frontend/dist/assets/{access-_jCu7Rgu.js → access-DgHvmn15.js} +1 -1
- package/payload/frontend/dist/assets/{advanced-CqOhObYj.js → advanced-C1Fh14vw.js} +1 -1
- package/payload/frontend/dist/assets/{appearance-CrrD5gzC.js → appearance-Bs7cSXqO.js} +1 -1
- package/payload/frontend/dist/assets/{arc-dbfyHSF0.js → arc-E3iYHQG_.js} +1 -1
- package/payload/frontend/dist/assets/{architectureDiagram-Q4EWVU46-CntSCAsO.js → architectureDiagram-Q4EWVU46-DgpYpTb9.js} +1 -1
- package/payload/frontend/dist/assets/{blockDiagram-DXYQGD6D-Chp0D4qy.js → blockDiagram-DXYQGD6D-CfFOEKZ7.js} +1 -1
- package/payload/frontend/dist/assets/{c4Diagram-AHTNJAMY-CF91pOuW.js → c4Diagram-AHTNJAMY-BxlHBUj3.js} +1 -1
- package/payload/frontend/dist/assets/channel-amxyNKnk.js +1 -0
- package/payload/frontend/dist/assets/{chunk-4BX2VUAB-B1gxlVu2.js → chunk-4BX2VUAB-xWocgDo8.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-4TB4RGXK-Cxt3mj9b.js → chunk-4TB4RGXK-Bl1cNICf.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-55IACEB6-BJT6qNik.js → chunk-55IACEB6-DVtE836u.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-EDXVE4YY-yI59bCa0.js → chunk-EDXVE4YY-Dbd3tDCr.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-FMBD7UC4-CDvncKKJ.js → chunk-FMBD7UC4-MPJaTsyN.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-OYMX7WX6-BblOIU57.js → chunk-OYMX7WX6-D3LuudlW.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-QZHKN3VN-rODzNdO0.js → chunk-QZHKN3VN-Dn1aF6iQ.js} +1 -1
- package/payload/frontend/dist/assets/{chunk-YZCP3GAM-B6D4wQwk.js → chunk-YZCP3GAM-jZYbHnCw.js} +1 -1
- package/payload/frontend/dist/assets/classDiagram-6PBFFD2Q-B8cTijjT.js +1 -0
- package/payload/frontend/dist/assets/classDiagram-v2-HSJHXN6E-B8cTijjT.js +1 -0
- package/payload/frontend/dist/assets/clone-xzI2eGRI.js +1 -0
- package/payload/frontend/dist/assets/connection-V2iI-6rM.js +12 -0
- package/payload/frontend/dist/assets/{connections-DqDmxS-O.js → connections-G_Q7342g.js} +1 -1
- package/payload/frontend/dist/assets/{cose-bilkent-S5V4N54A-BvwVWp29.js → cose-bilkent-S5V4N54A-75FLD3RS.js} +1 -1
- package/payload/frontend/dist/assets/{dagre-KV5264BT-h_K1TH11.js → dagre-KV5264BT-DEm-DpJL.js} +1 -1
- package/payload/frontend/dist/assets/{desktop-BQ3kGtKG.js → desktop-g5JC-CQd.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-5BDNPKRD-B8g2SV6L.js → diagram-5BDNPKRD-BV6P2UTy.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-G4DWMVQ6-BOEnrqYm.js → diagram-G4DWMVQ6-DuCK-MM2.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-MMDJMWI5-DlaN_z71.js → diagram-MMDJMWI5-D5_GlPgO.js} +1 -1
- package/payload/frontend/dist/assets/{diagram-TYMM5635-C_pSKftn.js → diagram-TYMM5635-QRbOYR1P.js} +1 -1
- package/payload/frontend/dist/assets/{erDiagram-SMLLAGMA-C2dL-h3I.js → erDiagram-SMLLAGMA-DefCheAw.js} +1 -1
- package/payload/frontend/dist/assets/{flowDiagram-DWJPFMVM-BmXhKWFj.js → flowDiagram-DWJPFMVM-DVzyWIso.js} +1 -1
- package/payload/frontend/dist/assets/{ganttDiagram-T4ZO3ILL-D_Odnssf.js → ganttDiagram-T4ZO3ILL-BJaClUEF.js} +1 -1
- package/payload/frontend/dist/assets/{gitGraphDiagram-UUTBAWPF-DcQdcwKZ.js → gitGraphDiagram-UUTBAWPF-BLfbApNz.js} +1 -1
- package/payload/frontend/dist/assets/{graph-C_XsxefA.js → graph-C-YqFh68.js} +1 -1
- package/payload/frontend/dist/assets/{image-D3hgVr8O.js → image-CZo_2Awc.js} +1 -1
- package/payload/frontend/dist/assets/{index-CEUsFFQq.js → index-6q2aeqkt.js} +95 -105
- package/payload/frontend/dist/assets/{infoDiagram-42DDH7IO-C6TnRyMi.js → infoDiagram-42DDH7IO-BakVOutT.js} +1 -1
- package/payload/frontend/dist/assets/{ishikawaDiagram-UXIWVN3A-BL7rfALJ.js → ishikawaDiagram-UXIWVN3A-D_1Oa5Dc.js} +1 -1
- package/payload/frontend/dist/assets/{journeyDiagram-VCZTEJTY-C_6407GW.js → journeyDiagram-VCZTEJTY-Y8TVFv6B.js} +1 -1
- package/payload/frontend/dist/assets/{kanban-definition-6JOO6SKY-CK61Fd0p.js → kanban-definition-6JOO6SKY-DxeNhTIB.js} +1 -1
- package/payload/frontend/dist/assets/{layout-DVn6JKbl.js → layout-5cMeOTAp.js} +1 -1
- package/payload/frontend/dist/assets/{linear-DyWskq8H.js → linear-Bnc3ev5g.js} +1 -1
- package/payload/frontend/dist/assets/main-3TPtEl66.js +706 -0
- package/payload/frontend/dist/assets/main-D4_uoZQa.css +33 -0
- package/payload/frontend/dist/assets/{min-apbLpSJ3.js → min-BRXKkrS8.js} +1 -1
- package/payload/frontend/dist/assets/{mindmap-definition-QFDTVHPH-MVHZZbma.js → mindmap-definition-QFDTVHPH-RYZO_BEr.js} +1 -1
- package/payload/frontend/dist/assets/{monitoring-BApsVez_.js → monitoring-Fv7kZ4s6.js} +1 -1
- package/payload/frontend/dist/assets/{notifications-CjxSNLU1.js → notifications-BzrYqyMH.js} +1 -1
- package/payload/frontend/dist/assets/{pieDiagram-DEJITSTG-Dhbb0AYU.js → pieDiagram-DEJITSTG-Bzw0dhjz.js} +1 -1
- package/payload/frontend/dist/assets/{quadrantDiagram-34T5L4WZ-Yk6LOF0S.js → quadrantDiagram-34T5L4WZ-CQJY_msa.js} +1 -1
- package/payload/frontend/dist/assets/{record-content-BCJ80KS5.js → record-content-B7-6olQt.js} +1 -1
- package/payload/frontend/dist/assets/{requirementDiagram-MS252O5E-BUhS0PEq.js → requirementDiagram-MS252O5E-DuP8hAV8.js} +1 -1
- package/payload/frontend/dist/assets/{sankeyDiagram-XADWPNL6-D2sdxz14.js → sankeyDiagram-XADWPNL6-D-fQnCZZ.js} +1 -1
- package/payload/frontend/dist/assets/{sequenceDiagram-FGHM5R23-CRere4Fy.js → sequenceDiagram-FGHM5R23-DaZNEccV.js} +1 -1
- package/payload/frontend/dist/assets/{stateDiagram-FHFEXIEX-_pk-OMlm.js → stateDiagram-FHFEXIEX-CkOLt5R1.js} +1 -1
- package/payload/frontend/dist/assets/stateDiagram-v2-QKLJ7IA2-atg1K4nB.js +1 -0
- package/payload/frontend/dist/assets/{status-Dk5rRVQF.js → status-CIIPajZp.js} +1 -1
- package/payload/frontend/dist/assets/suiji-C453W-Sg.js +1 -0
- package/payload/frontend/dist/assets/{svg-X7YkMMvx.js → svg-BUqAWGtg.js} +1 -1
- package/payload/frontend/dist/assets/{tabs-BmKbcPVh.js → tabs-Cwlp1Meu.js} +1 -1
- package/payload/frontend/dist/assets/{timeline-definition-GMOUNBTQ-BPsI2pMC.js → timeline-definition-GMOUNBTQ-BOKDMwHS.js} +1 -1
- package/payload/frontend/dist/assets/{vennDiagram-DHZGUBPP-BNJkZ1Az.js → vennDiagram-DHZGUBPP-fSZjDS41.js} +1 -1
- package/payload/frontend/dist/assets/{wardley-RL74JXVD-CVcYeATS.js → wardley-RL74JXVD-D1KIsvoD.js} +1 -1
- package/payload/frontend/dist/assets/{wardleyDiagram-NUSXRM2D-BpLJ0alk.js → wardleyDiagram-NUSXRM2D-FMe67dwE.js} +1 -1
- package/payload/frontend/dist/assets/{xychartDiagram-5P7HB3ND-BdsYYk4M.js → xychartDiagram-5P7HB3ND-B9AM9_9w.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 +64 -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/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/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
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
// Keep command output private: gh and proxy errors can contain credentials.
|
|
2
|
+
function result(value, timeout = "check_timeout") {
|
|
3
|
+
let reason = value.error;
|
|
4
|
+
const message = value.stderr;
|
|
5
|
+
if (reason === "timeout") reason = timeout;
|
|
6
|
+
else if (reason === "ENOENT") reason = "cli_unavailable";
|
|
7
|
+
else if (/rate limit/i.test(message)) reason = "rate_limited";
|
|
8
|
+
else if (/HTTP 401|Bad credentials|token.*(?:invalid|expired)/i.test(message))
|
|
9
|
+
reason = "authentication_rejected";
|
|
10
|
+
else if (/407|proxy authentication/i.test(message))
|
|
11
|
+
reason = "proxy_authentication_rejected";
|
|
12
|
+
else if (/HTTP 403/i.test(message)) reason = "access_denied";
|
|
13
|
+
else if (/HTTP 404|Could not resolve to a Repository/i.test(message))
|
|
14
|
+
reason = "repository_unavailable";
|
|
15
|
+
else if (/HTTP 5\d\d/i.test(message)) reason = "api_unavailable";
|
|
16
|
+
else if (/not logged/i.test(message)) reason = "account_unconfigured";
|
|
17
|
+
else if (/no oauth token|no token/i.test(message))
|
|
18
|
+
reason = "credential_missing";
|
|
19
|
+
else if (/resolve host|no such host|ENOTFOUND/i.test(message))
|
|
20
|
+
reason = "dns_failure";
|
|
21
|
+
else if (/certificate|TLS handshake|SSL/i.test(message))
|
|
22
|
+
reason = "tls_failure";
|
|
23
|
+
else if (/timeout|timed out|context deadline/i.test(message))
|
|
24
|
+
reason = timeout;
|
|
25
|
+
else if (/connect|connection|network|proxy/i.test(message))
|
|
26
|
+
reason = "connection_failure";
|
|
27
|
+
else if (value.status === "failed" && /^\d+$/.test(reason ?? ""))
|
|
28
|
+
reason = "command_failed";
|
|
29
|
+
return { status: value.status, exitCode: value.exitCode, error: reason };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function proxyEnvironment(proxy) {
|
|
33
|
+
if (!proxy) return null;
|
|
34
|
+
let url;
|
|
35
|
+
try {
|
|
36
|
+
url = new URL(proxy);
|
|
37
|
+
} catch {
|
|
38
|
+
throw new Error(
|
|
39
|
+
"Fallback proxy must be an HTTP(S) URL without credentials.",
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (
|
|
43
|
+
!["http:", "https:"].includes(url.protocol) ||
|
|
44
|
+
url.username ||
|
|
45
|
+
url.password ||
|
|
46
|
+
url.pathname !== "/" ||
|
|
47
|
+
url.search ||
|
|
48
|
+
url.hash
|
|
49
|
+
)
|
|
50
|
+
throw new Error(
|
|
51
|
+
"Fallback proxy must be an HTTP(S) URL without credentials.",
|
|
52
|
+
);
|
|
53
|
+
return {
|
|
54
|
+
HTTP_PROXY: url.href,
|
|
55
|
+
HTTPS_PROXY: url.href,
|
|
56
|
+
http_proxy: url.href,
|
|
57
|
+
https_proxy: url.href,
|
|
58
|
+
NO_PROXY: "",
|
|
59
|
+
no_proxy: "",
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function network(run, env, gitHttps) {
|
|
64
|
+
const values = await Promise.all(
|
|
65
|
+
(gitHttps ? ["api.github.com", "github.com"] : ["api.github.com"]).map(
|
|
66
|
+
async (host) => {
|
|
67
|
+
const probe = await run(
|
|
68
|
+
"curl",
|
|
69
|
+
[
|
|
70
|
+
"--disable",
|
|
71
|
+
"--silent",
|
|
72
|
+
"--show-error",
|
|
73
|
+
"--head",
|
|
74
|
+
"--connect-timeout",
|
|
75
|
+
"5",
|
|
76
|
+
"--max-time",
|
|
77
|
+
"8",
|
|
78
|
+
"--write-out",
|
|
79
|
+
"\n%{http_code}",
|
|
80
|
+
`https://${host}/`,
|
|
81
|
+
],
|
|
82
|
+
[0],
|
|
83
|
+
{ env, timeout: 10_000 },
|
|
84
|
+
);
|
|
85
|
+
const value = result(probe, "network_timeout");
|
|
86
|
+
// A real HTTP response proves connectivity, even when the server rejects HEAD.
|
|
87
|
+
const httpStatus = Number(probe.stdout.trim().split("\n").at(-1));
|
|
88
|
+
if (probe.exitCode === 28) value.error = "network_timeout";
|
|
89
|
+
if (probe.exitCode === 5 || probe.exitCode === 6)
|
|
90
|
+
value.error = "dns_failure";
|
|
91
|
+
if (probe.exitCode === 35 || probe.exitCode === 60)
|
|
92
|
+
value.error = "tls_failure";
|
|
93
|
+
if (probe.exitCode === 0 && httpStatus >= 100 && httpStatus <= 599)
|
|
94
|
+
value.httpStatus = httpStatus;
|
|
95
|
+
else if (value.status === "ok") {
|
|
96
|
+
value.status = "failed";
|
|
97
|
+
value.error = "invalid_http_response";
|
|
98
|
+
}
|
|
99
|
+
if (value.error === "cli_unavailable") value.status = "skipped";
|
|
100
|
+
return [host, value];
|
|
101
|
+
},
|
|
102
|
+
),
|
|
103
|
+
);
|
|
104
|
+
const hosts = Object.fromEntries(values);
|
|
105
|
+
const failed = values.find(([, value]) => value.status === "failed");
|
|
106
|
+
return {
|
|
107
|
+
status: failed
|
|
108
|
+
? "failed"
|
|
109
|
+
: values.every(([, value]) => value.status === "skipped")
|
|
110
|
+
? "skipped"
|
|
111
|
+
: "ok",
|
|
112
|
+
error: failed?.[1].error ?? null,
|
|
113
|
+
hosts,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async function accountChecks(run, env, repository) {
|
|
118
|
+
const [auth, account, access] = await Promise.all([
|
|
119
|
+
run("gh", ["auth", "status", "--active", "--hostname", "github.com"], [0], {
|
|
120
|
+
env,
|
|
121
|
+
}),
|
|
122
|
+
run(
|
|
123
|
+
"gh",
|
|
124
|
+
["api", "--hostname", "github.com", "user", "--jq", ".login"],
|
|
125
|
+
[0],
|
|
126
|
+
{ env },
|
|
127
|
+
),
|
|
128
|
+
run(
|
|
129
|
+
"gh",
|
|
130
|
+
[
|
|
131
|
+
"repo",
|
|
132
|
+
"view",
|
|
133
|
+
repository,
|
|
134
|
+
"--json",
|
|
135
|
+
"nameWithOwner,viewerPermission,defaultBranchRef",
|
|
136
|
+
],
|
|
137
|
+
[0],
|
|
138
|
+
{ env },
|
|
139
|
+
),
|
|
140
|
+
]);
|
|
141
|
+
const checks = {
|
|
142
|
+
auth: result(auth),
|
|
143
|
+
account: {
|
|
144
|
+
...result(account, "api_timeout"),
|
|
145
|
+
login: account.status === "ok" ? account.stdout : null,
|
|
146
|
+
},
|
|
147
|
+
repositoryAccess: result(access, "api_timeout"),
|
|
148
|
+
};
|
|
149
|
+
// gh auth status can label a token invalid when its validation cannot connect.
|
|
150
|
+
if (
|
|
151
|
+
checks.auth.error === "authentication_rejected" &&
|
|
152
|
+
checks.account.status === "failed" &&
|
|
153
|
+
(retryable.has(checks.account.error) ||
|
|
154
|
+
["dns_failure", "tls_failure"].includes(checks.account.error))
|
|
155
|
+
)
|
|
156
|
+
checks.auth.error = checks.account.error;
|
|
157
|
+
if (access.status === "ok") {
|
|
158
|
+
try {
|
|
159
|
+
checks.repositoryAccess.details = JSON.parse(access.stdout);
|
|
160
|
+
} catch {
|
|
161
|
+
checks.repositoryAccess.status = "failed";
|
|
162
|
+
checks.repositoryAccess.error = "invalid_json";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return checks;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function skipped(reason) {
|
|
169
|
+
return Object.fromEntries(
|
|
170
|
+
["auth", "account", "repositoryAccess"].map((key) => [
|
|
171
|
+
key,
|
|
172
|
+
{ status: "skipped", reason },
|
|
173
|
+
]),
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const retryable = new Set([
|
|
178
|
+
"network_timeout",
|
|
179
|
+
"api_timeout",
|
|
180
|
+
"check_timeout",
|
|
181
|
+
"connection_failure",
|
|
182
|
+
"api_unavailable",
|
|
183
|
+
]);
|
|
184
|
+
|
|
185
|
+
export async function githubAccess(
|
|
186
|
+
run,
|
|
187
|
+
env,
|
|
188
|
+
repository,
|
|
189
|
+
fallbackProxy,
|
|
190
|
+
gitHttps,
|
|
191
|
+
) {
|
|
192
|
+
// Validate before starting subprocesses, and never print a rejected proxy URL.
|
|
193
|
+
const fallback = proxyEnvironment(fallbackProxy);
|
|
194
|
+
const credentialProbe = run(
|
|
195
|
+
"gh",
|
|
196
|
+
["auth", "token", "--hostname", "github.com"],
|
|
197
|
+
[0],
|
|
198
|
+
{ timeout: 8_000 },
|
|
199
|
+
).then((token) => {
|
|
200
|
+
const credential = result(token, "credential_read_timeout");
|
|
201
|
+
credential.readable = token.status === "ok" && Boolean(token.stdout.trim());
|
|
202
|
+
if (credential.status === "ok" && !credential.readable) {
|
|
203
|
+
credential.status = "failed";
|
|
204
|
+
credential.error = "credential_missing";
|
|
205
|
+
}
|
|
206
|
+
return credential;
|
|
207
|
+
});
|
|
208
|
+
let connectionEnvironment = {};
|
|
209
|
+
let checks;
|
|
210
|
+
const attempts = [];
|
|
211
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
212
|
+
const attemptEnv = { ...env, ...connectionEnvironment };
|
|
213
|
+
const [connectivity, credential] = await Promise.all([
|
|
214
|
+
network(run, attemptEnv, gitHttps),
|
|
215
|
+
credentialProbe,
|
|
216
|
+
]);
|
|
217
|
+
checks = {
|
|
218
|
+
credential,
|
|
219
|
+
// curl has its own TLS/proxy configuration; only gh checks can block gh access.
|
|
220
|
+
network: {
|
|
221
|
+
...connectivity,
|
|
222
|
+
status:
|
|
223
|
+
connectivity.status === "failed" ? "warning" : connectivity.status,
|
|
224
|
+
},
|
|
225
|
+
...(credential.status === "failed"
|
|
226
|
+
? skipped("credential_unavailable")
|
|
227
|
+
: await accountChecks(run, attemptEnv, repository)),
|
|
228
|
+
};
|
|
229
|
+
attempts.push({
|
|
230
|
+
route: Object.keys(connectionEnvironment).length
|
|
231
|
+
? "fallback_proxy"
|
|
232
|
+
: "current",
|
|
233
|
+
checks,
|
|
234
|
+
});
|
|
235
|
+
const failures = Object.values(checks).filter(
|
|
236
|
+
(value) => value.status === "failed",
|
|
237
|
+
);
|
|
238
|
+
if (failures.length === 0 || credential.status === "failed") break;
|
|
239
|
+
// Authentication/permission rejection must never cause proxy or account switching.
|
|
240
|
+
if (
|
|
241
|
+
failures.some((value) =>
|
|
242
|
+
[
|
|
243
|
+
"authentication_rejected",
|
|
244
|
+
"access_denied",
|
|
245
|
+
"repository_unavailable",
|
|
246
|
+
"rate_limited",
|
|
247
|
+
"proxy_authentication_rejected",
|
|
248
|
+
].includes(value.error),
|
|
249
|
+
)
|
|
250
|
+
)
|
|
251
|
+
break;
|
|
252
|
+
const connectivityFailure = failures.some(
|
|
253
|
+
(value) =>
|
|
254
|
+
retryable.has(value.error) ||
|
|
255
|
+
["dns_failure", "tls_failure"].includes(value.error),
|
|
256
|
+
);
|
|
257
|
+
if (!connectivityFailure || attempt === 2) break;
|
|
258
|
+
if (fallback && Object.keys(connectionEnvironment).length === 0)
|
|
259
|
+
connectionEnvironment = fallback;
|
|
260
|
+
else if (!failures.every((value) => retryable.has(value.error))) break;
|
|
261
|
+
await new Promise((resolve) => setTimeout(resolve, 1_000));
|
|
262
|
+
}
|
|
263
|
+
const failedCheck = Object.values(checks).find(
|
|
264
|
+
(value) => value.status === "failed",
|
|
265
|
+
);
|
|
266
|
+
const failure =
|
|
267
|
+
checks.credential.status === "failed"
|
|
268
|
+
? "credential_unavailable"
|
|
269
|
+
: retryable.has(failedCheck?.error) ||
|
|
270
|
+
["dns_failure", "tls_failure"].includes(failedCheck?.error)
|
|
271
|
+
? "network_unavailable"
|
|
272
|
+
: (failedCheck?.error ?? null);
|
|
273
|
+
return {
|
|
274
|
+
checks,
|
|
275
|
+
recovery: {
|
|
276
|
+
attempts,
|
|
277
|
+
connectionEnvironment,
|
|
278
|
+
gitTransport: gitHttps ? "https" : "ssh",
|
|
279
|
+
},
|
|
280
|
+
diagnosis: {
|
|
281
|
+
cause: failure,
|
|
282
|
+
guidance:
|
|
283
|
+
failure === "network_unavailable"
|
|
284
|
+
? "GitHub connectivity failed. Credential readability is reported separately; a timeout does not prove missing credentials or a keyring failure. Use a configured working route for both git and gh."
|
|
285
|
+
: failure === "credential_unavailable"
|
|
286
|
+
? "The local credential probe failed. Its error identifies missing credentials versus a read timeout; do not infer either from an API timeout."
|
|
287
|
+
: failure
|
|
288
|
+
? "Inspect the classified failing checks; do not change accounts or request a new token solely because a check timed out."
|
|
289
|
+
: "GitHub checks passed. Apply recovery.connectionEnvironment to subsequent git and gh commands when nonempty; it contains no GitHub token.",
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execFile } from "node:child_process";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { githubAccess } from "./github-access.mjs";
|
|
6
|
+
|
|
7
|
+
// Read-only collection: one failed probe must not suppress unrelated evidence.
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const fallbackIndex = args.indexOf("--fallback-proxy");
|
|
10
|
+
let fallbackProxy;
|
|
11
|
+
if (fallbackIndex >= 0) {
|
|
12
|
+
fallbackProxy = args[fallbackIndex + 1];
|
|
13
|
+
if (!fallbackProxy)
|
|
14
|
+
throw new Error("--fallback-proxy requires an HTTP(S) proxy URL.");
|
|
15
|
+
args.splice(fallbackIndex, 2);
|
|
16
|
+
}
|
|
17
|
+
if (args.length > 1 || args[0]?.startsWith("--"))
|
|
18
|
+
throw new Error("Usage: preflight.mjs [workspace] [--fallback-proxy URL]");
|
|
19
|
+
const cwd = path.resolve(args[0] || process.cwd());
|
|
20
|
+
const env = {
|
|
21
|
+
...process.env,
|
|
22
|
+
GIT_OPTIONAL_LOCKS: "0",
|
|
23
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
24
|
+
GH_PROMPT_DISABLED: "1",
|
|
25
|
+
};
|
|
26
|
+
delete env.GH_DEBUG;
|
|
27
|
+
|
|
28
|
+
function run(file, args, accepted = [0], options = {}) {
|
|
29
|
+
return new Promise((resolve) => {
|
|
30
|
+
execFile(
|
|
31
|
+
file,
|
|
32
|
+
args,
|
|
33
|
+
{ cwd, env, timeout: 20_000, maxBuffer: 1024 * 1024, ...options },
|
|
34
|
+
(error, stdout, stderr) =>
|
|
35
|
+
resolve({
|
|
36
|
+
status: !error || accepted.includes(error.code) ? "ok" : "failed",
|
|
37
|
+
exitCode: error
|
|
38
|
+
? typeof error.code === "number"
|
|
39
|
+
? error.code
|
|
40
|
+
: null
|
|
41
|
+
: 0,
|
|
42
|
+
error:
|
|
43
|
+
error && !accepted.includes(error.code)
|
|
44
|
+
? error.killed
|
|
45
|
+
? "timeout"
|
|
46
|
+
: String(error.code)
|
|
47
|
+
: null,
|
|
48
|
+
stdout: stdout.trimEnd(),
|
|
49
|
+
stderr: stderr.trimEnd(),
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function githubRepository(remote) {
|
|
56
|
+
// Only accept the github.com transport forms supported by this skill.
|
|
57
|
+
const match = remote.match(
|
|
58
|
+
/^(?:https:\/\/github\.com\/|ssh:\/\/git@github\.com\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/i,
|
|
59
|
+
);
|
|
60
|
+
return match ? `github.com/${match[1]}/${match[2]}` : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function privateResult(result) {
|
|
64
|
+
// Never print auth output or raw remotes, which may contain credentials.
|
|
65
|
+
return {
|
|
66
|
+
status: result.status,
|
|
67
|
+
exitCode: result.exitCode,
|
|
68
|
+
error: result.error,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const probes = {
|
|
73
|
+
root: ["rev-parse", "--show-toplevel"],
|
|
74
|
+
head: ["rev-parse", "--verify", "HEAD"],
|
|
75
|
+
branch: ["symbolic-ref", "--quiet", "--short", "HEAD"],
|
|
76
|
+
worktree: ["status", "--porcelain=v1", "--untracked-files=normal"],
|
|
77
|
+
staged: ["diff", "--cached", "--name-status"],
|
|
78
|
+
worktrees: ["worktree", "list", "--porcelain"],
|
|
79
|
+
origin: ["remote", "get-url", "origin"],
|
|
80
|
+
pushOrigin: ["remote", "get-url", "--push", "--all", "origin"],
|
|
81
|
+
preCommitPath: [
|
|
82
|
+
"rev-parse",
|
|
83
|
+
"--path-format=absolute",
|
|
84
|
+
"--git-path",
|
|
85
|
+
"hooks/pre-commit",
|
|
86
|
+
],
|
|
87
|
+
prePushPath: [
|
|
88
|
+
"rev-parse",
|
|
89
|
+
"--path-format=absolute",
|
|
90
|
+
"--git-path",
|
|
91
|
+
"hooks/pre-push",
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
const checks = Object.fromEntries(
|
|
95
|
+
await Promise.all(
|
|
96
|
+
Object.entries(probes).map(async ([name, args]) => [
|
|
97
|
+
name,
|
|
98
|
+
await run("git", args, name === "branch" ? [0, 1] : [0]),
|
|
99
|
+
]),
|
|
100
|
+
),
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const repository =
|
|
104
|
+
checks.origin.status === "ok" ? githubRepository(checks.origin.stdout) : null;
|
|
105
|
+
const gitHttps = checks.origin.stdout.startsWith("https://");
|
|
106
|
+
const pushRepositories =
|
|
107
|
+
checks.pushOrigin.status === "ok"
|
|
108
|
+
? checks.pushOrigin.stdout.split("\n").map(githubRepository)
|
|
109
|
+
: [];
|
|
110
|
+
const remoteMatches =
|
|
111
|
+
repository !== null &&
|
|
112
|
+
pushRepositories.length === 1 &&
|
|
113
|
+
pushRepositories[0]?.toLowerCase() === repository.toLowerCase();
|
|
114
|
+
checks.origin = { ...privateResult(checks.origin), repository };
|
|
115
|
+
checks.pushOrigin = {
|
|
116
|
+
...privateResult(checks.pushOrigin),
|
|
117
|
+
repositories: pushRepositories,
|
|
118
|
+
};
|
|
119
|
+
checks.remote = {
|
|
120
|
+
status: remoteMatches ? "ok" : "failed",
|
|
121
|
+
reason: remoteMatches
|
|
122
|
+
? null
|
|
123
|
+
: "Expected one matching github.com fetch/push repository; inspect origin configuration before publishing.",
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
async function readHook(hookPath) {
|
|
127
|
+
try {
|
|
128
|
+
return {
|
|
129
|
+
status: "ok",
|
|
130
|
+
path: hookPath,
|
|
131
|
+
content: await readFile(hookPath, "utf8"),
|
|
132
|
+
};
|
|
133
|
+
} catch (error) {
|
|
134
|
+
return {
|
|
135
|
+
status: error.code === "ENOENT" ? "absent" : "failed",
|
|
136
|
+
path: hookPath,
|
|
137
|
+
error: error.code,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Hooks and Git state are collected even if GitHub credentials are unusable.
|
|
143
|
+
const hookPaths = [checks.preCommitPath, checks.prePushPath]
|
|
144
|
+
.filter((result) => result.status === "ok")
|
|
145
|
+
.map((result) => result.stdout);
|
|
146
|
+
if (checks.root.status === "ok") {
|
|
147
|
+
hookPaths.push(
|
|
148
|
+
...["pre-commit", "pre-push"].map((name) =>
|
|
149
|
+
path.join(checks.root.stdout, ".husky", name),
|
|
150
|
+
),
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
const hooksPromise = Promise.all([...new Set(hookPaths)].map(readHook));
|
|
154
|
+
|
|
155
|
+
let github;
|
|
156
|
+
if (repository) {
|
|
157
|
+
github = await githubAccess(run, env, repository, fallbackProxy, gitHttps);
|
|
158
|
+
Object.assign(checks, github.checks);
|
|
159
|
+
} else {
|
|
160
|
+
for (const name of ["auth", "account", "repositoryAccess"]) {
|
|
161
|
+
checks[name] = {
|
|
162
|
+
status: "skipped",
|
|
163
|
+
reason: "No supported origin repository",
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const hooks = await hooksPromise;
|
|
169
|
+
const failedChecks = Object.entries(checks)
|
|
170
|
+
.filter(([, result]) => result.status === "failed")
|
|
171
|
+
.map(([name]) => name);
|
|
172
|
+
const passed =
|
|
173
|
+
failedChecks.length === 0 && hooks.every((hook) => hook.status !== "failed");
|
|
174
|
+
console.log(
|
|
175
|
+
JSON.stringify(
|
|
176
|
+
{
|
|
177
|
+
cwd,
|
|
178
|
+
passed,
|
|
179
|
+
failedChecks,
|
|
180
|
+
checks,
|
|
181
|
+
...(github
|
|
182
|
+
? { diagnosis: github.diagnosis, recovery: github.recovery }
|
|
183
|
+
: {}),
|
|
184
|
+
hooks,
|
|
185
|
+
note: "Read-only snapshot, not permission to stage, push or merge. Recheck state before mutations; repository read access does not prove push permission.",
|
|
186
|
+
},
|
|
187
|
+
null,
|
|
188
|
+
2,
|
|
189
|
+
),
|
|
190
|
+
);
|
|
191
|
+
process.exitCode = passed ? 0 : 1;
|