@ken-jo/agent-connector 0.4.95 → 0.4.97
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/LICENSE +202 -202
- package/NOTICE +6 -6
- package/README.md +605 -599
- package/dist/{action-Q7GGO4PA.js → action-IPFDPOZU.js} +16 -16
- package/dist/action-IPFDPOZU.js.map +1 -0
- package/dist/{amazon-q-ETMAGY3D.js → amazon-q-IT44LEWV.js} +6 -6
- package/dist/amazon-q-IT44LEWV.js.map +1 -0
- package/dist/{amp-BQZOL5GR.js → amp-CEWOSWQO.js} +4 -4
- package/dist/amp-CEWOSWQO.js.map +1 -0
- package/dist/{amp-67BZONGF.js → amp-P35FRU2Z.js} +7 -7
- package/dist/amp-P35FRU2Z.js.map +1 -0
- package/dist/{antigravity-EA4L225L.js → antigravity-LHFEFNMC.js} +5 -5
- package/dist/antigravity-LHFEFNMC.js.map +1 -0
- package/dist/antigravity-TWIWXTQH.js +18 -0
- package/dist/{antigravity-cli-B2HXZFYQ.js → antigravity-cli-MOKFSWOU.js} +5 -5
- package/dist/antigravity-cli-MOKFSWOU.js.map +1 -0
- package/dist/{antigravity-cli-OM6SC3PE.js → antigravity-cli-MPE27LPI.js} +9 -9
- package/dist/antigravity-cli-MPE27LPI.js.map +1 -0
- package/dist/audit-3E5JAOP2.js +311 -0
- package/dist/audit-3E5JAOP2.js.map +1 -0
- package/dist/{chunk-PW42ZXCB.js → chunk-3EP5V2F4.js} +3 -3
- package/dist/chunk-3EP5V2F4.js.map +1 -0
- package/dist/{chunk-MGTDQLJJ.js → chunk-3FINQ2ZF.js} +4 -4
- package/dist/chunk-3FINQ2ZF.js.map +1 -0
- package/dist/{chunk-KHO5WNTP.js → chunk-4GH2KA7V.js} +1 -1
- package/dist/chunk-4GH2KA7V.js.map +1 -0
- package/dist/{chunk-2Y2MZRLP.js → chunk-7C2IPIIB.js} +3 -3
- package/dist/chunk-7C2IPIIB.js.map +1 -0
- package/dist/{chunk-NLE2J5P4.js → chunk-7HHW23AC.js} +29 -29
- package/dist/chunk-7HHW23AC.js.map +1 -0
- package/dist/{chunk-XD7MY6HB.js → chunk-7PSNXUFK.js} +1 -1
- package/dist/chunk-7PSNXUFK.js.map +1 -0
- package/dist/{chunk-5IOTP7LQ.js → chunk-7ZFK2WEO.js} +7 -5
- package/dist/chunk-7ZFK2WEO.js.map +1 -0
- package/dist/{chunk-XC5SJ35F.js → chunk-C63AAXK7.js} +5 -5
- package/dist/chunk-C63AAXK7.js.map +1 -0
- package/dist/{chunk-UM5S7DKK.js → chunk-C747DYNT.js} +1 -1
- package/dist/chunk-C747DYNT.js.map +1 -0
- package/dist/{chunk-YPAXJ7EW.js → chunk-FHYR5Q5T.js} +13 -13
- package/dist/chunk-FHYR5Q5T.js.map +1 -0
- package/dist/{chunk-I5UXHIDT.js → chunk-GCPEPUD7.js} +8 -8
- package/dist/chunk-GCPEPUD7.js.map +1 -0
- package/dist/{chunk-ISEJWBFF.js → chunk-GZZCHJDP.js} +2 -2
- package/dist/chunk-GZZCHJDP.js.map +1 -0
- package/dist/{chunk-UMQ6NBQR.js → chunk-ILWHLGIC.js} +2 -2
- package/dist/chunk-ILWHLGIC.js.map +1 -0
- package/dist/{chunk-IVAWP6HH.js → chunk-IOJDZJ72.js} +2 -2
- package/dist/chunk-IOJDZJ72.js.map +1 -0
- package/dist/{chunk-NBYKLUF6.js → chunk-KFPSJRHR.js} +2 -2
- package/dist/chunk-KFPSJRHR.js.map +1 -0
- package/dist/{chunk-O7SDRBVB.js → chunk-KM2YXO6V.js} +1 -1
- package/dist/chunk-KM2YXO6V.js.map +1 -0
- package/dist/{chunk-7F5KHLEP.js → chunk-L2C5UMKW.js} +4 -4
- package/dist/chunk-L2C5UMKW.js.map +1 -0
- package/dist/{chunk-OP4KBXUO.js → chunk-LFWYYWLV.js} +1 -1
- package/dist/chunk-LFWYYWLV.js.map +1 -0
- package/dist/{chunk-APZDTY76.js → chunk-LQ55E7QI.js} +7 -7
- package/dist/chunk-LQ55E7QI.js.map +1 -0
- package/dist/{chunk-PAPMUAR5.js → chunk-MLU7NDAZ.js} +12 -12
- package/dist/chunk-MLU7NDAZ.js.map +1 -0
- package/dist/{chunk-H33M77DD.js → chunk-N4ENLZEU.js} +22 -19
- package/dist/chunk-N4ENLZEU.js.map +1 -0
- package/dist/{chunk-D4ELPBB5.js → chunk-NDMNMAKP.js} +43 -43
- package/dist/chunk-NDMNMAKP.js.map +1 -0
- package/dist/{chunk-H53QZQJI.js → chunk-PSGTHJQU.js} +1 -1
- package/dist/chunk-PSGTHJQU.js.map +1 -0
- package/dist/{chunk-FBJQGRET.js → chunk-Q4ISQHUQ.js} +1 -1
- package/dist/chunk-Q4ISQHUQ.js.map +1 -0
- package/dist/{chunk-6TF7MHG5.js → chunk-Q7PR2WGT.js} +2 -2
- package/dist/chunk-Q7PR2WGT.js.map +1 -0
- package/dist/{chunk-GZGLCCEE.js → chunk-QYOUQCC6.js} +1 -1
- package/dist/chunk-QYOUQCC6.js.map +1 -0
- package/dist/{chunk-Z2MRSS2I.js → chunk-SLJI5BOM.js} +2 -2
- package/dist/chunk-SLJI5BOM.js.map +1 -0
- package/dist/{chunk-JKKU2WKG.js → chunk-TGZFDXNH.js} +4 -4
- package/dist/chunk-TGZFDXNH.js.map +1 -0
- package/dist/{chunk-FJCUKXGX.js → chunk-THI4PI4H.js} +2 -2
- package/dist/chunk-THI4PI4H.js.map +1 -0
- package/dist/{chunk-MQPNU2CY.js → chunk-UZZTWWGG.js} +1 -1
- package/dist/chunk-UZZTWWGG.js.map +1 -0
- package/dist/{chunk-3NH2ARIS.js → chunk-WPTNMYYM.js} +2 -2
- package/dist/chunk-WPTNMYYM.js.map +1 -0
- package/dist/{chunk-OPXAP3AC.js → chunk-XN7S44U4.js} +1 -1
- package/dist/chunk-XN7S44U4.js.map +1 -0
- package/dist/{chunk-6WZODR3Z.js → chunk-XVEJAFKW.js} +5 -5
- package/dist/chunk-XVEJAFKW.js.map +1 -0
- package/dist/{chunk-BEFVJ2OE.js → chunk-XXLCMSD3.js} +1 -1
- package/dist/chunk-XXLCMSD3.js.map +1 -0
- package/dist/{chunk-YT43MUSJ.js → chunk-XZWMJLIT.js} +1 -1
- package/dist/chunk-XZWMJLIT.js.map +1 -0
- package/dist/{chunk-4NHXLXSD.js → chunk-Y3K6KJMS.js} +2 -2
- package/dist/chunk-Y3K6KJMS.js.map +1 -0
- package/dist/{chunk-RK6VBLXP.js → chunk-ZSOS2KOR.js} +1 -1
- package/dist/chunk-ZSOS2KOR.js.map +1 -0
- package/dist/{claude-code-NMRKTAP7.js → claude-code-FS42PXZO.js} +4 -4
- package/dist/claude-code-FS42PXZO.js.map +1 -0
- package/dist/{claude-code-GRWO6XBZ.js → claude-code-QBWDT5RT.js} +11 -11
- package/dist/claude-code-QBWDT5RT.js.map +1 -0
- package/dist/cli/sdk.js +9 -8
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/{cline-25KW25IN.js → cline-JKEAYWVR.js} +6 -6
- package/dist/cline-JKEAYWVR.js.map +1 -0
- package/dist/{codebuddy-ZNYQACMF.js → codebuddy-EB6EYPC3.js} +7 -7
- package/dist/codebuddy-EB6EYPC3.js.map +1 -0
- package/dist/{codebuff-VR6JUDIY.js → codebuff-5RSXFU6G.js} +6 -6
- package/dist/codebuff-5RSXFU6G.js.map +1 -0
- package/dist/{codebuff-ETYT5UBL.js → codebuff-6KWBW6CT.js} +4 -4
- package/dist/codebuff-6KWBW6CT.js.map +1 -0
- package/dist/{codex-CPNKTXG3.js → codex-ART46CDD.js} +9 -9
- package/dist/codex-ART46CDD.js.map +1 -0
- package/dist/{codex-YAORPCOD.js → codex-DKBAAUCO.js} +4 -4
- package/dist/codex-DKBAAUCO.js.map +1 -0
- package/dist/{continue-WU2IB5KS.js → continue-JHZCMSPH.js} +8 -8
- package/dist/continue-JHZCMSPH.js.map +1 -0
- package/dist/{copilot-cli-MZTAWMPW.js → copilot-cli-CLBJACQ5.js} +4 -4
- package/dist/copilot-cli-CLBJACQ5.js.map +1 -0
- package/dist/{copilot-cli-PAP377OM.js → copilot-cli-QVAU5CFM.js} +7 -7
- package/dist/copilot-cli-QVAU5CFM.js.map +1 -0
- package/dist/{crush-3AVQA4YU.js → crush-7TORBYUL.js} +7 -7
- package/dist/crush-7TORBYUL.js.map +1 -0
- package/dist/{crush-QBXLNN7T.js → crush-A5C5USRL.js} +4 -4
- package/dist/crush-A5C5USRL.js.map +1 -0
- package/dist/{cursor-DIW43TRZ.js → cursor-D5SWDVSW.js} +3 -3
- package/dist/cursor-D5SWDVSW.js.map +1 -0
- package/dist/cursor-W7I4QUFO.js +22 -0
- package/dist/{detect-6V4LC3MA.js → detect-JHSA3G3U.js} +4 -4
- package/dist/detect-JHSA3G3U.js.map +1 -0
- package/dist/{devin-QMEM3OFA.js → devin-SSR7S4WX.js} +7 -7
- package/dist/devin-SSR7S4WX.js.map +1 -0
- package/dist/{doctor-2YDUVSAU.js → doctor-CQJ7TZPA.js} +26 -26
- package/dist/doctor-CQJ7TZPA.js.map +1 -0
- package/dist/{droid-MOKV53J4.js → droid-45PJ7JGF.js} +7 -7
- package/dist/droid-45PJ7JGF.js.map +1 -0
- package/dist/{droid-U3ZBLQFO.js → droid-PFQ2PZSF.js} +4 -4
- package/dist/droid-PFQ2PZSF.js.map +1 -0
- package/dist/{gemini-cli-47ZHCOZR.js → gemini-cli-24PFDK7D.js} +8 -8
- package/dist/gemini-cli-24PFDK7D.js.map +1 -0
- package/dist/{gemini-cli-NMVVBO3K.js → gemini-cli-Y6RJMU24.js} +4 -4
- package/dist/gemini-cli-Y6RJMU24.js.map +1 -0
- package/dist/{goose-64V46Y2W.js → goose-K2HKUTBK.js} +4 -4
- package/dist/goose-K2HKUTBK.js.map +1 -0
- package/dist/{goose-4EI5MYTI.js → goose-U5D3LCPC.js} +9 -9
- package/dist/goose-U5D3LCPC.js.map +1 -0
- package/dist/{grok-cli-QYQPDSVB.js → grok-cli-L2MHAPBY.js} +7 -7
- package/dist/grok-cli-L2MHAPBY.js.map +1 -0
- package/dist/{hermes-F75OSK3Y.js → hermes-2S5JUTTJ.js} +7 -7
- package/dist/hermes-2S5JUTTJ.js.map +1 -0
- package/dist/{hermes-F3EGTK6N.js → hermes-MF3NX4ZY.js} +4 -4
- package/dist/hermes-MF3NX4ZY.js.map +1 -0
- package/dist/{hook-OEVRDMXD.js → hook-VHICXHXL.js} +16 -16
- package/dist/hook-VHICXHXL.js.map +1 -0
- package/dist/index.js +5 -5
- package/dist/{install-5NMCUDG5.js → install-WLENR4KF.js} +192 -28
- package/dist/install-WLENR4KF.js.map +1 -0
- package/dist/{jetbrains-copilot-ZGIWI6YV.js → jetbrains-copilot-Z4FC3RM3.js} +6 -6
- package/dist/jetbrains-copilot-Z4FC3RM3.js.map +1 -0
- package/dist/{junie-DIFN2P22.js → junie-ULGJJIHB.js} +6 -6
- package/dist/junie-ULGJJIHB.js.map +1 -0
- package/dist/{kilo-SW7BH6EG.js → kilo-SMHPOHJ5.js} +4 -4
- package/dist/kilo-SMHPOHJ5.js.map +1 -0
- package/dist/{kilo-EMZJBEBB.js → kilo-WWIJOVWD.js} +8 -8
- package/dist/kilo-WWIJOVWD.js.map +1 -0
- package/dist/{kilo-cli-S3GXBPAE.js → kilo-cli-QKE2EQLS.js} +8 -8
- package/dist/kilo-cli-QKE2EQLS.js.map +1 -0
- package/dist/{kilo-cli-ZF272ZHN.js → kilo-cli-T2SRRRJS.js} +5 -5
- package/dist/kilo-cli-T2SRRRJS.js.map +1 -0
- package/dist/{kimi-IQJOIY6B.js → kimi-JMUFTVSF.js} +7 -7
- package/dist/kimi-JMUFTVSF.js.map +1 -0
- package/dist/{kimi-5FHEXGZD.js → kimi-MSIDEMCI.js} +4 -4
- package/dist/kimi-MSIDEMCI.js.map +1 -0
- package/dist/{kiro-WGOI5CGT.js → kiro-NYRRBIKW.js} +4 -4
- package/dist/kiro-NYRRBIKW.js.map +1 -0
- package/dist/{kiro-BYX4HEAJ.js → kiro-UWUCRKR3.js} +7 -7
- package/dist/kiro-UWUCRKR3.js.map +1 -0
- package/dist/{leaderboard-XEKS7B3H.js → leaderboard-NJWKGMXP.js} +7 -7
- package/dist/leaderboard-NJWKGMXP.js.map +1 -0
- package/dist/{mimo-code-7R53QDHB.js → mimo-code-BPNYYIVM.js} +7 -7
- package/dist/mimo-code-BPNYYIVM.js.map +1 -0
- package/dist/{mistral-vibe-LHJ55FSB.js → mistral-vibe-LT3DAJ3L.js} +6 -6
- package/dist/mistral-vibe-LT3DAJ3L.js.map +1 -0
- package/dist/{mux-XM6AP35L.js → mux-7PIJ7HUQ.js} +4 -4
- package/dist/mux-7PIJ7HUQ.js.map +1 -0
- package/dist/{mux-NYCNGL43.js → mux-AHNUAY5Z.js} +6 -6
- package/dist/mux-AHNUAY5Z.js.map +1 -0
- package/dist/{nemoclaw-WSIPSE7U.js → nemoclaw-RE5RZASZ.js} +7 -7
- package/dist/nemoclaw-RE5RZASZ.js.map +1 -0
- package/dist/{omp-562NK5BJ.js → omp-D2EXEPH7.js} +7 -7
- package/dist/omp-D2EXEPH7.js.map +1 -0
- package/dist/{open-interpreter-I2CNOEXY.js → open-interpreter-SSGBEUKX.js} +6 -6
- package/dist/open-interpreter-SSGBEUKX.js.map +1 -0
- package/dist/openclaw-IJ33K45M.js +17 -0
- package/dist/{openclaw-5EQFGOWL.js → openclaw-KAFTNLR2.js} +4 -4
- package/dist/openclaw-KAFTNLR2.js.map +1 -0
- package/dist/{opencode-YS4WX2E2.js → opencode-YKUKZY3J.js} +7 -7
- package/dist/opencode-YKUKZY3J.js.map +1 -0
- package/dist/{opencode-QGP4ALQY.js → opencode-Z65JYILL.js} +4 -4
- package/dist/opencode-Z65JYILL.js.map +1 -0
- package/dist/{openhands-QMYIKNOS.js → openhands-SEZMCUC3.js} +7 -7
- package/dist/openhands-SEZMCUC3.js.map +1 -0
- package/dist/{package-G25GVTH2.js → package-JECVQEFT.js} +15 -15
- package/dist/package-JECVQEFT.js.map +1 -0
- package/dist/{pi-GGDQREVG.js → pi-DLKCPOJE.js} +4 -4
- package/dist/pi-DLKCPOJE.js.map +1 -0
- package/dist/{pi-644FIN3A.js → pi-YPYV2ULH.js} +6 -6
- package/dist/pi-YPYV2ULH.js.map +1 -0
- package/dist/{qwen-code-GQILBJ5B.js → qwen-code-26CSFDX6.js} +4 -4
- package/dist/qwen-code-26CSFDX6.js.map +1 -0
- package/dist/{qwen-code-STDMX7EM.js → qwen-code-ZHCLCYMC.js} +9 -9
- package/dist/qwen-code-ZHCLCYMC.js.map +1 -0
- package/dist/{roo-code-DLPIHHQ6.js → roo-code-7F4HYB34.js} +6 -6
- package/dist/roo-code-7F4HYB34.js.map +1 -0
- package/dist/{roo-code-SUWI4BBN.js → roo-code-HSAE2CJU.js} +4 -4
- package/dist/roo-code-HSAE2CJU.js.map +1 -0
- package/dist/runtime/index.js +14 -14
- package/dist/sdk/index.js +6 -6
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/test.js +11 -11
- package/dist/{serve-XTMIUHKK.js → serve-LYSBH43G.js} +16 -16
- package/dist/serve-LYSBH43G.js.map +1 -0
- package/dist/{status-VJAGO4Z7.js → status-PHKKGEW5.js} +11 -11
- package/dist/status-PHKKGEW5.js.map +1 -0
- package/dist/{statusline-EY2E2UGF.js → statusline-ZDD4OZ4F.js} +15 -15
- package/dist/statusline-ZDD4OZ4F.js.map +1 -0
- package/dist/{synthetic-6FRA7P5Q.js → synthetic-LUT6V6SD.js} +4 -4
- package/dist/synthetic-LUT6V6SD.js.map +1 -0
- package/dist/{telemetry-OLZQBADT.js → telemetry-HDGMI2BK.js} +10 -10
- package/dist/telemetry-HDGMI2BK.js.map +1 -0
- package/dist/{trae-CPPYASR2.js → trae-SIQI3C66.js} +4 -4
- package/dist/trae-SIQI3C66.js.map +1 -0
- package/dist/{trae-UOYD6JZZ.js → trae-Y67HSDOW.js} +6 -6
- package/dist/trae-Y67HSDOW.js.map +1 -0
- package/dist/{uninstall-AZEUPAND.js → uninstall-RWO2GM2I.js} +21 -21
- package/dist/uninstall-RWO2GM2I.js.map +1 -0
- package/dist/{upgrade-CAUUHSSC.js → upgrade-YJCXNUEE.js} +21 -21
- package/dist/upgrade-YJCXNUEE.js.map +1 -0
- package/dist/{usage-3KHZ4RYZ.js → usage-IWO4RQN6.js} +4 -4
- package/dist/usage-IWO4RQN6.js.map +1 -0
- package/dist/{usage-event-TZWOZPRJ.js → usage-event-AFFKCLHE.js} +15 -15
- package/dist/usage-event-AFFKCLHE.js.map +1 -0
- package/dist/{vscode-copilot-NIMH2DGU.js → vscode-copilot-5CI5B3X6.js} +7 -7
- package/dist/vscode-copilot-5CI5B3X6.js.map +1 -0
- package/dist/{warp-NRBBJQR2.js → warp-5YBSP7FP.js} +4 -4
- package/dist/warp-5YBSP7FP.js.map +1 -0
- package/dist/{warp-QYJGKURM.js → warp-INAKVGBV.js} +6 -6
- package/dist/warp-INAKVGBV.js.map +1 -0
- package/dist/{windsurf-75LLZ37C.js → windsurf-4HM57QAY.js} +6 -6
- package/dist/windsurf-4HM57QAY.js.map +1 -0
- package/dist/{zed-XJFOOKCO.js → zed-XXCNYOIN.js} +4 -4
- package/dist/zed-XXCNYOIN.js.map +1 -0
- package/dist/{zed-HKAZXEJW.js → zed-YN5X37PQ.js} +7 -7
- package/dist/zed-YN5X37PQ.js.map +1 -0
- package/package.json +92 -88
- package/dist/action-Q7GGO4PA.js.map +0 -1
- package/dist/amazon-q-ETMAGY3D.js.map +0 -1
- package/dist/amp-67BZONGF.js.map +0 -1
- package/dist/amp-BQZOL5GR.js.map +0 -1
- package/dist/antigravity-EA4L225L.js.map +0 -1
- package/dist/antigravity-VXLDLTO7.js +0 -18
- package/dist/antigravity-cli-B2HXZFYQ.js.map +0 -1
- package/dist/antigravity-cli-OM6SC3PE.js.map +0 -1
- package/dist/chunk-2Y2MZRLP.js.map +0 -1
- package/dist/chunk-3NH2ARIS.js.map +0 -1
- package/dist/chunk-4NHXLXSD.js.map +0 -1
- package/dist/chunk-5IOTP7LQ.js.map +0 -1
- package/dist/chunk-6TF7MHG5.js.map +0 -1
- package/dist/chunk-6WZODR3Z.js.map +0 -1
- package/dist/chunk-7F5KHLEP.js.map +0 -1
- package/dist/chunk-APZDTY76.js.map +0 -1
- package/dist/chunk-BEFVJ2OE.js.map +0 -1
- package/dist/chunk-D4ELPBB5.js.map +0 -1
- package/dist/chunk-FBJQGRET.js.map +0 -1
- package/dist/chunk-FJCUKXGX.js.map +0 -1
- package/dist/chunk-GZGLCCEE.js.map +0 -1
- package/dist/chunk-H33M77DD.js.map +0 -1
- package/dist/chunk-H53QZQJI.js.map +0 -1
- package/dist/chunk-I5UXHIDT.js.map +0 -1
- package/dist/chunk-ISEJWBFF.js.map +0 -1
- package/dist/chunk-IVAWP6HH.js.map +0 -1
- package/dist/chunk-JKKU2WKG.js.map +0 -1
- package/dist/chunk-KHO5WNTP.js.map +0 -1
- package/dist/chunk-MGTDQLJJ.js.map +0 -1
- package/dist/chunk-MQPNU2CY.js.map +0 -1
- package/dist/chunk-NBYKLUF6.js.map +0 -1
- package/dist/chunk-NLE2J5P4.js.map +0 -1
- package/dist/chunk-O7SDRBVB.js.map +0 -1
- package/dist/chunk-OP4KBXUO.js.map +0 -1
- package/dist/chunk-OPXAP3AC.js.map +0 -1
- package/dist/chunk-PAPMUAR5.js.map +0 -1
- package/dist/chunk-PW42ZXCB.js.map +0 -1
- package/dist/chunk-RK6VBLXP.js.map +0 -1
- package/dist/chunk-UM5S7DKK.js.map +0 -1
- package/dist/chunk-UMQ6NBQR.js.map +0 -1
- package/dist/chunk-XC5SJ35F.js.map +0 -1
- package/dist/chunk-XD7MY6HB.js.map +0 -1
- package/dist/chunk-YPAXJ7EW.js.map +0 -1
- package/dist/chunk-YT43MUSJ.js.map +0 -1
- package/dist/chunk-Z2MRSS2I.js.map +0 -1
- package/dist/claude-code-GRWO6XBZ.js.map +0 -1
- package/dist/claude-code-NMRKTAP7.js.map +0 -1
- package/dist/cline-25KW25IN.js.map +0 -1
- package/dist/codebuddy-ZNYQACMF.js.map +0 -1
- package/dist/codebuff-ETYT5UBL.js.map +0 -1
- package/dist/codebuff-VR6JUDIY.js.map +0 -1
- package/dist/codex-CPNKTXG3.js.map +0 -1
- package/dist/codex-YAORPCOD.js.map +0 -1
- package/dist/continue-WU2IB5KS.js.map +0 -1
- package/dist/copilot-cli-MZTAWMPW.js.map +0 -1
- package/dist/copilot-cli-PAP377OM.js.map +0 -1
- package/dist/crush-3AVQA4YU.js.map +0 -1
- package/dist/crush-QBXLNN7T.js.map +0 -1
- package/dist/cursor-DIW43TRZ.js.map +0 -1
- package/dist/cursor-GSLUET3V.js +0 -22
- package/dist/detect-6V4LC3MA.js.map +0 -1
- package/dist/devin-QMEM3OFA.js.map +0 -1
- package/dist/doctor-2YDUVSAU.js.map +0 -1
- package/dist/droid-MOKV53J4.js.map +0 -1
- package/dist/droid-U3ZBLQFO.js.map +0 -1
- package/dist/gemini-cli-47ZHCOZR.js.map +0 -1
- package/dist/gemini-cli-NMVVBO3K.js.map +0 -1
- package/dist/goose-4EI5MYTI.js.map +0 -1
- package/dist/goose-64V46Y2W.js.map +0 -1
- package/dist/grok-cli-QYQPDSVB.js.map +0 -1
- package/dist/hermes-F3EGTK6N.js.map +0 -1
- package/dist/hermes-F75OSK3Y.js.map +0 -1
- package/dist/hook-OEVRDMXD.js.map +0 -1
- package/dist/install-5NMCUDG5.js.map +0 -1
- package/dist/jetbrains-copilot-ZGIWI6YV.js.map +0 -1
- package/dist/junie-DIFN2P22.js.map +0 -1
- package/dist/kilo-EMZJBEBB.js.map +0 -1
- package/dist/kilo-SW7BH6EG.js.map +0 -1
- package/dist/kilo-cli-S3GXBPAE.js.map +0 -1
- package/dist/kilo-cli-ZF272ZHN.js.map +0 -1
- package/dist/kimi-5FHEXGZD.js.map +0 -1
- package/dist/kimi-IQJOIY6B.js.map +0 -1
- package/dist/kiro-BYX4HEAJ.js.map +0 -1
- package/dist/kiro-WGOI5CGT.js.map +0 -1
- package/dist/leaderboard-XEKS7B3H.js.map +0 -1
- package/dist/mimo-code-7R53QDHB.js.map +0 -1
- package/dist/mistral-vibe-LHJ55FSB.js.map +0 -1
- package/dist/mux-NYCNGL43.js.map +0 -1
- package/dist/mux-XM6AP35L.js.map +0 -1
- package/dist/nemoclaw-WSIPSE7U.js.map +0 -1
- package/dist/omp-562NK5BJ.js.map +0 -1
- package/dist/open-interpreter-I2CNOEXY.js.map +0 -1
- package/dist/openclaw-5EQFGOWL.js.map +0 -1
- package/dist/openclaw-7EYBQS4R.js +0 -17
- package/dist/opencode-QGP4ALQY.js.map +0 -1
- package/dist/opencode-YS4WX2E2.js.map +0 -1
- package/dist/openhands-QMYIKNOS.js.map +0 -1
- package/dist/package-G25GVTH2.js.map +0 -1
- package/dist/pi-644FIN3A.js.map +0 -1
- package/dist/pi-GGDQREVG.js.map +0 -1
- package/dist/qwen-code-GQILBJ5B.js.map +0 -1
- package/dist/qwen-code-STDMX7EM.js.map +0 -1
- package/dist/roo-code-DLPIHHQ6.js.map +0 -1
- package/dist/roo-code-SUWI4BBN.js.map +0 -1
- package/dist/serve-XTMIUHKK.js.map +0 -1
- package/dist/status-VJAGO4Z7.js.map +0 -1
- package/dist/statusline-EY2E2UGF.js.map +0 -1
- package/dist/synthetic-6FRA7P5Q.js.map +0 -1
- package/dist/telemetry-OLZQBADT.js.map +0 -1
- package/dist/trae-CPPYASR2.js.map +0 -1
- package/dist/trae-UOYD6JZZ.js.map +0 -1
- package/dist/uninstall-AZEUPAND.js.map +0 -1
- package/dist/upgrade-CAUUHSSC.js.map +0 -1
- package/dist/usage-3KHZ4RYZ.js.map +0 -1
- package/dist/usage-event-TZWOZPRJ.js.map +0 -1
- package/dist/vscode-copilot-NIMH2DGU.js.map +0 -1
- package/dist/warp-NRBBJQR2.js.map +0 -1
- package/dist/warp-QYJGKURM.js.map +0 -1
- package/dist/windsurf-75LLZ37C.js.map +0 -1
- package/dist/zed-HKAZXEJW.js.map +0 -1
- package/dist/zed-XJFOOKCO.js.map +0 -1
- /package/dist/{antigravity-VXLDLTO7.js.map → antigravity-TWIWXTQH.js.map} +0 -0
- /package/dist/{cursor-GSLUET3V.js.map → cursor-W7I4QUFO.js.map} +0 -0
- /package/dist/{openclaw-7EYBQS4R.js.map → openclaw-IJ33K45M.js.map} +0 -0
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
installConnector,
|
|
4
4
|
installViaMarketplace,
|
|
5
5
|
parseInstallMethod
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-MLU7NDAZ.js";
|
|
7
|
+
import "./chunk-LQ55E7QI.js";
|
|
8
|
+
import "./chunk-7C2IPIIB.js";
|
|
9
|
+
import "./chunk-C747DYNT.js";
|
|
10
|
+
import "./chunk-XVEJAFKW.js";
|
|
11
|
+
import "./chunk-XN7S44U4.js";
|
|
12
12
|
import {
|
|
13
13
|
buildConnectorSummary,
|
|
14
14
|
fail,
|
|
@@ -17,25 +17,25 @@ import {
|
|
|
17
17
|
parseTargets,
|
|
18
18
|
print,
|
|
19
19
|
renderInstallResult
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-N4ENLZEU.js";
|
|
21
|
+
import "./chunk-SLJI5BOM.js";
|
|
22
|
+
import "./chunk-GZZCHJDP.js";
|
|
23
|
+
import "./chunk-4GH2KA7V.js";
|
|
24
24
|
import {
|
|
25
25
|
findConnectorConfig,
|
|
26
26
|
loadConnectorFromPath
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-3EP5V2F4.js";
|
|
28
|
+
import "./chunk-7ZFK2WEO.js";
|
|
29
|
+
import "./chunk-NDMNMAKP.js";
|
|
30
|
+
import "./chunk-KFPSJRHR.js";
|
|
31
|
+
import "./chunk-PSGTHJQU.js";
|
|
32
|
+
import "./chunk-XXLCMSD3.js";
|
|
33
|
+
import "./chunk-3FINQ2ZF.js";
|
|
34
|
+
import "./chunk-Y3K6KJMS.js";
|
|
35
|
+
import "./chunk-ILWHLGIC.js";
|
|
36
36
|
import {
|
|
37
37
|
sourcesDir
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-QYOUQCC6.js";
|
|
39
39
|
|
|
40
40
|
// src/cli/commands/install.ts
|
|
41
41
|
import { parseArgs } from "util";
|
|
@@ -47,13 +47,24 @@ import {
|
|
|
47
47
|
existsSync,
|
|
48
48
|
mkdirSync,
|
|
49
49
|
readdirSync,
|
|
50
|
+
readFileSync,
|
|
50
51
|
renameSync,
|
|
51
52
|
rmSync,
|
|
52
53
|
writeFileSync
|
|
53
54
|
} from "fs";
|
|
54
55
|
import { tmpdir } from "os";
|
|
55
|
-
import { isAbsolute, join, relative, resolve } from "path";
|
|
56
|
+
import { basename, isAbsolute, join, relative, resolve } from "path";
|
|
57
|
+
import { fileURLToPath } from "url";
|
|
56
58
|
var GITHUB_SEG = /^[A-Za-z0-9._-]+$/;
|
|
59
|
+
var NPM_UNSCOPED_NAME_RE = /^[a-z0-9][a-z0-9._~-]*$/i;
|
|
60
|
+
var NPM_SCOPE_RE = /^@[a-z0-9][a-z0-9._~-]*$/i;
|
|
61
|
+
function isSafeGitHubSegment(segment) {
|
|
62
|
+
return GITHUB_SEG.test(segment) && segment !== "." && segment !== "..";
|
|
63
|
+
}
|
|
64
|
+
function isSafeSubpath(subpath) {
|
|
65
|
+
if (subpath === void 0 || subpath === "") return true;
|
|
66
|
+
return subpath.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
67
|
+
}
|
|
57
68
|
function looksLocal(value) {
|
|
58
69
|
if (value === "") return true;
|
|
59
70
|
if (existsSync(value)) return true;
|
|
@@ -92,7 +103,7 @@ function parseRemoteSource(value) {
|
|
|
92
103
|
}
|
|
93
104
|
const hash = url.hash.replace(/^#/, "");
|
|
94
105
|
if (hash) ref = hash;
|
|
95
|
-
if (!
|
|
106
|
+
if (!isSafeGitHubSegment(owner2) || !isSafeGitHubSegment(repo2)) return null;
|
|
96
107
|
return cleanRemote({ owner: owner2, repo: repo2, ref, subpath: subpath2 });
|
|
97
108
|
}
|
|
98
109
|
const shorthand = raw.startsWith("github:") ? raw.slice("github:".length) : raw;
|
|
@@ -102,7 +113,7 @@ function parseRemoteSource(value) {
|
|
|
102
113
|
const owner = segs[0];
|
|
103
114
|
const repo = segs[1].replace(/\.git$/, "");
|
|
104
115
|
const subpath = segs.length > 2 ? segs.slice(2).join("/") : void 0;
|
|
105
|
-
if (!
|
|
116
|
+
if (!isSafeGitHubSegment(owner) || !isSafeGitHubSegment(repo)) return null;
|
|
106
117
|
return cleanRemote({ owner, repo, ref: refPart, subpath });
|
|
107
118
|
}
|
|
108
119
|
function splitHash(value) {
|
|
@@ -116,7 +127,7 @@ function finalizeFromPath(owner, repoAndRest, _ref) {
|
|
|
116
127
|
const segs = pathPart.split("/").filter(Boolean);
|
|
117
128
|
const repo = (segs[0] ?? "").replace(/\.git$/, "");
|
|
118
129
|
const subpath = segs.length > 1 ? segs.slice(1).join("/") : void 0;
|
|
119
|
-
if (!
|
|
130
|
+
if (!isSafeGitHubSegment(owner) || !isSafeGitHubSegment(repo)) return null;
|
|
120
131
|
return cleanRemote({ owner, repo, ref, subpath });
|
|
121
132
|
}
|
|
122
133
|
var REF_RE = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;
|
|
@@ -125,6 +136,7 @@ function isSafeRef(ref) {
|
|
|
125
136
|
}
|
|
126
137
|
function cleanRemote(r) {
|
|
127
138
|
if (r.ref !== void 0 && !isSafeRef(r.ref)) return null;
|
|
139
|
+
if (!isSafeSubpath(r.subpath)) return null;
|
|
128
140
|
const out = { owner: r.owner, repo: r.repo };
|
|
129
141
|
if (r.ref) out.ref = r.ref;
|
|
130
142
|
if (r.subpath && r.subpath !== "") out.subpath = r.subpath;
|
|
@@ -144,7 +156,75 @@ function parseGitUrl(value) {
|
|
|
144
156
|
if (ref) out.ref = ref;
|
|
145
157
|
return out;
|
|
146
158
|
}
|
|
159
|
+
function parseNpmSource(value) {
|
|
160
|
+
const raw = value.trim();
|
|
161
|
+
if (!raw.startsWith("npm:")) return null;
|
|
162
|
+
const spec = raw.slice("npm:".length).trim();
|
|
163
|
+
if (spec === "" || /\s/.test(spec) || spec.startsWith("-")) return null;
|
|
164
|
+
let packageName;
|
|
165
|
+
if (spec.startsWith("@")) {
|
|
166
|
+
const match = spec.match(/^(@[^/@\s]+\/[^/@\s]+)(?:@([^/\s]+))?$/);
|
|
167
|
+
if (!match) return null;
|
|
168
|
+
packageName = match[1];
|
|
169
|
+
} else {
|
|
170
|
+
const match = spec.match(/^([^/@\s]+)(?:@([^/\s]+))?$/);
|
|
171
|
+
if (!match) return null;
|
|
172
|
+
packageName = match[1];
|
|
173
|
+
}
|
|
174
|
+
const parts = packageName.startsWith("@") ? packageName.split("/") : [packageName];
|
|
175
|
+
if (parts.length === 2) {
|
|
176
|
+
if (!NPM_SCOPE_RE.test(parts[0]) || !NPM_UNSCOPED_NAME_RE.test(parts[1])) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
} else if (parts.length === 1) {
|
|
180
|
+
if (!NPM_UNSCOPED_NAME_RE.test(parts[0])) return null;
|
|
181
|
+
} else {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
sourceKind: "npm",
|
|
186
|
+
owner: "npm",
|
|
187
|
+
repo: packageName.replace(/^@/, "").replace(/\//g, "__"),
|
|
188
|
+
packageName,
|
|
189
|
+
packageSpec: spec
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function stripQueryAndHash(value) {
|
|
193
|
+
return value.split(/[?#]/, 1)[0] ?? value;
|
|
194
|
+
}
|
|
195
|
+
function archivePathname(value) {
|
|
196
|
+
try {
|
|
197
|
+
const url = new URL(value);
|
|
198
|
+
return url.pathname;
|
|
199
|
+
} catch {
|
|
200
|
+
return value;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function isTarballLike(value) {
|
|
204
|
+
const p = stripQueryAndHash(archivePathname(value)).toLowerCase();
|
|
205
|
+
return p.endsWith(".tgz") || p.endsWith(".tar.gz");
|
|
206
|
+
}
|
|
207
|
+
function parseArchiveSource(value) {
|
|
208
|
+
const raw = value.trim();
|
|
209
|
+
const explicit = raw.startsWith("archive:");
|
|
210
|
+
const source = explicit ? raw.slice("archive:".length).trim() : raw;
|
|
211
|
+
if (source === "") return null;
|
|
212
|
+
if (!explicit && !isTarballLike(source)) return null;
|
|
213
|
+
const pathish = stripQueryAndHash(archivePathname(source));
|
|
214
|
+
const base = basename(pathish).replace(/\.tar\.gz$/i, "").replace(/\.tgz$/i, "");
|
|
215
|
+
const repo = base || "source";
|
|
216
|
+
return {
|
|
217
|
+
sourceKind: "archive",
|
|
218
|
+
owner: "archive",
|
|
219
|
+
repo,
|
|
220
|
+
archiveUrl: source
|
|
221
|
+
};
|
|
222
|
+
}
|
|
147
223
|
function classifySource(value) {
|
|
224
|
+
const npm = parseNpmSource(value);
|
|
225
|
+
if (npm) return { kind: "remote", remote: npm };
|
|
226
|
+
const archive = parseArchiveSource(value);
|
|
227
|
+
if (archive) return { kind: "remote", remote: archive };
|
|
148
228
|
const gitUrl = parseGitUrl(value);
|
|
149
229
|
if (gitUrl) return { kind: "remote", remote: gitUrl };
|
|
150
230
|
if (looksLocal(value)) return { kind: "local", value };
|
|
@@ -152,6 +232,9 @@ function classifySource(value) {
|
|
|
152
232
|
return remote ? { kind: "remote", remote } : null;
|
|
153
233
|
}
|
|
154
234
|
function cloneUrl(r) {
|
|
235
|
+
if (r.sourceKind === "npm" || r.sourceKind === "archive") {
|
|
236
|
+
throw new Error(`${describeRemote(r)} is not a git clone source`);
|
|
237
|
+
}
|
|
155
238
|
return r.cloneUrl ?? `https://github.com/${r.owner}/${r.repo}.git`;
|
|
156
239
|
}
|
|
157
240
|
function tarballUrl(r) {
|
|
@@ -160,6 +243,12 @@ function tarballUrl(r) {
|
|
|
160
243
|
}
|
|
161
244
|
function sourceCacheDir(r) {
|
|
162
245
|
const safe = (s) => s.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
246
|
+
if (r.sourceKind === "npm") {
|
|
247
|
+
return join(sourcesDir(), `npm__${safe(r.packageName ?? r.repo)}__${shortHash(r.packageSpec ?? r.repo)}`);
|
|
248
|
+
}
|
|
249
|
+
if (r.sourceKind === "archive") {
|
|
250
|
+
return join(sourcesDir(), `archive__${safe(r.repo)}__${shortHash(r.archiveUrl ?? r.repo)}`);
|
|
251
|
+
}
|
|
163
252
|
const base = r.cloneUrl ? `${safe(r.owner)}__${safe(r.repo)}__${shortHash(r.cloneUrl)}` : `${safe(r.owner)}__${safe(r.repo)}`;
|
|
164
253
|
const name = r.ref ? `${base}__${safe(r.ref)}` : base;
|
|
165
254
|
return join(sourcesDir(), name);
|
|
@@ -177,6 +266,9 @@ function gitAvailable() {
|
|
|
177
266
|
}
|
|
178
267
|
function makeGitFetcher(urlFor = cloneUrl) {
|
|
179
268
|
return (remote, dest) => {
|
|
269
|
+
if (remote.sourceKind === "npm" || remote.sourceKind === "archive") {
|
|
270
|
+
throw new Error(`${describeRemote(remote)} is not a git clone source`);
|
|
271
|
+
}
|
|
180
272
|
if (!gitAvailable()) {
|
|
181
273
|
throw new Error(
|
|
182
274
|
"git is required to fetch a remote connector source but was not found on PATH. Install git, or pass a local --connector <path>."
|
|
@@ -202,7 +294,9 @@ async function tarballFetch(remote, dest) {
|
|
|
202
294
|
if (!res.ok) {
|
|
203
295
|
throw new Error(`failed to download ${url}: HTTP ${res.status} ${res.statusText}`);
|
|
204
296
|
}
|
|
205
|
-
|
|
297
|
+
await extractTarballBuffer(Buffer.from(await res.arrayBuffer()), dest);
|
|
298
|
+
}
|
|
299
|
+
function extractTarballBuffer(buf, dest) {
|
|
206
300
|
const work = join(tmpdir(), `ac-src-${process.pid}-${Date.now()}`);
|
|
207
301
|
mkdirSync(work, { recursive: true });
|
|
208
302
|
const tarPath = join(work, "source.tar.gz");
|
|
@@ -221,7 +315,75 @@ async function tarballFetch(remote, dest) {
|
|
|
221
315
|
renameSync(top, dest);
|
|
222
316
|
rmSync(work, { recursive: true, force: true });
|
|
223
317
|
}
|
|
318
|
+
async function archiveFetch(remote, dest) {
|
|
319
|
+
const source = remote.archiveUrl;
|
|
320
|
+
if (!source) throw new Error("archive source is missing archiveUrl");
|
|
321
|
+
if (/^https?:\/\//i.test(source)) {
|
|
322
|
+
const res = await fetch(source);
|
|
323
|
+
if (!res.ok) {
|
|
324
|
+
throw new Error(`failed to download ${source}: HTTP ${res.status} ${res.statusText}`);
|
|
325
|
+
}
|
|
326
|
+
await extractTarballBuffer(Buffer.from(await res.arrayBuffer()), dest);
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const archivePath = source.startsWith("file://") ? fileURLToPath(source) : source;
|
|
330
|
+
if (!existsSync(archivePath)) {
|
|
331
|
+
throw new Error(`archive source not found: ${source}`);
|
|
332
|
+
}
|
|
333
|
+
extractTarballBuffer(readFileSync(archivePath), dest);
|
|
334
|
+
}
|
|
335
|
+
function npmAvailable() {
|
|
336
|
+
try {
|
|
337
|
+
execFileSync("npm", ["--version"], { stdio: "ignore" });
|
|
338
|
+
return true;
|
|
339
|
+
} catch {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
async function npmFetch(remote, dest) {
|
|
344
|
+
const spec = remote.packageSpec;
|
|
345
|
+
if (!spec) throw new Error("npm source is missing packageSpec");
|
|
346
|
+
if (!npmAvailable()) {
|
|
347
|
+
throw new Error(
|
|
348
|
+
`npm is required to fetch npm:${spec} but was not found on PATH. Install npm, or pass a local --connector <path>.`
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
const work = join(tmpdir(), `ac-npm-${process.pid}-${Date.now()}`);
|
|
352
|
+
mkdirSync(work, { recursive: true });
|
|
353
|
+
let stdout;
|
|
354
|
+
try {
|
|
355
|
+
stdout = execFileSync(
|
|
356
|
+
"npm",
|
|
357
|
+
["pack", spec, "--pack-destination", work, "--silent"],
|
|
358
|
+
{ encoding: "utf8" }
|
|
359
|
+
);
|
|
360
|
+
} catch (err) {
|
|
361
|
+
rmSync(work, { recursive: true, force: true });
|
|
362
|
+
throw new Error(
|
|
363
|
+
`failed to fetch npm:${spec}: ${err instanceof Error ? err.message : String(err)}`
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
const packed = stdout.trim().split(/\r?\n/).filter(Boolean).pop();
|
|
367
|
+
if (!packed) {
|
|
368
|
+
rmSync(work, { recursive: true, force: true });
|
|
369
|
+
throw new Error(`failed to fetch npm:${spec}: npm pack produced no tarball`);
|
|
370
|
+
}
|
|
371
|
+
const tarPath = isAbsolute(packed) ? packed : join(work, packed);
|
|
372
|
+
try {
|
|
373
|
+
extractTarballBuffer(readFileSync(tarPath), dest);
|
|
374
|
+
} finally {
|
|
375
|
+
rmSync(work, { recursive: true, force: true });
|
|
376
|
+
}
|
|
377
|
+
}
|
|
224
378
|
var gitFetcher = async (remote, dest) => {
|
|
379
|
+
if (remote.sourceKind === "npm") {
|
|
380
|
+
await npmFetch(remote, dest);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (remote.sourceKind === "archive") {
|
|
384
|
+
await archiveFetch(remote, dest);
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
225
387
|
if (gitAvailable()) {
|
|
226
388
|
makeGitFetcher()(remote, dest);
|
|
227
389
|
return;
|
|
@@ -286,6 +448,8 @@ function findConfigWithin(dir) {
|
|
|
286
448
|
return hitDir === dirAbs ? hit : null;
|
|
287
449
|
}
|
|
288
450
|
function describeRemote(r) {
|
|
451
|
+
if (r.sourceKind === "npm") return `npm:${r.packageSpec ?? r.repo}`;
|
|
452
|
+
if (r.sourceKind === "archive") return `archive:${r.archiveUrl ?? r.repo}`;
|
|
289
453
|
let s = r.cloneUrl ?? `${r.owner}/${r.repo}`;
|
|
290
454
|
if (r.subpath) s += `/${r.subpath}`;
|
|
291
455
|
if (r.ref) s += `#${r.ref}`;
|
|
@@ -336,7 +500,7 @@ async function run(argv) {
|
|
|
336
500
|
const spec = source != null ? classifySource(source) : null;
|
|
337
501
|
if (source != null && spec == null) {
|
|
338
502
|
return fail(
|
|
339
|
-
`"${source}" is not a local path or a recognizable
|
|
503
|
+
`"${source}" is not a local path or a recognizable connector source (owner/repo[/subpath][#ref], github URL, git URL, npm:<package>[@version], archive:<path-or-url>, or .tgz/.tar.gz).`
|
|
340
504
|
);
|
|
341
505
|
}
|
|
342
506
|
if (spec != null && spec.kind === "remote") {
|
|
@@ -350,7 +514,7 @@ async function run(argv) {
|
|
|
350
514
|
const configPath = source ?? findConnectorConfig(projectDir);
|
|
351
515
|
if (!configPath) {
|
|
352
516
|
return fail(
|
|
353
|
-
"no connector config found. Pass a <source> (local path
|
|
517
|
+
"no connector config found. Pass a <source> (local path, owner/repo, npm:<package>, or archive tarball) or --connector <path>, or add an agent-connector.config.{mjs,js,json} to your project."
|
|
354
518
|
);
|
|
355
519
|
}
|
|
356
520
|
({ connector, modulePath } = await loadConnectorFromPath(configPath));
|
|
@@ -379,4 +543,4 @@ async function run(argv) {
|
|
|
379
543
|
export {
|
|
380
544
|
run
|
|
381
545
|
};
|
|
382
|
-
//# sourceMappingURL=install-
|
|
546
|
+
//# sourceMappingURL=install-WLENR4KF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/install.ts","../src/core/fetch-source.ts"],"sourcesContent":["/**\r\n * cli/commands/install — deploy a connector across its target platforms.\r\n *\r\n * Resolves the connector config (--connector <path>, else findConnectorConfig\r\n * walking up from the project dir), loads it into a live ResolvedConnector, and\r\n * hands it to the chosen DELIVERY METHOD's orchestration:\r\n *\r\n * --method direct (default) — the installer renders each host's native\r\n * MCP + hook + content config in place (zero behavior\r\n * change for existing scripts).\r\n * --method marketplace — stage the connector's plugin bundle under the\r\n * data-root and DRIVE the host's own plugin/marketplace\r\n * install flow (v1 driver: claude-code; other hosts get\r\n * never-silent skip/warn records with manual commands).\r\n *\r\n * Both methods emit the same ChangeRecords, rendered as a readable diff;\r\n * --dry-run renders the plan without writing or spawning. A double-install\r\n * guard (both directions) enforces exactly one method per (connector, host,\r\n * scope) — a refusal is a `warn` record, so the exit-1-on-warn convention\r\n * carries over.\r\n */\r\n\r\nimport { parseArgs } from \"node:util\";\r\n\r\nimport { installConnector } from \"../../core/installer.js\";\r\nimport { installViaMarketplace, parseInstallMethod } from \"../../core/marketplace.js\";\r\nimport { findConnectorConfig, loadConnectorFromPath } from \"../../core/load-connector.js\";\r\nimport { classifySource, resolveRemoteSource } from \"../../core/fetch-source.js\";\r\nimport {\r\n buildConnectorSummary,\r\n fail,\r\n maybePrintBanner,\r\n parseScope,\r\n parseTargets,\r\n print,\r\n renderInstallResult,\r\n} from \"../app.js\";\r\n\r\nexport async function run(argv: string[]): Promise<number> {\r\n const { values, positionals } = parseArgs({\r\n args: argv,\r\n options: {\r\n method: { type: \"string\", default: \"direct\" },\r\n scope: { type: \"string\", default: \"user\" },\r\n targets: { type: \"string\" },\r\n connector: { type: \"string\" },\r\n project: { type: \"string\" },\r\n \"dry-run\": { type: \"boolean\", default: false },\r\n // Memory surface: overwrite USER-EDITED managed blocks (hash drift).\r\n // Default behavior is warn-and-leave; --force backs the file up first.\r\n force: { type: \"boolean\", default: false },\r\n // Decorative-banner suppressor (no effect on command output bytes).\r\n quiet: { type: \"boolean\", default: false },\r\n },\r\n // A single positional <source> (local path OR remote GitHub spec) is the\r\n // ergonomic alias of --connector; either may be remote.\r\n allowPositionals: true,\r\n });\r\n\r\n maybePrintBanner({ quiet: values.quiet });\r\n\r\n const method = parseInstallMethod(values.method);\r\n if (method == null) {\r\n return fail(`invalid --method \"${values.method}\" (use direct|marketplace)`);\r\n }\r\n\r\n const projectDir = values.project ?? process.cwd();\r\n\r\n // A connector source may arrive as the first positional or via --connector,\n // and may be a LOCAL path or a REMOTE source spec (GitHub/raw git, npm:, or\n // archive tarball). The positional and the flag are equivalent; reject\n // ambiguity when both name a source.\n const positionalSource = positionals[0];\r\n if (positionalSource != null && values.connector != null) {\r\n return fail(\"pass a connector source as EITHER the positional <source> OR --connector, not both.\");\r\n }\r\n const source = positionalSource ?? values.connector;\r\n\r\n const scope = parseScope(values.scope);\r\n if (scope == null) return fail(`invalid --scope \"${values.scope}\" (use user|project)`);\r\n if (method === \"marketplace\" && scope !== \"user\") {\r\n return fail(\r\n \"--method marketplace supports --scope user only (project-scope plugin installs are deferred)\",\r\n );\r\n }\r\n\r\n // Resolve the source to a loadable connector. A REMOTE spec is fetched into a\r\n // STABLE cache dir under the data-root and GATED (must be an agent-connector\r\n // package) before handing off to the existing install flow. A LOCAL source —\r\n // or no source at all — keeps today's path-discovery behavior unchanged.\r\n let connector: Awaited<ReturnType<typeof loadConnectorFromPath>>[\"connector\"];\r\n let modulePath: string;\r\n const spec = source != null ? classifySource(source) : null;\r\n if (source != null && spec == null) {\n return fail(\n `\"${source}\" is not a local path or a recognizable connector source ` +\n \"(owner/repo[/subpath][#ref], github URL, git URL, npm:<package>[@version], archive:<path-or-url>, or .tgz/.tar.gz).\",\n );\n }\n if (spec != null && spec.kind === \"remote\") {\r\n try {\r\n const resolved = await resolveRemoteSource(spec.remote);\r\n ({ connector, modulePath } = resolved);\r\n } catch (err) {\r\n return fail(err instanceof Error ? err.message : String(err));\r\n }\r\n } else {\r\n const configPath = source ?? findConnectorConfig(projectDir);\r\n if (!configPath) {\n return fail(\n \"no connector config found. Pass a <source> (local path, owner/repo, npm:<package>, or archive tarball) or \" +\n \"--connector <path>, or add an agent-connector.config.{mjs,js,json} to your project.\",\n );\n }\n ({ connector, modulePath } = await loadConnectorFromPath(configPath));\r\n }\r\n\r\n const targets = parseTargets(values.targets);\r\n\r\n const result =\r\n method === \"marketplace\"\r\n ? await installViaMarketplace({\r\n connector,\r\n modulePath,\r\n scope,\r\n projectDir,\r\n dryRun: values[\"dry-run\"],\r\n ...(targets ? { targets } : {}),\r\n })\r\n : await installConnector({\r\n connector,\r\n modulePath,\r\n scope,\r\n projectDir,\r\n dryRun: values[\"dry-run\"],\r\n force: values.force,\r\n ...(targets ? { targets } : {}),\r\n });\r\n\r\n result.connector = buildConnectorSummary(connector);\r\n print(renderInstallResult(result, \"install\"));\r\n return result.changes.some((c) => c.action === \"warn\") ? 1 : 0;\r\n}\r\n","/**\r\n * core/fetch-source — resolve an `install <source>` argument that may be a\r\n * LOCAL path OR a REMOTE package/source spec into a local connector-config path.\n *\r\n * Responsibilities (MVP):\r\n * 1. CLASSIFY a source string as local-path vs. remote GitHub spec. A value\r\n * that exists on disk, or that looks like a filesystem path (starts with\r\n * `.`, `/`, `~`, a `file://` URL, or a Windows drive/UNC), stays LOCAL and\r\n * keeps today's behavior. Everything else is parsed as a remote spec.\r\n * 2. PARSE the supported remote forms:\n * owner/repo · owner/repo#ref · owner/repo/sub · owner/repo/sub#ref\n * github:owner/repo · https://github.com/owner/repo[/tree/ref/sub]\n * git@github.com:owner/repo.git · the .git suffix on any of the above.\n * npm:<package>[@version] · archive:<path-or-url> · *.tgz / *.tar.gz\n * 3. FETCH + PERSIST the repo to a STABLE cache dir under the data-root\r\n * (`sources/<owner>__<repo>[__<ref>]/`), NOT a temp dir, so a connector\r\n * with a local stdio server keeps resolving after install. Re-fetch updates\r\n * it. `git clone --depth 1` is preferred; a codeload tarball is the\r\n * fallback when `git` is unavailable.\r\n * 4. GATE: the fetched (sub)dir MUST contain an `agent-connector.config.*`\r\n * that loads — otherwise the target is not an agent-connector connector.\r\n *\r\n * The actual fetch is injected via a {@link Fetcher} seam so tests can drive the\r\n * pipeline against a `file://` git fixture without any real network/GitHub hit.\r\n */\r\n\r\nimport { execFileSync } from \"node:child_process\";\r\nimport { createHash } from \"node:crypto\";\r\nimport {\r\n existsSync,\r\n mkdirSync,\n readdirSync,\n readFileSync,\n renameSync,\n rmSync,\n writeFileSync,\n} from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { basename, isAbsolute, join, relative, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\r\nimport { findConnectorConfig, loadConnectorFromPath } from \"./load-connector.js\";\r\nimport { sourcesDir } from \"./paths.js\";\r\nimport type { ResolvedConnector } from \"./types.js\";\r\n\r\n/** A parsed remote source to fetch (a GitHub spec, or a raw git clone URL such\r\n * as `file://`/`ssh://`/`git@…`). `ref` is a branch/tag/sha; `subpath` is the\r\n * directory within the repo that holds the connector config. */\r\nexport interface RemoteSource {\n owner: string;\n repo: string;\n /**\n * Non-git source kind. Omitted for GitHub/raw-git sources to preserve the\n * original object shape used by tests and callers.\n */\n sourceKind?: \"npm\" | \"archive\";\n /** Branch / tag / commit. Undefined → the repo default branch. */\n ref?: string;\n /** Sub-directory inside the repo holding the connector config. */\n subpath?: string;\n /**\r\n * A raw clone URL (file://, ssh://, git@host:…, https://non-github) when the\r\n * source is NOT a github.com owner/repo we can derive a URL for. Present → the\r\n * tarball fallback is unavailable (we can only `git clone` it).\r\n */\n cloneUrl?: string;\n /** npm package spec for sourceKind:\"npm\", e.g. \"@acme/db-mcp@1.2.3\". */\n packageSpec?: string;\n /** npm package name without version/tag, e.g. \"@acme/db-mcp\". */\n packageName?: string;\n /** Tarball path or URL for sourceKind:\"archive\". */\n archiveUrl?: string;\n}\n\r\n/** The classification of an `install <source>` argument. */\r\nexport type SourceSpec =\r\n | { kind: \"local\"; value: string }\r\n | { kind: \"remote\"; remote: RemoteSource };\r\n\r\nconst GITHUB_SEG = /^[A-Za-z0-9._-]+$/;\nconst NPM_UNSCOPED_NAME_RE = /^[a-z0-9][a-z0-9._~-]*$/i;\nconst NPM_SCOPE_RE = /^@[a-z0-9][a-z0-9._~-]*$/i;\n\r\nfunction isSafeGitHubSegment(segment: string): boolean {\r\n return GITHUB_SEG.test(segment) && segment !== \".\" && segment !== \"..\";\r\n}\r\n\r\nfunction isSafeSubpath(subpath: string | undefined): boolean {\r\n if (subpath === undefined || subpath === \"\") return true;\r\n return subpath\r\n .split(\"/\")\r\n .every((segment) => segment !== \"\" && segment !== \".\" && segment !== \"..\");\r\n}\r\n\r\n/**\r\n * True when `value` should be treated as a LOCAL path (existing behavior),\r\n * before any remote-spec parse is attempted. Conservative on purpose: a path\r\n * that exists wins, and the common path sigils (`.`, `/`, `~`, `file://`, a\r\n * Windows drive letter or UNC) are local even when nothing is on disk yet.\r\n */\r\nexport function looksLocal(value: string): boolean {\r\n if (value === \"\") return true;\r\n if (existsSync(value)) return true;\r\n if (\r\n value.startsWith(\"./\") ||\r\n value.startsWith(\"../\") ||\r\n value === \".\" ||\r\n value === \"..\" ||\r\n value.startsWith(\"/\") ||\r\n value.startsWith(\"~\") ||\r\n value.startsWith(\"file://\")\r\n ) {\r\n return true;\r\n }\r\n // Windows drive (C:\\ or C:/) or UNC (\\\\server\\share).\r\n if (/^[A-Za-z]:[\\\\/]/.test(value) || value.startsWith(\"\\\\\\\\\")) return true;\r\n return false;\r\n}\r\n\r\n/**\r\n * Parse a remote GitHub spec into a {@link RemoteSource}, or null when `value`\r\n * is not a recognizable GitHub source. Supports the bare `owner/repo[/sub][#ref]`\r\n * shorthand, `github:owner/repo`, full `https://github.com/...` (incl.\r\n * `/tree/<ref>/<subpath>`), and `git@github.com:owner/repo.git`.\r\n */\r\nexport function parseRemoteSource(value: string): RemoteSource | null {\r\n const raw = value.trim();\r\n if (raw === \"\") return null;\r\n\r\n // ── git@github.com:owner/repo(.git) ───────────────────────────────────────\r\n const scp = raw.match(/^git@github\\.com:([^/]+)\\/(.+?)(?:\\.git)?$/);\r\n if (scp) {\r\n return finalizeFromPath(scp[1]!, scp[2]!, undefined);\r\n }\r\n\r\n // ── https://github.com/owner/repo[/tree/<ref>/<subpath>][.git][#ref] ───────\r\n if (/^https?:\\/\\//i.test(raw) || raw.startsWith(\"git://\")) {\r\n let url: URL;\r\n try {\r\n url = new URL(raw.replace(/^git:\\/\\//, \"https://\"));\r\n } catch {\r\n return null;\r\n }\r\n if (!/(^|\\.)github\\.com$/i.test(url.hostname)) return null;\r\n const segs = url.pathname.replace(/^\\/+/, \"\").split(\"/\").filter(Boolean);\r\n if (segs.length < 2) return null;\r\n const owner = segs[0]!;\r\n let repo = segs[1]!.replace(/\\.git$/, \"\");\r\n let ref: string | undefined;\r\n let subpath: string | undefined;\r\n // /tree/<ref>/<subpath...> selects a ref + sub-directory.\r\n if (segs[2] === \"tree\" || segs[2] === \"blob\") {\r\n ref = segs[3];\r\n if (segs.length > 4) subpath = segs.slice(4).join(\"/\");\r\n } else if (segs.length > 2) {\r\n subpath = segs.slice(2).join(\"/\");\r\n }\r\n const hash = url.hash.replace(/^#/, \"\");\r\n if (hash) ref = hash;\r\n if (!isSafeGitHubSegment(owner) || !isSafeGitHubSegment(repo)) return null;\r\n return cleanRemote({ owner, repo, ref, subpath });\r\n }\r\n\r\n // ── github:owner/repo[...] ────────────────────────────────────────────────\r\n const shorthand = raw.startsWith(\"github:\") ? raw.slice(\"github:\".length) : raw;\r\n\r\n // ── owner/repo[/subpath][#ref] ────────────────────────────────────────────\r\n // Reject anything that doesn't look like the bare `owner/repo` shape (a single\r\n // path segment, or a leading slash) so we never misread a stray token.\r\n const [pathPart, refPart] = splitHash(shorthand);\r\n const segs = pathPart.split(\"/\").filter(Boolean);\r\n if (segs.length < 2) return null;\r\n const owner = segs[0]!;\r\n const repo = segs[1]!.replace(/\\.git$/, \"\");\r\n const subpath = segs.length > 2 ? segs.slice(2).join(\"/\") : undefined;\r\n if (!isSafeGitHubSegment(owner) || !isSafeGitHubSegment(repo)) return null;\r\n return cleanRemote({ owner, repo, ref: refPart, subpath });\r\n}\r\n\r\n/** Split a \"<path>#<ref>\" into [path, ref?]. */\r\nfunction splitHash(value: string): [string, string | undefined] {\r\n const i = value.indexOf(\"#\");\r\n if (i === -1) return [value, undefined];\r\n const ref = value.slice(i + 1).trim();\r\n return [value.slice(0, i), ref === \"\" ? undefined : ref];\r\n}\r\n\r\n/** scp-form helper: the repo half may itself carry `/sub` and `#ref`. */\r\nfunction finalizeFromPath(owner: string, repoAndRest: string, _ref: undefined): RemoteSource | null {\r\n const [pathPart, ref] = splitHash(repoAndRest);\r\n const segs = pathPart.split(\"/\").filter(Boolean);\r\n const repo = (segs[0] ?? \"\").replace(/\\.git$/, \"\");\r\n const subpath = segs.length > 1 ? segs.slice(1).join(\"/\") : undefined;\r\n if (!isSafeGitHubSegment(owner) || !isSafeGitHubSegment(repo)) return null;\r\n return cleanRemote({ owner, repo, ref, subpath });\r\n}\r\n\r\n/**\r\n * A git-refname-safe ref charset: branch/tag/sha names plus the `/`, `.`, `_`,\r\n * `-` they may contain. A LEADING `-` is rejected so a ref can never be read as\r\n * a git flag (e.g. `--upload-pack=…`) when passed to `git clone --branch`, and\r\n * the constrained charset keeps cache-dir names clean. Empty is invalid.\r\n */\r\nconst REF_RE = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;\r\n\r\n/** True when `ref` is a safe git refname (defense-in-depth before exec). */\r\nexport function isSafeRef(ref: string): boolean {\r\n return REF_RE.test(ref);\r\n}\r\n\r\n/**\r\n * Drop empty optional fields so equality/snapshot comparisons stay clean.\r\n * Returns null when a present `ref` is not git-refname-safe (defense-in-depth:\r\n * never pass an attacker-shaped ref to `git clone --branch`).\r\n */\r\nfunction cleanRemote(r: RemoteSource): RemoteSource | null {\r\n if (r.ref !== undefined && !isSafeRef(r.ref)) return null;\r\n if (!isSafeSubpath(r.subpath)) return null;\r\n const out: RemoteSource = { owner: r.owner, repo: r.repo };\r\n if (r.ref) out.ref = r.ref;\r\n if (r.subpath && r.subpath !== \"\") out.subpath = r.subpath;\r\n return out;\r\n}\r\n\r\n/**\r\n * Parse a RAW git clone URL (NOT a github.com owner/repo): `file://…`,\r\n * `ssh://…`, `git@host:owner/repo`, or `https://<non-github>/…`. These are\r\n * `git clone`-able directly. A trailing `#ref` selects a branch/tag/sha. These\r\n * forms point at a repo root (no in-URL subpath). Returns null for anything\r\n * that isn't a clone URL.\r\n */\r\nexport function parseGitUrl(value: string): RemoteSource | null {\n const [urlPart, ref] = splitHash(value.trim());\r\n const isScheme =\r\n urlPart.startsWith(\"file://\") ||\r\n urlPart.startsWith(\"ssh://\") ||\r\n urlPart.startsWith(\"git://\") ||\r\n /^https?:\\/\\//i.test(urlPart);\r\n const isScp = /^[^@\\s]+@[^:\\s]+:.+/.test(urlPart) && !urlPart.startsWith(\"git@github.com:\");\r\n if (!isScheme && !isScp) return null;\r\n // Reject an unsafe ref (e.g. a leading-dash flag) before it reaches git.\r\n if (ref !== undefined && !isSafeRef(ref)) return null;\r\n\r\n // Derive a stable owner/repo cache key from the URL's last two path segments.\r\n const stripped = urlPart.replace(/\\.git$/, \"\").replace(/\\/+$/, \"\");\r\n const segs = stripped.split(/[/:]/).filter(Boolean);\r\n const repo = segs[segs.length - 1] ?? \"repo\";\r\n const owner = segs[segs.length - 2] ?? \"git\";\r\n const out: RemoteSource = { owner, repo, cloneUrl: urlPart };\r\n if (ref) out.ref = ref;\r\n return out;\r\n}\n\n/** Parse an explicit npm source: npm:<package>[@version-or-tag]. */\nexport function parseNpmSource(value: string): RemoteSource | null {\n const raw = value.trim();\n if (!raw.startsWith(\"npm:\")) return null;\n const spec = raw.slice(\"npm:\".length).trim();\n if (spec === \"\" || /\\s/.test(spec) || spec.startsWith(\"-\")) return null;\n\n let packageName: string;\n if (spec.startsWith(\"@\")) {\n const match = spec.match(/^(@[^/@\\s]+\\/[^/@\\s]+)(?:@([^/\\s]+))?$/);\n if (!match) return null;\n packageName = match[1]!;\n } else {\n const match = spec.match(/^([^/@\\s]+)(?:@([^/\\s]+))?$/);\n if (!match) return null;\n packageName = match[1]!;\n }\n\n const parts = packageName.startsWith(\"@\") ? packageName.split(\"/\") : [packageName];\n if (parts.length === 2) {\n if (!NPM_SCOPE_RE.test(parts[0]!) || !NPM_UNSCOPED_NAME_RE.test(parts[1]!)) {\n return null;\n }\n } else if (parts.length === 1) {\n if (!NPM_UNSCOPED_NAME_RE.test(parts[0]!)) return null;\n } else {\n return null;\n }\n\n return {\n sourceKind: \"npm\",\n owner: \"npm\",\n repo: packageName.replace(/^@/, \"\").replace(/\\//g, \"__\"),\n packageName,\n packageSpec: spec,\n };\n}\n\nfunction stripQueryAndHash(value: string): string {\n return value.split(/[?#]/, 1)[0] ?? value;\n}\n\nfunction archivePathname(value: string): string {\n try {\n const url = new URL(value);\n return url.pathname;\n } catch {\n return value;\n }\n}\n\nfunction isTarballLike(value: string): boolean {\n const p = stripQueryAndHash(archivePathname(value)).toLowerCase();\n return p.endsWith(\".tgz\") || p.endsWith(\".tar.gz\");\n}\n\n/** Parse a tarball archive source: archive:<path-or-url> or direct *.tgz/*.tar.gz. */\nexport function parseArchiveSource(value: string): RemoteSource | null {\n const raw = value.trim();\n const explicit = raw.startsWith(\"archive:\");\n const source = explicit ? raw.slice(\"archive:\".length).trim() : raw;\n if (source === \"\") return null;\n if (!explicit && !isTarballLike(source)) return null;\n\n const pathish = stripQueryAndHash(archivePathname(source));\n const base = basename(pathish).replace(/\\.tar\\.gz$/i, \"\").replace(/\\.tgz$/i, \"\");\n const repo = base || \"source\";\n return {\n sourceKind: \"archive\",\n owner: \"archive\",\n repo,\n archiveUrl: source,\n };\n}\n\r\n/**\r\n * Classify an `install <source>` argument. A raw git clone URL (file://, ssh://,\r\n * git@…) or a GitHub spec is REMOTE (a fetch); a local FILESYSTEM path (existing\r\n * or path-shaped, EXCLUDING file:// which is a clone URL) keeps today's\r\n * behavior. Returns null when a non-local value is NOT a recognizable remote.\r\n */\r\nexport function classifySource(value: string): SourceSpec | null {\n const npm = parseNpmSource(value);\n if (npm) return { kind: \"remote\", remote: npm };\n const archive = parseArchiveSource(value);\n if (archive) return { kind: \"remote\", remote: archive };\n // A raw git clone URL (incl. file://) is always a FETCH, never a config path —\n // even though file:// is \"path-shaped\" it names a clonable repo, not a config.\n const gitUrl = parseGitUrl(value);\r\n if (gitUrl) return { kind: \"remote\", remote: gitUrl };\r\n if (looksLocal(value)) return { kind: \"local\", value };\r\n const remote = parseRemoteSource(value);\r\n return remote ? { kind: \"remote\", remote } : null;\r\n}\r\n\r\n/** The clone URL for a remote source (its raw cloneUrl, else the github URL). */\r\nexport function cloneUrl(r: RemoteSource): string {\n if (r.sourceKind === \"npm\" || r.sourceKind === \"archive\") {\n throw new Error(`${describeRemote(r)} is not a git clone source`);\n }\n return r.cloneUrl ?? `https://github.com/${r.owner}/${r.repo}.git`;\n}\n\r\n/** The codeload tarball URL for a github source (default branch when no ref). */\r\nexport function tarballUrl(r: RemoteSource): string {\r\n const ref = r.ref ?? \"HEAD\";\r\n return `https://codeload.github.com/${r.owner}/${r.repo}/tar.gz/${ref}`;\r\n}\r\n\r\n/** The STABLE cache directory a remote source is fetched into. */\r\nexport function sourceCacheDir(r: RemoteSource): string {\n const safe = (s: string) => s.replace(/[^A-Za-z0-9._-]/g, \"-\");\n if (r.sourceKind === \"npm\") {\n return join(sourcesDir(), `npm__${safe(r.packageName ?? r.repo)}__${shortHash(r.packageSpec ?? r.repo)}`);\n }\n if (r.sourceKind === \"archive\") {\n return join(sourcesDir(), `archive__${safe(r.repo)}__${shortHash(r.archiveUrl ?? r.repo)}`);\n }\n // A raw clone URL hashes its full URL into the key so two different file://\n // repos that share an owner/repo basename never collide in the cache.\n const base = r.cloneUrl\r\n ? `${safe(r.owner)}__${safe(r.repo)}__${shortHash(r.cloneUrl)}`\r\n : `${safe(r.owner)}__${safe(r.repo)}`;\r\n const name = r.ref ? `${base}__${safe(r.ref)}` : base;\r\n return join(sourcesDir(), name);\r\n}\r\n\r\n/** A short, filename-safe hash for disambiguating raw clone URLs in the cache. */\r\nfunction shortHash(value: string): string {\r\n return createHash(\"sha256\").update(value).digest(\"hex\").slice(0, 8);\r\n}\r\n\r\n/**\r\n * A fetcher fetches `remote` into the stable directory `dest`. Injected so tests\r\n * can drive the resolve pipeline against a `file://` git fixture (no network).\r\n * The default {@link gitFetcher} clones over HTTPS.\r\n */\r\nexport type Fetcher = (remote: RemoteSource, dest: string) => void | Promise<void>;\r\n\r\n/** True when a usable `git` is on PATH (probed once per process via a cheap call). */\r\nfunction gitAvailable(): boolean {\r\n try {\r\n execFileSync(\"git\", [\"--version\"], { stdio: \"ignore\" });\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * The default fetcher: `git clone --depth 1 [--branch <ref>] <url> <dest>`.\r\n * Re-fetch replaces the cache dir so the clone reflects the requested ref. The\r\n * caller may override the clone URL via `urlFor` (tests pass a `file://` repo).\r\n */\r\nexport function makeGitFetcher(urlFor: (r: RemoteSource) => string = cloneUrl): Fetcher {\n return (remote, dest) => {\n if (remote.sourceKind === \"npm\" || remote.sourceKind === \"archive\") {\n throw new Error(`${describeRemote(remote)} is not a git clone source`);\n }\n if (!gitAvailable()) {\n throw new Error(\r\n \"git is required to fetch a remote connector source but was not found on PATH. \" +\r\n \"Install git, or pass a local --connector <path>.\",\r\n );\r\n }\r\n rmSync(dest, { recursive: true, force: true });\r\n mkdirSync(dest, { recursive: true });\r\n const args = [\"clone\", \"--depth\", \"1\"];\r\n if (remote.ref) args.push(\"--branch\", remote.ref);\r\n args.push(urlFor(remote), dest);\r\n try {\r\n execFileSync(\"git\", args, { stdio: \"ignore\" });\r\n } catch (err) {\r\n throw new Error(\r\n `failed to clone ${urlFor(remote)}${remote.ref ? ` (ref ${remote.ref})` : \"\"}: ` +\r\n `${err instanceof Error ? err.message : String(err)}`,\r\n );\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Tarball fallback: download the GitHub codeload `tar.gz` and extract it with\r\n * the system `tar` (present on Linux, macOS, and Windows 10+). codeload nests\r\n * everything under a single `<repo>-<ref>/` top dir, which we flatten into\r\n * `dest`. Used only when `git` is unavailable.\r\n */\r\nasync function tarballFetch(remote: RemoteSource, dest: string): Promise<void> {\n const url = tarballUrl(remote);\n const res = await fetch(url);\n if (!res.ok) {\n throw new Error(`failed to download ${url}: HTTP ${res.status} ${res.statusText}`);\n }\n await extractTarballBuffer(Buffer.from(await res.arrayBuffer()), dest);\n}\n\nfunction extractTarballBuffer(buf: Buffer, dest: string): void {\n const work = join(tmpdir(), `ac-src-${process.pid}-${Date.now()}`);\n mkdirSync(work, { recursive: true });\n const tarPath = join(work, \"source.tar.gz\");\r\n writeFileSync(tarPath, buf);\r\n try {\r\n execFileSync(\"tar\", [\"-xzf\", tarPath, \"-C\", work], { stdio: \"ignore\" });\r\n } catch (err) {\r\n rmSync(work, { recursive: true, force: true });\r\n throw new Error(\r\n \"neither git nor a usable `tar` is available to fetch a remote connector \" +\r\n `source (${err instanceof Error ? err.message : String(err)}). Install git ` +\r\n \"or tar, or pass a local --connector <path>.\",\r\n );\r\n }\r\n // codeload nests under a single `<repo>-<ref>/` directory — flatten it.\r\n const entries = readdirSync(work).filter((e) => e !== \"source.tar.gz\");\r\n const top = entries.length === 1 ? join(work, entries[0]!) : work;\r\n rmSync(dest, { recursive: true, force: true });\r\n renameSync(top, dest);\n rmSync(work, { recursive: true, force: true });\n}\n\nasync function archiveFetch(remote: RemoteSource, dest: string): Promise<void> {\n const source = remote.archiveUrl;\n if (!source) throw new Error(\"archive source is missing archiveUrl\");\n\n if (/^https?:\\/\\//i.test(source)) {\n const res = await fetch(source);\n if (!res.ok) {\n throw new Error(`failed to download ${source}: HTTP ${res.status} ${res.statusText}`);\n }\n await extractTarballBuffer(Buffer.from(await res.arrayBuffer()), dest);\n return;\n }\n\n const archivePath = source.startsWith(\"file://\") ? fileURLToPath(source) : source;\n if (!existsSync(archivePath)) {\n throw new Error(`archive source not found: ${source}`);\n }\n extractTarballBuffer(readFileSync(archivePath), dest);\n}\n\nfunction npmAvailable(): boolean {\n try {\n execFileSync(\"npm\", [\"--version\"], { stdio: \"ignore\" });\n return true;\n } catch {\n return false;\n }\n}\n\nasync function npmFetch(remote: RemoteSource, dest: string): Promise<void> {\n const spec = remote.packageSpec;\n if (!spec) throw new Error(\"npm source is missing packageSpec\");\n if (!npmAvailable()) {\n throw new Error(\n `npm is required to fetch npm:${spec} but was not found on PATH. ` +\n \"Install npm, or pass a local --connector <path>.\",\n );\n }\n\n const work = join(tmpdir(), `ac-npm-${process.pid}-${Date.now()}`);\n mkdirSync(work, { recursive: true });\n let stdout: string;\n try {\n stdout = execFileSync(\n \"npm\",\n [\"pack\", spec, \"--pack-destination\", work, \"--silent\"],\n { encoding: \"utf8\" },\n );\n } catch (err) {\n rmSync(work, { recursive: true, force: true });\n throw new Error(\n `failed to fetch npm:${spec}: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n const packed = stdout.trim().split(/\\r?\\n/).filter(Boolean).pop();\n if (!packed) {\n rmSync(work, { recursive: true, force: true });\n throw new Error(`failed to fetch npm:${spec}: npm pack produced no tarball`);\n }\n const tarPath = isAbsolute(packed) ? packed : join(work, packed);\n try {\n extractTarballBuffer(readFileSync(tarPath), dest);\n } finally {\n rmSync(work, { recursive: true, force: true });\n }\n}\n\r\n/**\r\n * The default network fetcher: `git clone` when git is on PATH, otherwise the\r\n * codeload tarball fallback (github.com sources only — a raw clone URL can only\r\n * be `git clone`d, so it requires git). A clear error is thrown when neither\r\n * applicable path works.\r\n */\r\nexport const gitFetcher: Fetcher = async (remote, dest) => {\n if (remote.sourceKind === \"npm\") {\n await npmFetch(remote, dest);\n return;\n }\n if (remote.sourceKind === \"archive\") {\n await archiveFetch(remote, dest);\n return;\n }\n if (gitAvailable()) {\n makeGitFetcher()(remote, dest);\r\n return;\r\n }\r\n if (remote.cloneUrl) {\r\n throw new Error(\r\n `git is required to fetch ${remote.cloneUrl} but was not found on PATH. ` +\r\n \"Install git, or pass a local --connector <path>.\",\r\n );\r\n }\r\n await tarballFetch(remote, dest);\r\n};\r\n\r\n/** The resolved output of {@link resolveRemoteSource}. */\r\nexport interface ResolvedSource {\r\n /** Absolute path to the agent-connector.config.* found inside the fetch. */\r\n configPath: string;\r\n /** The directory the source was fetched into (stable, under the data-root). */\r\n sourceDir: string;\r\n /** The (sub)directory the config was found in. */\r\n connectorDir: string;\r\n /** The live connector + its absolute module path (ready for the install flow). */\r\n connector: ResolvedConnector;\r\n modulePath: string;\r\n}\r\n\r\n/** Options for {@link resolveRemoteSource}. */\r\nexport interface ResolveOptions {\r\n /** Override the fetch (tests). Defaults to {@link gitFetcher}. */\r\n fetcher?: Fetcher;\r\n}\r\n\r\n/**\r\n * Fetch a remote source into its stable cache dir, honor the subpath, and GATE\r\n * it as a real agent-connector package: `findConnectorConfig` must locate an\r\n * `agent-connector.config.{mjs,js,json}` that `loadConnectorFromPath` can load.\r\n * Throws a clear, specific error when the target is not an agent-connector\r\n * connector. Returns everything the install flow needs.\r\n */\r\nexport async function resolveRemoteSource(\r\n remote: RemoteSource,\r\n opts: ResolveOptions = {},\r\n): Promise<ResolvedSource> {\r\n const fetcher = opts.fetcher ?? gitFetcher;\r\n const sourceDir = sourceCacheDir(remote);\r\n mkdirSync(sourcesDir(), { recursive: true });\r\n await fetcher(remote, sourceDir);\r\n\r\n const label = describeRemote(remote);\r\n if (!existsSync(sourceDir)) {\r\n throw new Error(`failed to fetch ${label}: nothing was written to ${sourceDir}`);\r\n }\r\n\r\n // Honor the subpath; guard against a `..` escape out of the fetched dir.\r\n // Containment is checked with path.relative (NOT a bare string prefix, which\r\n // a sibling dir sharing the cache-key prefix would defeat) — mirroring the\r\n // connectorDir() guard in paths.ts: reject when the relative path is empty,\r\n // starts with \"..\", or is absolute.\r\n const root = resolve(sourceDir);\r\n const searchDir = remote.subpath ? resolve(root, remote.subpath) : root;\r\n if (remote.subpath) {\r\n const rel = relative(root, searchDir);\r\n if (rel === \"\" || rel.startsWith(\"..\") || isAbsolute(rel)) {\r\n throw new Error(`subpath escapes the fetched source: ${remote.subpath}`);\r\n }\r\n }\r\n if (!existsSync(searchDir)) {\r\n throw new Error(\r\n `${label}: subpath \"${remote.subpath}\" does not exist in the repository.`,\r\n );\r\n }\r\n\r\n // ── PACKAGE GATE ──────────────────────────────────────────────────────────\r\n // Search only WITHIN the fetched (sub)dir. findConnectorConfig walks UPWARD to\r\n // the filesystem root, so confine the start dir and verify the hit is inside.\r\n const configPath = findConfigWithin(searchDir);\r\n if (!configPath) {\r\n throw new Error(\r\n `${label} is not an agent-connector connector — no ` +\r\n `agent-connector.config.{mjs,js,json} found in the repo` +\r\n (remote.subpath ? ` at subpath \"${remote.subpath}\"` : \"\") +\r\n \". The target must be a package built with agent-connector (defineConnector).\",\r\n );\r\n }\r\n\r\n let connector: ResolvedConnector;\r\n let modulePath: string;\r\n try {\r\n ({ connector, modulePath } = await loadConnectorFromPath(configPath));\r\n } catch (err) {\r\n throw new Error(\r\n `${label}: found ${configPath} but it failed to load as an agent-connector ` +\r\n `connector (${err instanceof Error ? err.message : String(err)}). The target ` +\r\n \"must be a package built with agent-connector (defineConnector).\",\r\n );\r\n }\r\n\r\n return {\r\n configPath,\r\n sourceDir,\r\n connectorDir: searchDir,\r\n connector,\r\n modulePath,\r\n };\r\n}\r\n\r\n/**\r\n * Locate `agent-connector.config.*` strictly within `dir` (not its ancestors).\r\n * `findConnectorConfig` walks upward, so we scope the result by asserting the\r\n * hit is in `dir` itself.\r\n */\r\nfunction findConfigWithin(dir: string): string | null {\r\n const hit = findConnectorConfig(dir);\r\n if (!hit) return null;\r\n // Must live directly in the (sub)dir we were pointed at — reject an ancestor\r\n // hit so a parent dir's config can't masquerade as the repo's.\r\n const dirAbs = resolve(dir);\r\n const hitDir = resolve(hit, \"..\");\r\n return hitDir === dirAbs ? hit : null;\r\n}\r\n\r\n/** A human label for a remote source used in error messages. */\r\nexport function describeRemote(r: RemoteSource): string {\n if (r.sourceKind === \"npm\") return `npm:${r.packageSpec ?? r.repo}`;\n if (r.sourceKind === \"archive\") return `archive:${r.archiveUrl ?? r.repo}`;\n let s = r.cloneUrl ?? `${r.owner}/${r.repo}`;\n if (r.subpath) s += `/${r.subpath}`;\n if (r.ref) s += `#${r.ref}`;\r\n return s;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,iBAAiB;;;ACI1B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,SAAS,UAAU,YAAY,MAAM,UAAU,eAAe;AAC9D,SAAS,qBAAqB;AAwC9B,IAAM,aAAa;AACnB,IAAM,uBAAuB;AAC7B,IAAM,eAAe;AAErB,SAAS,oBAAoB,SAA0B;AACrD,SAAO,WAAW,KAAK,OAAO,KAAK,YAAY,OAAO,YAAY;AACpE;AAEA,SAAS,cAAc,SAAsC;AAC3D,MAAI,YAAY,UAAa,YAAY,GAAI,QAAO;AACpD,SAAO,QACJ,MAAM,GAAG,EACT,MAAM,CAAC,YAAY,YAAY,MAAM,YAAY,OAAO,YAAY,IAAI;AAC7E;AAQO,SAAS,WAAW,OAAwB;AACjD,MAAI,UAAU,GAAI,QAAO;AACzB,MAAI,WAAW,KAAK,EAAG,QAAO;AAC9B,MACE,MAAM,WAAW,IAAI,KACrB,MAAM,WAAW,KAAK,KACtB,UAAU,OACV,UAAU,QACV,MAAM,WAAW,GAAG,KACpB,MAAM,WAAW,GAAG,KACpB,MAAM,WAAW,SAAS,GAC1B;AACA,WAAO;AAAA,EACT;AAEA,MAAI,kBAAkB,KAAK,KAAK,KAAK,MAAM,WAAW,MAAM,EAAG,QAAO;AACtE,SAAO;AACT;AAQO,SAAS,kBAAkB,OAAoC;AACpE,QAAM,MAAM,MAAM,KAAK;AACvB,MAAI,QAAQ,GAAI,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ACxB,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC/B,CAAC,IACD,MAAM,iBAAiB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ,OAAO,SAAS;AAAA,IACxB,OAAO,OAAO;AAAA,IACd,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC/B,CAAC;AAEP,SAAO,YAAY,sBAAsB,SAAS;AAClD,QAAM,oBAAoB,QAAQ,SAAS,CAAC;AAC5C,SAAO,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,WAAW,MAAM,IAAI,IAAI;AAC/D;","names":["segs","owner","repo","subpath"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
normalizeSessionSource
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PSGTHJQU.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseAdapter,
|
|
7
7
|
renderSkillMd
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3FINQ2ZF.js";
|
|
9
9
|
import {
|
|
10
10
|
buildHomeBinHookCommand,
|
|
11
11
|
isHomeBinHookCommand
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-Y3K6KJMS.js";
|
|
13
|
+
import "./chunk-ILWHLGIC.js";
|
|
14
|
+
import "./chunk-QYOUQCC6.js";
|
|
15
15
|
|
|
16
16
|
// src/adapters/jetbrains-copilot/index.ts
|
|
17
17
|
import { existsSync } from "fs";
|
|
@@ -710,4 +710,4 @@ export {
|
|
|
710
710
|
adapter,
|
|
711
711
|
jetbrains_copilot_default as default
|
|
712
712
|
};
|
|
713
|
-
//# sourceMappingURL=jetbrains-copilot-
|
|
713
|
+
//# sourceMappingURL=jetbrains-copilot-Z4FC3RM3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/jetbrains-copilot/index.ts"],"sourcesContent":["/**\r\n * adapters/jetbrains-copilot — JetBrains Copilot platform adapter for agent-connector.\r\n *\r\n * JetBrains Copilot shares the Copilot hook paradigm with VS Code Copilot\r\n * (Claude-compatible json-stdio), but diverges on MCP registration:\r\n *\r\n * - MCP servers: JetBrains stores MCP server registration via the IDE Settings\r\n * UI (Settings > Tools > GitHub Copilot > MCP > Configure), NOT in any file\r\n * we can reliably write — the runtime owns the `servers` key behind the UI.\r\n * So `installServer` writes NOTHING and returns a \"warn\" ChangeRecord telling\r\n * the user to add the server via the JetBrains MCP settings UI. Writing a\r\n * bogus file would be ignored at best and corrupt real UI state at worst.\r\n * `getHealthChecks` surfaces this as a WARN (not FAIL).\r\n *\r\n * - Hooks (Copilot Preview hooks): file-based and identical in shape to VS Code\r\n * Copilot. We write one per-connector file at\r\n * <projectDir>/.github/hooks/<connector-id>.json shaped as:\r\n * { \"version\": 1, \"hooks\": { <Event>: [ { \"type\": \"command\", \"command\" } ] } }\r\n * The top-level `version: 1` is REQUIRED — the Copilot hooks runtime rejects a\r\n * version-less file and no hooks fire. Each entry is a FLAT { type, command }\r\n * object (no Claude-style { matcher, hooks:[...] } wrapper). JetBrains parses\r\n * matchers but IGNORES them — ALL hooks fire on ALL tools — so we omit the\r\n * matcher entirely rather than persist an advisory one that never applies.\r\n *\r\n * - Reply: Claude-compatible JSON on stdout (exit 0), a `hookSpecificOutput`\r\n * object keyed by the PascalCase `hookEventName` carrying permissionDecision\r\n * (deny|ask) + permissionDecisionReason and additionalContext. This mirrors\r\n * vscode-copilot/claude-code exactly EXCEPT JetBrains cannot rewrite tool\r\n * input (canModifyArgs:false), so a \"modify\" decision degrades to allow.\r\n *\r\n * Env interpolation: GitHub Copilot does not document a portable native env\r\n * token for the hooks file, and the hooks file only ever carries our home-bin\r\n * hook command (no secrets), so there is nothing to interpolate here. MCP env\r\n * interpolation is moot because we never write the MCP file.\r\n */\r\n\r\nimport { existsSync } from \"node:fs\";\r\nimport { dirname, join } from \"node:path\";\r\n\r\nimport { BaseAdapter } from \"../base.js\";\r\nimport type { Adapter, HookReply, InstallContext, NormalizedEvent } from \"../spi.js\";\r\nimport type {\r\n ChangeRecord,\r\n CommandDef,\r\n DetectedPlatform,\r\n HealthCheck,\r\n HookEventName,\r\n HookParadigm,\r\n HookResponse,\r\n NotificationEvent,\r\n PlatformCapabilities,\r\n PlatformId,\r\n PostToolUseEvent,\r\n PostCompactEvent,\r\n PreCompactEvent,\r\n PreToolUseEvent,\r\n SessionEndEvent,\r\n SessionStartEvent,\r\n StopEvent,\r\n UserPromptSubmitEvent,\r\n} from \"../../core/types.js\";\r\nimport {\r\n buildHomeBinHookCommand,\r\n isHomeBinHookCommand,\r\n} from \"../../core/spawn.js\";\r\nimport { renderSkillMd } from \"../claude-code/render.js\";\r\nimport { normalizeSessionSource } from \"../claude-code/wire.js\";\r\n\r\nconst HOST: PlatformId = \"jetbrains-copilot\";\r\n\r\n/** Top-level version the Copilot hooks runtime requires; a version-less file is rejected. */\r\nconst JETBRAINS_HOOKS_VERSION = 1;\r\n\r\n/**\r\n * JetBrains Copilot reads PascalCase hook event names from its hooks file —\r\n * identical to VS Code Copilot / Claude Code. Only the events JetBrains actually\r\n * delivers are registered; everything else has no Copilot equivalent and is\r\n * reported as a warn/skip at install time.\r\n */\r\nconst EVENT_MAP: Partial<Record<HookEventName, string>> = {\r\n PreToolUse: \"PreToolUse\",\r\n PostToolUse: \"PostToolUse\",\r\n PreCompact: \"PreCompact\",\r\n SessionStart: \"SessionStart\",\r\n SessionEnd: \"SessionEnd\",\r\n UserPromptSubmit: \"UserPromptSubmit\",\r\n};\r\n\r\nconst WORKSPACE_SCOPE_DETAIL =\r\n \"JetBrains Copilot hooks and content are workspace-scoped (.github); rerun with --scope project to install them.\";\r\n\r\n/** A single JetBrains Copilot native hook entry — a flat command object. */\r\ninterface JetBrainsHookEntry {\r\n type: \"command\";\r\n command: string;\r\n}\r\n\r\n/** The shape of a JetBrains Copilot .github/hooks/<connector>.json file. */\r\ninterface JetBrainsHooksFile {\r\n version?: number;\r\n hooks?: Record<string, JetBrainsHookEntry[]>;\r\n}\r\n\r\n/**\r\n * Raw JetBrains Copilot hook stdin payload (Claude-compatible snake_case fields).\r\n *\r\n * Common input fields (every event): session_id, transcript_path, cwd,\r\n * hook_event_name. There is NO `workspace_roots` field — JetBrains aliases the\r\n * VS Code `.github/hooks` surface which sends only `cwd` (workspace_roots was a\r\n * dead fallback; removed — getProjectDir now relies on `cwd` only, matching\r\n * vscode-copilot #211).\r\n */\r\ninterface JetBrainsWireInput {\r\n session_id?: string;\r\n transcript_path?: string;\r\n cwd?: string;\r\n hook_event_name?: string;\r\n\r\n // tool events. PostToolUse fires ONLY after a tool completes SUCCESSFULLY and\r\n // sends { tool_name, tool_input, tool_use_id, tool_response } — the VS Code\r\n // `.github/hooks` dialect this host ALIASES (vscode-copilot), NOT copilot-cli's\r\n // `tool_result`. `tool_response` is the sole result field; there is NO\r\n // `tool_output` and NO `error_message`, so those reads are dead here.\r\n tool_name?: string;\r\n tool_input?: Record<string, unknown>;\r\n tool_response?: unknown;\r\n\r\n // SessionStart\r\n source?: string;\r\n // SessionEnd\r\n reason?: string;\r\n // UserPromptSubmit\r\n prompt?: string;\r\n // PreCompact\r\n trigger?: string;\r\n // Stop\r\n stop_hook_active?: boolean;\r\n // Notification\r\n message?: string;\r\n\r\n /** Injected by the entrypoint so the runtime knows which connector to dispatch. */\r\n connector?: string;\r\n}\r\n\r\nexport class JetBrainsCopilotAdapter extends BaseAdapter implements Adapter {\r\n readonly id: PlatformId = HOST;\r\n readonly name = \"JetBrains Copilot\";\r\n readonly paradigm: HookParadigm = \"json-stdio\";\r\n\r\n readonly capabilities: PlatformCapabilities = {\r\n // Memory surface: AGENTS.md-first managed block via the BaseAdapter default\r\n // (memoryTargets: project <projectDir>/AGENTS.md; user scope where documented).\r\n supportsMemory: true,\r\n // JetBrains Copilot's Preview hooks runtime delivers Pre/PostToolUse,\r\n // PreCompact, SessionStart, SessionEnd, and UserPromptSubmit (GitHub's\r\n // hooks-reference) — same surface as VS Code Copilot, whose reply contract\r\n // this adapter mirrors exactly (see formatReply: UserPromptSubmit/PostToolUse\r\n // deny → top-level {decision:block}). Stop stays unwired (refuted for\r\n // JetBrains: an unimplemented feature request, not in the documented schema).\r\n preToolUse: true,\r\n postToolUse: true,\r\n preCompact: true,\r\n sessionStart: true,\r\n sessionEnd: true,\r\n userPromptSubmit: true,\r\n stop: false,\r\n notification: false,\r\n // Newer events: the JetBrains Copilot Preview hooks runtime documents no\r\n // permission-dialog, tool-failure, or subagent lifecycle events, so\r\n // permissionRequest / postToolUseFailure / subagentStart / subagentStop\r\n // stay unset — install reports the standard skip-warn for them.\r\n // Per the JetBrains spec this host is deny/ask-only: a PreToolUse hook\r\n // CANNOT rewrite tool input, and PostToolUse cannot rewrite tool output.\r\n canModifyArgs: false,\r\n canModifyOutput: false,\r\n canInjectSessionContext: true,\r\n // MCP is managed via the IDE Settings UI (Settings > Tools > GitHub Copilot\r\n // > MCP). The UI accepts local stdio servers AND remote Streamable HTTP / SSE\r\n // servers; AC writes no file, so this list only describes what the UI accepts\r\n // (install reports a UI-managed warn for every transport).\r\n transports: [\"stdio\", \"http\", \"sse\"],\r\n // Content surfaces: JetBrains Copilot consumes the GitHub Copilot .github/\r\n // files (it has no distinct authoring location), so it is an ALIAS of the\r\n // vscode-copilot writer for prompt files and Agent Skills. It has no native\r\n // subagent/chat-mode surface, so subagents stay unsupported (BaseAdapter\r\n // returns the skip/warn default).\r\n supportsCommands: true,\r\n supportsSkills: true,\r\n supportsSubagents: false,\r\n // Native passthrough: GitHub's JetBrains-Copilot changelog documents an\r\n // errorOccurred / ErrorOccurred lifecycle event with NO canonical\r\n // HookEventName analog (PostToolUseFailure is tool-scoped, not a session-wide\r\n // error event). A connector reaches it via platforms[\"jetbrains-copilot\"].\r\n // nativeHooks; installHooks files the event-name key VERBATIM and the generic\r\n // uninstall reverses it. PascalCase ErrorOccurred matches the adapter's\r\n // Claude-compatible payload dialect (GitHub hooks-reference accepts both).\r\n supportsNativeHooks: true,\r\n };\r\n\r\n // ── Detection ────────────────────────────────────────────────────────────\r\n\r\n detectInstalled(projectDir: string): DetectedPlatform {\r\n // JetBrains Copilot integration is observable through two markers:\r\n // • the project hooks tree (<projectDir>/.github/hooks) we write to, and\r\n // • our per-connector hooks file specifically.\r\n // There is no reliable user-profile MCP file to probe (the UI owns it), so\r\n // detection is project-scoped and keyed on the hooks footprint.\r\n const githubDir = join(projectDir, \".github\");\r\n const hooksDir = join(githubDir, \"hooks\");\r\n const installed = existsSync(hooksDir) || existsSync(githubDir);\r\n const configPath = hooksDir;\r\n return {\r\n id: this.id,\r\n name: this.name,\r\n installed,\r\n paradigm: this.paradigm,\r\n capabilities: this.capabilities,\r\n configPath,\r\n scope: \"project\",\r\n reason: installed\r\n ? `found JetBrains Copilot hooks tree at ${hooksDir}`\r\n : `no JetBrains Copilot hooks tree at ${hooksDir}`,\r\n confidence: installed ? \"medium\" : \"low\",\r\n };\r\n }\r\n\r\n // ── Native paths ─────────────────────────────────────────────────────────\r\n\r\n /** Hooks live under the workspace .github tree for both scopes. */\r\n getConfigDir(ctx: InstallContext): string {\r\n return join(ctx.projectDir, \".github\");\r\n }\r\n\r\n /**\r\n * MCP server registration has NO writable file on JetBrains — the IDE owns it\r\n * behind the Settings UI. We still return a stable path (the hooks file) so the\r\n * base-adapter `doctor`/`backupSettings` helpers have a sensible target rather\r\n * than a nonexistent/bogus MCP path. `installServer` never writes here.\r\n */\r\n getServerConfigPath(ctx: InstallContext): string {\r\n return this.getHookConfigPath(ctx);\r\n }\r\n\r\n /**\r\n * Hook registration lives in the workspace-discovered .github/hooks tree, which\r\n * JetBrains Copilot scans for *.json hook files. We write one file per connector\r\n * so installs/uninstalls never clobber another connector's hooks. Anchored on\r\n * projectDir for both scopes — .github/hooks is a workspace concept (there is no\r\n * user-profile equivalent in the Copilot hooks schema).\r\n */\r\n getHookConfigPath(ctx: InstallContext): string {\r\n return join(ctx.projectDir, \".github\", \"hooks\", `${ctx.connector.id}.json`);\r\n }\r\n\r\n // ── MCP server install / uninstall ───────────────────────────────────────\r\n\r\n /**\r\n * JetBrains MCP registration is UI-only. We never write a file: a bogus file is\r\n * ignored at best and corrupts real UI-managed state at worst. Emit a \"warn\"\r\n * ChangeRecord that tells the user exactly where to add the server by hand.\r\n */\r\n installServer(ctx: InstallContext): ChangeRecord[] {\r\n const { connector } = ctx;\r\n const override = connector.platforms[HOST]?.server;\r\n if (!connector.server || override === false) {\r\n return [\r\n {\r\n platform: this.id,\r\n action: \"skip\",\r\n detail: connector.server\r\n ? \"server registration disabled for jetbrains-copilot\"\r\n : \"connector declares no MCP server\",\r\n },\r\n ];\r\n }\r\n\r\n return [\r\n {\r\n platform: this.id,\r\n action: \"warn\",\r\n detail:\r\n `JetBrains Copilot manages MCP servers via the IDE Settings UI — ` +\r\n `add \"${connector.id}\" manually under Settings > Tools > GitHub Copilot ` +\r\n `> MCP > Configure (no file is written here).`,\r\n },\r\n ];\r\n }\r\n\r\n /**\r\n * Nothing was written for the MCP server, so there is nothing to remove. Mirror\r\n * the install-time guidance as a \"warn\" so an uninstall report is honest about\r\n * the UI-managed entry the user may still want to remove by hand.\r\n */\r\n uninstallServer(ctx: InstallContext): ChangeRecord[] {\r\n const { connector } = ctx;\r\n if (!connector.server || connector.platforms[HOST]?.server === false) {\r\n return [\r\n {\r\n platform: this.id,\r\n action: \"skip\",\r\n detail: \"no MCP server was registered for jetbrains-copilot\",\r\n },\r\n ];\r\n }\r\n return [\r\n {\r\n platform: this.id,\r\n action: \"warn\",\r\n detail:\r\n `JetBrains Copilot MCP servers are UI-managed — if \"${connector.id}\" was ` +\r\n `added manually, remove it under Settings > Tools > GitHub Copilot > MCP.`,\r\n },\r\n ];\r\n }\r\n\r\n // ── Hook install / uninstall ─────────────────────────────────────────────\r\n\r\n installHooks(ctx: InstallContext): ChangeRecord[] {\r\n const { connector } = ctx;\r\n const override = connector.platforms[HOST];\r\n const hooksDisabled = override?.hooks === false;\r\n // `hooks: false` disables only the NORMALIZED events; nativeHooks is a\r\n // sibling, jetbrains-copilot-scoped declaration that installs regardless.\r\n const normalizedEvents = hooksDisabled ? [] : connector.hookEvents;\r\n const nativeHooks = override?.nativeHooks ?? {};\r\n const nativeEvents = Object.keys(nativeHooks);\r\n\r\n if (normalizedEvents.length === 0 && nativeEvents.length === 0) {\r\n return [\r\n {\r\n platform: this.id,\r\n action: \"skip\",\r\n detail: hooksDisabled\r\n ? \"hooks disabled for jetbrains-copilot\"\r\n : \"connector declares no hooks\",\r\n },\r\n ];\r\n }\r\n if (ctx.scope === \"user\") {\r\n return [{ platform: this.id, action: \"warn\", detail: WORKSPACE_SCOPE_DETAIL }];\r\n }\r\n\r\n const hooksPath = this.getHookConfigPath(ctx);\r\n const symlink = this.symlinkPathWarning(hooksPath);\r\n if (symlink) return [symlink];\r\n\r\n const file = this.readJson<JetBrainsHooksFile>(hooksPath) ?? {};\r\n const __skip = this.malformedHookRootSkip(hooksPath, (file as Record<string, unknown>).hooks);\r\n if (__skip) return [__skip];\r\n const hooks = (file.hooks ??= {});\r\n\r\n const changes: ChangeRecord[] = [];\r\n let mutated = false;\r\n\r\n for (const event of normalizedEvents) {\r\n const jetbrainsEvent = EVENT_MAP[event];\r\n if (!jetbrainsEvent) {\r\n // No JetBrains Copilot equivalent for this normalized event — report+skip.\r\n changes.push({\r\n platform: this.id,\r\n action: \"warn\",\r\n path: hooksPath,\r\n detail: `${event} has no JetBrains Copilot hook equivalent — skipped`,\r\n });\r\n continue;\r\n }\r\n\r\n const command = buildHomeBinHookCommand(ctx.homeBinPath, HOST, event, connector.id);\r\n // Matchers are IGNORED by JetBrains (all hooks fire on all tools), so we omit\r\n // the matcher entirely — a flat { type, command } entry.\r\n const entry: JetBrainsHookEntry = { type: \"command\", command };\r\n\r\n const bucket = (hooks[jetbrainsEvent] ??= []);\r\n const existingIdx = bucket.findIndex((e) => this.isOurCommand(e.command, ctx));\r\n\r\n if (existingIdx >= 0) {\r\n if (JSON.stringify(bucket[existingIdx]) === JSON.stringify(entry)) {\r\n changes.push({\r\n platform: this.id,\r\n action: \"skip\",\r\n path: hooksPath,\r\n detail: `hooks.${jetbrainsEvent} already registered`,\r\n });\r\n continue;\r\n }\r\n bucket[existingIdx] = entry;\r\n changes.push({\r\n platform: this.id,\r\n action: \"update\",\r\n path: hooksPath,\r\n detail: `hooks.${jetbrainsEvent}`,\r\n });\r\n } else {\r\n bucket.push(entry);\r\n changes.push({\r\n platform: this.id,\r\n action: \"create\",\r\n path: hooksPath,\r\n detail: `hooks.${jetbrainsEvent}`,\r\n });\r\n }\r\n mutated = true;\r\n }\r\n\r\n // NATIVE passthrough events: jetbrains-copilot-native event-name keys (e.g.\r\n // ErrorOccurred) filed VERBATIM into the hooks map — no EVENT_MAP, since they\r\n // ARE Copilot events. Flat { type, command } entry (matchers are ignored);\r\n // matched by EXACT command so a native key coinciding with a normalized one\r\n // never clobbers it.\r\n for (const nativeEvent of nativeEvents) {\r\n const command = buildHomeBinHookCommand(ctx.homeBinPath, HOST, nativeEvent, connector.id);\r\n const entry: JetBrainsHookEntry = { type: \"command\", command };\r\n const bucket = (hooks[nativeEvent] ??= []);\r\n const existingIdx = bucket.findIndex((e) => e.command === command);\r\n if (existingIdx >= 0) {\r\n if (JSON.stringify(bucket[existingIdx]) === JSON.stringify(entry)) {\r\n changes.push({\r\n platform: this.id,\r\n action: \"skip\",\r\n path: hooksPath,\r\n detail: `hooks.${nativeEvent} (native) already registered`,\r\n });\r\n continue;\r\n }\r\n bucket[existingIdx] = entry;\r\n changes.push({\r\n platform: this.id,\r\n action: \"update\",\r\n path: hooksPath,\r\n detail: `hooks.${nativeEvent} (native)`,\r\n });\r\n } else {\r\n bucket.push(entry);\r\n changes.push({\r\n platform: this.id,\r\n action: \"create\",\r\n path: hooksPath,\r\n detail: `hooks.${nativeEvent} (native)`,\r\n });\r\n }\r\n mutated = true;\r\n }\r\n\r\n if (mutated) {\r\n // The top-level version is REQUIRED — a version-less file is rejected and\r\n // no hooks fire. Always (re)assert it when we write.\r\n file.version = JETBRAINS_HOOKS_VERSION;\r\n this.writeJson(hooksPath, file, ctx.dryRun);\r\n }\r\n return changes;\r\n }\r\n\r\n uninstallHooks(ctx: InstallContext): ChangeRecord[] {\r\n const hooksPath = this.getHookConfigPath(ctx);\r\n const symlink = this.symlinkPathWarning(hooksPath);\r\n if (symlink) return [symlink];\r\n\r\n const file = this.readJson<JetBrainsHooksFile>(hooksPath);\r\n const hooks = file?.hooks;\r\n if (!file || !hooks) {\r\n return [\r\n {\r\n platform: this.id,\r\n action: \"skip\",\r\n path: hooksPath,\r\n detail: \"no hooks section present\",\r\n },\r\n ];\r\n }\r\n\r\n const changes: ChangeRecord[] = [];\r\n let mutated = false;\r\n\r\n for (const jetbrainsEvent of Object.keys(hooks)) {\r\n const bucket = hooks[jetbrainsEvent];\r\n if (!Array.isArray(bucket)) continue;\r\n\r\n const before = bucket.length;\r\n // Only strip OUR connector's home-bin commands — never another connector's\r\n // (isHomeBinHookCommand is id-anchored against a shared-prefix collision).\r\n const next = bucket.filter((e) => !this.isOurCommand(e.command, ctx));\r\n const removed = before - next.length;\r\n if (removed > 0) {\r\n if (next.length > 0) hooks[jetbrainsEvent] = next;\r\n else delete hooks[jetbrainsEvent];\r\n changes.push({\r\n platform: this.id,\r\n action: \"remove\",\r\n path: hooksPath,\r\n detail: `hooks.${jetbrainsEvent} (${removed})`,\r\n });\r\n mutated = true;\r\n }\r\n }\r\n\r\n if (mutated) {\r\n // The hooks file is connector-OWNED (<connector-id>.json), so when our\r\n // strip leaves it with NO hooks we must DELETE the whole file rather than\r\n // rewrite a `{ \"hooks\": {}, \"version\": 1 }` shell — an empty shell is an\r\n // orphan per-connector file that lingers after uninstall. A non-empty\r\n // result still belongs to us, so we rewrite it as before. dryRun reports\r\n // the would-be remove without mutating the filesystem.\r\n if (Object.keys(hooks).length === 0) {\r\n changes.push(\r\n this.removeManagedFile(\r\n hooksPath,\r\n ctx.dryRun,\r\n \"removed empty connector hooks file\",\r\n \"no hooks file present\",\r\n ),\r\n );\r\n // Clean up the parent .github/hooks dir only when it is now empty (it is\r\n // a per-connector tree; leave it in place if other connectors' files\r\n // remain).\r\n changes.push(this.removeDirIfEmpty(dirname(hooksPath), ctx.dryRun));\r\n } else {\r\n this.writeJson(hooksPath, file, ctx.dryRun);\r\n }\r\n }\r\n if (changes.length === 0) {\r\n changes.push({\r\n platform: this.id,\r\n action: \"skip\",\r\n path: hooksPath,\r\n detail: \"no matching hook entries\",\r\n });\r\n }\r\n return changes;\r\n }\r\n\r\n /** True when a hook command references our home binary AND this connector id\r\n * (anchored so a shared-prefix id can't collide — see isHomeBinHookCommand). */\r\n private isOurCommand(command: string | undefined, ctx: InstallContext): boolean {\r\n return isHomeBinHookCommand(command, ctx.homeBinPath, ctx.connector.id);\r\n }\r\n\r\n // ── Content surfaces: commands / skills ──────────────────────────────────\r\n // CONTENT-ONLY: pure native-file writers under the workspace .github/ tree\r\n // ({prompts,skills}). No runtime dispatch, no home-bin pointer, no telemetry\r\n // wrap. Each method is idempotent (byte-identical → skip) via\r\n // BaseAdapter.writeContentFile and reversible via removeContentFile. Honors\r\n // platforms[\"jetbrains-copilot\"] per-surface false to skip.\r\n //\r\n // ALIAS of vscode-copilot: JetBrains consumes the GitHub Copilot .github/\r\n // files and has no distinct authoring location, so the rendered content +\r\n // paths here are IDENTICAL to the vscode-copilot writer.\r\n //\r\n // SHARED .github TREE: vscode-copilot, copilot-cli, and jetbrains-copilot all\r\n // write under the SAME project <projectDir>/.github tree. The rendered content\r\n // is identical and idempotent across those connectors, and uninstall here only\r\n // removes the files THIS connector declared — never another writer's files.\r\n //\r\n // SCOPE NOTE: .github is a workspace concept and this adapter is project-\r\n // scoped (no user-profile .github authoring location exists in the Copilot\r\n // prompt/skill discovery), so the content root is always the project .github\r\n // tree — the same dir getConfigDir already anchors on.\r\n\r\n /** Root of the content tree — the project .github tree (see getConfigDir). */\r\n private contentRootDir(ctx: InstallContext): string {\r\n return this.getConfigDir(ctx);\r\n }\r\n\r\n private promptsDir(ctx: InstallContext): string {\r\n return join(this.contentRootDir(ctx), \"prompts\");\r\n }\r\n private skillsDir(ctx: InstallContext): string {\r\n return join(this.contentRootDir(ctx), \"skills\");\r\n }\r\n\r\n /** Native command file path: <ghDir>/prompts/<name>.prompt.md. */\r\n private commandPath(ctx: InstallContext, name: string): string {\r\n return join(this.promptsDir(ctx), `${name}.prompt.md`);\r\n }\r\n /** Native skill dir: <ghDir>/skills/<name>. */\r\n private skillDir(ctx: InstallContext, name: string): string {\r\n return join(this.skillsDir(ctx), name);\r\n }\r\n\r\n // ── Commands ──────────────────────────────────────────────────────────────\r\n\r\n override installCommands(ctx: InstallContext): ChangeRecord[] {\r\n const { connector } = ctx;\r\n if (connector.platforms[HOST]?.commands === false) {\r\n return [{ platform: this.id, action: \"skip\", detail: \"commands disabled for jetbrains-copilot\" }];\r\n }\r\n if (connector.commands.length === 0) {\r\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\r\n }\r\n if (ctx.scope === \"user\") {\r\n return [{ platform: this.id, action: \"warn\", detail: WORKSPACE_SCOPE_DETAIL }];\r\n }\r\n return connector.commands.map((cmd) =>\r\n this.writeContentFile(\r\n this.commandPath(ctx, cmd.name),\r\n this.renderCommand(cmd),\r\n ctx.dryRun,\r\n ),\r\n );\r\n }\r\n\r\n override uninstallCommands(ctx: InstallContext): ChangeRecord[] {\r\n const { connector } = ctx;\r\n if (connector.commands.length === 0) {\r\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\r\n }\r\n return connector.commands.map((cmd) =>\r\n this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun),\r\n );\r\n }\r\n\r\n /** Render a Copilot prompt file: md+frontmatter(description, tools, model, argument-hint). */\r\n private renderCommand(cmd: CommandDef): string {\r\n const frontmatter: Record<string, unknown> = {};\r\n if (cmd.description !== undefined) frontmatter.description = cmd.description;\r\n // Copilot prompt files express tool access as a `tools` array, sourced from\r\n // the portable tools.allow policy.\r\n const allow = cmd.tools?.allow;\r\n if (allow && allow.length > 0) frontmatter.tools = [...allow];\r\n if (cmd.model !== undefined) frontmatter.model = cmd.model;\r\n if (cmd.argumentHint !== undefined) frontmatter[\"argument-hint\"] = cmd.argumentHint;\r\n if (cmd.extra) Object.assign(frontmatter, cmd.extra);\r\n return this.renderFrontmatterMd(frontmatter, cmd.prompt);\r\n }\r\n\r\n // ── Skills ────────────────────────────────────────────────────────────────\r\n\r\n override installSkills(ctx: InstallContext): ChangeRecord[] {\r\n const { connector } = ctx;\r\n if (connector.platforms[HOST]?.skills === false) {\r\n return [{ platform: this.id, action: \"skip\", detail: \"skills disabled for jetbrains-copilot\" }];\r\n }\r\n if (connector.skills.length === 0) {\r\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\r\n }\r\n if (ctx.scope === \"user\") {\r\n return [{ platform: this.id, action: \"warn\", detail: WORKSPACE_SCOPE_DETAIL }];\r\n }\r\n const changes: ChangeRecord[] = [];\r\n for (const skill of connector.skills) {\r\n const dir = this.skillDir(ctx, skill.name);\r\n changes.push(\r\n this.writeContentFile(join(dir, \"SKILL.md\"), renderSkillMd(skill), ctx.dryRun),\r\n );\r\n // Bundle any resource files beside SKILL.md (relative path → contents).\r\n // Defense-in-depth: skip+warn on any key that escapes the skill dir\r\n // (config-time validation already rejects these, but never trust input).\r\n for (const [rel, contents] of Object.entries(skill.resources ?? {})) {\r\n const target = this.resolveWithin(dir, rel);\r\n if (target === null) {\r\n changes.push({\r\n platform: this.id,\r\n action: \"warn\",\r\n detail: `skill resource \"${rel}\" escapes the skill dir; skipped`,\r\n });\r\n continue;\r\n }\r\n changes.push(this.writeContentFile(target, contents, ctx.dryRun));\r\n }\r\n }\r\n return changes;\r\n }\r\n\r\n override uninstallSkills(ctx: InstallContext): ChangeRecord[] {\r\n const { connector } = ctx;\r\n if (connector.skills.length === 0) {\r\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\r\n }\r\n const changes: ChangeRecord[] = [];\r\n for (const skill of connector.skills) {\r\n const dir = this.skillDir(ctx, skill.name);\r\n // Remove only the files we wrote (SKILL.md + declared resources), then the\r\n // skill dir itself when we own its full contents.\r\n changes.push(this.removeContentFile(join(dir, \"SKILL.md\"), ctx.dryRun));\r\n for (const rel of Object.keys(skill.resources ?? {})) {\r\n const target = this.resolveWithin(dir, rel);\r\n if (target === null) continue; // never delete outside the skill dir\r\n changes.push(this.removeContentFile(target, ctx.dryRun));\r\n }\r\n // Only remove the skill dir when WE own its full contents — never rm -rf a\r\n // dir that still holds user-added / sibling-tool / shared files.\r\n changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));\r\n }\r\n return changes;\r\n }\r\n\r\n // ── Diagnostics ──────────────────────────────────────────────────────────\r\n\r\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\r\n const hooksPath = this.getHookConfigPath(ctx);\r\n const connectorId = ctx.connector.id;\r\n const homeBin = ctx.homeBinPath;\r\n const hookEvents = ctx.connector.hookEvents;\r\n const hasServer =\r\n ctx.connector.server != null &&\r\n ctx.connector.platforms[HOST]?.server !== false;\r\n const checks: HealthCheck[] = [\r\n {\r\n // MCP cannot be verified from disk — JetBrains owns it behind the UI.\r\n // BaseAdapter.doctor maps != OK to a hard FAIL, but an unverifiable\r\n // UI-managed surface must NOT hard-fail doctor (that contradicts the\r\n // install-time WARN). Return OK with a verify-in-UI detail instead.\r\n name: `${this.name}: MCP server (UI-managed)`,\r\n check: () =>\r\n hasServer\r\n ? {\r\n status: \"OK\",\r\n detail:\r\n \"MCP is UI-managed — verify in Settings > Tools > GitHub Copilot > MCP\",\r\n }\r\n : { status: \"OK\", detail: \"connector declares no MCP server\" },\r\n },\r\n {\r\n name: `${this.name}: hook command registered`,\r\n check: () => {\r\n if (hookEvents.length === 0) {\r\n return { status: \"OK\", detail: \"no hooks declared\" };\r\n }\r\n if (ctx.scope === \"user\") {\r\n return {\r\n status: \"OK\",\r\n detail: \"hooks are workspace-scoped; install them with --scope project\",\r\n };\r\n }\r\n const file = this.readJson<JetBrainsHooksFile>(hooksPath);\r\n if (!file) return { status: \"FAIL\", detail: `not found: ${hooksPath}` };\r\n if (file.version !== JETBRAINS_HOOKS_VERSION) {\r\n return {\r\n status: \"FAIL\",\r\n detail: `${hooksPath} missing required \"version\": ${JETBRAINS_HOOKS_VERSION} — Copilot rejects it`,\r\n };\r\n }\r\n const registered = Object.values(file.hooks ?? {}).some((entries) =>\r\n (entries ?? []).some((e) =>\r\n isHomeBinHookCommand(e.command, homeBin, connectorId),\r\n ),\r\n );\r\n return registered\r\n ? { status: \"OK\", detail: \"hook command present\" }\r\n : { status: \"FAIL\", detail: `no hook for ${connectorId} in ${hooksPath}` };\r\n },\r\n },\r\n ];\r\n\r\n // Content-surface checks: only assert presence of the files this connector\r\n // declares (skip silently for surfaces it never asked for). Subagents are\r\n // unsupported here, so they are never checked.\r\n for (const cmd of ctx.connector.commands) {\r\n const p = this.commandPath(ctx, cmd.name);\r\n checks.push({\r\n name: `${this.name}: command ${cmd.name} present`,\r\n check: () =>\r\n ctx.scope === \"user\"\r\n ? { status: \"OK\", detail: \"commands are workspace-scoped; install them with --scope project\" }\r\n : existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\r\n });\r\n }\r\n for (const skill of ctx.connector.skills) {\r\n const p = join(this.skillDir(ctx, skill.name), \"SKILL.md\");\r\n checks.push({\r\n name: `${this.name}: skill ${skill.name} present`,\r\n check: () =>\r\n ctx.scope === \"user\"\r\n ? { status: \"OK\", detail: \"skills are workspace-scoped; install them with --scope project\" }\r\n : existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\r\n });\r\n }\r\n return checks;\r\n }\r\n\r\n // ── Runtime: parse JetBrains Copilot stdin JSON → normalized event ────────\r\n\r\n parseEvent(event: HookEventName, raw: unknown): NormalizedEvent {\r\n const input = (raw ?? {}) as JetBrainsWireInput;\r\n const connectorId = typeof input.connector === \"string\" ? input.connector : \"\";\r\n const sessionId = extractSessionId(input);\r\n const projectDir = this.getProjectDir(input);\r\n\r\n const base = {\r\n hostPlatform: HOST,\r\n connectorId,\r\n sessionId,\r\n raw,\r\n ...(projectDir !== undefined ? { projectDir } : {}),\r\n } as const;\r\n\r\n switch (event) {\r\n case \"PreToolUse\": {\r\n const ev: PreToolUseEvent = {\r\n ...base,\r\n toolName: input.tool_name ?? \"\",\r\n toolInput: input.tool_input ?? {},\r\n };\r\n return ev;\r\n }\r\n case \"PostToolUse\": {\r\n // PRIMARY SOURCE (VS Code Copilot hooks docs, \"PostToolUse input\"):\r\n // JetBrains aliases the VS Code `.github/hooks` surface, which fires\r\n // PostToolUse only after a tool completes SUCCESSFULLY and serializes a\r\n // single result field, `tool_response`. There is NO `tool_output` and NO\r\n // `error_message` in this dialect, so the old fallback legs read\r\n // host-nonexistent fields and the `error_message`-driven `isError` could\r\n // never become true. Read only `tool_response`; a tool-failure event\r\n // (PostToolUseFailure) is not part of this surface and is not wired.\r\n const toolOutput = toolResponseToString(input.tool_response);\r\n const ev: PostToolUseEvent = {\r\n ...base,\r\n toolName: input.tool_name ?? \"\",\r\n toolInput: input.tool_input ?? {},\r\n ...(toolOutput !== undefined ? { toolOutput } : {}),\r\n };\r\n return ev;\r\n }\r\n case \"PreCompact\": {\r\n const ev: PreCompactEvent = {\r\n ...base,\r\n ...(input.trigger === \"auto\" || input.trigger === \"manual\"\r\n ? { trigger: input.trigger }\r\n : {}),\r\n };\r\n return ev;\r\n }\r\n case \"PostCompact\": {\r\n // JetBrains Copilot does not fire PostCompact natively (postCompact\r\n // unset → warn-skip at install). Parsed defensively, mirroring\r\n // PreCompact, so a manual/mis-routed dispatch normalizes instead of\r\n // hitting the guard.\r\n const ev: PostCompactEvent = {\r\n ...base,\r\n ...(input.trigger === \"auto\" || input.trigger === \"manual\"\r\n ? { trigger: input.trigger }\r\n : {}),\r\n };\r\n return ev;\r\n }\r\n case \"SessionStart\": {\r\n const ev: SessionStartEvent = {\r\n ...base,\r\n source: normalizeSessionSource(input.source ?? input.trigger),\r\n };\r\n return ev;\r\n }\r\n case \"SessionEnd\": {\r\n const ev: SessionEndEvent = {\r\n ...base,\r\n ...(typeof input.reason === \"string\" ? { reason: input.reason } : {}),\r\n };\r\n return ev;\r\n }\r\n case \"UserPromptSubmit\": {\r\n const ev: UserPromptSubmitEvent = {\r\n ...base,\r\n prompt: typeof input.prompt === \"string\" ? input.prompt : \"\",\r\n };\r\n return ev;\r\n }\r\n case \"Stop\": {\r\n const ev: StopEvent = {\r\n ...base,\r\n ...(typeof input.stop_hook_active === \"boolean\"\r\n ? { stopHookActive: input.stop_hook_active }\r\n : {}),\r\n };\r\n return ev;\r\n }\r\n case \"Notification\": {\r\n const ev: NotificationEvent = {\r\n ...base,\r\n message: typeof input.message === \"string\" ? input.message : \"\",\r\n };\r\n return ev;\r\n }\r\n case \"PermissionRequest\":\r\n case \"PostToolUseFailure\":\r\n case \"SubagentStart\":\r\n case \"SubagentStop\": {\r\n // No JetBrains Copilot analog — its Preview hooks runtime documents no\r\n // permission-dialog, tool-failure, or subagent lifecycle events.\r\n // Install already skip-warns these via EVENT_MAP; a runtime dispatch is\r\n // a mis-route — fail loudly.\r\n throw new Error(`unsupported jetbrains-copilot hook event: ${String(event)}`);\r\n }\r\n default: {\r\n // Exhaustive guard — every HookEventName is handled above. (JetBrains only\r\n // delivers the four it declares; the rest are handled defensively so a\r\n // mis-dispatch stays inert rather than crashing.)\r\n const _never: never = event;\r\n throw new Error(`unsupported jetbrains-copilot hook event: ${String(_never)}`);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Resolve the project dir from the wire payload. PRIMARY SOURCE (VS Code\r\n * `.github/hooks` dialect this host aliases): the only working-directory field\r\n * sent is `cwd`. There is no `workspace_roots` field — the old\r\n * `?? workspace_roots[0]` fallback read a host-nonexistent field and is removed\r\n * (parity with vscode-copilot #211).\r\n */\r\n private getProjectDir(input: JetBrainsWireInput): string | undefined {\r\n return typeof input.cwd === \"string\" ? input.cwd : undefined;\r\n }\r\n\r\n // ── Runtime: normalized response → JetBrains Copilot native hook reply ────\r\n\r\n formatReply(event: HookEventName, response: HookResponse): HookReply {\r\n const hookEventName = event;\r\n const decision = response.decision ?? \"allow\";\r\n\r\n // deny → block the action with a reason (exit 0; JSON carries the decision).\r\n // JetBrains Copilot's reply is Claude-compatible, identical to vscode-copilot:\r\n // `hookSpecificOutput.permissionDecision` is read ONLY for the pre-execution\r\n // PreToolUse permission event. The post-execution / turn-control events —\r\n // PostToolUse, UserPromptSubmit, Stop, SubagentStop — block via the TOP-LEVEL\r\n // {\"decision\":\"block\",\"reason\"} instead (PostToolUse runs AFTER the tool, so a\r\n // permissionDecision there is silently ignored). Mirrors vscode-copilot #56/#58.\r\n if (decision === \"deny\") {\r\n if (\r\n event === \"PostToolUse\" ||\r\n event === \"UserPromptSubmit\" ||\r\n event === \"Stop\" ||\r\n event === \"SubagentStop\"\r\n ) {\r\n return this.stdout({\r\n decision: \"block\",\r\n reason: response.reason ?? \"Blocked by hook\",\r\n });\r\n }\r\n return this.stdout({\r\n hookSpecificOutput: {\r\n hookEventName,\r\n permissionDecision: \"deny\",\r\n permissionDecisionReason: response.reason ?? \"Blocked by hook\",\r\n },\r\n });\r\n }\r\n\r\n // ask → prompt the user to confirm.\r\n if (decision === \"ask\") {\r\n return this.stdout({\r\n hookSpecificOutput: {\r\n hookEventName,\r\n permissionDecision: \"ask\",\r\n permissionDecisionReason:\r\n response.reason ?? \"Confirmation required by hook\",\r\n },\r\n });\r\n }\r\n\r\n // modify → unsupported on JetBrains (canModifyArgs:false): a PreToolUse hook\r\n // cannot rewrite tool input here, so degrade to allow rather than emit an\r\n // updatedInput the host will ignore.\r\n\r\n // context → inject soft guidance (also the SessionStart context path).\r\n if (decision === \"context\" && response.additionalContext) {\r\n return this.stdout({\r\n hookSpecificOutput: { hookEventName, additionalContext: response.additionalContext },\r\n });\r\n }\r\n\r\n // allow / void / modify-degradation / unsupported → pass through with exit 0.\r\n return { exitCode: 0 };\r\n }\r\n\r\n private stdout(payload: unknown): HookReply {\r\n return { exitCode: 0, stdout: JSON.stringify(payload) };\r\n }\r\n}\r\n\r\n/**\r\n * Extract a stable session id from a JetBrains Copilot wire payload. Priority\r\n * mirrors the Claude-compatible wire: transcript UUID > session_id > \"\" (the\r\n * framework uses \"\" when no id is available — no ppid fabrication here).\r\n */\r\nfunction extractSessionId(input: JetBrainsWireInput): string {\r\n if (typeof input.transcript_path === \"string\") {\r\n const m = input.transcript_path.match(/([a-f0-9-]{36})\\.jsonl$/);\r\n if (m && m[1]) return m[1];\r\n }\r\n if (typeof input.session_id === \"string\" && input.session_id !== \"\") {\r\n return input.session_id;\r\n }\r\n return \"\";\r\n}\r\n\r\n/** Coerce a Claude-compatible PostToolUse `tool_response` into a string. */\r\nfunction toolResponseToString(value: unknown): string | undefined {\r\n if (value == null) return undefined;\r\n if (typeof value === \"string\") return value;\r\n try {\r\n return JSON.stringify(value);\r\n } catch {\r\n return String(value);\r\n }\r\n}\r\n\r\nexport const adapter = new JetBrainsCopilotAdapter();\r\nexport default adapter;\r\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,SAAS,kBAAkB;AAC3B,SAAS,SAAS,YAAY;AA+B9B,IAAM,OAAmB;AAGzB,IAAM,0BAA0B;AAQhC,IAAM,YAAoD;AAAA,EACxD,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,kBAAkB;AACpB;AAEA,IAAM,yBACJ;AAuDK,IAAM,0BAAN,cAAsC,YAA+B;AAAA,EACjE,KAAiB;AAAA,EACjB,OAAO;AAAA,EACP,WAAyB;AAAA,EAEzB,eAAqC;AAAA;AAAA;AAAA,IAG5C,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA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