@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
|
@@ -2,17 +2,17 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __namzuCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
assembleHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5WORROIE.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveGeneratorSettings
|
|
8
|
+
} from "./chunk-LCGXWCVU.js";
|
|
6
9
|
import {
|
|
7
10
|
bindPermissionTableToSource,
|
|
8
11
|
mergePermissionSettings,
|
|
9
12
|
mergePermissionTables,
|
|
10
13
|
permissionSettingsProblem,
|
|
11
14
|
splitPermissionsTable
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
resolveGeneratorSettings
|
|
15
|
-
} from "./chunk-LCGXWCVU.js";
|
|
15
|
+
} from "./chunk-4NVFHP23.js";
|
|
16
16
|
import {
|
|
17
17
|
McpServerFileError,
|
|
18
18
|
PROJECT_MCP_FILE,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
clearStoredApiKey,
|
|
43
43
|
readStoredApiKey,
|
|
44
44
|
writeStoredApiKey
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-XFCFWWFK.js";
|
|
46
46
|
import {
|
|
47
47
|
BROWSER_ACT_TOOL_NAME,
|
|
48
48
|
BROWSER_TOOL_NAME,
|
|
@@ -52,24 +52,204 @@ import {
|
|
|
52
52
|
SHELL_HOOK_PASCAL_EVENT_NAMES,
|
|
53
53
|
canonicalizeBrowserSitePattern,
|
|
54
54
|
canonicalizeBrowserUrl,
|
|
55
|
+
isPluginFolderVariable,
|
|
55
56
|
passthroughToolNames,
|
|
57
|
+
referencedVariables,
|
|
56
58
|
resolveAutoCompactWindowSetting,
|
|
57
59
|
resolveNamzuHome,
|
|
60
|
+
shellHookEnvNameProblem,
|
|
61
|
+
shellHookEnvProblems,
|
|
58
62
|
toolResultCorrespondenceGuardrail,
|
|
59
63
|
toolResultInjectionGuardrail
|
|
60
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-JTEWIH66.js";
|
|
61
65
|
import {
|
|
62
66
|
__name,
|
|
63
67
|
__toESM
|
|
64
68
|
} from "./chunk-76FLAFCG.js";
|
|
65
69
|
|
|
66
|
-
// src/
|
|
67
|
-
import {
|
|
70
|
+
// src/config/load.ts
|
|
71
|
+
import { readFileSync as readFileSync3 } from "node:fs";
|
|
72
|
+
import { join as join3, resolve as resolve2 } from "node:path";
|
|
73
|
+
|
|
74
|
+
// src/integrations/decision/connection.ts
|
|
75
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
76
|
+
import { randomUUID } from "node:crypto";
|
|
68
77
|
import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
69
|
-
import { dirname, join
|
|
78
|
+
import { dirname, join } from "node:path";
|
|
79
|
+
var DECISION_KEY_ID = "decision";
|
|
80
|
+
var DEFAULT_CONNECTED_POINTS = {
|
|
81
|
+
notify: "on",
|
|
82
|
+
memory: "shadow",
|
|
83
|
+
skill: "on",
|
|
84
|
+
pick: "shadow"
|
|
85
|
+
};
|
|
86
|
+
function connectedPointsNotice(points = DEFAULT_CONNECTED_POINTS) {
|
|
87
|
+
const names = /* @__PURE__ */ __name((mode) => Object.entries(points).filter(([, value]) => value === mode).map(([name]) => name), "names");
|
|
88
|
+
const on = names("on");
|
|
89
|
+
const shadow = names("shadow");
|
|
90
|
+
const join4 = /* @__PURE__ */ __name((list) => list.join(" and "), "join");
|
|
91
|
+
if (on.length === 0 && shadow.length === 0) return "No decision point is on.";
|
|
92
|
+
const parts = [];
|
|
93
|
+
if (on.length > 0) parts.push(`${join4(on)} ${on.length > 1 ? "are" : "is"} on`);
|
|
94
|
+
if (shadow.length > 0)
|
|
95
|
+
parts.push(
|
|
96
|
+
`${join4(shadow)} only record${shadow.length > 1 ? "" : "s"} to the decision log until you set ${shadow.length > 1 ? "them" : "it"} to on`
|
|
97
|
+
);
|
|
98
|
+
return `${parts.join("; ")}.`;
|
|
99
|
+
}
|
|
100
|
+
__name(connectedPointsNotice, "connectedPointsNotice");
|
|
101
|
+
function homeDir(opts) {
|
|
102
|
+
return resolveNamzuHome({
|
|
103
|
+
...opts.home ? { home: opts.home } : {},
|
|
104
|
+
env: opts.env ?? process.env
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
__name(homeDir, "homeDir");
|
|
108
|
+
function connectionPath(opts = {}) {
|
|
109
|
+
return join(homeDir(opts), "decision-connection.json");
|
|
110
|
+
}
|
|
111
|
+
__name(connectionPath, "connectionPath");
|
|
112
|
+
function readConnection(opts = {}) {
|
|
113
|
+
try {
|
|
114
|
+
const parsed = JSON.parse(readFileSync(connectionPath(opts), "utf8"));
|
|
115
|
+
if (parsed.provider === "azure" && typeof parsed.endpoint === "string" && typeof parsed.deployment === "string") {
|
|
116
|
+
return { provider: "azure", endpoint: parsed.endpoint, deployment: parsed.deployment };
|
|
117
|
+
}
|
|
118
|
+
if (parsed.provider === "http" && typeof parsed.url === "string") {
|
|
119
|
+
return {
|
|
120
|
+
provider: "http",
|
|
121
|
+
url: parsed.url,
|
|
122
|
+
...typeof parsed.model === "string" && parsed.model ? { model: parsed.model } : {},
|
|
123
|
+
...typeof parsed.apiKeyEnv === "string" && parsed.apiKeyEnv ? { apiKeyEnv: parsed.apiKeyEnv } : {}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
} catch {
|
|
127
|
+
}
|
|
128
|
+
return void 0;
|
|
129
|
+
}
|
|
130
|
+
__name(readConnection, "readConnection");
|
|
131
|
+
function writeAtomic(path, body) {
|
|
132
|
+
mkdirSync(dirname(path), { recursive: true, mode: 448 });
|
|
133
|
+
const temp = `${path}.${randomUUID()}.tmp`;
|
|
134
|
+
try {
|
|
135
|
+
writeFileSync(temp, body, { mode: 384 });
|
|
136
|
+
renameSync(temp, path);
|
|
137
|
+
} catch (error) {
|
|
138
|
+
rmSync(temp, { force: true });
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
__name(writeAtomic, "writeAtomic");
|
|
143
|
+
function writeConnection(conn, opts = {}) {
|
|
144
|
+
writeAtomic(connectionPath(opts), `${JSON.stringify(conn, null, 2)}
|
|
145
|
+
`);
|
|
146
|
+
resetBoundKeyCache();
|
|
147
|
+
}
|
|
148
|
+
__name(writeConnection, "writeConnection");
|
|
149
|
+
function connectionToBlock(conn, points = DEFAULT_CONNECTED_POINTS) {
|
|
150
|
+
return { ...conn, points };
|
|
151
|
+
}
|
|
152
|
+
__name(connectionToBlock, "connectionToBlock");
|
|
153
|
+
function saveDecisionKey(key, opts = {}) {
|
|
154
|
+
const path = writeStoredApiKey(DECISION_KEY_ID, key, opts.home);
|
|
155
|
+
resetBoundKeyCache();
|
|
156
|
+
return path;
|
|
157
|
+
}
|
|
158
|
+
__name(saveDecisionKey, "saveDecisionKey");
|
|
159
|
+
function readDecisionKey(opts = {}) {
|
|
160
|
+
return readStoredApiKey(DECISION_KEY_ID, opts.home);
|
|
161
|
+
}
|
|
162
|
+
__name(readDecisionKey, "readDecisionKey");
|
|
163
|
+
function clearDecisionKey(opts = {}) {
|
|
164
|
+
clearStoredApiKey(DECISION_KEY_ID, opts.home);
|
|
165
|
+
resetBoundKeyCache();
|
|
166
|
+
}
|
|
167
|
+
__name(clearDecisionKey, "clearDecisionKey");
|
|
168
|
+
function connectionAddress(conn) {
|
|
169
|
+
return conn.provider === "azure" ? conn.endpoint : conn.url;
|
|
170
|
+
}
|
|
171
|
+
__name(connectionAddress, "connectionAddress");
|
|
172
|
+
var boundKeys = /* @__PURE__ */ new Map();
|
|
173
|
+
function resetBoundKeyCache() {
|
|
174
|
+
boundKeys.clear();
|
|
175
|
+
}
|
|
176
|
+
__name(resetBoundKeyCache, "resetBoundKeyCache");
|
|
177
|
+
function readBoundDecisionKey(address, opts = {}) {
|
|
178
|
+
const id = `${opts.home ?? ""}\0${address}`;
|
|
179
|
+
const known = boundKeys.get(id);
|
|
180
|
+
if (known !== void 0) return known;
|
|
181
|
+
const conn = readConnection(opts);
|
|
182
|
+
const key = conn && connectionAddress(conn) === address ? readDecisionKey(opts) : null;
|
|
183
|
+
boundKeys.set(id, key);
|
|
184
|
+
return key;
|
|
185
|
+
}
|
|
186
|
+
__name(readBoundDecisionKey, "readBoundDecisionKey");
|
|
187
|
+
function resolveDecisionShorthand(value, opts = {}) {
|
|
188
|
+
if (value !== true) return value;
|
|
189
|
+
const conn = readConnection(opts);
|
|
190
|
+
return conn ? connectionToBlock(conn) : void 0;
|
|
191
|
+
}
|
|
192
|
+
__name(resolveDecisionShorthand, "resolveDecisionShorthand");
|
|
193
|
+
function readUserDecisionSetting(opts = {}) {
|
|
194
|
+
try {
|
|
195
|
+
const parsed = (0, import_yaml.parse)(readFileSync(join(homeDir(opts), "config.yaml"), "utf8"));
|
|
196
|
+
const value = parsed?.decision;
|
|
197
|
+
if (value === true) return "shorthand";
|
|
198
|
+
if (value !== void 0 && value !== null && value !== false) return "block";
|
|
199
|
+
} catch {
|
|
200
|
+
}
|
|
201
|
+
return "absent";
|
|
202
|
+
}
|
|
203
|
+
__name(readUserDecisionSetting, "readUserDecisionSetting");
|
|
204
|
+
function offerPath(opts = {}) {
|
|
205
|
+
return join(homeDir(opts), "decision-offer.json");
|
|
206
|
+
}
|
|
207
|
+
__name(offerPath, "offerPath");
|
|
208
|
+
function readOffer(opts = {}) {
|
|
209
|
+
try {
|
|
210
|
+
const parsed = JSON.parse(readFileSync(offerPath(opts), "utf8"));
|
|
211
|
+
if ((parsed.answer === "later" || parsed.answer === "never") && typeof parsed.at === "string") {
|
|
212
|
+
return { answer: parsed.answer, at: parsed.at };
|
|
213
|
+
}
|
|
214
|
+
} catch {
|
|
215
|
+
}
|
|
216
|
+
return void 0;
|
|
217
|
+
}
|
|
218
|
+
__name(readOffer, "readOffer");
|
|
219
|
+
function recordOffer(answer, opts = {}, now = () => /* @__PURE__ */ new Date()) {
|
|
220
|
+
writeAtomic(offerPath(opts), `${JSON.stringify({ answer, at: now().toISOString() })}
|
|
221
|
+
`);
|
|
222
|
+
}
|
|
223
|
+
__name(recordOffer, "recordOffer");
|
|
224
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
225
|
+
function shouldOfferDecisionSetup(input) {
|
|
226
|
+
if (input.env.NAMZU_NO_DECISION === "1") return false;
|
|
227
|
+
if (input.setting !== "absent") return false;
|
|
228
|
+
if (!input.record) return true;
|
|
229
|
+
if (input.record.answer === "never") return false;
|
|
230
|
+
const at = Date.parse(input.record.at);
|
|
231
|
+
return Number.isNaN(at) || input.now - at >= DAY_MS;
|
|
232
|
+
}
|
|
233
|
+
__name(shouldOfferDecisionSetup, "shouldOfferDecisionSetup");
|
|
234
|
+
function decisionStatusLine(input) {
|
|
235
|
+
if (input.env.NAMZU_NO_DECISION === "1") return "Off (NAMZU_NO_DECISION)";
|
|
236
|
+
if (!input.config && !input.connected) return "Not connected";
|
|
237
|
+
const points = input.config?.points ?? {};
|
|
238
|
+
const named = Object.entries(points).filter(([, mode]) => mode !== "off").map(([name, mode]) => `${name} ${mode}`);
|
|
239
|
+
return `Connected${named.length > 0 ? ` \xB7 ${named.join(", ")}` : " \xB7 no point is on"}`;
|
|
240
|
+
}
|
|
241
|
+
__name(decisionStatusLine, "decisionStatusLine");
|
|
242
|
+
|
|
243
|
+
// src/config/load.ts
|
|
244
|
+
var import_yaml2 = __toESM(require_dist(), 1);
|
|
245
|
+
|
|
246
|
+
// src/integrations/mcp/project-approval.ts
|
|
247
|
+
import { createHash, randomUUID as randomUUID2 } from "node:crypto";
|
|
248
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as renameSync2, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
249
|
+
import { dirname as dirname2, join as join2, resolve } from "node:path";
|
|
70
250
|
var FILE_VERSION = 1;
|
|
71
251
|
function mcpApprovalsPath(namzuHome) {
|
|
72
|
-
return
|
|
252
|
+
return join2(namzuHome, "mcp-approvals.json");
|
|
73
253
|
}
|
|
74
254
|
__name(mcpApprovalsPath, "mcpApprovalsPath");
|
|
75
255
|
function folderKey(cwd) {
|
|
@@ -97,7 +277,7 @@ __name(fingerprintMcpServer, "fingerprintMcpServer");
|
|
|
97
277
|
function readFile(namzuHome) {
|
|
98
278
|
try {
|
|
99
279
|
const parsed = JSON.parse(
|
|
100
|
-
|
|
280
|
+
readFileSync2(mcpApprovalsPath(namzuHome), "utf8")
|
|
101
281
|
);
|
|
102
282
|
const folders = {};
|
|
103
283
|
if (parsed.folders !== null && typeof parsed.folders === "object") {
|
|
@@ -156,14 +336,14 @@ function recordApprovals(namzuHome, cwd, prints) {
|
|
|
156
336
|
for (const name of chosen) folder[name] = prints[name];
|
|
157
337
|
const next = { version: FILE_VERSION, folders: { ...file.folders, [key]: folder } };
|
|
158
338
|
const path = mcpApprovalsPath(namzuHome);
|
|
159
|
-
|
|
160
|
-
const temporary = `${path}.${process.pid}.${
|
|
339
|
+
mkdirSync2(dirname2(path), { recursive: true, mode: 448 });
|
|
340
|
+
const temporary = `${path}.${process.pid}.${randomUUID2()}.tmp`;
|
|
161
341
|
try {
|
|
162
|
-
|
|
342
|
+
writeFileSync2(temporary, `${JSON.stringify(next, null, 2)}
|
|
163
343
|
`, { mode: 384 });
|
|
164
|
-
|
|
344
|
+
renameSync2(temporary, path);
|
|
165
345
|
} catch (error) {
|
|
166
|
-
|
|
346
|
+
rmSync2(temporary, { force: true });
|
|
167
347
|
throw error;
|
|
168
348
|
}
|
|
169
349
|
return chosen;
|
|
@@ -394,379 +574,45 @@ function isBrowserDeny(rule) {
|
|
|
394
574
|
return rule.toolNames.some((name) => BROWSER_TOOLS.has(name));
|
|
395
575
|
case "argument_pattern":
|
|
396
576
|
return rule.decision === "deny" && rule.toolNames.some((name) => BROWSER_TOOLS.has(name));
|
|
397
|
-
case "custom_pattern":
|
|
398
|
-
return rule.decision === "deny" && (rule.pattern.startsWith(`^${BROWSER_TOOL_NAME}`) || rule.pattern.startsWith(`^${BROWSER_ACT_TOOL_NAME}`));
|
|
399
|
-
default:
|
|
400
|
-
return false;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
__name(isBrowserDeny, "isBrowserDeny");
|
|
404
|
-
function withBrowserSiteRules(tableRules, siteRules) {
|
|
405
|
-
return [
|
|
406
|
-
...tableRules.filter(isBrowserDeny),
|
|
407
|
-
...siteRules,
|
|
408
|
-
...tableRules.filter((rule) => !isBrowserDeny(rule))
|
|
409
|
-
];
|
|
410
|
-
}
|
|
411
|
-
__name(withBrowserSiteRules, "withBrowserSiteRules");
|
|
412
|
-
function browserSiteRuleFor(sites, origin) {
|
|
413
|
-
const normalized = normalizeBrowserSites(sites).sites;
|
|
414
|
-
const parsed = Object.entries(normalized).filter(([key]) => key !== "*").map(([key, level]) => parseSite(key, level)).filter((site) => site !== void 0);
|
|
415
|
-
const hits = parsed.filter((site) => new RegExp(`^${originSource(site)}$`).test(origin));
|
|
416
|
-
const deny = hits.find((site) => site.level === "deny");
|
|
417
|
-
if (deny) return { site: deny.key, level: "deny" };
|
|
418
|
-
const best = hits.sort((a, b) => specificity(b) - specificity(a))[0];
|
|
419
|
-
if (best) return { site: best.key, level: best.level };
|
|
420
|
-
return { site: "*", level: normalized["*"] ?? DEFAULT_BROWSER_SITE_LEVEL };
|
|
421
|
-
}
|
|
422
|
-
__name(browserSiteRuleFor, "browserSiteRuleFor");
|
|
423
|
-
function browserCallOrigin(toolName, input) {
|
|
424
|
-
if (typeof input !== "object" || input === null) return void 0;
|
|
425
|
-
const record = input;
|
|
426
|
-
if (toolName === BROWSER_ACT_TOOL_NAME) {
|
|
427
|
-
return typeof record.origin === "string" ? record.origin : void 0;
|
|
428
|
-
}
|
|
429
|
-
if (toolName === BROWSER_TOOL_NAME && typeof record.url === "string") {
|
|
430
|
-
const verdict = canonicalizeBrowserUrl(record.url);
|
|
431
|
-
return verdict.ok && verdict.url !== "about:blank" ? verdict.origin : void 0;
|
|
432
|
-
}
|
|
433
|
-
return void 0;
|
|
434
|
-
}
|
|
435
|
-
__name(browserCallOrigin, "browserCallOrigin");
|
|
436
|
-
|
|
437
|
-
// src/config/debug.ts
|
|
438
|
-
function createConfigDebugSnapshot(provenance, options = {}) {
|
|
439
|
-
const sources = {
|
|
440
|
-
...provenance
|
|
441
|
-
};
|
|
442
|
-
if (options.formatFromCli) sources.format = { kind: "cli-flag", flag: "--format" };
|
|
443
|
-
if (options.quietFromCli) sources.quiet = { kind: "cli-flag", flag: "--quiet" };
|
|
444
|
-
const selectedProfile = options.selectedProfile ? Object.freeze({ ...options.selectedProfile }) : void 0;
|
|
445
|
-
return Object.freeze({
|
|
446
|
-
sources: Object.freeze(sources),
|
|
447
|
-
...selectedProfile ? { selectedProfile } : {}
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
__name(createConfigDebugSnapshot, "createConfigDebugSnapshot");
|
|
451
|
-
function formatConfigSource(source, dynamic = (value) => value) {
|
|
452
|
-
switch (source.kind) {
|
|
453
|
-
case "default":
|
|
454
|
-
return "default";
|
|
455
|
-
case "user-file":
|
|
456
|
-
return `user-file ${dynamic(source.path)}`;
|
|
457
|
-
case "project-file":
|
|
458
|
-
return `project-file ${dynamic(source.path)}`;
|
|
459
|
-
case "local-file":
|
|
460
|
-
return `local-file ${dynamic(source.path)}`;
|
|
461
|
-
case "profile":
|
|
462
|
-
return `profile ${dynamic(source.name)} (${dynamic(source.path)})`;
|
|
463
|
-
case "env":
|
|
464
|
-
return `env ${dynamic(source.variable)}`;
|
|
465
|
-
case "managed":
|
|
466
|
-
return `managed ${dynamic(source.path)}`;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
__name(formatConfigSource, "formatConfigSource");
|
|
470
|
-
function renderConfigDebug(snapshot) {
|
|
471
|
-
if (!snapshot) {
|
|
472
|
-
return [
|
|
473
|
-
"Configuration provenance is unavailable in this embedded TUI.",
|
|
474
|
-
"Restart through the namzu CLI to inspect launch-time sources."
|
|
475
|
-
].join("\n");
|
|
476
|
-
}
|
|
477
|
-
const lines = [
|
|
478
|
-
"Configuration precedence (low -> high):",
|
|
479
|
-
" default -> user file -> project file -> local file -> selected profile(s) -> environment -> managed file",
|
|
480
|
-
" --format and --quiet override only their matching keys for this process."
|
|
481
|
-
];
|
|
482
|
-
if (snapshot.selectedProfile) {
|
|
483
|
-
lines.push(
|
|
484
|
-
"",
|
|
485
|
-
`Selected profile: ${configMetadataLiteral(snapshot.selectedProfile.name)} (selected by ${snapshot.selectedProfile.selectedBy})`
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
lines.push("", "Winning sources (resolved values are deliberately omitted):");
|
|
489
|
-
const entries = Object.entries(snapshot.sources).sort(
|
|
490
|
-
([left], [right]) => left < right ? -1 : left > right ? 1 : 0
|
|
491
|
-
);
|
|
492
|
-
if (entries.length === 0) {
|
|
493
|
-
lines.push(" <none>");
|
|
494
|
-
} else {
|
|
495
|
-
for (const [key, source] of entries) {
|
|
496
|
-
if (!source) continue;
|
|
497
|
-
lines.push(` ${key}: ${formatEffectiveSource(source)}`);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return lines.join("\n");
|
|
501
|
-
}
|
|
502
|
-
__name(renderConfigDebug, "renderConfigDebug");
|
|
503
|
-
function formatEffectiveSource(source) {
|
|
504
|
-
return source.kind === "cli-flag" ? `CLI flag ${source.flag}` : formatConfigSource(source, configMetadataLiteral);
|
|
505
|
-
}
|
|
506
|
-
__name(formatEffectiveSource, "formatEffectiveSource");
|
|
507
|
-
function configMetadataLiteral(value) {
|
|
508
|
-
const redacted = redactSourceMetadata(value);
|
|
509
|
-
let out = '"';
|
|
510
|
-
for (const character of redacted) {
|
|
511
|
-
const codePoint = character.codePointAt(0);
|
|
512
|
-
if (codePoint === void 0) continue;
|
|
513
|
-
if (character === "\\") out += "\\\\";
|
|
514
|
-
else if (character === '"') out += '\\"';
|
|
515
|
-
else if (codePoint >= 32 && codePoint <= 126) out += character;
|
|
516
|
-
else out += `\\u{${codePoint.toString(16).padStart(4, "0")}}`;
|
|
517
|
-
}
|
|
518
|
-
return `${out}"`;
|
|
519
|
-
}
|
|
520
|
-
__name(configMetadataLiteral, "configMetadataLiteral");
|
|
521
|
-
function redactSourceMetadata(value) {
|
|
522
|
-
let out = value;
|
|
523
|
-
for (const [label, pattern] of LOG_SECRET_PATTERNS) {
|
|
524
|
-
pattern.lastIndex = 0;
|
|
525
|
-
out = out.replace(pattern, `[REDACTED:${label}]`);
|
|
526
|
-
pattern.lastIndex = 0;
|
|
527
|
-
}
|
|
528
|
-
return out;
|
|
529
|
-
}
|
|
530
|
-
__name(redactSourceMetadata, "redactSourceMetadata");
|
|
531
|
-
|
|
532
|
-
// src/config/schema.ts
|
|
533
|
-
var DECISION_POINT_IDS = ["notify", "memory", "skill", "pick"];
|
|
534
|
-
var LEGACY_DECISION_POINT_NAMES = {
|
|
535
|
-
"notify-worthy": "notify",
|
|
536
|
-
"memory-admit": "memory",
|
|
537
|
-
"skill-worthy": "skill"
|
|
538
|
-
};
|
|
539
|
-
var DEFAULT_CONFIG = Object.freeze({
|
|
540
|
-
format: "text",
|
|
541
|
-
quiet: false
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
// src/config/tool-result-screens.ts
|
|
545
|
-
var TOOL_RESULT_SCREEN_NAMES = ["correspondence", "injection"];
|
|
546
|
-
var TOOL_RESULT_SCREEN_OPTION_KEYS = {
|
|
547
|
-
correspondence: ["passthroughTools"],
|
|
548
|
-
injection: []
|
|
549
|
-
};
|
|
550
|
-
function isToolResultScreenName(value) {
|
|
551
|
-
return TOOL_RESULT_SCREEN_NAMES.includes(value);
|
|
552
|
-
}
|
|
553
|
-
__name(isToolResultScreenName, "isToolResultScreenName");
|
|
554
|
-
function toolResultScreenName(entry) {
|
|
555
|
-
return typeof entry === "string" ? entry : entry.name;
|
|
556
|
-
}
|
|
557
|
-
__name(toolResultScreenName, "toolResultScreenName");
|
|
558
|
-
function buildScreen(entry) {
|
|
559
|
-
const name = toolResultScreenName(entry);
|
|
560
|
-
switch (name) {
|
|
561
|
-
case "correspondence":
|
|
562
|
-
return toolResultCorrespondenceGuardrail(
|
|
563
|
-
typeof entry === "string" || entry.passthroughTools === void 0 ? {} : { passthroughTools: entry.passthroughTools }
|
|
564
|
-
);
|
|
565
|
-
case "injection":
|
|
566
|
-
return toolResultInjectionGuardrail();
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
__name(buildScreen, "buildScreen");
|
|
570
|
-
function resolveToolResultScreens(entries) {
|
|
571
|
-
return entries?.map(buildScreen);
|
|
572
|
-
}
|
|
573
|
-
__name(resolveToolResultScreens, "resolveToolResultScreens");
|
|
574
|
-
function configuredPassthroughTools(entries) {
|
|
575
|
-
const names = [];
|
|
576
|
-
for (const entry of entries ?? []) {
|
|
577
|
-
if (typeof entry === "string") continue;
|
|
578
|
-
for (const name of entry.passthroughTools ?? []) {
|
|
579
|
-
if (!names.includes(name)) names.push(name);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
return names;
|
|
583
|
-
}
|
|
584
|
-
__name(configuredPassthroughTools, "configuredPassthroughTools");
|
|
585
|
-
function unmatchedPassthroughTools(configured, tools) {
|
|
586
|
-
if (configured.length === 0) return [];
|
|
587
|
-
const answers = /* @__PURE__ */ new Set();
|
|
588
|
-
for (const tool of tools) {
|
|
589
|
-
for (const name of passthroughToolNames(tool.name, tool.server)) answers.add(name);
|
|
590
|
-
}
|
|
591
|
-
return configured.filter((name) => !answers.has(name));
|
|
592
|
-
}
|
|
593
|
-
__name(unmatchedPassthroughTools, "unmatchedPassthroughTools");
|
|
594
|
-
|
|
595
|
-
// src/config/load.ts
|
|
596
|
-
import { readFileSync as readFileSync3 } from "node:fs";
|
|
597
|
-
import { join as join3, resolve as resolve2 } from "node:path";
|
|
598
|
-
|
|
599
|
-
// src/integrations/decision/connection.ts
|
|
600
|
-
var import_yaml = __toESM(require_dist(), 1);
|
|
601
|
-
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
602
|
-
import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as renameSync2, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
603
|
-
import { dirname as dirname2, join as join2 } from "node:path";
|
|
604
|
-
var DECISION_KEY_ID = "decision";
|
|
605
|
-
var DEFAULT_CONNECTED_POINTS = {
|
|
606
|
-
notify: "on",
|
|
607
|
-
memory: "shadow",
|
|
608
|
-
skill: "on",
|
|
609
|
-
pick: "shadow"
|
|
610
|
-
};
|
|
611
|
-
function connectedPointsNotice(points = DEFAULT_CONNECTED_POINTS) {
|
|
612
|
-
const names = /* @__PURE__ */ __name((mode) => Object.entries(points).filter(([, value]) => value === mode).map(([name]) => name), "names");
|
|
613
|
-
const on = names("on");
|
|
614
|
-
const shadow = names("shadow");
|
|
615
|
-
const join4 = /* @__PURE__ */ __name((list) => list.join(" and "), "join");
|
|
616
|
-
if (on.length === 0 && shadow.length === 0) return "No decision point is on.";
|
|
617
|
-
const parts = [];
|
|
618
|
-
if (on.length > 0) parts.push(`${join4(on)} ${on.length > 1 ? "are" : "is"} on`);
|
|
619
|
-
if (shadow.length > 0)
|
|
620
|
-
parts.push(
|
|
621
|
-
`${join4(shadow)} only record${shadow.length > 1 ? "" : "s"} to the decision log until you set ${shadow.length > 1 ? "them" : "it"} to on`
|
|
622
|
-
);
|
|
623
|
-
return `${parts.join("; ")}.`;
|
|
624
|
-
}
|
|
625
|
-
__name(connectedPointsNotice, "connectedPointsNotice");
|
|
626
|
-
function homeDir(opts) {
|
|
627
|
-
return resolveNamzuHome({
|
|
628
|
-
...opts.home ? { home: opts.home } : {},
|
|
629
|
-
env: opts.env ?? process.env
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
__name(homeDir, "homeDir");
|
|
633
|
-
function connectionPath(opts = {}) {
|
|
634
|
-
return join2(homeDir(opts), "decision-connection.json");
|
|
635
|
-
}
|
|
636
|
-
__name(connectionPath, "connectionPath");
|
|
637
|
-
function readConnection(opts = {}) {
|
|
638
|
-
try {
|
|
639
|
-
const parsed = JSON.parse(readFileSync2(connectionPath(opts), "utf8"));
|
|
640
|
-
if (parsed.provider === "azure" && typeof parsed.endpoint === "string" && typeof parsed.deployment === "string") {
|
|
641
|
-
return { provider: "azure", endpoint: parsed.endpoint, deployment: parsed.deployment };
|
|
642
|
-
}
|
|
643
|
-
if (parsed.provider === "http" && typeof parsed.url === "string") {
|
|
644
|
-
return {
|
|
645
|
-
provider: "http",
|
|
646
|
-
url: parsed.url,
|
|
647
|
-
...typeof parsed.model === "string" && parsed.model ? { model: parsed.model } : {},
|
|
648
|
-
...typeof parsed.apiKeyEnv === "string" && parsed.apiKeyEnv ? { apiKeyEnv: parsed.apiKeyEnv } : {}
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
} catch {
|
|
652
|
-
}
|
|
653
|
-
return void 0;
|
|
654
|
-
}
|
|
655
|
-
__name(readConnection, "readConnection");
|
|
656
|
-
function writeAtomic(path, body) {
|
|
657
|
-
mkdirSync2(dirname2(path), { recursive: true, mode: 448 });
|
|
658
|
-
const temp = `${path}.${randomUUID2()}.tmp`;
|
|
659
|
-
try {
|
|
660
|
-
writeFileSync2(temp, body, { mode: 384 });
|
|
661
|
-
renameSync2(temp, path);
|
|
662
|
-
} catch (error) {
|
|
663
|
-
rmSync2(temp, { force: true });
|
|
664
|
-
throw error;
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
__name(writeAtomic, "writeAtomic");
|
|
668
|
-
function writeConnection(conn, opts = {}) {
|
|
669
|
-
writeAtomic(connectionPath(opts), `${JSON.stringify(conn, null, 2)}
|
|
670
|
-
`);
|
|
671
|
-
resetBoundKeyCache();
|
|
672
|
-
}
|
|
673
|
-
__name(writeConnection, "writeConnection");
|
|
674
|
-
function connectionToBlock(conn, points = DEFAULT_CONNECTED_POINTS) {
|
|
675
|
-
return { ...conn, points };
|
|
676
|
-
}
|
|
677
|
-
__name(connectionToBlock, "connectionToBlock");
|
|
678
|
-
function saveDecisionKey(key, opts = {}) {
|
|
679
|
-
const path = writeStoredApiKey(DECISION_KEY_ID, key, opts.home);
|
|
680
|
-
resetBoundKeyCache();
|
|
681
|
-
return path;
|
|
682
|
-
}
|
|
683
|
-
__name(saveDecisionKey, "saveDecisionKey");
|
|
684
|
-
function readDecisionKey(opts = {}) {
|
|
685
|
-
return readStoredApiKey(DECISION_KEY_ID, opts.home);
|
|
686
|
-
}
|
|
687
|
-
__name(readDecisionKey, "readDecisionKey");
|
|
688
|
-
function clearDecisionKey(opts = {}) {
|
|
689
|
-
clearStoredApiKey(DECISION_KEY_ID, opts.home);
|
|
690
|
-
resetBoundKeyCache();
|
|
691
|
-
}
|
|
692
|
-
__name(clearDecisionKey, "clearDecisionKey");
|
|
693
|
-
function connectionAddress(conn) {
|
|
694
|
-
return conn.provider === "azure" ? conn.endpoint : conn.url;
|
|
695
|
-
}
|
|
696
|
-
__name(connectionAddress, "connectionAddress");
|
|
697
|
-
var boundKeys = /* @__PURE__ */ new Map();
|
|
698
|
-
function resetBoundKeyCache() {
|
|
699
|
-
boundKeys.clear();
|
|
700
|
-
}
|
|
701
|
-
__name(resetBoundKeyCache, "resetBoundKeyCache");
|
|
702
|
-
function readBoundDecisionKey(address, opts = {}) {
|
|
703
|
-
const id = `${opts.home ?? ""}\0${address}`;
|
|
704
|
-
const known = boundKeys.get(id);
|
|
705
|
-
if (known !== void 0) return known;
|
|
706
|
-
const conn = readConnection(opts);
|
|
707
|
-
const key = conn && connectionAddress(conn) === address ? readDecisionKey(opts) : null;
|
|
708
|
-
boundKeys.set(id, key);
|
|
709
|
-
return key;
|
|
710
|
-
}
|
|
711
|
-
__name(readBoundDecisionKey, "readBoundDecisionKey");
|
|
712
|
-
function resolveDecisionShorthand(value, opts = {}) {
|
|
713
|
-
if (value !== true) return value;
|
|
714
|
-
const conn = readConnection(opts);
|
|
715
|
-
return conn ? connectionToBlock(conn) : void 0;
|
|
716
|
-
}
|
|
717
|
-
__name(resolveDecisionShorthand, "resolveDecisionShorthand");
|
|
718
|
-
function readUserDecisionSetting(opts = {}) {
|
|
719
|
-
try {
|
|
720
|
-
const parsed = (0, import_yaml.parse)(readFileSync2(join2(homeDir(opts), "config.yaml"), "utf8"));
|
|
721
|
-
const value = parsed?.decision;
|
|
722
|
-
if (value === true) return "shorthand";
|
|
723
|
-
if (value !== void 0 && value !== null && value !== false) return "block";
|
|
724
|
-
} catch {
|
|
577
|
+
case "custom_pattern":
|
|
578
|
+
return rule.decision === "deny" && (rule.pattern.startsWith(`^${BROWSER_TOOL_NAME}`) || rule.pattern.startsWith(`^${BROWSER_ACT_TOOL_NAME}`));
|
|
579
|
+
default:
|
|
580
|
+
return false;
|
|
725
581
|
}
|
|
726
|
-
return "absent";
|
|
727
582
|
}
|
|
728
|
-
__name(
|
|
729
|
-
function
|
|
730
|
-
return
|
|
583
|
+
__name(isBrowserDeny, "isBrowserDeny");
|
|
584
|
+
function withBrowserSiteRules(tableRules, siteRules) {
|
|
585
|
+
return [
|
|
586
|
+
...tableRules.filter(isBrowserDeny),
|
|
587
|
+
...siteRules,
|
|
588
|
+
...tableRules.filter((rule) => !isBrowserDeny(rule))
|
|
589
|
+
];
|
|
731
590
|
}
|
|
732
|
-
__name(
|
|
733
|
-
function
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
591
|
+
__name(withBrowserSiteRules, "withBrowserSiteRules");
|
|
592
|
+
function browserSiteRuleFor(sites, origin) {
|
|
593
|
+
const normalized = normalizeBrowserSites(sites).sites;
|
|
594
|
+
const parsed = Object.entries(normalized).filter(([key]) => key !== "*").map(([key, level]) => parseSite(key, level)).filter((site) => site !== void 0);
|
|
595
|
+
const hits = parsed.filter((site) => new RegExp(`^${originSource(site)}$`).test(origin));
|
|
596
|
+
const deny = hits.find((site) => site.level === "deny");
|
|
597
|
+
if (deny) return { site: deny.key, level: "deny" };
|
|
598
|
+
const best = hits.sort((a, b) => specificity(b) - specificity(a))[0];
|
|
599
|
+
if (best) return { site: best.key, level: best.level };
|
|
600
|
+
return { site: "*", level: normalized["*"] ?? DEFAULT_BROWSER_SITE_LEVEL };
|
|
601
|
+
}
|
|
602
|
+
__name(browserSiteRuleFor, "browserSiteRuleFor");
|
|
603
|
+
function browserCallOrigin(toolName, input) {
|
|
604
|
+
if (typeof input !== "object" || input === null) return void 0;
|
|
605
|
+
const record = input;
|
|
606
|
+
if (toolName === BROWSER_ACT_TOOL_NAME) {
|
|
607
|
+
return typeof record.origin === "string" ? record.origin : void 0;
|
|
608
|
+
}
|
|
609
|
+
if (toolName === BROWSER_TOOL_NAME && typeof record.url === "string") {
|
|
610
|
+
const verdict = canonicalizeBrowserUrl(record.url);
|
|
611
|
+
return verdict.ok && verdict.url !== "about:blank" ? verdict.origin : void 0;
|
|
740
612
|
}
|
|
741
613
|
return void 0;
|
|
742
614
|
}
|
|
743
|
-
__name(
|
|
744
|
-
function recordOffer(answer, opts = {}, now = () => /* @__PURE__ */ new Date()) {
|
|
745
|
-
writeAtomic(offerPath(opts), `${JSON.stringify({ answer, at: now().toISOString() })}
|
|
746
|
-
`);
|
|
747
|
-
}
|
|
748
|
-
__name(recordOffer, "recordOffer");
|
|
749
|
-
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
750
|
-
function shouldOfferDecisionSetup(input) {
|
|
751
|
-
if (input.env.NAMZU_NO_DECISION === "1") return false;
|
|
752
|
-
if (input.setting !== "absent") return false;
|
|
753
|
-
if (!input.record) return true;
|
|
754
|
-
if (input.record.answer === "never") return false;
|
|
755
|
-
const at = Date.parse(input.record.at);
|
|
756
|
-
return Number.isNaN(at) || input.now - at >= DAY_MS;
|
|
757
|
-
}
|
|
758
|
-
__name(shouldOfferDecisionSetup, "shouldOfferDecisionSetup");
|
|
759
|
-
function decisionStatusLine(input) {
|
|
760
|
-
if (input.env.NAMZU_NO_DECISION === "1") return "Off (NAMZU_NO_DECISION)";
|
|
761
|
-
if (!input.config && !input.connected) return "Not connected";
|
|
762
|
-
const points = input.config?.points ?? {};
|
|
763
|
-
const named = Object.entries(points).filter(([, mode]) => mode !== "off").map(([name, mode]) => `${name} ${mode}`);
|
|
764
|
-
return `Connected${named.length > 0 ? ` \xB7 ${named.join(", ")}` : " \xB7 no point is on"}`;
|
|
765
|
-
}
|
|
766
|
-
__name(decisionStatusLine, "decisionStatusLine");
|
|
767
|
-
|
|
768
|
-
// src/config/load.ts
|
|
769
|
-
var import_yaml2 = __toESM(require_dist(), 1);
|
|
615
|
+
__name(browserCallOrigin, "browserCallOrigin");
|
|
770
616
|
|
|
771
617
|
// src/permissions/rule-strings.ts
|
|
772
618
|
var RULE_LIST_KEYS = ["allow", "ask", "deny"];
|
|
@@ -924,6 +770,101 @@ function mergeComposerTriggers(below, layer, projectControlled) {
|
|
|
924
770
|
}
|
|
925
771
|
__name(mergeComposerTriggers, "mergeComposerTriggers");
|
|
926
772
|
|
|
773
|
+
// src/config/debug.ts
|
|
774
|
+
function createConfigDebugSnapshot(provenance, options = {}) {
|
|
775
|
+
const sources = {
|
|
776
|
+
...provenance
|
|
777
|
+
};
|
|
778
|
+
if (options.formatFromCli) sources.format = { kind: "cli-flag", flag: "--format" };
|
|
779
|
+
if (options.quietFromCli) sources.quiet = { kind: "cli-flag", flag: "--quiet" };
|
|
780
|
+
const selectedProfile = options.selectedProfile ? Object.freeze({ ...options.selectedProfile }) : void 0;
|
|
781
|
+
return Object.freeze({
|
|
782
|
+
sources: Object.freeze(sources),
|
|
783
|
+
...selectedProfile ? { selectedProfile } : {}
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
__name(createConfigDebugSnapshot, "createConfigDebugSnapshot");
|
|
787
|
+
function formatConfigSource(source, dynamic = (value) => value) {
|
|
788
|
+
switch (source.kind) {
|
|
789
|
+
case "default":
|
|
790
|
+
return "default";
|
|
791
|
+
case "user-file":
|
|
792
|
+
return `user-file ${dynamic(source.path)}`;
|
|
793
|
+
case "project-file":
|
|
794
|
+
return `project-file ${dynamic(source.path)}`;
|
|
795
|
+
case "local-file":
|
|
796
|
+
return `local-file ${dynamic(source.path)}`;
|
|
797
|
+
case "profile":
|
|
798
|
+
return `profile ${dynamic(source.name)} (${dynamic(source.path)})`;
|
|
799
|
+
case "env":
|
|
800
|
+
return `env ${dynamic(source.variable)}`;
|
|
801
|
+
case "managed":
|
|
802
|
+
return `managed ${dynamic(source.path)}`;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
__name(formatConfigSource, "formatConfigSource");
|
|
806
|
+
function renderConfigDebug(snapshot) {
|
|
807
|
+
if (!snapshot) {
|
|
808
|
+
return [
|
|
809
|
+
"Configuration provenance is unavailable in this embedded TUI.",
|
|
810
|
+
"Restart through the namzu CLI to inspect launch-time sources."
|
|
811
|
+
].join("\n");
|
|
812
|
+
}
|
|
813
|
+
const lines = [
|
|
814
|
+
"Configuration precedence (low -> high):",
|
|
815
|
+
" default -> user file -> project file -> local file -> selected profile(s) -> environment -> managed file",
|
|
816
|
+
" --format and --quiet override only their matching keys for this process."
|
|
817
|
+
];
|
|
818
|
+
if (snapshot.selectedProfile) {
|
|
819
|
+
lines.push(
|
|
820
|
+
"",
|
|
821
|
+
`Selected profile: ${configMetadataLiteral(snapshot.selectedProfile.name)} (selected by ${snapshot.selectedProfile.selectedBy})`
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
lines.push("", "Winning sources (resolved values are deliberately omitted):");
|
|
825
|
+
const entries = Object.entries(snapshot.sources).sort(
|
|
826
|
+
([left], [right]) => left < right ? -1 : left > right ? 1 : 0
|
|
827
|
+
);
|
|
828
|
+
if (entries.length === 0) {
|
|
829
|
+
lines.push(" <none>");
|
|
830
|
+
} else {
|
|
831
|
+
for (const [key, source] of entries) {
|
|
832
|
+
if (!source) continue;
|
|
833
|
+
lines.push(` ${key}: ${formatEffectiveSource(source)}`);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
return lines.join("\n");
|
|
837
|
+
}
|
|
838
|
+
__name(renderConfigDebug, "renderConfigDebug");
|
|
839
|
+
function formatEffectiveSource(source) {
|
|
840
|
+
return source.kind === "cli-flag" ? `CLI flag ${source.flag}` : formatConfigSource(source, configMetadataLiteral);
|
|
841
|
+
}
|
|
842
|
+
__name(formatEffectiveSource, "formatEffectiveSource");
|
|
843
|
+
function configMetadataLiteral(value) {
|
|
844
|
+
const redacted = redactSourceMetadata(value);
|
|
845
|
+
let out = '"';
|
|
846
|
+
for (const character of redacted) {
|
|
847
|
+
const codePoint = character.codePointAt(0);
|
|
848
|
+
if (codePoint === void 0) continue;
|
|
849
|
+
if (character === "\\") out += "\\\\";
|
|
850
|
+
else if (character === '"') out += '\\"';
|
|
851
|
+
else if (codePoint >= 32 && codePoint <= 126) out += character;
|
|
852
|
+
else out += `\\u{${codePoint.toString(16).padStart(4, "0")}}`;
|
|
853
|
+
}
|
|
854
|
+
return `${out}"`;
|
|
855
|
+
}
|
|
856
|
+
__name(configMetadataLiteral, "configMetadataLiteral");
|
|
857
|
+
function redactSourceMetadata(value) {
|
|
858
|
+
let out = value;
|
|
859
|
+
for (const [label, pattern] of LOG_SECRET_PATTERNS) {
|
|
860
|
+
pattern.lastIndex = 0;
|
|
861
|
+
out = out.replace(pattern, `[REDACTED:${label}]`);
|
|
862
|
+
pattern.lastIndex = 0;
|
|
863
|
+
}
|
|
864
|
+
return out;
|
|
865
|
+
}
|
|
866
|
+
__name(redactSourceMetadata, "redactSourceMetadata");
|
|
867
|
+
|
|
927
868
|
// src/config/hook-common-shape.ts
|
|
928
869
|
var GUARD_EVENTS = /* @__PURE__ */ new Set([
|
|
929
870
|
"user_prompt_submit",
|
|
@@ -936,8 +877,12 @@ var GUARD_EVENTS = /* @__PURE__ */ new Set([
|
|
|
936
877
|
"subagent_start",
|
|
937
878
|
"subagent_stop"
|
|
938
879
|
]);
|
|
880
|
+
function isGuardHookEvent(event) {
|
|
881
|
+
return GUARD_EVENTS.has(event);
|
|
882
|
+
}
|
|
883
|
+
__name(isGuardHookEvent, "isGuardHookEvent");
|
|
939
884
|
var KIND_KEYS = {
|
|
940
|
-
command: ["command", "args", "async"],
|
|
885
|
+
command: ["command", "args", "async", "env"],
|
|
941
886
|
http: ["url", "headers", "allowedEnvVars"],
|
|
942
887
|
prompt: ["prompt"]
|
|
943
888
|
};
|
|
@@ -984,6 +929,27 @@ function text(value) {
|
|
|
984
929
|
return typeof value === "string" && value.trim().length > 0 ? value : void 0;
|
|
985
930
|
}
|
|
986
931
|
__name(text, "text");
|
|
932
|
+
function readHookEnv(value, at, report) {
|
|
933
|
+
if (value === void 0) return void 0;
|
|
934
|
+
if (!isMapping(value)) {
|
|
935
|
+
report(
|
|
936
|
+
"note",
|
|
937
|
+
`${at}: "env" must be a mapping of variable names to text; it is left off and the hook runs without it.`
|
|
938
|
+
);
|
|
939
|
+
return void 0;
|
|
940
|
+
}
|
|
941
|
+
const out = {};
|
|
942
|
+
for (const [name, each] of Object.entries(value)) {
|
|
943
|
+
const bad = shellHookEnvNameProblem(name);
|
|
944
|
+
if (bad !== void 0) {
|
|
945
|
+
report("note", `${at}: "env" ${JSON.stringify(name)} ${bad}; it is left off.`);
|
|
946
|
+
} else if (typeof each !== "string") {
|
|
947
|
+
report("note", `${at}: "env" ${JSON.stringify(name)} must be text; it is left off.`);
|
|
948
|
+
} else out[name] = each;
|
|
949
|
+
}
|
|
950
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
951
|
+
}
|
|
952
|
+
__name(readHookEnv, "readHookEnv");
|
|
987
953
|
function readHookGroup(event, group, groupIndex, report) {
|
|
988
954
|
const where = `group ${groupIndex + 1}`;
|
|
989
955
|
const guard = GUARD_EVENTS.has(event);
|
|
@@ -1130,10 +1096,12 @@ function readHookGroup(event, group, groupIndex, report) {
|
|
|
1130
1096
|
if (typeof hook.async === "boolean") async = hook.async;
|
|
1131
1097
|
else ignored("async", "true or false");
|
|
1132
1098
|
}
|
|
1099
|
+
const env = readHookEnv(hook.env, at, report);
|
|
1133
1100
|
out.push({
|
|
1134
1101
|
command,
|
|
1135
1102
|
...args !== void 0 ? { args } : {},
|
|
1136
1103
|
...async !== void 0 ? { async } : {},
|
|
1104
|
+
...env !== void 0 ? { env } : {},
|
|
1137
1105
|
...shared
|
|
1138
1106
|
});
|
|
1139
1107
|
}
|
|
@@ -1164,6 +1132,69 @@ function mergeLearningGenerator(previous, next, fromProject) {
|
|
|
1164
1132
|
}
|
|
1165
1133
|
__name(mergeLearningGenerator, "mergeLearningGenerator");
|
|
1166
1134
|
|
|
1135
|
+
// src/config/schema.ts
|
|
1136
|
+
var DECISION_POINT_IDS = ["notify", "memory", "skill", "pick"];
|
|
1137
|
+
var LEGACY_DECISION_POINT_NAMES = {
|
|
1138
|
+
"notify-worthy": "notify",
|
|
1139
|
+
"memory-admit": "memory",
|
|
1140
|
+
"skill-worthy": "skill"
|
|
1141
|
+
};
|
|
1142
|
+
var DEFAULT_CONFIG = Object.freeze({
|
|
1143
|
+
format: "text",
|
|
1144
|
+
quiet: false
|
|
1145
|
+
});
|
|
1146
|
+
|
|
1147
|
+
// src/config/tool-result-screens.ts
|
|
1148
|
+
var TOOL_RESULT_SCREEN_NAMES = ["correspondence", "injection"];
|
|
1149
|
+
var TOOL_RESULT_SCREEN_OPTION_KEYS = {
|
|
1150
|
+
correspondence: ["passthroughTools"],
|
|
1151
|
+
injection: []
|
|
1152
|
+
};
|
|
1153
|
+
function isToolResultScreenName(value) {
|
|
1154
|
+
return TOOL_RESULT_SCREEN_NAMES.includes(value);
|
|
1155
|
+
}
|
|
1156
|
+
__name(isToolResultScreenName, "isToolResultScreenName");
|
|
1157
|
+
function toolResultScreenName(entry) {
|
|
1158
|
+
return typeof entry === "string" ? entry : entry.name;
|
|
1159
|
+
}
|
|
1160
|
+
__name(toolResultScreenName, "toolResultScreenName");
|
|
1161
|
+
function buildScreen(entry) {
|
|
1162
|
+
const name = toolResultScreenName(entry);
|
|
1163
|
+
switch (name) {
|
|
1164
|
+
case "correspondence":
|
|
1165
|
+
return toolResultCorrespondenceGuardrail(
|
|
1166
|
+
typeof entry === "string" || entry.passthroughTools === void 0 ? {} : { passthroughTools: entry.passthroughTools }
|
|
1167
|
+
);
|
|
1168
|
+
case "injection":
|
|
1169
|
+
return toolResultInjectionGuardrail();
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
__name(buildScreen, "buildScreen");
|
|
1173
|
+
function resolveToolResultScreens(entries) {
|
|
1174
|
+
return entries?.map(buildScreen);
|
|
1175
|
+
}
|
|
1176
|
+
__name(resolveToolResultScreens, "resolveToolResultScreens");
|
|
1177
|
+
function configuredPassthroughTools(entries) {
|
|
1178
|
+
const names = [];
|
|
1179
|
+
for (const entry of entries ?? []) {
|
|
1180
|
+
if (typeof entry === "string") continue;
|
|
1181
|
+
for (const name of entry.passthroughTools ?? []) {
|
|
1182
|
+
if (!names.includes(name)) names.push(name);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
return names;
|
|
1186
|
+
}
|
|
1187
|
+
__name(configuredPassthroughTools, "configuredPassthroughTools");
|
|
1188
|
+
function unmatchedPassthroughTools(configured, tools) {
|
|
1189
|
+
if (configured.length === 0) return [];
|
|
1190
|
+
const answers = /* @__PURE__ */ new Set();
|
|
1191
|
+
for (const tool of tools) {
|
|
1192
|
+
for (const name of passthroughToolNames(tool.name, tool.server)) answers.add(name);
|
|
1193
|
+
}
|
|
1194
|
+
return configured.filter((name) => !answers.has(name));
|
|
1195
|
+
}
|
|
1196
|
+
__name(unmatchedPassthroughTools, "unmatchedPassthroughTools");
|
|
1197
|
+
|
|
1167
1198
|
// src/config/load.ts
|
|
1168
1199
|
var MANAGED_CONFIG_PATH = process.platform === "win32" ? join3(process.env.PROGRAMDATA ?? "C:\\ProgramData", "namzu", "config.json") : "/etc/namzu/config.json";
|
|
1169
1200
|
function loadConfigWithProvenance(opts = {}) {
|
|
@@ -1557,11 +1588,19 @@ var HOOK_COMMON_KEYS = [
|
|
|
1557
1588
|
"toolNames"
|
|
1558
1589
|
];
|
|
1559
1590
|
var HOOK_KIND_KEYS = {
|
|
1560
|
-
command: ["command", "args", "async"],
|
|
1591
|
+
command: ["command", "args", "async", "env"],
|
|
1561
1592
|
http: ["url", "headers", "allowedEnvVars"],
|
|
1562
1593
|
prompt: ["prompt"]
|
|
1563
1594
|
};
|
|
1564
1595
|
var HOOK_ENTRY_KEYS = [...HOOK_COMMON_KEYS, ...HOOK_KIND_KEYS.command];
|
|
1596
|
+
function pluginVariablesOf(entry) {
|
|
1597
|
+
if (entry.type !== void 0) return [];
|
|
1598
|
+
const env = entry.env ?? {};
|
|
1599
|
+
return referencedVariables([entry.command, ...entry.args ?? []]).filter(
|
|
1600
|
+
(name) => isPluginFolderVariable(name) && env[name] === void 0
|
|
1601
|
+
);
|
|
1602
|
+
}
|
|
1603
|
+
__name(pluginVariablesOf, "pluginVariablesOf");
|
|
1565
1604
|
var CONFIG_READERS = {
|
|
1566
1605
|
format: /* @__PURE__ */ __name((v, context) => {
|
|
1567
1606
|
if (typeof v === "string" && isFormatName(v)) return v;
|
|
@@ -1889,11 +1928,12 @@ var CONFIG_READERS = {
|
|
|
1889
1928
|
}
|
|
1890
1929
|
return v;
|
|
1891
1930
|
}, "toolResultScreens"),
|
|
1892
|
-
hooks: /* @__PURE__ */ __name((v, context) => {
|
|
1931
|
+
hooks: /* @__PURE__ */ __name((v, context, hookOptions) => {
|
|
1893
1932
|
if (!isConfigMapping(v))
|
|
1894
1933
|
return invalidConfigValue(context, [], "must be a mapping of event \u2192 list");
|
|
1895
1934
|
const out = {};
|
|
1896
|
-
const file = hookSourceLabel(context.source);
|
|
1935
|
+
const file = hookOptions?.file ?? hookSourceLabel(context.source);
|
|
1936
|
+
const record = hookOptions?.record ?? recordHookProblem;
|
|
1897
1937
|
for (const [event, entries] of Object.entries(v)) {
|
|
1898
1938
|
const renamed = Object.hasOwn(RENAMED_PLUGIN_HOOK_EVENTS, event) ? RENAMED_PLUGIN_HOOK_EVENTS[event] : void 0;
|
|
1899
1939
|
if (renamed !== void 0) {
|
|
@@ -1902,7 +1942,7 @@ var CONFIG_READERS = {
|
|
|
1902
1942
|
const target = hookEventForKey(event);
|
|
1903
1943
|
if (target === void 0) {
|
|
1904
1944
|
if (looksLikeWrittenEvent(event) && Array.isArray(entries)) {
|
|
1905
|
-
|
|
1945
|
+
record(file, event, "problem", `${unknownEventMessage()}.`);
|
|
1906
1946
|
continue;
|
|
1907
1947
|
}
|
|
1908
1948
|
return invalidConfigValue(
|
|
@@ -1922,7 +1962,7 @@ var CONFIG_READERS = {
|
|
|
1922
1962
|
target,
|
|
1923
1963
|
entry,
|
|
1924
1964
|
index,
|
|
1925
|
-
(severity, message) =>
|
|
1965
|
+
(severity, message) => record(file, event, severity, message)
|
|
1926
1966
|
)
|
|
1927
1967
|
);
|
|
1928
1968
|
continue;
|
|
@@ -1930,7 +1970,7 @@ var CONFIG_READERS = {
|
|
|
1930
1970
|
if (!isConfigMapping(entry)) {
|
|
1931
1971
|
if (writtenKey) {
|
|
1932
1972
|
const lost = unreadableElement(target, index);
|
|
1933
|
-
|
|
1973
|
+
record(file, event, lost.severity, lost.message);
|
|
1934
1974
|
continue;
|
|
1935
1975
|
}
|
|
1936
1976
|
return invalidConfigValue(context, [event, index], "must be a mapping with a `command`");
|
|
@@ -2014,6 +2054,12 @@ var CONFIG_READERS = {
|
|
|
2014
2054
|
if (raw.args !== void 0 && (!Array.isArray(raw.args) || raw.args.some((item) => typeof item !== "string"))) {
|
|
2015
2055
|
return invalidConfigValue(context, [event, index, "args"], "must be a list of strings");
|
|
2016
2056
|
}
|
|
2057
|
+
if (raw.env !== void 0) {
|
|
2058
|
+
const envProblems = shellHookEnvProblems(raw.env);
|
|
2059
|
+
if (envProblems.length > 0) {
|
|
2060
|
+
return invalidConfigValue(context, [event, index, "env"], envProblems.join("; "));
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2017
2063
|
if (raw.allowedEnvVars !== void 0 && (!Array.isArray(raw.allowedEnvVars) || raw.allowedEnvVars.some((item) => typeof item !== "string"))) {
|
|
2018
2064
|
return invalidConfigValue(
|
|
2019
2065
|
context,
|
|
@@ -2069,10 +2115,23 @@ var CONFIG_READERS = {
|
|
|
2069
2115
|
command: raw.command,
|
|
2070
2116
|
...raw.args !== void 0 ? { args: raw.args } : {},
|
|
2071
2117
|
...raw.async !== void 0 ? { async: raw.async } : {},
|
|
2118
|
+
...raw.env !== void 0 ? { env: raw.env } : {},
|
|
2072
2119
|
...shared
|
|
2073
2120
|
});
|
|
2074
2121
|
}
|
|
2075
2122
|
}
|
|
2123
|
+
if (hookOptions?.plugin !== true) {
|
|
2124
|
+
for (const entry of parsed) {
|
|
2125
|
+
const named = pluginVariablesOf(entry);
|
|
2126
|
+
if (named.length === 0) continue;
|
|
2127
|
+
record(
|
|
2128
|
+
file,
|
|
2129
|
+
event,
|
|
2130
|
+
"note",
|
|
2131
|
+
`the command \`${entry.command.slice(0, 60)}\` refers to ${named.map((name) => `$${name}`).join(", ")}, which only a hook entry a plugin ships is given: it is empty here and the command still runs, unless the entry's "env" or your environment sets ${named.length === 1 ? "it" : "each"}.`
|
|
2132
|
+
);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2076
2135
|
out[target] = [...out[target] ?? [], ...parsed];
|
|
2077
2136
|
}
|
|
2078
2137
|
return out;
|
|
@@ -2851,7 +2910,22 @@ function hookSourceLabel(source) {
|
|
|
2851
2910
|
return source.kind === "file" ? shortHomePath(source.path) : `environment variable ${source.variable}`;
|
|
2852
2911
|
}
|
|
2853
2912
|
__name(hookSourceLabel, "hookSourceLabel");
|
|
2913
|
+
var hookProblemSink;
|
|
2914
|
+
function withHookProblemSink(sink, read) {
|
|
2915
|
+
const outer = hookProblemSink;
|
|
2916
|
+
hookProblemSink = sink;
|
|
2917
|
+
try {
|
|
2918
|
+
return read();
|
|
2919
|
+
} finally {
|
|
2920
|
+
hookProblemSink = outer;
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
__name(withHookProblemSink, "withHookProblemSink");
|
|
2854
2924
|
function recordHookProblem(file, event, severity, message) {
|
|
2925
|
+
if (hookProblemSink) {
|
|
2926
|
+
hookProblemSink(event, severity, message, file);
|
|
2927
|
+
return;
|
|
2928
|
+
}
|
|
2855
2929
|
const key = `${file}
|
|
2856
2930
|
${event}
|
|
2857
2931
|
${message}`;
|
|
@@ -2866,6 +2940,10 @@ function hookConfigProblems() {
|
|
|
2866
2940
|
return [...hookConfigProblemList.values()];
|
|
2867
2941
|
}
|
|
2868
2942
|
__name(hookConfigProblems, "hookConfigProblems");
|
|
2943
|
+
function resetHookConfigProblems() {
|
|
2944
|
+
hookConfigProblemList.clear();
|
|
2945
|
+
}
|
|
2946
|
+
__name(resetHookConfigProblems, "resetHookConfigProblems");
|
|
2869
2947
|
function takeConfigWarnings() {
|
|
2870
2948
|
const out = [...configWarnings];
|
|
2871
2949
|
configWarnings.clear();
|
|
@@ -3048,6 +3126,17 @@ function describeSource(source) {
|
|
|
3048
3126
|
return "path" in source ? shortHomePath(source.path) : source.kind;
|
|
3049
3127
|
}
|
|
3050
3128
|
__name(describeSource, "describeSource");
|
|
3129
|
+
var hookLayerSink;
|
|
3130
|
+
function withHookLayerSink(sink, read) {
|
|
3131
|
+
const outer = hookLayerSink;
|
|
3132
|
+
hookLayerSink = sink;
|
|
3133
|
+
try {
|
|
3134
|
+
return read();
|
|
3135
|
+
} finally {
|
|
3136
|
+
hookLayerSink = outer;
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
__name(withHookLayerSink, "withHookLayerSink");
|
|
3051
3140
|
function withAssembledHooks(merged, layers, managedCfg, managedPath) {
|
|
3052
3141
|
const hookLayers = [];
|
|
3053
3142
|
let lastSource;
|
|
@@ -3059,13 +3148,23 @@ function withAssembledHooks(merged, layers, managedCfg, managedPath) {
|
|
|
3059
3148
|
hookLayers.push({
|
|
3060
3149
|
label: path === void 0 ? source.kind : source.kind === "profile" ? `${shortHomePath(path)} (profile ${source.name})` : shortHomePath(path),
|
|
3061
3150
|
managed: source.kind === "managed" || path !== void 0 && path === managedPath,
|
|
3062
|
-
hooks: layer.config.hooks
|
|
3151
|
+
hooks: layer.config.hooks,
|
|
3152
|
+
source
|
|
3063
3153
|
});
|
|
3064
3154
|
}
|
|
3065
|
-
const
|
|
3155
|
+
const switches = {
|
|
3066
3156
|
disableHooks: merged.config.disableHooks === true,
|
|
3067
3157
|
managedOnly: managedCfg.hooksManagedOnly === true
|
|
3158
|
+
};
|
|
3159
|
+
const ignoredDisableHooks = layers.filter(
|
|
3160
|
+
(layer) => layer.config.disableHooks === true && isProjectSource(layer.sourceFor("disableHooks"))
|
|
3161
|
+
).map((layer) => layer.sourceFor("disableHooks"));
|
|
3162
|
+
hookLayerSink?.({
|
|
3163
|
+
layers: hookLayers,
|
|
3164
|
+
switches,
|
|
3165
|
+
...ignoredDisableHooks.length > 0 ? { ignoredDisableHooks } : {}
|
|
3068
3166
|
});
|
|
3167
|
+
const assembled = assembleHooks(hookLayers, switches);
|
|
3069
3168
|
const { hooks: _replaced, ...rest } = merged.config;
|
|
3070
3169
|
return {
|
|
3071
3170
|
config: assembled.hooks !== void 0 ? { ...rest, hooks: assembled.hooks } : rest,
|
|
@@ -3452,6 +3551,15 @@ function mergeBrowserConfig(below, layer, source) {
|
|
|
3452
3551
|
};
|
|
3453
3552
|
}
|
|
3454
3553
|
__name(mergeBrowserConfig, "mergeBrowserConfig");
|
|
3554
|
+
function readPluginHookEntries(value, where, record) {
|
|
3555
|
+
const read = CONFIG_READERS.hooks;
|
|
3556
|
+
return read(
|
|
3557
|
+
value,
|
|
3558
|
+
{ source: { kind: "file", path: where.path }, path: ["hooks"] },
|
|
3559
|
+
{ file: where.file, record, plugin: true }
|
|
3560
|
+
);
|
|
3561
|
+
}
|
|
3562
|
+
__name(readPluginHookEntries, "readPluginHookEntries");
|
|
3455
3563
|
|
|
3456
3564
|
export {
|
|
3457
3565
|
connectedPointsNotice,
|
|
@@ -3490,11 +3598,15 @@ export {
|
|
|
3490
3598
|
createConfigDebugSnapshot,
|
|
3491
3599
|
formatConfigSource,
|
|
3492
3600
|
renderConfigDebug,
|
|
3601
|
+
isGuardHookEvent,
|
|
3602
|
+
hookEventForKey,
|
|
3493
3603
|
hooksOfElement,
|
|
3604
|
+
unknownEventMessage,
|
|
3494
3605
|
DEFAULT_CONFIG,
|
|
3495
3606
|
resolveToolResultScreens,
|
|
3496
3607
|
configuredPassthroughTools,
|
|
3497
3608
|
unmatchedPassthroughTools,
|
|
3609
|
+
MANAGED_CONFIG_PATH,
|
|
3498
3610
|
loadConfigWithProvenance,
|
|
3499
3611
|
loadBootstrapConfigWithProvenance,
|
|
3500
3612
|
readPermissionLayers,
|
|
@@ -3504,9 +3616,20 @@ export {
|
|
|
3504
3616
|
pendingProjectMcpServers,
|
|
3505
3617
|
LOCAL_CONFIG_FILE,
|
|
3506
3618
|
shortHomePath,
|
|
3619
|
+
stripByteOrderMark,
|
|
3620
|
+
ENV_VARIABLE_NAMES,
|
|
3621
|
+
withHookProblemSink,
|
|
3507
3622
|
hookConfigProblems,
|
|
3623
|
+
resetHookConfigProblems,
|
|
3508
3624
|
takeConfigWarnings,
|
|
3509
3625
|
CONFIG_KEYS,
|
|
3510
|
-
readConfigKey
|
|
3626
|
+
readConfigKey,
|
|
3627
|
+
withHookLayerSink,
|
|
3628
|
+
mergeCodeAnalysisConfig,
|
|
3629
|
+
mergeTuiConfig,
|
|
3630
|
+
mergeUpdatesConfig,
|
|
3631
|
+
mergeSandboxConfig,
|
|
3632
|
+
mergeBrowserConfig,
|
|
3633
|
+
readPluginHookEntries
|
|
3511
3634
|
};
|
|
3512
|
-
//# sourceMappingURL=chunk-
|
|
3635
|
+
//# sourceMappingURL=chunk-YCJOAIDG.js.map
|