@namzu/cli 53.0.1 → 53.2.0
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/CHANGELOG.md +85 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-IOWTKF2X.js → acp-3FNB6MSI.js} +101 -82
- package/dist/chunks/acp-3FNB6MSI.js.map +6 -0
- package/dist/chunks/{activity-command-U2AOTIVF.js → activity-command-IBOJOCRF.js} +15 -15
- package/dist/chunks/{add-YYQLPCP2.js → add-LYBL3IC7.js} +27 -27
- package/dist/chunks/{agent-WL6NX4W6.js → agent-LTLWJW3P.js} +47 -43
- package/dist/chunks/agent-session-BD2AHK5S.js +77 -0
- package/dist/chunks/{apply-at-exit-BRXYTQVG.js → apply-at-exit-7BF3KBU2.js} +8 -8
- package/dist/chunks/{archive-UE756BME.js → archive-FCPUCOYT.js} +14 -14
- package/dist/chunks/{bin-main-XR2DJOI6.js → bin-main-AVPCWJHJ.js} +14 -14
- package/dist/chunks/{binding-HCIPLFUO.js → binding-OZCOSUYV.js} +3 -3
- package/dist/chunks/{browser-7SFVCKSO.js → browser-LR25NVO7.js} +6 -6
- package/dist/chunks/{chat-K6GQGRUA.js → chat-PP7XU7US.js} +22 -22
- package/dist/chunks/{chunk-3NAVAACC.js → chunk-2KNLSJFS.js} +2 -2
- package/dist/chunks/{chunk-2VSICYQP.js → chunk-2O6LZGGG.js} +2 -2
- package/dist/chunks/{chunk-V7VNFYA4.js → chunk-32LCSSAN.js} +18 -14
- package/dist/chunks/chunk-32LCSSAN.js.map +6 -0
- package/dist/chunks/{chunk-Z5NMQ2YN.js → chunk-3Q42HHZM.js} +2 -2
- package/dist/chunks/{chunk-RAPO3KLG.js → chunk-3WTIGIDA.js} +4 -4
- package/dist/chunks/chunk-4JBQTRTF.js +452 -0
- package/dist/chunks/chunk-4JBQTRTF.js.map +6 -0
- package/dist/chunks/{chunk-NICPMJJQ.js → chunk-4KMFIIWV.js} +6 -5
- package/dist/chunks/{chunk-NICPMJJQ.js.map → chunk-4KMFIIWV.js.map} +1 -1
- package/dist/chunks/{chunk-5NDRDTNX.js → chunk-4NVFHP23.js} +6 -6
- package/dist/chunks/chunk-4NVFHP23.js.map +6 -0
- package/dist/chunks/{chunk-FX7BSCB4.js → chunk-4Q4J3KDG.js} +4 -4
- package/dist/chunks/{chunk-KO2N6EIF.js → chunk-4VB264C5.js} +13 -13
- package/dist/chunks/{chunk-HJILJSZO.js → chunk-4VXS3UYL.js} +2 -2
- package/dist/chunks/{chunk-2WDF5N2A.js → chunk-5FEAC3G5.js} +9 -9
- package/dist/chunks/{chunk-BHOZPFJM.js → chunk-5HCZHDPA.js} +5 -5
- package/dist/chunks/chunk-5OAKUXE3.js +41 -0
- package/dist/chunks/chunk-5OAKUXE3.js.map +6 -0
- package/dist/chunks/{chunk-U4XNJBDB.js → chunk-5WORROIE.js} +8 -1
- package/dist/chunks/{chunk-U4XNJBDB.js.map → chunk-5WORROIE.js.map} +1 -1
- package/dist/chunks/{chunk-Z5FDI74K.js → chunk-5YNAPIUZ.js} +6 -6
- package/dist/chunks/{chunk-A47ZNTW7.js → chunk-6SHOR62K.js} +3 -3
- package/dist/chunks/{chunk-46VSU4QF.js → chunk-72IJ3FQU.js} +2 -2
- package/dist/chunks/{chunk-DHS5CQNC.js → chunk-AO4A56EG.js} +12 -12
- package/dist/chunks/{chunk-KAPCNFMC.js → chunk-BFCUL4BW.js} +3 -3
- package/dist/chunks/{chunk-DOFQWVBL.js → chunk-CKWDYYBE.js} +3 -3
- package/dist/chunks/{chunk-J3PHMXN4.js → chunk-CSBKGTBA.js} +4 -4
- package/dist/chunks/{chunk-ZMKEYARZ.js → chunk-D3JJE6VZ.js} +6 -6
- package/dist/chunks/{chunk-UWN4WNQZ.js → chunk-DEEK2FOC.js} +2 -2
- package/dist/chunks/chunk-DEH4YIDN.js +247 -0
- package/dist/chunks/chunk-DEH4YIDN.js.map +6 -0
- package/dist/chunks/{chunk-F3SQRGKZ.js → chunk-DSMBM5LQ.js} +2 -2
- package/dist/chunks/chunk-DZBCLR75.js +526 -0
- package/dist/chunks/chunk-DZBCLR75.js.map +6 -0
- package/dist/chunks/{chunk-4FV2VZS6.js → chunk-EC2F3CWT.js} +3 -3
- package/dist/chunks/{chunk-OBMHA7OP.js → chunk-EMXH2RJN.js} +3 -3
- package/dist/chunks/{chunk-MYVF3JRV.js → chunk-EQGE25MQ.js} +6 -6
- package/dist/chunks/{chunk-RDW6L3PV.js → chunk-F2TXNDKC.js} +3 -3
- package/dist/chunks/{chunk-UMHKTV2L.js → chunk-FAWY4LRG.js} +3 -3
- package/dist/chunks/{chunk-LMLJ7NS5.js → chunk-FK6WJQ5T.js} +5 -5
- package/dist/chunks/{chunk-EKMHZKVP.js → chunk-FRADQASS.js} +2 -2
- package/dist/chunks/{chunk-N56NUKMT.js → chunk-FS7CUHOG.js} +2 -2
- package/dist/chunks/{chunk-C5XQHEYB.js → chunk-GFZFGTDZ.js} +2 -2
- package/dist/chunks/{chunk-VVWI4EB7.js → chunk-GXCOSOVM.js} +3 -3
- package/dist/chunks/{chunk-TI6FFONP.js → chunk-HJJNIG33.js} +2 -2
- package/dist/chunks/{chunk-MHXJYXOF.js → chunk-HUDP4HTK.js} +5 -5
- package/dist/chunks/{chunk-SHUA4YUK.js → chunk-IBPN346S.js} +2 -2
- package/dist/chunks/chunk-IERT7D34.js +226 -0
- package/dist/chunks/chunk-IERT7D34.js.map +6 -0
- package/dist/chunks/{chunk-Z6J7SVOB.js → chunk-IPAGLYU3.js} +2 -2
- package/dist/chunks/{chunk-ZDZ35MMZ.js → chunk-ISHCON5Z.js} +2 -2
- package/dist/chunks/{chunk-FEIIR46G.js → chunk-J6I6MCWR.js} +5 -5
- package/dist/chunks/{chunk-HGZYNEQE.js → chunk-JFLX34FA.js} +14 -7
- package/dist/chunks/chunk-JFLX34FA.js.map +6 -0
- package/dist/chunks/{chunk-YELRULQ7.js → chunk-JTEWIH66.js} +4478 -2713
- package/dist/chunks/chunk-JTEWIH66.js.map +6 -0
- package/dist/chunks/{chunk-X6SREM2V.js → chunk-JXJIKAAE.js} +7 -7
- package/dist/chunks/{chunk-POOJ2MUS.js → chunk-K3QEZ7D7.js} +3 -3
- package/dist/chunks/{chunk-4RTQTX5R.js → chunk-KFWQSTT3.js} +2 -2
- package/dist/chunks/{chunk-DI4L3GH5.js → chunk-KHQAU33M.js} +2 -2
- package/dist/chunks/{chunk-CCYAWSZL.js → chunk-KNBFV3DC.js} +5 -5
- package/dist/chunks/{chunk-HTHNDZ3L.js → chunk-L2Q7APTU.js} +2 -2
- package/dist/chunks/{chunk-DIWEKTYK.js → chunk-LHZ632YK.js} +5 -5
- package/dist/chunks/chunk-LQZIENWB.js +686 -0
- package/dist/chunks/chunk-LQZIENWB.js.map +6 -0
- package/dist/chunks/{chunk-TYTE2GIF.js → chunk-LWYW2DAK.js} +5 -5
- package/dist/chunks/{chunk-NZMKMXGG.js → chunk-MKAQAKHE.js} +2 -2
- package/dist/chunks/{chunk-QPR3UA4L.js → chunk-MXJAJXE7.js} +2 -2
- package/dist/chunks/{chunk-SPSWX3QZ.js → chunk-MXR77LCX.js} +2 -2
- package/dist/chunks/{chunk-PSLNHLZI.js → chunk-NSGEVYJC.js} +3 -3
- package/dist/chunks/{chunk-EKQ6J5KA.js → chunk-O4GHSR2X.js} +2 -2
- package/dist/chunks/chunk-P3LYPSD6.js +137 -0
- package/dist/chunks/chunk-P3LYPSD6.js.map +6 -0
- package/dist/chunks/{chunk-J7SA5BCI.js → chunk-PNEFIK4E.js} +4 -4
- package/dist/chunks/chunk-PTPVAPCA.js +44 -0
- package/dist/chunks/chunk-PTPVAPCA.js.map +6 -0
- package/dist/chunks/{chunk-XHLFI6F6.js → chunk-QXKCTJWO.js} +2 -2
- package/dist/chunks/{chunk-P7FHJL3V.js → chunk-SK3JQNO5.js} +2 -2
- package/dist/chunks/{chunk-RJWPNAYL.js → chunk-SU5VBBRS.js} +12 -12
- package/dist/chunks/{chunk-SVMGV4AS.js → chunk-SWH4CAIH.js} +56 -47
- package/dist/chunks/chunk-SWH4CAIH.js.map +6 -0
- package/dist/chunks/{chunk-7AWFHVMT.js → chunk-T2CHZ6V7.js} +3 -3
- package/dist/chunks/{chunk-P5E6ITP5.js → chunk-TE4MIRMA.js} +5 -5
- package/dist/chunks/{chunk-24N42TGE.js → chunk-THOVK7I5.js} +6 -6
- package/dist/chunks/{chunk-YSKCWH72.js → chunk-TIMEEDY6.js} +203 -32
- package/dist/chunks/chunk-TIMEEDY6.js.map +6 -0
- package/dist/chunks/{chunk-DSKNFDTL.js → chunk-TLTD26JG.js} +2 -2
- package/dist/chunks/{chunk-CQKYKQEF.js → chunk-TUEZKY7I.js} +4 -4
- package/dist/chunks/{chunk-LOWGGJOB.js → chunk-U3IK5VKD.js} +6 -111
- package/dist/chunks/chunk-U3IK5VKD.js.map +6 -0
- package/dist/chunks/{chunk-2U357RJS.js → chunk-UUQY5P7K.js} +10 -10
- package/dist/chunks/{chunk-WOSL3OZD.js → chunk-VBRCNXMM.js} +4 -4
- package/dist/chunks/{chunk-VYLCV6W3.js → chunk-VI66HXJT.js} +9 -9
- package/dist/chunks/{chunk-HOKSVFIC.js → chunk-VQ5KK7YF.js} +79 -7
- package/dist/chunks/chunk-VQ5KK7YF.js.map +6 -0
- package/dist/chunks/{chunk-AGFGC7SI.js → chunk-VQCP7LOK.js} +3 -3
- package/dist/chunks/{chunk-OAHCS42A.js → chunk-VTS2SVX6.js} +2 -2
- package/dist/chunks/{chunk-HUONDMU4.js → chunk-W5TE6NIA.js} +2 -2
- package/dist/chunks/{chunk-UJOWXA23.js → chunk-WDY7OHLQ.js} +777 -261
- package/dist/chunks/chunk-WDY7OHLQ.js.map +6 -0
- package/dist/chunks/{chunk-ZZNHDQAD.js → chunk-WV45Z5QQ.js} +2 -2
- package/dist/chunks/{chunk-TUXH7IXQ.js → chunk-X44EPHHA.js} +2 -2
- package/dist/chunks/{chunk-6CFPN6I4.js → chunk-XFCFWWFK.js} +2 -2
- package/dist/chunks/{chunk-PV65WQHD.js → chunk-XGS5WUCQ.js} +12 -12
- package/dist/chunks/{chunk-NTV2XD2J.js → chunk-Y4MKRX73.js} +2 -2
- package/dist/chunks/{chunk-WSMX3IQE.js → chunk-YCJOAIDG.js} +518 -395
- package/dist/chunks/chunk-YCJOAIDG.js.map +6 -0
- package/dist/chunks/{chunk-SB3A7KUJ.js → chunk-YDGUEMBB.js} +4 -4
- package/dist/chunks/{chunk-7JT7DNR7.js → chunk-YIZXVNUY.js} +3 -3
- package/dist/chunks/{chunk-PYSZ7JTU.js → chunk-YNBAVIQA.js} +2 -2
- package/dist/chunks/{chunk-O326HKCW.js → chunk-YPLYAESJ.js} +3 -3
- package/dist/chunks/{chunk-5I45HTKW.js → chunk-ZH5MQMMF.js} +182 -40
- package/dist/chunks/chunk-ZH5MQMMF.js.map +6 -0
- package/dist/chunks/{chunk-M3AUPUII.js → chunk-ZI5FFFBJ.js} +6 -6
- package/dist/chunks/{chunk-EA73SWCT.js → chunk-ZIRQSGOG.js} +4 -4
- package/dist/chunks/{chunk-HOB6FTE2.js → chunk-ZVLTZDC4.js} +5 -4
- package/dist/chunks/{chunk-HOB6FTE2.js.map → chunk-ZVLTZDC4.js.map} +1 -1
- package/dist/chunks/{chunk-KNQ7R54U.js → chunk-ZZK2BVEH.js} +911 -670
- package/dist/chunks/chunk-ZZK2BVEH.js.map +6 -0
- package/dist/chunks/{cli-runtime-SVXU6U4V.js → cli-runtime-V2FI7PIQ.js} +25 -25
- package/dist/chunks/{commands-A2E3OV7F.js → commands-R2LZBXLK.js} +5 -5
- package/dist/chunks/{cost-NA7APCZD.js → cost-PQWWLMOO.js} +8 -8
- package/dist/chunks/{crash-report-C6QXQJAK.js → crash-report-MY27ZDU6.js} +9 -9
- package/dist/chunks/{dist-3PE5MOU6.js → dist-3HCAPKP5.js} +2 -2
- package/dist/chunks/{dist-5SZ7VOLE.js → dist-4RNVO224.js} +2 -2
- package/dist/chunks/{dist-6CHQ5OPZ.js → dist-7A7PB34A.js} +2 -2
- package/dist/chunks/{dist-G4BSVJKY.js → dist-MSFQTEPK.js} +2 -2
- package/dist/chunks/{dist-LBTLFSNF.js → dist-MT3MTMRF.js} +68 -2
- package/dist/chunks/{dist-HYKH6P7F.js → dist-PH7MWV7K.js} +2 -2
- package/dist/chunks/{dist-GVGW7AZ2.js → dist-TIMUM4OR.js} +2 -2
- package/dist/chunks/{dist-HASAHQL3.js → dist-Y4Q4SXRE.js} +2 -2
- package/dist/chunks/{doctor-Y5PQ2R7D.js → doctor-JRVQJERE.js} +46 -42
- package/dist/chunks/{drain-RG275P5J.js → drain-YOE55I26.js} +14 -14
- package/dist/chunks/{entry-BJY7UE6P.js → entry-QAXRBCG3.js} +6 -6
- package/dist/chunks/{eval-GG2BH7CQ.js → eval-UPNYQIHO.js} +12 -12
- package/dist/chunks/{exec-63SUPKUV.js → exec-LLOKYQZY.js} +92 -64
- package/dist/chunks/exec-LLOKYQZY.js.map +6 -0
- package/dist/chunks/{github-MGIA7MTZ.js → github-Z3JQNLXA.js} +5 -5
- package/dist/chunks/{home-KMZDOTX5.js → home-7TSSDRFT.js} +3 -3
- package/dist/chunks/hooks-JNM3P24H.js +210 -0
- package/dist/chunks/hooks-JNM3P24H.js.map +6 -0
- package/dist/chunks/hooks-report-GGRTQH23.js +39 -0
- package/dist/chunks/{host-OB5CL3GG.js → host-M2CYP3TP.js} +12 -12
- package/dist/chunks/{host-queries-2GQM7BTI.js → host-queries-L7P5FQ36.js} +15 -15
- package/dist/chunks/{learn-LUEHNOMA.js → learn-CBIMGXXS.js} +12 -12
- package/dist/chunks/{learn-builtin-R2Z27LDI.js → learn-builtin-UHGQ6CNQ.js} +17 -17
- package/dist/chunks/{lifecycle-DCLLAROM.js → lifecycle-NJGOR77O.js} +37 -37
- package/dist/chunks/{list-5UW5SFIX.js → list-QZUWOS4I.js} +19 -19
- package/dist/chunks/{live-YUE4AKRQ.js → live-LHKUQFEO.js} +44 -40
- package/dist/chunks/load-LF7GZYTP.js +75 -0
- package/dist/chunks/{login-ELIGI6HT.js → login-F4NOOGD5.js} +13 -13
- package/dist/chunks/{logs-PXASK6XI.js → logs-6CJCV6YU.js} +5 -5
- package/dist/chunks/{mcp-YVV35X7H.js → mcp-C7FQLLXL.js} +34 -34
- package/dist/chunks/{message-command-QVGOKB4W.js → message-command-BJPPVBGT.js} +59 -55
- package/dist/chunks/message-command-BJPPVBGT.js.map +6 -0
- package/dist/chunks/{open-MDT2NTF4.js → open-GLWFBW4C.js} +8 -8
- package/dist/chunks/{operator-tools-LYY2FXSO.js → operator-tools-KQV2T5UU.js} +14 -14
- package/dist/chunks/{output-schema-VR43KZNJ.js → output-schema-XXKTMSU6.js} +3 -3
- package/dist/chunks/{pal-YXOWNULV.js → pal-4OZ7KPSC.js} +19 -19
- package/dist/chunks/{peers-CJOTRI4W.js → peers-4DMT2KZ2.js} +18 -18
- package/dist/chunks/{peers-6M4UPHDF.js → peers-SMOALKZW.js} +6 -6
- package/dist/chunks/{plugin-IVIHCAEO.js → plugin-IDW4AYIK.js} +101 -20
- package/dist/chunks/plugin-IDW4AYIK.js.map +6 -0
- package/dist/chunks/{providers-7WDY37V3.js → providers-7HLI5PWI.js} +11 -11
- package/dist/chunks/{pty-CLDDZT5T.js → pty-SQBYCAX4.js} +3 -3
- package/dist/chunks/resume-2HBHZF54.js +23 -0
- package/dist/chunks/{resume-command-TXPTYQFF.js → resume-command-VCMPAWTN.js} +4 -4
- package/dist/chunks/{running-KBISZDIQ.js → running-DR4MSZ7B.js} +5 -5
- package/dist/chunks/{schedule-ECZVNZLH.js → schedule-W3QPDJRS.js} +8 -8
- package/dist/chunks/{send-VUJ33MJM.js → send-QDBFAZ5P.js} +16 -16
- package/dist/chunks/{send-person-WXM7Y5PZ.js → send-person-O5OJ7KHD.js} +13 -13
- package/dist/chunks/{service-DORQ3PNE.js → service-5Z47V5KC.js} +42 -42
- package/dist/chunks/{skills-W7KY3WX4.js → skills-XYT6UUTP.js} +45 -16
- package/dist/chunks/skills-XYT6UUTP.js.map +6 -0
- package/dist/chunks/{start-check-KECY75IO.js → start-check-OKCRZ67I.js} +2 -2
- package/dist/chunks/{startup-failure-MS7TPUMI.js → startup-failure-N3RO73Z4.js} +2 -2
- package/dist/chunks/{state-YK5JWP5I.js → state-7CLHPA4P.js} +6 -6
- package/dist/chunks/{store-XIPDR26B.js → store-CNEKBGKD.js} +6 -6
- package/dist/chunks/{store-TM7VDQ5G.js → store-GA3I7BMG.js} +4 -4
- package/dist/chunks/{store-H4IVAEZK.js → store-YFAH5XGW.js} +3 -3
- package/dist/chunks/store-YFAH5XGW.js.map +6 -0
- package/dist/chunks/{store-7SFKBFX6.js → store-ZDFRYDWS.js} +12 -10
- package/dist/chunks/store-ZDFRYDWS.js.map +6 -0
- package/dist/chunks/{tui-XKAQI3DD.js → tui-T6VPVMEV.js} +95 -89
- package/dist/chunks/tui-T6VPVMEV.js.map +6 -0
- package/dist/chunks/{upgrade-GLEEEZWO.js → upgrade-SW474CXN.js} +10 -10
- package/dist/chunks/{watch-XZKKDKAF.js → watch-OIYLZVDF.js} +134 -101
- package/dist/chunks/watch-OIYLZVDF.js.map +6 -0
- package/dist/chunks/{workspaces-GS6D72XT.js → workspaces-YQW2E6PE.js} +22 -22
- package/dist/chunks/worktree-ZMMQI2Z5.js +204 -0
- package/dist/chunks/worktree-ZMMQI2Z5.js.map +6 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/desktop-host.d.ts +7 -0
- package/dist/commands/desktop-host.d.ts.map +1 -1
- package/dist/commands/exec-json.d.ts.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/hooks.d.ts +13 -0
- package/dist/commands/hooks.d.ts.map +1 -0
- package/dist/commands/manifest.d.ts +1 -0
- package/dist/commands/manifest.d.ts.map +1 -1
- package/dist/commands/worktree.d.ts.map +1 -1
- package/dist/config/hook-common-shape.d.ts +2 -0
- package/dist/config/hook-common-shape.d.ts.map +1 -1
- package/dist/config/hook-layers.d.ts.map +1 -1
- package/dist/config/hooks-report.d.ts +162 -0
- package/dist/config/hooks-report.d.ts.map +1 -0
- package/dist/config/load.d.ts +53 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/skill-hooks-reader.d.ts +46 -0
- package/dist/config/skill-hooks-reader.d.ts.map +1 -0
- package/dist/doctor/checks/hooks.d.ts +7 -2
- package/dist/doctor/checks/hooks.d.ts.map +1 -1
- package/dist/index.js +49 -45
- package/dist/integrations/plugins/hook-activity.d.ts +62 -0
- package/dist/integrations/plugins/hook-activity.d.ts.map +1 -0
- package/dist/integrations/plugins/hook-entries.d.ts +126 -0
- package/dist/integrations/plugins/hook-entries.d.ts.map +1 -0
- package/dist/integrations/plugins/runtime.d.ts +52 -2
- package/dist/integrations/plugins/runtime.d.ts.map +1 -1
- package/dist/integrations/plugins/validate.d.ts.map +1 -1
- package/dist/integrations/sessions/conversation-facts.d.ts +12 -0
- package/dist/integrations/sessions/conversation-facts.d.ts.map +1 -1
- package/dist/integrations/sessions/store.d.ts +11 -1
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/watch-view.d.ts +2 -0
- package/dist/integrations/sessions/watch-view.d.ts.map +1 -1
- package/dist/integrations/subagents/NamzuCliAgent.d.ts +9 -1
- package/dist/integrations/subagents/NamzuCliAgent.d.ts.map +1 -1
- package/dist/integrations/subagents/agent-hooks.d.ts +116 -0
- package/dist/integrations/subagents/agent-hooks.d.ts.map +1 -0
- package/dist/integrations/subagents/definitions.d.ts +18 -0
- package/dist/integrations/subagents/definitions.d.ts.map +1 -1
- package/dist/integrations/subagents/replay.d.ts +6 -0
- package/dist/integrations/subagents/replay.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts +23 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/worktree-driver.d.ts +20 -5
- package/dist/integrations/subagents/worktree-driver.d.ts.map +1 -1
- package/dist/integrations/trust/folder-grants.d.ts.map +1 -1
- package/dist/integrations/worktrees/hook-host.d.ts +23 -0
- package/dist/integrations/worktrees/hook-host.d.ts.map +1 -0
- package/dist/integrations/worktrees/managed.d.ts +20 -2
- package/dist/integrations/worktrees/managed.d.ts.map +1 -1
- package/dist/integrations/worktrees/untrusted-hook.d.ts +16 -0
- package/dist/integrations/worktrees/untrusted-hook.d.ts.map +1 -0
- package/dist/schedule/fire/fire.d.ts.map +1 -1
- package/dist/skills/audit.d.ts +11 -0
- package/dist/skills/audit.d.ts.map +1 -1
- package/dist/skills/catalog.d.ts +3 -0
- package/dist/skills/catalog.d.ts.map +1 -1
- package/dist/skills/restore-skill-hooks.d.ts +16 -0
- package/dist/skills/restore-skill-hooks.d.ts.map +1 -0
- package/dist/skills/skill-hooks.d.ts +73 -0
- package/dist/skills/skill-hooks.d.ts.map +1 -0
- package/dist/skills/store.d.ts +3 -0
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/skills/use-hooks.d.ts +25 -0
- package/dist/skills/use-hooks.d.ts.map +1 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/ReadSearchGroup.d.ts.map +1 -1
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/agent-transcript-rows.d.ts +3 -1
- package/dist/tui/agent-transcript-rows.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +73 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/fullscreen/layout.d.ts +9 -1
- package/dist/tui/fullscreen/layout.d.ts.map +1 -1
- package/dist/tui/fullscreen/markdown-rows.d.ts +18 -18
- package/dist/tui/fullscreen/markdown-rows.d.ts.map +1 -1
- package/dist/tui/fullscreen/reply-rows.d.ts +83 -0
- package/dist/tui/fullscreen/reply-rows.d.ts.map +1 -0
- package/dist/tui/hint-fit.d.ts +36 -0
- package/dist/tui/hint-fit.d.ts.map +1 -0
- package/dist/tui/plugin-view.d.ts.map +1 -1
- package/dist/tui/restored-rows.d.ts +6 -0
- package/dist/tui/restored-rows.d.ts.map +1 -1
- package/dist/tui/slashCommands.d.ts +44 -1
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/transcript-scroll.d.ts +1 -1
- package/dist/tui/transcript-scroll.d.ts.map +1 -1
- package/dist/user-commands/store.d.ts +2 -0
- package/dist/user-commands/store.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/chunks/acp-IOWTKF2X.js.map +0 -6
- package/dist/chunks/agent-session-L6J5GZVX.js +0 -73
- package/dist/chunks/chunk-5I45HTKW.js.map +0 -6
- package/dist/chunks/chunk-5NDRDTNX.js.map +0 -6
- package/dist/chunks/chunk-AME342DQ.js +0 -245
- package/dist/chunks/chunk-AME342DQ.js.map +0 -6
- package/dist/chunks/chunk-HGZYNEQE.js.map +0 -6
- package/dist/chunks/chunk-HOKSVFIC.js.map +0 -6
- package/dist/chunks/chunk-KNQ7R54U.js.map +0 -6
- package/dist/chunks/chunk-LOWGGJOB.js.map +0 -6
- package/dist/chunks/chunk-SVMGV4AS.js.map +0 -6
- package/dist/chunks/chunk-UJOWXA23.js.map +0 -6
- package/dist/chunks/chunk-V7VNFYA4.js.map +0 -6
- package/dist/chunks/chunk-WSMX3IQE.js.map +0 -6
- package/dist/chunks/chunk-YELRULQ7.js.map +0 -6
- package/dist/chunks/chunk-YSKCWH72.js.map +0 -6
- package/dist/chunks/exec-63SUPKUV.js.map +0 -6
- package/dist/chunks/message-command-QVGOKB4W.js.map +0 -6
- package/dist/chunks/plugin-IVIHCAEO.js.map +0 -6
- package/dist/chunks/resume-ZRVTAGB6.js +0 -23
- package/dist/chunks/skills-W7KY3WX4.js.map +0 -6
- package/dist/chunks/tui-XKAQI3DD.js.map +0 -6
- package/dist/chunks/watch-XZKKDKAF.js.map +0 -6
- package/dist/chunks/worktree-Z456JZKA.js +0 -119
- package/dist/chunks/worktree-Z456JZKA.js.map +0 -6
- /package/dist/chunks/{activity-command-U2AOTIVF.js.map → activity-command-IBOJOCRF.js.map} +0 -0
- /package/dist/chunks/{add-YYQLPCP2.js.map → add-LYBL3IC7.js.map} +0 -0
- /package/dist/chunks/{agent-WL6NX4W6.js.map → agent-LTLWJW3P.js.map} +0 -0
- /package/dist/chunks/{agent-session-L6J5GZVX.js.map → agent-session-BD2AHK5S.js.map} +0 -0
- /package/dist/chunks/{apply-at-exit-BRXYTQVG.js.map → apply-at-exit-7BF3KBU2.js.map} +0 -0
- /package/dist/chunks/{archive-UE756BME.js.map → archive-FCPUCOYT.js.map} +0 -0
- /package/dist/chunks/{bin-main-XR2DJOI6.js.map → bin-main-AVPCWJHJ.js.map} +0 -0
- /package/dist/chunks/{binding-HCIPLFUO.js.map → binding-OZCOSUYV.js.map} +0 -0
- /package/dist/chunks/{browser-7SFVCKSO.js.map → browser-LR25NVO7.js.map} +0 -0
- /package/dist/chunks/{chat-K6GQGRUA.js.map → chat-PP7XU7US.js.map} +0 -0
- /package/dist/chunks/{chunk-3NAVAACC.js.map → chunk-2KNLSJFS.js.map} +0 -0
- /package/dist/chunks/{chunk-2VSICYQP.js.map → chunk-2O6LZGGG.js.map} +0 -0
- /package/dist/chunks/{chunk-Z5NMQ2YN.js.map → chunk-3Q42HHZM.js.map} +0 -0
- /package/dist/chunks/{chunk-RAPO3KLG.js.map → chunk-3WTIGIDA.js.map} +0 -0
- /package/dist/chunks/{chunk-FX7BSCB4.js.map → chunk-4Q4J3KDG.js.map} +0 -0
- /package/dist/chunks/{chunk-KO2N6EIF.js.map → chunk-4VB264C5.js.map} +0 -0
- /package/dist/chunks/{chunk-HJILJSZO.js.map → chunk-4VXS3UYL.js.map} +0 -0
- /package/dist/chunks/{chunk-2WDF5N2A.js.map → chunk-5FEAC3G5.js.map} +0 -0
- /package/dist/chunks/{chunk-BHOZPFJM.js.map → chunk-5HCZHDPA.js.map} +0 -0
- /package/dist/chunks/{chunk-Z5FDI74K.js.map → chunk-5YNAPIUZ.js.map} +0 -0
- /package/dist/chunks/{chunk-A47ZNTW7.js.map → chunk-6SHOR62K.js.map} +0 -0
- /package/dist/chunks/{chunk-46VSU4QF.js.map → chunk-72IJ3FQU.js.map} +0 -0
- /package/dist/chunks/{chunk-DHS5CQNC.js.map → chunk-AO4A56EG.js.map} +0 -0
- /package/dist/chunks/{chunk-KAPCNFMC.js.map → chunk-BFCUL4BW.js.map} +0 -0
- /package/dist/chunks/{chunk-DOFQWVBL.js.map → chunk-CKWDYYBE.js.map} +0 -0
- /package/dist/chunks/{chunk-J3PHMXN4.js.map → chunk-CSBKGTBA.js.map} +0 -0
- /package/dist/chunks/{chunk-ZMKEYARZ.js.map → chunk-D3JJE6VZ.js.map} +0 -0
- /package/dist/chunks/{chunk-UWN4WNQZ.js.map → chunk-DEEK2FOC.js.map} +0 -0
- /package/dist/chunks/{chunk-F3SQRGKZ.js.map → chunk-DSMBM5LQ.js.map} +0 -0
- /package/dist/chunks/{chunk-4FV2VZS6.js.map → chunk-EC2F3CWT.js.map} +0 -0
- /package/dist/chunks/{chunk-OBMHA7OP.js.map → chunk-EMXH2RJN.js.map} +0 -0
- /package/dist/chunks/{chunk-MYVF3JRV.js.map → chunk-EQGE25MQ.js.map} +0 -0
- /package/dist/chunks/{chunk-RDW6L3PV.js.map → chunk-F2TXNDKC.js.map} +0 -0
- /package/dist/chunks/{chunk-UMHKTV2L.js.map → chunk-FAWY4LRG.js.map} +0 -0
- /package/dist/chunks/{chunk-LMLJ7NS5.js.map → chunk-FK6WJQ5T.js.map} +0 -0
- /package/dist/chunks/{chunk-EKMHZKVP.js.map → chunk-FRADQASS.js.map} +0 -0
- /package/dist/chunks/{chunk-N56NUKMT.js.map → chunk-FS7CUHOG.js.map} +0 -0
- /package/dist/chunks/{chunk-C5XQHEYB.js.map → chunk-GFZFGTDZ.js.map} +0 -0
- /package/dist/chunks/{chunk-VVWI4EB7.js.map → chunk-GXCOSOVM.js.map} +0 -0
- /package/dist/chunks/{chunk-TI6FFONP.js.map → chunk-HJJNIG33.js.map} +0 -0
- /package/dist/chunks/{chunk-MHXJYXOF.js.map → chunk-HUDP4HTK.js.map} +0 -0
- /package/dist/chunks/{chunk-SHUA4YUK.js.map → chunk-IBPN346S.js.map} +0 -0
- /package/dist/chunks/{chunk-Z6J7SVOB.js.map → chunk-IPAGLYU3.js.map} +0 -0
- /package/dist/chunks/{chunk-ZDZ35MMZ.js.map → chunk-ISHCON5Z.js.map} +0 -0
- /package/dist/chunks/{chunk-FEIIR46G.js.map → chunk-J6I6MCWR.js.map} +0 -0
- /package/dist/chunks/{chunk-X6SREM2V.js.map → chunk-JXJIKAAE.js.map} +0 -0
- /package/dist/chunks/{chunk-POOJ2MUS.js.map → chunk-K3QEZ7D7.js.map} +0 -0
- /package/dist/chunks/{chunk-4RTQTX5R.js.map → chunk-KFWQSTT3.js.map} +0 -0
- /package/dist/chunks/{chunk-DI4L3GH5.js.map → chunk-KHQAU33M.js.map} +0 -0
- /package/dist/chunks/{chunk-CCYAWSZL.js.map → chunk-KNBFV3DC.js.map} +0 -0
- /package/dist/chunks/{chunk-HTHNDZ3L.js.map → chunk-L2Q7APTU.js.map} +0 -0
- /package/dist/chunks/{chunk-DIWEKTYK.js.map → chunk-LHZ632YK.js.map} +0 -0
- /package/dist/chunks/{chunk-TYTE2GIF.js.map → chunk-LWYW2DAK.js.map} +0 -0
- /package/dist/chunks/{chunk-NZMKMXGG.js.map → chunk-MKAQAKHE.js.map} +0 -0
- /package/dist/chunks/{chunk-QPR3UA4L.js.map → chunk-MXJAJXE7.js.map} +0 -0
- /package/dist/chunks/{chunk-SPSWX3QZ.js.map → chunk-MXR77LCX.js.map} +0 -0
- /package/dist/chunks/{chunk-PSLNHLZI.js.map → chunk-NSGEVYJC.js.map} +0 -0
- /package/dist/chunks/{chunk-EKQ6J5KA.js.map → chunk-O4GHSR2X.js.map} +0 -0
- /package/dist/chunks/{chunk-J7SA5BCI.js.map → chunk-PNEFIK4E.js.map} +0 -0
- /package/dist/chunks/{chunk-XHLFI6F6.js.map → chunk-QXKCTJWO.js.map} +0 -0
- /package/dist/chunks/{chunk-P7FHJL3V.js.map → chunk-SK3JQNO5.js.map} +0 -0
- /package/dist/chunks/{chunk-RJWPNAYL.js.map → chunk-SU5VBBRS.js.map} +0 -0
- /package/dist/chunks/{chunk-7AWFHVMT.js.map → chunk-T2CHZ6V7.js.map} +0 -0
- /package/dist/chunks/{chunk-P5E6ITP5.js.map → chunk-TE4MIRMA.js.map} +0 -0
- /package/dist/chunks/{chunk-24N42TGE.js.map → chunk-THOVK7I5.js.map} +0 -0
- /package/dist/chunks/{chunk-DSKNFDTL.js.map → chunk-TLTD26JG.js.map} +0 -0
- /package/dist/chunks/{chunk-CQKYKQEF.js.map → chunk-TUEZKY7I.js.map} +0 -0
- /package/dist/chunks/{chunk-2U357RJS.js.map → chunk-UUQY5P7K.js.map} +0 -0
- /package/dist/chunks/{chunk-WOSL3OZD.js.map → chunk-VBRCNXMM.js.map} +0 -0
- /package/dist/chunks/{chunk-VYLCV6W3.js.map → chunk-VI66HXJT.js.map} +0 -0
- /package/dist/chunks/{chunk-AGFGC7SI.js.map → chunk-VQCP7LOK.js.map} +0 -0
- /package/dist/chunks/{chunk-OAHCS42A.js.map → chunk-VTS2SVX6.js.map} +0 -0
- /package/dist/chunks/{chunk-HUONDMU4.js.map → chunk-W5TE6NIA.js.map} +0 -0
- /package/dist/chunks/{chunk-ZZNHDQAD.js.map → chunk-WV45Z5QQ.js.map} +0 -0
- /package/dist/chunks/{chunk-TUXH7IXQ.js.map → chunk-X44EPHHA.js.map} +0 -0
- /package/dist/chunks/{chunk-6CFPN6I4.js.map → chunk-XFCFWWFK.js.map} +0 -0
- /package/dist/chunks/{chunk-PV65WQHD.js.map → chunk-XGS5WUCQ.js.map} +0 -0
- /package/dist/chunks/{chunk-NTV2XD2J.js.map → chunk-Y4MKRX73.js.map} +0 -0
- /package/dist/chunks/{chunk-SB3A7KUJ.js.map → chunk-YDGUEMBB.js.map} +0 -0
- /package/dist/chunks/{chunk-7JT7DNR7.js.map → chunk-YIZXVNUY.js.map} +0 -0
- /package/dist/chunks/{chunk-PYSZ7JTU.js.map → chunk-YNBAVIQA.js.map} +0 -0
- /package/dist/chunks/{chunk-O326HKCW.js.map → chunk-YPLYAESJ.js.map} +0 -0
- /package/dist/chunks/{chunk-M3AUPUII.js.map → chunk-ZI5FFFBJ.js.map} +0 -0
- /package/dist/chunks/{chunk-EA73SWCT.js.map → chunk-ZIRQSGOG.js.map} +0 -0
- /package/dist/chunks/{cli-runtime-SVXU6U4V.js.map → cli-runtime-V2FI7PIQ.js.map} +0 -0
- /package/dist/chunks/{commands-A2E3OV7F.js.map → commands-R2LZBXLK.js.map} +0 -0
- /package/dist/chunks/{cost-NA7APCZD.js.map → cost-PQWWLMOO.js.map} +0 -0
- /package/dist/chunks/{crash-report-C6QXQJAK.js.map → crash-report-MY27ZDU6.js.map} +0 -0
- /package/dist/chunks/{dist-3PE5MOU6.js.map → dist-3HCAPKP5.js.map} +0 -0
- /package/dist/chunks/{dist-5SZ7VOLE.js.map → dist-4RNVO224.js.map} +0 -0
- /package/dist/chunks/{dist-6CHQ5OPZ.js.map → dist-7A7PB34A.js.map} +0 -0
- /package/dist/chunks/{dist-G4BSVJKY.js.map → dist-MSFQTEPK.js.map} +0 -0
- /package/dist/chunks/{dist-LBTLFSNF.js.map → dist-MT3MTMRF.js.map} +0 -0
- /package/dist/chunks/{dist-HYKH6P7F.js.map → dist-PH7MWV7K.js.map} +0 -0
- /package/dist/chunks/{dist-GVGW7AZ2.js.map → dist-TIMUM4OR.js.map} +0 -0
- /package/dist/chunks/{dist-HASAHQL3.js.map → dist-Y4Q4SXRE.js.map} +0 -0
- /package/dist/chunks/{doctor-Y5PQ2R7D.js.map → doctor-JRVQJERE.js.map} +0 -0
- /package/dist/chunks/{drain-RG275P5J.js.map → drain-YOE55I26.js.map} +0 -0
- /package/dist/chunks/{entry-BJY7UE6P.js.map → entry-QAXRBCG3.js.map} +0 -0
- /package/dist/chunks/{eval-GG2BH7CQ.js.map → eval-UPNYQIHO.js.map} +0 -0
- /package/dist/chunks/{github-MGIA7MTZ.js.map → github-Z3JQNLXA.js.map} +0 -0
- /package/dist/chunks/{home-KMZDOTX5.js.map → home-7TSSDRFT.js.map} +0 -0
- /package/dist/chunks/{host-OB5CL3GG.js.map → hooks-report-GGRTQH23.js.map} +0 -0
- /package/dist/chunks/{lifecycle-DCLLAROM.js.map → host-M2CYP3TP.js.map} +0 -0
- /package/dist/chunks/{host-queries-2GQM7BTI.js.map → host-queries-L7P5FQ36.js.map} +0 -0
- /package/dist/chunks/{learn-LUEHNOMA.js.map → learn-CBIMGXXS.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-R2Z27LDI.js.map → learn-builtin-UHGQ6CNQ.js.map} +0 -0
- /package/dist/chunks/{live-YUE4AKRQ.js.map → lifecycle-NJGOR77O.js.map} +0 -0
- /package/dist/chunks/{list-5UW5SFIX.js.map → list-QZUWOS4I.js.map} +0 -0
- /package/dist/chunks/{login-ELIGI6HT.js.map → live-LHKUQFEO.js.map} +0 -0
- /package/dist/chunks/{open-MDT2NTF4.js.map → load-LF7GZYTP.js.map} +0 -0
- /package/dist/chunks/{output-schema-VR43KZNJ.js.map → login-F4NOOGD5.js.map} +0 -0
- /package/dist/chunks/{logs-PXASK6XI.js.map → logs-6CJCV6YU.js.map} +0 -0
- /package/dist/chunks/{mcp-YVV35X7H.js.map → mcp-C7FQLLXL.js.map} +0 -0
- /package/dist/chunks/{peers-6M4UPHDF.js.map → open-GLWFBW4C.js.map} +0 -0
- /package/dist/chunks/{operator-tools-LYY2FXSO.js.map → operator-tools-KQV2T5UU.js.map} +0 -0
- /package/dist/chunks/{providers-7WDY37V3.js.map → output-schema-XXKTMSU6.js.map} +0 -0
- /package/dist/chunks/{pal-YXOWNULV.js.map → pal-4OZ7KPSC.js.map} +0 -0
- /package/dist/chunks/{peers-CJOTRI4W.js.map → peers-4DMT2KZ2.js.map} +0 -0
- /package/dist/chunks/{pty-CLDDZT5T.js.map → peers-SMOALKZW.js.map} +0 -0
- /package/dist/chunks/{resume-ZRVTAGB6.js.map → providers-7HLI5PWI.js.map} +0 -0
- /package/dist/chunks/{resume-command-TXPTYQFF.js.map → pty-SQBYCAX4.js.map} +0 -0
- /package/dist/chunks/{running-KBISZDIQ.js.map → resume-2HBHZF54.js.map} +0 -0
- /package/dist/chunks/{send-VUJ33MJM.js.map → resume-command-VCMPAWTN.js.map} +0 -0
- /package/dist/chunks/{send-person-WXM7Y5PZ.js.map → running-DR4MSZ7B.js.map} +0 -0
- /package/dist/chunks/{schedule-ECZVNZLH.js.map → schedule-W3QPDJRS.js.map} +0 -0
- /package/dist/chunks/{start-check-KECY75IO.js.map → send-QDBFAZ5P.js.map} +0 -0
- /package/dist/chunks/{store-7SFKBFX6.js.map → send-person-O5OJ7KHD.js.map} +0 -0
- /package/dist/chunks/{service-DORQ3PNE.js.map → service-5Z47V5KC.js.map} +0 -0
- /package/dist/chunks/{store-H4IVAEZK.js.map → start-check-OKCRZ67I.js.map} +0 -0
- /package/dist/chunks/{startup-failure-MS7TPUMI.js.map → startup-failure-N3RO73Z4.js.map} +0 -0
- /package/dist/chunks/{state-YK5JWP5I.js.map → state-7CLHPA4P.js.map} +0 -0
- /package/dist/chunks/{store-TM7VDQ5G.js.map → store-CNEKBGKD.js.map} +0 -0
- /package/dist/chunks/{store-XIPDR26B.js.map → store-GA3I7BMG.js.map} +0 -0
- /package/dist/chunks/{upgrade-GLEEEZWO.js.map → upgrade-SW474CXN.js.map} +0 -0
- /package/dist/chunks/{workspaces-GS6D72XT.js.map → workspaces-YQW2E6PE.js.map} +0 -0
|
@@ -0,0 +1,686 @@
|
|
|
1
|
+
import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
2
|
+
const require = __namzuCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
listMarkdownNames,
|
|
5
|
+
resolvePluginFileDirs
|
|
6
|
+
} from "./chunk-U3IK5VKD.js";
|
|
7
|
+
import {
|
|
8
|
+
activeConversationTurn,
|
|
9
|
+
closeSessions,
|
|
10
|
+
forkConversationInto,
|
|
11
|
+
listRecent,
|
|
12
|
+
loadResumableConversation,
|
|
13
|
+
openSessions
|
|
14
|
+
} from "./chunk-VQ5KK7YF.js";
|
|
15
|
+
import {
|
|
16
|
+
PluginSettingsStore,
|
|
17
|
+
dataDirOverlapsPlugin,
|
|
18
|
+
pluginDataDir,
|
|
19
|
+
readPluginHookEntriesOf
|
|
20
|
+
} from "./chunk-4JBQTRTF.js";
|
|
21
|
+
import {
|
|
22
|
+
isPathRuleTool,
|
|
23
|
+
pathRule,
|
|
24
|
+
pathRuleTools
|
|
25
|
+
} from "./chunk-4NVFHP23.js";
|
|
26
|
+
import {
|
|
27
|
+
cliLogger
|
|
28
|
+
} from "./chunk-W5TE6NIA.js";
|
|
29
|
+
import {
|
|
30
|
+
FileChangeHooks,
|
|
31
|
+
GitWorktreeDriver,
|
|
32
|
+
HookedWorkspaceDriver,
|
|
33
|
+
PluginLifecycleManager,
|
|
34
|
+
PluginRegistry,
|
|
35
|
+
SHELL_HOOKS_PLUGIN_ID,
|
|
36
|
+
SHELL_HOOK_EVENTS,
|
|
37
|
+
SessionHookEnv,
|
|
38
|
+
SkillRegistry,
|
|
39
|
+
asSessionId,
|
|
40
|
+
attachShellHooks,
|
|
41
|
+
createShellHook,
|
|
42
|
+
discoverAllPluginDirs,
|
|
43
|
+
fileChangedMatcherNote,
|
|
44
|
+
fileChangedMatcherPaths,
|
|
45
|
+
generateWorkspaceId,
|
|
46
|
+
resolveNamzuHome
|
|
47
|
+
} from "./chunk-JTEWIH66.js";
|
|
48
|
+
import {
|
|
49
|
+
__name
|
|
50
|
+
} from "./chunk-76FLAFCG.js";
|
|
51
|
+
|
|
52
|
+
// src/integrations/plugins/hook-activity.ts
|
|
53
|
+
var MAX_PENDING_NOTICES = 20;
|
|
54
|
+
function createSessionHookActivity(options) {
|
|
55
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
56
|
+
const pending = [];
|
|
57
|
+
const notify = /* @__PURE__ */ __name((line) => {
|
|
58
|
+
cliLogger().warn("hook", { "namzu.hook.notice": line });
|
|
59
|
+
if (listeners.size === 0) {
|
|
60
|
+
if (pending.length < MAX_PENDING_NOTICES) pending.push(line);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
for (const listener of listeners) listener(line);
|
|
64
|
+
}, "notify");
|
|
65
|
+
const hookEnv = new SessionHookEnv({ onProblem: notify });
|
|
66
|
+
const entries = options.hooks?.file_changed ?? [];
|
|
67
|
+
const matcherPaths = entries.flatMap((entry) => fileChangedMatcherPaths(entry.matcher));
|
|
68
|
+
let manager = options.manager;
|
|
69
|
+
let files;
|
|
70
|
+
let closed = false;
|
|
71
|
+
const attach = /* @__PURE__ */ __name((given) => {
|
|
72
|
+
manager = given;
|
|
73
|
+
if (closed) return;
|
|
74
|
+
files = new FileChangeHooks({
|
|
75
|
+
manager: given,
|
|
76
|
+
cwd: options.cwd,
|
|
77
|
+
sessionId: options.sessionId,
|
|
78
|
+
matcherPaths,
|
|
79
|
+
onNotice: notify,
|
|
80
|
+
onProblem: notify
|
|
81
|
+
});
|
|
82
|
+
}, "attach");
|
|
83
|
+
if (manager !== void 0) attach(manager);
|
|
84
|
+
return {
|
|
85
|
+
variables: hookEnv.variables,
|
|
86
|
+
hookEnv,
|
|
87
|
+
attach,
|
|
88
|
+
absorbSessionStart: /* @__PURE__ */ __name((results) => files?.absorb(results), "absorbSessionStart"),
|
|
89
|
+
async changeDirectory(change) {
|
|
90
|
+
hookEnv.clearFolderLayers();
|
|
91
|
+
if (manager === void 0) return;
|
|
92
|
+
try {
|
|
93
|
+
const results = await manager.executeHooks("cwd_changed", {
|
|
94
|
+
sessionId: options.sessionId(),
|
|
95
|
+
oldCwd: change.from,
|
|
96
|
+
newCwd: change.to
|
|
97
|
+
});
|
|
98
|
+
files?.absorb(results);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
notify(
|
|
101
|
+
`A cwd_changed hook could not run: ${error instanceof Error ? error.message : String(error)}.`
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
notify,
|
|
106
|
+
describe: /* @__PURE__ */ __name(() => ({
|
|
107
|
+
variables: hookEnv.describe(),
|
|
108
|
+
watching: files?.watching ?? [],
|
|
109
|
+
notes: entries.map((entry) => fileChangedMatcherNote(entry.matcher)).filter((note) => note !== void 0)
|
|
110
|
+
}), "describe"),
|
|
111
|
+
onNotice(listener) {
|
|
112
|
+
listeners.add(listener);
|
|
113
|
+
for (const line of pending.splice(0)) listener(line);
|
|
114
|
+
return () => {
|
|
115
|
+
listeners.delete(listener);
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
close() {
|
|
119
|
+
closed = true;
|
|
120
|
+
files?.close();
|
|
121
|
+
hookEnv.dispose();
|
|
122
|
+
listeners.clear();
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
__name(createSessionHookActivity, "createSessionHookActivity");
|
|
127
|
+
|
|
128
|
+
// src/integrations/plugins/hook-path-filter.ts
|
|
129
|
+
function createHookPathFilter(cwd) {
|
|
130
|
+
return (tool, pattern, callTool, toolInput) => {
|
|
131
|
+
if (!isPathRuleTool(tool)) return void 0;
|
|
132
|
+
if (!pathRuleTools(tool).includes(callTool)) return false;
|
|
133
|
+
const input = toolInput !== null && typeof toolInput === "object" ? toolInput : void 0;
|
|
134
|
+
const written = input?.path;
|
|
135
|
+
const searchTool = callTool === "grep" || callTool === "glob" || callTool === "ls";
|
|
136
|
+
if (!(typeof written === "string" && written !== "") && !searchTool) return void 0;
|
|
137
|
+
const rule = pathRule(tool, pattern, "ask", { cwd });
|
|
138
|
+
if (rule.type !== "predicate") return void 0;
|
|
139
|
+
try {
|
|
140
|
+
return rule.decide({
|
|
141
|
+
toolName: callTool,
|
|
142
|
+
toolInput,
|
|
143
|
+
toolDef: void 0,
|
|
144
|
+
commandDialect: "sh"
|
|
145
|
+
}) !== null;
|
|
146
|
+
} catch {
|
|
147
|
+
return void 0;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
__name(createHookPathFilter, "createHookPathFilter");
|
|
152
|
+
|
|
153
|
+
// src/integrations/plugins/runtime.ts
|
|
154
|
+
var SESSION_END_HOOK_TIMEOUT_MS = 5e3;
|
|
155
|
+
var MAX_HOOK_TIMEOUT_MS = 10 * 6e4;
|
|
156
|
+
function sessionEndHookBudgetMs(hooks) {
|
|
157
|
+
let longest = 0;
|
|
158
|
+
for (const entry of hooks?.session_end ?? []) {
|
|
159
|
+
if ("async" in entry && entry.async === true) continue;
|
|
160
|
+
const own = entry.timeoutMs ?? SESSION_END_HOOK_TIMEOUT_MS;
|
|
161
|
+
longest = Math.max(longest, Math.min(MAX_HOOK_TIMEOUT_MS, Math.max(1, own)));
|
|
162
|
+
}
|
|
163
|
+
return longest;
|
|
164
|
+
}
|
|
165
|
+
__name(sessionEndHookBudgetMs, "sessionEndHookBudgetMs");
|
|
166
|
+
function hookTimeoutLine(info) {
|
|
167
|
+
const seconds = info.timeoutMs / 1e3;
|
|
168
|
+
return `The ${info.event} hook \`${info.hook}\` did not finish within ${seconds} second${seconds === 1 ? "" : "s"} and was ended.`;
|
|
169
|
+
}
|
|
170
|
+
__name(hookTimeoutLine, "hookTimeoutLine");
|
|
171
|
+
function message(error) {
|
|
172
|
+
return error instanceof Error ? error.message : String(error);
|
|
173
|
+
}
|
|
174
|
+
__name(message, "message");
|
|
175
|
+
async function createCliPluginRuntime(config, cwd, hooks, hookHost, host) {
|
|
176
|
+
const pluginsEnabled = config?.enabled === true;
|
|
177
|
+
const launchDirs = config?.launchDirs ?? [];
|
|
178
|
+
const hookCount = hooks ? Object.values(hooks).reduce((n, list) => n + (list?.length ?? 0), 0) : 0;
|
|
179
|
+
if (!pluginsEnabled && hookCount === 0 && launchDirs.length === 0 && host?.keepForSkills !== true) {
|
|
180
|
+
return void 0;
|
|
181
|
+
}
|
|
182
|
+
const log = cliLogger();
|
|
183
|
+
const userRoot = resolveNamzuHome();
|
|
184
|
+
const settings = new PluginSettingsStore(userRoot);
|
|
185
|
+
const plugins = new PluginRegistry();
|
|
186
|
+
const skills = new SkillRegistry(log);
|
|
187
|
+
const { sessionId: currentSession, ...shellHost } = hookHost ?? {};
|
|
188
|
+
const hookActivity = createSessionHookActivity({
|
|
189
|
+
hooks,
|
|
190
|
+
cwd,
|
|
191
|
+
sessionId: currentSession ?? (() => "")
|
|
192
|
+
});
|
|
193
|
+
const shellOptions = {
|
|
194
|
+
hookEnv: hookActivity.hookEnv,
|
|
195
|
+
cwd,
|
|
196
|
+
// The folder the session was started for, for a hook script to find its own files.
|
|
197
|
+
projectDir: cwd,
|
|
198
|
+
pathFilter: createHookPathFilter(cwd),
|
|
199
|
+
log,
|
|
200
|
+
defaultTimeoutMs: { session_end: SESSION_END_HOOK_TIMEOUT_MS },
|
|
201
|
+
// Only the close of a session says so out loud: it is the one place
|
|
202
|
+
// a person is left waiting with nothing on screen to explain it.
|
|
203
|
+
onTimeout: /* @__PURE__ */ __name((info) => {
|
|
204
|
+
if (info.event === "session_end") process.stderr.write(`${hookTimeoutLine(info)}
|
|
205
|
+
`);
|
|
206
|
+
}, "onTimeout"),
|
|
207
|
+
...shellHost
|
|
208
|
+
};
|
|
209
|
+
const shipped = /* @__PURE__ */ new Map();
|
|
210
|
+
const warningLines = [];
|
|
211
|
+
const hooksSwitch = host?.hooksSwitch;
|
|
212
|
+
const manager = new PluginLifecycleManager({
|
|
213
|
+
pluginRegistry: plugins,
|
|
214
|
+
skillRegistry: skills,
|
|
215
|
+
scopeRoots: { project: cwd, user: userRoot },
|
|
216
|
+
log,
|
|
217
|
+
...config?.hookTimeoutMs !== void 0 ? { hookTimeoutMs: config.hookTimeoutMs } : {},
|
|
218
|
+
hooksFor: /* @__PURE__ */ __name((plugin) => {
|
|
219
|
+
const read = readPluginHookEntriesOf(plugin);
|
|
220
|
+
const name = plugin.manifest.name;
|
|
221
|
+
const dataDir = pluginDataDir(userRoot, {
|
|
222
|
+
name,
|
|
223
|
+
scope: plugin.scope,
|
|
224
|
+
rootDir: plugin.rootDir
|
|
225
|
+
});
|
|
226
|
+
const problems = [...read.problems];
|
|
227
|
+
let usable = true;
|
|
228
|
+
if (read.count > 0 && dataDirOverlapsPlugin(dataDir, plugin.rootDir)) {
|
|
229
|
+
usable = false;
|
|
230
|
+
problems.push({
|
|
231
|
+
severity: "problem",
|
|
232
|
+
code: "hook-entries-invalid",
|
|
233
|
+
file: name,
|
|
234
|
+
message: `its data folder ${dataDir} would overlap the plugin's own folder, so its hook entries are not attached.`
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
const entries = SHELL_HOOK_EVENTS.flatMap(
|
|
238
|
+
(event) => (read.hooks[event] ?? []).map((entry) => ({ event, entry }))
|
|
239
|
+
);
|
|
240
|
+
shipped.set(plugin.id, {
|
|
241
|
+
name,
|
|
242
|
+
entries,
|
|
243
|
+
problems,
|
|
244
|
+
...hooksSwitch !== void 0 ? { off: hooksSwitch } : {}
|
|
245
|
+
});
|
|
246
|
+
for (const problem of problems) {
|
|
247
|
+
warningLines.push(
|
|
248
|
+
`${problem.severity === "problem" ? "Hook problem" : "Hook note"} in plugin ${name}, ${problem.file}: ${problem.message}`
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
if (hooksSwitch !== void 0 || !usable) return [];
|
|
252
|
+
const options = {
|
|
253
|
+
...shellOptions,
|
|
254
|
+
plugin: { root: plugin.rootDir, dataDir }
|
|
255
|
+
};
|
|
256
|
+
return entries.map(
|
|
257
|
+
({ event, entry }) => createShellHook(event, entry, options)
|
|
258
|
+
);
|
|
259
|
+
}, "hooksFor")
|
|
260
|
+
});
|
|
261
|
+
hookActivity.attach(manager);
|
|
262
|
+
if (hooks && hookCount > 0) attachShellHooks(manager, hooks, shellOptions);
|
|
263
|
+
const allowedScopes = config?.allowedScopes ?? ["project", "user"];
|
|
264
|
+
const discovered = pluginsEnabled ? await discoverAllPluginDirs(cwd, {
|
|
265
|
+
enabled: true,
|
|
266
|
+
autoDiscovery: config?.autoDiscovery ?? true,
|
|
267
|
+
allowedScopes,
|
|
268
|
+
userRoot,
|
|
269
|
+
log
|
|
270
|
+
}) : { project: [], user: [] };
|
|
271
|
+
const installed = [];
|
|
272
|
+
try {
|
|
273
|
+
for (const scope of allowedScopes) {
|
|
274
|
+
const dirs = [...discovered[scope]].sort((a, b) => a.localeCompare(b));
|
|
275
|
+
for (const dir of dirs) {
|
|
276
|
+
const plugin = await manager.install(dir, scope);
|
|
277
|
+
installed.push(plugin);
|
|
278
|
+
const enabled = settings.read({ rootDir: plugin.rootDir, name: plugin.manifest.name });
|
|
279
|
+
if (enabled) await manager.enable(plugin.id);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
for (const dir of launchDirs) {
|
|
283
|
+
const plugin = await manager.install(dir, "user", { authorityRoot: dir });
|
|
284
|
+
installed.push(plugin);
|
|
285
|
+
const enabled = settings.read({ rootDir: plugin.rootDir, name: plugin.manifest.name });
|
|
286
|
+
if (enabled) await manager.enable(plugin.id);
|
|
287
|
+
}
|
|
288
|
+
} catch (error) {
|
|
289
|
+
const cleanupErrors = [];
|
|
290
|
+
for (const plugin of [...installed].reverse()) {
|
|
291
|
+
try {
|
|
292
|
+
await manager.uninstall(plugin.id);
|
|
293
|
+
} catch (cleanupError) {
|
|
294
|
+
cleanupErrors.push(cleanupError);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
const cleanupSuffix = cleanupErrors.length === 0 ? "" : ` Cleanup also failed: ${cleanupErrors.map(message).join("; ")}`;
|
|
298
|
+
throw new Error(`Plugin runtime could not start: ${message(error)}.${cleanupSuffix}`, {
|
|
299
|
+
cause: error
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
let closePromise;
|
|
303
|
+
let closed = false;
|
|
304
|
+
let mutation;
|
|
305
|
+
const contributedToolNames = /* @__PURE__ */ __name((prefix) => manager.toolsets.flatMap((ts) => ts.tools()).map((tool) => tool.name).filter((name) => name.startsWith(prefix)).sort(), "contributedToolNames");
|
|
306
|
+
return {
|
|
307
|
+
manager,
|
|
308
|
+
hookOptions: shellOptions,
|
|
309
|
+
skills,
|
|
310
|
+
pluginCount: installed.length,
|
|
311
|
+
sessionEndBudgetMs: sessionEndHookBudgetMs(hooks),
|
|
312
|
+
hookActivity,
|
|
313
|
+
pluginHookEntries: /* @__PURE__ */ __name(() => plugins.getAll().filter((plugin) => plugin.status === "enabled").flatMap((plugin) => {
|
|
314
|
+
const state = shipped.get(plugin.id);
|
|
315
|
+
return (state?.entries ?? []).map(({ event, entry }) => ({
|
|
316
|
+
plugin: state?.name ?? plugin.manifest.name,
|
|
317
|
+
event,
|
|
318
|
+
entry,
|
|
319
|
+
...state?.off !== void 0 ? { off: state.off } : {}
|
|
320
|
+
}));
|
|
321
|
+
}), "pluginHookEntries"),
|
|
322
|
+
pluginHookProblems: /* @__PURE__ */ __name(() => plugins.getAll().filter((plugin) => plugin.status === "enabled").flatMap(
|
|
323
|
+
(plugin) => (shipped.get(plugin.id)?.problems ?? []).map((problem) => ({
|
|
324
|
+
...problem,
|
|
325
|
+
plugin: plugin.manifest.name
|
|
326
|
+
}))
|
|
327
|
+
), "pluginHookProblems"),
|
|
328
|
+
takePluginHookWarnings: /* @__PURE__ */ __name(() => warningLines.splice(0), "takePluginHookWarnings"),
|
|
329
|
+
pluginHooks: /* @__PURE__ */ __name(() => manager.listHooks().filter((hook) => hook.pluginId !== SHELL_HOOKS_PLUGIN_ID && hook.shell !== true).map((hook) => ({
|
|
330
|
+
plugin: plugins.get(hook.pluginId)?.manifest.name ?? String(hook.pluginId),
|
|
331
|
+
event: hook.event
|
|
332
|
+
})), "pluginHooks"),
|
|
333
|
+
list: /* @__PURE__ */ __name(() => plugins.getAll().map((plugin) => {
|
|
334
|
+
const prefix = `${plugin.manifest.name}__`;
|
|
335
|
+
let startupEnabled;
|
|
336
|
+
let startupError;
|
|
337
|
+
try {
|
|
338
|
+
startupEnabled = settings.read({ rootDir: plugin.rootDir, name: plugin.manifest.name });
|
|
339
|
+
} catch (error) {
|
|
340
|
+
startupError = message(error);
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
name: plugin.manifest.name,
|
|
344
|
+
version: plugin.manifest.version,
|
|
345
|
+
description: plugin.manifest.description,
|
|
346
|
+
scope: plugin.scope,
|
|
347
|
+
rootDir: plugin.rootDir,
|
|
348
|
+
status: plugin.status === "installed" ? "disabled" : plugin.status,
|
|
349
|
+
...startupEnabled !== void 0 ? { startupEnabled } : {},
|
|
350
|
+
...startupError ? { startupError } : {},
|
|
351
|
+
tools: contributedToolNames(prefix),
|
|
352
|
+
skills: skills.list().map((skill) => skill.metadata.name).filter((name) => name.startsWith(prefix)).sort(),
|
|
353
|
+
hookModules: (plugin.manifest.hooks ?? []).filter(
|
|
354
|
+
(path) => !path.toLowerCase().endsWith(".json")
|
|
355
|
+
),
|
|
356
|
+
hookEntries: readPluginHookEntriesOf(plugin).count,
|
|
357
|
+
mcpServers: (plugin.manifest.mcpServers ?? []).map((server) => server.name),
|
|
358
|
+
commands: resolvePluginFileDirs(
|
|
359
|
+
plugin.manifest.name,
|
|
360
|
+
plugin.rootDir,
|
|
361
|
+
plugin.manifest.commands
|
|
362
|
+
).dirs.flatMap(
|
|
363
|
+
(source) => listMarkdownNames(source.dir).map((file) => `${prefix}${file}`)
|
|
364
|
+
),
|
|
365
|
+
agents: resolvePluginFileDirs(
|
|
366
|
+
plugin.manifest.name,
|
|
367
|
+
plugin.rootDir,
|
|
368
|
+
plugin.manifest.agents
|
|
369
|
+
).dirs.flatMap(
|
|
370
|
+
(source) => listMarkdownNames(source.dir).map((file) => `${prefix}${file}`)
|
|
371
|
+
)
|
|
372
|
+
};
|
|
373
|
+
}).sort((a, b) => a.name.localeCompare(b.name)), "list"),
|
|
374
|
+
async setEnabled(name, enabled) {
|
|
375
|
+
if (closed) throw new Error("Plugin runtime is closed.");
|
|
376
|
+
if (mutation) throw new Error("Another plugin change is in progress.");
|
|
377
|
+
const plugin = plugins.findByName(name);
|
|
378
|
+
if (!plugin) throw new Error(`Plugin "${name}" is not loaded in this session.`);
|
|
379
|
+
if (enabled && plugin.status === "enabled" || !enabled && (plugin.status === "disabled" || plugin.status === "installed"))
|
|
380
|
+
return;
|
|
381
|
+
mutation = enabled ? manager.enable(plugin.id) : manager.disable(plugin.id);
|
|
382
|
+
try {
|
|
383
|
+
await mutation;
|
|
384
|
+
} finally {
|
|
385
|
+
mutation = void 0;
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
async rememberState(name) {
|
|
389
|
+
if (closed) throw new Error("Plugin runtime is closed.");
|
|
390
|
+
if (mutation) throw new Error("Another plugin change is in progress.");
|
|
391
|
+
const plugin = plugins.findByName(name);
|
|
392
|
+
if (!plugin) throw new Error(`Plugin "${name}" is not loaded in this session.`);
|
|
393
|
+
if (!["enabled", "disabled", "installed"].includes(plugin.status)) {
|
|
394
|
+
throw new Error("Resolve the plugin error before remembering its state.");
|
|
395
|
+
}
|
|
396
|
+
const enabled = plugin.status === "enabled";
|
|
397
|
+
settings.write({ rootDir: plugin.rootDir, name }, enabled);
|
|
398
|
+
},
|
|
399
|
+
close() {
|
|
400
|
+
if (closePromise) return closePromise;
|
|
401
|
+
closed = true;
|
|
402
|
+
closePromise = (async () => {
|
|
403
|
+
hookActivity.close();
|
|
404
|
+
if (mutation) await mutation.catch(() => {
|
|
405
|
+
});
|
|
406
|
+
const errors = [];
|
|
407
|
+
for (const plugin of [...installed].reverse()) {
|
|
408
|
+
try {
|
|
409
|
+
await manager.uninstall(plugin.id);
|
|
410
|
+
} catch (error) {
|
|
411
|
+
errors.push(error);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (errors.length > 0) {
|
|
415
|
+
throw new AggregateError(errors, "One or more plugins could not be uninstalled.");
|
|
416
|
+
}
|
|
417
|
+
})();
|
|
418
|
+
return closePromise;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
__name(createCliPluginRuntime, "createCliPluginRuntime");
|
|
423
|
+
|
|
424
|
+
// src/integrations/worktrees/managed.ts
|
|
425
|
+
import { execFile } from "node:child_process";
|
|
426
|
+
import { randomUUID } from "node:crypto";
|
|
427
|
+
import { lstat, mkdir, readdir, realpath, rmdir } from "node:fs/promises";
|
|
428
|
+
import { join, resolve } from "node:path";
|
|
429
|
+
import { promisify } from "node:util";
|
|
430
|
+
var runFile = promisify(execFile);
|
|
431
|
+
var HOOK_MADE_BRANCH = "(made by a worktree_create hook)";
|
|
432
|
+
function worktreeOpenHint(path, conversationId) {
|
|
433
|
+
const quoted = process.platform === "win32" ? `'${path.replaceAll("'", "''")}'` : `'${path.replaceAll("'", "'\\''")}'`;
|
|
434
|
+
const launch = `namzu${conversationId ? ` resume ${conversationId}` : ""}`;
|
|
435
|
+
return process.platform === "win32" ? `Set-Location -LiteralPath ${quoted}; if ($?) { ${launch} }` : `cd ${quoted} && ${launch}`;
|
|
436
|
+
}
|
|
437
|
+
__name(worktreeOpenHint, "worktreeOpenHint");
|
|
438
|
+
function checkedLabel(value) {
|
|
439
|
+
if (!/^[a-z0-9][a-z0-9-]{0,63}$/.test(value)) {
|
|
440
|
+
throw new Error("A worktree name must use 1\u201364 lowercase letters, digits or hyphens.");
|
|
441
|
+
}
|
|
442
|
+
return value;
|
|
443
|
+
}
|
|
444
|
+
__name(checkedLabel, "checkedLabel");
|
|
445
|
+
async function git(cwd, ...args) {
|
|
446
|
+
const { stdout } = await runFile("git", ["-C", cwd, ...args]);
|
|
447
|
+
return stdout;
|
|
448
|
+
}
|
|
449
|
+
__name(git, "git");
|
|
450
|
+
async function openManagedWorktrees(cwd, options = {}) {
|
|
451
|
+
const directory = await realpath(resolve(cwd));
|
|
452
|
+
let sourceRoot;
|
|
453
|
+
let repoRoot;
|
|
454
|
+
let notGit;
|
|
455
|
+
try {
|
|
456
|
+
sourceRoot = await realpath((await git(directory, "rev-parse", "--show-toplevel")).trim());
|
|
457
|
+
const listing = await git(directory, "worktree", "list", "--porcelain", "-z");
|
|
458
|
+
const first = listing.split("\0", 1)[0];
|
|
459
|
+
if (!first?.startsWith("worktree ")) throw new Error("Git did not report a main checkout.");
|
|
460
|
+
repoRoot = await realpath(first.slice("worktree ".length));
|
|
461
|
+
const sourceCommon = await realpath(
|
|
462
|
+
(await git(sourceRoot, "rev-parse", "--path-format=absolute", "--git-common-dir")).trim()
|
|
463
|
+
);
|
|
464
|
+
const mainCommon = await realpath(
|
|
465
|
+
(await git(repoRoot, "rev-parse", "--path-format=absolute", "--git-common-dir")).trim()
|
|
466
|
+
);
|
|
467
|
+
if (sourceCommon !== mainCommon)
|
|
468
|
+
throw new Error("The selected checkout belongs to another repository.");
|
|
469
|
+
} catch (cause) {
|
|
470
|
+
const failure = new Error(
|
|
471
|
+
`Cannot manage worktrees here: ${cause instanceof Error ? cause.message : String(cause)}`
|
|
472
|
+
);
|
|
473
|
+
if (options.hooks === void 0) throw failure;
|
|
474
|
+
notGit = failure;
|
|
475
|
+
sourceRoot = directory;
|
|
476
|
+
repoRoot = directory;
|
|
477
|
+
}
|
|
478
|
+
const sessions = await openSessions(repoRoot, options);
|
|
479
|
+
const worktreesDir = sessions.paths.worktrees();
|
|
480
|
+
closeSessions(sessions);
|
|
481
|
+
try {
|
|
482
|
+
const node = await lstat(worktreesDir);
|
|
483
|
+
if (!node.isDirectory()) throw new Error("The managed worktree path is not a directory.");
|
|
484
|
+
} catch (cause) {
|
|
485
|
+
if (cause.code !== "ENOENT") throw cause;
|
|
486
|
+
}
|
|
487
|
+
const kernel = notGit === void 0 ? new GitWorktreeDriver({ repoRoot, worktreesDir, logger: cliLogger() }) : withoutGit(notGit);
|
|
488
|
+
return new ManagedWorktrees(
|
|
489
|
+
repoRoot,
|
|
490
|
+
sourceRoot,
|
|
491
|
+
worktreesDir,
|
|
492
|
+
new HookedWorkspaceDriver({
|
|
493
|
+
inner: kernel,
|
|
494
|
+
hooks: options.hooks ?? (() => void 0),
|
|
495
|
+
root: /* @__PURE__ */ __name(() => worktreesDir, "root"),
|
|
496
|
+
repoRoot: /* @__PURE__ */ __name(() => repoRoot, "repoRoot"),
|
|
497
|
+
...options.onNotice ? { onNotice: options.onNotice } : {}
|
|
498
|
+
}),
|
|
499
|
+
options,
|
|
500
|
+
notGit === void 0
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
__name(openManagedWorktrees, "openManagedWorktrees");
|
|
504
|
+
function withoutGit(failure) {
|
|
505
|
+
const refuse = /* @__PURE__ */ __name(async () => {
|
|
506
|
+
throw failure;
|
|
507
|
+
}, "refuse");
|
|
508
|
+
return {
|
|
509
|
+
kind: "git-worktree",
|
|
510
|
+
create: refuse,
|
|
511
|
+
branch: refuse,
|
|
512
|
+
dispose: refuse,
|
|
513
|
+
inspect: refuse
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
__name(withoutGit, "withoutGit");
|
|
517
|
+
var ManagedWorktrees = class {
|
|
518
|
+
constructor(repoRoot, sourceRoot, worktreesDir, driver, options, isGit = true) {
|
|
519
|
+
this.repoRoot = repoRoot;
|
|
520
|
+
this.sourceRoot = sourceRoot;
|
|
521
|
+
this.worktreesDir = worktreesDir;
|
|
522
|
+
this.driver = driver;
|
|
523
|
+
this.options = options;
|
|
524
|
+
this.isGit = isGit;
|
|
525
|
+
}
|
|
526
|
+
repoRoot;
|
|
527
|
+
sourceRoot;
|
|
528
|
+
worktreesDir;
|
|
529
|
+
driver;
|
|
530
|
+
options;
|
|
531
|
+
isGit;
|
|
532
|
+
static {
|
|
533
|
+
__name(this, "ManagedWorktrees");
|
|
534
|
+
}
|
|
535
|
+
/** The driver that makes and removes worktrees: hooks first, the kernel's Git logic otherwise. */
|
|
536
|
+
get workspaceDriver() {
|
|
537
|
+
return this.driver;
|
|
538
|
+
}
|
|
539
|
+
ref(label) {
|
|
540
|
+
const checked = checkedLabel(label);
|
|
541
|
+
return {
|
|
542
|
+
id: generateWorkspaceId(),
|
|
543
|
+
meta: {
|
|
544
|
+
backend: "git-worktree",
|
|
545
|
+
repoRoot: this.repoRoot,
|
|
546
|
+
branch: `namzu/${checked}`,
|
|
547
|
+
worktreePath: join(this.worktreesDir, checked)
|
|
548
|
+
},
|
|
549
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
/** Registered Namzu-owned checkouts only; arbitrary folders are omitted. */
|
|
553
|
+
async list() {
|
|
554
|
+
let entries;
|
|
555
|
+
try {
|
|
556
|
+
entries = await readdir(this.worktreesDir, {
|
|
557
|
+
withFileTypes: true,
|
|
558
|
+
encoding: "utf8"
|
|
559
|
+
});
|
|
560
|
+
} catch (cause) {
|
|
561
|
+
if (cause.code === "ENOENT") return [];
|
|
562
|
+
throw cause;
|
|
563
|
+
}
|
|
564
|
+
const found = [];
|
|
565
|
+
for (const entry of entries) {
|
|
566
|
+
if (!entry.isDirectory()) continue;
|
|
567
|
+
if (!/^[a-z0-9][a-z0-9-]{0,63}$/.test(entry.name)) continue;
|
|
568
|
+
try {
|
|
569
|
+
const worktree = await this.inspect(entry.name);
|
|
570
|
+
if (worktree) found.push(worktree);
|
|
571
|
+
} catch {
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
return found.sort((a, b) => a.label.localeCompare(b.label));
|
|
575
|
+
}
|
|
576
|
+
/** An exact label must still pass the SDK driver's ownership and Git registration checks. */
|
|
577
|
+
async inspect(label) {
|
|
578
|
+
const ref = this.ref(label);
|
|
579
|
+
const inspection = await this.driver.inspect(ref);
|
|
580
|
+
return inspection.exists ? {
|
|
581
|
+
label,
|
|
582
|
+
path: ref.meta.worktreePath,
|
|
583
|
+
branch: ref.meta.branch,
|
|
584
|
+
dirty: inspection.isDirty
|
|
585
|
+
} : null;
|
|
586
|
+
}
|
|
587
|
+
/** Create at the selected checkout's committed HEAD, leaving its dirty files in place. */
|
|
588
|
+
async create(label) {
|
|
589
|
+
const name = checkedLabel(label ?? `work-${randomUUID().slice(0, 8)}`);
|
|
590
|
+
const sourceDirty = this.isGit ? (await git(this.sourceRoot, "status", "--porcelain")).trim().length > 0 : false;
|
|
591
|
+
const head = this.isGit ? (await git(this.sourceRoot, "rev-parse", "HEAD")).trim() : void 0;
|
|
592
|
+
await mkdir(this.worktreesDir, { recursive: true, mode: 448 });
|
|
593
|
+
const lockPath = join(this.worktreesDir, `.${name}.creating`);
|
|
594
|
+
try {
|
|
595
|
+
await mkdir(lockPath);
|
|
596
|
+
} catch (cause) {
|
|
597
|
+
if (cause.code === "EEXIST") {
|
|
598
|
+
throw new Error(`Worktree ${name} is already being created. Try another name.`);
|
|
599
|
+
}
|
|
600
|
+
throw cause;
|
|
601
|
+
}
|
|
602
|
+
try {
|
|
603
|
+
if (this.isGit && await this.inspect(name)) {
|
|
604
|
+
throw new Error(`Worktree ${name} already exists.`);
|
|
605
|
+
}
|
|
606
|
+
const ref = await this.driver.create({
|
|
607
|
+
label: name,
|
|
608
|
+
...head !== void 0 ? { baseRef: head } : {}
|
|
609
|
+
});
|
|
610
|
+
const inspection = await this.driver.inspect(ref);
|
|
611
|
+
if (!inspection.exists) {
|
|
612
|
+
throw new Error(
|
|
613
|
+
ref.meta.hookOwned === true ? `A worktree_create hook gave ${ref.meta.worktreePath}, which is not a folder that exists.` : `Git reported a worktree at ${ref.meta.worktreePath}, but it is not registered.`
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
return {
|
|
617
|
+
label: name,
|
|
618
|
+
path: ref.meta.worktreePath,
|
|
619
|
+
branch: ref.meta.hookOwned === true ? HOOK_MADE_BRANCH : ref.meta.branch,
|
|
620
|
+
madeByHook: ref.meta.hookOwned === true,
|
|
621
|
+
dirty: inspection.isDirty,
|
|
622
|
+
sourceDirty
|
|
623
|
+
};
|
|
624
|
+
} finally {
|
|
625
|
+
await rmdir(lockPath);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
/** Fork the source checkout's settled conversation into the new checkout's Project. */
|
|
629
|
+
async fork(sourceConversationId, label) {
|
|
630
|
+
const source = await openSessions(this.sourceRoot, this.options);
|
|
631
|
+
try {
|
|
632
|
+
const sourceId = asSessionId(sourceConversationId);
|
|
633
|
+
const messages = await loadResumableConversation(source, sourceId);
|
|
634
|
+
if (messages.length === 0) {
|
|
635
|
+
throw new Error("There is nothing to fork yet \u2014 this conversation has no messages.");
|
|
636
|
+
}
|
|
637
|
+
if (await activeConversationTurn(source, sourceId)) {
|
|
638
|
+
throw new Error("Wait for the current turn to finish before forking to a worktree.");
|
|
639
|
+
}
|
|
640
|
+
const created = await this.create(label);
|
|
641
|
+
try {
|
|
642
|
+
const target = await openSessions(created.path, this.options);
|
|
643
|
+
try {
|
|
644
|
+
const forked = await forkConversationInto(source, target, sourceId);
|
|
645
|
+
return {
|
|
646
|
+
...created,
|
|
647
|
+
conversationId: forked.id,
|
|
648
|
+
title: forked.title,
|
|
649
|
+
copied: forked.copied
|
|
650
|
+
};
|
|
651
|
+
} finally {
|
|
652
|
+
closeSessions(target);
|
|
653
|
+
}
|
|
654
|
+
} catch (cause) {
|
|
655
|
+
throw new Error(
|
|
656
|
+
`Worktree ${created.path} was created, but its conversation copy failed: ${cause instanceof Error ? cause.message : String(cause)}. The worktree was kept for inspection.`
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
} finally {
|
|
660
|
+
closeSessions(source);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
/** Resolve an owned checkout and one of its own conversations for a fresh TUI launch. */
|
|
664
|
+
async resume(label, conversationId) {
|
|
665
|
+
const worktree = await this.inspect(label);
|
|
666
|
+
if (!worktree) throw new Error(`No managed worktree named ${label} is registered here.`);
|
|
667
|
+
const sessions = await openSessions(worktree.path, this.options);
|
|
668
|
+
try {
|
|
669
|
+
if (conversationId) {
|
|
670
|
+
await loadResumableConversation(sessions, conversationId);
|
|
671
|
+
return { worktree, conversationId };
|
|
672
|
+
}
|
|
673
|
+
const latest = (await listRecent(sessions, 1))[0];
|
|
674
|
+
return latest ? { worktree, conversationId: latest.id, title: latest.title } : { worktree };
|
|
675
|
+
} finally {
|
|
676
|
+
closeSessions(sessions);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
export {
|
|
682
|
+
createCliPluginRuntime,
|
|
683
|
+
worktreeOpenHint,
|
|
684
|
+
openManagedWorktrees
|
|
685
|
+
};
|
|
686
|
+
//# sourceMappingURL=chunk-LQZIENWB.js.map
|