@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,578 @@
|
|
|
1
|
+
/* global module, process, require, Buffer */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
3
|
+
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const os = require("node:os");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
const STOP_EVENTS = new Set(["stop"]);
|
|
9
|
+
const COMPLETION_REASONS = new Set([
|
|
10
|
+
"hook_stop",
|
|
11
|
+
"notify",
|
|
12
|
+
"ai_process_exit",
|
|
13
|
+
"manual",
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
function parseTmuxSocketPath(value) {
|
|
17
|
+
if (!value) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const socketPath = String(value).split(",")[0]?.trim();
|
|
21
|
+
return socketPath || null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getCommandBasename(command) {
|
|
25
|
+
const normalized = String(command || "")
|
|
26
|
+
.trim()
|
|
27
|
+
.replace(/\\+/g, "/");
|
|
28
|
+
if (!normalized) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const basename = normalized.split("/").filter(Boolean).at(-1) || normalized;
|
|
32
|
+
return basename || null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function isNestedCodexProcess(spawnSync) {
|
|
36
|
+
// A nested CLI inherits terminal/pane identity. Its hook still belongs to
|
|
37
|
+
// the child CLI, even when tmux reports the parent as the foreground command.
|
|
38
|
+
const result = spawnSync("ps", ["-ww", "-axo", "pid=,ppid=,args="], {
|
|
39
|
+
encoding: "utf8",
|
|
40
|
+
timeout: 1000,
|
|
41
|
+
maxBuffer: 2 * 1024 * 1024,
|
|
42
|
+
});
|
|
43
|
+
// Reject only proven nesting; an unavailable process snapshot must not
|
|
44
|
+
// disable normal hooks or shared-daemon hooks with a different ancestry.
|
|
45
|
+
if (result.error || result.status !== 0) return false;
|
|
46
|
+
const processes = new Map();
|
|
47
|
+
for (const line of String(result.stdout || "").split(/\r?\n/)) {
|
|
48
|
+
const match = line.match(/^\s*(\d+)\s+(\d+)\s+(\S+)(?:\s+(.*?))?\s*$/);
|
|
49
|
+
if (match) {
|
|
50
|
+
processes.set(Number(match[1]), {
|
|
51
|
+
parent: Number(match[2]),
|
|
52
|
+
command: getCommandBasename(match[3]),
|
|
53
|
+
// Shared app-server and its daemon supervisor both use the codex
|
|
54
|
+
// executable. Neither is a parent CLI that owns this terminal.
|
|
55
|
+
appServer: /^app-server(?:\s|$)/.test(match[4] || ""),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
let codexCount = 0;
|
|
60
|
+
const visited = new Set();
|
|
61
|
+
for (let pid = process.ppid; pid > 1 && !visited.has(pid); ) {
|
|
62
|
+
visited.add(pid);
|
|
63
|
+
const entry = processes.get(pid);
|
|
64
|
+
if (!entry) break;
|
|
65
|
+
if (entry.command === "codex" && !entry.appServer && ++codexCount > 1) return true;
|
|
66
|
+
pid = entry.parent;
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function readTmuxPaneContext(spawnSync) {
|
|
72
|
+
const socketPath = parseTmuxSocketPath(process.env.TMUX);
|
|
73
|
+
const tmuxPaneId = process.env.TMUX_PANE;
|
|
74
|
+
if (!socketPath || !tmuxPaneId) {
|
|
75
|
+
return {
|
|
76
|
+
commandName: null,
|
|
77
|
+
panelId: null,
|
|
78
|
+
resolved: false,
|
|
79
|
+
reason: "missing_tmux_context",
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const separator = "__RUNWEAVE_METADATA_FIELD__";
|
|
83
|
+
let result;
|
|
84
|
+
let attempts = 0;
|
|
85
|
+
while (attempts < 2) {
|
|
86
|
+
attempts += 1;
|
|
87
|
+
result = spawnSync(
|
|
88
|
+
process.env.RUNWEAVE_RUNTIME_TMUX_BINARY || "tmux",
|
|
89
|
+
[
|
|
90
|
+
"-S",
|
|
91
|
+
socketPath,
|
|
92
|
+
"display-message",
|
|
93
|
+
"-p",
|
|
94
|
+
"-t",
|
|
95
|
+
tmuxPaneId,
|
|
96
|
+
[
|
|
97
|
+
"#{@runweave_agent_prepare_command}",
|
|
98
|
+
"#{@runweave_agent_prepare_exit}",
|
|
99
|
+
"#{@runweave_command}",
|
|
100
|
+
"#{pane_current_command}",
|
|
101
|
+
"#{@runweave_panel_id}",
|
|
102
|
+
].join(separator),
|
|
103
|
+
],
|
|
104
|
+
{
|
|
105
|
+
encoding: "utf8",
|
|
106
|
+
timeout: 1000,
|
|
107
|
+
maxBuffer: 32 * 1024,
|
|
108
|
+
},
|
|
109
|
+
);
|
|
110
|
+
if (!result.error && result.status === 0) {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (!result || result.error || result.status !== 0) {
|
|
115
|
+
return {
|
|
116
|
+
commandName: null,
|
|
117
|
+
panelId: null,
|
|
118
|
+
resolved: false,
|
|
119
|
+
reason: "tmux_display_message_failed",
|
|
120
|
+
attempts,
|
|
121
|
+
status: result?.status ?? null,
|
|
122
|
+
error: result?.error instanceof Error ? result.error.message : null,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const [
|
|
126
|
+
agentPrepareCommand = "",
|
|
127
|
+
agentPrepareExit = "",
|
|
128
|
+
runweaveCommand = "",
|
|
129
|
+
paneCommand = "",
|
|
130
|
+
panelId = "",
|
|
131
|
+
] = String(result.stdout || "")
|
|
132
|
+
.replace(/\r?\n$/, "")
|
|
133
|
+
.split(separator);
|
|
134
|
+
const normalizedPaneCommand = getCommandBasename(paneCommand);
|
|
135
|
+
const paneAtInteractivePrompt = ["bash", "fish", "sh", "zsh"].includes(
|
|
136
|
+
normalizedPaneCommand,
|
|
137
|
+
);
|
|
138
|
+
const pendingAgentCommand =
|
|
139
|
+
agentPrepareExit.startsWith("pending:") &&
|
|
140
|
+
(Boolean(runweaveCommand.trim()) || !paneAtInteractivePrompt)
|
|
141
|
+
? getCommandBasename(agentPrepareCommand)
|
|
142
|
+
: null;
|
|
143
|
+
return {
|
|
144
|
+
commandName:
|
|
145
|
+
pendingAgentCommand ||
|
|
146
|
+
getCommandBasename(runweaveCommand) ||
|
|
147
|
+
getCommandBasename(paneCommand),
|
|
148
|
+
panelId: panelId.trim() || null,
|
|
149
|
+
resolved: true,
|
|
150
|
+
reason: null,
|
|
151
|
+
attempts,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function normalizeSummaryText(value) {
|
|
156
|
+
if (typeof value !== "string") {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
const trimmed = value.trim();
|
|
160
|
+
if (!trimmed) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
return trimmed.length > 8000
|
|
164
|
+
? `${trimmed.slice(0, 8000)}\n...[truncated]`
|
|
165
|
+
: trimmed;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function extractCompletionSummary(payload) {
|
|
169
|
+
const directKeys = [
|
|
170
|
+
"last_assistant_message",
|
|
171
|
+
"lastAssistantMessage",
|
|
172
|
+
"last_agent_message",
|
|
173
|
+
"assistant_message",
|
|
174
|
+
"assistantMessage",
|
|
175
|
+
];
|
|
176
|
+
for (const key of directKeys) {
|
|
177
|
+
const normalized = normalizeSummaryText(payload?.[key]);
|
|
178
|
+
if (normalized) {
|
|
179
|
+
return normalized;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const fromTranscript = readTranscriptReply(payload);
|
|
183
|
+
if (fromTranscript) return fromTranscript;
|
|
184
|
+
for (const key of [
|
|
185
|
+
"summary",
|
|
186
|
+
"message",
|
|
187
|
+
"last_message",
|
|
188
|
+
"lastMessage",
|
|
189
|
+
"response",
|
|
190
|
+
"output",
|
|
191
|
+
"text",
|
|
192
|
+
"content",
|
|
193
|
+
"body",
|
|
194
|
+
]) {
|
|
195
|
+
const normalized = normalizeSummaryText(payload?.[key]);
|
|
196
|
+
if (normalized) return normalized;
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function readTranscriptReply(payload) {
|
|
202
|
+
if (Array.isArray(payload?.transcript))
|
|
203
|
+
return lastAssistantReply(payload.transcript);
|
|
204
|
+
const sessionId = readThreadId(payload);
|
|
205
|
+
const candidates = [payload?.transcript_path];
|
|
206
|
+
if (sessionId && /^[A-Za-z0-9_-]+$/.test(sessionId)) {
|
|
207
|
+
candidates.push(
|
|
208
|
+
path.join(
|
|
209
|
+
os.homedir(),
|
|
210
|
+
"Library/Caches/coco/sessions",
|
|
211
|
+
sessionId,
|
|
212
|
+
"events.jsonl",
|
|
213
|
+
),
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
for (const candidate of candidates) {
|
|
217
|
+
if (typeof candidate !== "string" || !candidate) continue;
|
|
218
|
+
let descriptor;
|
|
219
|
+
try {
|
|
220
|
+
descriptor = fs.openSync(candidate, "r");
|
|
221
|
+
const stat = fs.fstatSync(descriptor);
|
|
222
|
+
if (!stat.isFile()) continue;
|
|
223
|
+
// Bound hook work even for very long conversations and tool output.
|
|
224
|
+
const start = Math.max(0, stat.size - 1024 * 1024);
|
|
225
|
+
const buffer = Buffer.alloc(stat.size - start);
|
|
226
|
+
const bytes = fs.readSync(descriptor, buffer, 0, buffer.length, start);
|
|
227
|
+
const tail = buffer.subarray(0, bytes).toString("utf8");
|
|
228
|
+
const lines = (start ? tail.slice(tail.indexOf("\n") + 1) : tail).split(
|
|
229
|
+
/\r?\n/,
|
|
230
|
+
);
|
|
231
|
+
const records = lines.flatMap((line) => {
|
|
232
|
+
try {
|
|
233
|
+
return [JSON.parse(line)];
|
|
234
|
+
} catch {
|
|
235
|
+
return [];
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
return lastAssistantReply(records);
|
|
239
|
+
} catch {
|
|
240
|
+
// A missing transcript must not prevent completion reporting.
|
|
241
|
+
} finally {
|
|
242
|
+
if (descriptor !== undefined) fs.closeSync(descriptor);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function lastAssistantReply(records) {
|
|
249
|
+
for (let index = records.length - 1; index >= 0; index -= 1) {
|
|
250
|
+
const record = records[index];
|
|
251
|
+
if (record?.type === "event_msg") {
|
|
252
|
+
if (record.payload?.type === "task_complete") {
|
|
253
|
+
const completed = normalizeSummaryText(
|
|
254
|
+
record.payload.last_agent_message,
|
|
255
|
+
);
|
|
256
|
+
if (completed) return completed;
|
|
257
|
+
}
|
|
258
|
+
if (record.payload?.type === "task_started") return null;
|
|
259
|
+
}
|
|
260
|
+
const item =
|
|
261
|
+
record?.type === "response_item"
|
|
262
|
+
? record.payload
|
|
263
|
+
: (record?.message?.message ??
|
|
264
|
+
(typeof record?.message === "object" ? record.message : record));
|
|
265
|
+
const role = item?.role ?? item?.type;
|
|
266
|
+
if (role === "user") return null;
|
|
267
|
+
if (role !== "assistant" && role !== "agent") continue;
|
|
268
|
+
if (item.phase && item.phase !== "final_answer") continue;
|
|
269
|
+
const content = Array.isArray(item.content)
|
|
270
|
+
? item.content
|
|
271
|
+
.filter((part) => part.type === "text" || part.type === "output_text")
|
|
272
|
+
.map((part) => part.text ?? "")
|
|
273
|
+
.join("\n")
|
|
274
|
+
: (item.content ?? item.text ?? item.message);
|
|
275
|
+
const normalized = normalizeSummaryText(content);
|
|
276
|
+
if (normalized) return normalized;
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function extractUserPrompt(payload) {
|
|
282
|
+
for (const key of [
|
|
283
|
+
"prompt",
|
|
284
|
+
"query",
|
|
285
|
+
"user_prompt",
|
|
286
|
+
"userPrompt",
|
|
287
|
+
"message",
|
|
288
|
+
]) {
|
|
289
|
+
const normalized = normalizeSummaryText(payload?.[key]);
|
|
290
|
+
if (normalized) return normalized.slice(0, 8000);
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function extractToolHook(payload) {
|
|
296
|
+
const toolUseId =
|
|
297
|
+
payload?.tool_use_id ?? payload?.toolUseId ?? payload?.tool_call_id;
|
|
298
|
+
const toolName = payload?.tool_name ?? payload?.toolName ?? payload?.name;
|
|
299
|
+
const toolResult = payload?.tool_response ?? payload?.tool_result ?? payload?.output;
|
|
300
|
+
// Read provider metadata only. Text output (including JSON-looking text) is
|
|
301
|
+
// untrusted tool content and cannot establish execution success or failure.
|
|
302
|
+
const exitCode = payload?.exit_code ?? toolResult?.exit_code;
|
|
303
|
+
const isError = payload?.is_error ?? toolResult?.is_error;
|
|
304
|
+
const toolExecution = {
|
|
305
|
+
...(Number.isSafeInteger(exitCode) ? { exitCode } : {}),
|
|
306
|
+
...(typeof isError === "boolean" ? { isError } : {}),
|
|
307
|
+
};
|
|
308
|
+
return {
|
|
309
|
+
toolUseId:
|
|
310
|
+
typeof toolUseId === "string" && toolUseId.trim()
|
|
311
|
+
? toolUseId.trim()
|
|
312
|
+
: null,
|
|
313
|
+
toolName:
|
|
314
|
+
typeof toolName === "string" && toolName.trim() ? toolName.trim() : null,
|
|
315
|
+
toolInput: payload?.tool_input ?? payload?.input,
|
|
316
|
+
toolResult,
|
|
317
|
+
...(Object.keys(toolExecution).length ? { toolExecution } : {}),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function parseArgs(argv) {
|
|
322
|
+
const args = { source: "unknown", reason: "hook_stop", commandName: null };
|
|
323
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
324
|
+
if (argv[index] === "--source" && argv[index + 1]) {
|
|
325
|
+
args.source = argv[index + 1];
|
|
326
|
+
index += 1;
|
|
327
|
+
} else if (argv[index] === "--reason" && argv[index + 1]) {
|
|
328
|
+
args.reason = argv[index + 1];
|
|
329
|
+
index += 1;
|
|
330
|
+
} else if (argv[index] === "--command-name" && argv[index + 1]) {
|
|
331
|
+
args.commandName = argv[index + 1];
|
|
332
|
+
index += 1;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return args;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function parsePayload(raw) {
|
|
339
|
+
if (!raw.trim()) {
|
|
340
|
+
return {};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
try {
|
|
344
|
+
const parsed = JSON.parse(raw);
|
|
345
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
346
|
+
} catch {
|
|
347
|
+
return {};
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function readHookEvent(payload) {
|
|
352
|
+
return (
|
|
353
|
+
payload.hook_event_name ??
|
|
354
|
+
payload.hookEventName ??
|
|
355
|
+
payload.eventName ??
|
|
356
|
+
payload.event ??
|
|
357
|
+
"Unknown"
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function readNotificationType(payload) {
|
|
362
|
+
const raw = payload.notification_type ?? payload.notificationType;
|
|
363
|
+
return typeof raw === "string" && raw.trim()
|
|
364
|
+
? raw.trim().toLowerCase()
|
|
365
|
+
: null;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function isFeishuAttentionHook(payload, source) {
|
|
369
|
+
const event = normalizeEventName(readHookEvent(payload));
|
|
370
|
+
return (event === "notification" && ["permission_prompt", "idle_prompt"].includes(readNotificationType(payload))) ||
|
|
371
|
+
(toAgentHookStateEvent(event) === "ToolRequested" &&
|
|
372
|
+
["request_user_input", "functions.request_user_input", "AskUserQuestion"].includes(extractToolHook(payload).toolName)) ||
|
|
373
|
+
(source === "pi" && payload.pi?.event === "ui_prompt_start");
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function readThreadId(payload) {
|
|
377
|
+
const raw =
|
|
378
|
+
payload.threadId ??
|
|
379
|
+
payload.thread_id ??
|
|
380
|
+
payload.sessionId ??
|
|
381
|
+
payload.session_id;
|
|
382
|
+
return typeof raw === "string" && raw.trim() ? raw.trim() : null;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function normalizeEventName(raw) {
|
|
386
|
+
return String(raw || "Unknown")
|
|
387
|
+
.trim()
|
|
388
|
+
.toLowerCase()
|
|
389
|
+
.replace(/[-\s]+/g, "_");
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function normalizeSource(raw) {
|
|
393
|
+
const source = String(raw || "unknown")
|
|
394
|
+
.trim()
|
|
395
|
+
.toLowerCase();
|
|
396
|
+
if (
|
|
397
|
+
source === "claude" ||
|
|
398
|
+
source === "codex" ||
|
|
399
|
+
source === "trae" ||
|
|
400
|
+
source === "traecli" ||
|
|
401
|
+
source === "pi" || source === "traex"
|
|
402
|
+
) {
|
|
403
|
+
return source;
|
|
404
|
+
}
|
|
405
|
+
return "unknown";
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function normalizeReason(raw) {
|
|
409
|
+
const reason = String(raw || "hook_stop")
|
|
410
|
+
.trim()
|
|
411
|
+
.toLowerCase();
|
|
412
|
+
return COMPLETION_REASONS.has(reason) ? reason : "hook_stop";
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function deriveCompletionEndpoint(endpoint) {
|
|
416
|
+
if (!endpoint) {
|
|
417
|
+
return undefined;
|
|
418
|
+
}
|
|
419
|
+
return endpoint.replace(
|
|
420
|
+
/\/internal\/terminal\/agent-hook\/?$/,
|
|
421
|
+
"/internal/terminal-completion",
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function deriveAgentHookEndpoint(endpoint) {
|
|
426
|
+
if (!endpoint) {
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
429
|
+
return endpoint.replace(
|
|
430
|
+
/\/internal\/terminal-completion\/?$/,
|
|
431
|
+
"/internal/terminal/agent-hook",
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function toAgentHookStateEvent(normalizedEvent) {
|
|
436
|
+
if (normalizedEvent === "agentmetadata") return "AgentMetadata";
|
|
437
|
+
if (
|
|
438
|
+
normalizedEvent === "sessionstart" ||
|
|
439
|
+
normalizedEvent === "session_start"
|
|
440
|
+
) {
|
|
441
|
+
return "SessionStart";
|
|
442
|
+
}
|
|
443
|
+
if (
|
|
444
|
+
normalizedEvent === "userpromptsubmit" ||
|
|
445
|
+
normalizedEvent === "user_prompt_submit"
|
|
446
|
+
) {
|
|
447
|
+
return "UserPromptSubmit";
|
|
448
|
+
}
|
|
449
|
+
if (STOP_EVENTS.has(normalizedEvent)) {
|
|
450
|
+
return "Stop";
|
|
451
|
+
}
|
|
452
|
+
if (normalizedEvent === "pretooluse" || normalizedEvent === "pre_tool_use") {
|
|
453
|
+
return "ToolRequested";
|
|
454
|
+
}
|
|
455
|
+
if (
|
|
456
|
+
normalizedEvent === "posttooluse" ||
|
|
457
|
+
normalizedEvent === "post_tool_use"
|
|
458
|
+
) {
|
|
459
|
+
return "ToolCompleted";
|
|
460
|
+
}
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function buildCompletionHookBody({
|
|
465
|
+
terminalSessionId,
|
|
466
|
+
payload,
|
|
467
|
+
source,
|
|
468
|
+
completionReason,
|
|
469
|
+
rawEvent,
|
|
470
|
+
commandName,
|
|
471
|
+
}) {
|
|
472
|
+
return {
|
|
473
|
+
terminalSessionId,
|
|
474
|
+
source,
|
|
475
|
+
...(payload.feishuNotificationOnly ? { feishuNotificationOnly: true } : {}),
|
|
476
|
+
...(source === "pi" && payload.pi ? { pi: payload.pi } : {}),
|
|
477
|
+
completionReason,
|
|
478
|
+
commandName: commandName || null,
|
|
479
|
+
rawHookEvent: String(rawEvent || "Stop"),
|
|
480
|
+
hookEvent: String(rawEvent || "Stop"),
|
|
481
|
+
summary: extractCompletionSummary(payload),
|
|
482
|
+
threadId: readThreadId(payload),
|
|
483
|
+
operationId: process.env.RUNWEAVE_TERMINAL_AGENT_OPERATION_ID || null,
|
|
484
|
+
panelId: process.env.RUNWEAVE_TERMINAL_PANEL_ID || null,
|
|
485
|
+
tmuxPaneId: process.env.TMUX_PANE || null,
|
|
486
|
+
cwd:
|
|
487
|
+
typeof payload.cwd === "string" && payload.cwd.trim()
|
|
488
|
+
? payload.cwd
|
|
489
|
+
: process.env.PWD || null,
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
function buildAppServerBaseEvent({
|
|
494
|
+
kind,
|
|
495
|
+
payload,
|
|
496
|
+
rawEvent,
|
|
497
|
+
normalizedEvent,
|
|
498
|
+
stateHookEvent,
|
|
499
|
+
source,
|
|
500
|
+
terminalSessionId,
|
|
501
|
+
threadId,
|
|
502
|
+
commandName,
|
|
503
|
+
dedupePrefix,
|
|
504
|
+
}) {
|
|
505
|
+
const terminalPanelId = process.env.RUNWEAVE_TERMINAL_PANEL_ID || null;
|
|
506
|
+
const tmuxPaneId = process.env.TMUX_PANE || null;
|
|
507
|
+
return {
|
|
508
|
+
kind,
|
|
509
|
+
source: {
|
|
510
|
+
app: "hook",
|
|
511
|
+
instanceId: `${source}:${terminalSessionId}`,
|
|
512
|
+
pid: process.pid,
|
|
513
|
+
},
|
|
514
|
+
scope: {
|
|
515
|
+
projectId: process.env.RUNWEAVE_PROJECT_ID || null,
|
|
516
|
+
terminalSessionId,
|
|
517
|
+
terminalPanelId,
|
|
518
|
+
terminalTmuxPaneId: tmuxPaneId,
|
|
519
|
+
cwd:
|
|
520
|
+
typeof payload.cwd === "string" && payload.cwd.trim()
|
|
521
|
+
? payload.cwd
|
|
522
|
+
: process.env.PWD || null,
|
|
523
|
+
},
|
|
524
|
+
dedupeKey: payload.pi ? `${dedupePrefix}:pi:${payload.pi.instanceId}:${payload.pi.sequence}` : `${dedupePrefix}:${source}:${terminalSessionId}:${String(
|
|
525
|
+
rawEvent || "Unknown",
|
|
526
|
+
)}:${threadId || "no-thread"}:${Date.now()}`,
|
|
527
|
+
correlationId: threadId,
|
|
528
|
+
payload: {
|
|
529
|
+
source,
|
|
530
|
+
...(source === "pi" && payload.pi ? { pi: payload.pi } : {}),
|
|
531
|
+
threadId,
|
|
532
|
+
rawHookEvent: String(rawEvent || "Unknown"),
|
|
533
|
+
normalizedEvent,
|
|
534
|
+
stateHookEvent,
|
|
535
|
+
activityEventId: payload.runweaveHookEventId,
|
|
536
|
+
...(stateHookEvent === "UserPromptSubmit" ? { query: extractUserPrompt(payload) } : {}),
|
|
537
|
+
panelId: terminalPanelId,
|
|
538
|
+
tmuxPaneId,
|
|
539
|
+
commandName: commandName || null,
|
|
540
|
+
operationId: process.env.RUNWEAVE_TERMINAL_AGENT_OPERATION_ID || null,
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
module.exports = {
|
|
546
|
+
isNestedCodexProcess,
|
|
547
|
+
isFeishuAttentionHook,
|
|
548
|
+
STOP_EVENTS,
|
|
549
|
+
buildAppServerBaseEvent,
|
|
550
|
+
buildCompletionHookBody,
|
|
551
|
+
deriveAgentHookEndpoint,
|
|
552
|
+
deriveCompletionEndpoint,
|
|
553
|
+
extractCompletionSummary,
|
|
554
|
+
extractToolHook,
|
|
555
|
+
extractUserPrompt,
|
|
556
|
+
normalizeEventName,
|
|
557
|
+
normalizeReason,
|
|
558
|
+
normalizeSource,
|
|
559
|
+
parseTmuxSocketPath,
|
|
560
|
+
parseArgs,
|
|
561
|
+
parsePayload,
|
|
562
|
+
readHookEvent,
|
|
563
|
+
readNotificationType,
|
|
564
|
+
readTmuxPaneContext,
|
|
565
|
+
readThreadId,
|
|
566
|
+
toAgentHookStateEvent,
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
// The standalone Feishu script uses the same extractor as the completion hook.
|
|
570
|
+
if (require.main === module) {
|
|
571
|
+
try {
|
|
572
|
+
process.stdout.write(
|
|
573
|
+
extractCompletionSummary(JSON.parse(fs.readFileSync(0, "utf8"))) ?? "",
|
|
574
|
+
);
|
|
575
|
+
} catch {
|
|
576
|
+
process.exitCode = 0;
|
|
577
|
+
}
|
|
578
|
+
}
|