@namzu/cli 60.1.0 → 61.0.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 +86 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-6R4I2A3Q.js → acp-Q3IA5XHU.js} +294 -133
- package/dist/chunks/acp-Q3IA5XHU.js.map +6 -0
- package/dist/chunks/{activity-command-JU4HLIQJ.js → activity-command-PXOMQCVV.js} +14 -14
- package/dist/chunks/{add-S6JYKDI4.js → add-HIIKDZDN.js} +21 -21
- package/dist/chunks/{agent-E343AQV7.js → agent-5OM6GGWO.js} +55 -53
- package/dist/chunks/agent-session-MNEGO6RD.js +95 -0
- package/dist/chunks/{apply-at-exit-MEOJMGNT.js → apply-at-exit-2TUEV3TN.js} +7 -7
- package/dist/chunks/{archive-ZPWC7GZU.js → archive-ESYECN4Y.js} +12 -12
- package/dist/chunks/{auth-6NX4TMIG.js → auth-WA6ZXNXM.js} +12 -12
- package/dist/chunks/{bin-main-P3KAQDKC.js → bin-main-Y5FDOG2X.js} +8 -8
- package/dist/chunks/{binding-6QZVGFQ5.js → binding-7ZF533IJ.js} +3 -3
- package/dist/chunks/{browser-KK2U5524.js → browser-HFAVORW3.js} +7 -7
- package/dist/chunks/{chat-VEXJRSZN.js → chat-BVA2BLKE.js} +17 -17
- package/dist/chunks/{chunk-PS5SVAUJ.js → chunk-2SXME4FG.js} +2 -2
- package/dist/chunks/{chunk-VQZPXK4X.js → chunk-2ZA7XJ63.js} +3 -3
- package/dist/chunks/{chunk-452SL2Y4.js → chunk-3CEL5P45.js} +2 -2
- package/dist/chunks/{chunk-N5CCXOYK.js → chunk-3DCQNM64.js} +7 -7
- package/dist/chunks/{chunk-4KVYTHY7.js → chunk-3KCGBW3F.js} +3 -3
- package/dist/chunks/{chunk-66QIFMEO.js → chunk-3RDKZZQE.js} +2 -2
- package/dist/chunks/{chunk-ZHEEG3NS.js → chunk-5KRUNLE7.js} +2 -2
- package/dist/chunks/{chunk-PE4MWWUW.js → chunk-5M44QX4G.js} +3 -3
- package/dist/chunks/{chunk-C7E7YCRD.js → chunk-5VKCUXB2.js} +8 -6
- package/dist/chunks/chunk-5VKCUXB2.js.map +6 -0
- package/dist/chunks/{chunk-SXONHO4H.js → chunk-65ROGOIM.js} +9 -9
- package/dist/chunks/{chunk-HM7L5PM2.js → chunk-65ZRPJA5.js} +3 -3
- package/dist/chunks/{chunk-BA7KUG6V.js → chunk-6FGEPFFB.js} +2 -2
- package/dist/chunks/{chunk-32OIBGYI.js → chunk-6PEEUJSR.js} +10 -8
- package/dist/chunks/chunk-6PEEUJSR.js.map +6 -0
- package/dist/chunks/{chunk-44YG6EI4.js → chunk-6UWOG6FY.js} +4 -4
- package/dist/chunks/{chunk-2KVQVPJ7.js → chunk-6ZZQSHLH.js} +6 -6
- package/dist/chunks/{chunk-2KVQVPJ7.js.map → chunk-6ZZQSHLH.js.map} +1 -1
- package/dist/chunks/{chunk-AMYP2WPW.js → chunk-752F23K2.js} +8 -8
- package/dist/chunks/{chunk-DRSQTKDN.js → chunk-7BRCXPI3.js} +3 -3
- package/dist/chunks/{chunk-WOTA5FO5.js → chunk-7TPWEPUT.js} +3 -3
- package/dist/chunks/{chunk-PRJO4XM3.js → chunk-A42WH5C5.js} +2 -2
- package/dist/chunks/{chunk-RMOTHWPV.js → chunk-AAGA2PWL.js} +17 -6
- package/dist/chunks/chunk-AAGA2PWL.js.map +6 -0
- package/dist/chunks/{chunk-F5W4TNCR.js → chunk-AHV6BJED.js} +2 -2
- package/dist/chunks/{chunk-4CJ3HPOT.js → chunk-AYD4H6VV.js} +2 -2
- package/dist/chunks/{chunk-2DCOB33W.js → chunk-B7DL5QPS.js} +19 -6
- package/dist/chunks/chunk-B7DL5QPS.js.map +6 -0
- package/dist/chunks/{chunk-FK4MAZV2.js → chunk-BXUNIVZB.js} +13 -6
- package/dist/chunks/chunk-BXUNIVZB.js.map +6 -0
- package/dist/chunks/{chunk-J4PL65DJ.js → chunk-C3KDKOUV.js} +6 -6
- package/dist/chunks/{chunk-VWUTJ4EU.js → chunk-CJBRIESJ.js} +3 -3
- package/dist/chunks/{chunk-YWRRS7SO.js → chunk-COOEFXWT.js} +2 -2
- package/dist/chunks/{chunk-BJT37HR4.js → chunk-CQ2EGIRN.js} +301 -713
- package/dist/chunks/chunk-CQ2EGIRN.js.map +6 -0
- package/dist/chunks/{chunk-NVWD5XDT.js → chunk-DAZEYCY5.js} +2 -2
- package/dist/chunks/{chunk-4Y242BU4.js → chunk-DL5KZGQK.js} +5 -5
- package/dist/chunks/{chunk-O4EILTV6.js → chunk-DRYK66N3.js} +78 -25
- package/dist/chunks/chunk-DRYK66N3.js.map +6 -0
- package/dist/chunks/{chunk-RQAY7REG.js → chunk-EDAEDZ37.js} +3 -3
- package/dist/chunks/{chunk-QQ4S6MNH.js → chunk-EDLBZSB2.js} +1198 -305
- package/dist/chunks/chunk-EDLBZSB2.js.map +6 -0
- package/dist/chunks/{chunk-R6M6EIAH.js → chunk-EEBDKNNP.js} +4 -4
- package/dist/chunks/{chunk-GT22EDUB.js → chunk-EOLSGOXC.js} +6 -6
- package/dist/chunks/{chunk-O45DCUNX.js → chunk-EYFAHVYO.js} +2 -2
- package/dist/chunks/{chunk-NKHEBASJ.js → chunk-EZYMBETQ.js} +2 -2
- package/dist/chunks/{chunk-ME4LETA3.js → chunk-F5AHQ4RX.js} +2 -2
- package/dist/chunks/{chunk-MUSGZEFY.js → chunk-F5SG7JPB.js} +2 -2
- package/dist/chunks/{chunk-MK42KB72.js → chunk-FHKPEPTE.js} +4 -4
- package/dist/chunks/{chunk-XDUA6PBP.js → chunk-FHP4D55L.js} +2 -2
- package/dist/chunks/{chunk-WDKAL7EW.js → chunk-FIEADS4A.js} +2 -2
- package/dist/chunks/{chunk-K2EKXCLZ.js → chunk-G5NS6ASX.js} +3 -3
- package/dist/chunks/{chunk-I4RC6KQQ.js → chunk-GS7ST2VG.js} +19 -19
- package/dist/chunks/{chunk-XE6XT6R6.js → chunk-GSNTXEOD.js} +4 -4
- package/dist/chunks/{chunk-H6NTNPWD.js → chunk-HGBVFYQT.js} +4 -4
- package/dist/chunks/{chunk-D2R47LDH.js → chunk-HIJXZ6FI.js} +12 -12
- package/dist/chunks/{chunk-5F4DSPZC.js → chunk-HLYITQWD.js} +10 -10
- package/dist/chunks/{chunk-42JIZXVL.js → chunk-HN2NZD4E.js} +3 -88
- package/dist/chunks/chunk-HN2NZD4E.js.map +6 -0
- package/dist/chunks/{chunk-QCV3HH4P.js → chunk-HX3ENA3I.js} +2 -2
- package/dist/chunks/{chunk-HKRUNZVI.js → chunk-IWVJDG4L.js} +3 -3
- package/dist/chunks/{chunk-PZWSRAE7.js → chunk-J2ITWYQQ.js} +6 -6
- package/dist/chunks/{chunk-4BNCVR3U.js → chunk-JR3LFDKN.js} +2 -2
- package/dist/chunks/{chunk-BZR5PIFF.js → chunk-JRZSUEK4.js} +367 -176
- package/dist/chunks/chunk-JRZSUEK4.js.map +6 -0
- package/dist/chunks/{chunk-FMD4REZQ.js → chunk-K4PFUUP7.js} +47 -40
- package/dist/chunks/chunk-K4PFUUP7.js.map +6 -0
- package/dist/chunks/{chunk-TBJ6XU3T.js → chunk-KDOBJGF2.js} +3 -3
- package/dist/chunks/{chunk-EBBT2I5S.js → chunk-KDPGC66S.js} +30 -6
- package/dist/chunks/chunk-KDPGC66S.js.map +6 -0
- package/dist/chunks/{chunk-QNJXULU7.js → chunk-KKHZG7B2.js} +2 -2
- package/dist/chunks/{chunk-6W3UGXGG.js → chunk-KTSPKGEC.js} +4 -4
- package/dist/chunks/{chunk-BURGRQWO.js → chunk-KXBZ7P2A.js} +2 -2
- package/dist/chunks/{chunk-4473VICE.js → chunk-KZ5XYWKO.js} +3 -3
- package/dist/chunks/{chunk-EXJJLYZK.js → chunk-LKWENSPO.js} +7 -60
- package/dist/chunks/chunk-LKWENSPO.js.map +6 -0
- package/dist/chunks/{chunk-F7KOBJVW.js → chunk-LLVZON4J.js} +4 -4
- package/dist/chunks/{chunk-B4AOCHH6.js → chunk-LNMFADLE.js} +3 -3
- package/dist/chunks/{chunk-AC5P6W3G.js → chunk-ME7MQ4P2.js} +2 -2
- package/dist/chunks/{chunk-JJ72TLOA.js → chunk-MESE2QPT.js} +27 -30
- package/dist/chunks/chunk-MESE2QPT.js.map +6 -0
- package/dist/chunks/{chunk-FPC3K4TT.js → chunk-MHESN2FM.js} +3 -3
- package/dist/chunks/{chunk-SLTJNYOU.js → chunk-MKCZB324.js} +2 -2
- package/dist/chunks/{chunk-5IGEQN7L.js → chunk-NE55T7GN.js} +4 -4
- package/dist/chunks/{chunk-VG7245VJ.js → chunk-NI2YKSPW.js} +6 -6
- package/dist/chunks/{chunk-AYMB4AOZ.js → chunk-NQVSTOUH.js} +4 -4
- package/dist/chunks/chunk-NSU3TAZZ.js +74 -0
- package/dist/chunks/chunk-NSU3TAZZ.js.map +6 -0
- package/dist/chunks/{chunk-QGBR42TV.js → chunk-NVRUHQKC.js} +7 -7
- package/dist/chunks/{chunk-PAUMCJPX.js → chunk-O3AEUU3Q.js} +3 -3
- package/dist/chunks/{chunk-4DSUVT37.js → chunk-OG7MBIKO.js} +5 -5
- package/dist/chunks/{chunk-NBJ5PRAY.js → chunk-OGMRGX5M.js} +3 -3
- package/dist/chunks/{chunk-WJ6QRVL6.js → chunk-PFQQ6YFF.js} +2 -2
- package/dist/chunks/{chunk-CXW7I2S3.js → chunk-PHEL63BK.js} +2 -2
- package/dist/chunks/{chunk-YR3TWNIV.js → chunk-PJORD4FZ.js} +9 -9
- package/dist/chunks/{chunk-5ZLKTFU2.js → chunk-PSUJIMQV.js} +3 -3
- package/dist/chunks/{chunk-TBGKPWCL.js → chunk-PWSMXR6B.js} +9 -9
- package/dist/chunks/{chunk-PRRX5LNR.js → chunk-PYFAJB35.js} +2 -2
- package/dist/chunks/{chunk-BWD2TUI4.js → chunk-PYFGTXFQ.js} +5 -5
- package/dist/chunks/{chunk-EWPGU4HH.js → chunk-Q5H7EHCH.js} +314 -22
- package/dist/chunks/{chunk-EWPGU4HH.js.map → chunk-Q5H7EHCH.js.map} +2 -2
- package/dist/chunks/{chunk-BHQHTM3Z.js → chunk-QH4DQR57.js} +5 -5
- package/dist/chunks/{chunk-TTKMQW6B.js → chunk-QR5VVGWU.js} +3 -3
- package/dist/chunks/{chunk-UCML5ZXB.js → chunk-QR7GTBV3.js} +3 -3
- package/dist/chunks/{chunk-T7ILM666.js → chunk-R5BEMFDZ.js} +11 -11
- package/dist/chunks/{chunk-D4TXOX34.js → chunk-RQOE2MRO.js} +2 -2
- package/dist/chunks/chunk-RYOZ4HYY.js +1221 -0
- package/dist/chunks/chunk-RYOZ4HYY.js.map +6 -0
- package/dist/chunks/{chunk-6TUHWKXP.js → chunk-RZBIRLZ6.js} +6 -6
- package/dist/chunks/{chunk-GTUTBTOV.js → chunk-SLLKDPGZ.js} +3 -3
- package/dist/chunks/{chunk-6HYK4DDB.js → chunk-SXI6NW2H.js} +3 -3
- package/dist/chunks/{chunk-R2KAESOM.js → chunk-SYJRI5A4.js} +2 -2
- package/dist/chunks/{chunk-RKKU2RE4.js → chunk-T26HDLQS.js} +2 -2
- package/dist/chunks/{chunk-WYA4QWWE.js → chunk-TBQQRYS2.js} +5 -5
- package/dist/chunks/{chunk-IMMUS7IW.js → chunk-TFREQNR5.js} +20 -12
- package/dist/chunks/chunk-TFREQNR5.js.map +6 -0
- package/dist/chunks/{chunk-GPTYDM26.js → chunk-TQZSXYON.js} +8 -8
- package/dist/chunks/{chunk-D6PB3Z7Q.js → chunk-TSN7J4ZH.js} +2 -2
- package/dist/chunks/{chunk-Z5OG4HXI.js → chunk-TT3GLF32.js} +133 -89
- package/dist/chunks/chunk-TT3GLF32.js.map +6 -0
- package/dist/chunks/{chunk-PZLPACNY.js → chunk-TWTZKA46.js} +3 -3
- package/dist/chunks/{chunk-K7YZJV2X.js → chunk-U3OY3T54.js} +34 -16
- package/dist/chunks/chunk-U3OY3T54.js.map +6 -0
- package/dist/chunks/{chunk-MF3SFDBW.js → chunk-U6DACADN.js} +3 -3
- package/dist/chunks/chunk-UBDKPN27.js +150 -0
- package/dist/chunks/chunk-UBDKPN27.js.map +6 -0
- package/dist/chunks/{chunk-75YLZNZW.js → chunk-UDSY3L6M.js} +3 -3
- package/dist/chunks/{chunk-WPGVZMSU.js → chunk-UOU7PGPZ.js} +2 -2
- package/dist/chunks/{chunk-TSOZBRM6.js → chunk-UY5KPN7B.js} +2 -2
- package/dist/chunks/{chunk-DEAG4G5J.js → chunk-V3DMBRE3.js} +2 -2
- package/dist/chunks/{chunk-QBLHOG2F.js → chunk-V5K2AOLI.js} +3 -3
- package/dist/chunks/{chunk-TTFPWGIU.js → chunk-VAJPCN3B.js} +2 -2
- package/dist/chunks/{chunk-JECLB23L.js → chunk-VIURZHCB.js} +6 -6
- package/dist/chunks/{chunk-IQ44C7Y3.js → chunk-VOR32IWQ.js} +4 -4
- package/dist/chunks/{chunk-XNQY26AE.js → chunk-W3BDNKTN.js} +4 -4
- package/dist/chunks/{chunk-JRBFL6WT.js → chunk-W5GDQFZS.js} +2 -2
- package/dist/chunks/{chunk-FVIKYFYD.js → chunk-XWGWQBF7.js} +2 -2
- package/dist/chunks/{chunk-KSRN5Y2O.js → chunk-Y2HHHKBF.js} +165 -79
- package/dist/chunks/chunk-Y2HHHKBF.js.map +6 -0
- package/dist/chunks/{chunk-PLCWCIL4.js → chunk-Y5NGMUDN.js} +2 -2
- package/dist/chunks/{chunk-TMPP2DEY.js → chunk-YCODODZO.js} +4 -4
- package/dist/chunks/{chunk-HG2PPCAE.js → chunk-YENBRA7T.js} +3 -3
- package/dist/chunks/{chunk-HCQGZPVT.js → chunk-YHUAVEOM.js} +2 -2
- package/dist/chunks/{chunk-4ENL4VUO.js → chunk-YPNF7YFU.js} +4 -4
- package/dist/chunks/{chunk-IL4Y3JGT.js → chunk-ZCDOMHZU.js} +13 -13
- package/dist/chunks/{chunk-BNLIRJ3M.js → chunk-ZPOMLH5G.js} +4 -4
- package/dist/chunks/{cli-runtime-ZJKKIW4H.js → cli-runtime-5IXM6W6M.js} +22 -22
- package/dist/chunks/{commands-TQH5DD22.js → commands-LOMIOXZ3.js} +6 -6
- package/dist/chunks/{config-APYUJ5UW.js → config-UBOJ3N77.js} +12 -12
- package/dist/chunks/{cost-5YV27U7F.js → cost-LM34ZHBI.js} +5 -5
- package/dist/chunks/{crash-report-QVXU2YVL.js → crash-report-PTHJP6ZC.js} +6 -6
- package/dist/chunks/{dist-AOT4CEP5.js → dist-3P6YD6AW.js} +2 -2
- package/dist/chunks/{dist-H7CAJ3ZW.js → dist-3W2E4ZVU.js} +16 -2
- package/dist/chunks/{dist-Z2HW2SJR.js → dist-C7M5OJAH.js} +2 -2
- package/dist/chunks/{dist-2FSOLP72.js → dist-HJYAXRBL.js} +2 -2
- package/dist/chunks/{dist-IZGKRIWL.js → dist-LZAIP6RQ.js} +2 -2
- package/dist/chunks/{dist-J4UXFVYR.js → dist-TEFBDQUK.js} +2 -2
- package/dist/chunks/{dist-PZYMYR7N.js → dist-Y4YXKFL6.js} +3 -3
- package/dist/chunks/{dist-JHKRSGW6.js → dist-ZVUIWK64.js} +2 -2
- package/dist/chunks/{doctor-CM6UPXG5.js → doctor-LL6FW4DE.js} +40 -40
- package/dist/chunks/{drain-X6RURKKC.js → drain-AX2SKGAZ.js} +31 -31
- package/dist/chunks/drain-AX2SKGAZ.js.map +6 -0
- package/dist/chunks/{entry-QQDPY6ZL.js → entry-QT6CMKBN.js} +6 -6
- package/dist/chunks/{eval-GZA22B4I.js → eval-HKAAPPGO.js} +9 -9
- package/dist/chunks/{exec-3NE75Z6E.js → exec-DY3B5KGJ.js} +98 -52
- package/dist/chunks/exec-DY3B5KGJ.js.map +6 -0
- package/dist/chunks/{extension-N5IQNKVZ.js → extension-55PWXBQY.js} +6 -6
- package/dist/chunks/{home-I4FIB6FV.js → home-7KXFLNBX.js} +3 -3
- package/dist/chunks/{homes-WTMMXQ6G.js → homes-WYHCCBK6.js} +5 -5
- package/dist/chunks/{hooks-R42OTZDT.js → hooks-UZ46HYL4.js} +22 -22
- package/dist/chunks/{hooks-report-K6VOPVBR.js → hooks-report-RD53ZGON.js} +18 -18
- package/dist/chunks/{host-65UFBZJV.js → host-NUIEARM2.js} +11 -10
- package/dist/chunks/host-queries-OB7OWZI6.js +37 -0
- package/dist/chunks/{installed-list-7QIWVKLQ.js → installed-list-T3G757YK.js} +4 -4
- package/dist/chunks/{learn-NZXLKYV4.js → learn-MTQXTX6E.js} +17 -17
- package/dist/chunks/{learn-builtin-RC4XXVBS.js → learn-builtin-3SXUVV7J.js} +20 -20
- package/dist/chunks/{lifecycle-NLCZ6OPA.js → lifecycle-MFXCFSJP.js} +33 -30
- package/dist/chunks/{list-2U67CAWS.js → list-M6Y24N5J.js} +18 -18
- package/dist/chunks/{live-CWJ2NWUQ.js → live-UNUQSBVZ.js} +39 -39
- package/dist/chunks/{load-H52QQBVE.js → load-GA4OIEG4.js} +9 -9
- package/dist/chunks/{logs-ZIW3QFU4.js → logs-LUPWFBWF.js} +4 -4
- package/dist/chunks/{mcp-FNSMEMCM.js → mcp-4GD5Y5W7.js} +98 -36
- package/dist/chunks/mcp-4GD5Y5W7.js.map +6 -0
- package/dist/chunks/{mcp-serve-ZC2OKIPP.js → mcp-serve-RQKZQNPI.js} +17 -17
- package/dist/chunks/{message-command-IHZWL5GI.js → message-command-L5HAX56P.js} +59 -59
- package/dist/chunks/{open-AHDQMVXI.js → open-D6QESFR2.js} +7 -7
- package/dist/chunks/{operator-tools-P5R4TF6N.js → operator-tools-CFYHXAZS.js} +15 -15
- package/dist/chunks/{output-schema-Q5RWHNKE.js → output-schema-WV5RUG66.js} +3 -3
- package/dist/chunks/{pal-T42HU4AK.js → pal-JVR6ZLEI.js} +15 -15
- package/dist/chunks/{peers-5RYEA7IA.js → peers-EK24T2HF.js} +8 -7
- package/dist/chunks/{peers-7ZG3DEBO.js → peers-NCDTNFJV.js} +20 -19
- package/dist/chunks/peers-NCDTNFJV.js.map +6 -0
- package/dist/chunks/{plugin-DGEINYG5.js → plugin-RR4O7D6C.js} +108 -52
- package/dist/chunks/plugin-RR4O7D6C.js.map +6 -0
- package/dist/chunks/{providers-I24HYZXG.js → providers-2CLIPXQ2.js} +10 -10
- package/dist/chunks/{providers-BXXIM7EW.js → providers-RTRULUUS.js} +17 -17
- package/dist/chunks/{pty-WVKM6ATI.js → pty-OHLKFJFA.js} +3 -3
- package/dist/chunks/resume-5OWRUFUL.js +25 -0
- package/dist/chunks/{resume-command-4I47WN7T.js → resume-command-HIIEMJAT.js} +4 -4
- package/dist/chunks/{running-VID6BVT2.js → running-3BAWMUK4.js} +4 -4
- package/dist/chunks/{schedule-75IZH76Z.js → schedule-OW54ANKO.js} +12 -12
- package/dist/chunks/{send-QRYY2NCG.js → send-5NIU4WFY.js} +20 -19
- package/dist/chunks/send-person-RYBIVAML.js +33 -0
- package/dist/chunks/{service-B6BNESZB.js → service-MGZ4LEVY.js} +33 -30
- package/dist/chunks/service-MGZ4LEVY.js.map +6 -0
- package/dist/chunks/{setting-cli-O4YWOIU5.js → setting-cli-CHPHJSAM.js} +12 -12
- package/dist/chunks/{skills-PEMVX5C3.js → skills-6DNVYWKR.js} +26 -26
- package/dist/chunks/{start-check-EKRXJ5VE.js → start-check-MHUGGAYJ.js} +2 -2
- package/dist/chunks/{startup-failure-2UJKPNMR.js → startup-failure-R2AIVZYU.js} +2 -2
- package/dist/chunks/{state-X3MKUFYM.js → state-2WEGEDJ5.js} +19 -19
- package/dist/chunks/{store-VRKKFOYW.js → store-MCRRV4BB.js} +3 -3
- package/dist/chunks/{store-QFNY4BV4.js → store-RITSVC5A.js} +4 -4
- package/dist/chunks/{store-MK5IYBE5.js → store-UFRLA47W.js} +8 -8
- package/dist/chunks/{store-4OXWHFS5.js → store-WH3C3EPV.js} +12 -12
- package/dist/chunks/{tui-MI72TUST.js → tui-5QS4AAMU.js} +98 -96
- package/dist/chunks/tui-5QS4AAMU.js.map +6 -0
- package/dist/chunks/{update-ELZEXYIX.js → update-3VXQAKVL.js} +8 -8
- package/dist/chunks/{watch-HPINGMZZ.js → watch-PMFTONTW.js} +102 -100
- package/dist/chunks/watch-PMFTONTW.js.map +6 -0
- package/dist/chunks/{workspaces-3LB4SPPS.js → workspaces-N7A3JNL4.js} +16 -15
- package/dist/chunks/workspaces-N7A3JNL4.js.map +6 -0
- package/dist/chunks/{worktree-5CWUUWNO.js → worktree-6L5FLMVI.js} +24 -24
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/acp.d.ts +8 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/desktop-host-plugins.d.ts +28 -1
- package/dist/commands/desktop-host-plugins.d.ts.map +1 -1
- package/dist/commands/desktop-host.d.ts +20 -1
- package/dist/commands/desktop-host.d.ts.map +1 -1
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/exec-browser.d.ts +19 -0
- package/dist/commands/exec-browser.d.ts.map +1 -0
- package/dist/commands/exec-flags.d.ts +11 -2
- package/dist/commands/exec-flags.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/mcp.d.ts +16 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/plugin-install.d.ts +6 -0
- package/dist/commands/plugin-install.d.ts.map +1 -1
- package/dist/commands/plugin-records.d.ts +3 -0
- package/dist/commands/plugin-records.d.ts.map +1 -1
- package/dist/commands/plugin.d.ts.map +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/schema.d.ts +29 -3
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/session-options.d.ts +116 -0
- package/dist/config/session-options.d.ts.map +1 -1
- package/dist/config/settings-descriptors.d.ts.map +1 -1
- package/dist/index.js +40 -40
- package/dist/integrations/archive/zip.d.ts +8 -1
- package/dist/integrations/archive/zip.d.ts.map +1 -1
- package/dist/integrations/mcp/plugin-remote.d.ts +4 -0
- package/dist/integrations/mcp/plugin-remote.d.ts.map +1 -1
- package/dist/integrations/peers/process-ancestry.d.ts +10 -0
- package/dist/integrations/peers/process-ancestry.d.ts.map +1 -1
- package/dist/integrations/plugins/fetch/archive.d.ts.map +1 -1
- package/dist/integrations/plugins/fetch/git.d.ts +13 -3
- package/dist/integrations/plugins/fetch/git.d.ts.map +1 -1
- package/dist/integrations/plugins/fetch/policy.d.ts +40 -0
- package/dist/integrations/plugins/fetch/policy.d.ts.map +1 -0
- package/dist/integrations/plugins/fetch/source.d.ts +8 -10
- package/dist/integrations/plugins/fetch/source.d.ts.map +1 -1
- package/dist/integrations/plugins/fetch/url.d.ts +16 -4
- package/dist/integrations/plugins/fetch/url.d.ts.map +1 -1
- package/dist/integrations/plugins/files.d.ts.map +1 -1
- package/dist/integrations/plugins/install-manifest.d.ts +11 -0
- package/dist/integrations/plugins/install-manifest.d.ts.map +1 -1
- package/dist/integrations/plugins/install-plan.d.ts.map +1 -1
- package/dist/integrations/plugins/install-preview.d.ts +1 -2
- package/dist/integrations/plugins/install-preview.d.ts.map +1 -1
- package/dist/integrations/plugins/install.d.ts.map +1 -1
- package/dist/integrations/plugins/installed-source.d.ts +25 -0
- package/dist/integrations/plugins/installed-source.d.ts.map +1 -1
- package/dist/integrations/plugins/inventory.d.ts.map +1 -1
- package/dist/integrations/plugins/remote-marketplace.d.ts +16 -2
- package/dist/integrations/plugins/remote-marketplace.d.ts.map +1 -1
- package/dist/integrations/plugins/runtime.d.ts.map +1 -1
- package/dist/integrations/plugins/surface.d.ts +3 -1
- package/dist/integrations/plugins/surface.d.ts.map +1 -1
- package/dist/integrations/plugins/update-compare.d.ts +3 -3
- package/dist/integrations/plugins/update-compare.d.ts.map +1 -1
- package/dist/integrations/plugins/validate.d.ts.map +1 -1
- package/dist/integrations/workflows/guidance.d.ts +12 -0
- package/dist/integrations/workflows/guidance.d.ts.map +1 -0
- package/dist/integrations/workflows/host.d.ts +3 -0
- package/dist/integrations/workflows/host.d.ts.map +1 -1
- package/dist/integrations/workflows/offering.d.ts +16 -1
- package/dist/integrations/workflows/offering.d.ts.map +1 -1
- package/dist/integrations/workflows/size.d.ts +17 -3
- package/dist/integrations/workflows/size.d.ts.map +1 -1
- package/dist/permissions/auto-classifier.d.ts.map +1 -1
- package/dist/permissions/send-floor.d.ts +7 -0
- package/dist/permissions/send-floor.d.ts.map +1 -1
- package/dist/reminders/hypermode.d.ts +6 -0
- package/dist/reminders/hypermode.d.ts.map +1 -1
- package/dist/reminders/index.d.ts +1 -0
- package/dist/reminders/index.d.ts.map +1 -1
- package/dist/schedule/fire/fire.d.ts.map +1 -1
- package/dist/schedule/policy.d.ts.map +1 -1
- package/dist/skills/skill-shell.d.ts +9 -5
- package/dist/skills/skill-shell.d.ts.map +1 -1
- package/dist/tui/AgentExplorer.d.ts +3 -2
- package/dist/tui/AgentExplorer.d.ts.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/BackgroundJobsPanel.d.ts.map +1 -1
- package/dist/tui/ColouredText.d.ts +11 -0
- package/dist/tui/ColouredText.d.ts.map +1 -0
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/Transcript.d.ts +7 -1
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/agent-tokens.d.ts +7 -0
- package/dist/tui/agent-tokens.d.ts.map +1 -1
- package/dist/tui/agent-transcript-rows.d.ts +5 -1
- package/dist/tui/agent-transcript-rows.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +31 -4
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/computer-use-screen-approval.d.ts +11 -1
- package/dist/tui/computer-use-screen-approval.d.ts.map +1 -1
- package/dist/tui/job-result-footer.d.ts +6 -1
- package/dist/tui/job-result-footer.d.ts.map +1 -1
- package/dist/tui/model-selection-intent.d.ts +5 -1
- package/dist/tui/model-selection-intent.d.ts.map +1 -1
- package/dist/tui/sgr-colour.d.ts +46 -0
- package/dist/tui/sgr-colour.d.ts.map +1 -0
- package/dist/tui/shell-cell.d.ts +1 -0
- package/dist/tui/shell-cell.d.ts.map +1 -1
- package/dist/tui/tidy-tool-output.d.ts +3 -3
- package/dist/tui/tidy-tool-output.d.ts.map +1 -1
- package/dist/tui/tool-end-rows.d.ts +2 -0
- package/dist/tui/tool-end-rows.d.ts.map +1 -1
- package/dist/tui/transcript-screen.d.ts.map +1 -1
- package/dist/tui/transcript-scroll.d.ts.map +1 -1
- package/package.json +4 -4
- package/skills/README.md +5 -0
- package/skills/workflow-authoring/SKILL.md +101 -0
- package/dist/chunks/acp-6R4I2A3Q.js.map +0 -6
- package/dist/chunks/agent-session-D6JIOCON.js +0 -95
- package/dist/chunks/chunk-2DCOB33W.js.map +0 -6
- package/dist/chunks/chunk-32OIBGYI.js.map +0 -6
- package/dist/chunks/chunk-42JIZXVL.js.map +0 -6
- package/dist/chunks/chunk-BJT37HR4.js.map +0 -6
- package/dist/chunks/chunk-BZR5PIFF.js.map +0 -6
- package/dist/chunks/chunk-C7E7YCRD.js.map +0 -6
- package/dist/chunks/chunk-EBBT2I5S.js.map +0 -6
- package/dist/chunks/chunk-EXJJLYZK.js.map +0 -6
- package/dist/chunks/chunk-FK4MAZV2.js.map +0 -6
- package/dist/chunks/chunk-FMD4REZQ.js.map +0 -6
- package/dist/chunks/chunk-IMMUS7IW.js.map +0 -6
- package/dist/chunks/chunk-JJ72TLOA.js.map +0 -6
- package/dist/chunks/chunk-K7YZJV2X.js.map +0 -6
- package/dist/chunks/chunk-KF6IKSF2.js +0 -472
- package/dist/chunks/chunk-KF6IKSF2.js.map +0 -6
- package/dist/chunks/chunk-KSRN5Y2O.js.map +0 -6
- package/dist/chunks/chunk-O4EILTV6.js.map +0 -6
- package/dist/chunks/chunk-QQ4S6MNH.js.map +0 -6
- package/dist/chunks/chunk-RMOTHWPV.js.map +0 -6
- package/dist/chunks/chunk-Z5OG4HXI.js.map +0 -6
- package/dist/chunks/drain-X6RURKKC.js.map +0 -6
- package/dist/chunks/exec-3NE75Z6E.js.map +0 -6
- package/dist/chunks/host-queries-L4PYE2BW.js +0 -37
- package/dist/chunks/mcp-FNSMEMCM.js.map +0 -6
- package/dist/chunks/peers-7ZG3DEBO.js.map +0 -6
- package/dist/chunks/plugin-DGEINYG5.js.map +0 -6
- package/dist/chunks/resume-F7JEDBHI.js +0 -25
- package/dist/chunks/send-person-VADQNJBN.js +0 -32
- package/dist/chunks/service-B6BNESZB.js.map +0 -6
- package/dist/chunks/tui-MI72TUST.js.map +0 -6
- package/dist/chunks/watch-HPINGMZZ.js.map +0 -6
- package/dist/chunks/workspaces-3LB4SPPS.js.map +0 -6
- /package/dist/chunks/{activity-command-JU4HLIQJ.js.map → activity-command-PXOMQCVV.js.map} +0 -0
- /package/dist/chunks/{add-S6JYKDI4.js.map → add-HIIKDZDN.js.map} +0 -0
- /package/dist/chunks/{agent-E343AQV7.js.map → agent-5OM6GGWO.js.map} +0 -0
- /package/dist/chunks/{agent-session-D6JIOCON.js.map → agent-session-MNEGO6RD.js.map} +0 -0
- /package/dist/chunks/{apply-at-exit-MEOJMGNT.js.map → apply-at-exit-2TUEV3TN.js.map} +0 -0
- /package/dist/chunks/{archive-ZPWC7GZU.js.map → archive-ESYECN4Y.js.map} +0 -0
- /package/dist/chunks/{auth-6NX4TMIG.js.map → auth-WA6ZXNXM.js.map} +0 -0
- /package/dist/chunks/{bin-main-P3KAQDKC.js.map → bin-main-Y5FDOG2X.js.map} +0 -0
- /package/dist/chunks/{binding-6QZVGFQ5.js.map → binding-7ZF533IJ.js.map} +0 -0
- /package/dist/chunks/{browser-KK2U5524.js.map → browser-HFAVORW3.js.map} +0 -0
- /package/dist/chunks/{chat-VEXJRSZN.js.map → chat-BVA2BLKE.js.map} +0 -0
- /package/dist/chunks/{chunk-PS5SVAUJ.js.map → chunk-2SXME4FG.js.map} +0 -0
- /package/dist/chunks/{chunk-VQZPXK4X.js.map → chunk-2ZA7XJ63.js.map} +0 -0
- /package/dist/chunks/{chunk-452SL2Y4.js.map → chunk-3CEL5P45.js.map} +0 -0
- /package/dist/chunks/{chunk-N5CCXOYK.js.map → chunk-3DCQNM64.js.map} +0 -0
- /package/dist/chunks/{chunk-4KVYTHY7.js.map → chunk-3KCGBW3F.js.map} +0 -0
- /package/dist/chunks/{chunk-66QIFMEO.js.map → chunk-3RDKZZQE.js.map} +0 -0
- /package/dist/chunks/{chunk-ZHEEG3NS.js.map → chunk-5KRUNLE7.js.map} +0 -0
- /package/dist/chunks/{chunk-PE4MWWUW.js.map → chunk-5M44QX4G.js.map} +0 -0
- /package/dist/chunks/{chunk-SXONHO4H.js.map → chunk-65ROGOIM.js.map} +0 -0
- /package/dist/chunks/{chunk-HM7L5PM2.js.map → chunk-65ZRPJA5.js.map} +0 -0
- /package/dist/chunks/{chunk-BA7KUG6V.js.map → chunk-6FGEPFFB.js.map} +0 -0
- /package/dist/chunks/{chunk-44YG6EI4.js.map → chunk-6UWOG6FY.js.map} +0 -0
- /package/dist/chunks/{chunk-AMYP2WPW.js.map → chunk-752F23K2.js.map} +0 -0
- /package/dist/chunks/{chunk-DRSQTKDN.js.map → chunk-7BRCXPI3.js.map} +0 -0
- /package/dist/chunks/{chunk-WOTA5FO5.js.map → chunk-7TPWEPUT.js.map} +0 -0
- /package/dist/chunks/{chunk-PRJO4XM3.js.map → chunk-A42WH5C5.js.map} +0 -0
- /package/dist/chunks/{chunk-F5W4TNCR.js.map → chunk-AHV6BJED.js.map} +0 -0
- /package/dist/chunks/{chunk-4CJ3HPOT.js.map → chunk-AYD4H6VV.js.map} +0 -0
- /package/dist/chunks/{chunk-J4PL65DJ.js.map → chunk-C3KDKOUV.js.map} +0 -0
- /package/dist/chunks/{chunk-VWUTJ4EU.js.map → chunk-CJBRIESJ.js.map} +0 -0
- /package/dist/chunks/{chunk-YWRRS7SO.js.map → chunk-COOEFXWT.js.map} +0 -0
- /package/dist/chunks/{chunk-NVWD5XDT.js.map → chunk-DAZEYCY5.js.map} +0 -0
- /package/dist/chunks/{chunk-4Y242BU4.js.map → chunk-DL5KZGQK.js.map} +0 -0
- /package/dist/chunks/{chunk-RQAY7REG.js.map → chunk-EDAEDZ37.js.map} +0 -0
- /package/dist/chunks/{chunk-R6M6EIAH.js.map → chunk-EEBDKNNP.js.map} +0 -0
- /package/dist/chunks/{chunk-GT22EDUB.js.map → chunk-EOLSGOXC.js.map} +0 -0
- /package/dist/chunks/{chunk-O45DCUNX.js.map → chunk-EYFAHVYO.js.map} +0 -0
- /package/dist/chunks/{chunk-NKHEBASJ.js.map → chunk-EZYMBETQ.js.map} +0 -0
- /package/dist/chunks/{chunk-ME4LETA3.js.map → chunk-F5AHQ4RX.js.map} +0 -0
- /package/dist/chunks/{chunk-MUSGZEFY.js.map → chunk-F5SG7JPB.js.map} +0 -0
- /package/dist/chunks/{chunk-MK42KB72.js.map → chunk-FHKPEPTE.js.map} +0 -0
- /package/dist/chunks/{chunk-XDUA6PBP.js.map → chunk-FHP4D55L.js.map} +0 -0
- /package/dist/chunks/{chunk-WDKAL7EW.js.map → chunk-FIEADS4A.js.map} +0 -0
- /package/dist/chunks/{chunk-K2EKXCLZ.js.map → chunk-G5NS6ASX.js.map} +0 -0
- /package/dist/chunks/{chunk-I4RC6KQQ.js.map → chunk-GS7ST2VG.js.map} +0 -0
- /package/dist/chunks/{chunk-XE6XT6R6.js.map → chunk-GSNTXEOD.js.map} +0 -0
- /package/dist/chunks/{chunk-H6NTNPWD.js.map → chunk-HGBVFYQT.js.map} +0 -0
- /package/dist/chunks/{chunk-D2R47LDH.js.map → chunk-HIJXZ6FI.js.map} +0 -0
- /package/dist/chunks/{chunk-5F4DSPZC.js.map → chunk-HLYITQWD.js.map} +0 -0
- /package/dist/chunks/{chunk-QCV3HH4P.js.map → chunk-HX3ENA3I.js.map} +0 -0
- /package/dist/chunks/{chunk-HKRUNZVI.js.map → chunk-IWVJDG4L.js.map} +0 -0
- /package/dist/chunks/{chunk-PZWSRAE7.js.map → chunk-J2ITWYQQ.js.map} +0 -0
- /package/dist/chunks/{chunk-4BNCVR3U.js.map → chunk-JR3LFDKN.js.map} +0 -0
- /package/dist/chunks/{chunk-TBJ6XU3T.js.map → chunk-KDOBJGF2.js.map} +0 -0
- /package/dist/chunks/{chunk-QNJXULU7.js.map → chunk-KKHZG7B2.js.map} +0 -0
- /package/dist/chunks/{chunk-6W3UGXGG.js.map → chunk-KTSPKGEC.js.map} +0 -0
- /package/dist/chunks/{chunk-BURGRQWO.js.map → chunk-KXBZ7P2A.js.map} +0 -0
- /package/dist/chunks/{chunk-4473VICE.js.map → chunk-KZ5XYWKO.js.map} +0 -0
- /package/dist/chunks/{chunk-F7KOBJVW.js.map → chunk-LLVZON4J.js.map} +0 -0
- /package/dist/chunks/{chunk-B4AOCHH6.js.map → chunk-LNMFADLE.js.map} +0 -0
- /package/dist/chunks/{chunk-AC5P6W3G.js.map → chunk-ME7MQ4P2.js.map} +0 -0
- /package/dist/chunks/{chunk-FPC3K4TT.js.map → chunk-MHESN2FM.js.map} +0 -0
- /package/dist/chunks/{chunk-SLTJNYOU.js.map → chunk-MKCZB324.js.map} +0 -0
- /package/dist/chunks/{chunk-5IGEQN7L.js.map → chunk-NE55T7GN.js.map} +0 -0
- /package/dist/chunks/{chunk-VG7245VJ.js.map → chunk-NI2YKSPW.js.map} +0 -0
- /package/dist/chunks/{chunk-AYMB4AOZ.js.map → chunk-NQVSTOUH.js.map} +0 -0
- /package/dist/chunks/{chunk-QGBR42TV.js.map → chunk-NVRUHQKC.js.map} +0 -0
- /package/dist/chunks/{chunk-PAUMCJPX.js.map → chunk-O3AEUU3Q.js.map} +0 -0
- /package/dist/chunks/{chunk-4DSUVT37.js.map → chunk-OG7MBIKO.js.map} +0 -0
- /package/dist/chunks/{chunk-NBJ5PRAY.js.map → chunk-OGMRGX5M.js.map} +0 -0
- /package/dist/chunks/{chunk-WJ6QRVL6.js.map → chunk-PFQQ6YFF.js.map} +0 -0
- /package/dist/chunks/{chunk-CXW7I2S3.js.map → chunk-PHEL63BK.js.map} +0 -0
- /package/dist/chunks/{chunk-YR3TWNIV.js.map → chunk-PJORD4FZ.js.map} +0 -0
- /package/dist/chunks/{chunk-5ZLKTFU2.js.map → chunk-PSUJIMQV.js.map} +0 -0
- /package/dist/chunks/{chunk-TBGKPWCL.js.map → chunk-PWSMXR6B.js.map} +0 -0
- /package/dist/chunks/{chunk-PRRX5LNR.js.map → chunk-PYFAJB35.js.map} +0 -0
- /package/dist/chunks/{chunk-BWD2TUI4.js.map → chunk-PYFGTXFQ.js.map} +0 -0
- /package/dist/chunks/{chunk-BHQHTM3Z.js.map → chunk-QH4DQR57.js.map} +0 -0
- /package/dist/chunks/{chunk-TTKMQW6B.js.map → chunk-QR5VVGWU.js.map} +0 -0
- /package/dist/chunks/{chunk-UCML5ZXB.js.map → chunk-QR7GTBV3.js.map} +0 -0
- /package/dist/chunks/{chunk-T7ILM666.js.map → chunk-R5BEMFDZ.js.map} +0 -0
- /package/dist/chunks/{chunk-D4TXOX34.js.map → chunk-RQOE2MRO.js.map} +0 -0
- /package/dist/chunks/{chunk-6TUHWKXP.js.map → chunk-RZBIRLZ6.js.map} +0 -0
- /package/dist/chunks/{chunk-GTUTBTOV.js.map → chunk-SLLKDPGZ.js.map} +0 -0
- /package/dist/chunks/{chunk-6HYK4DDB.js.map → chunk-SXI6NW2H.js.map} +0 -0
- /package/dist/chunks/{chunk-R2KAESOM.js.map → chunk-SYJRI5A4.js.map} +0 -0
- /package/dist/chunks/{chunk-RKKU2RE4.js.map → chunk-T26HDLQS.js.map} +0 -0
- /package/dist/chunks/{chunk-WYA4QWWE.js.map → chunk-TBQQRYS2.js.map} +0 -0
- /package/dist/chunks/{chunk-GPTYDM26.js.map → chunk-TQZSXYON.js.map} +0 -0
- /package/dist/chunks/{chunk-D6PB3Z7Q.js.map → chunk-TSN7J4ZH.js.map} +0 -0
- /package/dist/chunks/{chunk-PZLPACNY.js.map → chunk-TWTZKA46.js.map} +0 -0
- /package/dist/chunks/{chunk-MF3SFDBW.js.map → chunk-U6DACADN.js.map} +0 -0
- /package/dist/chunks/{chunk-75YLZNZW.js.map → chunk-UDSY3L6M.js.map} +0 -0
- /package/dist/chunks/{chunk-WPGVZMSU.js.map → chunk-UOU7PGPZ.js.map} +0 -0
- /package/dist/chunks/{chunk-TSOZBRM6.js.map → chunk-UY5KPN7B.js.map} +0 -0
- /package/dist/chunks/{chunk-DEAG4G5J.js.map → chunk-V3DMBRE3.js.map} +0 -0
- /package/dist/chunks/{chunk-QBLHOG2F.js.map → chunk-V5K2AOLI.js.map} +0 -0
- /package/dist/chunks/{chunk-TTFPWGIU.js.map → chunk-VAJPCN3B.js.map} +0 -0
- /package/dist/chunks/{chunk-JECLB23L.js.map → chunk-VIURZHCB.js.map} +0 -0
- /package/dist/chunks/{chunk-IQ44C7Y3.js.map → chunk-VOR32IWQ.js.map} +0 -0
- /package/dist/chunks/{chunk-XNQY26AE.js.map → chunk-W3BDNKTN.js.map} +0 -0
- /package/dist/chunks/{chunk-JRBFL6WT.js.map → chunk-W5GDQFZS.js.map} +0 -0
- /package/dist/chunks/{chunk-FVIKYFYD.js.map → chunk-XWGWQBF7.js.map} +0 -0
- /package/dist/chunks/{chunk-PLCWCIL4.js.map → chunk-Y5NGMUDN.js.map} +0 -0
- /package/dist/chunks/{chunk-TMPP2DEY.js.map → chunk-YCODODZO.js.map} +0 -0
- /package/dist/chunks/{chunk-HG2PPCAE.js.map → chunk-YENBRA7T.js.map} +0 -0
- /package/dist/chunks/{chunk-HCQGZPVT.js.map → chunk-YHUAVEOM.js.map} +0 -0
- /package/dist/chunks/{chunk-4ENL4VUO.js.map → chunk-YPNF7YFU.js.map} +0 -0
- /package/dist/chunks/{chunk-IL4Y3JGT.js.map → chunk-ZCDOMHZU.js.map} +0 -0
- /package/dist/chunks/{chunk-BNLIRJ3M.js.map → chunk-ZPOMLH5G.js.map} +0 -0
- /package/dist/chunks/{cli-runtime-ZJKKIW4H.js.map → cli-runtime-5IXM6W6M.js.map} +0 -0
- /package/dist/chunks/{commands-TQH5DD22.js.map → commands-LOMIOXZ3.js.map} +0 -0
- /package/dist/chunks/{config-APYUJ5UW.js.map → config-UBOJ3N77.js.map} +0 -0
- /package/dist/chunks/{cost-5YV27U7F.js.map → cost-LM34ZHBI.js.map} +0 -0
- /package/dist/chunks/{crash-report-QVXU2YVL.js.map → crash-report-PTHJP6ZC.js.map} +0 -0
- /package/dist/chunks/{dist-AOT4CEP5.js.map → dist-3P6YD6AW.js.map} +0 -0
- /package/dist/chunks/{dist-H7CAJ3ZW.js.map → dist-3W2E4ZVU.js.map} +0 -0
- /package/dist/chunks/{dist-Z2HW2SJR.js.map → dist-C7M5OJAH.js.map} +0 -0
- /package/dist/chunks/{dist-2FSOLP72.js.map → dist-HJYAXRBL.js.map} +0 -0
- /package/dist/chunks/{dist-IZGKRIWL.js.map → dist-LZAIP6RQ.js.map} +0 -0
- /package/dist/chunks/{dist-J4UXFVYR.js.map → dist-TEFBDQUK.js.map} +0 -0
- /package/dist/chunks/{dist-PZYMYR7N.js.map → dist-Y4YXKFL6.js.map} +0 -0
- /package/dist/chunks/{dist-JHKRSGW6.js.map → dist-ZVUIWK64.js.map} +0 -0
- /package/dist/chunks/{doctor-CM6UPXG5.js.map → doctor-LL6FW4DE.js.map} +0 -0
- /package/dist/chunks/{entry-QQDPY6ZL.js.map → entry-QT6CMKBN.js.map} +0 -0
- /package/dist/chunks/{eval-GZA22B4I.js.map → eval-HKAAPPGO.js.map} +0 -0
- /package/dist/chunks/{extension-N5IQNKVZ.js.map → extension-55PWXBQY.js.map} +0 -0
- /package/dist/chunks/{home-I4FIB6FV.js.map → home-7KXFLNBX.js.map} +0 -0
- /package/dist/chunks/{homes-WTMMXQ6G.js.map → homes-WYHCCBK6.js.map} +0 -0
- /package/dist/chunks/{hooks-R42OTZDT.js.map → hooks-UZ46HYL4.js.map} +0 -0
- /package/dist/chunks/{hooks-report-K6VOPVBR.js.map → hooks-report-RD53ZGON.js.map} +0 -0
- /package/dist/chunks/{host-65UFBZJV.js.map → host-NUIEARM2.js.map} +0 -0
- /package/dist/chunks/{host-queries-L4PYE2BW.js.map → host-queries-OB7OWZI6.js.map} +0 -0
- /package/dist/chunks/{installed-list-7QIWVKLQ.js.map → installed-list-T3G757YK.js.map} +0 -0
- /package/dist/chunks/{learn-NZXLKYV4.js.map → learn-MTQXTX6E.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-RC4XXVBS.js.map → learn-builtin-3SXUVV7J.js.map} +0 -0
- /package/dist/chunks/{lifecycle-NLCZ6OPA.js.map → lifecycle-MFXCFSJP.js.map} +0 -0
- /package/dist/chunks/{list-2U67CAWS.js.map → list-M6Y24N5J.js.map} +0 -0
- /package/dist/chunks/{live-CWJ2NWUQ.js.map → live-UNUQSBVZ.js.map} +0 -0
- /package/dist/chunks/{load-H52QQBVE.js.map → load-GA4OIEG4.js.map} +0 -0
- /package/dist/chunks/{logs-ZIW3QFU4.js.map → logs-LUPWFBWF.js.map} +0 -0
- /package/dist/chunks/{mcp-serve-ZC2OKIPP.js.map → mcp-serve-RQKZQNPI.js.map} +0 -0
- /package/dist/chunks/{message-command-IHZWL5GI.js.map → message-command-L5HAX56P.js.map} +0 -0
- /package/dist/chunks/{open-AHDQMVXI.js.map → open-D6QESFR2.js.map} +0 -0
- /package/dist/chunks/{operator-tools-P5R4TF6N.js.map → operator-tools-CFYHXAZS.js.map} +0 -0
- /package/dist/chunks/{output-schema-Q5RWHNKE.js.map → output-schema-WV5RUG66.js.map} +0 -0
- /package/dist/chunks/{pal-T42HU4AK.js.map → pal-JVR6ZLEI.js.map} +0 -0
- /package/dist/chunks/{peers-5RYEA7IA.js.map → peers-EK24T2HF.js.map} +0 -0
- /package/dist/chunks/{providers-I24HYZXG.js.map → providers-2CLIPXQ2.js.map} +0 -0
- /package/dist/chunks/{providers-BXXIM7EW.js.map → providers-RTRULUUS.js.map} +0 -0
- /package/dist/chunks/{pty-WVKM6ATI.js.map → pty-OHLKFJFA.js.map} +0 -0
- /package/dist/chunks/{resume-F7JEDBHI.js.map → resume-5OWRUFUL.js.map} +0 -0
- /package/dist/chunks/{resume-command-4I47WN7T.js.map → resume-command-HIIEMJAT.js.map} +0 -0
- /package/dist/chunks/{running-VID6BVT2.js.map → running-3BAWMUK4.js.map} +0 -0
- /package/dist/chunks/{schedule-75IZH76Z.js.map → schedule-OW54ANKO.js.map} +0 -0
- /package/dist/chunks/{send-QRYY2NCG.js.map → send-5NIU4WFY.js.map} +0 -0
- /package/dist/chunks/{send-person-VADQNJBN.js.map → send-person-RYBIVAML.js.map} +0 -0
- /package/dist/chunks/{setting-cli-O4YWOIU5.js.map → setting-cli-CHPHJSAM.js.map} +0 -0
- /package/dist/chunks/{skills-PEMVX5C3.js.map → skills-6DNVYWKR.js.map} +0 -0
- /package/dist/chunks/{start-check-EKRXJ5VE.js.map → start-check-MHUGGAYJ.js.map} +0 -0
- /package/dist/chunks/{startup-failure-2UJKPNMR.js.map → startup-failure-R2AIVZYU.js.map} +0 -0
- /package/dist/chunks/{state-X3MKUFYM.js.map → state-2WEGEDJ5.js.map} +0 -0
- /package/dist/chunks/{store-4OXWHFS5.js.map → store-MCRRV4BB.js.map} +0 -0
- /package/dist/chunks/{store-MK5IYBE5.js.map → store-RITSVC5A.js.map} +0 -0
- /package/dist/chunks/{store-QFNY4BV4.js.map → store-UFRLA47W.js.map} +0 -0
- /package/dist/chunks/{store-VRKKFOYW.js.map → store-WH3C3EPV.js.map} +0 -0
- /package/dist/chunks/{update-ELZEXYIX.js.map → update-3VXQAKVL.js.map} +0 -0
- /package/dist/chunks/{worktree-5CWUUWNO.js.map → worktree-6L5FLMVI.js.map} +0 -0
|
@@ -3,43 +3,56 @@ const require = __namzuCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
listMarkdownNames,
|
|
5
5
|
resolvePluginFileDirs
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6PEEUJSR.js";
|
|
7
7
|
import {
|
|
8
|
+
ENTRY_SIDECAR_KEEPS,
|
|
8
9
|
INSTALL_MANIFEST_VERSION,
|
|
10
|
+
LOCAL_UPLOADS_MARKETPLACE,
|
|
9
11
|
admissionScope,
|
|
10
12
|
currentEnabledAnswer,
|
|
13
|
+
describeSource,
|
|
14
|
+
gitUrlOf,
|
|
15
|
+
gitUrlProblem,
|
|
11
16
|
installManifestPath,
|
|
17
|
+
installedPluginRefusal,
|
|
18
|
+
installedRefusalText,
|
|
19
|
+
isBlockedSource,
|
|
20
|
+
isCommitId,
|
|
12
21
|
isConfigFile,
|
|
13
22
|
isExecutablePath,
|
|
14
23
|
isInsidePluginCache,
|
|
15
24
|
loadInstalledManifest,
|
|
25
|
+
manifestDigest,
|
|
26
|
+
readCatalog,
|
|
16
27
|
readInstallManifest,
|
|
17
28
|
readLayers,
|
|
18
29
|
readRecordLayer,
|
|
19
30
|
recordLayerPath,
|
|
31
|
+
repoPathProblem,
|
|
32
|
+
resolveEntrySource,
|
|
20
33
|
setEnabledPlugin,
|
|
21
34
|
setExtraKnownMarketplace,
|
|
22
35
|
sha256Hex,
|
|
36
|
+
sourceRefusal,
|
|
23
37
|
surfaceDigest,
|
|
24
38
|
verifyInstalledCopy
|
|
25
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-RYOZ4HYY.js";
|
|
26
40
|
import {
|
|
27
41
|
ArchiveError,
|
|
28
|
-
|
|
29
|
-
} from "./chunk-
|
|
42
|
+
eachArchiveFile
|
|
43
|
+
} from "./chunk-KDPGC66S.js";
|
|
30
44
|
import {
|
|
31
45
|
readPluginHookEntriesOf
|
|
32
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RZBIRLZ6.js";
|
|
33
47
|
import {
|
|
34
48
|
readSkillHooks
|
|
35
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-KDOBJGF2.js";
|
|
36
50
|
import {
|
|
37
51
|
PLUGIN_ID_PATTERN,
|
|
38
52
|
installManifestsFolder,
|
|
39
53
|
installedPluginDataFolder,
|
|
40
54
|
installedPluginsPath,
|
|
41
55
|
isPluginId,
|
|
42
|
-
isRecord,
|
|
43
56
|
isReservedPluginDir,
|
|
44
57
|
marketplacesFolder,
|
|
45
58
|
pluginCacheFolder,
|
|
@@ -52,10 +65,10 @@ import {
|
|
|
52
65
|
removeInstallRecord,
|
|
53
66
|
samePath,
|
|
54
67
|
splitPluginId
|
|
55
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-RQOE2MRO.js";
|
|
56
69
|
import {
|
|
57
70
|
parseSkillMarkdown
|
|
58
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-SXI6NW2H.js";
|
|
59
72
|
import {
|
|
60
73
|
EXIT_DATAERR,
|
|
61
74
|
EXIT_FAIL,
|
|
@@ -73,7 +86,7 @@ import {
|
|
|
73
86
|
StateFileUnreadableError,
|
|
74
87
|
unreadableStateFile,
|
|
75
88
|
withStateFileLock
|
|
76
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-AHV6BJED.js";
|
|
77
90
|
import {
|
|
78
91
|
COMMON_MANIFEST_DIR,
|
|
79
92
|
COMMON_MARKETPLACE_FILE,
|
|
@@ -82,22 +95,23 @@ import {
|
|
|
82
95
|
findCommonLayoutRoot,
|
|
83
96
|
hookModuleConsentEntry,
|
|
84
97
|
isHookEntriesPath,
|
|
85
|
-
isOfficialLookingMarketplaceName,
|
|
86
98
|
loadPluginManifest,
|
|
87
99
|
loadPluginManifestWithFindings,
|
|
88
100
|
locateHookModule,
|
|
89
101
|
parsePluginManifestText,
|
|
102
|
+
privateAddressProblem,
|
|
103
|
+
proxyConfigured,
|
|
90
104
|
readCommonLayout,
|
|
91
105
|
resolveWithinReal,
|
|
92
106
|
scanHookModule
|
|
93
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-EDLBZSB2.js";
|
|
94
108
|
import {
|
|
95
109
|
__name
|
|
96
110
|
} from "./chunk-76FLAFCG.js";
|
|
97
111
|
|
|
98
112
|
// src/commands/plugin-records.ts
|
|
99
|
-
import { lstatSync as
|
|
100
|
-
import { join as
|
|
113
|
+
import { lstatSync as lstatSync6, readdirSync as readdirSync5 } from "node:fs";
|
|
114
|
+
import { join as join8, resolve as resolve2 } from "node:path";
|
|
101
115
|
|
|
102
116
|
// src/integrations/plugins/manifest-details.ts
|
|
103
117
|
import { readFile, stat } from "node:fs/promises";
|
|
@@ -147,17 +161,16 @@ __name(readPluginManifestDetails, "readPluginManifestDetails");
|
|
|
147
161
|
|
|
148
162
|
// src/integrations/plugins/remote-marketplace.ts
|
|
149
163
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
150
|
-
import { lstatSync as
|
|
151
|
-
import { isAbsolute as
|
|
164
|
+
import { lstatSync as lstatSync5, mkdirSync as mkdirSync6, renameSync as renameSync3 } from "node:fs";
|
|
165
|
+
import { isAbsolute as isAbsolute2, join as join7, relative as relative2 } from "node:path";
|
|
152
166
|
|
|
153
167
|
// src/integrations/plugins/fetch/index.ts
|
|
154
|
-
import { lstatSync as lstatSync2, mkdirSync as mkdirSync3, writeFileSync
|
|
168
|
+
import { lstatSync as lstatSync2, mkdirSync as mkdirSync3, writeFileSync } from "node:fs";
|
|
155
169
|
import { join as join3 } from "node:path";
|
|
156
170
|
|
|
157
171
|
// src/integrations/plugins/fetch/archive.ts
|
|
158
|
-
import {
|
|
159
|
-
import {
|
|
160
|
-
import { dirname } from "node:path";
|
|
172
|
+
import { mkdirSync as mkdirSync2, rmSync as rmSync3 } from "node:fs";
|
|
173
|
+
import { dirname as dirname2 } from "node:path";
|
|
161
174
|
|
|
162
175
|
// src/integrations/plugins/fetch/git.ts
|
|
163
176
|
import { execFile, spawn } from "node:child_process";
|
|
@@ -172,322 +185,7 @@ import {
|
|
|
172
185
|
readdirSync,
|
|
173
186
|
rmSync
|
|
174
187
|
} from "node:fs";
|
|
175
|
-
import { join as join2 } from "node:path";
|
|
176
|
-
|
|
177
|
-
// src/integrations/plugins/fetch/source.ts
|
|
178
|
-
var NOT_AN_ADDRESS = "Not a marketplace address. Use owner/repo, an https:// address, or a folder path.";
|
|
179
|
-
var KNOWN_GIT_HOSTS = ["github.com", "gitlab.com", "bitbucket.org"];
|
|
180
|
-
var SCP_FORM = /^([A-Za-z0-9_][\w.-]*)@([A-Za-z0-9][\w.-]*):([^\s\\]+)$/;
|
|
181
|
-
var SHORTHAND = /^([\w][\w.-]*)\/([\w][\w.-]*?)(?:\.git)?(?:[#@](.+))?$/;
|
|
182
|
-
var COMMIT_ID = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
183
|
-
function isCommitId(value) {
|
|
184
|
-
return COMMIT_ID.test(value);
|
|
185
|
-
}
|
|
186
|
-
__name(isCommitId, "isCommitId");
|
|
187
|
-
function refProblem(ref) {
|
|
188
|
-
if (!/^[A-Za-z0-9_][A-Za-z0-9._/+-]{0,199}$/.test(ref) || ref.includes("..") || ref.includes("//") || ref.endsWith("/") || ref.endsWith(".") || ref.endsWith(".lock"))
|
|
189
|
-
return `"${ref}" is not a branch, tag or commit name Namzu will pass to Git.`;
|
|
190
|
-
return void 0;
|
|
191
|
-
}
|
|
192
|
-
__name(refProblem, "refProblem");
|
|
193
|
-
function repoPathProblem(path) {
|
|
194
|
-
if (path === "" || path.length > 300 || path.startsWith("/") || path.startsWith("-") || path.startsWith("~") || /^[A-Za-z]:/.test(path) || path.includes("\\") || // biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are what is refused
|
|
195
|
-
/[\u0000-\u001f\u007f]/.test(path) || path.split("/").some((part) => part === ".." || part === "." || part === ""))
|
|
196
|
-
return `"${path}" is not a folder inside the repository (no .., no absolute path).`;
|
|
197
|
-
return void 0;
|
|
198
|
-
}
|
|
199
|
-
__name(repoPathProblem, "repoPathProblem");
|
|
200
|
-
function splitRef(value) {
|
|
201
|
-
const at = value.indexOf("#");
|
|
202
|
-
if (at < 0) return { base: value };
|
|
203
|
-
return { base: value.slice(0, at), ref: value.slice(at + 1) };
|
|
204
|
-
}
|
|
205
|
-
__name(splitRef, "splitRef");
|
|
206
|
-
function parseRemoteAddress(input) {
|
|
207
|
-
const value = input.trim();
|
|
208
|
-
if (value === "" || value.startsWith("-") || /\s/.test(value))
|
|
209
|
-
return { ok: false, message: NOT_AN_ADDRESS };
|
|
210
|
-
const scp = SCP_FORM.exec(splitRef(value).base);
|
|
211
|
-
if (scp !== null) {
|
|
212
|
-
const { base, ref } = splitRef(value);
|
|
213
|
-
if (ref !== void 0) {
|
|
214
|
-
const problem = refProblem(ref);
|
|
215
|
-
if (problem !== void 0) return { ok: false, message: problem };
|
|
216
|
-
}
|
|
217
|
-
return {
|
|
218
|
-
ok: true,
|
|
219
|
-
form: "git",
|
|
220
|
-
source: { source: "git", url: base, ...ref !== void 0 ? { ref } : {} }
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
if (/^https:\/\//i.test(value)) return parseHttps(value);
|
|
224
|
-
const short = SHORTHAND.exec(value);
|
|
225
|
-
if (short !== null && !value.includes(":")) {
|
|
226
|
-
const [, owner, repo, ref] = short;
|
|
227
|
-
if (owner === "." || owner === ".." || repo === "." || repo === "..")
|
|
228
|
-
return { ok: false, message: NOT_AN_ADDRESS };
|
|
229
|
-
if (ref !== void 0) {
|
|
230
|
-
const problem = refProblem(ref);
|
|
231
|
-
if (problem !== void 0) return { ok: false, message: problem };
|
|
232
|
-
}
|
|
233
|
-
return {
|
|
234
|
-
ok: true,
|
|
235
|
-
form: "github",
|
|
236
|
-
source: { source: "github", repo: `${owner}/${repo}`, ...ref !== void 0 ? { ref } : {} }
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
if (value.includes("/") && !value.includes(":"))
|
|
240
|
-
return {
|
|
241
|
-
ok: false,
|
|
242
|
-
message: `'${value.slice(0, 80)}' is not a valid GitHub owner/repo shorthand. For a Git repository use its full https:// address. For a hosted marketplace.json use its https:// address. For a folder on this computer start with ./ or use an absolute path.`
|
|
243
|
-
};
|
|
244
|
-
return { ok: false, message: NOT_AN_ADDRESS };
|
|
245
|
-
}
|
|
246
|
-
__name(parseRemoteAddress, "parseRemoteAddress");
|
|
247
|
-
function parseHttps(value) {
|
|
248
|
-
const { base, ref } = splitRef(value);
|
|
249
|
-
let url;
|
|
250
|
-
try {
|
|
251
|
-
url = new URL(base);
|
|
252
|
-
} catch {
|
|
253
|
-
return { ok: false, message: NOT_AN_ADDRESS };
|
|
254
|
-
}
|
|
255
|
-
if (url.username !== "" || url.password !== "" || url.search !== "")
|
|
256
|
-
return {
|
|
257
|
-
ok: false,
|
|
258
|
-
message: "Remove the sign-in details from the address; Namzu uses your own Git setup."
|
|
259
|
-
};
|
|
260
|
-
if (ref !== void 0) {
|
|
261
|
-
const problem = refProblem(ref);
|
|
262
|
-
if (problem !== void 0) return { ok: false, message: problem };
|
|
263
|
-
}
|
|
264
|
-
const host = url.hostname.toLowerCase();
|
|
265
|
-
const path = url.pathname.replace(/\/+$/, "");
|
|
266
|
-
if (host === "github.com" && /\/(tree|blob)\//.test(path))
|
|
267
|
-
return {
|
|
268
|
-
ok: false,
|
|
269
|
-
message: "Use the repository address (owner/repo), not a page inside it."
|
|
270
|
-
};
|
|
271
|
-
const isGit = path.endsWith(".git") || path.includes("/_git/");
|
|
272
|
-
const hosted = KNOWN_GIT_HOSTS.includes(host) ? /^\/([\w.-]+)\/([\w.-]+?)(?:\.git)?$/.exec(path) : null;
|
|
273
|
-
if (hosted !== null && host === "github.com")
|
|
274
|
-
return {
|
|
275
|
-
ok: true,
|
|
276
|
-
form: "https",
|
|
277
|
-
source: {
|
|
278
|
-
source: "github",
|
|
279
|
-
repo: `${hosted[1]}/${hosted[2]}`,
|
|
280
|
-
...ref !== void 0 ? { ref } : {}
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
if (isGit || hosted !== null) {
|
|
284
|
-
const clean = hosted !== null ? `https://${host}/${hosted[1]}/${hosted[2]}.git` : `https://${host}${url.port ? `:${url.port}` : ""}${path}`;
|
|
285
|
-
return {
|
|
286
|
-
ok: true,
|
|
287
|
-
form: "https",
|
|
288
|
-
source: { source: "git", url: clean, ...ref !== void 0 ? { ref } : {} }
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
if (ref !== void 0)
|
|
292
|
-
return {
|
|
293
|
-
ok: false,
|
|
294
|
-
message: "A hosted marketplace.json address takes no #ref: it is one file, not a repository."
|
|
295
|
-
};
|
|
296
|
-
return {
|
|
297
|
-
ok: true,
|
|
298
|
-
form: "https",
|
|
299
|
-
source: { source: "url", url: `https://${host}${url.port ? `:${url.port}` : ""}${path}` }
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
__name(parseHttps, "parseHttps");
|
|
303
|
-
function gitUrlOf(source) {
|
|
304
|
-
return source.source === "github" ? `https://github.com/${source.repo}.git` : source.url;
|
|
305
|
-
}
|
|
306
|
-
__name(gitUrlOf, "gitUrlOf");
|
|
307
|
-
function describeSource(source) {
|
|
308
|
-
switch (source.source) {
|
|
309
|
-
case "github":
|
|
310
|
-
return `github.com/${String(source.repo)}`;
|
|
311
|
-
case "git":
|
|
312
|
-
case "url":
|
|
313
|
-
return String(source.url);
|
|
314
|
-
default:
|
|
315
|
-
return String(source.path ?? source.source);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
__name(describeSource, "describeSource");
|
|
319
|
-
function normalizeAddress(text2) {
|
|
320
|
-
let value = text2.trim();
|
|
321
|
-
const scp = /^[^@/\s]+@([^:/\s]+):\/?(.+)$/.exec(value);
|
|
322
|
-
let host;
|
|
323
|
-
let path;
|
|
324
|
-
if (scp !== null && !/^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
|
|
325
|
-
host = scp[1];
|
|
326
|
-
path = scp[2];
|
|
327
|
-
} else if (/^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
|
|
328
|
-
try {
|
|
329
|
-
const url = new URL(value);
|
|
330
|
-
host = url.hostname;
|
|
331
|
-
path = url.pathname;
|
|
332
|
-
} catch {
|
|
333
|
-
value = value.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "");
|
|
334
|
-
const at = value.indexOf("/");
|
|
335
|
-
host = at < 0 ? value : value.slice(0, at);
|
|
336
|
-
path = at < 0 ? "" : value.slice(at);
|
|
337
|
-
}
|
|
338
|
-
} else {
|
|
339
|
-
const at = value.indexOf("/");
|
|
340
|
-
host = at < 0 ? value : value.slice(0, at);
|
|
341
|
-
path = at < 0 ? "" : value.slice(at);
|
|
342
|
-
}
|
|
343
|
-
host = host.replace(/^[^@]*@/, "").replace(/:\d*$/, "").toLowerCase().replace(/\.+$/, "");
|
|
344
|
-
if (host.startsWith("www.") && KNOWN_GIT_HOSTS.includes(host.slice(4))) host = host.slice(4);
|
|
345
|
-
try {
|
|
346
|
-
path = decodeURIComponent(path);
|
|
347
|
-
} catch {
|
|
348
|
-
}
|
|
349
|
-
path = path.toLowerCase().replace(/\/{2,}/g, "/").replace(/\/+$/, "").replace(/\.git$/, "").replace(/\/+$/, "");
|
|
350
|
-
return `${host}${path.startsWith("/") || path === "" ? "" : "/"}${path}`;
|
|
351
|
-
}
|
|
352
|
-
__name(normalizeAddress, "normalizeAddress");
|
|
353
|
-
function sourceKey(source) {
|
|
354
|
-
if (source.source === "github") return normalizeAddress(`github.com/${String(source.repo)}`);
|
|
355
|
-
if (source.source === "git" || source.source === "url")
|
|
356
|
-
return normalizeAddress(String(source.url));
|
|
357
|
-
return void 0;
|
|
358
|
-
}
|
|
359
|
-
__name(sourceKey, "sourceKey");
|
|
360
|
-
function isBlockedSource(source, blocked) {
|
|
361
|
-
if (blocked === void 0 || blocked.length === 0) return false;
|
|
362
|
-
const key = sourceKey(source);
|
|
363
|
-
if (key === void 0) return false;
|
|
364
|
-
for (const raw of blocked) {
|
|
365
|
-
let entry = raw.trim().toLowerCase();
|
|
366
|
-
if (entry === "") continue;
|
|
367
|
-
const wildcard = entry.endsWith("/*");
|
|
368
|
-
if (wildcard) entry = entry.slice(0, -2);
|
|
369
|
-
const hasScheme = /^[a-z][a-z0-9+.-]*:\/\//.test(entry);
|
|
370
|
-
if (!hasScheme && !entry.split("/")[0]?.includes(".") && !entry.includes("@"))
|
|
371
|
-
entry = `github.com/${entry}`;
|
|
372
|
-
entry = normalizeAddress(entry);
|
|
373
|
-
if (entry === "") continue;
|
|
374
|
-
if (wildcard) {
|
|
375
|
-
if (key.startsWith(`${entry}/`)) return true;
|
|
376
|
-
} else if (!entry.includes("/")) {
|
|
377
|
-
if (key === entry || key.startsWith(`${entry}/`)) return true;
|
|
378
|
-
} else if (key === entry) return true;
|
|
379
|
-
}
|
|
380
|
-
return false;
|
|
381
|
-
}
|
|
382
|
-
__name(isBlockedSource, "isBlockedSource");
|
|
383
|
-
var SHA256 = /^[0-9a-f]{64}$/i;
|
|
384
|
-
function gitUrlProblem(url, allowFile) {
|
|
385
|
-
if (url.startsWith("-") || /\s/.test(url)) return "it is not a Git address";
|
|
386
|
-
if (SCP_FORM.test(url)) return void 0;
|
|
387
|
-
if (/^https:\/\//i.test(url) || /^ssh:\/\//i.test(url)) {
|
|
388
|
-
let parsed;
|
|
389
|
-
try {
|
|
390
|
-
parsed = new URL(url);
|
|
391
|
-
} catch {
|
|
392
|
-
return "it is not a Git address";
|
|
393
|
-
}
|
|
394
|
-
if (parsed.password !== "" || parsed.protocol === "https:" && parsed.username !== "")
|
|
395
|
-
return "it has sign-in details in it";
|
|
396
|
-
if (parsed.hostname === "" || parsed.hostname.startsWith("-")) return "it names no host";
|
|
397
|
-
if (parsed.protocol === "ssh:") {
|
|
398
|
-
let user = parsed.username;
|
|
399
|
-
try {
|
|
400
|
-
user = decodeURIComponent(user);
|
|
401
|
-
} catch {
|
|
402
|
-
return "it has sign-in details Namzu cannot read";
|
|
403
|
-
}
|
|
404
|
-
if (user.startsWith("-") || /[\u0000-\u001f\u007f\s]/.test(user))
|
|
405
|
-
return "its user name is not one Namzu will pass to Git";
|
|
406
|
-
}
|
|
407
|
-
return void 0;
|
|
408
|
-
}
|
|
409
|
-
if (allowFile && (url.startsWith("/") || /^file:\/\//i.test(url))) return void 0;
|
|
410
|
-
return "only https and ssh addresses are accepted";
|
|
411
|
-
}
|
|
412
|
-
__name(gitUrlProblem, "gitUrlProblem");
|
|
413
|
-
function parseEntrySource(name, source, entry, allowFile = false) {
|
|
414
|
-
const kind = typeof source.source === "string" ? source.source : "";
|
|
415
|
-
const invalid = /* @__PURE__ */ __name((reason) => ({ ok: false, unsupported: false, reason }), "invalid");
|
|
416
|
-
const text2 = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "" ? value : void 0, "text");
|
|
417
|
-
if (kind === "npm" || kind === "command" || kind === "")
|
|
418
|
-
return {
|
|
419
|
-
ok: false,
|
|
420
|
-
unsupported: true,
|
|
421
|
-
reason: `${name} is obtained by ${kind === "" ? "an unknown means" : kind}, which Namzu does not install: it would run a package manager or another program to get the code.`
|
|
422
|
-
};
|
|
423
|
-
if (kind !== "github" && kind !== "url" && kind !== "git" && kind !== "git-subdir" && kind !== "archive")
|
|
424
|
-
return {
|
|
425
|
-
ok: false,
|
|
426
|
-
unsupported: true,
|
|
427
|
-
reason: `${name} is obtained by ${kind}, which Namzu does not install.`
|
|
428
|
-
};
|
|
429
|
-
if ("headers" in entry || "headersHelper" in entry || "headers" in source || "headersHelper" in source)
|
|
430
|
-
return {
|
|
431
|
-
ok: false,
|
|
432
|
-
unsupported: true,
|
|
433
|
-
reason: `${name} needs request headers or a helper program to download, which Namzu does not run.`
|
|
434
|
-
};
|
|
435
|
-
const ref = text2(source.ref);
|
|
436
|
-
const sha = text2(source.sha);
|
|
437
|
-
if (ref !== void 0) {
|
|
438
|
-
const problem2 = refProblem(ref);
|
|
439
|
-
if (problem2 !== void 0) return invalid(`${name}: ${problem2}`);
|
|
440
|
-
}
|
|
441
|
-
if (sha !== void 0 && !isCommitId(sha.toLowerCase()))
|
|
442
|
-
return invalid(`${name}: the sha pin must be a full 40 or 64 character commit id.`);
|
|
443
|
-
const pins = {
|
|
444
|
-
...ref !== void 0 ? { ref } : {},
|
|
445
|
-
...sha !== void 0 ? { sha: sha.toLowerCase() } : {}
|
|
446
|
-
};
|
|
447
|
-
if (kind === "github") {
|
|
448
|
-
const repo = text2(source.repo);
|
|
449
|
-
if (repo === void 0 || !/^[\w][\w.-]*\/[\w][\w.-]*$/.test(repo))
|
|
450
|
-
return invalid(`${name}: the GitHub source needs repo as owner/repo.`);
|
|
451
|
-
return { ok: true, source: { kind: "github", repo, ...pins } };
|
|
452
|
-
}
|
|
453
|
-
if (kind === "archive") {
|
|
454
|
-
const url2 = text2(source.url);
|
|
455
|
-
if (url2 === void 0 || !/^https:\/\//i.test(url2))
|
|
456
|
-
return invalid(`${name}: an archive must be downloaded over https.`);
|
|
457
|
-
let parsed;
|
|
458
|
-
try {
|
|
459
|
-
parsed = new URL(url2);
|
|
460
|
-
} catch {
|
|
461
|
-
return invalid(`${name}: the archive address is not an address.`);
|
|
462
|
-
}
|
|
463
|
-
if (parsed.username !== "" || parsed.password !== "")
|
|
464
|
-
return invalid(`${name}: remove the sign-in details from the archive address.`);
|
|
465
|
-
const sha256 = text2(source.sha256);
|
|
466
|
-
if (sha256 !== void 0 && !SHA256.test(sha256))
|
|
467
|
-
return invalid(`${name}: sha256 must be 64 hexadecimal characters.`);
|
|
468
|
-
return {
|
|
469
|
-
ok: true,
|
|
470
|
-
source: {
|
|
471
|
-
kind: "archive",
|
|
472
|
-
url: url2,
|
|
473
|
-
...sha256 !== void 0 ? { sha256: sha256.toLowerCase() } : {}
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
const url = text2(source.url);
|
|
478
|
-
if (url === void 0) return invalid(`${name}: the source has no url.`);
|
|
479
|
-
const problem = gitUrlProblem(url, allowFile);
|
|
480
|
-
if (problem !== void 0) return invalid(`${name}: ${problem}.`);
|
|
481
|
-
if (kind === "url") return { ok: true, source: { kind: "git", url, ...pins } };
|
|
482
|
-
const path = text2(source.path);
|
|
483
|
-
if (path === void 0) return invalid(`${name}: a git-subdir source needs a path.`);
|
|
484
|
-
const pathProblem = repoPathProblem(path);
|
|
485
|
-
if (pathProblem !== void 0) return invalid(`${name}: ${pathProblem}`);
|
|
486
|
-
return { ok: true, source: { kind: "git-subdir", url, path, ...pins } };
|
|
487
|
-
}
|
|
488
|
-
__name(parseEntrySource, "parseEntrySource");
|
|
489
|
-
|
|
490
|
-
// src/integrations/plugins/fetch/git.ts
|
|
188
|
+
import { dirname, join as join2 } from "node:path";
|
|
491
189
|
var FetchError = class extends Error {
|
|
492
190
|
constructor(code, message, kind) {
|
|
493
191
|
super(message);
|
|
@@ -522,12 +220,12 @@ function gitTimeoutMs(env = process.env) {
|
|
|
522
220
|
__name(gitTimeoutMs, "gitTimeoutMs");
|
|
523
221
|
function killProcessTree(pid, platform) {
|
|
524
222
|
if (platform === "win32") {
|
|
525
|
-
return new Promise((
|
|
223
|
+
return new Promise((resolve3) => {
|
|
526
224
|
execFile(
|
|
527
225
|
join2(process.env.SystemRoot ?? "C:\\Windows", "System32", "taskkill.exe"),
|
|
528
226
|
["/PID", String(pid), "/T", "/F"],
|
|
529
227
|
{ windowsHide: true, timeout: 5e3 },
|
|
530
|
-
() =>
|
|
228
|
+
() => resolve3()
|
|
531
229
|
);
|
|
532
230
|
});
|
|
533
231
|
}
|
|
@@ -619,7 +317,7 @@ function createGitRunner(deps = {}) {
|
|
|
619
317
|
const later = deps.setTimeout ?? ((fn, ms) => setTimeout(fn, ms));
|
|
620
318
|
const cancel = deps.clearTimeout ?? ((handle) => clearTimeout(handle));
|
|
621
319
|
const sizeOf = deps.sizeOf ?? measureFolder;
|
|
622
|
-
return (args, options) => new Promise((
|
|
320
|
+
return (args, options) => new Promise((resolve3) => {
|
|
623
321
|
let stdout = "";
|
|
624
322
|
let stderr = "";
|
|
625
323
|
let done = false;
|
|
@@ -640,7 +338,7 @@ function createGitRunner(deps = {}) {
|
|
|
640
338
|
live.delete(pid);
|
|
641
339
|
if (live.size === 0) unhook();
|
|
642
340
|
}
|
|
643
|
-
|
|
341
|
+
resolve3({ code, stdout, stderr, timedOut, missing, ...oversize ? { oversize } : {} });
|
|
644
342
|
}, "finish");
|
|
645
343
|
const stop = /* @__PURE__ */ __name(() => {
|
|
646
344
|
if (stopping) return;
|
|
@@ -710,7 +408,7 @@ function createGitRunner(deps = {}) {
|
|
|
710
408
|
}
|
|
711
409
|
__name(createGitRunner, "createGitRunner");
|
|
712
410
|
var defaultRunner = createGitRunner();
|
|
713
|
-
function gitEnvironment(base, allowFile) {
|
|
411
|
+
function gitEnvironment(base, allowFile, platform = process.platform) {
|
|
714
412
|
const env = {};
|
|
715
413
|
for (const [key, value] of Object.entries(base))
|
|
716
414
|
if (value !== void 0 && !/^GIT_/i.test(key)) env[key] = value;
|
|
@@ -720,6 +418,8 @@ function gitEnvironment(base, allowFile) {
|
|
|
720
418
|
env.SSH_ASKPASS_REQUIRE = "never";
|
|
721
419
|
env.GIT_SSH_COMMAND = "ssh -o BatchMode=yes -o StrictHostKeyChecking=yes";
|
|
722
420
|
env.GIT_ALLOW_PROTOCOL = allowFile ? "https:ssh:file" : "https:ssh";
|
|
421
|
+
env.GIT_CONFIG_NOSYSTEM = "1";
|
|
422
|
+
env.GIT_CONFIG_GLOBAL = platform === "win32" ? "NUL" : "/dev/null";
|
|
723
423
|
env.GIT_LFS_SKIP_SMUDGE = "1";
|
|
724
424
|
env.GIT_OPTIONAL_LOCKS = "0";
|
|
725
425
|
env.LC_ALL = "C";
|
|
@@ -740,11 +440,26 @@ function gitSettings(allowFile, platform = process.platform) {
|
|
|
740
440
|
"receive.fsckObjects=true",
|
|
741
441
|
"submodule.recurse=false",
|
|
742
442
|
"fetch.recurseSubmodules=false",
|
|
743
|
-
"core.autocrlf=false"
|
|
443
|
+
"core.autocrlf=false",
|
|
444
|
+
// Empty resets the list: no credential helper runs, whatever a configuration file says.
|
|
445
|
+
"credential.helper=",
|
|
446
|
+
// A redirect from the first request would send Git to an address nothing here has checked.
|
|
447
|
+
"http.followRedirects=false"
|
|
744
448
|
];
|
|
745
449
|
return settings.flatMap((setting) => ["-c", setting]);
|
|
746
450
|
}
|
|
747
451
|
__name(gitSettings, "gitSettings");
|
|
452
|
+
function gitHostOf(url) {
|
|
453
|
+
const scp = /^[^@/\s]+@([^:/\s]+):/.exec(url);
|
|
454
|
+
if (scp !== null && !/^[a-z][a-z0-9+.-]*:\/\//i.test(url)) return scp[1];
|
|
455
|
+
if (!/^(https|ssh):\/\//i.test(url)) return void 0;
|
|
456
|
+
try {
|
|
457
|
+
return new URL(url).hostname;
|
|
458
|
+
} catch {
|
|
459
|
+
return void 0;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
__name(gitHostOf, "gitHostOf");
|
|
748
463
|
function hostOf(url) {
|
|
749
464
|
const scp = /^[^@/]+@([^:/]+):/.exec(url);
|
|
750
465
|
if (scp !== null) return scp[1];
|
|
@@ -774,9 +489,9 @@ function explainGitFailure(run, url, timeoutMs) {
|
|
|
774
489
|
`Git took longer than ${Math.round(timeoutMs / 1e3)} seconds and was stopped. Try again, or raise NAMZU_PLUGIN_GIT_TIMEOUT_MS (at most 600000).`,
|
|
775
490
|
"timeout"
|
|
776
491
|
);
|
|
777
|
-
const
|
|
492
|
+
const text = run.stderr;
|
|
778
493
|
if (/could not read (Username|Password)|terminal prompts disabled|Authentication failed|Permission denied \(publickey|Host key verification failed|no (supported )?authentication/i.test(
|
|
779
|
-
|
|
494
|
+
text
|
|
780
495
|
))
|
|
781
496
|
return new FetchError(
|
|
782
497
|
EXIT_NOINPUT,
|
|
@@ -784,7 +499,7 @@ function explainGitFailure(run, url, timeoutMs) {
|
|
|
784
499
|
"auth"
|
|
785
500
|
);
|
|
786
501
|
if (/Remote branch .* not found|couldn't find remote ref|not our ref|did not match any|invalid reference|reference is not a tree|unadvertised object/i.test(
|
|
787
|
-
|
|
502
|
+
text
|
|
788
503
|
))
|
|
789
504
|
return new FetchError(
|
|
790
505
|
EXIT_NOINPUT,
|
|
@@ -792,7 +507,7 @@ function explainGitFailure(run, url, timeoutMs) {
|
|
|
792
507
|
"ref"
|
|
793
508
|
);
|
|
794
509
|
if (/Repository not found|not found|does not appear to be a git repository|does not exist|404/i.test(
|
|
795
|
-
|
|
510
|
+
text
|
|
796
511
|
))
|
|
797
512
|
return new FetchError(
|
|
798
513
|
EXIT_NOINPUT,
|
|
@@ -800,18 +515,18 @@ function explainGitFailure(run, url, timeoutMs) {
|
|
|
800
515
|
"not-found"
|
|
801
516
|
);
|
|
802
517
|
if (/Could not resolve host|Failed to connect|Connection (timed out|refused|reset)|Network is unreachable|unable to access|Could not resolve hostname|Operation timed out/i.test(
|
|
803
|
-
|
|
518
|
+
text
|
|
804
519
|
))
|
|
805
520
|
return new FetchError(EXIT_UNAVAILABLE, `Could not reach ${hostOf(url)}.`, "network");
|
|
806
|
-
if (/protocol .* is not allowed|transport .* not allowed/i.test(
|
|
521
|
+
if (/protocol .* is not allowed|transport .* not allowed/i.test(text))
|
|
807
522
|
return new FetchError(EXIT_DATAERR, "That kind of address is not allowed.", "protocol");
|
|
808
|
-
if (/fsck|bad object|corrupt|object .* is (broken|invalid)|invalid .* in (commit|tree)/i.test(
|
|
523
|
+
if (/fsck|bad object|corrupt|object .* is (broken|invalid)|invalid .* in (commit|tree)/i.test(text))
|
|
809
524
|
return new FetchError(
|
|
810
525
|
EXIT_DATAERR,
|
|
811
526
|
"The repository failed Git\u2019s integrity checks, so nothing was taken from it.",
|
|
812
527
|
"fsck"
|
|
813
528
|
);
|
|
814
|
-
const first =
|
|
529
|
+
const first = text.split("\n").map((line) => line.trim()).find((line) => line !== "");
|
|
815
530
|
return new FetchError(
|
|
816
531
|
EXIT_FAIL,
|
|
817
532
|
`Git could not fetch the repository${first !== void 0 ? ` (${[...first].map((c) => c.charCodeAt(0) < 32 ? " " : c).join("").slice(0, 200)})` : ""}.`,
|
|
@@ -825,7 +540,7 @@ var Git = class {
|
|
|
825
540
|
this.dest = dest;
|
|
826
541
|
const allowFile = options.allowFileProtocol === true;
|
|
827
542
|
this.env = gitEnvironment(options.env ?? process.env, allowFile);
|
|
828
|
-
this.settings = gitSettings(allowFile);
|
|
543
|
+
this.settings = gitSettings(allowFile, process.platform);
|
|
829
544
|
this.timeoutMs = options.timeoutMs ?? gitTimeoutMs(options.env ?? process.env);
|
|
830
545
|
this.runner = options.runner ?? defaultRunner;
|
|
831
546
|
}
|
|
@@ -895,6 +610,22 @@ async function cloneRepository(request, options = {}) {
|
|
|
895
610
|
`${hostOf(request.url)} cannot be used: ${problem}.`,
|
|
896
611
|
"address"
|
|
897
612
|
);
|
|
613
|
+
if (!allowFile) {
|
|
614
|
+
const host = gitHostOf(request.url);
|
|
615
|
+
const where = host === void 0 ? void 0 : await privateAddressProblem(host, {
|
|
616
|
+
...options.resolve !== void 0 ? { resolve: options.resolve } : {},
|
|
617
|
+
// Only Git over https goes through a proxy; ssh resolves the name on this machine.
|
|
618
|
+
proxied: /^https:\/\//i.test(request.url) ? options.proxied ?? proxyConfigured(options.env ?? process.env, host) : false,
|
|
619
|
+
...options.signal !== void 0 ? { signal: options.signal } : {}
|
|
620
|
+
});
|
|
621
|
+
if (options.signal?.aborted) throw cancelledFetch();
|
|
622
|
+
if (where !== void 0)
|
|
623
|
+
throw new FetchError(
|
|
624
|
+
EXIT_UNTRUSTED,
|
|
625
|
+
`${host} was not used: ${where}. Namzu does not clone from inside this computer's own network.`,
|
|
626
|
+
"private-address"
|
|
627
|
+
);
|
|
628
|
+
}
|
|
898
629
|
const sparse = request.sparsePaths ?? [];
|
|
899
630
|
for (const path of sparse) {
|
|
900
631
|
const bad = repoPathProblem(path);
|
|
@@ -936,7 +667,9 @@ async function cloneRepository(request, options = {}) {
|
|
|
936
667
|
url,
|
|
937
668
|
request.dest
|
|
938
669
|
],
|
|
939
|
-
request.url
|
|
670
|
+
request.url,
|
|
671
|
+
// Inside the staging folder, never the folder Namzu was started in.
|
|
672
|
+
dirname(request.dest)
|
|
940
673
|
);
|
|
941
674
|
if (sparse.length > 0)
|
|
942
675
|
await git.run(
|
|
@@ -972,6 +705,8 @@ async function cloneRepository(request, options = {}) {
|
|
|
972
705
|
__name(cloneRepository, "cloneRepository");
|
|
973
706
|
|
|
974
707
|
// src/integrations/plugins/fetch/url.ts
|
|
708
|
+
import { createHash } from "node:crypto";
|
|
709
|
+
import { closeSync as closeSync2, openSync as openSync2, rmSync as rmSync2, writeSync } from "node:fs";
|
|
975
710
|
var CATALOG_DOWNLOAD_MAX_BYTES = 10 * 1024 * 1024;
|
|
976
711
|
var CATALOG_DOWNLOAD_TIMEOUT_MS = 3e4;
|
|
977
712
|
var ARCHIVE_DOWNLOAD_MAX_BYTES = 200 * 1024 * 1024;
|
|
@@ -992,7 +727,29 @@ function isArchiveType(contentType) {
|
|
|
992
727
|
return type !== "text/html" && type !== "application/json";
|
|
993
728
|
}
|
|
994
729
|
__name(isArchiveType, "isArchiveType");
|
|
995
|
-
async function
|
|
730
|
+
async function addressProblem(url, declared, options, signal) {
|
|
731
|
+
if (isBlockedSource({ source: "url", url: declared }, options.blockedMarketplaces))
|
|
732
|
+
return new FetchError(
|
|
733
|
+
EXIT_UNTRUSTED,
|
|
734
|
+
`${url.hostname} is on the list of sources turned off in your settings, so nothing was downloaded from it.`,
|
|
735
|
+
"blocked"
|
|
736
|
+
);
|
|
737
|
+
if (options.allowLoopbackHttp === true && url.hostname === "127.0.0.1") return void 0;
|
|
738
|
+
const problem = await privateAddressProblem(url.hostname, {
|
|
739
|
+
...options.resolve !== void 0 ? { resolve: options.resolve } : {},
|
|
740
|
+
proxied: options.proxied ?? proxyConfigured(options.env ?? process.env, url.hostname),
|
|
741
|
+
signal
|
|
742
|
+
});
|
|
743
|
+
if (problem === void 0) return void 0;
|
|
744
|
+
if (signal.aborted) return cancelledFetch();
|
|
745
|
+
return new FetchError(
|
|
746
|
+
EXIT_UNTRUSTED,
|
|
747
|
+
`${url.hostname} was not used: ${problem}. Namzu does not download from inside this computer's own network.`,
|
|
748
|
+
"private-address"
|
|
749
|
+
);
|
|
750
|
+
}
|
|
751
|
+
__name(addressProblem, "addressProblem");
|
|
752
|
+
async function transfer(request, options, onChunk) {
|
|
996
753
|
let current;
|
|
997
754
|
try {
|
|
998
755
|
current = new URL(options.rewriteUrl?.(request.url) ?? request.url);
|
|
@@ -1019,7 +776,13 @@ async function download(request, options = {}) {
|
|
|
1019
776
|
}, request.timeoutMs);
|
|
1020
777
|
const host = current.hostname;
|
|
1021
778
|
try {
|
|
779
|
+
let named = request.url;
|
|
1022
780
|
for (let hop = 0; ; hop++) {
|
|
781
|
+
const refused = await addressProblem(current, named, options, controller.signal);
|
|
782
|
+
if (refused !== void 0) {
|
|
783
|
+
if (options.signal?.aborted) throw cancelledFetch();
|
|
784
|
+
throw refused;
|
|
785
|
+
}
|
|
1023
786
|
let response;
|
|
1024
787
|
try {
|
|
1025
788
|
response = await fetcher(current.toString(), {
|
|
@@ -1072,6 +835,7 @@ async function download(request, options = {}) {
|
|
|
1072
835
|
"redirect"
|
|
1073
836
|
);
|
|
1074
837
|
current = next;
|
|
838
|
+
named = next.toString();
|
|
1075
839
|
continue;
|
|
1076
840
|
}
|
|
1077
841
|
if (response.status === 404 || response.status === 410)
|
|
@@ -1108,9 +872,8 @@ async function download(request, options = {}) {
|
|
|
1108
872
|
await response.body?.cancel().catch(() => void 0);
|
|
1109
873
|
throw tooBig;
|
|
1110
874
|
}
|
|
1111
|
-
if (response.body === null) return
|
|
875
|
+
if (response.body === null) return;
|
|
1112
876
|
const reader = response.body.getReader();
|
|
1113
|
-
const chunks = [];
|
|
1114
877
|
let total = 0;
|
|
1115
878
|
try {
|
|
1116
879
|
for (; ; ) {
|
|
@@ -1121,7 +884,7 @@ async function download(request, options = {}) {
|
|
|
1121
884
|
await reader.cancel().catch(() => void 0);
|
|
1122
885
|
throw tooBig;
|
|
1123
886
|
}
|
|
1124
|
-
|
|
887
|
+
onChunk(value);
|
|
1125
888
|
}
|
|
1126
889
|
} catch (error) {
|
|
1127
890
|
if (error instanceof FetchError) throw error;
|
|
@@ -1134,14 +897,43 @@ async function download(request, options = {}) {
|
|
|
1134
897
|
);
|
|
1135
898
|
throw new FetchError(EXIT_UNAVAILABLE, `The download from ${host} was cut off.`, "network");
|
|
1136
899
|
}
|
|
1137
|
-
return
|
|
900
|
+
return;
|
|
1138
901
|
}
|
|
1139
902
|
} finally {
|
|
1140
903
|
clearTimeout(timer);
|
|
1141
904
|
options.signal?.removeEventListener("abort", onAbort);
|
|
1142
905
|
}
|
|
1143
906
|
}
|
|
907
|
+
__name(transfer, "transfer");
|
|
908
|
+
async function download(request, options = {}) {
|
|
909
|
+
const chunks = [];
|
|
910
|
+
await transfer(request, options, (chunk) => {
|
|
911
|
+
chunks.push(Buffer.from(chunk));
|
|
912
|
+
});
|
|
913
|
+
return Buffer.concat(chunks);
|
|
914
|
+
}
|
|
1144
915
|
__name(download, "download");
|
|
916
|
+
async function downloadToFile(request, dest, options = {}) {
|
|
917
|
+
const hash = createHash("sha256");
|
|
918
|
+
let bytes2 = 0;
|
|
919
|
+
const fd = openSync2(dest, "w", 384);
|
|
920
|
+
try {
|
|
921
|
+
await transfer(request, options, (chunk) => {
|
|
922
|
+
hash.update(chunk);
|
|
923
|
+
bytes2 += chunk.byteLength;
|
|
924
|
+
let written = 0;
|
|
925
|
+
while (written < chunk.byteLength)
|
|
926
|
+
written += writeSync(fd, chunk, written, chunk.byteLength - written);
|
|
927
|
+
});
|
|
928
|
+
} catch (error) {
|
|
929
|
+
closeSync2(fd);
|
|
930
|
+
rmSync2(dest, { force: true });
|
|
931
|
+
throw error;
|
|
932
|
+
}
|
|
933
|
+
closeSync2(fd);
|
|
934
|
+
return { sha256: hash.digest("hex"), bytes: bytes2 };
|
|
935
|
+
}
|
|
936
|
+
__name(downloadToFile, "downloadToFile");
|
|
1145
937
|
async function fetchCatalogText(url, options = {}) {
|
|
1146
938
|
const bytes2 = await download(
|
|
1147
939
|
{
|
|
@@ -1159,7 +951,8 @@ __name(fetchCatalogText, "fetchCatalogText");
|
|
|
1159
951
|
|
|
1160
952
|
// src/integrations/plugins/fetch/archive.ts
|
|
1161
953
|
async function downloadArchive(url, dest, expectedSha256, options = {}) {
|
|
1162
|
-
|
|
954
|
+
mkdirSync2(dirname2(dest), { recursive: true, mode: 448 });
|
|
955
|
+
const { sha256, bytes: bytes2 } = await downloadToFile(
|
|
1163
956
|
{
|
|
1164
957
|
url,
|
|
1165
958
|
maxBytes: ARCHIVE_DOWNLOAD_MAX_BYTES,
|
|
@@ -1167,18 +960,18 @@ async function downloadArchive(url, dest, expectedSha256, options = {}) {
|
|
|
1167
960
|
acceptType: isArchiveType,
|
|
1168
961
|
subject: "archive"
|
|
1169
962
|
},
|
|
963
|
+
dest,
|
|
1170
964
|
options
|
|
1171
965
|
);
|
|
1172
|
-
|
|
1173
|
-
|
|
966
|
+
if (expectedSha256 !== void 0 && sha256 !== expectedSha256.toLowerCase()) {
|
|
967
|
+
rmSync3(dest, { force: true });
|
|
1174
968
|
throw new FetchError(
|
|
1175
969
|
EXIT_DATAERR,
|
|
1176
970
|
`The download does not match the digest the marketplace gave for it (expected ${expectedSha256.slice(0, 12)}, got ${sha256.slice(0, 12)}). Nothing was installed.`,
|
|
1177
971
|
"digest"
|
|
1178
972
|
);
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
return { file: dest, sha256, bytes: body.length };
|
|
973
|
+
}
|
|
974
|
+
return { file: dest, sha256, bytes: bytes2 };
|
|
1182
975
|
}
|
|
1183
976
|
__name(downloadArchive, "downloadArchive");
|
|
1184
977
|
|
|
@@ -1186,10 +979,10 @@ __name(downloadArchive, "downloadArchive");
|
|
|
1186
979
|
async function fetchMarketplace(source, staging, options = {}) {
|
|
1187
980
|
const dir = join3(staging, "m");
|
|
1188
981
|
if (source.source === "url") {
|
|
1189
|
-
const
|
|
982
|
+
const text = await fetchCatalogText(source.url, options);
|
|
1190
983
|
const file = join3(dir, COMMON_MANIFEST_DIR, COMMON_MARKETPLACE_FILE);
|
|
1191
984
|
mkdirSync3(join3(dir, COMMON_MANIFEST_DIR), { recursive: true, mode: 448 });
|
|
1192
|
-
|
|
985
|
+
writeFileSync(file, text, { mode: 384 });
|
|
1193
986
|
return { dir, lfsPointers: 0, submodules: 0 };
|
|
1194
987
|
}
|
|
1195
988
|
const sparse = source.sparsePaths;
|
|
@@ -1259,257 +1052,21 @@ import {
|
|
|
1259
1052
|
chmodSync,
|
|
1260
1053
|
copyFileSync,
|
|
1261
1054
|
existsSync as existsSync2,
|
|
1262
|
-
lstatSync as
|
|
1055
|
+
lstatSync as lstatSync4,
|
|
1263
1056
|
mkdirSync as mkdirSync4,
|
|
1264
|
-
readFileSync as
|
|
1057
|
+
readFileSync as readFileSync3,
|
|
1265
1058
|
readdirSync as readdirSync3,
|
|
1266
|
-
realpathSync
|
|
1059
|
+
realpathSync,
|
|
1267
1060
|
renameSync,
|
|
1268
|
-
rmSync as
|
|
1061
|
+
rmSync as rmSync4,
|
|
1269
1062
|
statSync,
|
|
1270
|
-
writeFileSync as
|
|
1063
|
+
writeFileSync as writeFileSync2
|
|
1271
1064
|
} from "node:fs";
|
|
1272
|
-
import { dirname as dirname3, isAbsolute
|
|
1273
|
-
|
|
1274
|
-
// src/integrations/plugins/marketplace.ts
|
|
1275
|
-
import { lstatSync as lstatSync3, readFileSync as readFileSync2, realpathSync } from "node:fs";
|
|
1276
|
-
import { basename, dirname as dirname2, isAbsolute, join as join4, resolve } from "node:path";
|
|
1277
|
-
var LOCAL_UPLOADS_MARKETPLACE = "local-uploads";
|
|
1278
|
-
var RESERVED_MARKETPLACE_NAMES = [
|
|
1279
|
-
LOCAL_UPLOADS_MARKETPLACE,
|
|
1280
|
-
"inline",
|
|
1281
|
-
"builtin",
|
|
1282
|
-
"synced"
|
|
1283
|
-
];
|
|
1284
|
-
var MAX_CATALOG_PLUGINS = 500;
|
|
1285
|
-
var MAX_CATALOG_BYTES = 10 * 1024 * 1024;
|
|
1286
|
-
var NAME_RULE = /^[a-z0-9][a-z0-9._-]{0,63}$/;
|
|
1287
|
-
function marketplaceNameProblem(name) {
|
|
1288
|
-
if (!NAME_RULE.test(name) || name.includes(".."))
|
|
1289
|
-
return `"${name}" is not a marketplace name. Use lowercase letters, digits, dots, dashes and underscores, starting with a letter or digit, at most 64 characters.`;
|
|
1290
|
-
const lower = name.toLowerCase();
|
|
1291
|
-
if (RESERVED_MARKETPLACE_NAMES.includes(lower) || lower === "namzu" || lower.startsWith("namzu-"))
|
|
1292
|
-
return `The marketplace name "${name}" is reserved.`;
|
|
1293
|
-
if (isOfficialLookingMarketplaceName(name))
|
|
1294
|
-
return `The marketplace name "${name}" looks like an official catalog's name, which another marketplace may not use.`;
|
|
1295
|
-
return void 0;
|
|
1296
|
-
}
|
|
1297
|
-
__name(marketplaceNameProblem, "marketplaceNameProblem");
|
|
1298
|
-
var ENTRY_COMPONENT_FIELDS = [
|
|
1299
|
-
"skills",
|
|
1300
|
-
"commands",
|
|
1301
|
-
"agents",
|
|
1302
|
-
"hooks",
|
|
1303
|
-
"mcpServers"
|
|
1304
|
-
];
|
|
1305
|
-
var ENTRY_SIDECAR_KEEPS = [
|
|
1306
|
-
"name",
|
|
1307
|
-
"description",
|
|
1308
|
-
"version",
|
|
1309
|
-
"author",
|
|
1310
|
-
"strict",
|
|
1311
|
-
"platforms",
|
|
1312
|
-
"engines",
|
|
1313
|
-
...ENTRY_COMPONENT_FIELDS
|
|
1314
|
-
];
|
|
1315
|
-
function catalogLocation(location, kind) {
|
|
1316
|
-
if (kind === "file") {
|
|
1317
|
-
const dir = dirname2(location);
|
|
1318
|
-
return { file: location, root: basename(dir) === COMMON_MANIFEST_DIR ? dirname2(dir) : dir };
|
|
1319
|
-
}
|
|
1320
|
-
const inside2 = join4(location, COMMON_MANIFEST_DIR, COMMON_MARKETPLACE_FILE);
|
|
1321
|
-
let file = inside2;
|
|
1322
|
-
try {
|
|
1323
|
-
lstatSync3(inside2);
|
|
1324
|
-
} catch {
|
|
1325
|
-
const plain = join4(location, COMMON_MARKETPLACE_FILE);
|
|
1326
|
-
try {
|
|
1327
|
-
lstatSync3(plain);
|
|
1328
|
-
file = plain;
|
|
1329
|
-
} catch {
|
|
1330
|
-
file = inside2;
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
return { file, root: location };
|
|
1334
|
-
}
|
|
1335
|
-
__name(catalogLocation, "catalogLocation");
|
|
1336
|
-
function text(value, max = 1024) {
|
|
1337
|
-
return typeof value === "string" && value.trim() !== "" ? value.trim().slice(0, max) : void 0;
|
|
1338
|
-
}
|
|
1339
|
-
__name(text, "text");
|
|
1340
|
-
function readCatalog(location, kind) {
|
|
1341
|
-
const { file, root } = catalogLocation(location, kind);
|
|
1342
|
-
let stat2;
|
|
1343
|
-
try {
|
|
1344
|
-
stat2 = lstatSync3(file);
|
|
1345
|
-
} catch {
|
|
1346
|
-
return {
|
|
1347
|
-
ok: false,
|
|
1348
|
-
missing: true,
|
|
1349
|
-
reason: `There is no catalog at ${file}. A marketplace folder holds ${COMMON_MANIFEST_DIR}/${COMMON_MARKETPLACE_FILE}.`
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
if (!stat2.isFile())
|
|
1353
|
-
return { ok: false, reason: `${file} is a link or not a regular file, so it is not read.` };
|
|
1354
|
-
if (stat2.size > MAX_CATALOG_BYTES)
|
|
1355
|
-
return { ok: false, reason: `${file} is larger than ${MAX_CATALOG_BYTES / (1024 * 1024)} MiB.` };
|
|
1356
|
-
let parsed;
|
|
1357
|
-
try {
|
|
1358
|
-
parsed = JSON.parse(readFileSync2(file, "utf8"));
|
|
1359
|
-
} catch (error) {
|
|
1360
|
-
return {
|
|
1361
|
-
ok: false,
|
|
1362
|
-
reason: `${file} is not valid JSON (${error instanceof Error ? error.message : String(error)}).`
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
if (!isRecord(parsed))
|
|
1366
|
-
return { ok: false, reason: `${file} is not a catalog: it is not a mapping.` };
|
|
1367
|
-
const name = text(parsed.name, 200);
|
|
1368
|
-
if (name === void 0) return { ok: false, reason: `${file} has no "name".` };
|
|
1369
|
-
if (!Array.isArray(parsed.plugins)) return { ok: false, reason: `${file} has no "plugins" list.` };
|
|
1370
|
-
if (parsed.plugins.length > MAX_CATALOG_PLUGINS)
|
|
1371
|
-
return {
|
|
1372
|
-
ok: false,
|
|
1373
|
-
reason: `${file} lists ${parsed.plugins.length} plugins; at most ${MAX_CATALOG_PLUGINS} are read.`
|
|
1374
|
-
};
|
|
1375
|
-
const warnings = [];
|
|
1376
|
-
const owner = isRecord(parsed.owner) ? text(parsed.owner.name, 200) : void 0;
|
|
1377
|
-
if (owner === void 0) warnings.push("The catalog names no owner.");
|
|
1378
|
-
const metadata = isRecord(parsed.metadata) ? parsed.metadata : {};
|
|
1379
|
-
const pluginRoot = text(metadata.pluginRoot, 512);
|
|
1380
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1381
|
-
const entries = [];
|
|
1382
|
-
for (const [index, item] of parsed.plugins.entries()) {
|
|
1383
|
-
if (!isRecord(item)) {
|
|
1384
|
-
warnings.push(`Entry ${index + 1} is not a mapping and was left out.`);
|
|
1385
|
-
continue;
|
|
1386
|
-
}
|
|
1387
|
-
const entryName = text(item.name, 64);
|
|
1388
|
-
if (entryName === void 0 || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(entryName)) {
|
|
1389
|
-
warnings.push(`Entry ${index + 1} has no usable name and was left out.`);
|
|
1390
|
-
continue;
|
|
1391
|
-
}
|
|
1392
|
-
if (item.source === void 0 || typeof item.source !== "string" && !isRecord(item.source) || item.source === "") {
|
|
1393
|
-
warnings.push(`${entryName} has no source and was left out.`);
|
|
1394
|
-
continue;
|
|
1395
|
-
}
|
|
1396
|
-
if (seen.has(entryName)) {
|
|
1397
|
-
warnings.push(`${entryName} is listed twice; the first entry is used.`);
|
|
1398
|
-
continue;
|
|
1399
|
-
}
|
|
1400
|
-
seen.add(entryName);
|
|
1401
|
-
const description = text(item.description);
|
|
1402
|
-
const version = text(item.version, 64);
|
|
1403
|
-
const author = typeof item.author === "string" ? text(item.author, 200) : void 0;
|
|
1404
|
-
entries.push({
|
|
1405
|
-
name: entryName,
|
|
1406
|
-
source: item.source,
|
|
1407
|
-
...description !== void 0 ? { description } : {},
|
|
1408
|
-
...version !== void 0 ? { version } : {},
|
|
1409
|
-
...author !== void 0 ? { author } : {},
|
|
1410
|
-
strict: item.strict !== false,
|
|
1411
|
-
raw: item
|
|
1412
|
-
});
|
|
1413
|
-
if (item.strict !== false && ENTRY_COMPONENT_FIELDS.some((field) => field in item))
|
|
1414
|
-
warnings.push(
|
|
1415
|
-
`${entryName} sets components inline without "strict": false, so they are ignored.`
|
|
1416
|
-
);
|
|
1417
|
-
}
|
|
1418
|
-
return {
|
|
1419
|
-
ok: true,
|
|
1420
|
-
catalog: {
|
|
1421
|
-
name,
|
|
1422
|
-
...owner !== void 0 ? { owner } : {},
|
|
1423
|
-
...pluginRoot !== void 0 ? { pluginRoot } : {},
|
|
1424
|
-
entries,
|
|
1425
|
-
warnings,
|
|
1426
|
-
file,
|
|
1427
|
-
root
|
|
1428
|
-
}
|
|
1429
|
-
};
|
|
1430
|
-
}
|
|
1431
|
-
__name(readCatalog, "readCatalog");
|
|
1432
|
-
async function resolveEntrySource(entry, catalog, options = {}) {
|
|
1433
|
-
const source = entry.source;
|
|
1434
|
-
if (typeof source === "string") {
|
|
1435
|
-
if (options.hosted === true)
|
|
1436
|
-
return {
|
|
1437
|
-
kind: "unsupported",
|
|
1438
|
-
reason: `${entry.name} is a folder inside the marketplace, and a hosted catalog file has no folders behind it. Add the marketplace as a repository instead.`
|
|
1439
|
-
};
|
|
1440
|
-
let relative3;
|
|
1441
|
-
if (source.startsWith("./") || source.startsWith("../") || source === ".") relative3 = source;
|
|
1442
|
-
else if (catalog.pluginRoot !== void 0 && !isAbsolute(source) && !/^[A-Za-z]:/.test(source))
|
|
1443
|
-
relative3 = join4(catalog.pluginRoot, source);
|
|
1444
|
-
else
|
|
1445
|
-
return {
|
|
1446
|
-
kind: "invalid",
|
|
1447
|
-
reason: `The source "${source}" is not a folder path starting with ./, and the catalog sets no metadata.pluginRoot for a bare name.`
|
|
1448
|
-
};
|
|
1449
|
-
if (isAbsolute(relative3) || /^[A-Za-z]:/.test(relative3))
|
|
1450
|
-
return { kind: "invalid", reason: `The source "${source}" is an absolute path.` };
|
|
1451
|
-
try {
|
|
1452
|
-
const dir = await resolveWithinReal(catalog.root, relative3);
|
|
1453
|
-
if (!lstatSync3(dir).isDirectory())
|
|
1454
|
-
return { kind: "invalid", reason: `The source "${source}" is not a folder.` };
|
|
1455
|
-
return { kind: "local", dir };
|
|
1456
|
-
} catch (error) {
|
|
1457
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
1458
|
-
const leaves = /^Path escapes the working directory/.test(message);
|
|
1459
|
-
return {
|
|
1460
|
-
kind: "invalid",
|
|
1461
|
-
reason: leaves ? `The source "${source}" leaves the marketplace folder, which is not allowed.` : `The source "${source}" cannot be used: ${message}`
|
|
1462
|
-
};
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
if (isRecord(source)) {
|
|
1466
|
-
const read = parseEntrySource(
|
|
1467
|
-
entry.name,
|
|
1468
|
-
source,
|
|
1469
|
-
entry.raw,
|
|
1470
|
-
options.allowFileProtocol === true
|
|
1471
|
-
);
|
|
1472
|
-
if (read.ok) return { kind: "remote", remote: read.source };
|
|
1473
|
-
return read.unsupported ? { kind: "unsupported", reason: read.reason } : { kind: "invalid", reason: read.reason };
|
|
1474
|
-
}
|
|
1475
|
-
return { kind: "invalid", reason: "The entry has no usable source." };
|
|
1476
|
-
}
|
|
1477
|
-
__name(resolveEntrySource, "resolveEntrySource");
|
|
1478
|
-
var NOT_AN_ADDRESS2 = "Not a marketplace address. Use owner/repo, an https:// address, or a folder path.";
|
|
1479
|
-
function parseMarketplaceAddress(input, cwd) {
|
|
1480
|
-
const value = input.trim();
|
|
1481
|
-
if (value === "") return { kind: "refused", message: NOT_AN_ADDRESS2 };
|
|
1482
|
-
if (/^http:\/\//i.test(value))
|
|
1483
|
-
return { kind: "refused", message: "Only https:// addresses are accepted, not http://." };
|
|
1484
|
-
if (/^file:\/\//i.test(value))
|
|
1485
|
-
return { kind: "refused", message: "Use a folder path, not a file:// address." };
|
|
1486
|
-
if (/^\\\\/.test(value) || /^\/\/[^/]/.test(value))
|
|
1487
|
-
return {
|
|
1488
|
-
kind: "refused",
|
|
1489
|
-
message: "A network share is not accepted. Copy the marketplace to this computer first."
|
|
1490
|
-
};
|
|
1491
|
-
if (/^(\.{1,2}([\\/]|$)|\/|~|[A-Za-z]:[\\/])/.test(value)) {
|
|
1492
|
-
const home = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
1493
|
-
const expanded = value === "~" || /^~[\\/]/.test(value) ? join4(home, value.slice(1)) : value;
|
|
1494
|
-
return { kind: "path", path: resolve(cwd, expanded) };
|
|
1495
|
-
}
|
|
1496
|
-
const remote = parseRemoteAddress(value);
|
|
1497
|
-
if (!remote.ok) return { kind: "refused", message: remote.message };
|
|
1498
|
-
return { kind: "remote", form: remote.form, text: value, source: remote.source };
|
|
1499
|
-
}
|
|
1500
|
-
__name(parseMarketplaceAddress, "parseMarketplaceAddress");
|
|
1501
|
-
function realPathOf(path) {
|
|
1502
|
-
try {
|
|
1503
|
-
return realpathSync.native(path);
|
|
1504
|
-
} catch {
|
|
1505
|
-
return void 0;
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
__name(realPathOf, "realPathOf");
|
|
1065
|
+
import { dirname as dirname3, isAbsolute, join as join5, relative, resolve } from "node:path";
|
|
1509
1066
|
|
|
1510
1067
|
// src/integrations/plugins/surface.ts
|
|
1511
|
-
import { lstatSync as
|
|
1512
|
-
import { join as
|
|
1068
|
+
import { lstatSync as lstatSync3, readFileSync as readFileSync2, readdirSync as readdirSync2 } from "node:fs";
|
|
1069
|
+
import { join as join4 } from "node:path";
|
|
1513
1070
|
function hashExecutableFiles(root) {
|
|
1514
1071
|
const executable = [];
|
|
1515
1072
|
const files = {};
|
|
@@ -1517,12 +1074,12 @@ function hashExecutableFiles(root) {
|
|
|
1517
1074
|
const walk = /* @__PURE__ */ __name((dir, prefix) => {
|
|
1518
1075
|
for (const entry of readdirSync2(dir, { withFileTypes: true })) {
|
|
1519
1076
|
const rel = prefix === "" ? entry.name : `${prefix}/${entry.name}`;
|
|
1520
|
-
const full =
|
|
1077
|
+
const full = join4(dir, entry.name);
|
|
1521
1078
|
if (entry.isDirectory()) walk(full, rel);
|
|
1522
1079
|
else if (entry.isFile()) {
|
|
1523
|
-
const stat2 =
|
|
1080
|
+
const stat2 = lstatSync3(full);
|
|
1524
1081
|
executable.push(rel);
|
|
1525
|
-
files[rel] = sha256Hex(
|
|
1082
|
+
files[rel] = sha256Hex(readFileSync2(full));
|
|
1526
1083
|
if (isExecutablePath(rel, stat2.mode) && !isConfigFile(rel))
|
|
1527
1084
|
scripts.push({ path: rel, bytes: stat2.size, exec: (stat2.mode & 73) !== 0 });
|
|
1528
1085
|
}
|
|
@@ -1543,14 +1100,14 @@ function envNamesIn(values) {
|
|
|
1543
1100
|
}
|
|
1544
1101
|
__name(envNamesIn, "envNamesIn");
|
|
1545
1102
|
function unexpandWith(un) {
|
|
1546
|
-
if (un === void 0) return (
|
|
1103
|
+
if (un === void 0) return (text) => text;
|
|
1547
1104
|
const pairs = [
|
|
1548
1105
|
[un.root, "${NAMZU_PLUGIN_ROOT}"],
|
|
1549
1106
|
[un.dataSentinel, "${NAMZU_PLUGIN_DATA}"],
|
|
1550
1107
|
[un.projectSentinel, "${NAMZU_PROJECT_DIR}"]
|
|
1551
1108
|
];
|
|
1552
|
-
return (
|
|
1553
|
-
let out =
|
|
1109
|
+
return (text) => {
|
|
1110
|
+
let out = text;
|
|
1554
1111
|
for (const [folder, name] of pairs) if (folder.length > 1) out = out.split(folder).join(name);
|
|
1555
1112
|
return out;
|
|
1556
1113
|
};
|
|
@@ -1594,14 +1151,14 @@ function splitAllowedTools(written) {
|
|
|
1594
1151
|
__name(splitAllowedTools, "splitAllowedTools");
|
|
1595
1152
|
function inside(root, rel) {
|
|
1596
1153
|
if (rel.split(/[\\/]/).includes("..") || /^([A-Za-z]:|[\\/])/.test(rel)) return void 0;
|
|
1597
|
-
return
|
|
1154
|
+
return join4(root, rel);
|
|
1598
1155
|
}
|
|
1599
1156
|
__name(inside, "inside");
|
|
1600
1157
|
function readText(path) {
|
|
1601
1158
|
try {
|
|
1602
|
-
const stat2 =
|
|
1159
|
+
const stat2 = lstatSync3(path);
|
|
1603
1160
|
if (!stat2.isFile() || stat2.size > 1024 * 1024) return void 0;
|
|
1604
|
-
return
|
|
1161
|
+
return readFileSync2(path, "utf8");
|
|
1605
1162
|
} catch {
|
|
1606
1163
|
return void 0;
|
|
1607
1164
|
}
|
|
@@ -1640,6 +1197,8 @@ function readSurface(input) {
|
|
|
1640
1197
|
problems.push({ code: problem.code, file: problem.file, message: problem.message });
|
|
1641
1198
|
const hooks = hookRows(read.hooks).map((row) => ({ ...row }));
|
|
1642
1199
|
const modules = (manifest.hooks ?? []).filter((path) => !isHookEntriesPath(path)).map((path) => ({ path }));
|
|
1200
|
+
for (const path of manifest.tools ?? [])
|
|
1201
|
+
if (!modules.some((module) => module.path === path)) modules.push({ path, tool: true });
|
|
1643
1202
|
const isolated = isolatedModuleRow(root, manifest.name);
|
|
1644
1203
|
if (isolated !== void 0) modules.push(isolated);
|
|
1645
1204
|
const mcpLocal = (manifest.mcpServers ?? []).map((server) => ({
|
|
@@ -1713,7 +1272,7 @@ function readSurface(input) {
|
|
|
1713
1272
|
for (const dir of manifest.skills ?? []) {
|
|
1714
1273
|
const folder = inside(root, dir);
|
|
1715
1274
|
if (folder !== void 0)
|
|
1716
|
-
considerFile("skill", dir.split(/[\\/]/).pop() ?? dir,
|
|
1275
|
+
considerFile("skill", dir.split(/[\\/]/).pop() ?? dir, join4(folder, "SKILL.md"));
|
|
1717
1276
|
}
|
|
1718
1277
|
for (const [kind, declared] of [
|
|
1719
1278
|
["command", manifest.commands],
|
|
@@ -1721,7 +1280,7 @@ function readSurface(input) {
|
|
|
1721
1280
|
]) {
|
|
1722
1281
|
for (const source of resolvePluginFileDirs(manifest.name, root, declared, manifest.layout).dirs)
|
|
1723
1282
|
for (const file of listMarkdownNames(source.dir, source.only))
|
|
1724
|
-
considerFile(kind, file,
|
|
1283
|
+
considerFile(kind, file, join4(source.dir, `${file}.md`));
|
|
1725
1284
|
}
|
|
1726
1285
|
const byName = /* @__PURE__ */ __name((a, b) => `${a.kind ?? ""} ${a.name ?? ""} ${a.event ?? ""}`.localeCompare(
|
|
1727
1286
|
`${b.kind ?? ""} ${b.name ?? ""} ${b.event ?? ""}`
|
|
@@ -1831,14 +1390,14 @@ var PlanRefusal = class extends Error {
|
|
|
1831
1390
|
name = "PlanRefusal";
|
|
1832
1391
|
};
|
|
1833
1392
|
function stagingFolder(home) {
|
|
1834
|
-
return
|
|
1393
|
+
return join5(pluginsFolder(home), ".staging");
|
|
1835
1394
|
}
|
|
1836
1395
|
__name(stagingFolder, "stagingFolder");
|
|
1837
1396
|
var SKIPPED_NAMES = /* @__PURE__ */ new Set([".git", "__MACOSX", ".DS_Store"]);
|
|
1838
1397
|
var REFUSED = 65;
|
|
1839
1398
|
function within(outer, inner) {
|
|
1840
1399
|
const rel = relative(outer, inner);
|
|
1841
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
1400
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
|
|
1842
1401
|
}
|
|
1843
1402
|
__name(within, "within");
|
|
1844
1403
|
function copyPluginTree(src, dest, findings) {
|
|
@@ -1850,8 +1409,8 @@ function copyPluginTree(src, dest, findings) {
|
|
|
1850
1409
|
)) {
|
|
1851
1410
|
if (SKIPPED_NAMES.has(entry.name)) continue;
|
|
1852
1411
|
const rel = prefix === "" ? entry.name : `${prefix}/${entry.name}`;
|
|
1853
|
-
const source =
|
|
1854
|
-
const stat2 =
|
|
1412
|
+
const source = join5(from, entry.name);
|
|
1413
|
+
const stat2 = lstatSync4(source);
|
|
1855
1414
|
if (stat2.isSymbolicLink()) {
|
|
1856
1415
|
findings.push({
|
|
1857
1416
|
level: "ignored",
|
|
@@ -1859,7 +1418,7 @@ function copyPluginTree(src, dest, findings) {
|
|
|
1859
1418
|
field: rel,
|
|
1860
1419
|
message: `${rel} is a link and was not copied.`
|
|
1861
1420
|
});
|
|
1862
|
-
} else if (stat2.isDirectory()) walk(source,
|
|
1421
|
+
} else if (stat2.isDirectory()) walk(source, join5(to, entry.name), rel);
|
|
1863
1422
|
else if (stat2.isFile()) {
|
|
1864
1423
|
counter.files += 1;
|
|
1865
1424
|
counter.bytes += stat2.size;
|
|
@@ -1873,7 +1432,7 @@ function copyPluginTree(src, dest, findings) {
|
|
|
1873
1432
|
REFUSED,
|
|
1874
1433
|
`The plugin is larger than ${PLUGIN_COPY_MAX_BYTES / (1024 * 1024)} MiB, which is more than Namzu installs.`
|
|
1875
1434
|
);
|
|
1876
|
-
const target =
|
|
1435
|
+
const target = join5(to, entry.name);
|
|
1877
1436
|
copyFileSync(source, target);
|
|
1878
1437
|
chmodSync(target, (stat2.mode & 64) !== 0 ? 493 : 420);
|
|
1879
1438
|
} else
|
|
@@ -1901,29 +1460,28 @@ function unpackPluginArchive(file, dest) {
|
|
|
1901
1460
|
REFUSED,
|
|
1902
1461
|
`The archive is larger than ${PLUGIN_ARCHIVE_MAX_BYTES / (1024 * 1024)} MiB.`
|
|
1903
1462
|
);
|
|
1904
|
-
let
|
|
1463
|
+
let count = 0;
|
|
1905
1464
|
try {
|
|
1906
|
-
|
|
1465
|
+
eachArchiveFile(readFileSync3(file), PLUGIN_ARCHIVE_LIMITS, (name, entry) => {
|
|
1466
|
+
if (name.split("/").some((part) => SKIPPED_NAMES.has(part))) return;
|
|
1467
|
+
if (++count > PLUGIN_COPY_MAX_FILES)
|
|
1468
|
+
throw new PlanRefusal(REFUSED, `The archive has more than ${PLUGIN_COPY_MAX_FILES} files.`);
|
|
1469
|
+
const target = join5(dest, ...name.split("/"));
|
|
1470
|
+
if (!within(dest, target))
|
|
1471
|
+
throw new PlanRefusal(REFUSED, `${name} climbs out of the archive.`);
|
|
1472
|
+
mkdirSync4(dirname3(target), { recursive: true, mode: 493 });
|
|
1473
|
+
writeFileSync2(target, entry.bytes, { mode: entry.executable ? 493 : 420 });
|
|
1474
|
+
chmodSync(target, entry.executable ? 493 : 420);
|
|
1475
|
+
});
|
|
1907
1476
|
} catch (error) {
|
|
1908
1477
|
if (error instanceof ArchiveError) throw new PlanRefusal(REFUSED, error.message);
|
|
1909
1478
|
throw error;
|
|
1910
1479
|
}
|
|
1911
|
-
let count = 0;
|
|
1912
|
-
for (const [name, entry] of files) {
|
|
1913
|
-
if (name.split("/").some((part) => SKIPPED_NAMES.has(part))) continue;
|
|
1914
|
-
if (++count > PLUGIN_COPY_MAX_FILES)
|
|
1915
|
-
throw new PlanRefusal(REFUSED, `The archive has more than ${PLUGIN_COPY_MAX_FILES} files.`);
|
|
1916
|
-
const target = join6(dest, ...name.split("/"));
|
|
1917
|
-
if (!within(dest, target)) throw new PlanRefusal(REFUSED, `${name} climbs out of the archive.`);
|
|
1918
|
-
mkdirSync4(dirname3(target), { recursive: true, mode: 493 });
|
|
1919
|
-
writeFileSync3(target, entry.bytes, { mode: entry.executable ? 493 : 420 });
|
|
1920
|
-
chmodSync(target, entry.executable ? 493 : 420);
|
|
1921
|
-
}
|
|
1922
1480
|
}
|
|
1923
1481
|
__name(unpackPluginArchive, "unpackPluginArchive");
|
|
1924
1482
|
function discardStaging(dir) {
|
|
1925
1483
|
try {
|
|
1926
|
-
|
|
1484
|
+
rmSync4(dir, { recursive: true, force: true });
|
|
1927
1485
|
} catch {
|
|
1928
1486
|
}
|
|
1929
1487
|
}
|
|
@@ -1973,7 +1531,7 @@ function sidecarFor(entry) {
|
|
|
1973
1531
|
__name(sidecarFor, "sidecarFor");
|
|
1974
1532
|
var SIDECAR_FILE = ".namzu-entry.json";
|
|
1975
1533
|
async function planInstall(source, options) {
|
|
1976
|
-
const staging =
|
|
1534
|
+
const staging = join5(stagingFolder(options.home), randomUUID());
|
|
1977
1535
|
mkdirSync4(staging, { recursive: true, mode: 448 });
|
|
1978
1536
|
try {
|
|
1979
1537
|
return await build(source, options, staging);
|
|
@@ -1985,7 +1543,7 @@ async function planInstall(source, options) {
|
|
|
1985
1543
|
__name(planInstall, "planInstall");
|
|
1986
1544
|
async function build(source, options, staging) {
|
|
1987
1545
|
const findings = [];
|
|
1988
|
-
const root =
|
|
1546
|
+
const root = join5(staging, "plugin");
|
|
1989
1547
|
let installedFrom;
|
|
1990
1548
|
let marketplace;
|
|
1991
1549
|
let entry;
|
|
@@ -2015,7 +1573,7 @@ async function build(source, options, staging) {
|
|
|
2015
1573
|
if (fetched.archive !== void 0) {
|
|
2016
1574
|
if (source.remote.kind === "archive" && source.remote.sha256 === void 0)
|
|
2017
1575
|
unpinnedDownload = true;
|
|
2018
|
-
const unpacked =
|
|
1576
|
+
const unpacked = join5(staging, "unpacked");
|
|
2019
1577
|
mkdirSync4(unpacked, { recursive: true, mode: 493 });
|
|
2020
1578
|
unpackPluginArchive(fetched.archive.file, unpacked);
|
|
2021
1579
|
const inner = await findCommonLayoutRoot(unpacked);
|
|
@@ -2035,25 +1593,25 @@ async function build(source, options, staging) {
|
|
|
2035
1593
|
marketplace = LOCAL_UPLOADS_MARKETPLACE;
|
|
2036
1594
|
let stat2;
|
|
2037
1595
|
try {
|
|
2038
|
-
stat2 =
|
|
1596
|
+
stat2 = lstatSync4(source.path);
|
|
2039
1597
|
} catch {
|
|
2040
1598
|
throw new PlanRefusal(66, `${source.path} was not found.`);
|
|
2041
1599
|
}
|
|
2042
1600
|
if (stat2.isDirectory()) {
|
|
2043
|
-
installedFrom = { marketplace, source:
|
|
1601
|
+
installedFrom = { marketplace, source: realpathSync.native(source.path), kind: "folder" };
|
|
2044
1602
|
copyFolderSource(source.path, root, options, findings);
|
|
2045
1603
|
} else if (stat2.isFile()) {
|
|
2046
|
-
installedFrom = { marketplace, source:
|
|
2047
|
-
const unpacked =
|
|
1604
|
+
installedFrom = { marketplace, source: resolve(source.path), kind: "archive" };
|
|
1605
|
+
const unpacked = join5(staging, "unpacked");
|
|
2048
1606
|
mkdirSync4(unpacked, { recursive: true, mode: 493 });
|
|
2049
1607
|
unpackPluginArchive(source.path, unpacked);
|
|
2050
1608
|
const inner = await findCommonLayoutRoot(unpacked);
|
|
2051
1609
|
renameSync(inner, root);
|
|
2052
1610
|
} else throw new PlanRefusal(66, `${source.path} is neither a folder nor an archive.`);
|
|
2053
1611
|
}
|
|
2054
|
-
const sidecarPath =
|
|
1612
|
+
const sidecarPath = join5(root, SIDECAR_FILE);
|
|
2055
1613
|
if (existsSync2(sidecarPath)) {
|
|
2056
|
-
|
|
1614
|
+
rmSync4(sidecarPath, { force: true });
|
|
2057
1615
|
findings.push({
|
|
2058
1616
|
level: "ignored",
|
|
2059
1617
|
code: "sidecar-shipped",
|
|
@@ -2062,7 +1620,7 @@ async function build(source, options, staging) {
|
|
|
2062
1620
|
});
|
|
2063
1621
|
}
|
|
2064
1622
|
const sidecar = entry !== void 0 ? sidecarFor(entry) : void 0;
|
|
2065
|
-
if (sidecar !== void 0)
|
|
1623
|
+
if (sidecar !== void 0) writeFileSync2(sidecarPath, sidecar, { mode: 420 });
|
|
2066
1624
|
const installed = readInstalledPlugins(options.home);
|
|
2067
1625
|
const installedIds = /* @__PURE__ */ new Set();
|
|
2068
1626
|
if (installed.state !== "unreadable")
|
|
@@ -2175,11 +1733,11 @@ __name(build, "build");
|
|
|
2175
1733
|
function copyFolderSource(dir, root, options, findings) {
|
|
2176
1734
|
let real;
|
|
2177
1735
|
try {
|
|
2178
|
-
real =
|
|
1736
|
+
real = realpathSync.native(dir);
|
|
2179
1737
|
} catch {
|
|
2180
1738
|
throw new PlanRefusal(66, `${dir} was not found.`);
|
|
2181
1739
|
}
|
|
2182
|
-
if (!
|
|
1740
|
+
if (!lstatSync4(real).isDirectory()) throw new PlanRefusal(66, `${dir} is not a folder.`);
|
|
2183
1741
|
if (within(real, pluginsFolder(options.home)) || within(real, options.home))
|
|
2184
1742
|
throw new PlanRefusal(
|
|
2185
1743
|
REFUSED,
|
|
@@ -2209,15 +1767,15 @@ import { randomUUID as randomUUID2 } from "node:crypto";
|
|
|
2209
1767
|
import {
|
|
2210
1768
|
existsSync as existsSync3,
|
|
2211
1769
|
mkdirSync as mkdirSync5,
|
|
2212
|
-
readFileSync as
|
|
1770
|
+
readFileSync as readFileSync4,
|
|
2213
1771
|
readdirSync as readdirSync4,
|
|
2214
1772
|
renameSync as renameSync2,
|
|
2215
|
-
rmSync as
|
|
1773
|
+
rmSync as rmSync5,
|
|
2216
1774
|
rmdirSync,
|
|
2217
1775
|
statSync as statSync2,
|
|
2218
|
-
writeFileSync as
|
|
1776
|
+
writeFileSync as writeFileSync3
|
|
2219
1777
|
} from "node:fs";
|
|
2220
|
-
import { dirname as dirname4, join as
|
|
1778
|
+
import { dirname as dirname4, join as join6 } from "node:path";
|
|
2221
1779
|
var SimulatedCrash = class extends Error {
|
|
2222
1780
|
static {
|
|
2223
1781
|
__name(this, "SimulatedCrash");
|
|
@@ -2250,27 +1808,27 @@ __name(readRecords, "readRecords");
|
|
|
2250
1808
|
function writeJsonAtomic(path, value) {
|
|
2251
1809
|
mkdirSync5(dirname4(path), { recursive: true, mode: 448 });
|
|
2252
1810
|
const tmp = `${path}.${process.pid}.${randomUUID2().slice(0, 8)}.tmp`;
|
|
2253
|
-
|
|
1811
|
+
writeFileSync3(tmp, `${JSON.stringify(value, null, 2)}
|
|
2254
1812
|
`, { mode: 384 });
|
|
2255
1813
|
renameSync2(tmp, path);
|
|
2256
1814
|
}
|
|
2257
1815
|
__name(writeJsonAtomic, "writeJsonAtomic");
|
|
2258
1816
|
function trashFolder(home, path) {
|
|
2259
|
-
const bin =
|
|
1817
|
+
const bin = join6(stagingFolder(home), `trash-${Date.now()}-${randomUUID2().slice(0, 8)}`);
|
|
2260
1818
|
try {
|
|
2261
1819
|
mkdirSync5(dirname4(bin), { recursive: true, mode: 448 });
|
|
2262
1820
|
renameSync2(path, bin);
|
|
2263
|
-
|
|
1821
|
+
rmSync5(bin, { recursive: true, force: true });
|
|
2264
1822
|
} catch {
|
|
2265
1823
|
try {
|
|
2266
|
-
|
|
1824
|
+
rmSync5(path, { recursive: true, force: true });
|
|
2267
1825
|
} catch {
|
|
2268
1826
|
}
|
|
2269
1827
|
}
|
|
2270
1828
|
}
|
|
2271
1829
|
__name(trashFolder, "trashFolder");
|
|
2272
1830
|
function cacheFolderOf(home, plan) {
|
|
2273
|
-
return
|
|
1831
|
+
return join6(pluginCacheFolder(home), plan.marketplace, plan.name, plan.version);
|
|
2274
1832
|
}
|
|
2275
1833
|
__name(cacheFolderOf, "cacheFolderOf");
|
|
2276
1834
|
function layerOf(scope) {
|
|
@@ -2286,6 +1844,7 @@ function manifestFile(plan, where) {
|
|
|
2286
1844
|
files: plan.files,
|
|
2287
1845
|
surface: plan.surface,
|
|
2288
1846
|
surfaceSha256: plan.digest,
|
|
1847
|
+
manifestSha256: manifestDigest(plan.manifest),
|
|
2289
1848
|
consent: {
|
|
2290
1849
|
at: where.now.toISOString(),
|
|
2291
1850
|
scope: where.scope,
|
|
@@ -2363,7 +1922,7 @@ function commitInstall(plan, where) {
|
|
|
2363
1922
|
return { outcome: "installed", installPath };
|
|
2364
1923
|
} catch (error) {
|
|
2365
1924
|
if (!(error instanceof SimulatedCrash) && !wroteRecord) {
|
|
2366
|
-
if (wroteManifest)
|
|
1925
|
+
if (wroteManifest) rmSync5(installManifestPath(home, plan.id), { force: true });
|
|
2367
1926
|
if (moved) trashFolder(home, dest);
|
|
2368
1927
|
}
|
|
2369
1928
|
throw error;
|
|
@@ -2389,7 +1948,7 @@ function commitUpdate(plan, where) {
|
|
|
2389
1948
|
const oldPaths = new Set(existing.map((record) => realPathOrResolved(record.installPath)));
|
|
2390
1949
|
let moved = false;
|
|
2391
1950
|
let wroteRecord = false;
|
|
2392
|
-
const previousManifest = existsSync3(installManifestPath(home, plan.id)) ?
|
|
1951
|
+
const previousManifest = existsSync3(installManifestPath(home, plan.id)) ? readFileSync4(installManifestPath(home, plan.id)) : void 0;
|
|
2393
1952
|
try {
|
|
2394
1953
|
if (existsSync3(dest)) trashFolder(home, dest);
|
|
2395
1954
|
where.faults?.("before-move");
|
|
@@ -2422,7 +1981,7 @@ function commitUpdate(plan, where) {
|
|
|
2422
1981
|
} catch (error) {
|
|
2423
1982
|
if (!(error instanceof SimulatedCrash) && !wroteRecord) {
|
|
2424
1983
|
if (previousManifest !== void 0)
|
|
2425
|
-
|
|
1984
|
+
writeFileSync3(installManifestPath(home, plan.id), previousManifest, { mode: 384 });
|
|
2426
1985
|
if (moved) trashFolder(home, dest);
|
|
2427
1986
|
}
|
|
2428
1987
|
throw error;
|
|
@@ -2430,7 +1989,7 @@ function commitUpdate(plan, where) {
|
|
|
2430
1989
|
for (const old of oldPaths) {
|
|
2431
1990
|
if (samePath(old, dest) || !isInsidePluginCache(home, old)) continue;
|
|
2432
1991
|
try {
|
|
2433
|
-
|
|
1992
|
+
writeFileSync3(join6(old, ".orphaned_at"), `${where.now.toISOString()}
|
|
2434
1993
|
`, { mode: 384 });
|
|
2435
1994
|
} catch {
|
|
2436
1995
|
}
|
|
@@ -2477,7 +2036,7 @@ function removeInstall(id, which, options) {
|
|
|
2477
2036
|
const prior = readInstallManifest(home, id);
|
|
2478
2037
|
const originSource = prior.state === "ok" ? prior.manifest.installedFrom ?? null : null;
|
|
2479
2038
|
if (left.length === 0 && existsSync3(installManifestPath(home, id))) {
|
|
2480
|
-
|
|
2039
|
+
rmSync5(installManifestPath(home, id), { force: true });
|
|
2481
2040
|
manifestRemoved = true;
|
|
2482
2041
|
}
|
|
2483
2042
|
const usedElsewhere = [...remaining.values()].flat().some((record) => samePath(record.installPath, before.installPath));
|
|
@@ -2497,8 +2056,8 @@ function removeInstall(id, which, options) {
|
|
|
2497
2056
|
} else {
|
|
2498
2057
|
dataKept = true;
|
|
2499
2058
|
try {
|
|
2500
|
-
|
|
2501
|
-
|
|
2059
|
+
writeFileSync3(
|
|
2060
|
+
join6(data, ".origin.json"),
|
|
2502
2061
|
`${JSON.stringify({ id, removedAt: options.now.toISOString(), source: originSource }, null, 2)}
|
|
2503
2062
|
`,
|
|
2504
2063
|
{ mode: 384 }
|
|
@@ -2542,7 +2101,7 @@ var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
|
2542
2101
|
var STAGING_GRACE_MS = 60 * 60 * 1e3;
|
|
2543
2102
|
function readMarker(dir) {
|
|
2544
2103
|
try {
|
|
2545
|
-
const at = Date.parse(
|
|
2104
|
+
const at = Date.parse(readFileSync4(join6(dir, ".orphaned_at"), "utf8").trim());
|
|
2546
2105
|
return Number.isNaN(at) ? void 0 : at;
|
|
2547
2106
|
} catch {
|
|
2548
2107
|
return void 0;
|
|
@@ -2551,7 +2110,7 @@ function readMarker(dir) {
|
|
|
2551
2110
|
__name(readMarker, "readMarker");
|
|
2552
2111
|
function listDirs(path) {
|
|
2553
2112
|
try {
|
|
2554
|
-
return readdirSync4(path, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) =>
|
|
2113
|
+
return readdirSync4(path, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join6(path, entry.name));
|
|
2555
2114
|
} catch {
|
|
2556
2115
|
return [];
|
|
2557
2116
|
}
|
|
@@ -2585,7 +2144,7 @@ function findPrunable(home, now) {
|
|
|
2585
2144
|
const id = file.slice(0, -".json".length);
|
|
2586
2145
|
if (!records.has(id))
|
|
2587
2146
|
items.push({
|
|
2588
|
-
path:
|
|
2147
|
+
path: join6(installManifestsFolder(home), file),
|
|
2589
2148
|
kind: "install-manifest",
|
|
2590
2149
|
reason: "no install record names it"
|
|
2591
2150
|
});
|
|
@@ -2608,7 +2167,7 @@ function findPrunable(home, now) {
|
|
|
2608
2167
|
__name(findPrunable, "findPrunable");
|
|
2609
2168
|
function listAll(path) {
|
|
2610
2169
|
try {
|
|
2611
|
-
return readdirSync4(path).map((name) =>
|
|
2170
|
+
return readdirSync4(path).map((name) => join6(path, name));
|
|
2612
2171
|
} catch {
|
|
2613
2172
|
return [];
|
|
2614
2173
|
}
|
|
@@ -2619,7 +2178,7 @@ function prune(home, now, apply) {
|
|
|
2619
2178
|
return withStateFileLock(installedPluginsPath(home), () => {
|
|
2620
2179
|
const result = findPrunable(home, now);
|
|
2621
2180
|
for (const item of result.items) {
|
|
2622
|
-
if (item.kind === "install-manifest")
|
|
2181
|
+
if (item.kind === "install-manifest") rmSync5(item.path, { force: true });
|
|
2623
2182
|
else trashFolder(home, item.path);
|
|
2624
2183
|
}
|
|
2625
2184
|
for (const market of listDirs(pluginCacheFolder(home))) {
|
|
@@ -2640,6 +2199,16 @@ var MARKETPLACE_NOTICE = [
|
|
|
2640
2199
|
].join("\n");
|
|
2641
2200
|
var MARKETPLACE_BLOCKED = "Adding this marketplace is turned off in your settings.";
|
|
2642
2201
|
var DOWNLOAD_BLOCKED = "Downloading from this marketplace is turned off in your settings.";
|
|
2202
|
+
var MARKETPLACE_NOT_ALLOWED = "Adding this marketplace is not allowed: your settings name the only marketplaces that may be added, and it is not one of them.";
|
|
2203
|
+
var DOWNLOAD_NOT_ALLOWED = "Downloading from this marketplace is not allowed: your settings name the only marketplaces that may be used, and it is not one of them.";
|
|
2204
|
+
function marketplaceRefusalText(refusal) {
|
|
2205
|
+
return refusal === "blocked" ? MARKETPLACE_BLOCKED : MARKETPLACE_NOT_ALLOWED;
|
|
2206
|
+
}
|
|
2207
|
+
__name(marketplaceRefusalText, "marketplaceRefusalText");
|
|
2208
|
+
function downloadRefusalText(refusal) {
|
|
2209
|
+
return refusal === "blocked" ? DOWNLOAD_BLOCKED : DOWNLOAD_NOT_ALLOWED;
|
|
2210
|
+
}
|
|
2211
|
+
__name(downloadRefusalText, "downloadRefusalText");
|
|
2643
2212
|
function sameVersionChanged(id, version) {
|
|
2644
2213
|
return `${id} still says version ${version} but its files changed. Ask its author to raise the version, or remove it and install it again.`;
|
|
2645
2214
|
}
|
|
@@ -2705,10 +2274,16 @@ function entryAddress(remote) {
|
|
|
2705
2274
|
return remote.kind === "github" ? { source: "github", repo: remote.repo } : remote.kind === "archive" ? { source: "url", url: remote.url } : { source: "git", url: remote.url };
|
|
2706
2275
|
}
|
|
2707
2276
|
__name(entryAddress, "entryAddress");
|
|
2708
|
-
function
|
|
2709
|
-
|
|
2277
|
+
function downloadRefusal(market, remote, policy) {
|
|
2278
|
+
if (market !== void 0) {
|
|
2279
|
+
const refusal = sourceRefusal(market.source, policy);
|
|
2280
|
+
if (refusal !== void 0) return refusal;
|
|
2281
|
+
}
|
|
2282
|
+
if (remote !== void 0 && isBlockedSource(entryAddress(remote), policy.blocked))
|
|
2283
|
+
return "blocked";
|
|
2284
|
+
return void 0;
|
|
2710
2285
|
}
|
|
2711
|
-
__name(
|
|
2286
|
+
__name(downloadRefusal, "downloadRefusal");
|
|
2712
2287
|
function readFetchedCatalog(dir, display) {
|
|
2713
2288
|
const read = readCatalog(dir, "directory");
|
|
2714
2289
|
if (!read.ok)
|
|
@@ -2731,7 +2306,7 @@ function fetchNotes(fetched) {
|
|
|
2731
2306
|
}
|
|
2732
2307
|
__name(fetchNotes, "fetchNotes");
|
|
2733
2308
|
function placeMarketplace(catalog, source, fetched, options) {
|
|
2734
|
-
const dest =
|
|
2309
|
+
const dest = join7(marketplacesFolder(options.home), catalog.name);
|
|
2735
2310
|
const at = options.now.toISOString();
|
|
2736
2311
|
if (lstatExists(dest)) trashFolder(options.home, dest);
|
|
2737
2312
|
mkdirSync6(marketplacesFolder(options.home), { recursive: true, mode: 448 });
|
|
@@ -2748,14 +2323,14 @@ function placeMarketplace(catalog, source, fetched, options) {
|
|
|
2748
2323
|
}
|
|
2749
2324
|
__name(placeMarketplace, "placeMarketplace");
|
|
2750
2325
|
function newStaging(home) {
|
|
2751
|
-
const staging =
|
|
2326
|
+
const staging = join7(stagingFolder(home), randomUUID3());
|
|
2752
2327
|
mkdirSync6(staging, { recursive: true, mode: 448 });
|
|
2753
2328
|
return staging;
|
|
2754
2329
|
}
|
|
2755
2330
|
__name(newStaging, "newStaging");
|
|
2756
2331
|
function lstatExists(path) {
|
|
2757
2332
|
try {
|
|
2758
|
-
|
|
2333
|
+
lstatSync5(path);
|
|
2759
2334
|
return true;
|
|
2760
2335
|
} catch {
|
|
2761
2336
|
return false;
|
|
@@ -2789,9 +2364,14 @@ function newerVersions(home, name, catalog) {
|
|
|
2789
2364
|
return out;
|
|
2790
2365
|
}
|
|
2791
2366
|
__name(newerVersions, "newerVersions");
|
|
2367
|
+
function withBlockList(fetch2, blocked) {
|
|
2368
|
+
if (blocked === void 0 || blocked.length === 0) return fetch2;
|
|
2369
|
+
return { ...fetch2, blockedMarketplaces: blocked };
|
|
2370
|
+
}
|
|
2371
|
+
__name(withBlockList, "withBlockList");
|
|
2792
2372
|
function isInside(outer, inner) {
|
|
2793
2373
|
const rel = relative2(outer, inner);
|
|
2794
|
-
return rel !== "" && !rel.startsWith("..") && !
|
|
2374
|
+
return rel !== "" && !rel.startsWith("..") && !isAbsolute2(rel);
|
|
2795
2375
|
}
|
|
2796
2376
|
__name(isInside, "isInside");
|
|
2797
2377
|
async function refreshRemoteMarketplace(market, options) {
|
|
@@ -2806,8 +2386,15 @@ async function refreshRemoteMarketplace(market, options) {
|
|
|
2806
2386
|
...partial
|
|
2807
2387
|
}), "row");
|
|
2808
2388
|
const kind = market.source.source;
|
|
2809
|
-
|
|
2810
|
-
|
|
2389
|
+
const refusal = sourceRefusal(market.source, {
|
|
2390
|
+
blocked: options.blockedMarketplaces,
|
|
2391
|
+
allowed: options.allowedMarketplaces
|
|
2392
|
+
});
|
|
2393
|
+
if (refusal !== void 0)
|
|
2394
|
+
return row({
|
|
2395
|
+
outcome: "failed",
|
|
2396
|
+
message: refusal === "blocked" ? "refreshing it is turned off in your settings." : "refreshing it is not allowed: your settings do not name it among the marketplaces that may be used."
|
|
2397
|
+
});
|
|
2811
2398
|
const ref = typeof market.source.ref === "string" ? market.source.ref : void 0;
|
|
2812
2399
|
if ((kind === "github" || kind === "git") && ref !== void 0 && isCommitId(ref))
|
|
2813
2400
|
return row({ outcome: "pinned", message: `pinned at ${ref.slice(0, 7)}` });
|
|
@@ -2823,7 +2410,7 @@ async function refreshRemoteMarketplace(market, options) {
|
|
|
2823
2410
|
fetched = await fetchMarketplace(
|
|
2824
2411
|
market.source,
|
|
2825
2412
|
staging,
|
|
2826
|
-
options.fetch
|
|
2413
|
+
withBlockList(options.fetch, options.blockedMarketplaces)
|
|
2827
2414
|
);
|
|
2828
2415
|
} catch (error) {
|
|
2829
2416
|
if (options.fetch?.signal?.aborted) throw error;
|
|
@@ -3015,7 +2602,7 @@ function applicable(records, cwd, trusted) {
|
|
|
3015
2602
|
}
|
|
3016
2603
|
__name(applicable, "applicable");
|
|
3017
2604
|
function contextOf(deps, flags) {
|
|
3018
|
-
const cwd =
|
|
2605
|
+
const cwd = resolve2(deps.cwd(), flags.cwd ?? ".");
|
|
3019
2606
|
return { cwd: realPathOrResolved(cwd), trusted: deps.isTrusted(cwd) };
|
|
3020
2607
|
}
|
|
3021
2608
|
__name(contextOf, "contextOf");
|
|
@@ -3216,14 +2803,14 @@ function dataSize(path) {
|
|
|
3216
2803
|
const walk = /* @__PURE__ */ __name((dir) => {
|
|
3217
2804
|
for (const entry of readdirSync5(dir)) {
|
|
3218
2805
|
if (++seen > 2e4) return;
|
|
3219
|
-
const full =
|
|
3220
|
-
const stat2 =
|
|
2806
|
+
const full = join8(dir, entry);
|
|
2807
|
+
const stat2 = lstatSync6(full);
|
|
3221
2808
|
if (stat2.isDirectory()) walk(full);
|
|
3222
2809
|
else total += stat2.size;
|
|
3223
2810
|
}
|
|
3224
2811
|
}, "walk");
|
|
3225
2812
|
try {
|
|
3226
|
-
if (!
|
|
2813
|
+
if (!lstatSync6(path).isDirectory()) return null;
|
|
3227
2814
|
walk(path);
|
|
3228
2815
|
return total;
|
|
3229
2816
|
} catch {
|
|
@@ -3397,6 +2984,16 @@ async function runToggle(deps, flags, enable) {
|
|
|
3397
2984
|
{ id }
|
|
3398
2985
|
);
|
|
3399
2986
|
}
|
|
2987
|
+
if (enable) {
|
|
2988
|
+
const refusal = installedPluginRefusal(deps.namzuHome, id, {
|
|
2989
|
+
blocked: deps.blockedMarketplaces,
|
|
2990
|
+
allowed: deps.allowedMarketplaces
|
|
2991
|
+
});
|
|
2992
|
+
if (refusal !== void 0)
|
|
2993
|
+
return failure(deps, flags.json, command, EXIT_UNTRUSTED, installedRefusalText(id, refusal), {
|
|
2994
|
+
id
|
|
2995
|
+
});
|
|
2996
|
+
}
|
|
3400
2997
|
const layer = flags.scope ?? (chosen.scope === "user" ? "user" : "local");
|
|
3401
2998
|
const path = recordLayerPath(layer, { home: deps.namzuHome, cwd: ctx.cwd });
|
|
3402
2999
|
const own = readRecordLayer(path);
|
|
@@ -3481,7 +3078,6 @@ __name(runPluginRecords, "runPluginRecords");
|
|
|
3481
3078
|
|
|
3482
3079
|
// src/integrations/plugins/install-preview.ts
|
|
3483
3080
|
var one = /* @__PURE__ */ __name((value) => terminalDisplayText(value).replace(/[\t\n\r]+/g, " "), "one");
|
|
3484
|
-
var SCRIPTS_SHOWN = 12;
|
|
3485
3081
|
function list(items) {
|
|
3486
3082
|
return items.map(one).join(", ");
|
|
3487
3083
|
}
|
|
@@ -3510,15 +3106,12 @@ function runsLines(surface) {
|
|
|
3510
3106
|
);
|
|
3511
3107
|
for (const module of surface.modules)
|
|
3512
3108
|
lines.push(
|
|
3513
|
-
module.refused !== void 0 ? ` module ${one(module.path)} (not run: ${one(module.refused)})` : module.isolated === true ? ` module ${one(module.path)} (runs in
|
|
3109
|
+
module.refused !== void 0 ? ` module ${one(module.path)} (not run: ${one(module.refused)}; a tool call is refused while it stays refused)` : module.tool === true ? ` module ${one(module.path)} (tools: JavaScript that runs inside the session when the plugin is turned on; what it declares is not read before it runs)` : module.isolated === true ? ` module ${one(module.path)} (runs in a worker with your permissions${module.declares !== void 0 && module.declares.length > 0 ? `; ${list(module.declares)}` : ""})` : ` module ${one(module.path)} (JavaScript that runs inside the session; what it declares is not read before it runs)`
|
|
3514
3110
|
);
|
|
3515
|
-
|
|
3111
|
+
const moduleTools = new Set(surface.modules.filter((m) => m.tool === true).map((m) => m.path));
|
|
3112
|
+
for (const script of surface.scripts)
|
|
3516
3113
|
lines.push(
|
|
3517
|
-
` script ${one(script.path)} (${bytes(script.bytes)}${script.exec ? ", executable" : ""})`
|
|
3518
|
-
);
|
|
3519
|
-
if (surface.scripts.length > SCRIPTS_SHOWN)
|
|
3520
|
-
lines.push(
|
|
3521
|
-
` script and ${surface.scripts.length - SCRIPTS_SHOWN} more (all of them in --json)`
|
|
3114
|
+
` script ${one(script.path)} (${bytes(script.bytes)}${script.exec ? ", executable" : ""}${moduleTools.has(script.path) ? "; also imported as a module" : ""})`
|
|
3522
3115
|
);
|
|
3523
3116
|
return lines;
|
|
3524
3117
|
}
|
|
@@ -3570,16 +3163,21 @@ function renderInstallPreview(plan, options) {
|
|
|
3570
3163
|
__name(renderInstallPreview, "renderInstallPreview");
|
|
3571
3164
|
|
|
3572
3165
|
// src/integrations/plugins/update-compare.ts
|
|
3166
|
+
var OWN_MANIFESTS = /* @__PURE__ */ new Set([
|
|
3167
|
+
PLUGIN_MANIFEST_FILENAME,
|
|
3168
|
+
`${COMMON_MANIFEST_DIR}/${PLUGIN_MANIFEST_FILENAME}`
|
|
3169
|
+
]);
|
|
3573
3170
|
function compareUpdate(recorded, plan) {
|
|
3574
3171
|
const before = recorded.surface;
|
|
3575
3172
|
const changes = surfaceChanges(before, plan.surface);
|
|
3173
|
+
const manifestChanged = recorded.manifestSha256 !== manifestDigest(plan.manifest);
|
|
3576
3174
|
const nothingRunsDifferently = JSON.stringify(before) === JSON.stringify(plan.surface) && [.../* @__PURE__ */ new Set([...Object.keys(plan.files), ...Object.keys(recorded.files)])].filter((path) => plan.files[path] !== recorded.files[path]).every((path) => {
|
|
3577
|
-
|
|
3578
|
-
|
|
3175
|
+
if (path.split("/").pop() === PLUGIN_MANIFEST_FILENAME)
|
|
3176
|
+
return OWN_MANIFESTS.has(path) && !manifestChanged;
|
|
3579
3177
|
return !isExecutablePath(path, 0) && !plan.surface.scripts.some((script) => script.path === path);
|
|
3580
3178
|
});
|
|
3581
3179
|
return {
|
|
3582
|
-
changes,
|
|
3180
|
+
changes: recorded.manifestSha256 !== void 0 && manifestChanged ? [...changes, "the plugin manifest changed"] : changes,
|
|
3583
3181
|
unchangedSurface: recorded.surfaceSha256 === plan.digest || nothingRunsDifferently
|
|
3584
3182
|
};
|
|
3585
3183
|
}
|
|
@@ -3587,19 +3185,8 @@ __name(compareUpdate, "compareUpdate");
|
|
|
3587
3185
|
|
|
3588
3186
|
export {
|
|
3589
3187
|
readPluginManifestDetails,
|
|
3590
|
-
refProblem,
|
|
3591
|
-
repoPathProblem,
|
|
3592
|
-
describeSource,
|
|
3593
|
-
isBlockedSource,
|
|
3594
3188
|
FetchError,
|
|
3595
3189
|
fetchMarketplace,
|
|
3596
|
-
LOCAL_UPLOADS_MARKETPLACE,
|
|
3597
|
-
MAX_CATALOG_PLUGINS,
|
|
3598
|
-
marketplaceNameProblem,
|
|
3599
|
-
readCatalog,
|
|
3600
|
-
resolveEntrySource,
|
|
3601
|
-
parseMarketplaceAddress,
|
|
3602
|
-
realPathOf,
|
|
3603
3190
|
hashExecutableFiles,
|
|
3604
3191
|
PlanRefusal,
|
|
3605
3192
|
discardStaging,
|
|
@@ -3615,21 +3202,22 @@ export {
|
|
|
3615
3202
|
prune,
|
|
3616
3203
|
oneLine,
|
|
3617
3204
|
MARKETPLACE_NOTICE,
|
|
3618
|
-
|
|
3619
|
-
|
|
3205
|
+
marketplaceRefusalText,
|
|
3206
|
+
downloadRefusalText,
|
|
3620
3207
|
sameVersionChanged,
|
|
3621
3208
|
describeAddition,
|
|
3622
3209
|
sameSource,
|
|
3623
3210
|
anotherPlace,
|
|
3624
3211
|
marketplaceConsentText,
|
|
3625
3212
|
countNotInstallable,
|
|
3626
|
-
|
|
3213
|
+
downloadRefusal,
|
|
3627
3214
|
readFetchedCatalog,
|
|
3628
3215
|
fetchNotes,
|
|
3629
3216
|
placeMarketplace,
|
|
3630
3217
|
newStaging,
|
|
3631
3218
|
lstatExists,
|
|
3632
3219
|
newerVersions,
|
|
3220
|
+
withBlockList,
|
|
3633
3221
|
isInside,
|
|
3634
3222
|
refreshRemoteMarketplace,
|
|
3635
3223
|
compareUpdate,
|
|
@@ -3641,4 +3229,4 @@ export {
|
|
|
3641
3229
|
applicable,
|
|
3642
3230
|
runPluginRecords
|
|
3643
3231
|
};
|
|
3644
|
-
//# sourceMappingURL=chunk-
|
|
3232
|
+
//# sourceMappingURL=chunk-CQ2EGIRN.js.map
|