@weavecode/weave 0.1.5 → 0.1.7
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/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/encodeurl/README.md +14 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/encodeurl/index.js +5 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/encodeurl/package.json +10 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/qs/CHANGELOG.md +42 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/qs/README.md +38 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/qs/dist/qs.js +18 -18
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/qs/lib/parse.js +16 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/qs/lib/utils.js +13 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express/node_modules/qs/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/dist/index.cjs +6 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/dist/index.mjs +6 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/package.json +10 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/decrypt.d.ts +3 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/verify.d.ts +3 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/types.d.ts +8 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@weavecode/cli/dist/cli.js +4 -4
- package/node_modules/@weavecode/cli/dist/commands/chpass.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/daemon-auth.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/daemon.d.ts +2 -0
- package/node_modules/@weavecode/cli/dist/commands/daemon.js +2 -2
- package/node_modules/@weavecode/cli/dist/commands/dashboard.js +2 -2
- package/node_modules/@weavecode/cli/dist/commands/doctor.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/init.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/msg.js +2 -2
- package/node_modules/@weavecode/cli/dist/commands/scan.js +1 -1
- package/node_modules/@weavecode/cli/dist/commands/status.js +2 -2
- package/node_modules/@weavecode/cli/dist/commands/uninstall.js +1 -1
- package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +5 -5
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +6 -1
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +5 -5
- package/node_modules/@weavecode/cli/dist/i18n/index.js +1 -1
- package/node_modules/@weavecode/cli/dist/i18n/t.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +3 -3
- package/node_modules/@weavecode/cli/dist/init/executor.js +3 -3
- package/node_modules/@weavecode/cli/dist/init/git-commit.js +2 -2
- package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
- package/node_modules/@weavecode/cli/dist/init/harnesses/codex.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/instruction-link.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/plugin-templates.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/prompt.js +4 -4
- package/node_modules/@weavecode/cli/dist/init/provision.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/uninstall.js +6 -6
- package/node_modules/@weavecode/cli/dist/init/wiring.js +1 -1
- package/node_modules/@weavecode/cli/dist/parser.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/mock-input.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/preview.js +2 -2
- package/node_modules/@weavecode/cli/package.json +5 -5
- package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
- package/node_modules/@weavecode/core/dist/harness.d.ts +25 -0
- package/node_modules/@weavecode/core/dist/harness.js +1 -1
- package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
- package/node_modules/@weavecode/core/dist/index.js +1 -1
- package/node_modules/@weavecode/core/dist/platform.js +1 -1
- package/node_modules/@weavecode/core/dist/types.js +1 -1
- package/node_modules/@weavecode/core/dist/utils/fs.js +1 -1
- package/node_modules/@weavecode/core/dist/utils/logger.js +1 -1
- package/node_modules/@weavecode/core/package.json +1 -1
- package/node_modules/@weavecode/harness/dist/claude/assets.js +4 -4
- package/node_modules/@weavecode/harness/dist/claude/capture.js +9 -9
- package/node_modules/@weavecode/harness/dist/claude/commands.d.ts +3 -0
- package/node_modules/@weavecode/harness/dist/claude/commands.js +2 -3
- package/node_modules/@weavecode/harness/dist/claude/config.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/edits.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/images.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/index.d.ts +1 -0
- package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/liveness.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/messaging.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/narration.d.ts +0 -11
- package/node_modules/@weavecode/harness/dist/claude/narration.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/plan.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/plugins.js +4 -4
- package/node_modules/@weavecode/harness/dist/claude/prompt-inbox.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/prompt.js +3 -3
- package/node_modules/@weavecode/harness/dist/claude/questions.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/resume.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/rewind.d.ts +8 -0
- package/node_modules/@weavecode/harness/dist/claude/rewind.js +1 -0
- package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/side-question.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/statusline/generator.js +36 -15
- package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.js +1 -1
- package/node_modules/@weavecode/harness/dist/claude/statusline/surface.js +2 -2
- package/node_modules/@weavecode/harness/dist/claude/transcript-cursor.d.ts +26 -0
- package/node_modules/@weavecode/harness/dist/claude/transcript-cursor.js +2 -0
- package/node_modules/@weavecode/harness/dist/claude/transcript.js +7 -7
- package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/capture.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/commands.js +4 -4
- package/node_modules/@weavecode/harness/dist/codex/config.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/event-source.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/images.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/index.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/liveness.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/mcp.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/messaging.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/narration.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/plugins.js +3 -3
- package/node_modules/@weavecode/harness/dist/codex/provision.js +1 -1
- package/node_modules/@weavecode/harness/dist/codex/questions.js +2 -2
- package/node_modules/@weavecode/harness/dist/codex/rollout.js +5 -5
- package/node_modules/@weavecode/harness/dist/codex/side-question.js +4 -4
- package/node_modules/@weavecode/harness/dist/codex/titles.js +4 -4
- package/node_modules/@weavecode/harness/dist/codex/toml.js +13 -13
- package/node_modules/@weavecode/harness/dist/codex/transcript.js +2 -2
- package/node_modules/@weavecode/harness/dist/driver.d.ts +56 -1
- package/node_modules/@weavecode/harness/dist/driver.js +1 -1
- package/node_modules/@weavecode/harness/dist/init/generated.js +2 -2
- package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -1
- package/node_modules/@weavecode/harness/dist/registry-wiring.js +1 -1
- package/node_modules/@weavecode/harness/dist/shared/install-link.js +1 -1
- package/node_modules/@weavecode/harness/dist/shared/json-cap.js +1 -1
- package/node_modules/@weavecode/harness/package.json +2 -2
- package/node_modules/@weavecode/server/dist/config/profiles.d.ts +19 -13
- package/node_modules/@weavecode/server/dist/config/profiles.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/config-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/entry.js +7 -1
- package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/launch.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener.d.ts +2 -0
- package/node_modules/@weavecode/server/dist/daemon/opener.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/session-control.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/session-insights.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/uploads.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.d.ts +3 -0
- package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.js +1 -0
- package/node_modules/@weavecode/server/dist/daemon/server.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/session-open.d.ts +17 -0
- package/node_modules/@weavecode/server/dist/daemon/session-open.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/session-probe.d.ts +5 -4
- package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
- package/node_modules/@weavecode/server/dist/db/db.js +6 -2
- package/node_modules/@weavecode/server/dist/hooks/bus.d.ts +3 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/ack-gate.d.ts +12 -6
- package/node_modules/@weavecode/server/dist/hooks/delivery/ack-gate.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/channels.d.ts +3 -3
- package/node_modules/@weavecode/server/dist/hooks/delivery/channels.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/keys.d.ts +19 -9
- package/node_modules/@weavecode/server/dist/hooks/delivery/keys.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/relay.d.ts +2 -2
- package/node_modules/@weavecode/server/dist/hooks/delivery/relay.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/views.d.ts +5 -1
- package/node_modules/@weavecode/server/dist/hooks/delivery/views.js +1 -1
- package/node_modules/@weavecode/server/dist/hooks/message-deliverer.d.ts +45 -38
- package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +5 -3
- package/node_modules/@weavecode/server/dist/repositories/hook-events.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/repositories/hook-events.js +4 -4
- package/node_modules/@weavecode/server/dist/repositories/sessions.d.ts +11 -1
- package/node_modules/@weavecode/server/dist/repositories/sessions.js +4 -2
- package/node_modules/@weavecode/server/dist/repositories/uploads.d.ts +14 -4
- package/node_modules/@weavecode/server/dist/repositories/uploads.js +11 -11
- package/node_modules/@weavecode/server/dist/surfaces.d.ts +3 -1
- package/node_modules/@weavecode/server/dist/surfaces.js +1 -1
- package/node_modules/@weavecode/server/package.json +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/{abnfDiagram-WEYOIA3C-C-f9WfD3.js → abnfDiagram-WEYOIA3C-DDeQkTf5.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{arc-D62qulAD.js → arc-CRZTRyjb.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{architectureDiagram-ZHVYKT53-B6ZJRpcL.js → architectureDiagram-ZHVYKT53-Dj54DE3O.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{blockDiagram-RJAE7QA3-DOtDFeiT.js → blockDiagram-RJAE7QA3-BIH8mSIZ.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{c4Diagram-XDPPPE54-DWn3ng8X.js → c4Diagram-XDPPPE54-5YoKWFOD.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/channel-5VM93AJ8.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2E7WHVMD-B5IIc9cn.js → chunk-2E7WHVMD-B653kMXt.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2Q5K7J3B-BUU9Zvt8.js → chunk-2Q5K7J3B-f_A4_eDz.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-4EMNKR2T-CqEGIghP.js → chunk-4EMNKR2T-v5j5qNGj.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-55XCU76K-D36o_E2b.js → chunk-55XCU76K-CgEqeP7j.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-5VM5RSS4-sxws8ERh.js → chunk-5VM5RSS4-BeROhLXN.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-JWPE2WC7-CJo_rEEb.js → chunk-JWPE2WC7-D6dXb_jr.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-VQ5W62QI-9UlLCpsb.js → chunk-VQ5W62QI-CnHdSEMi.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-XXDRQBXY-CX9CPbWb.js → chunk-XXDRQBXY-BkG_e6PE.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-ZCHMQSOR-DwEfdZcF.js → chunk-ZCHMQSOR-DxR-fxzs.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{classDiagram-v2-4MYWR3UA-CFCmIyt8.js → classDiagram-v2-4MYWR3UA-DQe1b_k8.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{cose-bilkent-JH36ORCC-qWXeXJTn.js → cose-bilkent-JH36ORCC-DThrA8S5.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{cynefin-EF2NZ3EQ-CXabWQxz.js → cynefin-EF2NZ3EQ-OZotFKUu.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{cynefinDiagram-WF24UDRP-Bzpj8Qbj.js → cynefinDiagram-WF24UDRP-DJjq2hfT.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{dagre-NK4GIZVX-CXsL8t30.js → dagre-NK4GIZVX-C2vH93HT.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-CBK3MWTC-xfR-zlAD.js → diagram-CBK3MWTC-DrF_ScM-.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-I5XIIV2D-BjMqEsXr.js → diagram-I5XIIV2D-D1qoUJ4t.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-ODIL2UCW-QZpf8KhT.js → diagram-ODIL2UCW-D9A6W8oB.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-PFBEJUXE-Cw1ESWft.js → diagram-PFBEJUXE-PeI-eyu2.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-RJA3I4VV-CAy2RYYZ.js → diagram-RJA3I4VV-DITY0Rd8.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-TYUNFSNR-B09WciWt.js → diagram-TYUNFSNR-D5KieEw5.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{ebnfDiagram-V4P3TTPT-DuLmHG0U.js → ebnfDiagram-V4P3TTPT-DDylK-gz.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{elk-QONTBCTQ--zzx0EVP.js → elk-QONTBCTQ-D3xrVg0U.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{erDiagram-KYQIGQAA-BPDjG5vB.js → erDiagram-KYQIGQAA-y_V1cor7.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{flowDiagram-IUGLLWBU-DtE2M9a_.js → flowDiagram-IUGLLWBU-BJ8Z0MkF.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{ganttDiagram-R7GPNTJY-B-4AaWVa.js → ganttDiagram-R7GPNTJY-C0q-CS1T.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{gitGraphDiagram-PDYL7XHY-CYj5FGYx.js → gitGraphDiagram-PDYL7XHY-BYTComiB.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/index-BKxAxaVG.js +1091 -0
- package/node_modules/@weavecode/server/web/dist/assets/index-C0Sd4MH7.css +11 -0
- package/node_modules/@weavecode/server/web/dist/assets/{infoDiagram-MVDRKAX5-DHYSDj-3.js → infoDiagram-MVDRKAX5-DtixgjLP.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{ishikawaDiagram-HPEHV2GE-CumAEBoU.js → ishikawaDiagram-HPEHV2GE-ChEnND76.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{journeyDiagram-BOSHW7O7-ES3O3X05.js → journeyDiagram-BOSHW7O7-DHcNtpYF.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{kanban-definition-FNSA4HC5-BMIrf0d9.js → kanban-definition-FNSA4HC5-Dft7qpW5.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{linear-DEZ5FO1r.js → linear-DEo11t-X.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{mermaid.core-D7gm2szA.js → mermaid.core-D_Dp_Kl2.js} +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/{mindmap-definition-6OY57UG3-BBQP8lyN.js → mindmap-definition-6OY57UG3-CM6OAd_-.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{pegDiagram-ECIUJNBX-DzkKsqmg.js → pegDiagram-ECIUJNBX-_QkY0h8Q.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{pieDiagram-GNMPY74T-zR3q7Qs1.js → pieDiagram-GNMPY74T-ZGr5vtDj.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{quadrantDiagram-D57K4MC3-B4xuIsMW.js → quadrantDiagram-D57K4MC3-D8pQ_PU2.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{railroadDiagram-Y72NRBL7-D2I52m9D.js → railroadDiagram-Y72NRBL7-DUIo-WmA.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{requirementDiagram-EQYSW5RA-aJ1KfKj2.js → requirementDiagram-EQYSW5RA-C90DU5Ny.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{sankeyDiagram-SY24JHO5-CEq16Ecf.js → sankeyDiagram-SY24JHO5-B_poYGgJ.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{sequenceDiagram-BLEHNHQU-Bc66KG9f.js → sequenceDiagram-BLEHNHQU-DDW7b2Dn.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{sizeCapture-INFHLROL-Ddizw_UG.js → sizeCapture-INFHLROL-CmKoqX6K.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{stateDiagram-v2-A6IESKWZ-C1eVtEX9.js → stateDiagram-v2-A6IESKWZ-CkVMAyxG.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{swimlanes-B3ENRKFQ-CCd_KlpZ.js → swimlanes-B3ENRKFQ-Dm_Omzky.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-Bjj8ZA4d.js +8 -0
- package/node_modules/@weavecode/server/web/dist/assets/{timeline-definition-JXYKGLGB-DqpBhIII.js → timeline-definition-JXYKGLGB-DnhkRGLb.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{usecaseDiagram-WPOLBNNX-bX_jNjSt.js → usecaseDiagram-WPOLBNNX-_TdIjC6Z.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{vennDiagram-Q3Y3IDCW-D07CUHl3.js → vennDiagram-Q3Y3IDCW-FzgsymXB.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{wardleyDiagram-IVAIDKWA-CZ5ovcWa.js → wardleyDiagram-IVAIDKWA-BwqimStC.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{xychartDiagram-4URNHDU4-CBTh52hU.js → xychartDiagram-4URNHDU4-CFjjVPIV.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/icons/apple-touch-icon.png +0 -0
- package/node_modules/@weavecode/server/web/dist/icons/icon-192.png +0 -0
- package/node_modules/@weavecode/server/web/dist/icons/icon-512.png +0 -0
- package/node_modules/@weavecode/server/web/dist/icons/icon-maskable-512.png +0 -0
- package/node_modules/@weavecode/server/web/dist/index.html +11 -2
- package/node_modules/@weavecode/server/web/dist/manifest.webmanifest +16 -0
- package/node_modules/@weavecode/server/web/dist/sw.js +14 -12
- package/node_modules/@weavecode/templates/package.json +2 -2
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/README.md +3 -8
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/package.json +1 -1
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.d.ts +4 -2
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.es6.js +10 -1
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.es6.mjs +10 -1
- package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.js +10 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/README.md +3 -8
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/package.json +1 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.d.ts +4 -2
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.es6.js +10 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.es6.mjs +10 -1
- package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.js +10 -1
- package/package.json +6 -6
- package/node_modules/@weavecode/server/web/dist/assets/channel-CjSr3Zfg.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/index-BGdTLG4q.js +0 -1031
- package/node_modules/@weavecode/server/web/dist/assets/index-CEpJpR7P.css +0 -11
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-yIifcHaR.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{spawn as
|
|
2
|
-
`).trim()||`exit ${
|
|
3
|
-
`,"utf8")},
|
|
4
|
-
`,"utf8")}const f=
|
|
1
|
+
import{spawn as C}from"node:child_process";import{homedir as O}from"node:os";import{cp as R,lstat as H,mkdir as x,readFile as L,readdir as V,writeFile as F}from"node:fs/promises";import r from"node:path";import{linkOrCopy as q,removeInstalled as B}from"../shared/install-link.js";import{CLAUDE_ASSETS as W}from"./assets.js";export const WEAVE_MARKETPLACE="weave";const z="weave-marketplace",Q=6e4,U=2e3,J=64*1024;export function claudeCommandLine(o){return["claude",...o.map(d=>`"${d.replace(/"/g,'\\"')}"`)].join(" ")}function X(o){if(!(o.exitCode!==null||o.signalCode!==null)){if(process.platform==="win32"&&o.pid!==void 0){C("taskkill",["/pid",String(o.pid),"/t","/f"],{windowsHide:!0,stdio:"ignore"}).unref();return}o.kill("SIGKILL")}}function $(o){return o.length>U?`${o.slice(0,U)}\u2026`:o}function K(o){try{const d=JSON.parse(o);return d&&typeof d=="object"&&!Array.isArray(d)?d:null}catch{return null}}export const execCli=(o,d)=>new Promise((E,A)=>{const v=process.platform==="win32",g=C(v?process.env.ComSpec||"cmd.exe":"claude",v?["/d","/s","/c",claudeCommandLine(o)]:o,{windowsHide:!0,windowsVerbatimArguments:v,stdio:["ignore","pipe","pipe"]}),y=`claude ${o.join(" ")}`;let k="",p="",l=!1;const j=c=>{l||(l=!0,clearTimeout(b),A(new Error($(c))))},b=setTimeout(()=>{X(g),j(`${y}: timed out after ${d.timeoutMs}ms`)},d.timeoutMs);g.stdout?.setEncoding("utf8"),g.stdout?.on("data",c=>{k.length<J&&(k+=c)}),g.stderr?.setEncoding("utf8"),g.stderr?.on("data",c=>{p.length<J&&(p+=c)}),g.on("error",c=>j(`${y}: ${c.message}`)),g.on("close",c=>{if(l)return;if(l=!0,clearTimeout(b),c===0){E({stdout:k,stderr:p});return}const h=[p,k].filter(Boolean).join(`
|
|
2
|
+
`).trim()||`exit ${c}`;A(new Error($(`${y}: ${h}`)))})});export function createClaudePluginSurface(o={}){const d=o.exec??execCli,E=e=>d(e,{timeoutMs:Q}),A=()=>W.userConfigFile(O()),v=()=>r.join(O(),".claude","plugins","installed_plugins.json"),g=()=>r.join(O(),".claude",z),y=e=>r.join(e,".claude","settings.json"),k=e=>r.join(e,".claude","settings.local.json"),p=(e,n)=>`${e}@${n??WEAVE_MARKETPLACE}`,l=async e=>{try{const n=JSON.parse(await L(e,"utf8"));return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{return{}}},j=async(e,n)=>{await x(r.dirname(e),{recursive:!0}),await F(e,`${JSON.stringify(n,null,2)}
|
|
3
|
+
`,"utf8")},b=e=>{const n=e.enabledPlugins;return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(([,t])=>typeof t=="boolean"))},c=e=>{const n=e.enabledPlugins;return n&&typeof n=="object"&&!Array.isArray(n)?{...n}:{}},h=async()=>{const n=(await l(v())).plugins;if(!n||typeof n!="object"||Array.isArray(n))return{};const t={};for(const[i,s]of Object.entries(n))Array.isArray(s)&&(t[i]=s);return t},I=(e,n,t)=>{const i=n?.[n.length-1];return{key:e,alreadyInstalled:t,...i?.scope?{scope:i.scope}:{},...i?.installPath?{installPath:i.installPath}:{},...i?.version?{version:i.version}:{}}},N=async(e,n,t={})=>{const i=g(),s=r.join(i,"plugins",n);await B(s),await x(r.dirname(s),{recursive:!0});const a=await L(r.join(e,".claude-plugin","plugin.json"),"utf8").then(()=>!0,()=>!1),u=await V(e).catch(()=>[]);if(a&&!u.includes("node_modules")&&!u.includes(".git"))await q(e,s);else if(await R(e,s,{recursive:!0,filter:S=>{const _=r.basename(S);return _!=="node_modules"&&_!==".git"}}),!a){const S=r.join(s,".claude-plugin","plugin.json");await x(r.dirname(S),{recursive:!0}),await F(S,JSON.stringify({name:n,version:t.version??"0.0.0",...t.description?{description:t.description}:{}},null,2)+`
|
|
4
|
+
`,"utf8")}const f=r.join(i,".claude-plugin","marketplace.json"),w=await l(f),P=Array.isArray(w.plugins)?[...w.plugins]:[],M={name:n,source:`./plugins/${n}`},T=P.findIndex(S=>S?.name===n);return T>=0?P[T]=M:P.push(M),w.name=WEAVE_MARKETPLACE,w.owner||(w.owner={name:"weave"}),w.plugins=P,await j(f,w),i},G=async(e,n,t)=>{if(!e.dir)throw new Error(`marketplace dir required for ${n}@${e.name}`);if((await H(e.dir)).isSymbolicLink())return;const i=r.join(e.dir,".claude-plugin","marketplace.json"),s=await l(i),a=Array.isArray(s.plugins)?[...s.plugins]:[],u=`./${r.relative(e.dir,t).split(r.sep).join("/")}`,m={name:n,source:u},f=a.findIndex(w=>w?.name===n);f>=0?a[f]=m:a.push(m),s.name=e.name,s.owner||(s.owner={name:"weave"}),s.plugins=a,await j(i,s)};return{projectPluginDir:e=>r.join(e,".claude","plugins"),pluginKey:p,parsePluginKey(e){const n=e.lastIndexOf("@");return n>0?{name:e.slice(0,n),market:e.slice(n+1)}:{name:e,market:WEAVE_MARKETPLACE}},async globalInstall(e,n={}){let t=n.name;if(!t){const f=await l(r.join(e,".claude-plugin","plugin.json"));t=typeof f.name=="string"?f.name:void 0}if(!t)throw new Error(`plugin manifest missing name: ${e}`);const i=n.marketplace,s=p(t,i?.name),a=(await h())[s];if(a&&a.length>0)return I(s,a,!0);if(i)await G(i,t,e),await E(["plugin","marketplace","add",i.dir??""]);else{const f=await N(e,t,n);await E(["plugin","marketplace","add",f])}const{stdout:u}=await E(["plugin","install",s,"--scope","user","--json"]),m=K(u);if(m?.outcome==="failed")throw new Error($(String(m.message??"plugin install failed")));return I(s,(await h())[s],!1)},readInstalled:h,async isInstalled(e,n){const t=(await h())[p(e,n)];return!!t&&t.length>0},async uninstall(e,n){const t=p(e,n),i=(await h())[t];if(!i||i.length===0)return;const s=[...new Set(i.map(a=>a.scope??"user"))];for(const a of s){const{stdout:u}=await E(["plugin","uninstall",t,"--scope",a,"--json"]),m=K(u);if(m?.outcome==="failed")throw new Error($(String(m.message??"plugin uninstall failed")))}},async removeMarketplace(e){const n=await l(r.join(O(),".claude","plugins","known_marketplaces.json")),t=r.resolve(e),i=Object.entries(n).find(([,s])=>s&&typeof s=="object"&&typeof s.installLocation=="string"&&r.resolve(s.installLocation)===t)?.[0];i&&await E(["plugin","marketplace","remove",i])},async readProjectEnabled(e,n,t){return b(await l(y(e)))[p(n,t)]??!1},async setProjectEnabled(e,n,t,i){const s=y(e),a=await l(s);a.enabledPlugins={...c(a),[p(n,i)]:t},await j(s,a)},async readGlobalEnabled(){return b(await l(A()))},async writeGlobalEnabled(e,n){const t=A(),i=await l(t);i.enabledPlugins={...c(i),[e]:n},await j(t,i)},pluginScopes:()=>["user","project","local"],async readEnabledOverrides(e){const[n,t,i]=await Promise.all([l(A()).then(b),l(y(e)).then(b),l(k(e)).then(b)]);return{user:n,project:t,local:i}},async setEnabledOverride(e,n,t,i){const s=n==="user"?A():n==="project"?y(e):k(e),a=await l(s),u=c(a);i==="inherit"?delete u[t]:u[t]=i==="on",a.enabledPlugins=u,await j(s,a)}}}export const CLAUDE_PLUGINS=createClaudePluginSurface();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const CLAUDE_PROMPT_INBOX={socketEnv:"CLAUDE_CODE_MESSAGING_SOCKET",tokenEnv:"CLAUDE_CODE_MESSAGING_TOKEN",requiresAuthOn:
|
|
1
|
+
export const CLAUDE_PROMPT_INBOX={socketEnv:"CLAUDE_CODE_MESSAGING_SOCKET",tokenEnv:"CLAUDE_CODE_MESSAGING_TOKEN",requiresAuthOn:e=>e==="win32",frame:({token:e,text:s})=>{const n=[];return e&&n.push(JSON.stringify({type:"auth",token:e})),n.push(JSON.stringify({type:"user",message:{role:"user",content:s}})),n.join(`
|
|
2
2
|
`)+`
|
|
3
3
|
`}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{resolveClaudePeer as
|
|
1
|
+
import{resolveClaudePeer as n}from"./peers.js";const t="[weave one-way injection \u2014 no reply is expected: do not call SendMessage or ListAgents, just act on this prompt in this session.]";export const CLAUDE_PROMPT_RELAY={bin:"claude",args:["-p","--no-session-persistence","--strict-mcp-config","--disable-slash-commands","--tools","SendMessage,ListAgents","-n","weave"],senderName:"weave",instruction:(e,s,o)=>`Send the following message verbatim to the Claude session named "${e}" using the SendMessage tool, then stop immediately. Do not use any other tool and do not wait for a reply \u2014 the handover is done once the tool call returns, so this process must exit promptly.
|
|
2
2
|
|
|
3
|
-
${o.oneWay?`${
|
|
3
|
+
${o.oneWay?`${t}
|
|
4
4
|
|
|
5
|
-
`:""}${s}`,resolve:
|
|
5
|
+
`:""}${s}`,resolve:n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${t}`:
|
|
1
|
+
import{HARNESS_LIFECYCLE as b}from"@weavecode/core";import{CLAUDE_PLAN as S}from"./plan.js";import{defaultPermissionModeOf as k}from"./model-aliases.js";import{preQuestionTextAt as g}from"./transcript.js";import{readTail as T}from"./transcript-cursor.js";const w=512*1024,f="\x1B[B",a=" ",A="\x1B[Z",N=2e3,m="(preview cannot be shown in full \u2014 compare the option labels and descriptions instead)",E="No preview available",_="n",O="press n to add notes",P=/[\p{M}\u200b-\u200f\u2028-\u202e\u2060-\u206f\u180b-\u180f\ufe0e\ufe0f]/u,I=[{keys:["1"],label:"Yes, and switch to default (ask each time) for this session"},{keys:["2"],label:"No"}],v={bypassPermissions:"BYPASS PERMISSIONS (no further prompts)"};export function planApprovalOptions(e){return e==null||e==="default"||e==="plan"?I.map(t=>({...t})):[{keys:["1"],label:`Yes, and switch to ${v[e]??e} for this session`},{keys:["2"],label:"Yes, manually approve edits"},{keys:["3"],label:"Tell Claude what to change",description:"shift+tab to approve with this feedback",input:!0,textTail:[A]}]}const C=[{keys:["1"],label:"Yes"},{keys:["2"],label:"Yes, and don't ask again for this tool"},{keys:["3"],label:"No, and tell Claude what to do differently (esc)"}],L=[{keys:["1"],label:"Yes, and tell Claude what to do next"},{keys:["2"],label:"No"}],h={key:"AskUserQuestion:opaque",header:null,question:"The session is asking a question (options unavailable \u2014 answer in its terminal)",multiSelect:!1,options:[]};function R(e){if(!e||typeof e!="object")return null;const t=e,s=r(t.to_model),n=r(t.from_model);return!s||!n||s===n||t.prompt_cache_warm!==!0?null:{key:"model:switch",header:"Switch model?",question:`Your next response will be slower and use more tokens. This conversation is cached for the current model. Switching to ${s} means the full history gets re-read on your next message.`,multiSelect:!1,options:[{keys:["1"],label:`Yes, switch to ${s}`},{keys:["2"],label:"No, go back"}]}}function Q(e){if(e==null||typeof e!="object")return"";try{const t=JSON.stringify(e);return!t||t==="{}"?"":t.length>160?`${t.slice(0,160)}\u2026`:t}catch{return""}}function q(e,t){return[t?{keys:[String(e+1)],label:"Type something",input:!0,textFocus:Array.from({length:e},()=>f),textTail:[a,"\r"]}:{keys:[String(e+1)],label:"Type something",input:!0,textTail:["\r"]},{keys:[String(e+2)],label:"Chat about this",chat:!0}]}function Y(){return{key:"AskUserQuestion:submit",header:"Submit",question:"Review your answers",multiSelect:!1,submit:!0,options:[{keys:[a,"1"],label:"Submit answers"},{keys:[a,"2"],label:"Cancel"}]}}function r(e){return typeof e=="string"&&e?e:null}function U(e){if(!Array.isArray(e))return[];const t=[];for(const s of e){if(!s||typeof s!="object")continue;const n=r(s.label);if(!n)continue;const o=s.description;t.push({keys:[String(t.length+1)],label:n,description:typeof o=="string"&&o?o:null,preview:x(s.preview)})}return t}function x(e){return typeof e!="string"?null:e.length>N?m:e.replace(/�/g,"").trim()?P.test(e)?m:e:null}function $(e,t){return t<2?[String(e+1)]:[String(e===0?2:1),String(e+1)]}function M(e){return e.map((t,s)=>({keys:$(s,e.length),commit:["\r"],label:t.label,description:t.description,preview:t.preview??E}))}function B(e){const t=[];return e>=2&&t.push({keys:[_],label:"Notes:",description:O,input:!0,textTail:["\r"]}),t.push({keys:[String(e),f,"\r"],label:"Chat about this",chat:!0}),t}export const CLAUDE_BLOCKING_PROMPT={plan:S,blockingTools:b.claude.questionTools,permissionNotificationType:"permission_prompt",silentPermissionModes:["bypassPermissions","dontAsk"],permissionQuestion(e){const t=e.toolName?`${e.toolName}${e.toolInput?` ${Q(e.toolInput)}`:""}`:"",s=e.permissionMode==="auto"||/classifier/i.test(e.message??""),n=e.message?.trim()||"Claude needs your permission";return{key:"permission:confirm",header:s?"Permission (auto mode)":"Permission",question:t?`${n}
|
|
2
|
+
${t}`:n,multiSelect:!1,options:[...s?L:C]}},parseQuestions(e,t){if(e==="AskUserQuestion"){const s=t&&typeof t=="object"?t.questions:void 0;if(!Array.isArray(s))return[h];const n=[];for(const o of s){if(!o||typeof o!="object")continue;const l=r(o.question),c=r(o.header),u=o.multiSelect===!0,i=U(o.options);if(!l||i.length===0)continue;const y=c??l.slice(0,24),p=!u&&i.some(d=>d.preview!=null);n.push({key:`AskUserQuestion:${y}`,header:c,question:l,options:p?[...M(i),...B(i.length)]:[...i,...q(i.length,u)],multiSelect:u,previewMode:p})}return n.length===0?[h]:((n.length>=2||n.some(o=>o.multiSelect))&&n.push(Y()),n)}return[{key:"ExitPlanMode:approve",header:"Exit plan mode?",question:"Claude wants to exit plan mode",multiSelect:!1,options:planApprovalOptions(k())}]},eventQuestion(e,t){return e==="PreModelSwitch"?R(t.raw):null},async preQuestion(e){if(!e)return null;const t=T(e,w);return t===null?null:g(t)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLAUDE_RESUME={supported:!0,bin:"claude",args:
|
|
1
|
+
export const CLAUDE_RESUME={supported:!0,bin:"claude",args:e=>["--resume",e,"-p"],promptStdin:!0,openArgs:e=>["--resume",e],extractArgs:(e,s)=>["--resume",e,"--fork-session","--no-session-persistence","--session-id",s],minVersion:"2.1.287"};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RewindSurface, RewindMark } from '../driver.js';
|
|
2
|
+
export declare const CLAUDE_REWIND: RewindSurface;
|
|
3
|
+
/**
|
|
4
|
+
* 一行转录 → 一条回退锚点(全量读与增量监视共用这份文法)。`seenRoot` =
|
|
5
|
+
* 此前是否已见过链根——会话开头第一条 user 与斜杠命令展开(`<command-message>`
|
|
6
|
+
* 开头,实测每次执行都立新根)都算,rewind 后的普通消息是**下一个**根。
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseRewindLine(line: string, seenRoot: boolean): RewindMark | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readNewLines as f,transcriptSize as c}from"./transcript-cursor.js";const t=new Map,a=64;export const CLAUDE_REWIND={async sessionRewinds({transcriptPath:e}){if(!e)return null;const s=c(e);if(s===null)return t.delete(e),null;const u=t.get(e);t.delete(e);const n=u??{cur:{offset:0},marks:[],seenRoot:!1};s<n.cur.offset&&(n.cur.offset=0,n.marks=[],n.seenRoot=!1);const o=f(e,n.cur,s);if(o===null)return null;for(const r of o){if(!r.includes('"type":"user"'))continue;const i=parseRewindLine(r,n.seenRoot);i&&n.marks.push(i);try{l(JSON.parse(r))&&(n.seenRoot=!0)}catch{}}if(t.size>=a){const r=t.keys().next().value;r!==void 0&&t.delete(r)}return t.set(e,n),n.marks}};export function parseRewindLine(e,s){if(!e.includes('"type":"user"'))return null;let u;try{u=JSON.parse(e)}catch{return null}if(!l(u)||!s)return null;const n=u.timestamp;return typeof n!="string"?null:{at:n,boundaryAt:null}}function l(e){if(e.type!=="user"||e.parentUuid!==null||e.isSidechain===!0)return!1;const s=e.message?.content;return!(typeof s=="string"&&s.startsWith("<command-message>"))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{captureHookGroup as r,sweepWeaveHookEvents as
|
|
1
|
+
import{captureHookGroup as r,sweepWeaveHookEvents as m}from"./capture.js";const S=".claude/helpers/statusline.cjs",d="Generated by weave \u2014 do not edit manually";export const WEAVE_PERMISSIONS_ALLOW=["Bash(npx weave:*)","Bash(pnpm:*)","Bash(npm:*)"],WEAVE_PERMISSIONS_DENY=["Read(./.env)","Read(./.env.*)","Read(./secrets/*)"];export function generateSettingsJson(n){const{components:s,hooks:e,platform:p,helpersDir:o}=n,c={$comment:d};if(s.helpers){const t={};e.preToolUse&&(t.PreToolUse=r("PreToolUse",o)),e.postToolUse&&(t.PostToolUse=r("PostToolUse",o)),e.userPromptSubmit&&(t.UserPromptSubmit=r("UserPromptSubmit",o)),e.sessionStart&&(t.SessionStart=r("SessionStart",o)),e.stop&&(t.Stop=r("Stop",o)),e.stopFailure&&(t.StopFailure=r("StopFailure",o)),e.subagentStop&&(t.SubagentStop=r("SubagentStop",o)),e.subagentStart&&(t.SubagentStart=r("SubagentStart",o)),e.notification&&(t.Notification=r("Notification",o)),e.postToolUseFailure&&(t.PostToolUseFailure=r("PostToolUseFailure",o)),e.permissionRequest&&(t.PermissionRequest=r("PermissionRequest",o)),e.permissionDenied&&(t.PermissionDenied=r("PermissionDenied",o)),e.preCompact&&(t.PreCompact=r("PreCompact",o)),e.sessionEnd&&(t.SessionEnd=r("SessionEnd",o)),e.preModelSwitch&&(t.PreModelSwitch=r("PreModelSwitch",o),t.PostModelSwitch=r("PostModelSwitch",o)),c.hooks=t}return c.permissions={allow:[...WEAVE_PERMISSIONS_ALLOW],deny:[...WEAVE_PERMISSIONS_DENY]},c.env={WEAVE_ENABLED:"true"},s.helpers&&(c.statusLine={type:"command",command:p.os==="windows"?`node "${o}/statusline.cjs"`:"node "+o+"/statusline.cjs",padding:0,refreshInterval:30}),c}export function mergeSettingsJson(n,s){const e={...n},p=s.hooks;if(p&&typeof p=="object"){const i=m(l(e.hooks)?{...e.hooks}:{})??{};for(const[a,f]of Object.entries(p)){const u=i[a];u===void 0?i[a]=f:Array.isArray(u)&&(i[a]=[...u,...Array.isArray(f)?f:[]])}e.hooks=i}const o=e.statusLine;s.statusLine&&(o===void 0||statusLineIsWeave(o))&&(e.statusLine=s.statusLine);const c=s.permissions;if(c&&typeof c=="object"){const i=l(e.permissions)?e.permissions:{};for(const a of["allow","deny"]){const f=c[a],u=i[a];Array.isArray(f)?i[a]=E(u,f):u===void 0&&(i[a]=f)}e.permissions=i}const t=s.env;if(t&&typeof t=="object"){const i=l(e.env)?e.env:{};for(const[a,f]of Object.entries(t))i[a]===void 0&&(i[a]=f);e.env=i}return e}function l(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}export function statusLineIsWeave(n){if(!l(n))return!1;const s=n.command;return typeof s=="string"&&h(s,S)}function h(n,s){return n.replace(/\\/g,"/").includes(s)}function E(n,s){return Array.isArray(n)?[...n,...s.filter(e=>!n.includes(e))]:[...s]}export function stripWeaveSettings(n){const s={...n};if(l(s.hooks)){const e=m(s.hooks);e?s.hooks=e:delete s.hooks}if(statusLineIsWeave(s.statusLine)&&delete s.statusLine,l(s.permissions)){const e={...s.permissions},p=(o,c)=>{const t=e[o];if(!Array.isArray(t))return;const i=t.filter(a=>!c.includes(a));i.length>0?e[o]=i:delete e[o]};p("allow",WEAVE_PERMISSIONS_ALLOW),p("deny",WEAVE_PERMISSIONS_DENY),Object.keys(e).length>0?s.permissions=e:delete s.permissions}if(l(s.env)){const e={...s.env};delete e.WEAVE_ENABLED,Object.keys(e).length>0?s.env=e:delete s.env}return s.$comment===d&&delete s.$comment,s}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
`)&&n.length<=80&&!
|
|
1
|
+
import{existsSync as o}from"node:fs";const a=2e3,c=/^[^\x00-\x1f\x7f]+$/,u=/^<(?:analysis|summary)>/,p="exploring|reviewing|inspecting|tracing|checking|locating|reporting|summarizing|examining|reading|searching|scanning|analyzing|investigating|fetching|loading|probing|auditing|mapping|listing|comparing|verifying|testing|extracting|processing|measuring|assessing|evaluating|identifying|confirming|drafting|refactoring|debugging|grepping",f=new RegExp(`^[\\p{P}\\s]*(${p})\\b`,"iu"),l=/\p{Script=Han}/u,S=n=>!n.includes(`
|
|
2
|
+
`)&&n.length<=80&&!l.test(n)&&f.test(n),e=(n,t)=>n&&typeof n=="object"?n[t]:void 0;export const CLAUDE_SIDE_QUESTION={command(n){return`/btw ${n}`},validate(n){const t=n.trim();return t?t.length>a?{ok:!1,error:`\u95EE\u9898\u8FC7\u957F\uFF08\u4E0A\u9650 ${a} \u5B57\u7B26\uFF09`}:c.test(t)?{ok:!0,text:t}:{ok:!1,error:"\u95EE\u9898\u4E0D\u80FD\u542B\u6362\u884C\u6216\u63A7\u5236\u5B57\u7B26\uFF08\u4F1A\u63D0\u524D\u63D0\u4EA4\uFF09"}:{ok:!1,error:"\u95EE\u9898\u4E0D\u80FD\u4E3A\u7A7A"}},answerOf(n,t){if(n!=="SubagentStop")return null;const s=e(t,"raw"),r=e(s,"agent_transcript_path");if(typeof r!="string"||!r||o(r))return null;const g=e(s,"last_assistant_message");if(typeof g!="string")return null;const i=g.trim();return i&&!u.test(i)&&!S(i)?i:null}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CONTEXT_STYLE_FORMAT as c,POWERLINE_DEFAULT_GLYPHS as e,SEGMENT_DEFAULT_FORMAT as d,SEGMENT_ORDER as p}from"./config.js";const h={gray:"90",red:"31",green:"32",yellow:"33",blue:"34",magenta:"35",cyan:"36"},f={gray:"100",red:"41",green:"42",yellow:"43",blue:"44",magenta:"45",cyan:"46"},g="\u2588",m="\u2591",v=10,
|
|
1
|
+
import{CONTEXT_STYLE_FORMAT as c,POWERLINE_DEFAULT_GLYPHS as e,SEGMENT_DEFAULT_FORMAT as d,SEGMENT_ORDER as p}from"./config.js";const h={gray:"90",red:"31",green:"32",yellow:"33",blue:"34",magenta:"35",cyan:"36"},f={gray:"100",red:"41",green:"42",yellow:"43",blue:"44",magenta:"45",cyan:"46"},g="\u2588",m="\u2591",v=10,y=8*1024*1024,r=5e3,b=3600,w=60,_=60,C=60,k=5;export function generateStatuslineScript(n,t){const i=JSON.stringify(n),s=JSON.stringify(t.cacheDir),a=JSON.stringify(h),o=JSON.stringify(f),l=JSON.stringify(d),u=JSON.stringify(c);return`#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* weave statusline \u2014 generated by the weave dashboard.
|
|
4
4
|
* Reads Claude Code's statusline JSON from stdin and prints a summary.
|
|
@@ -7,20 +7,20 @@ import{CONTEXT_STYLE_FORMAT as c,POWERLINE_DEFAULT_GLYPHS as e,SEGMENT_DEFAULT_F
|
|
|
7
7
|
*/
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
const CONFIG = ${
|
|
11
|
-
const ANSI = ${
|
|
12
|
-
const BG = ${
|
|
13
|
-
const SEGMENT_FORMAT = ${
|
|
14
|
-
const CONTEXT_FORMAT = ${
|
|
10
|
+
const CONFIG = ${i};
|
|
11
|
+
const ANSI = ${a};
|
|
12
|
+
const BG = ${o};
|
|
13
|
+
const SEGMENT_FORMAT = ${l};
|
|
14
|
+
const CONTEXT_FORMAT = ${u};
|
|
15
15
|
const BAR_FILL = '${g}';
|
|
16
16
|
const BAR_EMPTY = '${m}';
|
|
17
17
|
const BAR_CELLS = ${v};
|
|
18
|
-
const GIT_IDENTITY_TTL = ${
|
|
19
|
-
const GIT_CHANGES_TTL = ${
|
|
20
|
-
const GIT_BRANCH_TTL = ${
|
|
21
|
-
const GIT_SYNC_TTL = ${
|
|
22
|
-
const GIT_RETRY_TTL = ${
|
|
23
|
-
const CACHE_DIR = ${
|
|
18
|
+
const GIT_IDENTITY_TTL = ${b};
|
|
19
|
+
const GIT_CHANGES_TTL = ${w};
|
|
20
|
+
const GIT_BRANCH_TTL = ${_};
|
|
21
|
+
const GIT_SYNC_TTL = ${C};
|
|
22
|
+
const GIT_RETRY_TTL = ${k};
|
|
23
|
+
const CACHE_DIR = ${s};
|
|
24
24
|
// Stamped into the row-0 logo so the running version is always visible.
|
|
25
25
|
const WEAVE_VERSION = ${JSON.stringify(t.version)};
|
|
26
26
|
// Powerline glyphs (Nerd Font), configurable via CONFIG.powerline: undefined
|
|
@@ -124,14 +124,35 @@ function cacheKeyOf(input) {
|
|
|
124
124
|
return crypto.createHash('sha1').update(cwd).digest('hex').slice(0, 16);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
// \u5206\u7247\u6587\u4EF6\u7684\u952E\u6052\u4E3A\u9879\u76EE\u6839\uFF1A\u4F1A\u8BDD\u53EF\u4EE5 cd \u8FDB\u5B50\u76EE\u5F55\uFF0C\u800C dashboard \u5E95\u6761\u6309\u9879\u76EE\u8DEF\u5F84\u627E
|
|
128
|
+
// \u540C\u4E00\u4E2A\u6587\u4EF6\u2014\u2014\u4E24\u8FB9\u5FC5\u987B\u54C8\u5E0C\u540C\u4E00\u4E2A\u5B57\u7B26\u4E32\uFF08\u5426\u5219\u5E95\u6761\u6C38\u8FDC\u8BFB\u4E0D\u5230\uFF09\u3002\u9879\u76EE\u6839\u4F18\u5148\u53D6
|
|
129
|
+
// \u811A\u672C\u81EA\u8EAB\u4F4D\u7F6E\uFF08\u672C\u6587\u4EF6\u56FA\u5B9A\u5728 <\u9879\u76EE>/.claude/helpers/ \u4E0B = weave init \u7684\u90A3\u4E2A\u76EE\u5F55\uFF09\uFF0C
|
|
130
|
+
// \u5176\u6B21\u5BBF\u4E3B\u7684 workspace.project_dir\uFF0C\u6700\u540E\u624D\u56DE\u843D\u5230\u5F53\u524D\u76EE\u5F55\u3002
|
|
131
|
+
// \u6CE8\u610F\uFF1A\u63A2\u6D4B\u4ECD\u7528\u4F1A\u8BDD\u771F\u5B9E\u7684\u5DE5\u4F5C\u76EE\u5F55\uFF08cwd\uFF09\u2014\u2014\u72B6\u6001\u680F\u8981\u663E\u793A\u7528\u6237\u6B64\u523B\u6240\u5728\u7684\u4F4D\u7F6E\u4E0E
|
|
132
|
+
// \u90A3\u91CC\u7684\u6539\u52A8\uFF0C\u53EA\u6709\u6587\u4EF6\u843D\u5728\u54EA\u4E0D\u8DDF\u7740\u6F02\u3002
|
|
133
|
+
function projectRootOf(input) {
|
|
134
|
+
var path = require('path');
|
|
135
|
+
// \u53EA\u5728\u811A\u672C\u786E\u5B9E\u8EBA\u5728 <\u9879\u76EE>/.claude/helpers/<name> \u4E0B\u65F6\u624D\u7528\u4F4D\u7F6E\u63A8\u5BFC\u2014\u2014
|
|
136
|
+
// \u522B\u5904\u8DD1\u7684\u526F\u672C\uFF08\u6D4B\u8BD5\u3001\u624B\u5DE5\u8C03\u7528\uFF09\u4F4D\u7F6E\u6CA1\u6709\u610F\u4E49\uFF0C\u8D70\u5BBF\u4E3B\u7ED9\u7684\u9879\u76EE\u6839\u3002
|
|
137
|
+
try {
|
|
138
|
+
var helpers = path.dirname(__filename);
|
|
139
|
+
if (path.basename(helpers) === 'helpers' && path.basename(path.dirname(helpers)) === '.claude') {
|
|
140
|
+
return path.dirname(path.dirname(helpers));
|
|
141
|
+
}
|
|
142
|
+
} catch (e) {}
|
|
143
|
+
var dir = input.workspace && input.workspace.project_dir;
|
|
144
|
+
if (typeof dir === 'string' && dir) return dir;
|
|
145
|
+
return (input.workspace && input.workspace.current_dir) || process.cwd();
|
|
146
|
+
}
|
|
147
|
+
|
|
127
148
|
function initCache(input) {
|
|
128
149
|
var path = require('path');
|
|
129
150
|
var crypto = require('crypto');
|
|
130
151
|
CACHE_FILE = path.join(CACHE_DIR, cacheKeyOf(input) + '.json');
|
|
131
|
-
var
|
|
152
|
+
var root = projectRootOf(input);
|
|
132
153
|
// \u4E00\u4E2A\u76EE\u5F55\u4E00\u4E2A\u6587\u4EF6\uFF1A\u5927\u5C0F\u5199\u4E0D\u654F\u611F\uFF08Windows\uFF09\uFF0C\u5206\u9694\u7B26\u4E0E\u5C3E\u659C\u6760\u7684\u4E0D\u540C\u5199\u6CD5\u4E5F\u7B97\u540C\u4E00\u4E2A
|
|
133
154
|
var dirKey = crypto.createHash('sha1')
|
|
134
|
-
.update(String(
|
|
155
|
+
.update(String(root).toLowerCase().replace(/\\\\/g, '/').replace(/\\/+$/, ''))
|
|
135
156
|
.digest('hex').slice(0, 16);
|
|
136
157
|
GIT_FILE = path.join(CACHE_DIR, 'git-' + dirKey + '.json');
|
|
137
158
|
}
|
|
@@ -355,7 +376,7 @@ function sessionTokens(transcriptPath) {
|
|
|
355
376
|
store.tokens[transcriptPath] = entry;
|
|
356
377
|
if (stat.size === entry.offset) return entry.total || null;
|
|
357
378
|
|
|
358
|
-
var len = Math.min(stat.size - entry.offset, ${
|
|
379
|
+
var len = Math.min(stat.size - entry.offset, ${y});
|
|
359
380
|
var buf = Buffer.alloc(len);
|
|
360
381
|
var read = 0;
|
|
361
382
|
var fd = -1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as
|
|
1
|
+
import{readFileSync as f}from"node:fs";import{createHash as g}from"node:crypto";import d from"node:path";export function gitCacheKeyOf(c){return g("sha1").update(c.toLowerCase().replace(/\\/g,"/").replace(/\/+$/,"")).digest("hex").slice(0,16)}export function statuslineFactsFromCache(c,l,u=Date.now()){let o;try{o=JSON.parse(f(d.join(c,`git-${gitCacheKeyOf(l)}.json`),"utf-8"))}catch{return null}const s=t=>{const i=o.git?.[t];return!i||typeof i.expires!="number"||i.expires<=u?null:i.value??null},e={},a=s("branch");if(typeof a=="string"&&a){e.git={branch:a};const t=s("sync");t&&typeof t=="object"&&t.sync&&(e.git.ahead=t.ahead??"",e.git.behind=t.behind??"",e.git.sync=t.sync)}const n=s("git_user");n&&typeof n=="object"&&n.user&&(e.git_user={user:n.user,email:n.email??""});const r=s("changes");return r&&typeof r=="object"&&(e.changes={added:String(r.added??0),deleted:String(r.deleted??0),files:String(r.files??0)}),Object.keys(e).length>0?e:null}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readFile as o,writeFile as m,mkdir as u,access as l}from"node:fs/promises";import n from"node:path";import{SEGMENT_ORDER as p}from"./config.js";import{generateStatuslineScript as f}from"./generator.js";import{statuslineFactsFromCache as
|
|
2
|
-
`,"utf-8")}export const CLAUDE_STATUSLINE={segments:p,tui:"injectable",scriptRelPath:`${
|
|
1
|
+
import{readFile as o,writeFile as m,mkdir as u,access as l}from"node:fs/promises";import n from"node:path";import{SEGMENT_ORDER as p}from"./config.js";import{generateStatuslineScript as f}from"./generator.js";import{statuslineFactsFromCache as S}from"./git-cache.js";const d=".claude/helpers",h="statusline.cjs",E=".claude/settings.json";async function w(t){try{return await l(t),!0}catch{return!1}}export async function ensureSettingsStatusLine(t,e){const r=n.join(t,E),i=process.platform==="win32";let s={};if(await w(r))try{s=JSON.parse(await o(r,"utf-8"))}catch{s={}}const a=e.scriptPath,c=i?`node "${a}"`:`node ${a}`;s.statusLine={type:"command",command:c,padding:0,refreshInterval:Math.max(1,Math.round(e.refreshInterval))},await u(n.dirname(r),{recursive:!0}),await m(r,`${JSON.stringify(s,null,2)}
|
|
2
|
+
`,"utf-8")}export const CLAUDE_STATUSLINE={segments:p,tui:"injectable",scriptRelPath:`${d}/${h}`,generate:(t,e)=>f(t,e),wire:ensureSettingsStatusLine,facts:S};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 转录的两种读法(旁白 / 回退 / 命令回显共用):
|
|
3
|
+
*
|
|
4
|
+
* - **按行增量**:转录只追加,故记住「已消费到哪个字节」即可,每拍只读新增部分。
|
|
5
|
+
* 游标必须落在行边界上——读一块、找最后一个 `\n`、只推进到那里,尾部那条没写完
|
|
6
|
+
* 的长行下一拍连同新字节一起读(不押字符串、避免多字节字符被切断的偏移漂)。
|
|
7
|
+
* - **尾窗**:只关心文件末尾那点事实的(提问前说明)就别整份读进内存。
|
|
8
|
+
*/
|
|
9
|
+
/** 行级游标:已经完整消费掉的字节数(恒落在行边界)。 */
|
|
10
|
+
export interface LineCursor {
|
|
11
|
+
offset: number;
|
|
12
|
+
}
|
|
13
|
+
/** 文件大小;读不到(已删/无权限)= null。 */
|
|
14
|
+
export declare function transcriptSize(path: string): number | null;
|
|
15
|
+
/** 一行是不是完整的 JSON:转录每行一条 JSON,文件末尾没换行时用它判「写完了没」。 */
|
|
16
|
+
export declare function isCompleteJsonLine(line: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 从游标处读到文件尾,返回其中**完整的行**;游标推进到最后一个换行之后。
|
|
19
|
+
* 末尾那条没有换行的行,只有 `isComplete` 认它写完了才一并返回并推进游标
|
|
20
|
+
* (写了一半的行留给下一拍,否则半行会被当成坏行永久跳过)。
|
|
21
|
+
* 文件被截断/换掉(size < offset)→ 游标归零从头来。读失败返回 null(调用方
|
|
22
|
+
* 按「这一刻读不到」处理,不猜)。
|
|
23
|
+
*/
|
|
24
|
+
export declare function readNewLines(path: string, cursor: LineCursor, size: number, isComplete?: (line: string) => boolean): string[] | null;
|
|
25
|
+
/** 读文件尾部 `bytes` 字节(不足则整份)。读不到 = null。 */
|
|
26
|
+
export declare function readTail(path: string, bytes: number): string | null;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{closeSync as y,openSync as S,readSync as p,statSync as d}from"node:fs";export function transcriptSize(e){try{return d(e).size}catch{return null}}export function isCompleteJsonLine(e){try{return JSON.parse(e),!0}catch{return!1}}export function readNewLines(e,t,o,s=isCompleteJsonLine){if(o<t.offset&&(t.offset=0),o===t.offset)return[];const n=t.offset,r=Buffer.alloc(o-n);let f;const u=S(e,"r");try{f=p(u,r,0,r.length,n)}catch{return null}finally{y(u)}const a=r.lastIndexOf(10,f-1);if(a<0){const i=r.subarray(0,f).toString("utf8");return s(i)?(t.offset=n+f,[i]):[]}const c=r.subarray(0,a+1).toString("utf8").split(`
|
|
2
|
+
`).slice(0,-1),l=r.subarray(a+1,f).toString("utf8");return l!==""&&s(l)?(c.push(l),t.offset=n+f):t.offset=n+a+1,c}export function readTail(e,t){const o=transcriptSize(e);if(o===null)return null;const s=Math.max(0,o-t),n=Buffer.alloc(o-s),r=S(e,"r");try{const f=p(r,n,0,n.length,s);return n.subarray(0,f).toString("utf8")}catch{return null}finally{y(r)}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const m="[Request interrupted by user";function y(s){return typeof s=="string"?s:Array.isArray(s)?s.map(
|
|
2
|
-
`)){if(!
|
|
3
|
-
`)){if(!
|
|
4
|
-
`)){if(!
|
|
5
|
-
`)){if(!
|
|
6
|
-
`)){if(!
|
|
7
|
-
`);let
|
|
1
|
+
const m="[Request interrupted by user";function y(s){return typeof s=="string"?s:Array.isArray(s)?s.map(e=>{const t=e?.text;return typeof t=="string"?t:""}).join(""):""}export function interruptMarkerAt(s){let e=null;for(const t of s.split(`
|
|
2
|
+
`)){if(!t.includes(m))continue;let n;try{n=JSON.parse(t)}catch{continue}const o=n;if(o?.type!=="user"||!y(o.message?.content).startsWith(m))continue;const i=Date.parse(String(o.timestamp));Number.isFinite(i)&&(e===null||i>e)&&(e=i)}return e}const d="<synthetic>";export function currentModelAt(s){let e=null;for(const t of s.split(`
|
|
3
|
+
`)){if(!t.includes('"model"'))continue;let n;try{n=JSON.parse(t)}catch{continue}const o=n,i=o?.message?.model??o?.model;typeof i!="string"||!i||i===d||(e=i)}return e}export function currentEffortAt(s){let e=null;for(const t of s.split(`
|
|
4
|
+
`)){if(!t.includes('"effort"'))continue;let n;try{n=JSON.parse(t)}catch{continue}const o=n?.effort;typeof o!="string"||!o||(e=o)}return e}export function currentModeAt(s){let e=null;for(const t of s.split(`
|
|
5
|
+
`)){if(!t.includes("permissionMode"))continue;let n;try{n=JSON.parse(t)}catch{continue}const o=n?.permissionMode;typeof o!="string"||!o||(e=o)}return e}export function currentContextTokensAt(s){let e=null;for(const t of s.split(`
|
|
6
|
+
`)){if(!t.includes('"usage"'))continue;let n;try{n=JSON.parse(t)}catch{continue}const i=n?.message?.usage;if(!i||typeof i!="object")continue;const l=c=>typeof i[c]=="number"&&Number.isFinite(i[c])?i[c]:0,f=l("input_tokens")+l("output_tokens")+l("cache_read_input_tokens")+l("cache_creation_input_tokens");f<=0||(e=f)}return e}export function preQuestionTextAt(s){const e=/"(?:AskUserQuestion|ExitPlanMode)"/,t=s.split(`
|
|
7
|
+
`);let n=null,o="";for(let c=t.length-1;c>=0;c--){const a=t[c];if(!e.test(a))continue;let u;try{u=JSON.parse(a)}catch{continue}const r=u;if(!(r?.type!=="assistant"||!r.message?.content?.some(p=>p?.type==="tool_use"&&(p.name==="AskUserQuestion"||p.name==="ExitPlanMode")))){n=typeof r.message?.id=="string"?r.message.id:null,o=typeof r.timestamp=="string"?r.timestamp:"";break}}if(n===null)return null;const i=[];let l=o;for(const c of t){if(!c.includes(n))continue;let a;try{a=JSON.parse(c)}catch{continue}const u=a;if(!(u?.type!=="assistant"||u.message?.id!==n))for(const r of u.message?.content??[])r?.type==="text"&&typeof r.text=="string"&&r.text.trim()&&(i.push(r.text),typeof u.timestamp=="string"&&(l=u.timestamp))}const f=i.join("").trim();return f?{at:l,text:f}:null}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"node:path";import{FILE_ASSET_SPECS as
|
|
1
|
+
import t from"node:path";import{FILE_ASSET_SPECS as c}from"../shared/file-specs.js";import{readCodexMcpServers as d,removeCodexMcpServer as l,writeCodexMcpServer as u}from"./mcp.js";const i=e=>t.join(e,".codex","config.toml");export const CODEX_ASSETS={harness:"codex",targetDir(e,r,o,s){const n=c[e].dirs.codex;if(r!=="user"||!n?.user)throw new Error(`"${e}" has no Codex ${r==="user"?"user":"project"} surface`);return t.join(s,...n.user.split("/"))},projectSkillsRoots:()=>[".codex/skills",".agents/skills"],globalSkillsRoots:e=>[t.join(e,...".agents/skills".split("/")),t.join(e,...".codex/skills".split("/"))],userConfigFile:e=>i(e),mcpScopes:()=>["user"],mcpDest:(e,r)=>e==="user"?i(r):void 0,pluginCacheDir:e=>t.join(e,".codex","plugins","cache"),async mcpRead(e,r,o){if(e!=="user")throw new Error("Codex MCP servers are user-level only (~/.codex/config.toml)");return d(i(o))},async mcpWrite(e,r,o,s,n){if(e!=="user")throw new Error("Codex MCP servers are user-level only (~/.codex/config.toml)");await u(s,n,i(o))},async mcpRemove(e,r,o,s){if(e!=="user")throw new Error("Codex MCP servers are user-level only (~/.codex/config.toml)");return l(s,i(o))},classify(e){return e===".codex"||e.startsWith(".codex/")||e===".agents"||e.startsWith(".agents/")?!0:e.slice(e.lastIndexOf("/")+1)==="AGENTS.md"},ignore(e){return!(e===".codex"||e.startsWith(".codex/")||e===".agents"||e.startsWith(".agents/")||e==="AGENTS.md")}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{access as
|
|
2
|
-
`,"utf-8")}export async function readUserCapture(
|
|
1
|
+
import{access as j,mkdir as y,readFile as p,unlink as k,writeFile as E}from"node:fs/promises";import a from"node:path";import{HARNESS_EVENTS as v}from"@weavecode/core";import{generateHookHandler as H}from"../claude/capture.js";import{CANONICAL_TO_WIRE as g}from"./event-source.js";import{codexHome as x}from"./home.js";export const CODEX_HOOK_EVENTS=v.codex.map(e=>g[e]??e),CODEX_HOOK_HANDLER_MARKER="helpers/hook-handler.cjs";const O="@version weave@",C=3;function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function d(e){return e.replace(/\\/g,"/")}function h(e){return a.join(x(e),"hooks.json")}function A(e){return a.join(x(e),"helpers")}function l(e){return a.join(A(e),"hook-handler.cjs")}export function groupIsWeave(e){if(!i(e))return!1;const o=e.hooks;return Array.isArray(o)?o.some(t=>{if(!i(t))return!1;const n=t.commandWindows;return typeof t.command=="string"&&d(t.command).includes(CODEX_HOOK_HANDLER_MARKER)||typeof n=="string"&&d(n).includes(CODEX_HOOK_HANDLER_MARKER)}):!1}export function sweepWeaveHookEvents(e){if(!i(e))return{};const o={};for(const[t,n]of Object.entries(e)){if(!Array.isArray(n)){o[t]=n;continue}const r=n.filter(s=>!groupIsWeave(s));r.length>0&&(o[t]=r)}return o}export function captureHookGroup(e,o){const t=`node "${d(o)}"`;return[{hooks:[{type:"command",command:t,commandWindows:t,timeout:C,...e==="PostToolUse"||e==="PermissionRequest"?{async:!0}:{}}]}]}export function captureGroupsPresent(e){if(!i(e))return!1;const o=e.hooks;return i(o)?Object.values(o).some(t=>Array.isArray(t)&&t.some(groupIsWeave)):!1}async function _(e){try{return await j(e),!0}catch{return!1}}async function f(e){let o;try{o=await p(e,"utf-8")}catch{return{}}let t;try{t=JSON.parse(o)}catch{throw new Error(`codex hooks file is not parseable JSON: ${e}`)}if(!i(t))throw new Error(`codex hooks file is not a JSON object: ${e}`);return t}async function m(e,o){await y(a.dirname(e),{recursive:!0}),await E(e,JSON.stringify(o,null,2)+`
|
|
2
|
+
`,"utf-8")}export async function readUserCapture(e={}){const o=e.home,t=await f(h(o)).catch(()=>({}));return{installed:captureGroupsPresent(t),helperPresent:await _(l(o))}}export async function readScriptHealth(e={}){const o=e.home,t=l(o),n=(await readUserCapture({home:o})).installed;let r=null;try{r=await p(t,"utf-8")}catch{r=null}return{source:n?"user":"none",present:r!==null,weaveOwned:r!==null&&r.includes(O),generatedVersion:r?.match(/@version weave@(\S+)/)?.[1]??null,reportsInbox:!1,reportsPaneEnv:r!==null&&r.includes("terminalEnv()")}}export async function installUserCapture(e){const o=e.home,t=A(o);await y(t,{recursive:!0});const n=l(o);await E(n,H(e.version,"codex"),"utf-8");const r=h(o),s=await f(r),c=sweepWeaveHookEvents(s.hooks);for(const u of CODEX_HOOK_EVENTS){const w=c[u];c[u]=Array.isArray(w)?[...w,...captureHookGroup(u,n)]:captureHookGroup(u,n)}s.hooks=c,typeof s.description!="string"&&(s.description="weave hooks (generated \u2014 do not edit)"),await m(r,s)}export async function uninstallUserCapture(e={}){const o=e.home,t=h(o),n=await f(t).catch(()=>null);if(n){const s=sweepWeaveHookEvents(n.hooks);Object.keys(s).length===0?delete n.hooks:n.hooks=s,n.hooks===void 0&&(n.description===void 0||n.description==="weave hooks (generated \u2014 do not edit)")?await k(t).catch(()=>{}):await m(t,n)}const r=l(o);try{(await p(r,"utf-8")).includes(O)&&await k(r)}catch{}}export async function stripProjectCapture(e){const o=a.join(e,".codex","hooks.json"),t=await f(o).catch(()=>null);if(!t)return;const n=sweepWeaveHookEvents(t.hooks);Object.keys(n).length===0?delete t.hooks:t.hooks=n,await m(o,t)}export const CODEX_CAPTURE={harness:"codex",readUserCapture:e=>readUserCapture(e),installUserCapture:e=>installUserCapture(e),uninstallUserCapture:e=>uninstallUserCapture(e),stripProjectCapture,scriptHealth:e=>readScriptHealth(e)};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{spawn as p}from"node:child_process";import{readdir as m,readFile as f,stat as
|
|
2
|
-
`).find(
|
|
3
|
-
`)};
|
|
4
|
-
`))>=0;){const
|
|
1
|
+
import{spawn as p}from"node:child_process";import{readdir as m,readFile as f,stat as y}from"node:fs/promises";import{homedir as k}from"node:os";import r from"node:path";import{codexCommandLine as S}from"./plugins.js";const x=[{name:"model",description:"Choose what model and reasoning effort to use",source:"builtin"},{name:"approvals",description:"Choose what Codex can do without approval",source:"builtin"},{name:"new",description:"Start a new chat during a conversation",source:"builtin"},{name:"init",description:"Create an AGENTS.md file with project instructions",source:"builtin"},{name:"compact",description:"Summarize the conversation to free context",source:"builtin"},{name:"diff",description:"Show the diff of the working tree",source:"builtin"},{name:"mention",description:"Mention a file in the conversation",argsHint:"<path>",source:"builtin"},{name:"status",description:"Show session configuration and token usage",source:"builtin"},{name:"mcp",description:"List configured MCP tools",source:"builtin"},{name:"prompts",description:"Browse and use custom prompts",source:"builtin"},{name:"skills",description:"Browse and use skills",source:"builtin"},{name:"plugins",description:"Browse and manage plugins",source:"builtin"},{name:"review",description:"Review the current changes",source:"builtin"},{name:"undo",description:"Undo the last turn",source:"builtin"},{name:"statusline",description:"Configure the status line",source:"builtin"},{name:"logout",description:"Sign out of your account",source:"builtin"},{name:"quit",description:"Exit Codex",source:"builtin"}];function h(t){const e=/^---\r?\n([\s\S]*?)\r?\n---/.exec(t)?.[1]??"",i=/^description:\s*(.+)$/m.exec(e)?.[1]?.trim().replace(/^["']|["']$/g,"");return i||(t.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,"").split(`
|
|
2
|
+
`).find(s=>s.trim()!==""&&!s.startsWith("#"))?.trim()??"")}async function w(t){try{const e=await y(t);return e.isDirectory()?"dir":e.isFile()?"file":"other"}catch{return"other"}}async function v(t){try{const e=[];for(const i of await m(t,{withFileTypes:!0})){if(!i.name.endsWith(".md"))continue;const n=r.join(t,i.name);(i.isFile()||i.isSymbolicLink()&&await w(n)==="file")&&e.push(n)}return e}catch{return[]}}async function C(t){try{const e=[];for(const i of await m(t,{withFileTypes:!0})){const n=r.join(t,i.name);(i.isDirectory()||i.isSymbolicLink()&&await w(n)==="dir")&&e.push(n)}return e}catch{return[]}}async function j(t){const e=[];for(const i of await v(t)){const n=h(await f(i,"utf8").catch(()=>""));e.push({name:r.basename(i,".md"),description:n,source:"command"})}return e}async function O(t){const e=[];for(const i of await C(t)){const n=h(await f(r.join(i,"SKILL.md"),"utf8").catch(()=>""));e.push({name:r.basename(i),description:n,source:"skill",sigil:"$",inline:!0})}return e}function L(t){const e=t?.data;if(!Array.isArray(e))return null;const i=[];for(const n of e){const s=n?.skills;if(Array.isArray(s))for(const c of s){const o=c;typeof o.name!="string"||o.enabled===!1||i.push({name:o.name,description:typeof o.description=="string"?o.description:"",source:typeof o.pluginId=="string"?"plugin":"skill",sigil:"$",inline:!0})}}return i}const M=1e4;function I(t){return new Promise(e=>{const i=process.platform==="win32",n=p(i?process.env.ComSpec||"cmd.exe":"codex",i?["/d","/s","/c",S(["app-server"])]:["app-server"],{windowsHide:!0,windowsVerbatimArguments:i,stdio:["pipe","pipe","pipe"]});let s=!1,c="";const o=a=>{s||(s=!0,clearTimeout(g),i&&n.pid!==void 0?p("taskkill",["/pid",String(n.pid),"/t","/f"],{windowsHide:!0,stdio:"ignore"}).unref():n.kill("SIGKILL"),e(a))},g=setTimeout(()=>o(null),M),l=a=>{n.stdin?.write(`${JSON.stringify(a)}
|
|
3
|
+
`)};n.on("error",()=>o(null)),n.on("exit",()=>o(null)),n.stdin?.on("error",()=>o(null)),l({jsonrpc:"2.0",id:1,method:"initialize",params:{clientInfo:{name:"weave",title:"weave",version:"1.0.0"}}}),n.stdout?.setEncoding("utf8"),n.stdout?.on("data",a=>{c+=a;let d;for(;(d=c.indexOf(`
|
|
4
|
+
`))>=0;){const b=c.slice(0,d);c=c.slice(d+1);let u=null;try{u=JSON.parse(b)}catch{continue}if(u?.id===1){l({jsonrpc:"2.0",method:"initialized",params:{}}),l({jsonrpc:"2.0",id:2,method:"skills/list",params:{cwds:[t]}});continue}u?.id===2&&o(L(u.result))}})})}function T(t){const e=new Set;return t.filter(i=>e.has(i.name)?!1:(e.add(i.name),!0))}export function createCodexCommandSurface(t={}){const e=t.skills??I;return{harness:"codex",inputModes:[{kind:"slash",sigil:"/",named:!0}],async list({projectPath:i,homedir:n=k()}){const s=process.env.CODEX_HOME??r.join(n,".codex");return T([...x,...await j(r.join(s,"prompts")),...await e(i)??await O(r.join(s,"skills"))])},executions:()=>Promise.resolve(null)}}export const CODEX_COMMANDS=createCodexCommandSurface();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"node:fs/promises";import{homedir as k}from"node:os";import f from"node:path";import{parse as m}from"smol-toml";import{CODEX_CONFIG_GROUPS as S,CODEX_CONFIG_KEYS as b}from"./config-catalog.generated.js";import{codexHome as g}from"./home.js";import{CodexTomlCorruptError as y,setTomlValueInText as x}from"./toml.js";const A=[{id:"user",profiles:!0},{id:"project",profiles:!1}];function h(e,t){switch(e){case"user":return f.join(g(t.homedir),"config.toml");case"project":return f.join(t.projectPath??"",".codex","config.toml");default:return""}}function _(e){return e==="project"?b.filter(t=>t.scope!=="user"):b}function $(e){return new Set(_(e).map(t=>t.key.split(".")[0]))}function p(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function C(e){const t=[],r=e.mcp_servers;return p(r)&&"weave"in r&&t.push("mcp_servers.weave"),t}function F(e,t){let r=e.trim();return r==="~"?t:((r.startsWith("~/")||r.startsWith("~\\"))&&(r=f.join(t,r.slice(2))),f.isAbsolute(r)?r:f.join(g(t),r))}async function T(e){const t=e.values.model_catalog_json;if(typeof t!="string"||!t.trim())return{models:[],baseUrl:"",credential:"none"};const r=F(t,e.homedir??k());let o;try{o=await d.readFile(r,"utf-8")}catch{throw new Error(`model_catalog_json \u6307\u5411\u7684\u6587\u4EF6\u8BFB\u4E0D\u5230\uFF1A${r}`)}let s;try{s=JSON.parse(o)}catch{throw new Error(`model_catalog_json \u4E0D\u662F\u5408\u6CD5 JSON\uFF1A${r}`)}const i=p(s)?s.models:null;if(!Array.isArray(i))throw new Error("model catalog \u7F3A models \u6570\u7EC4");const a=[];for(const n of i)!p(n)||typeof n.slug!="string"||a.push({id:n.slug,...typeof n.display_name=="string"?{name:n.display_name}:{},...typeof n.description=="string"?{createdAt:n.description}:{}});return{models:a,baseUrl:"",credential:"none"}}export async function ensureTrustAccepted(e){const t=f.join(g(),"config.toml");let r="";try{r=await d.readFile(t,"utf-8")}catch{}let o;try{o=m(r)}catch(u){throw new y(`${t} is not valid TOML \u2014 refusing to write: ${u instanceof Error?u.message:String(u)}`)}const s=f.resolve(e),i=p(o.projects)?o.projects:{},a=(u,O)=>process.platform==="win32"?u.toLowerCase().replaceAll("/","\\")===O.toLowerCase().replaceAll("/","\\"):u===O,l=Object.keys(i).find(u=>a(u,s))??L(s),c=x(r,["projects",l,"trust_level"],"trusted");c!==r&&(await d.mkdir(f.dirname(t),{recursive:!0}),await d.writeFile(t,c,"utf-8"))}function L(e){return process.platform==="win32"?e.toLowerCase():e}export const CODEX_CONFIG={harness:"codex",files(e){return A.map(t=>({id:t.id,profiles:t.profiles,path:r=>h(t.id,r)}))},catalog(e){const t=_(e);return{groups:S.filter(r=>t.some(o=>o.group===r)),keys:t,envVars:[]}},async read(e,t){const r=h(e,t);let o;try{o=await d.readFile(r,"utf-8")}catch{return{}}let s;try{s=m(o)}catch(n){throw new y(`${r} is not valid TOML \u2014 refusing to read: ${n instanceof Error?n.message:String(n)}`)}if(!p(s))return{};const i=$(e),a={};for(const n of i)n in s&&(a[n]=s[n]);return a},async write(e,t,r){const o=h(e,t);let s="";try{s=await d.readFile(o,"utf-8")}catch{}let i;try{i=m(s)}catch(c){throw new y(`${o} is not valid TOML \u2014 refusing to write: ${c instanceof Error?c.message:String(c)}`)}const a=$(e),n={...i};for(const c of Object.keys(i))a.has(c)&&!(c in r)&&delete n[c];for(const[c,u]of Object.entries(r))a.has(c.split(".")[0])&&(n[c]=u);const l=E(n);await d.mkdir(f.dirname(o),{recursive:!0}),await d.writeFile(o,l,"utf-8")},managedKeys:C,managedEntries(){return[]},models:T,rawFormat:"toml",parseRaw(e){const t=m(e);if(!p(t))throw new Error("\u9876\u5C42\u5FC5\u987B\u662F\u8868");return t},serializeRaw(e){return E(e)}};function E(e){const t=[],r=(o,s)=>{const i=[],a=[];for(const[n,l]of Object.entries(s))p(l)&&!N(l)?a.push([n,l]):i.push(`${w(n)} = ${j(l)}`);o.length>0&&(i.length>0||a.length===0)&&(t.length>0&&t.push(""),t.push(`[${o.map(w).join(".")}]`)),t.push(...i);for(const[n,l]of a)r([...o,n],l)};return r([],e),t.length>0?`${t.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`:""}function
|
|
3
|
+
`:""}function N(e){return Object.keys(e).length===0}function w(e){return/^[A-Za-z0-9_-]+$/.test(e)?e:JSON.stringify(e)}function j(e){return e==null?'""':typeof e=="boolean"?e?"true":"false":typeof e=="number"?Number.isFinite(e)?String(e):'""':typeof e=="string"?K(e):Array.isArray(e)?`[${e.map(j).join(", ")}]`:`{ ${Object.entries(e).filter(([,r])=>r!==void 0).map(([r,o])=>`${w(r)} = ${j(o)}`).join(", ")} }`}function K(e){const t=e.includes("\\"),r=!e.includes("'")&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f\n]/.test(e);return t&&r?`'${e}'`:JSON.stringify(e)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as n}from"node:fs";import s from"node:path";const t=[".codex","AGENTS.md"];function o(e){return t.some(r=>n(s.join(e,r)))}export const CODEX_DETECTOR={markers:t,present:o,detect:e=>({harness:"codex",present:o(e)})};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{HARNESS_EVENTS as _}from"@weavecode/core";import{capFields as
|
|
2
|
-
`)||null}export function promptOfLine(
|
|
1
|
+
import{HARNESS_EVENTS as _}from"@weavecode/core";import{capFields as a}from"../shared/json-cap.js";import{CLAUDE_EVENT_SOURCE as g}from"../claude/event-source.js";const u={Interrupt:"TurnAborted"};export const CANONICAL_TO_WIRE=Object.fromEntries(Object.entries(u).map(([n,t])=>[t,n]));export function metaOfLine(n){if(n.type!=="session_meta")return null;const t=n.payload??{};return typeof t.session_id!="string"||!t.session_id?null:{sessionId:t.session_id,cwd:typeof t.cwd=="string"&&t.cwd?t.cwd:null}}function i(n){return Array.isArray(n)&&n.map(e=>{const o=e;return(typeof o?.type=="string"?o.type.toLowerCase():"")==="text"&&typeof o.text=="string"?o.text:""}).filter(Boolean).join(`
|
|
2
|
+
`)||null}export function promptOfLine(n){const t=n.payload??{};if(t.type==="user_message")return typeof t.message=="string"&&t.message?t.message:null;if(t.type!=="item_completed")return null;const e=t.item;return e?.type!=="UserMessage"?null:i(e.content)}function p(n){const t=n.payload??{};if(t.type!=="item_completed")return null;const e=t.item;if(!e||typeof e!="object")return null;const o=e.type;return typeof o=="string"?{type:o,item:e}:null}export class CodexTurnBuffer{last=null;report(t){const e=t.payload??{},o=typeof e.type=="string"?e.type:null,s=p(t);if(o==="agent_message")return typeof e.message=="string"&&e.message&&(this.last=e.message),null;if(s?.type==="AgentMessage"){const r=i(s.item.content);return r&&(this.last=r),null}if(promptOfLine(t)!==null)return this.last=null,{eventType:"UserPromptSubmit",payload:{line:t}};if(t.type==="session_meta")return{eventType:"SessionStart",payload:{line:t}};if(o==="task_started")return this.last=null,null;if(o==="task_complete"){const r=this.last;return this.last=null,{eventType:"Stop",payload:{line:t,lastAgentMessage:r}}}return o==="turn_aborted"?{eventType:"TurnAborted",payload:{line:t}}:o==="exec_command_end"||o==="patch_apply_end"?{eventType:"PostToolUse",payload:{line:t}}:s?.type==="CommandExecution"||s?.type==="FileChange"||s?.type==="McpToolCall"?{eventType:"PostToolUse",payload:{line:t}}:null}}function c(n){return Array.isArray(n)?n.filter(t=>typeof t=="string").join(" "):typeof n=="string"?n:null}function x(n){const t=n.payload??{};if(t.type==="exec_command_end")return{toolName:"exec_command",toolInput:{command:c(t.command),cwd:t.cwd??null},toolResponse:{exit_code:t.exit_code??null,status:t.status??null}};if(t.type==="patch_apply_end"){const o=t.changes&&typeof t.changes=="object"?t.changes:{};return{toolName:"apply_patch",toolInput:{paths:Object.keys(o)},toolResponse:{success:t.success??null}}}const e=p(n);if(e?.type==="CommandExecution")return{toolName:"exec_command",toolInput:{command:c(e.item.command),cwd:e.item.cwd??null},toolResponse:{exit_code:e.item.exit_code??null,status:e.item.status??null}};if(e?.type==="FileChange"){const o=e.item.changes&&typeof e.item.changes=="object"?e.item.changes:{};return{toolName:"apply_patch",toolInput:{paths:Object.keys(o)},toolResponse:{status:e.item.status??null}}}return e?.type==="McpToolCall"?{toolName:typeof e.item.name=="string"?e.item.name:"mcp_tool_call",toolInput:e.item.arguments??null,toolResponse:e.item.result??e.item.status??null}:{toolName:null,toolInput:null,toolResponse:null}}function T(n,t){return typeof n.last_agent_message=="string"&&n.last_agent_message?n.last_agent_message:t??null}function h(n){const t=n.error;if(typeof t=="string"&&t)return t;if(t&&typeof t=="object"){const e=t.message;if(typeof e=="string"&&e)return e}return null}export class CodexEventSource{source="codex";events=_.codex;normalize(t,e){const o=t??{};return typeof o.payload=="string"?O(o,e):w(o,e)}}function O(n,t){const e=n.eventType||"unknown",o=u[e]??e;return{...g.normalize({...n,eventType:o},t),source:"codex"}}function w(n,t){const e=n.payload?.line??{},o=e.payload??{},s=n.eventType||"unknown",r={};if(s==="UserPromptSubmit")r.prompt=promptOfLine(e)??"";else if(s==="Stop"){r.last_assistant_message=T(o,n.payload?.lastAgentMessage);const l=h(o);l&&(r.error=l)}else s==="TurnAborted"?(r.reason=o.reason??null,r.duration_ms=o.duration_ms??null):s==="SessionStart"&&(r.source="rollout");e.ordinal!==void 0&&(r.seq=e.ordinal);const{toolName:m,toolInput:f,toolResponse:y}=x(e),d={eventType:s,toolName:m,toolInput:a(f),toolResponse:a(y),cwd:n.cwd??null,raw:{...r,turn_id:o.turn_id??null,call_id:o.call_id??null}};return{projectId:t,source:"codex",eventType:s,sessionId:n.sessionId,payload:JSON.stringify(d)}}export const CODEX_EVENT_SOURCE=new CodexEventSource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createReadStream as f}from"node:fs";import{createInterface as u}from"node:readline";const
|
|
1
|
+
import{createReadStream as f}from"node:fs";import{createInterface as u}from"node:readline";const m=new Set(["image/png","image/jpeg","image/gif","image/webp"]),p=10*1024*1024,l=/^data:([^;,]+);base64,(.*)$/s;function y(e){if(!Array.isArray(e))return[];const t=[];for(const i of e){if(!i||typeof i!="object")continue;const o=i;if(o.type!=="image")continue;const n=typeof o.image_url=="string"?o.image_url:null;if(!n)continue;const c=l.exec(n);if(!c)continue;const r=c[1];if(!m.has(r))continue;const s=Buffer.from(c[2],"base64");s.length===0||s.length>p||t.push({mediaType:r,bytes:s})}return t}function g(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"&&t.type==="text"?String(t.text??""):"").join(""):""}export const CODEX_IMAGES={async sessionImages({transcriptPath:e}){if(!e)return null;const t=[],i=u({input:f(e,{encoding:"utf8"}),crlfDelay:1/0});try{for await(const o of i){if(!o.includes('"type":"image"'))continue;const n=JSON.parse(o);if(n.type!=="event_msg")continue;const c=n.payload;if(c?.type!=="item_completed")continue;const r=c.item;if(r?.type!=="UserMessage")continue;const s=r.content,a=y(s);a.length!==0&&t.push({text:g(s),at:typeof n.timestamp=="string"?n.timestamp:null,images:a})}}catch{return null}finally{i.close()}return t}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CODEX_ASSETS as o}from"./assets.js";import{CODEX_CAPTURE as r}from"./capture.js";import{CODEX_CONFIG as e}from"./config.js";import{CODEX_DETECTOR as E}from"./detect.js";import{CODEX_EVENT_SOURCE as t}from"./event-source.js";import{CODEX_IMAGES as
|
|
1
|
+
import{CODEX_ASSETS as o}from"./assets.js";import{CODEX_CAPTURE as r}from"./capture.js";import{CODEX_CONFIG as e}from"./config.js";import{CODEX_DETECTOR as E}from"./detect.js";import{CODEX_EVENT_SOURCE as t}from"./event-source.js";import{CODEX_IMAGES as m}from"./images.js";import{CODEX_NARRATION as C}from"./narration.js";import{CODEX_MESSAGING as O}from"./messaging.js";import{CODEX_PLUGINS as i}from"./plugins.js";import{CODEX_PLUGIN_STATE as p}from"./plugin-state.js";import{CODEX_PROVISION as s}from"./provision.js";import{CODEX_QUESTIONS as _}from"./questions.js";import{CODEX_RESUME as f}from"./resume.js";import{CODEX_LOG_SOURCE as D}from"./rollout.js";import{CODEX_COMMANDS as S}from"./commands.js";import{CODEX_LIVENESS as X}from"./liveness.js";import{CODEX_TITLES as n}from"./titles.js";export{CODEX_DETECTOR}from"./detect.js";export{CODEX_PLUGIN_STATE}from"./plugin-state.js";export{CODEX_IMAGES}from"./images.js";export{CODEX_NARRATION}from"./narration.js";export{CODEX_MESSAGING}from"./messaging.js";export{CODEX_QUESTIONS}from"./questions.js";export{CODEX_RESUME}from"./resume.js";export{CODEX_EVENT_SOURCE,CodexEventSource,CodexTurnBuffer}from"./event-source.js";export{CODEX_LOG_SOURCE,CodexLogSource}from"./rollout.js";export{CODEX_CAPTURE}from"./capture.js";export{codexInterruptMarkerAt}from"./transcript.js";export{CODEX_PLUGINS,createCodexPluginSurface,CODEX_MARKETPLACE}from"./plugins.js";export{CODEX_CONFIG,ensureTrustAccepted as ensureCodexTrustAccepted}from"./config.js";export{CODEX_PROVISION,codexProvisionCheck}from"./provision.js";export*from"./mcp.js";export*from"./toml.js";export{CODEX_COMMANDS}from"./commands.js";export{CODEX_LIVENESS,codexLivenessById,codexThreadLockDir,CODEX_LOCK_GRACE_MS}from"./liveness.js";export{CODEX_TITLES,codexSessionTitleOf,codexSetSessionTitle}from"./titles.js";export const CODEX_DRIVER={id:"codex",displayName:"Codex",capabilities:["assets","detect","plugins","pluginState","messaging","resume","events","capture","logs","config","commands","provision","liveness","images","narration","questions"],assets:o,detect:E,plugins:i,pluginState:p,messaging:O,resume:f,events:t,capture:r,logs:D,config:e,commands:S,provision:s,liveness:X,images:m,narration:C,questions:_,titles:n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readdirSync as
|
|
1
|
+
import{readdirSync as f,statSync as m}from"node:fs";import u from"node:path";import{codexHome as w}from"./home.js";export const CODEX_LOCK_GRACE_MS=9e4;const h=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.lock$/i;export function codexThreadLockDir(o){return u.join(w(o),"thread-writer-locks")}async function S(o,a){const{spawn:r}=await import("node:child_process"),i=t=>t.replace(/'/g,"''"),s=["$results = @()",...o.map(t=>{const p=u.win32.join(a,t);return`try { [void][IO.File]::Open('${i(p)}','Open','ReadWrite','None') } catch [IO.IOException] { $results += '${i(t)}' }`}),'$results -join "`n"'].join("; ");return new Promise(t=>{let p="";const c=r("powershell",["-NoProfile","-NonInteractive","-Command",s],{windowsHide:!0,stdio:["ignore","pipe","pipe"]}),e=setTimeout(()=>{c.kill("SIGKILL"),t(new Set)},5e3);c.stdout?.on("data",n=>p+=n.toString()),c.on("error",()=>{clearTimeout(e),t(new Set)}),c.on("close",()=>{clearTimeout(e),t(new Set(p.split(/\r?\n/).map(n=>n.trim()).filter(Boolean)))})})}async function y(){return new Set}const d=new Map;export async function codexLivenessById(o,a=Date.now()){const r=codexThreadLockDir(o);let i;try{i=f(r)}catch{return new Map}const s=i.filter(e=>h.test(e)),p=await(s.length===0?async()=>new Set:process.platform==="win32"?e=>S(e,r):()=>y())(s),c=new Map;for(const e of s){const n=e.replace(/\.lock$/i,"");if(p.has(e)){d.set(n,a),c.set(n,!0);continue}let l=d.get(n);if(l===void 0){try{l=m(u.join(r,e)).mtimeMs}catch{continue}d.set(n,l)}a-l>=CODEX_LOCK_GRACE_MS&&c.set(n,!1)}return c}export const CODEX_LIVENESS={harness:"codex",alive(o){return codexLivenessById().then(a=>{if(!o)return a;const r=new Map;for(const i of o){const s=a.get(i);s!==void 0&&r.set(i,s)}return r})}};
|