@namzu/cli 53.0.0 → 53.1.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 +67 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-IOWTKF2X.js → acp-UVCLNIXU.js} +83 -77
- package/dist/chunks/acp-UVCLNIXU.js.map +6 -0
- package/dist/chunks/{activity-command-U2AOTIVF.js → activity-command-2QIWTUUB.js} +15 -15
- package/dist/chunks/{add-YYQLPCP2.js → add-2YDEALUT.js} +26 -26
- package/dist/chunks/{agent-WL6NX4W6.js → agent-IKQ67NMW.js} +45 -42
- package/dist/chunks/agent-session-H3OE6ZJT.js +76 -0
- package/dist/chunks/{apply-at-exit-WWVK3RWD.js → apply-at-exit-F4G7PCZL.js} +8 -8
- package/dist/chunks/{archive-UE756BME.js → archive-FOTYHQPL.js} +14 -14
- package/dist/chunks/{bin-main-QWMIKRQP.js → bin-main-DWOCG2WK.js} +14 -14
- package/dist/chunks/{binding-HCIPLFUO.js → binding-2GEVBR5H.js} +3 -3
- package/dist/chunks/{browser-7SFVCKSO.js → browser-WYPSIPEZ.js} +6 -6
- package/dist/chunks/{chat-SE2QOB2X.js → chat-LWVIDEXR.js} +22 -22
- package/dist/chunks/{chunk-CQKYKQEF.js → chunk-2CYBRCPH.js} +4 -4
- package/dist/chunks/{chunk-7AWFHVMT.js → chunk-2Q2TPLYP.js} +3 -3
- package/dist/chunks/{chunk-TYTE2GIF.js → chunk-2QMXCXZ2.js} +5 -5
- package/dist/chunks/{chunk-Z5NMQ2YN.js → chunk-33WFG4C3.js} +2 -2
- package/dist/chunks/{chunk-Z5FDI74K.js → chunk-3EEKLQXD.js} +6 -6
- package/dist/chunks/chunk-3HJXXP6L.js +226 -0
- package/dist/chunks/chunk-3HJXXP6L.js.map +6 -0
- package/dist/chunks/{chunk-NZMKMXGG.js → chunk-3T5AX2PC.js} +2 -2
- package/dist/chunks/{chunk-OBMHA7OP.js → chunk-4ASCYXSH.js} +3 -3
- package/dist/chunks/{chunk-LSRVPPLR.js → chunk-4EBZUUE4.js} +5 -5
- package/dist/chunks/{chunk-WSMX3IQE.js → chunk-53UWPLAF.js} +503 -402
- package/dist/chunks/chunk-53UWPLAF.js.map +6 -0
- package/dist/chunks/{chunk-3NAVAACC.js → chunk-5F4SSZKS.js} +2 -2
- package/dist/chunks/{chunk-5QACH2Q2.js → chunk-5JQIGBBR.js} +3 -3
- package/dist/chunks/chunk-5PO5ZH6M.js +528 -0
- package/dist/chunks/chunk-5PO5ZH6M.js.map +6 -0
- package/dist/chunks/{chunk-HOB6FTE2.js → chunk-5S7U5MFW.js} +5 -4
- package/dist/chunks/{chunk-HOB6FTE2.js.map → chunk-5S7U5MFW.js.map} +1 -1
- 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-V7VNFYA4.js → chunk-6APCO6YC.js} +18 -14
- package/dist/chunks/chunk-6APCO6YC.js.map +6 -0
- package/dist/chunks/{chunk-HJILJSZO.js → chunk-6CXEEZLK.js} +2 -2
- package/dist/chunks/{chunk-2U357RJS.js → chunk-6JKNPDZD.js} +10 -10
- package/dist/chunks/{chunk-AGFGC7SI.js → chunk-6KIXUAOC.js} +3 -3
- package/dist/chunks/{chunk-2WDF5N2A.js → chunk-6NUQEVHG.js} +9 -9
- package/dist/chunks/{chunk-4RTQTX5R.js → chunk-6RTDZGPO.js} +2 -2
- package/dist/chunks/{chunk-HSLOM2WI.js → chunk-7PDUMQ4M.js} +176 -34
- package/dist/chunks/chunk-7PDUMQ4M.js.map +6 -0
- package/dist/chunks/{chunk-7JT7DNR7.js → chunk-7T6TX47O.js} +3 -3
- package/dist/chunks/{chunk-54KHPVNE.js → chunk-ABOV5CRT.js} +1159 -15808
- package/dist/chunks/chunk-ABOV5CRT.js.map +6 -0
- package/dist/chunks/{chunk-SFDB5RIL.js → chunk-AZHBCP6G.js} +46 -46
- package/dist/chunks/{chunk-POOJ2MUS.js → chunk-BLGPF6UL.js} +3 -3
- package/dist/chunks/{chunk-YELRULQ7.js → chunk-C74LVDRC.js} +3948 -2225
- package/dist/chunks/chunk-C74LVDRC.js.map +6 -0
- package/dist/chunks/{chunk-F3SQRGKZ.js → chunk-CMHOQ62S.js} +2 -2
- package/dist/chunks/{chunk-24N42TGE.js → chunk-D5RO75LO.js} +6 -6
- package/dist/chunks/{chunk-M3AUPUII.js → chunk-D7JY7KNY.js} +6 -6
- package/dist/chunks/chunk-DCMZYSON.js +247 -0
- package/dist/chunks/chunk-DCMZYSON.js.map +6 -0
- package/dist/chunks/{chunk-5NDRDTNX.js → chunk-DHWD5YYD.js} +6 -6
- package/dist/chunks/chunk-DHWD5YYD.js.map +6 -0
- package/dist/chunks/{chunk-RAPO3KLG.js → chunk-DTORDCJR.js} +4 -4
- package/dist/chunks/{chunk-NICPMJJQ.js → chunk-E7GZ5OXM.js} +6 -5
- package/dist/chunks/{chunk-NICPMJJQ.js.map → chunk-E7GZ5OXM.js.map} +1 -1
- package/dist/chunks/{chunk-O326HKCW.js → chunk-EADNTGVW.js} +3 -3
- package/dist/chunks/{chunk-CT47C23E.js → chunk-EYAWI7KU.js} +196 -27
- package/dist/chunks/chunk-EYAWI7KU.js.map +6 -0
- package/dist/chunks/{chunk-KNQ7R54U.js → chunk-F3GGSHY2.js} +715 -622
- package/dist/chunks/chunk-F3GGSHY2.js.map +6 -0
- package/dist/chunks/{chunk-HGZYNEQE.js → chunk-FBRYV5YN.js} +14 -7
- package/dist/chunks/chunk-FBRYV5YN.js.map +6 -0
- package/dist/chunks/{chunk-2VSICYQP.js → chunk-FWTWILCD.js} +2 -2
- package/dist/chunks/{chunk-HUONDMU4.js → chunk-G4R65ULE.js} +2 -2
- package/dist/chunks/{chunk-C5XQHEYB.js → chunk-G7LMPHZE.js} +2 -2
- package/dist/chunks/{chunk-XHLFI6F6.js → chunk-GD7VSTWZ.js} +2 -2
- package/dist/chunks/{chunk-4FV2VZS6.js → chunk-GZNTRTD5.js} +3 -3
- package/dist/chunks/{chunk-UMHKTV2L.js → chunk-H7UZKOVC.js} +132 -4
- package/dist/chunks/chunk-H7UZKOVC.js.map +6 -0
- package/dist/chunks/{chunk-M2J3O3JT.js → chunk-HFZLLEJS.js} +5 -5
- package/dist/chunks/chunk-IOWYDR6H.js +414 -0
- package/dist/chunks/chunk-IOWYDR6H.js.map +6 -0
- package/dist/chunks/{chunk-WOSL3OZD.js → chunk-IW3XMMEN.js} +4 -4
- package/dist/chunks/{chunk-DSKNFDTL.js → chunk-KXUKJLA2.js} +2 -2
- package/dist/chunks/{chunk-EA73SWCT.js → chunk-L2AKMCV3.js} +4 -4
- package/dist/chunks/{chunk-Z6J7SVOB.js → chunk-LC7SV2KM.js} +2 -2
- package/dist/chunks/{chunk-4SJZ5D6H.js → chunk-LOUV4VZ6.js} +4 -4
- package/dist/chunks/{chunk-DI4L3GH5.js → chunk-LQJLTW2D.js} +2 -2
- package/dist/chunks/{chunk-HTHNDZ3L.js → chunk-LRFRTQW7.js} +2 -2
- package/dist/chunks/{chunk-EKMHZKVP.js → chunk-MDY2IMVQ.js} +2 -2
- package/dist/chunks/{chunk-NTV2XD2J.js → chunk-MNMKHEMI.js} +2 -2
- package/dist/chunks/{chunk-ZDZ35MMZ.js → chunk-MTY4XYDO.js} +2 -2
- package/dist/chunks/{chunk-OAHCS42A.js → chunk-MZURZ6P4.js} +2 -2
- package/dist/chunks/{chunk-6CFPN6I4.js → chunk-NFKSV6UI.js} +2 -2
- package/dist/chunks/{chunk-TI6FFONP.js → chunk-NIRQFXO6.js} +2 -2
- package/dist/chunks/{chunk-QPR3UA4L.js → chunk-NJWQUZF2.js} +2 -2
- package/dist/chunks/{chunk-EKQ6J5KA.js → chunk-NRGGICBE.js} +2 -2
- package/dist/chunks/{chunk-ZMKEYARZ.js → chunk-NW6VBCCU.js} +6 -6
- package/dist/chunks/{chunk-UWN4WNQZ.js → chunk-ORCR5VST.js} +2 -2
- package/dist/chunks/{chunk-TUXH7IXQ.js → chunk-P6OOW3RL.js} +2 -2
- package/dist/chunks/{chunk-46VSU4QF.js → chunk-PXA27JGJ.js} +2 -2
- package/dist/chunks/{chunk-SPSWX3QZ.js → chunk-PXJ2KPOI.js} +2 -2
- package/dist/chunks/chunk-QBCGPM4E.js +41 -0
- package/dist/chunks/chunk-QBCGPM4E.js.map +6 -0
- package/dist/chunks/{chunk-FIYZCKQ7.js → chunk-QE5PQM5T.js} +3 -3
- package/dist/chunks/{chunk-SHUA4YUK.js → chunk-QIDU76IF.js} +2 -2
- package/dist/chunks/{chunk-SB3A7KUJ.js → chunk-QP435RW7.js} +4 -4
- package/dist/chunks/{chunk-FX7BSCB4.js → chunk-QPAWT3EG.js} +4 -4
- package/dist/chunks/{chunk-BHOZPFJM.js → chunk-QTPZCVPP.js} +5 -5
- package/dist/chunks/{chunk-CCYAWSZL.js → chunk-RFGMOXA6.js} +5 -5
- package/dist/chunks/{chunk-N56NUKMT.js → chunk-RPXTYB22.js} +2 -2
- package/dist/chunks/chunk-RVXJ5MYA.js +686 -0
- package/dist/chunks/chunk-RVXJ5MYA.js.map +6 -0
- package/dist/chunks/{chunk-X6SREM2V.js → chunk-RXUWYGFX.js} +7 -7
- package/dist/chunks/{chunk-DIWEKTYK.js → chunk-S5R2E5TZ.js} +5 -5
- package/dist/chunks/{chunk-DOFQWVBL.js → chunk-T3NIOUQJ.js} +3 -3
- package/dist/chunks/{chunk-LMLJ7NS5.js → chunk-TMOEYXPR.js} +5 -5
- package/dist/chunks/{chunk-PV65WQHD.js → chunk-UNO2ZRXA.js} +12 -12
- package/dist/chunks/{chunk-ZZNHDQAD.js → chunk-UNZNPAW7.js} +2 -2
- package/dist/chunks/{chunk-PYSZ7JTU.js → chunk-URIGGSIK.js} +2 -2
- package/dist/chunks/{chunk-JQZDXUYK.js → chunk-UWYDZYCZ.js} +7 -7
- package/dist/chunks/chunk-UYAI6F3R.js +44 -0
- package/dist/chunks/chunk-UYAI6F3R.js.map +6 -0
- package/dist/chunks/{chunk-P5E6ITP5.js → chunk-VG6RBHI4.js} +5 -5
- package/dist/chunks/{chunk-A47ZNTW7.js → chunk-VV2EHZOG.js} +3 -3
- package/dist/chunks/{chunk-VYLCV6W3.js → chunk-WY6KOPIY.js} +9 -9
- package/dist/chunks/{chunk-HOKSVFIC.js → chunk-XFVVJAI3.js} +6 -6
- package/dist/chunks/{chunk-MYVF3JRV.js → chunk-XKIV3H62.js} +6 -6
- package/dist/chunks/{chunk-J3PHMXN4.js → chunk-XLDFNUCV.js} +4 -4
- package/dist/chunks/{chunk-KAPCNFMC.js → chunk-XODDL7OV.js} +3 -3
- package/dist/chunks/{chunk-DHS5CQNC.js → chunk-XTVF376M.js} +12 -12
- package/dist/chunks/{chunk-PSLNHLZI.js → chunk-YLCMBXE3.js} +3 -3
- package/dist/chunks/{chunk-P7FHJL3V.js → chunk-YNY6XL5T.js} +2 -2
- package/dist/chunks/{chunk-KO2N6EIF.js → chunk-YVJVXTUS.js} +10 -10
- package/dist/chunks/{chunk-LOWGGJOB.js → chunk-ZYSTDBP7.js} +7 -112
- package/dist/chunks/chunk-ZYSTDBP7.js.map +6 -0
- package/dist/chunks/{cli-runtime-SVXU6U4V.js → cli-runtime-33Z22SZM.js} +24 -24
- package/dist/chunks/{commands-A2E3OV7F.js → commands-DLREWCNK.js} +5 -5
- package/dist/chunks/{cost-NA7APCZD.js → cost-MJOM52FI.js} +8 -8
- package/dist/chunks/{crash-report-C6QXQJAK.js → crash-report-62LMID3V.js} +9 -9
- package/dist/chunks/{dist-5SZ7VOLE.js → dist-HA6ABMIV.js} +2 -2
- package/dist/chunks/{dist-GVGW7AZ2.js → dist-HWU5U4SQ.js} +2 -2
- package/dist/chunks/{dist-HASAHQL3.js → dist-IL4H4QGY.js} +2 -2
- package/dist/chunks/{dist-G4BSVJKY.js → dist-MTYIYUQU.js} +2 -2
- package/dist/chunks/{dist-LBTLFSNF.js → dist-NUPNUHXB.js} +66 -2
- package/dist/chunks/{dist-3PE5MOU6.js → dist-TCKNCSZO.js} +2 -2
- package/dist/chunks/{dist-HYKH6P7F.js → dist-U7A47UOF.js} +2 -2
- package/dist/chunks/{dist-6CHQ5OPZ.js → dist-XFBNYCQ7.js} +2 -2
- package/dist/chunks/{doctor-7MQUQYQV.js → doctor-V5C6R5EN.js} +44 -41
- package/dist/chunks/{drain-RG275P5J.js → drain-CS7XQ5B7.js} +14 -14
- package/dist/chunks/{entry-Z2ZZSYJA.js → entry-HXLBVNDK.js} +6 -6
- package/dist/chunks/{eval-GG2BH7CQ.js → eval-NRBZ4IWO.js} +11 -11
- package/dist/chunks/{exec-57YQHQDC.js → exec-GCNNTGHM.js} +83 -55
- package/dist/chunks/exec-GCNNTGHM.js.map +6 -0
- package/dist/chunks/{github-MGIA7MTZ.js → github-Z3JQNLXA.js} +5 -5
- package/dist/chunks/{home-KMZDOTX5.js → home-GP3Y7F5H.js} +3 -3
- package/dist/chunks/{host-XSB7Z6CT.js → host-C5GIO57R.js} +11 -11
- package/dist/chunks/{host-queries-2GQM7BTI.js → host-queries-F5Y3L7E4.js} +15 -15
- package/dist/chunks/{learn-LUEHNOMA.js → learn-5FEP65D6.js} +12 -12
- package/dist/chunks/{learn-builtin-R2Z27LDI.js → learn-builtin-HV3ASHAJ.js} +17 -17
- package/dist/chunks/{lifecycle-DCLLAROM.js → lifecycle-TMZEWFWF.js} +36 -36
- package/dist/chunks/{list-5UW5SFIX.js → list-MD6ZN2PW.js} +18 -18
- package/dist/chunks/{live-YRL6H74Z.js → live-OVTHCQB3.js} +42 -39
- package/dist/chunks/load-ADBRLXAL.js +73 -0
- package/dist/chunks/{login-ELIGI6HT.js → login-RV3AHE4C.js} +13 -13
- package/dist/chunks/{logs-PXASK6XI.js → logs-6SBW5BWD.js} +5 -5
- package/dist/chunks/{mcp-YVV35X7H.js → mcp-3QDMZ7PD.js} +33 -33
- package/dist/chunks/{message-command-QVGOKB4W.js → message-command-TW57Q7AB.js} +57 -54
- package/dist/chunks/message-command-TW57Q7AB.js.map +6 -0
- package/dist/chunks/{open-MDT2NTF4.js → open-K4R6E6QJ.js} +8 -8
- package/dist/chunks/{operator-tools-LYY2FXSO.js → operator-tools-YX4575HD.js} +14 -14
- package/dist/chunks/{output-schema-VR43KZNJ.js → output-schema-QBKJSX77.js} +3 -3
- package/dist/chunks/{pal-ZTG4AHCK.js → pal-KLH2IC3W.js} +19 -19
- package/dist/chunks/{peers-CJOTRI4W.js → peers-5BMGZLHY.js} +18 -18
- package/dist/chunks/{peers-6M4UPHDF.js → peers-6F4JS4VL.js} +6 -6
- package/dist/chunks/{plugin-IVIHCAEO.js → plugin-T6ULGX5N.js} +101 -20
- package/dist/chunks/plugin-T6ULGX5N.js.map +6 -0
- package/dist/chunks/{providers-7WDY37V3.js → providers-YJVPCIRI.js} +11 -11
- package/dist/chunks/{pty-CLDDZT5T.js → pty-UMMMCRJW.js} +3 -3
- package/dist/chunks/resume-RKZ52FZP.js +23 -0
- package/dist/chunks/{resume-command-TXPTYQFF.js → resume-command-H4IJJDLH.js} +4 -4
- package/dist/chunks/{running-KBISZDIQ.js → running-UTOYIBXM.js} +5 -5
- package/dist/chunks/{schedule-ECZVNZLH.js → schedule-KWX4SXS5.js} +8 -8
- package/dist/chunks/{send-VUJ33MJM.js → send-UEL2L3VA.js} +16 -16
- package/dist/chunks/{send-person-WXM7Y5PZ.js → send-person-X3SWXKWV.js} +13 -13
- package/dist/chunks/{service-DORQ3PNE.js → service-4VS6XQ7O.js} +41 -41
- package/dist/chunks/{skills-W7KY3WX4.js → skills-LK7WSDDG.js} +45 -16
- package/dist/chunks/skills-LK7WSDDG.js.map +6 -0
- package/dist/chunks/{start-check-AOQC6GI3.js → start-check-HTPENJ36.js} +2 -2
- package/dist/chunks/{startup-failure-MS7TPUMI.js → startup-failure-LKAHWAYZ.js} +2 -2
- package/dist/chunks/{state-YK5JWP5I.js → state-UQPKWIYT.js} +6 -6
- package/dist/chunks/{store-TM7VDQ5G.js → store-74PEEN6L.js} +4 -4
- package/dist/chunks/{store-XIPDR26B.js → store-BY6HMUUN.js} +6 -6
- package/dist/chunks/{store-7SFKBFX6.js → store-MILGWYSA.js} +10 -10
- package/dist/chunks/{store-H4IVAEZK.js → store-UHIHEGKS.js} +3 -3
- package/dist/chunks/store-UHIHEGKS.js.map +6 -0
- package/dist/chunks/{tui-6OL6WX6S.js → tui-FOVSBYCD.js} +87 -82
- package/dist/chunks/tui-FOVSBYCD.js.map +6 -0
- package/dist/chunks/{upgrade-IQA7V2NK.js → upgrade-V5ST42EQ.js} +10 -10
- package/dist/chunks/{watch-TPJ6F4OJ.js → watch-Q7MSKZIA.js} +97 -92
- package/dist/chunks/watch-Q7MSKZIA.js.map +6 -0
- package/dist/chunks/{workspaces-B7URZQRL.js → workspaces-2AL72WFH.js} +20 -20
- package/dist/chunks/worktree-QPKIZBSK.js +204 -0
- package/dist/chunks/worktree-QPKIZBSK.js.map +6 -0
- package/dist/commands/acp.d.ts.map +1 -1
- 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/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/load.d.ts +25 -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 +45 -42
- 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 +92 -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/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/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/skill-hooks.d.ts +52 -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/agent.d.ts +73 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/fullscreen/code-wrap.d.ts +31 -0
- package/dist/tui/fullscreen/code-wrap.d.ts.map +1 -0
- package/dist/tui/fullscreen/layout.d.ts.map +1 -1
- package/dist/tui/fullscreen/markdown-rows.d.ts +19 -1
- package/dist/tui/fullscreen/markdown-rows.d.ts.map +1 -1
- package/dist/tui/plugin-view.d.ts.map +1 -1
- package/dist/tui/slashCommands.d.ts +44 -1
- package/dist/tui/slashCommands.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 +6 -6
- package/dist/chunks/acp-IOWTKF2X.js.map +0 -6
- package/dist/chunks/agent-session-L6J5GZVX.js +0 -73
- package/dist/chunks/chunk-54KHPVNE.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-CT47C23E.js.map +0 -6
- package/dist/chunks/chunk-HGZYNEQE.js.map +0 -6
- package/dist/chunks/chunk-HREK4V2O.js +0 -1545
- package/dist/chunks/chunk-HREK4V2O.js.map +0 -6
- package/dist/chunks/chunk-HSLOM2WI.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-UMHKTV2L.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/exec-57YQHQDC.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-6OL6WX6S.js.map +0 -6
- package/dist/chunks/watch-TPJ6F4OJ.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-2QIWTUUB.js.map} +0 -0
- /package/dist/chunks/{add-YYQLPCP2.js.map → add-2YDEALUT.js.map} +0 -0
- /package/dist/chunks/{agent-WL6NX4W6.js.map → agent-IKQ67NMW.js.map} +0 -0
- /package/dist/chunks/{agent-session-L6J5GZVX.js.map → agent-session-H3OE6ZJT.js.map} +0 -0
- /package/dist/chunks/{apply-at-exit-WWVK3RWD.js.map → apply-at-exit-F4G7PCZL.js.map} +0 -0
- /package/dist/chunks/{archive-UE756BME.js.map → archive-FOTYHQPL.js.map} +0 -0
- /package/dist/chunks/{bin-main-QWMIKRQP.js.map → bin-main-DWOCG2WK.js.map} +0 -0
- /package/dist/chunks/{binding-HCIPLFUO.js.map → binding-2GEVBR5H.js.map} +0 -0
- /package/dist/chunks/{browser-7SFVCKSO.js.map → browser-WYPSIPEZ.js.map} +0 -0
- /package/dist/chunks/{chat-SE2QOB2X.js.map → chat-LWVIDEXR.js.map} +0 -0
- /package/dist/chunks/{chunk-CQKYKQEF.js.map → chunk-2CYBRCPH.js.map} +0 -0
- /package/dist/chunks/{chunk-7AWFHVMT.js.map → chunk-2Q2TPLYP.js.map} +0 -0
- /package/dist/chunks/{chunk-TYTE2GIF.js.map → chunk-2QMXCXZ2.js.map} +0 -0
- /package/dist/chunks/{chunk-Z5NMQ2YN.js.map → chunk-33WFG4C3.js.map} +0 -0
- /package/dist/chunks/{chunk-Z5FDI74K.js.map → chunk-3EEKLQXD.js.map} +0 -0
- /package/dist/chunks/{chunk-NZMKMXGG.js.map → chunk-3T5AX2PC.js.map} +0 -0
- /package/dist/chunks/{chunk-OBMHA7OP.js.map → chunk-4ASCYXSH.js.map} +0 -0
- /package/dist/chunks/{chunk-LSRVPPLR.js.map → chunk-4EBZUUE4.js.map} +0 -0
- /package/dist/chunks/{chunk-3NAVAACC.js.map → chunk-5F4SSZKS.js.map} +0 -0
- /package/dist/chunks/{chunk-5QACH2Q2.js.map → chunk-5JQIGBBR.js.map} +0 -0
- /package/dist/chunks/{chunk-HJILJSZO.js.map → chunk-6CXEEZLK.js.map} +0 -0
- /package/dist/chunks/{chunk-2U357RJS.js.map → chunk-6JKNPDZD.js.map} +0 -0
- /package/dist/chunks/{chunk-AGFGC7SI.js.map → chunk-6KIXUAOC.js.map} +0 -0
- /package/dist/chunks/{chunk-2WDF5N2A.js.map → chunk-6NUQEVHG.js.map} +0 -0
- /package/dist/chunks/{chunk-4RTQTX5R.js.map → chunk-6RTDZGPO.js.map} +0 -0
- /package/dist/chunks/{chunk-7JT7DNR7.js.map → chunk-7T6TX47O.js.map} +0 -0
- /package/dist/chunks/{chunk-SFDB5RIL.js.map → chunk-AZHBCP6G.js.map} +0 -0
- /package/dist/chunks/{chunk-POOJ2MUS.js.map → chunk-BLGPF6UL.js.map} +0 -0
- /package/dist/chunks/{chunk-F3SQRGKZ.js.map → chunk-CMHOQ62S.js.map} +0 -0
- /package/dist/chunks/{chunk-24N42TGE.js.map → chunk-D5RO75LO.js.map} +0 -0
- /package/dist/chunks/{chunk-M3AUPUII.js.map → chunk-D7JY7KNY.js.map} +0 -0
- /package/dist/chunks/{chunk-RAPO3KLG.js.map → chunk-DTORDCJR.js.map} +0 -0
- /package/dist/chunks/{chunk-O326HKCW.js.map → chunk-EADNTGVW.js.map} +0 -0
- /package/dist/chunks/{chunk-2VSICYQP.js.map → chunk-FWTWILCD.js.map} +0 -0
- /package/dist/chunks/{chunk-HUONDMU4.js.map → chunk-G4R65ULE.js.map} +0 -0
- /package/dist/chunks/{chunk-C5XQHEYB.js.map → chunk-G7LMPHZE.js.map} +0 -0
- /package/dist/chunks/{chunk-XHLFI6F6.js.map → chunk-GD7VSTWZ.js.map} +0 -0
- /package/dist/chunks/{chunk-4FV2VZS6.js.map → chunk-GZNTRTD5.js.map} +0 -0
- /package/dist/chunks/{chunk-M2J3O3JT.js.map → chunk-HFZLLEJS.js.map} +0 -0
- /package/dist/chunks/{chunk-WOSL3OZD.js.map → chunk-IW3XMMEN.js.map} +0 -0
- /package/dist/chunks/{chunk-DSKNFDTL.js.map → chunk-KXUKJLA2.js.map} +0 -0
- /package/dist/chunks/{chunk-EA73SWCT.js.map → chunk-L2AKMCV3.js.map} +0 -0
- /package/dist/chunks/{chunk-Z6J7SVOB.js.map → chunk-LC7SV2KM.js.map} +0 -0
- /package/dist/chunks/{chunk-4SJZ5D6H.js.map → chunk-LOUV4VZ6.js.map} +0 -0
- /package/dist/chunks/{chunk-DI4L3GH5.js.map → chunk-LQJLTW2D.js.map} +0 -0
- /package/dist/chunks/{chunk-HTHNDZ3L.js.map → chunk-LRFRTQW7.js.map} +0 -0
- /package/dist/chunks/{chunk-EKMHZKVP.js.map → chunk-MDY2IMVQ.js.map} +0 -0
- /package/dist/chunks/{chunk-NTV2XD2J.js.map → chunk-MNMKHEMI.js.map} +0 -0
- /package/dist/chunks/{chunk-ZDZ35MMZ.js.map → chunk-MTY4XYDO.js.map} +0 -0
- /package/dist/chunks/{chunk-OAHCS42A.js.map → chunk-MZURZ6P4.js.map} +0 -0
- /package/dist/chunks/{chunk-6CFPN6I4.js.map → chunk-NFKSV6UI.js.map} +0 -0
- /package/dist/chunks/{chunk-TI6FFONP.js.map → chunk-NIRQFXO6.js.map} +0 -0
- /package/dist/chunks/{chunk-QPR3UA4L.js.map → chunk-NJWQUZF2.js.map} +0 -0
- /package/dist/chunks/{chunk-EKQ6J5KA.js.map → chunk-NRGGICBE.js.map} +0 -0
- /package/dist/chunks/{chunk-ZMKEYARZ.js.map → chunk-NW6VBCCU.js.map} +0 -0
- /package/dist/chunks/{chunk-UWN4WNQZ.js.map → chunk-ORCR5VST.js.map} +0 -0
- /package/dist/chunks/{chunk-TUXH7IXQ.js.map → chunk-P6OOW3RL.js.map} +0 -0
- /package/dist/chunks/{chunk-46VSU4QF.js.map → chunk-PXA27JGJ.js.map} +0 -0
- /package/dist/chunks/{chunk-SPSWX3QZ.js.map → chunk-PXJ2KPOI.js.map} +0 -0
- /package/dist/chunks/{chunk-FIYZCKQ7.js.map → chunk-QE5PQM5T.js.map} +0 -0
- /package/dist/chunks/{chunk-SHUA4YUK.js.map → chunk-QIDU76IF.js.map} +0 -0
- /package/dist/chunks/{chunk-SB3A7KUJ.js.map → chunk-QP435RW7.js.map} +0 -0
- /package/dist/chunks/{chunk-FX7BSCB4.js.map → chunk-QPAWT3EG.js.map} +0 -0
- /package/dist/chunks/{chunk-BHOZPFJM.js.map → chunk-QTPZCVPP.js.map} +0 -0
- /package/dist/chunks/{chunk-CCYAWSZL.js.map → chunk-RFGMOXA6.js.map} +0 -0
- /package/dist/chunks/{chunk-N56NUKMT.js.map → chunk-RPXTYB22.js.map} +0 -0
- /package/dist/chunks/{chunk-X6SREM2V.js.map → chunk-RXUWYGFX.js.map} +0 -0
- /package/dist/chunks/{chunk-DIWEKTYK.js.map → chunk-S5R2E5TZ.js.map} +0 -0
- /package/dist/chunks/{chunk-DOFQWVBL.js.map → chunk-T3NIOUQJ.js.map} +0 -0
- /package/dist/chunks/{chunk-LMLJ7NS5.js.map → chunk-TMOEYXPR.js.map} +0 -0
- /package/dist/chunks/{chunk-PV65WQHD.js.map → chunk-UNO2ZRXA.js.map} +0 -0
- /package/dist/chunks/{chunk-ZZNHDQAD.js.map → chunk-UNZNPAW7.js.map} +0 -0
- /package/dist/chunks/{chunk-PYSZ7JTU.js.map → chunk-URIGGSIK.js.map} +0 -0
- /package/dist/chunks/{chunk-JQZDXUYK.js.map → chunk-UWYDZYCZ.js.map} +0 -0
- /package/dist/chunks/{chunk-P5E6ITP5.js.map → chunk-VG6RBHI4.js.map} +0 -0
- /package/dist/chunks/{chunk-A47ZNTW7.js.map → chunk-VV2EHZOG.js.map} +0 -0
- /package/dist/chunks/{chunk-VYLCV6W3.js.map → chunk-WY6KOPIY.js.map} +0 -0
- /package/dist/chunks/{chunk-HOKSVFIC.js.map → chunk-XFVVJAI3.js.map} +0 -0
- /package/dist/chunks/{chunk-MYVF3JRV.js.map → chunk-XKIV3H62.js.map} +0 -0
- /package/dist/chunks/{chunk-J3PHMXN4.js.map → chunk-XLDFNUCV.js.map} +0 -0
- /package/dist/chunks/{chunk-KAPCNFMC.js.map → chunk-XODDL7OV.js.map} +0 -0
- /package/dist/chunks/{chunk-DHS5CQNC.js.map → chunk-XTVF376M.js.map} +0 -0
- /package/dist/chunks/{chunk-PSLNHLZI.js.map → chunk-YLCMBXE3.js.map} +0 -0
- /package/dist/chunks/{chunk-P7FHJL3V.js.map → chunk-YNY6XL5T.js.map} +0 -0
- /package/dist/chunks/{chunk-KO2N6EIF.js.map → chunk-YVJVXTUS.js.map} +0 -0
- /package/dist/chunks/{cli-runtime-SVXU6U4V.js.map → cli-runtime-33Z22SZM.js.map} +0 -0
- /package/dist/chunks/{commands-A2E3OV7F.js.map → commands-DLREWCNK.js.map} +0 -0
- /package/dist/chunks/{cost-NA7APCZD.js.map → cost-MJOM52FI.js.map} +0 -0
- /package/dist/chunks/{crash-report-C6QXQJAK.js.map → crash-report-62LMID3V.js.map} +0 -0
- /package/dist/chunks/{dist-5SZ7VOLE.js.map → dist-HA6ABMIV.js.map} +0 -0
- /package/dist/chunks/{dist-GVGW7AZ2.js.map → dist-HWU5U4SQ.js.map} +0 -0
- /package/dist/chunks/{dist-HASAHQL3.js.map → dist-IL4H4QGY.js.map} +0 -0
- /package/dist/chunks/{dist-G4BSVJKY.js.map → dist-MTYIYUQU.js.map} +0 -0
- /package/dist/chunks/{dist-LBTLFSNF.js.map → dist-NUPNUHXB.js.map} +0 -0
- /package/dist/chunks/{dist-3PE5MOU6.js.map → dist-TCKNCSZO.js.map} +0 -0
- /package/dist/chunks/{dist-HYKH6P7F.js.map → dist-U7A47UOF.js.map} +0 -0
- /package/dist/chunks/{dist-6CHQ5OPZ.js.map → dist-XFBNYCQ7.js.map} +0 -0
- /package/dist/chunks/{doctor-7MQUQYQV.js.map → doctor-V5C6R5EN.js.map} +0 -0
- /package/dist/chunks/{drain-RG275P5J.js.map → drain-CS7XQ5B7.js.map} +0 -0
- /package/dist/chunks/{entry-Z2ZZSYJA.js.map → entry-HXLBVNDK.js.map} +0 -0
- /package/dist/chunks/{eval-GG2BH7CQ.js.map → eval-NRBZ4IWO.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-GP3Y7F5H.js.map} +0 -0
- /package/dist/chunks/{host-XSB7Z6CT.js.map → host-C5GIO57R.js.map} +0 -0
- /package/dist/chunks/{host-queries-2GQM7BTI.js.map → host-queries-F5Y3L7E4.js.map} +0 -0
- /package/dist/chunks/{learn-LUEHNOMA.js.map → learn-5FEP65D6.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-R2Z27LDI.js.map → learn-builtin-HV3ASHAJ.js.map} +0 -0
- /package/dist/chunks/{lifecycle-DCLLAROM.js.map → lifecycle-TMZEWFWF.js.map} +0 -0
- /package/dist/chunks/{list-5UW5SFIX.js.map → list-MD6ZN2PW.js.map} +0 -0
- /package/dist/chunks/{live-YRL6H74Z.js.map → live-OVTHCQB3.js.map} +0 -0
- /package/dist/chunks/{login-ELIGI6HT.js.map → load-ADBRLXAL.js.map} +0 -0
- /package/dist/chunks/{open-MDT2NTF4.js.map → login-RV3AHE4C.js.map} +0 -0
- /package/dist/chunks/{logs-PXASK6XI.js.map → logs-6SBW5BWD.js.map} +0 -0
- /package/dist/chunks/{mcp-YVV35X7H.js.map → mcp-3QDMZ7PD.js.map} +0 -0
- /package/dist/chunks/{output-schema-VR43KZNJ.js.map → open-K4R6E6QJ.js.map} +0 -0
- /package/dist/chunks/{operator-tools-LYY2FXSO.js.map → operator-tools-YX4575HD.js.map} +0 -0
- /package/dist/chunks/{peers-6M4UPHDF.js.map → output-schema-QBKJSX77.js.map} +0 -0
- /package/dist/chunks/{pal-ZTG4AHCK.js.map → pal-KLH2IC3W.js.map} +0 -0
- /package/dist/chunks/{peers-CJOTRI4W.js.map → peers-5BMGZLHY.js.map} +0 -0
- /package/dist/chunks/{providers-7WDY37V3.js.map → peers-6F4JS4VL.js.map} +0 -0
- /package/dist/chunks/{pty-CLDDZT5T.js.map → providers-YJVPCIRI.js.map} +0 -0
- /package/dist/chunks/{resume-ZRVTAGB6.js.map → pty-UMMMCRJW.js.map} +0 -0
- /package/dist/chunks/{resume-command-TXPTYQFF.js.map → resume-RKZ52FZP.js.map} +0 -0
- /package/dist/chunks/{running-KBISZDIQ.js.map → resume-command-H4IJJDLH.js.map} +0 -0
- /package/dist/chunks/{send-VUJ33MJM.js.map → running-UTOYIBXM.js.map} +0 -0
- /package/dist/chunks/{schedule-ECZVNZLH.js.map → schedule-KWX4SXS5.js.map} +0 -0
- /package/dist/chunks/{send-person-WXM7Y5PZ.js.map → send-UEL2L3VA.js.map} +0 -0
- /package/dist/chunks/{start-check-AOQC6GI3.js.map → send-person-X3SWXKWV.js.map} +0 -0
- /package/dist/chunks/{service-DORQ3PNE.js.map → service-4VS6XQ7O.js.map} +0 -0
- /package/dist/chunks/{store-7SFKBFX6.js.map → start-check-HTPENJ36.js.map} +0 -0
- /package/dist/chunks/{startup-failure-MS7TPUMI.js.map → startup-failure-LKAHWAYZ.js.map} +0 -0
- /package/dist/chunks/{state-YK5JWP5I.js.map → state-UQPKWIYT.js.map} +0 -0
- /package/dist/chunks/{store-H4IVAEZK.js.map → store-74PEEN6L.js.map} +0 -0
- /package/dist/chunks/{store-TM7VDQ5G.js.map → store-BY6HMUUN.js.map} +0 -0
- /package/dist/chunks/{store-XIPDR26B.js.map → store-MILGWYSA.js.map} +0 -0
- /package/dist/chunks/{upgrade-IQA7V2NK.js.map → upgrade-V5ST42EQ.js.map} +0 -0
- /package/dist/chunks/{workspaces-B7URZQRL.js.map → workspaces-2AL72WFH.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-DHWD5YYD.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-NFKSV6UI.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-C74LVDRC.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;
|
|
@@ -386,387 +566,53 @@ function compileBrowserSites(sites) {
|
|
|
386
566
|
];
|
|
387
567
|
return { rules, sites: normalized.sites, diagnostics };
|
|
388
568
|
}
|
|
389
|
-
__name(compileBrowserSites, "compileBrowserSites");
|
|
390
|
-
var BROWSER_TOOLS = /* @__PURE__ */ new Set([BROWSER_TOOL_NAME, BROWSER_ACT_TOOL_NAME]);
|
|
391
|
-
function isBrowserDeny(rule) {
|
|
392
|
-
switch (rule.type) {
|
|
393
|
-
case "deny_by_name":
|
|
394
|
-
return rule.toolNames.some((name) => BROWSER_TOOLS.has(name));
|
|
395
|
-
case "argument_pattern":
|
|
396
|
-
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 {
|
|
725
|
-
}
|
|
726
|
-
return "absent";
|
|
727
|
-
}
|
|
728
|
-
__name(readUserDecisionSetting, "readUserDecisionSetting");
|
|
729
|
-
function offerPath(opts = {}) {
|
|
730
|
-
return join2(homeDir(opts), "decision-offer.json");
|
|
731
|
-
}
|
|
732
|
-
__name(offerPath, "offerPath");
|
|
733
|
-
function readOffer(opts = {}) {
|
|
734
|
-
try {
|
|
735
|
-
const parsed = JSON.parse(readFileSync2(offerPath(opts), "utf8"));
|
|
736
|
-
if ((parsed.answer === "later" || parsed.answer === "never") && typeof parsed.at === "string") {
|
|
737
|
-
return { answer: parsed.answer, at: parsed.at };
|
|
738
|
-
}
|
|
739
|
-
} catch {
|
|
569
|
+
__name(compileBrowserSites, "compileBrowserSites");
|
|
570
|
+
var BROWSER_TOOLS = /* @__PURE__ */ new Set([BROWSER_TOOL_NAME, BROWSER_ACT_TOOL_NAME]);
|
|
571
|
+
function isBrowserDeny(rule) {
|
|
572
|
+
switch (rule.type) {
|
|
573
|
+
case "deny_by_name":
|
|
574
|
+
return rule.toolNames.some((name) => BROWSER_TOOLS.has(name));
|
|
575
|
+
case "argument_pattern":
|
|
576
|
+
return rule.decision === "deny" && rule.toolNames.some((name) => BROWSER_TOOLS.has(name));
|
|
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;
|
|
740
581
|
}
|
|
741
|
-
return void 0;
|
|
742
582
|
}
|
|
743
|
-
__name(
|
|
744
|
-
function
|
|
745
|
-
|
|
746
|
-
|
|
583
|
+
__name(isBrowserDeny, "isBrowserDeny");
|
|
584
|
+
function withBrowserSiteRules(tableRules, siteRules) {
|
|
585
|
+
return [
|
|
586
|
+
...tableRules.filter(isBrowserDeny),
|
|
587
|
+
...siteRules,
|
|
588
|
+
...tableRules.filter((rule) => !isBrowserDeny(rule))
|
|
589
|
+
];
|
|
747
590
|
}
|
|
748
|
-
__name(
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
if (
|
|
755
|
-
const
|
|
756
|
-
|
|
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 };
|
|
757
601
|
}
|
|
758
|
-
__name(
|
|
759
|
-
function
|
|
760
|
-
if (input
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
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;
|
|
612
|
+
}
|
|
613
|
+
return void 0;
|
|
765
614
|
}
|
|
766
|
-
__name(
|
|
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);
|
|
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();
|
|
@@ -3452,6 +3530,15 @@ function mergeBrowserConfig(below, layer, source) {
|
|
|
3452
3530
|
};
|
|
3453
3531
|
}
|
|
3454
3532
|
__name(mergeBrowserConfig, "mergeBrowserConfig");
|
|
3533
|
+
function readPluginHookEntries(value, where, record) {
|
|
3534
|
+
const read = CONFIG_READERS.hooks;
|
|
3535
|
+
return read(
|
|
3536
|
+
value,
|
|
3537
|
+
{ source: { kind: "file", path: where.path }, path: ["hooks"] },
|
|
3538
|
+
{ file: where.file, record, plugin: true }
|
|
3539
|
+
);
|
|
3540
|
+
}
|
|
3541
|
+
__name(readPluginHookEntries, "readPluginHookEntries");
|
|
3455
3542
|
|
|
3456
3543
|
export {
|
|
3457
3544
|
connectedPointsNotice,
|
|
@@ -3490,11 +3577,15 @@ export {
|
|
|
3490
3577
|
createConfigDebugSnapshot,
|
|
3491
3578
|
formatConfigSource,
|
|
3492
3579
|
renderConfigDebug,
|
|
3580
|
+
isGuardHookEvent,
|
|
3581
|
+
hookEventForKey,
|
|
3493
3582
|
hooksOfElement,
|
|
3583
|
+
unknownEventMessage,
|
|
3494
3584
|
DEFAULT_CONFIG,
|
|
3495
3585
|
resolveToolResultScreens,
|
|
3496
3586
|
configuredPassthroughTools,
|
|
3497
3587
|
unmatchedPassthroughTools,
|
|
3588
|
+
MANAGED_CONFIG_PATH,
|
|
3498
3589
|
loadConfigWithProvenance,
|
|
3499
3590
|
loadBootstrapConfigWithProvenance,
|
|
3500
3591
|
readPermissionLayers,
|
|
@@ -3504,9 +3595,19 @@ export {
|
|
|
3504
3595
|
pendingProjectMcpServers,
|
|
3505
3596
|
LOCAL_CONFIG_FILE,
|
|
3506
3597
|
shortHomePath,
|
|
3598
|
+
stripByteOrderMark,
|
|
3599
|
+
ENV_VARIABLE_NAMES,
|
|
3600
|
+
withHookProblemSink,
|
|
3507
3601
|
hookConfigProblems,
|
|
3602
|
+
resetHookConfigProblems,
|
|
3508
3603
|
takeConfigWarnings,
|
|
3509
3604
|
CONFIG_KEYS,
|
|
3510
|
-
readConfigKey
|
|
3605
|
+
readConfigKey,
|
|
3606
|
+
mergeCodeAnalysisConfig,
|
|
3607
|
+
mergeTuiConfig,
|
|
3608
|
+
mergeUpdatesConfig,
|
|
3609
|
+
mergeSandboxConfig,
|
|
3610
|
+
mergeBrowserConfig,
|
|
3611
|
+
readPluginHookEntries
|
|
3511
3612
|
};
|
|
3512
|
-
//# sourceMappingURL=chunk-
|
|
3613
|
+
//# sourceMappingURL=chunk-53UWPLAF.js.map
|