@acedatacloud/nexior 3.371.3 → 3.371.4
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/dist/assets/{ApiCodeButton-CGRTnBjA.js → ApiCodeButton-B7iQtRyE.js} +1 -1
- package/dist/assets/{ApiCodeDialog-Gay4bCfr.js → ApiCodeDialog-CjY9zUXD.js} +1 -1
- package/dist/assets/{Artifacts-4mJocbBS.js → Artifacts-DyoBOofL.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BiIL49gU.js → AskUserQuestionCard-Stu32_7A.js} +1 -1
- package/dist/assets/{AudioPreview-Caes5-Xb.js → AudioPreview-aCkjiIEz.js} +1 -1
- package/dist/assets/{Auth-zKowLjrP.js → Auth-DetfyLGN.js} +1 -1
- package/dist/assets/{Bare-BZw1XJRd.js → Bare-Cuu1PNt6.js} +1 -1
- package/dist/assets/{BotPlaceholder-B285f5nu.js → BotPlaceholder-DwG3z10_.js} +1 -1
- package/dist/assets/{BottomFooter-Dw2YKFpW.js → BottomFooter-i12E3Wxn.js} +1 -1
- package/dist/assets/{BrowseConnectors-ei-2yWAD.js → BrowseConnectors-B8MJeXJk.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-D8kW-ViR.js → BrowserPairingDialog-B0hBZDzK.js} +1 -1
- package/dist/assets/{Callback-Bhm_-6C_.js → Callback-D1nEZs_g.js} +1 -1
- package/dist/assets/{CodeSnippet-Cwg8dFMK.js → CodeSnippet-DoIoonBw.js} +1 -1
- package/dist/assets/{Console-BtxrMcc2.js → Console-SAoY-xzV.js} +1 -1
- package/dist/assets/{Conversation-YJDeI6aL.js → Conversation-D48FgWHH.js} +1 -1
- package/dist/assets/{Conversation-DFANMvAM.js → Conversation-DghMnzHW.js} +1 -1
- package/dist/assets/{CopyToClipboard-CCt1tvH4.js → CopyToClipboard-sz0qw-Lr.js} +1 -1
- package/dist/assets/{Detail-idqj7qB_.js → Detail-AkAmjf-R.js} +1 -1
- package/dist/assets/{Extra-7JWcruAG.js → Extra-CE5pRCgt.js} +1 -1
- package/dist/assets/{FilePreview-BBYVVKx_.js → FilePreview-DKhYXSPe.js} +1 -1
- package/dist/assets/{Hailuo-CuoSeE43.js → Hailuo-CUjZNfzy.js} +1 -1
- package/dist/assets/{History-Na45kCwi.js → History-eoye6QHE.js} +1 -1
- package/dist/assets/{ImagePreview-HVDfPxCI.js → ImagePreview-BDgO7JJQ.js} +1 -1
- package/dist/assets/{ImageWrapper-DJusX6F3.js → ImageWrapper-C_8rYcTq.js} +1 -1
- package/dist/assets/{Index-kvn1jofi.js → Index-0CnHCdeq.js} +1 -1
- package/dist/assets/{Index-CJoHx7IL.js → Index-3ThIl7wr.js} +1 -1
- package/dist/assets/{Index-DgzaRU_u.js → Index-3kW06GOE.js} +1 -1
- package/dist/assets/{Index-BKLMDlNb.js → Index-5dSVc1yH.js} +1 -1
- package/dist/assets/{Index-B29NnMVJ.js → Index-BFDvfcbD.js} +1 -1
- package/dist/assets/{Index-Dtq3xaak.js → Index-BOkb_RNC.js} +1 -1
- package/dist/assets/{Index-CNApKteq.js → Index-BRLu1pwY.js} +1 -1
- package/dist/assets/{Index-CITMIscJ.js → Index-BUmolrNg.js} +1 -1
- package/dist/assets/{Index--YMh9P1_.js → Index-BVLJKgWp.js} +1 -1
- package/dist/assets/{Index-iXuXMV4M.js → Index-BW9gErcb.js} +1 -1
- package/dist/assets/{Index-SDOA4s6G.js → Index-Bf0GjUln.js} +1 -1
- package/dist/assets/{Index-DLgDiG8Y.js → Index-BgCdi3iz.js} +1 -1
- package/dist/assets/{Index-D9P6EhVK.js → Index-Bhw98Rcn.js} +1 -1
- package/dist/assets/{Index-CQt2DE-h.js → Index-BmT-hwvR.js} +1 -1
- package/dist/assets/{Index-Cw3tQFed.js → Index-Bzq6Sz1q.js} +1 -1
- package/dist/assets/{Index-kEioIUv1.js → Index-C1WDNKJt.js} +1 -1
- package/dist/assets/{Index-DYJg-Cpt.js → Index-CBTsPXsC.js} +1 -1
- package/dist/assets/{Index-DKHHbMFI.js → Index-CCtYsO7c.js} +1 -1
- package/dist/assets/{Index-BWL0b3ox.js → Index-CgJnZbEl.js} +1 -1
- package/dist/assets/{Index-rhe9ZgjA.js → Index-Crsd-Olk.js} +1 -1
- package/dist/assets/{Index-Ca_3yOj7.js → Index-Ct1qDnyL.js} +1 -1
- package/dist/assets/{Index-DAjb6kdK.js → Index-CvmDVbde.js} +1 -1
- package/dist/assets/{Index-BBv5I4X5.js → Index-D2MDmq-3.js} +1 -1
- package/dist/assets/{Index-39VcsoCv.js → Index-DAdby2RI.js} +1 -1
- package/dist/assets/{Index-B_TUv6kj.js → Index-DDh3GFmS.js} +1 -1
- package/dist/assets/{Index-BOlcEgT9.js → Index-DJSyrBHp.js} +1 -1
- package/dist/assets/{Index-DDTIPVMv.js → Index-Dlut7Ufb.js} +1 -1
- package/dist/assets/{Index-B2ki1RtE.js → Index-Dm7N0Udj.js} +1 -1
- package/dist/assets/{Index-CUK2OyT3.js → Index-Dpazwvgu.js} +1 -1
- package/dist/assets/{Index-B0CHcsji.js → Index-PRT7EuCp.js} +1 -1
- package/dist/assets/{Index-BWfjPdUt.js → Index-U822vfVB.js} +1 -1
- package/dist/assets/{Index-Dmzkglvs.js → Index-VIOTEzQH.js} +1 -1
- package/dist/assets/{Index-_wrjPICD.js → Index-dD77nmNZ.js} +1 -1
- package/dist/assets/{Index-CG_31FGm.js → Index-l2xagY55.js} +1 -1
- package/dist/assets/{Index-DNPIlc812.js → Index-s9-NbZBH2.js} +1 -1
- package/dist/assets/{Index-D5DYnpW9.js → Index-tDNDvukA.js} +1 -1
- package/dist/assets/{Invitees-moiTFnSF.js → Invitees-VLnksw93.js} +1 -1
- package/dist/assets/{List-TfhtIQaB.js → List-BLUsN_IY.js} +1 -1
- package/dist/assets/{List-CO2tMWVB.js → List-CyrUaLwU.js} +1 -1
- package/dist/assets/{List-FfbJ9ZZp.js → List-Dlt-YFs0.js} +1 -1
- package/dist/assets/{LocalTools-D5Gcci-U.js → LocalTools--4uRokHD.js} +1 -1
- package/dist/assets/{LocalTools-CKsGzj47.js → LocalTools-F_r2NtWr.js} +1 -1
- package/dist/assets/{Logo-BjrkUaTO.js → Logo-CcgvguPx.js} +1 -1
- package/dist/assets/{Main-CkTd100u.js → Main-zMnU7rdc.js} +1 -1
- package/dist/assets/{Message-DAXFqRgv.js → Message-BJsVECMX.js} +1 -1
- package/dist/assets/{Model-C89H_Vps.js → Model-CJu53VI-.js} +1 -1
- package/dist/assets/{Navigator-Cp5jJMRX.js → Navigator-CD_Mkms3.js} +3 -3
- package/dist/assets/{NotFound-c2IbZOdP.js → NotFound-DTJNOBje.js} +1 -1
- package/dist/assets/{PageHeader-BmPV4nuL.js → PageHeader-DBhZwlSN.js} +1 -1
- package/dist/assets/{Pay-C-lXWCpI.js → Pay-Dcf4fAwM.js} +1 -1
- package/dist/assets/{Player-BnwMeYKj.js → Player-NTv8iHvb.js} +1 -1
- package/dist/assets/{Poivelle-B3qLX-0g.js → Poivelle-DMmhJBKc.js} +1 -1
- package/dist/assets/{RealtimeCall-0lHBPV7C.js → RealtimeCall-DeM2ERNf.js} +1 -1
- package/dist/assets/{ReportButton-57emj3Ag.js → ReportButton-DbaMTiER.js} +1 -1
- package/dist/assets/{ReportDialog-BZsBwGJJ.js → ReportDialog-DNwoEOAa.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-B2nWCVIR.js → ScenarioPaymentMode-kZ7zDlkq.js} +1 -1
- package/dist/assets/{ScheduledTasks-BefYu5UX.js → ScheduledTasks-8gnn-weY.js} +1 -1
- package/dist/assets/{ServicePricingSummary-C5wco0tz.js → ServicePricingSummary-B6e4UMsc.js} +1 -1
- package/dist/assets/{ShowcaseGrid-D6wCcr43.js → ShowcaseGrid-BoavwcxX.js} +1 -1
- package/dist/assets/{ShowcaseResultTabs-CQ3vtIJe.js → ShowcaseResultTabs-D1blU4xG.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-CtmABq2j.js → SolanaWalletPickerDialog-B8eL97-M.js} +1 -1
- package/dist/assets/{Status-BujsSuxP.js → Status-DqCTQE1N.js} +1 -1
- package/dist/assets/{Subscribe-BioCvU_l.js → Subscribe-BPpiVhgm.js} +1 -1
- package/dist/assets/{TabSwitcher-Dvbx0qXf.js → TabSwitcher-BcumkFQb.js} +1 -1
- package/dist/assets/{Tts-dB9wsA-E.js → Tts-BvAhPcNh.js} +1 -1
- package/dist/assets/{VideoPlayer-i3VcnbHP.js → VideoPlayer-D5tztnYV.js} +1 -1
- package/dist/assets/{VideoPreview-CycVY7vI.js → VideoPreview-aiX7Evfh.js} +1 -1
- package/dist/assets/arrow-down-BSHeBz4t.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-De4Gt2z-.js → arrow-down-wide-narrow-CyKXpFct.js} +1 -1
- package/dist/assets/arrow-left-CQxDtYWw.js +1 -0
- package/dist/assets/arrow-right-B8UUyzYE.js +1 -0
- package/dist/assets/arrow-up-CPa1E8_P.js +1 -0
- package/dist/assets/{authorizeFlow-CMFNwjAy.js → authorizeFlow-BmStuqRw.js} +1 -1
- package/dist/assets/{avatar-B40VLBOo.js → avatar-DW8vBFvO.js} +1 -1
- package/dist/assets/{basic-B8RTc2o2.js → basic-V_dCQN-7.js} +1 -1
- package/dist/assets/{book-open-DgI_5ukf.js → book-open-Cx0F2c3b.js} +1 -1
- package/dist/assets/{box-BcHSnpH-.js → box-CTxxH32k.js} +1 -1
- package/dist/assets/{boxes-DY1x746v.js → boxes-D-h30qOE.js} +1 -1
- package/dist/assets/{brain-CRWdx7Pw.js → brain-BCdV44ve.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-DYbfFjq9.js → chart-no-axes-combined-D__zR5Ki.js} +1 -1
- package/dist/assets/{chat-zzRfVzx2.js → chat-EYuHs0yr.js} +1 -1
- package/dist/assets/check-C8mVEur2.js +1 -0
- package/dist/assets/chevron-down-C9d0FXRE.js +1 -0
- package/dist/assets/chevron-right-4Ky2D1GB.js +1 -0
- package/dist/assets/{circle-alert-quyhohc-.js → circle-alert-Cpi8B8aa.js} +1 -1
- package/dist/assets/circle-check-DzyKsQ5E.js +1 -0
- package/dist/assets/{circle-question-mark-CPbnmTcR.js → circle-question-mark-Dl_sOM5u.js} +1 -1
- package/dist/assets/{clipboard-list-BQKLA0v1.js → clipboard-list-D7AvBFtP.js} +1 -1
- package/dist/assets/clock-mP13CJwv.js +1 -0
- package/dist/assets/code-Pa0xuy7_.js +1 -0
- package/dist/assets/{codingBridge-ukbnxa2i.js → codingBridge-plv81E-l.js} +1 -1
- package/dist/assets/{coins-VScLyfIR.js → coins-BzdFOUsK.js} +1 -1
- package/dist/assets/{copy-BZ-nQMG2.js → copy-DtEpCnzV.js} +1 -1
- package/dist/assets/{createTaskActions-BfAz4tbb.js → createTaskActions-CYIxJbdr.js} +1 -1
- package/dist/assets/{date-picker-546ouPku.js → date-picker-BWwuIFnn.js} +1 -1
- package/dist/assets/{digitalhuman-DT6tPIDY.js → digitalhuman-BT4yd-cQ.js} +1 -1
- package/dist/assets/{dollar-sign-BIKVJENN.js → dollar-sign-D0R0nPhR.js} +1 -1
- package/dist/assets/{download-BHzlU_bJ.js → download-BdDFltwZ.js} +1 -1
- package/dist/assets/{drawer-yTqzLaen.js → drawer-KN1LRowH.js} +1 -1
- package/dist/assets/{dropdown-DxHZhHbe.js → dropdown-DWPPZIyK.js} +1 -1
- package/dist/assets/{dropdown-Bw011FVB.js → dropdown-_LBWBf-Y.js} +1 -1
- package/dist/assets/{ellipsis-CJqSKBCr.js → ellipsis-CQoyd1U8.js} +1 -1
- package/dist/assets/{esm-YlpVonMH.js → esm-BG657CGV.js} +2 -2
- package/dist/assets/{external-link-DXffEL3Y.js → external-link-xL7IaTrI.js} +1 -1
- package/dist/assets/{eye-FxhnNuOz.js → eye-C9gPEb69.js} +1 -1
- package/dist/assets/{file-DtMwLDy5.js → file-hh1eR7jk.js} +1 -1
- package/dist/assets/{file-output-CgPlARBN.js → file-output-_urjII1S.js} +1 -1
- package/dist/assets/{file-text-YhDtvMQ4.js → file-text-CTEvw_kE.js} +1 -1
- package/dist/assets/{fish-6YK_gMzf.js → fish-IksHjaG0.js} +1 -1
- package/dist/assets/{flux-DVtrOmjb.js → flux-fgdaXnVh.js} +1 -1
- package/dist/assets/{folder-BOq3rzmG.js → folder-DMqgztyI.js} +1 -1
- package/dist/assets/gauge-BqFWKACq.js +1 -0
- package/dist/assets/{generationInput-3_W3r_nF.js → generationInput-C5bI6y33.js} +1 -1
- package/dist/assets/{globe-DWsAWE_I.js → globe-MR7AWDCi.js} +1 -1
- package/dist/assets/{grokvideo-BV4Snx8H.js → grokvideo-BuG-TOG_.js} +1 -1
- package/dist/assets/{hailuo-C6AjT7BG.js → hailuo-0xIEKJD_.js} +1 -1
- package/dist/assets/{headphones-CDk8qDYh.js → headphones-DCyyVGL4.js} +1 -1
- package/dist/assets/{history-B25VEzje.js → history-DNd_c346.js} +1 -1
- package/dist/assets/{house-CWbvhhdE.js → house-BbdNS63y.js} +1 -1
- package/dist/assets/{image-mOJ1ByjJ.js → image-CZ_tH9kY.js} +1 -1
- package/dist/assets/{index-DM6hrjyQ.js → index-BDrhpCy4.js} +3 -3
- package/dist/assets/{index.es-B7BnZqPt.js → index.es-DRsketdd.js} +1 -1
- package/dist/assets/{info-AmBm9Cbx.js → info-BWyB8juG.js} +1 -1
- package/dist/assets/{input-number-BCjyae0g.js → input-number-BB7Zip42.js} +1 -1
- package/dist/assets/{key-round-qVD6kc-r.js → key-round-Dkk-knOA.js} +1 -1
- package/dist/assets/{kling-DsaOmBOS.js → kling-Cqc8JB9o.js} +1 -1
- package/dist/assets/{languages-DS2I-fXP.js → languages-LYXiy8Zw.js} +1 -1
- package/dist/assets/{laptop-CzgKynug.js → laptop-B4VpgJZX.js} +1 -1
- package/dist/assets/{lightbulb-ClD2GCjs.js → lightbulb-zTCBaXI3.js} +1 -1
- package/dist/assets/{link-DkSgA3dd.js → link-CBFmk5Ee.js} +1 -1
- package/dist/assets/loader-circle-BOHt8R3r.js +1 -0
- package/dist/assets/{lock-YVHBp4zq.js → lock-B3J02iis.js} +1 -1
- package/dist/assets/{luma-BPUDITN-.js → luma-CAg5eV4r.js} +1 -1
- package/dist/assets/{maestro-Dza-xdK1.js → maestro-b5VEc7e9.js} +1 -1
- package/dist/assets/{mail-BcrDtzjl.js → mail-TiuuwEaM.js} +1 -1
- package/dist/assets/{message-circle-IeKu5nx9.js → message-circle-ClAaI6hb.js} +1 -1
- package/dist/assets/{mic-DThA7f_u.js → mic-BIEMJL96.js} +1 -1
- package/dist/assets/{midjourney-BnT_R0Ip.js → midjourney-EES_2sWB.js} +1 -1
- package/dist/assets/{minimax-CR2mnCyQ.js → minimax-CwrWw1Ng.js} +1 -1
- package/dist/assets/{monitor-C7pDvjST.js → monitor-BYunWSkl.js} +1 -1
- package/dist/assets/{mouse-pointer-2-BGP2gVgn.js → mouse-pointer-2-BhJwpXJW.js} +1 -1
- package/dist/assets/music-2-CqlmSnd9.js +1 -0
- package/dist/assets/{nanobanana-CK-KHD71.js → nanobanana-y3dBZ6If.js} +1 -1
- package/dist/assets/{omni-CrWWTQMD.js → omni-Y9f6jFc4.js} +1 -1
- package/dist/assets/{openaiimage-C56Iwluv.js → openaiimage-Q2e2U6WO.js} +1 -1
- package/dist/assets/{pagination-BH4MphOL.js → pagination-B3M80drG.js} +1 -1
- package/dist/assets/{pagination-D-Ckizkk.js → pagination-BV08b7GL.js} +1 -1
- package/dist/assets/{pagination-50HEMFzY.js → pagination-CMtbXlkA.js} +1 -1
- package/dist/assets/{palette-CIMGKHKc.js → palette-oW13lGeT.js} +1 -1
- package/dist/assets/{paperclip-DHtaHoBJ.js → paperclip-x387dn2o.js} +1 -1
- package/dist/assets/{pause-Dh4Nf3e4.js → pause-BHPTY1dG.js} +1 -1
- package/dist/assets/{pencil-Dxw_6QaO.js → pencil-ppJ1ler-.js} +1 -1
- package/dist/assets/{pika-5A4aNWRC.js → pika-DXDppRKZ.js} +1 -1
- package/dist/assets/{pixverse-C6SKj6kT.js → pixverse-LzJlnbKz.js} +1 -1
- package/dist/assets/play-DHhh0pVt.js +1 -0
- package/dist/assets/{plug-CVrABqVX.js → plug-52V5XNg-.js} +1 -1
- package/dist/assets/plus-DO3XunBM.js +1 -0
- package/dist/assets/{poivelle-BqyypMcW.js → poivelle-AAZ1haTU.js} +1 -1
- package/dist/assets/{popover-CCAggJhc.js → popover-PJLeQqI9.js} +1 -1
- package/dist/assets/{producer-D6Jl2NpZ.js → producer-xcN6JvgN.js} +1 -1
- package/dist/assets/{qrart-BD8R3F1p.js → qrart-C5PbBgxj.js} +1 -1
- package/dist/assets/{qwenimage-CSMZKkyT.js → qwenimage-DMqjHshG.js} +1 -1
- package/dist/assets/{realtime-BzbMi6Db.js → realtime-BO9Am7p6.js} +1 -1
- package/dist/assets/{refresh-cw-CVSSWpQM.js → refresh-cw-DuY3Ve_P.js} +1 -1
- package/dist/assets/rotate-ccw-Bd8Mcint.js +1 -0
- package/dist/assets/rotate-cw-BXhODUI7.js +1 -0
- package/dist/assets/search-68wZrrVQ.js +1 -0
- package/dist/assets/{seedance-Bb_b_89I.js → seedance-CfqX2vo9.js} +1 -1
- package/dist/assets/{seedream-CpEq4B8M.js → seedream-DtUIl22l.js} +1 -1
- package/dist/assets/{select-BrdGcmQV.js → select-CJHU1puz.js} +1 -1
- package/dist/assets/{serp-KvxmJhd4.js → serp-DmwcYFH-.js} +1 -1
- package/dist/assets/{shield-D8Epv2bc.js → shield-7wMqeCnl.js} +1 -1
- package/dist/assets/{showcase-DLvb5FT2.js → showcase-BSzYXnlk.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-TEhFBc7v.js → showcaseRecreateMixin-l4sq0RCR.js} +1 -1
- package/dist/assets/{shuffle-qSlPWPcQ.js → shuffle-DEDsU45E.js} +1 -1
- package/dist/assets/{siteHome-BPe9s0lU.js → siteHome-AQGaYnOE.js} +1 -1
- package/dist/assets/{slider-Dmaw2uOQ.js → slider-D9GXU4sY.js} +1 -1
- package/dist/assets/{solana-wallets-Bqt8suXe.js → solana-wallets-ET1Yt6cz.js} +2 -2
- package/dist/assets/{sora-qoRgh7iI.js → sora-iBNspn8m.js} +1 -1
- package/dist/assets/{sparkles-BW1PBCix.js → sparkles-CcOmlUWX.js} +1 -1
- package/dist/assets/square-OTIXmfWE.js +1 -0
- package/dist/assets/{store-BM4V4uhC.js → store-DSn2Uqvw.js} +1 -1
- package/dist/assets/{suno-3tNeDQrn.js → suno-h9DfMDLr.js} +1 -1
- package/dist/assets/{switch-B1g5dw5D.js → switch-B8GgL0Se.js} +1 -1
- package/dist/assets/{table-CmXt553N.js → table-DaCzJh_U.js} +1 -1
- package/dist/assets/{tag-BaQlfV2_.js → tag-BaBXQkeI.js} +1 -1
- package/dist/assets/{taskPolling-BSXKWFXo.js → taskPolling-CGGGJX46.js} +1 -1
- package/dist/assets/terminal-DVkZFQop.js +1 -0
- package/dist/assets/{time-picker-u02IM5RL.js → time-picker-VI1MHfCH.js} +1 -1
- package/dist/assets/{tooltip-Drsa0R-y.js → tooltip-BmwZvoCo.js} +1 -1
- package/dist/assets/{trash-2-qsTysEar.js → trash-2-Bgi3IwhR.js} +1 -1
- package/dist/assets/{triangle-alert-wPWJieth.js → triangle-alert-tECqMJGT.js} +1 -1
- package/dist/assets/{upload-CYNoIKvu.js → upload-DNoc85A2.js} +1 -1
- package/dist/assets/user-B-D8rRw5.js +1 -0
- package/dist/assets/{veo-DM_UYXdG.js → veo-BByMo8C5.js} +1 -1
- package/dist/assets/{video-C-HdR_Qs.js → video-B1Lu-5UG.js} +1 -1
- package/dist/assets/{volume-2-DioCaOkE.js → volume-2-BflVGSM8.js} +1 -1
- package/dist/assets/{wallet-DUpARZWA.js → wallet-hT9dlcwr.js} +1 -1
- package/dist/assets/{wan-CfhH95bK.js → wan-CXudPQLi.js} +1 -1
- package/dist/assets/{wand-sparkles-B76KgpVz.js → wand-sparkles-CylWIDdZ.js} +1 -1
- package/dist/assets/{web-BHFFE-8r.js → web-B-NdHbL5.js} +1 -1
- package/dist/assets/{webextrator-CbGXAcFj.js → webextrator-BkIM2feg.js} +1 -1
- package/dist/assets/{zap-BDXCQHvY.js → zap-jib8JHPm.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +3 -2
- package/dist/assets/arrow-down-uzLp0EzK.js +0 -1
- package/dist/assets/arrow-left-Dh8RRepJ.js +0 -1
- package/dist/assets/arrow-right-Mc9TL9dE.js +0 -1
- package/dist/assets/arrow-up-Ok1QXX4J.js +0 -1
- package/dist/assets/check-Dkywcw9M.js +0 -1
- package/dist/assets/chevron-down-DofdIa77.js +0 -1
- package/dist/assets/chevron-right-BMqfbr8H.js +0 -1
- package/dist/assets/circle-check-DFAR5I11.js +0 -1
- package/dist/assets/clock-D_pf_5A-.js +0 -1
- package/dist/assets/code-B1khxmUM.js +0 -1
- package/dist/assets/gauge-D1GQHZS1.js +0 -1
- package/dist/assets/loader-circle-D26fSmns.js +0 -1
- package/dist/assets/music-2-BRWsn50W.js +0 -1
- package/dist/assets/play-CM6vdgoM.js +0 -1
- package/dist/assets/plus-CByC99a5.js +0 -1
- package/dist/assets/rotate-ccw-CqDtZEsB.js +0 -1
- package/dist/assets/rotate-cw-CKwX841o.js +0 -1
- package/dist/assets/search-BgeCUkYM.js +0 -1
- package/dist/assets/square-B_xQGZFm.js +0 -1
- package/dist/assets/terminal-DlnoUhS_.js +0 -1
- package/dist/assets/user-B6aZBiwl.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e,tt as t,z as n}from"./vendor-chart-Dw-P17PN.js";import{A as r}from"./index-
|
|
1
|
+
import{N as e,tt as t,z as n}from"./vendor-chart-Dw-P17PN.js";import{A as r}from"./index-BDrhpCy4.js";var i=n({name:`SettingsIndex`,mounted(){let e=this.$route.query.tab||``;window.dispatchEvent(new CustomEvent(`open-user-settings`,{detail:{tab:e}}))}}),a={class:`settings-page`};function o(n,r,i,o,s,c){return t(),e(`div`,a)}var s=r(i,[[`render`,o]]);export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,b as u,ht as d,j as f,mt as p,ot as m,qt as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-BrdGcmQV.js";import{n as S,t as C}from"./tabs-D_ymCjuP.js";import{t as w}from"./tooltip-Drsa0R-y.js";import{v as T}from"./models-qt9s4QBH.js";import{n as E,r as D,t as O}from"./dropdown-Bw011FVB.js";import{t as k}from"./pagination-D-Ckizkk.js";import{t as A}from"./switch-B1g5dw5D.js";import{t as j}from"./arrow-down-uzLp0EzK.js";import{t as M}from"./arrow-left-Dh8RRepJ.js";import{t as N}from"./book-open-DgI_5ukf.js";import{t as P}from"./chevron-down-DofdIa77.js";import{t as F}from"./chevron-right-BMqfbr8H.js";import{t as I}from"./circle-check-DFAR5I11.js";import{t as L}from"./circle-question-mark-CPbnmTcR.js";import{t as ee}from"./clipboard-list-BQKLA0v1.js";import{t as te}from"./code-B1khxmUM.js";import{t as R}from"./copy-BZ-nQMG2.js";import{t as ne}from"./ellipsis-CJqSKBCr.js";import{t as re}from"./eye-FxhnNuOz.js";import{t as ie}from"./file-text-YhDtvMQ4.js";import{t as z}from"./file-DtMwLDy5.js";import{t as ae}from"./folder-BOq3rzmG.js";import{t as oe}from"./image-mOJ1ByjJ.js";import{t as se}from"./lock-YVHBp4zq.js";import{t as B}from"./plus-CByC99a5.js";import{n as ce,t as le}from"./store-BM4V4uhC.js";import{t as ue}from"./search-BgeCUkYM.js";import{t as de}from"./trash-2-qsTysEar.js";import{t as fe}from"./triangle-alert-wPWJieth.js";import{t as pe}from"./upload-CYNoIKvu.js";import{t as me}from"./wand-sparkles-B76KgpVz.js";import{S as he,T as ge,k as _e,w as ve,y as ye}from"./i18n-BQrNxKw9.js";import{$a as be,A as V,Ba as H,Ha as U,Ia as xe,Ka as W,Va as Se,Xi as G,Yi as K,lo as q,to as J}from"./index-DM6hrjyQ.js";import{a as Ce,c as we,d as Te,f as Ee,i as De,l as Oe,m as Y,n as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe}from"./vendor-highlight-BHrfT4-E.js";import{t as Ie}from"./index.es-B7BnZqPt.js";import{t as Le}from"./VueMarkdown-CiiRjbWs.js";import{t as Re}from"./PageHeader-BmPV4nuL.js";var ze=H(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Be=H(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Ve=H(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),He=H(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ue=H(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),X=()=>({baseURL:`${xe()}/api/v1`}),Z=new class{key=`skills/installed`;async list(){return K.get(`/${this.key}/`,X())}async get(e){return K.get(`/${this.key}/${e}/`,X())}async createMarkdown(e){return K.post(`/${this.key}/`,e,X())}async createTarball(e){let t=new FormData;return t.append(`tarball`,e),K.post(`/${this.key}/`,t,{...X(),headers:{"Content-Type":`multipart/form-data`}})}async update(e,t){return K.patch(`/${this.key}/${e}/`,t,X())}async remove(e){return K.delete(`/${this.key}/${e}/`,X())}async enable(e){return K.post(`/${this.key}/${e}/enable/`,void 0,X())}async disable(e){return K.post(`/${this.key}/${e}/disable/`,void 0,X())}async fetchFile(e,t){let n=await K.get(`/${this.key}/${e}/files/`,{...X(),params:{path:t},responseType:`arraybuffer`}),r=n.headers[`content-type`]||`application/octet-stream`;return{blob:new Blob([n.data],{type:r}),contentType:r}}},Q=new class{key=`skills`;async list(e={}){return G.get(`/${this.key}/`,{...X(),params:e})}async get(e){return G.get(`/${this.key}/${e}/`,X())}async categories(){return G.get(`/${this.key}/categories/`,X())}async install(e,t={}){return K.post(`/${this.key}/${e}/install/`,t,X())}};function We(){let e=new Set;ve()&&e.add(`desktop`),ge()&&e.add(`ios`),he()&&e.add(`android`),_e()&&e.add(`web`);let t=ye();if(t===`mac`)e.add(`mac`);else if(t===`windows`)e.add(`windows`);else if(typeof navigator<`u`){let t=navigator.userAgent||``,n=navigator.userAgentData?.platform,r=/macintosh/i.test(t)&&(navigator.maxTouchPoints||0)>1;!ge()&&!r&&(n===`macOS`||/mac os x|macintosh/i.test(t))&&e.add(`mac`),(n===`Windows`||/windows nt/i.test(t))&&e.add(`windows`)}return e}var Ge=new Set([`mac`,`windows`,`desktop`,`web`,`ios`,`android`]);function Ke(e){let t=e.filter(e=>Ge.has(e));if(!t.length)return!0;let n=We();return t.some(e=>n.has(e))}Y.registerLanguage(`bash`,je),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var qe=12,Je=y({name:`BrowseSkillsDialog`,components:{VueMarkdown:Le,ElDialog:W,ElInput:q,ElButton:J,ElPagination:k,ElSelect:b,ElOption:x,FontAwesomeIcon:Ie,AddIcon:B,BackIcon:M,DownIcon:j,InstallIcon:ze,LockIcon:se,SearchIcon:ue,SuccessIcon:I},directives:{loading:U},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`installed`],data(){return{loading:!1,installing:!1,items:[],total:0,currentPage:1,searchQuery:``,namespaceFilter:``,sortBy:`popular`,selectedItem:null,searchTimer:null,knownNamespaces:[],publisherByNamespace:{}}},computed:{pageSize(){return qe},namespaceOptions(){let e=new Set(this.knownNamespaces);for(let t of this.items)e.add(t.namespace);return Array.from(e).sort().map(e=>({value:e,label:this.publisherForNamespace(e)}))},detailBody(){return this.selectedItem?this.selectedItem.content.replace(/^---\n[\s\S]*?\n---\n?/,``):``}},methods:{onOpen(){this.selectedItem=null,this.searchQuery=``,this.namespaceFilter=``,this.sortBy=`popular`,this.currentPage=1,this.knownNamespaces=[],this.publisherByNamespace={},this.loadFacets(),this.reload()},openDetail(e){this.selectedItem=e},async loadFacets(){try{let{data:e}=await Q.categories(),t=new Set;for(let n of e.namespaces)t.add(n.namespace);this.knownNamespaces=Array.from(t).sort()}catch(e){console.warn(`failed to load skill catalog facets`,e)}},reloadFromFirstPage(){this.currentPage=1,this.reload()},onPageChange(e){this.currentPage=e,this.reload(),this.$nextTick(()=>{let e=this.$el.querySelector(`.directory-grid-wrapper`);e&&(e.scrollTop=0)})},onSearchInput(){this.searchTimer!==null&&window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.reloadFromFirstPage()},250)},async reload(){this.loading=!0;try{let{data:e}=await Q.list({q:this.searchQuery.trim()||void 0,namespace:this.namespaceFilter||void 0,sort:this.sortBy,limit:this.pageSize,offset:(this.currentPage-1)*this.pageSize});this.items=e.items,this.total=e.total;for(let t of e.items)t.publisher&&(this.publisherByNamespace[t.namespace]=t.publisher)}catch(e){console.error(e),T.error(this.$t(`skill.directory.loadFailed`))}finally{this.loading=!1}},async onInstall(e){if(!this.installing&&!e.installed){if(!this.canInstallOnSurface(e)){T.warning(this.$t(`skill.directory.surfaceBlocked`,{platforms:this.surfaceLabels(e)}));return}this.installing=!0;try{let{data:t}=await Q.install(e.id);T.success(this.$t(`skill.directory.installSuccess`,{name:e.slug})),this.$emit(`installed`,t.id),e.installed=!0,e.install_count+=1}catch(t){let n=this.extractError(t);n.includes(`already exists`)?(e.installed=!0,T.warning(this.$t(`skill.directory.alreadyInstalled`,{name:e.slug}))):T.error(this.$t(`skill.directory.installFailed`,{detail:n}))}finally{this.installing=!1}}},extractError(e){return e?.response?.data?.detail||String(e)||`unknown error`},formatCount(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)},publisherForNamespace(e){if(this.publisherByNamespace[e])return this.publisherByNamespace[e];let t=this.items.find(t=>t.namespace===e);return t?t.publisher:e},restrictedSurfaces(e){let t=e.frontmatter?.surfaces;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim().toLowerCase()):[]},surfaceLabel(e){let t=`skill.directory.surface.${e}`,n=this.$t(t);return n===t?e:n},surfaceLabels(e){return this.restrictedSurfaces(e).map(e=>this.surfaceLabel(e)).join(` / `)},canInstallOnSurface(e){return Ke(this.restrictedSurfaces(e))}}}),Ye={class:`directory`},Xe={class:`directory-main`},Ze={class:`directory-header`},Qe={class:`directory-controls`},$e={class:`directory-grid-wrapper`},et={key:0,class:`directory-empty`},tt={key:1,class:`directory-grid`},nt=[`onClick`],rt={class:`directory-card-head`},it={class:`directory-card-title`},at=[`title`],ot=[`title`],st=[`aria-label`,`title`,`onClick`],ct=[`title`],lt={class:`directory-card-meta`},ut={class:`directory-card-publisher`},dt={key:0,class:`directory-card-count`},ft=[`title`],pt={class:`directory-card-desc`},mt={key:0,class:`directory-footer`},ht={class:`directory-detail-head`},gt={class:`directory-detail-actions`},_t=[`href`],vt={class:`directory-detail-body`},yt={class:`directory-detail-title`},bt={class:`directory-detail-meta`},xt={key:0},St={key:1},Ct=[`title`],wt={class:`directory-detail-desc`};function Tt(u,h,_,y,b,x){let S=l(`search-icon`),C=l(`el-input`),w=l(`el-option`),T=l(`el-select`),E=l(`success-icon`),D=l(`lock-icon`),O=l(`add-icon`),k=l(`down-icon`),A=l(`el-pagination`),j=l(`back-icon`),M=l(`font-awesome-icon`),N=l(`el-button`),P=l(`install-icon`),F=l(`vue-markdown`),I=l(`el-dialog`),L=m(`loading`);return v(),f(I,{"model-value":u.modelValue,title:u.$t(`skill.dialog.directoryTitle`),width:`min(960px, 94vw)`,"align-center":``,class:`directory-dialog`,"close-on-click-modal":!u.installing,"show-close":!u.installing,"onUpdate:modelValue":h[5]||=e=>u.$emit(`update:modelValue`,e),onOpen:u.onOpen},{default:p(()=>[e(`div`,Ye,[e(`main`,Xe,[u.selectedItem?(v(),s(c,{key:1},[e(`header`,ht,[e(`button`,{class:`directory-back-btn`,onClick:h[3]||=e=>u.selectedItem=null},[a(j,{size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.back`)),1)]),e(`div`,gt,[u.selectedItem.source_url?(v(),s(`a`,{key:0,href:u.selectedItem.source_url,target:`_blank`,class:`directory-link`},[a(M,{icon:`fa-brands fa-github`}),r(` `+i(u.$t(`skill.directory.viewSource`)),1)],8,_t)):o(``,!0),u.selectedItem.installed?(v(),f(N,{key:1,disabled:``,type:`success`,plain:``},{default:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.installed`)),1)]),_:1})):u.selectedItem.installable&&!u.canInstallOnSurface(u.selectedItem)?(v(),f(N,{key:2,disabled:``,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(u.selectedItem)})},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.surfaceUnavailable`)),1)]),_:1},8,[`title`])):u.selectedItem.installable?(v(),f(N,{key:3,type:`primary`,loading:u.installing,onClick:h[4]||=e=>u.onInstall(u.selectedItem)},{default:p(()=>[a(P,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.install`)),1)]),_:1},8,[`loading`])):(v(),f(N,{key:4,disabled:``,title:u.selectedItem.license},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.selectedItem.license||u.$t(`skill.directory.notInstallable`)),1)]),_:1},8,[`title`]))])]),e(`div`,vt,[e(`h2`,yt,`/`+i(u.selectedItem.slug),1),e(`div`,bt,[e(`span`,null,[e(`strong`,null,i(u.$t(`skill.meta.addedBy`))+`:`,1),r(` `+i(u.selectedItem.publisher),1)]),u.selectedItem.license?(v(),s(`span`,xt,[e(`strong`,null,i(u.$t(`skill.directory.license`))+`:`,1),r(` `+i(u.selectedItem.license),1)])):o(``,!0),u.selectedItem.version?(v(),s(`span`,St,`v`+i(u.selectedItem.version),1)):o(``,!0),u.surfaceLabels(u.selectedItem)?(v(),s(`span`,{key:2,class:`directory-detail-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.$t(`skill.directory.surfaceOnly`,{platforms:u.surfaceLabels(u.selectedItem)})),9,Ct)):o(``,!0)]),e(`p`,wt,i(u.selectedItem.description),1),a(F,{class:`directory-detail-content`,source:u.detailBody,sanitize:``},null,8,[`source`])])],64)):(v(),s(c,{key:0},[e(`header`,Ze,[a(C,{modelValue:u.searchQuery,"onUpdate:modelValue":h[0]||=e=>u.searchQuery=e,class:`directory-search`,size:`default`,clearable:``,placeholder:u.$t(`skill.directory.searchPlaceholder`),onInput:u.onSearchInput},{prefix:p(()=>[a(S,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`,`onInput`]),e(`div`,Qe,[a(T,{modelValue:u.namespaceFilter,"onUpdate:modelValue":h[1]||=e=>u.namespaceFilter=e,class:`directory-select`,placeholder:u.$t(`skill.directory.allPublishers`),clearable:``,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[(v(!0),s(c,null,g(u.namespaceOptions,e=>(v(),f(w,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),a(T,{modelValue:u.sortBy,"onUpdate:modelValue":h[2]||=e=>u.sortBy=e,class:`directory-select directory-select-sm`,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[a(w,{label:u.$t(`skill.directory.sort.popular`),value:`popular`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.recent`),value:`recent`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.name`),value:`name`},null,8,[`label`])]),_:1},8,[`modelValue`,`onChange`])])]),d((v(),s(`div`,$e,[!u.loading&&u.total===0?(v(),s(`p`,et,i(u.$t(`skill.directory.empty`)),1)):(v(),s(`div`,tt,[(v(!0),s(c,null,g(u.items,c=>(v(),s(`article`,{key:c.id,class:n([`directory-card`,{"is-installed":c.installed}]),onClick:e=>u.openDetail(c)},[e(`div`,rt,[e(`span`,it,`/`+i(c.slug),1),c.installed?(v(),s(`span`,{key:0,class:`directory-card-action is-installed`,title:u.$t(`skill.directory.installed`)},[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})],8,at)):c.installable&&!u.canInstallOnSurface(c)?(v(),s(`span`,{key:1,class:`directory-card-locked`,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(c)})},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ot)):c.installable?(v(),s(`button`,{key:2,class:`directory-card-action`,"aria-label":u.$t(`skill.directory.install`),title:u.$t(`skill.directory.install`),onClick:t(e=>u.onInstall(c),[`stop`])},[a(O,{size:16,"aria-hidden":`true`,focusable:`false`})],8,st)):(v(),s(`span`,{key:3,class:`directory-card-locked`,title:c.license},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ct))]),e(`div`,lt,[e(`span`,ut,i(c.publisher),1),c.install_count>0?(v(),s(`span`,dt,[a(k,{size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.formatCount(c.install_count)),1)])):o(``,!0),u.surfaceLabels(c)?(v(),s(`span`,{key:1,class:`directory-card-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.surfaceLabels(c)),9,ft)):o(``,!0)]),e(`p`,pt,i(c.description),1)],10,nt))),128))]))])),[[L,u.loading]]),u.total>u.pageSize?(v(),s(`footer`,mt,[a(A,{"current-page":u.currentPage,"page-size":u.pageSize,total:u.total,"pager-count":5,background:``,layout:`prev, pager, next, total`,onCurrentChange:u.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onCurrentChange`])])):o(``,!0)],64))])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`show-close`,`onOpen`])}var Et=V(Je,[[`render`,Tt],[`__scopeId`,`data-v-a9be2dc3`]]);Y.registerLanguage(`bash`,je),Y.registerLanguage(`css`,Ne),Y.registerLanguage(`go`,Ae),Y.registerLanguage(`javascript`,Ce),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`rust`,De),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`sql`,Me),Y.registerLanguage(`typescript`,ke),Y.registerLanguage(`xml`,Pe),Y.registerLanguage(`html`,Pe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),Y.registerAliases([`js`,`jsx`],{languageName:`javascript`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`rs`],{languageName:`rust`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var $=1e6;function Dt(e,t){let n=(e.split(`.`).pop()||``).toLowerCase();return n===`md`||t.startsWith(`text/markdown`)?`markdown`:n===`html`||n===`htm`||t.startsWith(`text/html`)?`html`:t.startsWith(`image/`)||[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`].includes(n)?`image`:t.startsWith(`text/`)||[`json`,`application/json`].includes(t.split(`;`)[0])?n?`code`:`text`:`binary`}function Ot(e){let t=(e.split(`.`).pop()||``).toLowerCase();return Y.getLanguage(t)?t:`plain`}var kt=y({name:`SkillFilePreview`,components:{ElButton:J,ElTooltip:w,ElTabs:S,ElTabPane:C,CodeIcon:te,CopyIcon:R,FileIcon:z,SaveIcon:He,SuccessIcon:I,ViewIcon:re,WarningIcon:fe,VueMarkdown:Le},directives:{loading:U},props:{skillId:{type:String,required:!0},path:{type:String,required:!0},editable:{type:Boolean,default:!1}},emits:[`save`],data(){return{MAX_PREVIEW_BYTES:$,loading:!1,error:``,contentType:``,size:0,textContent:``,imageUrl:``,truncated:!1,viewMode:`rendered`,dirty:!1,saving:!1,copied:!1,copiedTimer:void 0}},computed:{kind(){return this.path?Dt(this.path,this.contentType):`text`},canRender(){return this.kind===`markdown`||this.kind===`html`},hljsLang(){return`language-${Ot(this.path)}`},truncatedText(){return this.textContent}},watch:{path:{handler(){this.fetch()},immediate:!0}},beforeUnmount(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer)},methods:{humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},async fetch(){if(this.path){this.copied=!1,this.copiedTimer!==void 0&&(window.clearTimeout(this.copiedTimer),this.copiedTimer=void 0),this.loading=!0,this.error=``,this.textContent=``,this.truncated=!1,this.dirty=!1,this.imageUrl&&=(URL.revokeObjectURL(this.imageUrl),``);try{let{blob:e,contentType:t}=await Z.fetchFile(this.skillId,this.path);this.contentType=t,this.size=e.size;let n=Dt(this.path,t);if(n===`image`)this.imageUrl=URL.createObjectURL(e);else if(n!==`binary`){let t=await e.text();t.length>$&&(t=t.slice(0,$),this.truncated=!0),this.textContent=t,this.viewMode=n===`markdown`||n===`html`?`rendered`:`source`}}catch(e){let t=e,n=t?.response?.status,r=t?.response?.data?.detail||String(e);this.error=n?`(${n}) ${r}`:r}finally{this.loading=!1,this.$nextTick(()=>this.applyHighlight())}}},applyHighlight(){let e=this.$refs.codeEl;e&&this.kind===`code`&&this.viewMode!==`rendered`&&(delete e.dataset.highlighted,Y.highlightElement(e))},async onCopy(){if(this.textContent)try{await navigator.clipboard.writeText(this.textContent),this.copied=!0,this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1,this.copiedTimer=void 0},3e3),T.success(this.$t(`skill.preview.copied`))}catch{T.error(this.$t(`skill.preview.copyFailed`))}},async onSave(){this.saving=!0;try{await new Promise((e,t)=>{this.$emit(`save`,this.textContent,{resolve:e,reject:t})}),this.dirty=!1}catch{}finally{this.saving=!1}}}}),At={class:`preview-root`},jt={class:`toolbar`},Mt={class:`path-display`},Nt={key:0,class:`size-display`},Pt={class:`body`},Ft={key:0,class:`error`},It=[`srcdoc`],Lt={key:3,class:`image-pane`},Rt=[`src`,`alt`],zt={key:4,class:`binary`},Bt=[`placeholder`],Vt={key:6,class:`source-pane`},Ht={key:7,class:`truncated-warning`};function Ut(t,c,h,g,_,y){let b=l(`save-icon`),x=l(`el-button`),S=l(`success-icon`),C=l(`copy-icon`),w=l(`el-tooltip`),T=l(`view-icon`),E=l(`el-tab-pane`),D=l(`code-icon`),O=l(`el-tabs`),k=l(`warning-icon`),A=l(`vue-markdown`),j=l(`file-icon`),M=m(`loading`);return d((v(),s(`div`,At,[e(`div`,jt,[e(`span`,Mt,i(t.path||`—`),1),t.size?(v(),s(`span`,Nt,i(t.humanSize(t.size)),1)):o(``,!0),c[3]||=e(`span`,{class:`toolbar-spacer`},null,-1),t.editable?(v(),f(x,{key:1,type:`primary`,size:`small`,disabled:!t.dirty||t.saving,loading:t.saving,onClick:t.onSave},{default:p(()=>[a(b,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.save`)),1)]),_:1},8,[`disabled`,`loading`,`onClick`])):o(``,!0),a(w,{visible:t.copied,content:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),placement:`top-start`},{default:p(()=>[a(x,{size:`small`,circle:``,disabled:!t.textContent,"aria-label":t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),title:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),onClick:t.onCopy},{default:p(()=>[t.copied?(v(),f(S,{key:0,size:16,"aria-hidden":`true`,focusable:`false`})):(v(),f(C,{key:1,size:16,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`visible`,`content`])]),t.canRender?(v(),f(O,{key:0,modelValue:t.viewMode,"onUpdate:modelValue":c[0]||=e=>t.viewMode=e,class:`view-tabs`},{default:p(()=>[a(E,{name:`rendered`},{label:p(()=>[a(T,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewRendered`)),1)]),_:1}),a(E,{name:`source`},{label:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewSource`)),1)]),_:1})]),_:1},8,[`modelValue`])):o(``,!0),e(`div`,Pt,[t.error?(v(),s(`div`,Ft,[a(k,{class:`mr-2`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.error),1)])):t.kind===`markdown`&&t.viewMode===`rendered`?(v(),f(A,{key:1,class:`markdown-rendered`,source:t.textContent,sanitize:``},null,8,[`source`])):t.kind===`html`&&t.viewMode===`rendered`?(v(),s(`iframe`,{key:2,ref:`htmlFrame`,class:`html-frame`,sandbox:``,srcdoc:t.textContent},null,8,It)):t.kind===`image`?(v(),s(`div`,Lt,[e(`img`,{src:t.imageUrl,alt:t.path,class:`image-content`},null,8,Rt)])):t.kind===`binary`?(v(),s(`div`,zt,[a(j,{class:`binary-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.binary`,{type:t.contentType})),1)])):t.editable?d((v(),s(`textarea`,{key:5,"onUpdate:modelValue":c[1]||=e=>t.textContent=e,class:`source-editor`,spellcheck:`false`,placeholder:t.$t(`skill.placeholder.content`),onInput:c[2]||=e=>t.dirty=!0},null,40,Bt)),[[u,t.textContent]]):(v(),s(`pre`,Vt,[e(`code`,{ref:`codeEl`,class:n(t.hljsLang)},i(t.truncatedText),3)])),t.truncated?(v(),s(`p`,Ht,i(t.$t(`skill.preview.truncated`,{size:t.humanSize(t.MAX_PREVIEW_BYTES)})),1)):o(``,!0)])])),[[M,t.loading]])}var Wt=V(kt,[[`render`,Ut],[`__scopeId`,`data-v-872078d9`]]),Gt=new Set([`py`,`ts`,`tsx`,`js`,`jsx`,`json`,`yaml`,`yml`,`sh`,`bash`,`zsh`,`css`,`html`,`sql`,`go`,`rs`,`rb`,`java`,`cpp`,`c`,`h`,`toml`]),Kt=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function qt(e){let t=e.split(`/`).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();return t===`SKILL.md`?N:n===`md`?ie:Kt.has(n)?oe:Gt.has(n)?Ve:z}function Jt(e){let t=new Map;t.set(``,new Map);let n=(e,n)=>{let r=t.get(e);r||(r=new Map,t.set(e,r));let i=e?`${e}/${n}`:n,a=r.get(n);return a||(a={label:n,path:i,isLeaf:!1,children:[]},r.set(n,a),t.set(i,new Map)),a};for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length===0)continue;let i=e[e.length-1],a=e.slice(0,-1),o=``;for(let e of a)o=n(o,e).path;let s={label:i,path:r,isLeaf:!0},c=t.get(o);c||(c=new Map,t.set(o,c)),c.set(i,s)}let r=e=>{let n=t.get(e);if(!n)return[];let i=Array.from(n.values());for(let e of i)e.isLeaf||(e.children=r(e.path));return i.sort((e,t)=>e.path===`SKILL.md`?-1:t.path===`SKILL.md`?1:e.isLeaf===t.isLeaf?e.label.localeCompare(t.label):e.isLeaf?1:-1)};return r(``)}var Yt=y({name:`FileNode`,components:{ExpandDownIcon:P,ExpandRightIcon:F,FontAwesomeIcon:Ie},props:{node:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},skill:{type:Object,required:!0},depth:{type:Number,default:1}},emits:[`select-file`],data(){return{open:!0}},computed:{indent(){return 8+this.depth*16},isActive(){return this.node.isLeaf&&this.selectedSkillId===this.skill.id&&this.selectedPath===this.node.path}},methods:{isHtmlFile(e){return e.isLeaf&&e.path.toLowerCase().endsWith(`.html`)},iconFor(e){return e.isLeaf?qt(e.path):ae},onClick(){this.node.isLeaf?this.$emit(`select-file`,this.node.path):this.open=!this.open}}}),Xt=[`aria-label`,`title`],Zt={key:1,class:`node-chevron-spacer`},Qt={class:`node-label`},$t={key:0,class:`children`};function en(r,a,u,d,p,m){let y=l(`expand-down-icon`),b=l(`expand-right-icon`),x=l(`font-awesome-icon`),S=l(`file-node`,!0);return v(),s(`li`,null,[e(`div`,{class:n([`file-node`,{active:r.isActive}]),style:h({paddingLeft:r.indent+`px`}),onClick:a[1]||=(...e)=>r.onClick&&r.onClick(...e)},[r.node.isLeaf?(v(),s(`span`,Zt)):(v(),s(`button`,{key:0,class:`node-chevron`,"aria-label":r.$t(r.open?`common.button.collapse`:`common.button.expand`),title:r.$t(r.open?`common.button.collapse`:`common.button.expand`),onClick:a[0]||=t(e=>r.open=!r.open,[`stop`])},[r.open?(v(),f(y,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(b,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,Xt)),r.isHtmlFile(r.node)?(v(),f(x,{key:2,icon:`fa-brands fa-html5`,class:`node-icon`})):(v(),f(_(r.iconFor(r.node)),{key:3,class:`node-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Qt,i(r.node.label),1)],6),!r.node.isLeaf&&r.open?(v(),s(`ul`,$t,[(v(!0),s(c,null,g(r.node.children||[],e=>(v(),f(S,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:r.depth+1,onSelectFile:a[2]||=e=>r.$emit(`select-file`,e)},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`depth`]))),128))])):o(``,!0)])}var tn=y({name:`SkillRow`,components:{ExpandDownIcon:P,ExpandRightIcon:F,SkillIcon:ce,FileNode:V(Yt,[[`render`,en],[`__scopeId`,`data-v-5240087b`]])},props:{skill:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},expanded:{type:Boolean,default:!1}},emits:[`toggle-expand`,`select-skill`,`select-file`],computed:{tree(){return Jt(this.skill.asset_bundle_files)},hasChildren(){return this.skill.asset_bundle_files.length>1},isSkillSelected(){return this.selectedSkillId===this.skill.id&&!this.selectedPath}},methods:{onSelectFile(e){this.$emit(`select-file`,this.skill,e)}}}),nn={class:`skill-row-wrapper`},rn=[`aria-label`,`title`],an={key:1,class:`row-chevron-spacer`},on=[`title`],sn={key:0,class:`file-list`};function cn(r,u,d,p,m,h){let _=l(`expand-down-icon`),y=l(`expand-right-icon`),b=l(`skill-icon`),x=l(`file-node`);return v(),s(`li`,nn,[e(`div`,{class:n([`skill-row`,{active:r.isSkillSelected}]),onClick:u[1]||=e=>r.$emit(`select-skill`,r.skill)},[r.hasChildren?(v(),s(`button`,{key:0,class:`row-chevron`,"aria-label":r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),title:r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),onClick:u[0]||=t(e=>r.$emit(`toggle-expand`,r.skill),[`stop`])},[r.expanded?(v(),f(_,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(y,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,rn)):(v(),s(`span`,an)),a(b,{class:`row-icon`,size:16,"aria-hidden":`true`,focusable:`false`}),e(`span`,{class:`row-label`,title:r.skill.name},i(r.skill.slug),9,on)],2),r.expanded&&r.hasChildren?(v(),s(`ul`,sn,[(v(!0),s(c,null,g(r.tree,e=>(v(),f(x,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:1,onSelectFile:r.onSelectFile},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`onSelectFile`]))),128))])):o(``,!0)])}var ln=V(tn,[[`render`,cn],[`__scopeId`,`data-v-231c2ce1`]]),un=10*1024*1024,dn=/\.(tar\.gz|tgz|tar|zip|md)$/i,fn=y({name:`UploadSkillDialog`,components:{ElDialog:W,ElButton:J,AddFileIcon:Ue,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{file:null,isDragging:!1,uploading:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.uploading||this.$emit(`update:modelValue`,!1)},reset(){this.file=null,this.isDragging=!1;let e=this.$refs.fileInput;e&&(e.value=``)},humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},onPickFile(){this.uploading||this.$refs.fileInput?.click()},onFilePicked(e){let t=e.target.files?.[0]||null;this.acceptFile(t)},onDrop(e){this.isDragging=!1;let t=e.dataTransfer?.files?.[0]||null;this.acceptFile(t)},acceptFile(e){if(!e){this.file=null;return}if(e.size>un){T.error(this.$t(`skill.message.fileTooLarge`));return}if(!dn.test(e.name)){T.error(this.$t(`skill.message.fileTypeWrong`));return}this.file=e},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.file){this.uploading=!0;try{if(/\.md$/i.test(this.file.name)){let e=await this.file.text(),{data:t}=await Z.createMarkdown({content:e});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,t.id)}else{let{data:e}=await Z.createTarball(this.file);T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id)}this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.uploading=!1}}}}}),pn={key:0,class:`dropzone-hint`},mn={key:1,class:`dropzone-file`},hn={class:`dropzone-file-name`},gn={class:`dropzone-file-size`},_n={class:`requirements`},vn={class:`requirements-title`};function yn(o,c,u,d,m,h){let g=l(`add-file-icon`),_=l(`el-button`),y=l(`cloud-upload-icon`),b=l(`el-dialog`);return v(),f(b,{"model-value":o.modelValue,title:o.$t(`skill.dialog.uploadTitle`),width:`min(520px, 94vw)`,"align-center":``,"close-on-click-modal":!o.uploading,"close-on-press-escape":!o.uploading,"show-close":!o.uploading,"onUpdate:modelValue":o.onVisibleChange,onClosed:o.reset},{footer:p(()=>[a(_,{disabled:o.uploading,onClick:o.onClose},{default:p(()=>[r(i(o.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(_,{type:`primary`,loading:o.uploading,disabled:!o.file,onClick:o.onSubmit},{default:p(()=>[a(y,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`input`,{ref:`fileInput`,type:`file`,accept:`.tar.gz,.tgz,.tar,.zip,.md,application/gzip,application/zip,application/x-tar,text/markdown`,hidden:``,onChange:c[0]||=(...e)=>o.onFilePicked&&o.onFilePicked(...e)},null,544),e(`div`,{class:n([`dropzone`,{"is-dragging":o.isDragging,"has-file":!!o.file}]),onClick:c[1]||=(...e)=>o.onPickFile&&o.onPickFile(...e),onDragover:c[2]||=t(e=>o.isDragging=!0,[`prevent`]),onDragleave:c[3]||=t(e=>o.isDragging=!1,[`prevent`]),onDrop:c[4]||=t((...e)=>o.onDrop&&o.onDrop(...e),[`prevent`])},[a(g,{class:`dropzone-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),o.file?(v(),s(`p`,mn,[e(`span`,hn,i(o.file.name),1),e(`span`,gn,i(o.humanSize(o.file.size)),1)])):(v(),s(`p`,pn,i(o.$t(`skill.dialog.uploadDrop`)),1))],34),e(`div`,_n,[e(`p`,vn,i(o.$t(`skill.dialog.fileRequirements`)),1),e(`ul`,null,[e(`li`,null,i(o.$t(`skill.dialog.requirementMd`)),1),e(`li`,null,i(o.$t(`skill.dialog.requirementArchive`)),1)])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var bn=V(fn,[[`render`,yn],[`__scopeId`,`data-v-a38152b9`]]),xn=y({name:`WriteSkillDialog`,components:{ElDialog:W,ElButton:J,ElInput:q,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{content:``,saving:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.saving||this.$emit(`update:modelValue`,!1)},reset(){this.content=``},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.content.trim()){this.saving=!0;try{let{data:e}=await Z.createMarkdown({content:this.content});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id),this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.saving=!1}}}}}),Sn={class:`hint`};function Cn(t,n,o,s,c,u){let d=l(`el-input`),m=l(`el-button`),h=l(`cloud-upload-icon`),g=l(`el-dialog`);return v(),f(g,{"model-value":t.modelValue,title:t.$t(`skill.dialog.writeTitle`),width:`min(720px, 94vw)`,"align-center":``,"close-on-click-modal":!t.saving,"close-on-press-escape":!t.saving,"show-close":!t.saving,"onUpdate:modelValue":t.onVisibleChange,onClosed:t.reset},{footer:p(()=>[a(m,{disabled:t.saving,onClick:t.onClose},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(m,{type:`primary`,loading:t.saving,disabled:!t.content.trim(),onClick:t.onSubmit},{default:p(()=>[a(h,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`p`,Sn,i(t.$t(`skill.dialog.writeHint`)),1),a(d,{modelValue:t.content,"onUpdate:modelValue":n[0]||=e=>t.content=e,type:`textarea`,rows:18,placeholder:t.$t(`skill.placeholder.content`),spellcheck:`false`,class:`editor`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var wn=y({name:`UserSkills`,components:{ConsolePageHeader:Re,ElInput:q,ElSwitch:A,ElTag:be,ElTooltip:w,ElDropdown:O,ElDropdownMenu:D,ElDropdownItem:E,AddIcon:B,AiCreateIcon:me,DeleteIcon:de,ExpandDownIcon:P,ExpandRightIcon:F,HelpIcon:L,MarketplaceIcon:le,MoreIcon:ne,SearchIcon:ue,SkillIcon:ce,UploadIcon:pe,WriteIcon:ee,BrowseSkillsDialog:Et,SkillFilePreview:Wt,SkillRow:ln,UploadSkillDialog:bn,WriteSkillDialog:V(xn,[[`render`,Cn],[`__scopeId`,`data-v-1946d5b3`]])},directives:{loading:U},data(){return{loading:!1,skills:[],togglingId:null,selectedSkillId:``,selectedPath:``,expandedSkillIds:[],personalOpen:!0,globalsOpen:!0,searchQuery:``,uploadVisible:!1,writeVisible:!1,browseVisible:!1}},computed:{personalSkills(){return this.skills.filter(e=>e.source!==`global`)},globalSkills(){return this.skills.filter(e=>e.source===`global`)},filteredPersonal(){return this.applyFilter(this.personalSkills)},filteredGlobal(){return this.applyFilter(this.globalSkills)},selectedSkill(){return this.skills.find(e=>e.id===this.selectedSkillId)||null}},mounted(){this.fetchSkills()},methods:{applyFilter(e){let t=this.searchQuery.trim().toLowerCase();return t?e.filter(e=>e.slug.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):e},async fetchSkills(){this.loading=!0;try{let{data:e}=await Z.list();if(this.skills=e||[],!this.selectedSkillId&&this.skills.length){let e=this.personalSkills[0]||this.skills[0];this.selectedSkillId=e.id}else this.selectedSkillId&&!this.skills.find(e=>e.id===this.selectedSkillId)&&(this.selectedSkillId=``,this.selectedPath=``)}catch(e){console.error(e),T.error(this.$t(`skill.message.loadFailed`))}finally{this.loading=!1}},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},selectSkill(e){this.selectedSkillId=e.id,this.selectedPath=``},selectFile(e,t){this.selectedSkillId=e.id,this.selectedPath=t},toggleExpand(e){let t=this.expandedSkillIds.indexOf(e.id);t>=0?this.expandedSkillIds.splice(t,1):this.expandedSkillIds.push(e.id)},openUpload(){this.uploadVisible=!0},openWrite(){this.writeVisible=!0},onBrowse(){this.browseVisible=!0},async onCreated(e){await this.fetchSkills();let t=this.skills.find(t=>t.id===e);t&&(this.selectedSkillId=t.id,this.selectedPath=``,this.personalOpen=!0)},async onSaveContent(e,t){if(!this.selectedSkill){t.reject();return}try{let{data:n}=await Z.update(this.selectedSkill.id,{content:e});T.success(this.$t(`skill.message.updateSuccess`));let r=this.skills.findIndex(e=>e.id===n.id);r>=0&&this.skills.splice(r,1,n),t.resolve()}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)})),t.reject(e)}},async onDelete(e){try{await Se.confirm(this.$t(`skill.message.deleteConfirm`,{slug:e.slug}),this.$t(`common.button.delete`),{type:`warning`})}catch{return}try{await Z.remove(e.id),T.success(this.$t(`skill.message.deleteSuccess`)),this.selectedSkillId===e.id&&(this.selectedSkillId=``,this.selectedPath=``),await this.fetchSkills()}catch(e){T.error(this.extractError(e))}},async onToggleSkill(e,t){this.togglingId=e.id;try{t?(await Z.enable(e.id),T.success(this.$t(`skill.message.enableSuccess`))):(await Z.disable(e.id),T.success(this.$t(`skill.message.disableSuccess`))),e.enabled=t}catch(e){T.error(this.extractError(e))}finally{this.togglingId=null}}}}),Tn={class:`skills-page`},En={class:`skills-shell`},Dn={class:`left-pane`},On={class:`left-header`},kn=[`aria-label`,`title`],An={class:`submenu-trigger`},jn={class:`badge-soon`},Mn={class:`left-body`},Nn={class:`section`},Pn={key:0,class:`skill-list`},Fn={key:0,class:`empty-row`},In={key:0,class:`section`},Ln={key:0,class:`skill-list`},Rn={class:`right-pane`},zn={class:`right-header`},Bn={class:`right-title`},Vn={class:`right-actions`},Hn=[`aria-label`,`title`],Un={class:`meta-card`},Wn={class:`meta-grid`},Gn={class:`meta-cell`},Kn={class:`meta-label`},qn={class:`meta-value`},Jn={class:`meta-cell`},Yn={class:`meta-label`},Xn={class:`meta-value`},Zn={key:0,class:`meta-cell`},Qn={class:`meta-label`},$n={class:`meta-tags`},er={key:0,class:`meta-description`},tr={class:`meta-description-label`},nr={class:`meta-label`},rr={class:`preview-card`},ir={key:2,class:`right-empty`};function ar(t,n,u,h,_,y){let b=l(`console-page-header`),x=l(`search-icon`),S=l(`el-input`),C=l(`add-icon`),w=l(`marketplace-icon`),T=l(`el-dropdown-item`),E=l(`expand-right-icon`),D=l(`ai-create-icon`),O=l(`write-icon`),k=l(`upload-icon`),A=l(`el-dropdown-menu`),j=l(`el-dropdown`),M=l(`expand-down-icon`),N=l(`skill-row`),P=l(`el-switch`),F=l(`more-icon`),I=l(`delete-icon`),L=l(`el-tag`),ee=l(`help-icon`),te=l(`el-tooltip`),R=l(`skill-file-preview`),ne=l(`skill-icon`),re=l(`upload-skill-dialog`),ie=l(`write-skill-dialog`),z=l(`browse-skills-dialog`),ae=m(`loading`);return v(),s(`div`,Tn,[a(b,{title:t.$t(`skill.title.skills`),subtitle:t.$t(`skill.message.pageDescription`)},null,8,[`title`,`subtitle`]),e(`div`,En,[e(`aside`,Dn,[e(`header`,On,[a(S,{modelValue:t.searchQuery,"onUpdate:modelValue":n[0]||=e=>t.searchQuery=e,class:`search-input`,size:`default`,clearable:``,placeholder:t.$t(`skill.placeholder.search`)},{prefix:p(()=>[a(x,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`]),a(j,{trigger:`click`,placement:`bottom-end`,"hide-on-click":!1},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{onClick:t.onBrowse},{default:p(()=>[a(w,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.browse`)),1)]),_:1},8,[`onClick`]),a(T,{divided:``},{default:p(()=>[a(j,{trigger:`hover`,placement:`left-start`,"hide-on-click":!0},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{disabled:``},{default:p(()=>[a(D,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.createWithClaude`))+` `,1),e(`span`,jn,i(t.$t(`skill.menu.soon`)),1)]),_:1}),a(T,{onClick:t.openWrite},{default:p(()=>[a(O,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.write`)),1)]),_:1},8,[`onClick`]),a(T,{onClick:t.openUpload},{default:p(()=>[a(k,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.upload`)),1)]),_:1},8,[`onClick`])]),_:1})]),default:p(()=>[e(`span`,An,[a(C,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.create`))+` `,1),a(E,{class:`submenu-arrow`,size:14,"aria-hidden":`true`,focusable:`false`})])]),_:1})]),_:1})]),_:1})]),default:p(()=>[e(`button`,{type:`button`,class:`add-button`,"aria-label":t.$t(`skill.button.add`),title:t.$t(`skill.button.add`)},[a(C,{size:16,"aria-hidden":`true`,focusable:`false`})],8,kn)]),_:1})]),d((v(),s(`div`,Mn,[e(`section`,Nn,[e(`button`,{class:`section-header`,onClick:n[1]||=e=>t.personalOpen=!t.personalOpen},[t.personalOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.personal`)),1)]),t.personalOpen?(v(),s(`ul`,Pn,[!t.loading&&t.filteredPersonal.length===0?(v(),s(`li`,Fn,i(t.searchQuery?t.$t(`skill.empty.search`):t.$t(`skill.message.noSkills`)),1)):o(``,!0),(v(!0),s(c,null,g(t.filteredPersonal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)]),t.globalSkills.length>0?(v(),s(`section`,In,[e(`button`,{class:`section-header`,onClick:n[2]||=e=>t.globalsOpen=!t.globalsOpen},[t.globalsOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.platform`)),1)]),t.globalsOpen?(v(),s(`ul`,Ln,[(v(!0),s(c,null,g(t.filteredGlobal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)])):o(``,!0)])),[[ae,t.loading]])]),e(`main`,Rn,[t.selectedSkill&&!t.selectedPath?(v(),s(c,{key:0},[e(`header`,zn,[e(`h3`,Bn,i(t.selectedSkill.slug),1),e(`div`,Vn,[a(P,{"model-value":t.selectedSkill.enabled,size:`default`,loading:t.togglingId===t.selectedSkill.id,onChange:n[3]||=e=>t.onToggleSkill(t.selectedSkill,!!e)},null,8,[`model-value`,`loading`]),t.selectedSkill.source===`global`?o(``,!0):(v(),f(j,{key:0,trigger:`click`,placement:`bottom-end`},{dropdown:p(()=>[a(A,null,{default:p(()=>[a(T,{onClick:n[4]||=e=>t.onDelete(t.selectedSkill)},{default:p(()=>[a(I,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.delete`)),1)]),_:1})]),_:1})]),default:p(()=>[e(`button`,{class:`icon-btn`,"aria-label":t.$t(`skill.button.more`),title:t.$t(`skill.button.more`)},[a(F,{size:16,"aria-hidden":`true`,focusable:`false`})],8,Hn)]),_:1}))])]),e(`div`,Un,[e(`div`,Wn,[e(`div`,Gn,[e(`span`,Kn,i(t.$t(`skill.meta.addedBy`)),1),e(`span`,qn,i(t.selectedSkill.source===`global`?t.$t(`skill.meta.platform`):t.$t(`skill.meta.you`)),1)]),e(`div`,Jn,[e(`span`,Yn,i(t.$t(`skill.meta.lastUpdated`)),1),e(`span`,Xn,i(t.$dayjs.format(t.selectedSkill.updated_at)),1)]),t.selectedSkill.required_connections.length?(v(),s(`div`,Zn,[e(`span`,Qn,i(t.$t(`skill.field.requiredConnections`)),1),e(`div`,$n,[(v(!0),s(c,null,g(t.selectedSkill.required_connections,e=>(v(),f(L,{key:e,size:`small`,type:`info`},{default:p(()=>[r(i(e),1)]),_:2},1024))),128))])])):o(``,!0)]),t.selectedSkill.description?(v(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`skill.field.description`)),1),t.selectedSkill.when_to_use?(v(),f(te,{key:0,content:t.selectedSkill.when_to_use,placement:`top`},{default:p(()=>[a(ee,{class:`meta-info-icon`,size:12,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])):o(``,!0)]),e(`p`,null,i(t.selectedSkill.description),1)])):o(``,!0)]),e(`div`,rr,[(v(),f(R,{key:`${t.selectedSkill.id}:SKILL.md`,"skill-id":t.selectedSkill.id,path:`SKILL.md`,editable:t.selectedSkill.source===`upload`,onSave:t.onSaveContent},null,8,[`skill-id`,`editable`,`onSave`]))])],64)):t.selectedSkill&&t.selectedPath?(v(),f(R,{key:`${t.selectedSkill.id}:${t.selectedPath}`,"skill-id":t.selectedSkill.id,path:t.selectedPath,editable:!1},null,8,[`skill-id`,`path`])):(v(),s(`div`,ir,[a(ne,{class:`right-empty-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.selectSkill`)),1)]))])]),a(re,{modelValue:t.uploadVisible,"onUpdate:modelValue":n[5]||=e=>t.uploadVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(ie,{modelValue:t.writeVisible,"onUpdate:modelValue":n[6]||=e=>t.writeVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(z,{modelValue:t.browseVisible,"onUpdate:modelValue":n[7]||=e=>t.browseVisible=e,onInstalled:t.onCreated},null,8,[`modelValue`,`onInstalled`])])}var or=V(wn,[[`render`,ar],[`__scopeId`,`data-v-6d629e8e`]]);export{or as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,b as u,ht as d,j as f,mt as p,ot as m,qt as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-CJHU1puz.js";import{n as S,t as C}from"./tabs-D_ymCjuP.js";import{t as w}from"./tooltip-BmwZvoCo.js";import{v as T}from"./models-qt9s4QBH.js";import{n as E,r as D,t as O}from"./dropdown-_LBWBf-Y.js";import{t as k}from"./pagination-BV08b7GL.js";import{t as A}from"./switch-B8GgL0Se.js";import{t as j}from"./arrow-down-BSHeBz4t.js";import{t as M}from"./arrow-left-CQxDtYWw.js";import{t as N}from"./book-open-Cx0F2c3b.js";import{t as P}from"./chevron-down-C9d0FXRE.js";import{t as F}from"./chevron-right-4Ky2D1GB.js";import{t as I}from"./circle-check-DzyKsQ5E.js";import{t as L}from"./circle-question-mark-Dl_sOM5u.js";import{t as ee}from"./clipboard-list-D7AvBFtP.js";import{t as te}from"./code-Pa0xuy7_.js";import{t as R}from"./copy-DtEpCnzV.js";import{t as ne}from"./ellipsis-CQoyd1U8.js";import{t as re}from"./eye-C9gPEb69.js";import{t as ie}from"./file-text-CTEvw_kE.js";import{t as z}from"./file-hh1eR7jk.js";import{t as ae}from"./folder-DMqgztyI.js";import{t as oe}from"./image-CZ_tH9kY.js";import{t as se}from"./lock-B3J02iis.js";import{t as B}from"./plus-DO3XunBM.js";import{n as ce,t as le}from"./store-DSn2Uqvw.js";import{t as ue}from"./search-68wZrrVQ.js";import{t as de}from"./trash-2-Bgi3IwhR.js";import{t as fe}from"./triangle-alert-tECqMJGT.js";import{t as pe}from"./upload-DNoc85A2.js";import{t as me}from"./wand-sparkles-CylWIDdZ.js";import{S as he,T as ge,k as _e,w as ve,y as ye}from"./i18n-BQrNxKw9.js";import{$a as be,A as V,Ba as H,Ha as U,Ia as xe,Ka as W,Va as Se,Xi as G,Yi as K,lo as q,to as J}from"./index-BDrhpCy4.js";import{a as Ce,c as we,d as Te,f as Ee,i as De,l as Oe,m as Y,n as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe}from"./vendor-highlight-BHrfT4-E.js";import{t as Ie}from"./index.es-DRsketdd.js";import{t as Le}from"./VueMarkdown-CiiRjbWs.js";import{t as Re}from"./PageHeader-DBhZwlSN.js";var ze=H(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Be=H(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Ve=H(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),He=H(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ue=H(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),X=()=>({baseURL:`${xe()}/api/v1`}),Z=new class{key=`skills/installed`;async list(){return K.get(`/${this.key}/`,X())}async get(e){return K.get(`/${this.key}/${e}/`,X())}async createMarkdown(e){return K.post(`/${this.key}/`,e,X())}async createTarball(e){let t=new FormData;return t.append(`tarball`,e),K.post(`/${this.key}/`,t,{...X(),headers:{"Content-Type":`multipart/form-data`}})}async update(e,t){return K.patch(`/${this.key}/${e}/`,t,X())}async remove(e){return K.delete(`/${this.key}/${e}/`,X())}async enable(e){return K.post(`/${this.key}/${e}/enable/`,void 0,X())}async disable(e){return K.post(`/${this.key}/${e}/disable/`,void 0,X())}async fetchFile(e,t){let n=await K.get(`/${this.key}/${e}/files/`,{...X(),params:{path:t},responseType:`arraybuffer`}),r=n.headers[`content-type`]||`application/octet-stream`;return{blob:new Blob([n.data],{type:r}),contentType:r}}},Q=new class{key=`skills`;async list(e={}){return G.get(`/${this.key}/`,{...X(),params:e})}async get(e){return G.get(`/${this.key}/${e}/`,X())}async categories(){return G.get(`/${this.key}/categories/`,X())}async install(e,t={}){return K.post(`/${this.key}/${e}/install/`,t,X())}};function We(){let e=new Set;ve()&&e.add(`desktop`),ge()&&e.add(`ios`),he()&&e.add(`android`),_e()&&e.add(`web`);let t=ye();if(t===`mac`)e.add(`mac`);else if(t===`windows`)e.add(`windows`);else if(typeof navigator<`u`){let t=navigator.userAgent||``,n=navigator.userAgentData?.platform,r=/macintosh/i.test(t)&&(navigator.maxTouchPoints||0)>1;!ge()&&!r&&(n===`macOS`||/mac os x|macintosh/i.test(t))&&e.add(`mac`),(n===`Windows`||/windows nt/i.test(t))&&e.add(`windows`)}return e}var Ge=new Set([`mac`,`windows`,`desktop`,`web`,`ios`,`android`]);function Ke(e){let t=e.filter(e=>Ge.has(e));if(!t.length)return!0;let n=We();return t.some(e=>n.has(e))}Y.registerLanguage(`bash`,je),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var qe=12,Je=y({name:`BrowseSkillsDialog`,components:{VueMarkdown:Le,ElDialog:W,ElInput:q,ElButton:J,ElPagination:k,ElSelect:b,ElOption:x,FontAwesomeIcon:Ie,AddIcon:B,BackIcon:M,DownIcon:j,InstallIcon:ze,LockIcon:se,SearchIcon:ue,SuccessIcon:I},directives:{loading:U},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`installed`],data(){return{loading:!1,installing:!1,items:[],total:0,currentPage:1,searchQuery:``,namespaceFilter:``,sortBy:`popular`,selectedItem:null,searchTimer:null,knownNamespaces:[],publisherByNamespace:{}}},computed:{pageSize(){return qe},namespaceOptions(){let e=new Set(this.knownNamespaces);for(let t of this.items)e.add(t.namespace);return Array.from(e).sort().map(e=>({value:e,label:this.publisherForNamespace(e)}))},detailBody(){return this.selectedItem?this.selectedItem.content.replace(/^---\n[\s\S]*?\n---\n?/,``):``}},methods:{onOpen(){this.selectedItem=null,this.searchQuery=``,this.namespaceFilter=``,this.sortBy=`popular`,this.currentPage=1,this.knownNamespaces=[],this.publisherByNamespace={},this.loadFacets(),this.reload()},openDetail(e){this.selectedItem=e},async loadFacets(){try{let{data:e}=await Q.categories(),t=new Set;for(let n of e.namespaces)t.add(n.namespace);this.knownNamespaces=Array.from(t).sort()}catch(e){console.warn(`failed to load skill catalog facets`,e)}},reloadFromFirstPage(){this.currentPage=1,this.reload()},onPageChange(e){this.currentPage=e,this.reload(),this.$nextTick(()=>{let e=this.$el.querySelector(`.directory-grid-wrapper`);e&&(e.scrollTop=0)})},onSearchInput(){this.searchTimer!==null&&window.clearTimeout(this.searchTimer),this.searchTimer=window.setTimeout(()=>{this.searchTimer=null,this.reloadFromFirstPage()},250)},async reload(){this.loading=!0;try{let{data:e}=await Q.list({q:this.searchQuery.trim()||void 0,namespace:this.namespaceFilter||void 0,sort:this.sortBy,limit:this.pageSize,offset:(this.currentPage-1)*this.pageSize});this.items=e.items,this.total=e.total;for(let t of e.items)t.publisher&&(this.publisherByNamespace[t.namespace]=t.publisher)}catch(e){console.error(e),T.error(this.$t(`skill.directory.loadFailed`))}finally{this.loading=!1}},async onInstall(e){if(!this.installing&&!e.installed){if(!this.canInstallOnSurface(e)){T.warning(this.$t(`skill.directory.surfaceBlocked`,{platforms:this.surfaceLabels(e)}));return}this.installing=!0;try{let{data:t}=await Q.install(e.id);T.success(this.$t(`skill.directory.installSuccess`,{name:e.slug})),this.$emit(`installed`,t.id),e.installed=!0,e.install_count+=1}catch(t){let n=this.extractError(t);n.includes(`already exists`)?(e.installed=!0,T.warning(this.$t(`skill.directory.alreadyInstalled`,{name:e.slug}))):T.error(this.$t(`skill.directory.installFailed`,{detail:n}))}finally{this.installing=!1}}},extractError(e){return e?.response?.data?.detail||String(e)||`unknown error`},formatCount(e){return e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)},publisherForNamespace(e){if(this.publisherByNamespace[e])return this.publisherByNamespace[e];let t=this.items.find(t=>t.namespace===e);return t?t.publisher:e},restrictedSurfaces(e){let t=e.frontmatter?.surfaces;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).map(e=>e.trim().toLowerCase()):[]},surfaceLabel(e){let t=`skill.directory.surface.${e}`,n=this.$t(t);return n===t?e:n},surfaceLabels(e){return this.restrictedSurfaces(e).map(e=>this.surfaceLabel(e)).join(` / `)},canInstallOnSurface(e){return Ke(this.restrictedSurfaces(e))}}}),Ye={class:`directory`},Xe={class:`directory-main`},Ze={class:`directory-header`},Qe={class:`directory-controls`},$e={class:`directory-grid-wrapper`},et={key:0,class:`directory-empty`},tt={key:1,class:`directory-grid`},nt=[`onClick`],rt={class:`directory-card-head`},it={class:`directory-card-title`},at=[`title`],ot=[`title`],st=[`aria-label`,`title`,`onClick`],ct=[`title`],lt={class:`directory-card-meta`},ut={class:`directory-card-publisher`},dt={key:0,class:`directory-card-count`},ft=[`title`],pt={class:`directory-card-desc`},mt={key:0,class:`directory-footer`},ht={class:`directory-detail-head`},gt={class:`directory-detail-actions`},_t=[`href`],vt={class:`directory-detail-body`},yt={class:`directory-detail-title`},bt={class:`directory-detail-meta`},xt={key:0},St={key:1},Ct=[`title`],wt={class:`directory-detail-desc`};function Tt(u,h,_,y,b,x){let S=l(`search-icon`),C=l(`el-input`),w=l(`el-option`),T=l(`el-select`),E=l(`success-icon`),D=l(`lock-icon`),O=l(`add-icon`),k=l(`down-icon`),A=l(`el-pagination`),j=l(`back-icon`),M=l(`font-awesome-icon`),N=l(`el-button`),P=l(`install-icon`),F=l(`vue-markdown`),I=l(`el-dialog`),L=m(`loading`);return v(),f(I,{"model-value":u.modelValue,title:u.$t(`skill.dialog.directoryTitle`),width:`min(960px, 94vw)`,"align-center":``,class:`directory-dialog`,"close-on-click-modal":!u.installing,"show-close":!u.installing,"onUpdate:modelValue":h[5]||=e=>u.$emit(`update:modelValue`,e),onOpen:u.onOpen},{default:p(()=>[e(`div`,Ye,[e(`main`,Xe,[u.selectedItem?(v(),s(c,{key:1},[e(`header`,ht,[e(`button`,{class:`directory-back-btn`,onClick:h[3]||=e=>u.selectedItem=null},[a(j,{size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.back`)),1)]),e(`div`,gt,[u.selectedItem.source_url?(v(),s(`a`,{key:0,href:u.selectedItem.source_url,target:`_blank`,class:`directory-link`},[a(M,{icon:`fa-brands fa-github`}),r(` `+i(u.$t(`skill.directory.viewSource`)),1)],8,_t)):o(``,!0),u.selectedItem.installed?(v(),f(N,{key:1,disabled:``,type:`success`,plain:``},{default:p(()=>[a(E,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.installed`)),1)]),_:1})):u.selectedItem.installable&&!u.canInstallOnSurface(u.selectedItem)?(v(),f(N,{key:2,disabled:``,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(u.selectedItem)})},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.surfaceUnavailable`)),1)]),_:1},8,[`title`])):u.selectedItem.installable?(v(),f(N,{key:3,type:`primary`,loading:u.installing,onClick:h[4]||=e=>u.onInstall(u.selectedItem)},{default:p(()=>[a(P,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`skill.directory.install`)),1)]),_:1},8,[`loading`])):(v(),f(N,{key:4,disabled:``,title:u.selectedItem.license},{default:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.selectedItem.license||u.$t(`skill.directory.notInstallable`)),1)]),_:1},8,[`title`]))])]),e(`div`,vt,[e(`h2`,yt,`/`+i(u.selectedItem.slug),1),e(`div`,bt,[e(`span`,null,[e(`strong`,null,i(u.$t(`skill.meta.addedBy`))+`:`,1),r(` `+i(u.selectedItem.publisher),1)]),u.selectedItem.license?(v(),s(`span`,xt,[e(`strong`,null,i(u.$t(`skill.directory.license`))+`:`,1),r(` `+i(u.selectedItem.license),1)])):o(``,!0),u.selectedItem.version?(v(),s(`span`,St,`v`+i(u.selectedItem.version),1)):o(``,!0),u.surfaceLabels(u.selectedItem)?(v(),s(`span`,{key:2,class:`directory-detail-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.$t(`skill.directory.surfaceOnly`,{platforms:u.surfaceLabels(u.selectedItem)})),9,Ct)):o(``,!0)]),e(`p`,wt,i(u.selectedItem.description),1),a(F,{class:`directory-detail-content`,source:u.detailBody,sanitize:``},null,8,[`source`])])],64)):(v(),s(c,{key:0},[e(`header`,Ze,[a(C,{modelValue:u.searchQuery,"onUpdate:modelValue":h[0]||=e=>u.searchQuery=e,class:`directory-search`,size:`default`,clearable:``,placeholder:u.$t(`skill.directory.searchPlaceholder`),onInput:u.onSearchInput},{prefix:p(()=>[a(S,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`,`onInput`]),e(`div`,Qe,[a(T,{modelValue:u.namespaceFilter,"onUpdate:modelValue":h[1]||=e=>u.namespaceFilter=e,class:`directory-select`,placeholder:u.$t(`skill.directory.allPublishers`),clearable:``,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[(v(!0),s(c,null,g(u.namespaceOptions,e=>(v(),f(w,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`onChange`]),a(T,{modelValue:u.sortBy,"onUpdate:modelValue":h[2]||=e=>u.sortBy=e,class:`directory-select directory-select-sm`,size:`default`,onChange:u.reloadFromFirstPage},{default:p(()=>[a(w,{label:u.$t(`skill.directory.sort.popular`),value:`popular`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.recent`),value:`recent`},null,8,[`label`]),a(w,{label:u.$t(`skill.directory.sort.name`),value:`name`},null,8,[`label`])]),_:1},8,[`modelValue`,`onChange`])])]),d((v(),s(`div`,$e,[!u.loading&&u.total===0?(v(),s(`p`,et,i(u.$t(`skill.directory.empty`)),1)):(v(),s(`div`,tt,[(v(!0),s(c,null,g(u.items,c=>(v(),s(`article`,{key:c.id,class:n([`directory-card`,{"is-installed":c.installed}]),onClick:e=>u.openDetail(c)},[e(`div`,rt,[e(`span`,it,`/`+i(c.slug),1),c.installed?(v(),s(`span`,{key:0,class:`directory-card-action is-installed`,title:u.$t(`skill.directory.installed`)},[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})],8,at)):c.installable&&!u.canInstallOnSurface(c)?(v(),s(`span`,{key:1,class:`directory-card-locked`,title:u.$t(`skill.directory.surfaceBlocked`,{platforms:u.surfaceLabels(c)})},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ot)):c.installable?(v(),s(`button`,{key:2,class:`directory-card-action`,"aria-label":u.$t(`skill.directory.install`),title:u.$t(`skill.directory.install`),onClick:t(e=>u.onInstall(c),[`stop`])},[a(O,{size:16,"aria-hidden":`true`,focusable:`false`})],8,st)):(v(),s(`span`,{key:3,class:`directory-card-locked`,title:c.license},[a(D,{size:16,"aria-hidden":`true`,focusable:`false`})],8,ct))]),e(`div`,lt,[e(`span`,ut,i(c.publisher),1),c.install_count>0?(v(),s(`span`,dt,[a(k,{size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.formatCount(c.install_count)),1)])):o(``,!0),u.surfaceLabels(c)?(v(),s(`span`,{key:1,class:`directory-card-surface`,title:u.$t(`skill.directory.surfaceHint`)},i(u.surfaceLabels(c)),9,ft)):o(``,!0)]),e(`p`,pt,i(c.description),1)],10,nt))),128))]))])),[[L,u.loading]]),u.total>u.pageSize?(v(),s(`footer`,mt,[a(A,{"current-page":u.currentPage,"page-size":u.pageSize,total:u.total,"pager-count":5,background:``,layout:`prev, pager, next, total`,onCurrentChange:u.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onCurrentChange`])])):o(``,!0)],64))])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`show-close`,`onOpen`])}var Et=V(Je,[[`render`,Tt],[`__scopeId`,`data-v-a9be2dc3`]]);Y.registerLanguage(`bash`,je),Y.registerLanguage(`css`,Ne),Y.registerLanguage(`go`,Ae),Y.registerLanguage(`javascript`,Ce),Y.registerLanguage(`json`,Ee),Y.registerLanguage(`markdown`,Te),Y.registerLanguage(`python`,Fe),Y.registerLanguage(`rust`,De),Y.registerLanguage(`shell`,Oe),Y.registerLanguage(`sql`,Me),Y.registerLanguage(`typescript`,ke),Y.registerLanguage(`xml`,Pe),Y.registerLanguage(`html`,Pe),Y.registerLanguage(`yaml`,we),Y.registerAliases([`yml`],{languageName:`yaml`}),Y.registerAliases([`ts`,`tsx`],{languageName:`typescript`}),Y.registerAliases([`js`,`jsx`],{languageName:`javascript`}),Y.registerAliases([`py`],{languageName:`python`}),Y.registerAliases([`rs`],{languageName:`rust`}),Y.registerAliases([`sh`,`zsh`],{languageName:`bash`});var $=1e6;function Dt(e,t){let n=(e.split(`.`).pop()||``).toLowerCase();return n===`md`||t.startsWith(`text/markdown`)?`markdown`:n===`html`||n===`htm`||t.startsWith(`text/html`)?`html`:t.startsWith(`image/`)||[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`].includes(n)?`image`:t.startsWith(`text/`)||[`json`,`application/json`].includes(t.split(`;`)[0])?n?`code`:`text`:`binary`}function Ot(e){let t=(e.split(`.`).pop()||``).toLowerCase();return Y.getLanguage(t)?t:`plain`}var kt=y({name:`SkillFilePreview`,components:{ElButton:J,ElTooltip:w,ElTabs:S,ElTabPane:C,CodeIcon:te,CopyIcon:R,FileIcon:z,SaveIcon:He,SuccessIcon:I,ViewIcon:re,WarningIcon:fe,VueMarkdown:Le},directives:{loading:U},props:{skillId:{type:String,required:!0},path:{type:String,required:!0},editable:{type:Boolean,default:!1}},emits:[`save`],data(){return{MAX_PREVIEW_BYTES:$,loading:!1,error:``,contentType:``,size:0,textContent:``,imageUrl:``,truncated:!1,viewMode:`rendered`,dirty:!1,saving:!1,copied:!1,copiedTimer:void 0}},computed:{kind(){return this.path?Dt(this.path,this.contentType):`text`},canRender(){return this.kind===`markdown`||this.kind===`html`},hljsLang(){return`language-${Ot(this.path)}`},truncatedText(){return this.textContent}},watch:{path:{handler(){this.fetch()},immediate:!0}},beforeUnmount(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer)},methods:{humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},async fetch(){if(this.path){this.copied=!1,this.copiedTimer!==void 0&&(window.clearTimeout(this.copiedTimer),this.copiedTimer=void 0),this.loading=!0,this.error=``,this.textContent=``,this.truncated=!1,this.dirty=!1,this.imageUrl&&=(URL.revokeObjectURL(this.imageUrl),``);try{let{blob:e,contentType:t}=await Z.fetchFile(this.skillId,this.path);this.contentType=t,this.size=e.size;let n=Dt(this.path,t);if(n===`image`)this.imageUrl=URL.createObjectURL(e);else if(n!==`binary`){let t=await e.text();t.length>$&&(t=t.slice(0,$),this.truncated=!0),this.textContent=t,this.viewMode=n===`markdown`||n===`html`?`rendered`:`source`}}catch(e){let t=e,n=t?.response?.status,r=t?.response?.data?.detail||String(e);this.error=n?`(${n}) ${r}`:r}finally{this.loading=!1,this.$nextTick(()=>this.applyHighlight())}}},applyHighlight(){let e=this.$refs.codeEl;e&&this.kind===`code`&&this.viewMode!==`rendered`&&(delete e.dataset.highlighted,Y.highlightElement(e))},async onCopy(){if(this.textContent)try{await navigator.clipboard.writeText(this.textContent),this.copied=!0,this.copiedTimer!==void 0&&window.clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1,this.copiedTimer=void 0},3e3),T.success(this.$t(`skill.preview.copied`))}catch{T.error(this.$t(`skill.preview.copyFailed`))}},async onSave(){this.saving=!0;try{await new Promise((e,t)=>{this.$emit(`save`,this.textContent,{resolve:e,reject:t})}),this.dirty=!1}catch{}finally{this.saving=!1}}}}),At={class:`preview-root`},jt={class:`toolbar`},Mt={class:`path-display`},Nt={key:0,class:`size-display`},Pt={class:`body`},Ft={key:0,class:`error`},It=[`srcdoc`],Lt={key:3,class:`image-pane`},Rt=[`src`,`alt`],zt={key:4,class:`binary`},Bt=[`placeholder`],Vt={key:6,class:`source-pane`},Ht={key:7,class:`truncated-warning`};function Ut(t,c,h,g,_,y){let b=l(`save-icon`),x=l(`el-button`),S=l(`success-icon`),C=l(`copy-icon`),w=l(`el-tooltip`),T=l(`view-icon`),E=l(`el-tab-pane`),D=l(`code-icon`),O=l(`el-tabs`),k=l(`warning-icon`),A=l(`vue-markdown`),j=l(`file-icon`),M=m(`loading`);return d((v(),s(`div`,At,[e(`div`,jt,[e(`span`,Mt,i(t.path||`—`),1),t.size?(v(),s(`span`,Nt,i(t.humanSize(t.size)),1)):o(``,!0),c[3]||=e(`span`,{class:`toolbar-spacer`},null,-1),t.editable?(v(),f(x,{key:1,type:`primary`,size:`small`,disabled:!t.dirty||t.saving,loading:t.saving,onClick:t.onSave},{default:p(()=>[a(b,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.save`)),1)]),_:1},8,[`disabled`,`loading`,`onClick`])):o(``,!0),a(w,{visible:t.copied,content:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),placement:`top-start`},{default:p(()=>[a(x,{size:`small`,circle:``,disabled:!t.textContent,"aria-label":t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),title:t.copied?t.$t(`skill.preview.copied`):t.$t(`skill.preview.copy`),onClick:t.onCopy},{default:p(()=>[t.copied?(v(),f(S,{key:0,size:16,"aria-hidden":`true`,focusable:`false`})):(v(),f(C,{key:1,size:16,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`visible`,`content`])]),t.canRender?(v(),f(O,{key:0,modelValue:t.viewMode,"onUpdate:modelValue":c[0]||=e=>t.viewMode=e,class:`view-tabs`},{default:p(()=>[a(E,{name:`rendered`},{label:p(()=>[a(T,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewRendered`)),1)]),_:1}),a(E,{name:`source`},{label:p(()=>[a(D,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.preview.viewSource`)),1)]),_:1})]),_:1},8,[`modelValue`])):o(``,!0),e(`div`,Pt,[t.error?(v(),s(`div`,Ft,[a(k,{class:`mr-2`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.error),1)])):t.kind===`markdown`&&t.viewMode===`rendered`?(v(),f(A,{key:1,class:`markdown-rendered`,source:t.textContent,sanitize:``},null,8,[`source`])):t.kind===`html`&&t.viewMode===`rendered`?(v(),s(`iframe`,{key:2,ref:`htmlFrame`,class:`html-frame`,sandbox:``,srcdoc:t.textContent},null,8,It)):t.kind===`image`?(v(),s(`div`,Lt,[e(`img`,{src:t.imageUrl,alt:t.path,class:`image-content`},null,8,Rt)])):t.kind===`binary`?(v(),s(`div`,zt,[a(j,{class:`binary-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.binary`,{type:t.contentType})),1)])):t.editable?d((v(),s(`textarea`,{key:5,"onUpdate:modelValue":c[1]||=e=>t.textContent=e,class:`source-editor`,spellcheck:`false`,placeholder:t.$t(`skill.placeholder.content`),onInput:c[2]||=e=>t.dirty=!0},null,40,Bt)),[[u,t.textContent]]):(v(),s(`pre`,Vt,[e(`code`,{ref:`codeEl`,class:n(t.hljsLang)},i(t.truncatedText),3)])),t.truncated?(v(),s(`p`,Ht,i(t.$t(`skill.preview.truncated`,{size:t.humanSize(t.MAX_PREVIEW_BYTES)})),1)):o(``,!0)])])),[[M,t.loading]])}var Wt=V(kt,[[`render`,Ut],[`__scopeId`,`data-v-872078d9`]]),Gt=new Set([`py`,`ts`,`tsx`,`js`,`jsx`,`json`,`yaml`,`yml`,`sh`,`bash`,`zsh`,`css`,`html`,`sql`,`go`,`rs`,`rb`,`java`,`cpp`,`c`,`h`,`toml`]),Kt=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function qt(e){let t=e.split(`/`).pop()||e,n=(t.split(`.`).pop()||``).toLowerCase();return t===`SKILL.md`?N:n===`md`?ie:Kt.has(n)?oe:Gt.has(n)?Ve:z}function Jt(e){let t=new Map;t.set(``,new Map);let n=(e,n)=>{let r=t.get(e);r||(r=new Map,t.set(e,r));let i=e?`${e}/${n}`:n,a=r.get(n);return a||(a={label:n,path:i,isLeaf:!1,children:[]},r.set(n,a),t.set(i,new Map)),a};for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length===0)continue;let i=e[e.length-1],a=e.slice(0,-1),o=``;for(let e of a)o=n(o,e).path;let s={label:i,path:r,isLeaf:!0},c=t.get(o);c||(c=new Map,t.set(o,c)),c.set(i,s)}let r=e=>{let n=t.get(e);if(!n)return[];let i=Array.from(n.values());for(let e of i)e.isLeaf||(e.children=r(e.path));return i.sort((e,t)=>e.path===`SKILL.md`?-1:t.path===`SKILL.md`?1:e.isLeaf===t.isLeaf?e.label.localeCompare(t.label):e.isLeaf?1:-1)};return r(``)}var Yt=y({name:`FileNode`,components:{ExpandDownIcon:P,ExpandRightIcon:F,FontAwesomeIcon:Ie},props:{node:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},skill:{type:Object,required:!0},depth:{type:Number,default:1}},emits:[`select-file`],data(){return{open:!0}},computed:{indent(){return 8+this.depth*16},isActive(){return this.node.isLeaf&&this.selectedSkillId===this.skill.id&&this.selectedPath===this.node.path}},methods:{isHtmlFile(e){return e.isLeaf&&e.path.toLowerCase().endsWith(`.html`)},iconFor(e){return e.isLeaf?qt(e.path):ae},onClick(){this.node.isLeaf?this.$emit(`select-file`,this.node.path):this.open=!this.open}}}),Xt=[`aria-label`,`title`],Zt={key:1,class:`node-chevron-spacer`},Qt={class:`node-label`},$t={key:0,class:`children`};function en(r,a,u,d,p,m){let y=l(`expand-down-icon`),b=l(`expand-right-icon`),x=l(`font-awesome-icon`),S=l(`file-node`,!0);return v(),s(`li`,null,[e(`div`,{class:n([`file-node`,{active:r.isActive}]),style:h({paddingLeft:r.indent+`px`}),onClick:a[1]||=(...e)=>r.onClick&&r.onClick(...e)},[r.node.isLeaf?(v(),s(`span`,Zt)):(v(),s(`button`,{key:0,class:`node-chevron`,"aria-label":r.$t(r.open?`common.button.collapse`:`common.button.expand`),title:r.$t(r.open?`common.button.collapse`:`common.button.expand`),onClick:a[0]||=t(e=>r.open=!r.open,[`stop`])},[r.open?(v(),f(y,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(b,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,Xt)),r.isHtmlFile(r.node)?(v(),f(x,{key:2,icon:`fa-brands fa-html5`,class:`node-icon`})):(v(),f(_(r.iconFor(r.node)),{key:3,class:`node-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Qt,i(r.node.label),1)],6),!r.node.isLeaf&&r.open?(v(),s(`ul`,$t,[(v(!0),s(c,null,g(r.node.children||[],e=>(v(),f(S,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:r.depth+1,onSelectFile:a[2]||=e=>r.$emit(`select-file`,e)},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`depth`]))),128))])):o(``,!0)])}var tn=y({name:`SkillRow`,components:{ExpandDownIcon:P,ExpandRightIcon:F,SkillIcon:ce,FileNode:V(Yt,[[`render`,en],[`__scopeId`,`data-v-5240087b`]])},props:{skill:{type:Object,required:!0},selectedSkillId:{type:String,required:!0},selectedPath:{type:String,required:!0},expanded:{type:Boolean,default:!1}},emits:[`toggle-expand`,`select-skill`,`select-file`],computed:{tree(){return Jt(this.skill.asset_bundle_files)},hasChildren(){return this.skill.asset_bundle_files.length>1},isSkillSelected(){return this.selectedSkillId===this.skill.id&&!this.selectedPath}},methods:{onSelectFile(e){this.$emit(`select-file`,this.skill,e)}}}),nn={class:`skill-row-wrapper`},rn=[`aria-label`,`title`],an={key:1,class:`row-chevron-spacer`},on=[`title`],sn={key:0,class:`file-list`};function cn(r,u,d,p,m,h){let _=l(`expand-down-icon`),y=l(`expand-right-icon`),b=l(`skill-icon`),x=l(`file-node`);return v(),s(`li`,nn,[e(`div`,{class:n([`skill-row`,{active:r.isSkillSelected}]),onClick:u[1]||=e=>r.$emit(`select-skill`,r.skill)},[r.hasChildren?(v(),s(`button`,{key:0,class:`row-chevron`,"aria-label":r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),title:r.$t(r.expanded?`common.button.collapse`:`common.button.expand`),onClick:u[0]||=t(e=>r.$emit(`toggle-expand`,r.skill),[`stop`])},[r.expanded?(v(),f(_,{key:0,size:14,"aria-hidden":`true`,focusable:`false`})):(v(),f(y,{key:1,size:14,"aria-hidden":`true`,focusable:`false`}))],8,rn)):(v(),s(`span`,an)),a(b,{class:`row-icon`,size:16,"aria-hidden":`true`,focusable:`false`}),e(`span`,{class:`row-label`,title:r.skill.name},i(r.skill.slug),9,on)],2),r.expanded&&r.hasChildren?(v(),s(`ul`,sn,[(v(!0),s(c,null,g(r.tree,e=>(v(),f(x,{key:e.path,node:e,"selected-skill-id":r.selectedSkillId,"selected-path":r.selectedPath,skill:r.skill,depth:1,onSelectFile:r.onSelectFile},null,8,[`node`,`selected-skill-id`,`selected-path`,`skill`,`onSelectFile`]))),128))])):o(``,!0)])}var ln=V(tn,[[`render`,cn],[`__scopeId`,`data-v-231c2ce1`]]),un=10*1024*1024,dn=/\.(tar\.gz|tgz|tar|zip|md)$/i,fn=y({name:`UploadSkillDialog`,components:{ElDialog:W,ElButton:J,AddFileIcon:Ue,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{file:null,isDragging:!1,uploading:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.uploading||this.$emit(`update:modelValue`,!1)},reset(){this.file=null,this.isDragging=!1;let e=this.$refs.fileInput;e&&(e.value=``)},humanSize(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`},onPickFile(){this.uploading||this.$refs.fileInput?.click()},onFilePicked(e){let t=e.target.files?.[0]||null;this.acceptFile(t)},onDrop(e){this.isDragging=!1;let t=e.dataTransfer?.files?.[0]||null;this.acceptFile(t)},acceptFile(e){if(!e){this.file=null;return}if(e.size>un){T.error(this.$t(`skill.message.fileTooLarge`));return}if(!dn.test(e.name)){T.error(this.$t(`skill.message.fileTypeWrong`));return}this.file=e},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.file){this.uploading=!0;try{if(/\.md$/i.test(this.file.name)){let e=await this.file.text(),{data:t}=await Z.createMarkdown({content:e});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,t.id)}else{let{data:e}=await Z.createTarball(this.file);T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id)}this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.uploading=!1}}}}}),pn={key:0,class:`dropzone-hint`},mn={key:1,class:`dropzone-file`},hn={class:`dropzone-file-name`},gn={class:`dropzone-file-size`},_n={class:`requirements`},vn={class:`requirements-title`};function yn(o,c,u,d,m,h){let g=l(`add-file-icon`),_=l(`el-button`),y=l(`cloud-upload-icon`),b=l(`el-dialog`);return v(),f(b,{"model-value":o.modelValue,title:o.$t(`skill.dialog.uploadTitle`),width:`min(520px, 94vw)`,"align-center":``,"close-on-click-modal":!o.uploading,"close-on-press-escape":!o.uploading,"show-close":!o.uploading,"onUpdate:modelValue":o.onVisibleChange,onClosed:o.reset},{footer:p(()=>[a(_,{disabled:o.uploading,onClick:o.onClose},{default:p(()=>[r(i(o.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(_,{type:`primary`,loading:o.uploading,disabled:!o.file,onClick:o.onSubmit},{default:p(()=>[a(y,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`input`,{ref:`fileInput`,type:`file`,accept:`.tar.gz,.tgz,.tar,.zip,.md,application/gzip,application/zip,application/x-tar,text/markdown`,hidden:``,onChange:c[0]||=(...e)=>o.onFilePicked&&o.onFilePicked(...e)},null,544),e(`div`,{class:n([`dropzone`,{"is-dragging":o.isDragging,"has-file":!!o.file}]),onClick:c[1]||=(...e)=>o.onPickFile&&o.onPickFile(...e),onDragover:c[2]||=t(e=>o.isDragging=!0,[`prevent`]),onDragleave:c[3]||=t(e=>o.isDragging=!1,[`prevent`]),onDrop:c[4]||=t((...e)=>o.onDrop&&o.onDrop(...e),[`prevent`])},[a(g,{class:`dropzone-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),o.file?(v(),s(`p`,mn,[e(`span`,hn,i(o.file.name),1),e(`span`,gn,i(o.humanSize(o.file.size)),1)])):(v(),s(`p`,pn,i(o.$t(`skill.dialog.uploadDrop`)),1))],34),e(`div`,_n,[e(`p`,vn,i(o.$t(`skill.dialog.fileRequirements`)),1),e(`ul`,null,[e(`li`,null,i(o.$t(`skill.dialog.requirementMd`)),1),e(`li`,null,i(o.$t(`skill.dialog.requirementArchive`)),1)])])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var bn=V(fn,[[`render`,yn],[`__scopeId`,`data-v-a38152b9`]]),xn=y({name:`WriteSkillDialog`,components:{ElDialog:W,ElButton:J,ElInput:q,CloudUploadIcon:Be},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{content:``,saving:!1}},methods:{onVisibleChange(e){this.$emit(`update:modelValue`,e)},onClose(){this.saving||this.$emit(`update:modelValue`,!1)},reset(){this.content=``},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},async onSubmit(){if(this.content.trim()){this.saving=!0;try{let{data:e}=await Z.createMarkdown({content:this.content});T.success(this.$t(`skill.message.createSuccess`)),this.$emit(`created`,e.id),this.$emit(`update:modelValue`,!1)}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)}))}finally{this.saving=!1}}}}}),Sn={class:`hint`};function Cn(t,n,o,s,c,u){let d=l(`el-input`),m=l(`el-button`),h=l(`cloud-upload-icon`),g=l(`el-dialog`);return v(),f(g,{"model-value":t.modelValue,title:t.$t(`skill.dialog.writeTitle`),width:`min(720px, 94vw)`,"align-center":``,"close-on-click-modal":!t.saving,"close-on-press-escape":!t.saving,"show-close":!t.saving,"onUpdate:modelValue":t.onVisibleChange,onClosed:t.reset},{footer:p(()=>[a(m,{disabled:t.saving,onClick:t.onClose},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(m,{type:`primary`,loading:t.saving,disabled:!t.content.trim(),onClick:t.onSubmit},{default:p(()=>[a(h,{class:`mr-1`,size:16,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.button.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:p(()=>[e(`p`,Sn,i(t.$t(`skill.dialog.writeHint`)),1),a(d,{modelValue:t.content,"onUpdate:modelValue":n[0]||=e=>t.content=e,type:`textarea`,rows:18,placeholder:t.$t(`skill.placeholder.content`),spellcheck:`false`,class:`editor`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`show-close`,`onUpdate:modelValue`,`onClosed`])}var wn=y({name:`UserSkills`,components:{ConsolePageHeader:Re,ElInput:q,ElSwitch:A,ElTag:be,ElTooltip:w,ElDropdown:O,ElDropdownMenu:D,ElDropdownItem:E,AddIcon:B,AiCreateIcon:me,DeleteIcon:de,ExpandDownIcon:P,ExpandRightIcon:F,HelpIcon:L,MarketplaceIcon:le,MoreIcon:ne,SearchIcon:ue,SkillIcon:ce,UploadIcon:pe,WriteIcon:ee,BrowseSkillsDialog:Et,SkillFilePreview:Wt,SkillRow:ln,UploadSkillDialog:bn,WriteSkillDialog:V(xn,[[`render`,Cn],[`__scopeId`,`data-v-1946d5b3`]])},directives:{loading:U},data(){return{loading:!1,skills:[],togglingId:null,selectedSkillId:``,selectedPath:``,expandedSkillIds:[],personalOpen:!0,globalsOpen:!0,searchQuery:``,uploadVisible:!1,writeVisible:!1,browseVisible:!1}},computed:{personalSkills(){return this.skills.filter(e=>e.source!==`global`)},globalSkills(){return this.skills.filter(e=>e.source===`global`)},filteredPersonal(){return this.applyFilter(this.personalSkills)},filteredGlobal(){return this.applyFilter(this.globalSkills)},selectedSkill(){return this.skills.find(e=>e.id===this.selectedSkillId)||null}},mounted(){this.fetchSkills()},methods:{applyFilter(e){let t=this.searchQuery.trim().toLowerCase();return t?e.filter(e=>e.slug.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):e},async fetchSkills(){this.loading=!0;try{let{data:e}=await Z.list();if(this.skills=e||[],!this.selectedSkillId&&this.skills.length){let e=this.personalSkills[0]||this.skills[0];this.selectedSkillId=e.id}else this.selectedSkillId&&!this.skills.find(e=>e.id===this.selectedSkillId)&&(this.selectedSkillId=``,this.selectedPath=``)}catch(e){console.error(e),T.error(this.$t(`skill.message.loadFailed`))}finally{this.loading=!1}},extractError(e){let t=e;return t?.response?.data?.detail||(t?.response?.data?.content||[]).join(`; `)||String(e)||`unknown error`},selectSkill(e){this.selectedSkillId=e.id,this.selectedPath=``},selectFile(e,t){this.selectedSkillId=e.id,this.selectedPath=t},toggleExpand(e){let t=this.expandedSkillIds.indexOf(e.id);t>=0?this.expandedSkillIds.splice(t,1):this.expandedSkillIds.push(e.id)},openUpload(){this.uploadVisible=!0},openWrite(){this.writeVisible=!0},onBrowse(){this.browseVisible=!0},async onCreated(e){await this.fetchSkills();let t=this.skills.find(t=>t.id===e);t&&(this.selectedSkillId=t.id,this.selectedPath=``,this.personalOpen=!0)},async onSaveContent(e,t){if(!this.selectedSkill){t.reject();return}try{let{data:n}=await Z.update(this.selectedSkill.id,{content:e});T.success(this.$t(`skill.message.updateSuccess`));let r=this.skills.findIndex(e=>e.id===n.id);r>=0&&this.skills.splice(r,1,n),t.resolve()}catch(e){T.error(this.$t(`skill.message.createFailed`,{detail:this.extractError(e)})),t.reject(e)}},async onDelete(e){try{await Se.confirm(this.$t(`skill.message.deleteConfirm`,{slug:e.slug}),this.$t(`common.button.delete`),{type:`warning`})}catch{return}try{await Z.remove(e.id),T.success(this.$t(`skill.message.deleteSuccess`)),this.selectedSkillId===e.id&&(this.selectedSkillId=``,this.selectedPath=``),await this.fetchSkills()}catch(e){T.error(this.extractError(e))}},async onToggleSkill(e,t){this.togglingId=e.id;try{t?(await Z.enable(e.id),T.success(this.$t(`skill.message.enableSuccess`))):(await Z.disable(e.id),T.success(this.$t(`skill.message.disableSuccess`))),e.enabled=t}catch(e){T.error(this.extractError(e))}finally{this.togglingId=null}}}}),Tn={class:`skills-page`},En={class:`skills-shell`},Dn={class:`left-pane`},On={class:`left-header`},kn=[`aria-label`,`title`],An={class:`submenu-trigger`},jn={class:`badge-soon`},Mn={class:`left-body`},Nn={class:`section`},Pn={key:0,class:`skill-list`},Fn={key:0,class:`empty-row`},In={key:0,class:`section`},Ln={key:0,class:`skill-list`},Rn={class:`right-pane`},zn={class:`right-header`},Bn={class:`right-title`},Vn={class:`right-actions`},Hn=[`aria-label`,`title`],Un={class:`meta-card`},Wn={class:`meta-grid`},Gn={class:`meta-cell`},Kn={class:`meta-label`},qn={class:`meta-value`},Jn={class:`meta-cell`},Yn={class:`meta-label`},Xn={class:`meta-value`},Zn={key:0,class:`meta-cell`},Qn={class:`meta-label`},$n={class:`meta-tags`},er={key:0,class:`meta-description`},tr={class:`meta-description-label`},nr={class:`meta-label`},rr={class:`preview-card`},ir={key:2,class:`right-empty`};function ar(t,n,u,h,_,y){let b=l(`console-page-header`),x=l(`search-icon`),S=l(`el-input`),C=l(`add-icon`),w=l(`marketplace-icon`),T=l(`el-dropdown-item`),E=l(`expand-right-icon`),D=l(`ai-create-icon`),O=l(`write-icon`),k=l(`upload-icon`),A=l(`el-dropdown-menu`),j=l(`el-dropdown`),M=l(`expand-down-icon`),N=l(`skill-row`),P=l(`el-switch`),F=l(`more-icon`),I=l(`delete-icon`),L=l(`el-tag`),ee=l(`help-icon`),te=l(`el-tooltip`),R=l(`skill-file-preview`),ne=l(`skill-icon`),re=l(`upload-skill-dialog`),ie=l(`write-skill-dialog`),z=l(`browse-skills-dialog`),ae=m(`loading`);return v(),s(`div`,Tn,[a(b,{title:t.$t(`skill.title.skills`),subtitle:t.$t(`skill.message.pageDescription`)},null,8,[`title`,`subtitle`]),e(`div`,En,[e(`aside`,Dn,[e(`header`,On,[a(S,{modelValue:t.searchQuery,"onUpdate:modelValue":n[0]||=e=>t.searchQuery=e,class:`search-input`,size:`default`,clearable:``,placeholder:t.$t(`skill.placeholder.search`)},{prefix:p(()=>[a(x,{size:14,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`]),a(j,{trigger:`click`,placement:`bottom-end`,"hide-on-click":!1},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{onClick:t.onBrowse},{default:p(()=>[a(w,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.browse`)),1)]),_:1},8,[`onClick`]),a(T,{divided:``},{default:p(()=>[a(j,{trigger:`hover`,placement:`left-start`,"hide-on-click":!0},{dropdown:p(()=>[a(A,{class:`add-menu`},{default:p(()=>[a(T,{disabled:``},{default:p(()=>[a(D,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.createWithClaude`))+` `,1),e(`span`,jn,i(t.$t(`skill.menu.soon`)),1)]),_:1}),a(T,{onClick:t.openWrite},{default:p(()=>[a(O,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.write`)),1)]),_:1},8,[`onClick`]),a(T,{onClick:t.openUpload},{default:p(()=>[a(k,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.upload`)),1)]),_:1},8,[`onClick`])]),_:1})]),default:p(()=>[e(`span`,An,[a(C,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`skill.menu.create`))+` `,1),a(E,{class:`submenu-arrow`,size:14,"aria-hidden":`true`,focusable:`false`})])]),_:1})]),_:1})]),_:1})]),default:p(()=>[e(`button`,{type:`button`,class:`add-button`,"aria-label":t.$t(`skill.button.add`),title:t.$t(`skill.button.add`)},[a(C,{size:16,"aria-hidden":`true`,focusable:`false`})],8,kn)]),_:1})]),d((v(),s(`div`,Mn,[e(`section`,Nn,[e(`button`,{class:`section-header`,onClick:n[1]||=e=>t.personalOpen=!t.personalOpen},[t.personalOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.personal`)),1)]),t.personalOpen?(v(),s(`ul`,Pn,[!t.loading&&t.filteredPersonal.length===0?(v(),s(`li`,Fn,i(t.searchQuery?t.$t(`skill.empty.search`):t.$t(`skill.message.noSkills`)),1)):o(``,!0),(v(!0),s(c,null,g(t.filteredPersonal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)]),t.globalSkills.length>0?(v(),s(`section`,In,[e(`button`,{class:`section-header`,onClick:n[2]||=e=>t.globalsOpen=!t.globalsOpen},[t.globalsOpen?(v(),f(M,{key:0,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})):(v(),f(E,{key:1,class:`section-chevron`,size:12,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.$t(`skill.section.platform`)),1)]),t.globalsOpen?(v(),s(`ul`,Ln,[(v(!0),s(c,null,g(t.filteredGlobal,e=>(v(),f(N,{key:e.id,skill:e,"selected-skill-id":t.selectedSkillId,"selected-path":t.selectedPath,expanded:t.expandedSkillIds.includes(e.id),onToggleExpand:t.toggleExpand,onSelectSkill:t.selectSkill,onSelectFile:t.selectFile},null,8,[`skill`,`selected-skill-id`,`selected-path`,`expanded`,`onToggleExpand`,`onSelectSkill`,`onSelectFile`]))),128))])):o(``,!0)])):o(``,!0)])),[[ae,t.loading]])]),e(`main`,Rn,[t.selectedSkill&&!t.selectedPath?(v(),s(c,{key:0},[e(`header`,zn,[e(`h3`,Bn,i(t.selectedSkill.slug),1),e(`div`,Vn,[a(P,{"model-value":t.selectedSkill.enabled,size:`default`,loading:t.togglingId===t.selectedSkill.id,onChange:n[3]||=e=>t.onToggleSkill(t.selectedSkill,!!e)},null,8,[`model-value`,`loading`]),t.selectedSkill.source===`global`?o(``,!0):(v(),f(j,{key:0,trigger:`click`,placement:`bottom-end`},{dropdown:p(()=>[a(A,null,{default:p(()=>[a(T,{onClick:n[4]||=e=>t.onDelete(t.selectedSkill)},{default:p(()=>[a(I,{class:`menu-icon`,size:14,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`common.button.delete`)),1)]),_:1})]),_:1})]),default:p(()=>[e(`button`,{class:`icon-btn`,"aria-label":t.$t(`skill.button.more`),title:t.$t(`skill.button.more`)},[a(F,{size:16,"aria-hidden":`true`,focusable:`false`})],8,Hn)]),_:1}))])]),e(`div`,Un,[e(`div`,Wn,[e(`div`,Gn,[e(`span`,Kn,i(t.$t(`skill.meta.addedBy`)),1),e(`span`,qn,i(t.selectedSkill.source===`global`?t.$t(`skill.meta.platform`):t.$t(`skill.meta.you`)),1)]),e(`div`,Jn,[e(`span`,Yn,i(t.$t(`skill.meta.lastUpdated`)),1),e(`span`,Xn,i(t.$dayjs.format(t.selectedSkill.updated_at)),1)]),t.selectedSkill.required_connections.length?(v(),s(`div`,Zn,[e(`span`,Qn,i(t.$t(`skill.field.requiredConnections`)),1),e(`div`,$n,[(v(!0),s(c,null,g(t.selectedSkill.required_connections,e=>(v(),f(L,{key:e,size:`small`,type:`info`},{default:p(()=>[r(i(e),1)]),_:2},1024))),128))])])):o(``,!0)]),t.selectedSkill.description?(v(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`skill.field.description`)),1),t.selectedSkill.when_to_use?(v(),f(te,{key:0,content:t.selectedSkill.when_to_use,placement:`top`},{default:p(()=>[a(ee,{class:`meta-info-icon`,size:12,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`content`])):o(``,!0)]),e(`p`,null,i(t.selectedSkill.description),1)])):o(``,!0)]),e(`div`,rr,[(v(),f(R,{key:`${t.selectedSkill.id}:SKILL.md`,"skill-id":t.selectedSkill.id,path:`SKILL.md`,editable:t.selectedSkill.source===`upload`,onSave:t.onSaveContent},null,8,[`skill-id`,`editable`,`onSave`]))])],64)):t.selectedSkill&&t.selectedPath?(v(),f(R,{key:`${t.selectedSkill.id}:${t.selectedPath}`,"skill-id":t.selectedSkill.id,path:t.selectedPath,editable:!1},null,8,[`skill-id`,`path`])):(v(),s(`div`,ir,[a(ne,{class:`right-empty-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,i(t.$t(`skill.preview.selectSkill`)),1)]))])]),a(re,{modelValue:t.uploadVisible,"onUpdate:modelValue":n[5]||=e=>t.uploadVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(ie,{modelValue:t.writeVisible,"onUpdate:modelValue":n[6]||=e=>t.writeVisible=e,onCreated:t.onCreated},null,8,[`modelValue`,`onCreated`]),a(z,{modelValue:t.browseVisible,"onUpdate:modelValue":n[7]||=e=>t.browseVisible=e,onInstalled:t.onCreated},null,8,[`modelValue`,`onInstalled`])])}var or=V(wn,[[`render`,ar],[`__scopeId`,`data-v-6d629e8e`]]);export{or as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,ot as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{t as b}from"./upload-DPM3VJNR.js";import{h as x,v as S}from"./models-qt9s4QBH.js";import{t as C}from"./checkbox-DXMDpaxv.js";import{t as w}from"./drawer-yTqzLaen.js";import{n as T,r as E,t as D}from"./dropdown-Bw011FVB.js";import{t as O}from"./popover-CCAggJhc.js";import{n as ee,t as te}from"./skeleton-Dj_a_iIP.js";import{t as ne}from"./arrow-right-Mc9TL9dE.js";import{t as k}from"./arrow-up-Ok1QXX4J.js";import{t as re}from"./brain-CRWdx7Pw.js";import{t as A}from"./check-Dkywcw9M.js";import{t as ie}from"./chevron-down-DofdIa77.js";import{t as ae}from"./clipboard-list-BQKLA0v1.js";import{t as j}from"./code-B1khxmUM.js";import{t as M}from"./ellipsis-CJqSKBCr.js";import{t as oe}from"./eye-FxhnNuOz.js";import{t as se}from"./file-text-YhDtvMQ4.js";import{t as N}from"./file-DtMwLDy5.js";import{t as ce}from"./folder-BOq3rzmG.js";import{t as P}from"./gauge-D1GQHZS1.js";import{t as F}from"./history-B25VEzje.js";import{t as I}from"./info-AmBm9Cbx.js";import{t as L}from"./laptop-CzgKynug.js";import{t as R}from"./link-DkSgA3dd.js";import{t as z}from"./loader-circle-D26fSmns.js";import{t as le}from"./mic-DThA7f_u.js";import{t as ue}from"./monitor-C7pDvjST.js";import{t as B}from"./paperclip-DHtaHoBJ.js";import{t as V}from"./pencil-Dxw_6QaO.js";import{t as H}from"./plus-CByC99a5.js";import{t as U}from"./rotate-cw-CKwX841o.js";import{t as de}from"./search-BgeCUkYM.js";import{t as fe}from"./shield-D8Epv2bc.js";import{t as pe}from"./square-B_xQGZFm.js";import{t as me}from"./terminal-DlnoUhS_.js";import{t as he}from"./trash-2-qsTysEar.js";import{ba as ge}from"./constants-CmC-0Hwp.js";import{O as _e}from"./i18n-BQrNxKw9.js";import{A as W,Ba as G,Ka as K,La as ve,Sn as ye,Tn as be,Va as xe,ct as Se,lo as q,ra as Ce,st as we,to as J,za as Y}from"./index-DM6hrjyQ.js";import"./vendor-highlight-BHrfT4-E.js";import{t as Te}from"./CopyToClipboard-CCt1tvH4.js";import{t as Ee}from"./VueMarkdown-CiiRjbWs.js";import{t as De}from"./AskUserQuestionCard-BiIL49gU.js";import{s as Oe,t as ke}from"./codingBridgeNotify-DrZu58pn.js";import{t as Ae}from"./CodeSnippet-Cwg8dFMK.js";var je=G(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),Me=G(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Ne=G(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Pe=y({name:`CodingBridgeNotificationToggle`,components:{LoadingIcon:z,NotificationIcon:Me,NotificationOffIcon:je,ElButton:J},data(){return{enabled:!1,busy:!1}},computed:{supported(){return _e()||Oe()}},mounted(){this.enabled=!_e()&&ke()===`granted`},methods:{async onToggle(){this.busy=!0;try{if(this.enabled){await this.$store.dispatch(`codingBridge/disableNotifications`),this.enabled=!1,S.success(this.$t(`codingBridge.notify.disabled`));return}let e=await this.$store.dispatch(`codingBridge/enableNotifications`);e===`enabled`?(this.enabled=!0,S.success(this.$t(`codingBridge.notify.enabled`))):e===`denied`?S.warning(this.$t(`codingBridge.notify.denied`)):S.warning(this.$t(`codingBridge.notify.unsupported`))}catch{S.error(this.$t(`codingBridge.notify.failed`))}finally{this.busy=!1}}}});function Fe(e,t,n,r,i,a){let s=u(`loading-icon`),c=u(`notification-icon`),l=u(`notification-off-icon`),d=u(`el-button`);return e.supported?(v(),p(d,{key:0,circle:``,size:`small`,type:e.enabled?`primary`:`default`,title:e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),disabled:e.busy,"aria-label":e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),onClick:e.onToggle},{default:m(()=>[e.busy?(v(),p(s,{key:0,class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):e.enabled?(v(),p(c,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(l,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`type`,`title`,`disabled`,`aria-label`,`onClick`])):o(``,!0)}var Ie=y({name:`CodingBridgeNodeList`,components:{AddIcon:H,DeleteIcon:he,DesktopIcon:ue,DeveloperIcon:L,EditIcon:V,RedoIcon:U,ElButton:J,NotificationToggle:W(Pe,[[`render`,Fe]])},emits:[`pair`],computed:{nodes(){return this.$store.state.codingBridge?.nodes??[]},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},connection(){return this.$store.state.codingBridge?.connection??`disconnected`},connectionLabel(){return this.$t(`codingBridge.connection.${this.connection}`)},connectionDotClass(){switch(this.connection){case`connected`:return`bg-[var(--el-color-success)]`;case`connecting`:return`bg-[var(--el-color-warning)]`;case`error`:return`bg-[var(--el-color-danger)]`;default:return`bg-[var(--app-text-subtle)]`}}},methods:{onSelect(e){this.$store.dispatch(`codingBridge/selectNode`,e)},onRefresh(){this.$store.dispatch(`codingBridge/getNodes`)},async onRename(e){let t;try{t=((await xe.prompt(this.$t(`codingBridge.nodeList.renamePrompt`),this.$t(`codingBridge.nodeList.rename`),{confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`),inputValue:e.name,inputValidator:e=>{let t=(e??``).trim();return t?[...t].length>64?this.$t(`codingBridge.nodeList.renameTooLong`,{max:64}):!0:this.$t(`codingBridge.nodeList.renameEmpty`)}})).value??``).trim()}catch{return}if(!(!t||t===e.name))try{await this.$store.dispatch(`codingBridge/renameNode`,{nodeId:e.node_id,name:t}),S.success(this.$t(`codingBridge.nodeList.renameSuccess`))}catch{S.error(this.$t(`codingBridge.nodeList.renameFailed`))}},async onDelete(e){try{await xe.confirm(this.$t(`codingBridge.nodeList.removeConfirm`,{name:e.name}),this.$t(`codingBridge.nodeList.remove`),{confirmButtonText:this.$t(`codingBridge.nodeList.remove`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}try{await this.$store.dispatch(`codingBridge/deleteNode`,e.node_id),S.success(this.$t(`codingBridge.nodeList.removeSuccess`))}catch{S.error(this.$t(`codingBridge.nodeList.removeFailed`))}}}}),Le={class:`node-list flex flex-col h-full bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Re={class:`flex items-center justify-between px-4 py-3 border-b border-[var(--app-border-subtle)]`},ze={class:`flex items-center gap-2 font-medium`},Be={class:`flex items-center gap-1`},Ve={class:`flex items-center gap-2 px-4 py-2 text-xs border-b border-[var(--app-border-subtle)]`},He={class:`text-[var(--app-text-subtle)]`},Ue={class:`flex-1 overflow-y-auto`},We={key:0,class:`p-6 text-center text-sm text-[var(--app-text-subtle)]`},Ge={class:`mb-3`},Ke={key:1,class:`list-none m-0 p-0`},qe=[`onClick`],Je={class:`flex-1 min-w-0`},Ye={class:`flex items-center gap-2`},Xe={class:`truncate font-medium`},Ze=[`title`],Qe={class:`text-xs text-[var(--app-text-subtle)] truncate`};function $e(o,c,d,f,p,h){let _=u(`developer-icon`),y=u(`notification-toggle`),b=u(`redo-icon`),x=u(`el-button`),S=u(`add-icon`),C=u(`desktop-icon`),w=u(`edit-icon`),T=u(`delete-icon`);return v(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(o.$t(`codingBridge.nodeList.title`)),1)]),e(`div`,Be,[a(y),a(x,{circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.refresh`),title:o.$t(`codingBridge.nodeList.refresh`),onClick:o.onRefresh},{default:m(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(x,{type:`primary`,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.pair`),title:o.$t(`codingBridge.nodeList.pair`),onClick:c[0]||=e=>o.$emit(`pair`)},{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])])]),e(`div`,Ve,[e(`span`,{class:n([`inline-block w-2 h-2 rounded-full`,o.connectionDotClass])},null,2),e(`span`,He,i(o.connectionLabel),1)]),e(`div`,Ue,[o.nodes.length?(v(),s(`ul`,Ke,[(v(!0),s(l,null,g(o.nodes,r=>(v(),s(`li`,{key:r.node_id,class:n([`group flex items-center gap-3 px-4 py-3 cursor-pointer border-b border-[var(--app-border-subtle)] hover:bg-[var(--app-content-bg)]`,{"bg-[var(--app-content-bg)]":r.node_id===o.currentNodeId}]),onClick:e=>o.onSelect(r.node_id)},[a(C,{class:`text-[var(--app-text-subtle)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(r.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,r.status===`online`?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`]),title:r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)},null,10,Ze)]),e(`div`,Qe,i(r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)),1)]),a(x,{class:`node-action`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.rename`),title:o.$t(`codingBridge.nodeList.rename`),onClick:t(e=>o.onRename(r),[`stop`])},{default:m(()=>[a(w,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(x,{class:`node-action`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.remove`),title:o.$t(`codingBridge.nodeList.remove`),onClick:t(e=>o.onDelete(r),[`stop`])},{default:m(()=>[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])],10,qe))),128))])):(v(),s(`div`,We,[e(`p`,Ge,i(o.$t(`codingBridge.nodeList.empty`)),1),a(x,{type:`primary`,round:``,size:`small`,onClick:c[1]||=e=>o.$emit(`pair`)},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`codingBridge.nodeList.pairFirst`)),1)]),_:1})]))])])}var et=W(Ie,[[`render`,$e],[`__scopeId`,`data-v-37e3f542`]]),tt=e=>{let t=e?.questions;return Array.isArray(t)&&t.length>0&&t.every(e=>e&&typeof e.question==`string`&&Array.isArray(e.options))},nt=e=>e?(e.tool||``).toLowerCase()===`askuserquestion`?!0:tt(e.input):!1,rt=e=>({questions:e.input?.questions??[]}),it=100,X=4e4,at=12e3,ot=6e3,st=50,ct=200,Z=(e,t)=>{if(e.length<=t)return e;let n=((e.length-t)/1024).toFixed(1);return`${e.slice(0,t)}\n\n··· +${n} KB ···`},lt=y({name:`CodingBridgeTranscriptItem`,directives:{highlight:be},components:{CloseIcon:Y,ConfirmIcon:A,EditIcon:V,FileIcon:N,InfoIcon:I,VueMarkdown:Ee,CodeSnippet:Ae,CopyToClipboard:Te},props:{event:{type:Object,required:!0},editable:{type:Boolean,default:!1}},emits:[`edit`],data(){return{renderedText:Z(this.event.text||``,X),streamTimer:0}},computed:{commandText(){let e=this.event.input;if(!e)return``;for(let t of[`command`,`cmd`,`script`]){let n=e[t];if(typeof n==`string`&&n.trim())return Z(n,ot)}return``},filePath(){let e=this.event.input;if(!e)return``;for(let t of[`file_path`,`filePath`,`path`,`notebook_path`,`filename`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return``},toolDescription(){let e=this.event.input?.description;return typeof e==`string`?e:``},toolIcon(){if(this.todoList.length)return ae;if(this.commandText)return me;let e=(this.event.tool??``).toLowerCase();return/read|cat|view/.test(e)?se:/write|edit|create|update|insert/.test(e)?V:/grep|glob|search|find|list/.test(e)?de:j},questionLines(){let e=(this.event.tool??``).toLowerCase(),t=this.event.input?.questions;return!(e===`askuserquestion`||Array.isArray(t))||!Array.isArray(t)?[]:t.filter(e=>e&&typeof e.question==`string`).map(e=>({header:typeof e.header==`string`?e.header:``,question:e.question}))},todoList(){let e=this.event.input?.todos;return!Array.isArray(e)||!(this.event.tool??``).toLowerCase().includes(`todo`)&&Object.keys(this.event.input??{}).filter(e=>e!==`todos`&&e!==`description`).length?[]:e.filter(e=>e&&typeof e.content==`string`).map(e=>({content:e.content,status:typeof e.status==`string`?e.status:`pending`,activeForm:typeof e.activeForm==`string`?e.activeForm:void 0}))},todoItems(){return this.todoList.slice(0,st).map(e=>{let t=e.status===`in_progress`&&e.activeForm?e.activeForm:e.content,n=t.length>ct?`${t.slice(0,ct)}…`:t;return e.status===`completed`?{text:n,status:`completed`,statusLabel:this.$t(`codingBridge.transcript.todoCompleted`),icon:A,iconClass:`text-[var(--el-color-success)]`,textClass:`text-[var(--app-text-subtle)] line-through`}:e.status===`in_progress`?{text:n,status:`in_progress`,statusLabel:this.$t(`codingBridge.transcript.todoInProgress`),icon:z,iconClass:`text-[var(--el-color-primary)]`,textClass:`text-[var(--app-text)] font-medium`}:{text:n,status:`pending`,statusLabel:this.$t(`codingBridge.transcript.todoPending`),icon:pe,iconClass:`text-[var(--app-text-subtle)] opacity-60`,textClass:`text-[var(--app-text-subtle)]`}})},todoProgressLabel(){let e=this.todoList.filter(e=>e.status===`completed`).length;return this.$t(`codingBridge.transcript.todoProgress`,{done:e,total:this.todoList.length})},todoProgressId(){return`cb-todo-progress-${this.event.id}`},todoOverflow(){return Math.max(0,this.todoList.length-st)},inputText(){let e=this.event.input;if(!e)return``;let t={};for(let[n,r]of Object.entries(e))n===`timeout`||n===`description`||(t[n]=r);if(Object.keys(t).length===0)return``;try{return Z(JSON.stringify(t,null,2),ot)}catch{return Z(String(e),ot)}},thinkingText(){return Z(this.event.text||``,X)},resultText(){let e=this.event.content;return typeof e==`string`&&e.length>0?e:`—`},resultDisplay(){return Z(this.resultText,at)},resultLabel(){let e=[];return this.event.is_error?e.push(this.$t(`codingBridge.transcript.turnFailed`)):e.push(this.$t(`codingBridge.transcript.turnDone`)),typeof this.event.cost_usd==`number`&&this.event.cost_usd>0&&e.push(`$${this.event.cost_usd.toFixed(4)}`),e.join(` · `)},hasAttachments(){return!!this.event.attachments?.length},noticeText(){let e=this.event.subtype,t=this.event.command;if(t){if(e===`slash_unavailable`)return this.$t(`codingBridge.notice.slashUnavailable`,{command:t});if(e===`slash_codex_unsupported`)return this.$t(`codingBridge.notice.slashCodexUnsupported`,{command:t})}return this.event.text||``}},watch:{"event.text"(){this.scheduleRender()},"event.streaming"(e){e||this.flushRender()}},beforeUnmount(){this.streamTimer&&window.clearTimeout(this.streamTimer)},methods:{scheduleRender(){if(!this.event.streaming){this.flushRender();return}this.streamTimer||=window.setTimeout(()=>{this.streamTimer=0,this.renderedText=Z(this.event.text||``,X)},it)},flushRender(){this.streamTimer&&=(window.clearTimeout(this.streamTimer),0),this.renderedText=Z(this.event.text||``,X)}}}),ut={key:0,class:`group flex items-end justify-end gap-1.5`},dt=[`title`,`aria-label`],ft={class:`max-w-[85%] rounded-lg px-3 py-2 bg-[var(--el-color-primary)] text-white whitespace-pre-wrap break-words`},pt=[`src`],mt=[`href`],ht=[`src`],gt={key:1,class:`flex h-9 w-9 items-center justify-center rounded bg-white/15`},_t={class:`min-w-0 truncate`},vt={key:2},yt={key:2,class:`whitespace-pre-wrap break-words italic text-[var(--app-text-subtle)] border-l-2 border-[var(--app-border-subtle)] pl-3`},bt={key:3,class:`overflow-hidden rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)]`},xt={class:`flex items-center gap-2 px-2.5 py-1.5 font-medium text-[var(--app-text-subtle)]`},St={key:0,class:`min-w-0 truncate text-xs font-normal opacity-70`},Ct={key:0,class:`flex flex-col gap-1.5 px-2.5 pb-2`},wt={key:0,class:`font-medium text-[var(--app-text)]`},Tt={class:`whitespace-pre-wrap break-words text-[var(--app-text-subtle)]`},Et={key:1,class:`px-2.5 pb-2`},Dt=[`id`],Ot=[`aria-labelledby`],kt={class:`sr-only`},At={key:0,class:`mt-1 text-xs text-[var(--app-text-subtle)]`},jt={key:2,class:`px-2.5 pb-2`},Mt={key:3,class:`px-2.5 pb-2 font-mono text-xs break-all text-[var(--app-text-subtle)]`},Nt={key:4,class:`px-2.5 pb-2`},Pt={key:0,class:`absolute right-1.5 top-1.5 z-10 rounded bg-[var(--app-content-bg)] px-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`},Ft={key:5,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)]`},It={key:6,class:`flex items-start gap-2 rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)] text-[var(--app-text-subtle)] px-3 py-2 text-xs`},Lt={class:`whitespace-pre-wrap break-words`},Rt={key:7,class:`rounded-md bg-[var(--el-color-danger-light-9)] text-[var(--el-color-danger)] px-3 py-2 whitespace-pre-wrap break-words`};function zt(t,r,c,f,m,y){let b=u(`edit-icon`),x=u(`file-icon`),S=u(`vue-markdown`),C=u(`code-snippet`),w=u(`copy-to-clipboard`),T=u(`close-icon`),E=u(`confirm-icon`),D=u(`info-icon`),O=h(`highlight`);return v(),s(`div`,{class:n([`transcript-item text-sm leading-relaxed`,`kind-${t.event.kind}`])},[t.event.kind===`prompt`?(v(),s(`div`,ut,[t.editable?(v(),s(`button`,{key:0,type:`button`,class:`cb-edit-btn opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,title:t.$t(`codingBridge.session.editPrompt`),"aria-label":t.$t(`codingBridge.session.editPrompt`),onClick:r[0]||=e=>t.$emit(`edit`,t.event)},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,dt)):o(``,!0),e(`div`,ft,[t.event.images&&t.event.images.length?(v(),s(`div`,{key:0,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text||t.hasAttachments}])},[(v(!0),s(l,null,g(t.event.images,(e,t)=>(v(),s(`img`,{key:t,src:e,class:`w-16 h-16 rounded object-cover`,alt:``},null,8,pt))),128))],2)):o(``,!0),t.hasAttachments?(v(),s(`div`,{key:1,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text}])},[(v(!0),s(l,null,g(t.event.attachments,(t,n)=>(v(),s(`a`,{key:`${t.url}-${n}`,href:t.url,target:`_blank`,rel:`noopener noreferrer`,class:`flex max-w-[220px] items-center gap-2 rounded-md bg-white/15 px-2 py-1.5 text-xs text-white hover:bg-white/20`},[t.type===`image`?(v(),s(`img`,{key:0,src:t.url,class:`h-9 w-9 rounded object-cover`,alt:``},null,8,ht)):(v(),s(`span`,gt,[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,_t,i(t.name||t.url),1)],8,mt))),128))],2)):o(``,!0),t.event.text?(v(),s(`span`,vt,i(t.event.text),1)):o(``,!0)])])):t.event.kind===`text`?(v(),s(`div`,{key:1,class:n([`cb-stream-text`,{"is-streaming":t.event.streaming}])},[d(a(S,{source:t.renderedText,class:`markdown-body bg-transparent text-[var(--app-text)]`},null,8,[`source`]),[[O]])],2)):t.event.kind===`thinking`?(v(),s(`div`,yt,i(t.thinkingText),1)):t.event.kind===`tool_use`?(v(),s(`div`,bt,[e(`div`,xt,[(v(),p(_(t.toolIcon),{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.event.tool),1),t.toolDescription?(v(),s(`span`,St,i(t.toolDescription),1)):o(``,!0)]),t.questionLines.length?(v(),s(`div`,Ct,[(v(!0),s(l,null,g(t.questionLines,(t,n)=>(v(),s(`div`,{key:n,class:`rounded border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-2.5 py-1.5 text-xs`},[t.header?(v(),s(`div`,wt,i(t.header),1)):o(``,!0),e(`div`,Tt,i(t.question),1)]))),128))])):t.todoItems.length?(v(),s(`div`,Et,[e(`div`,{id:t.todoProgressId,class:`mb-1.5 text-xs text-[var(--app-text-subtle)]`},i(t.todoProgressLabel),9,Dt),e(`ul`,{class:`flex flex-col gap-1`,"aria-labelledby":t.todoProgressId},[(v(!0),s(l,null,g(t.todoItems,(t,r)=>(v(),s(`li`,{key:r,class:`flex items-start gap-2 text-xs`},[(v(),p(_(t.icon),{class:n([`mt-0.5 flex-none`,t.iconClass]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])),e(`span`,kt,i(t.statusLabel),1),e(`span`,{class:n([`min-w-0 break-words`,t.textClass])},i(t.text),3)]))),128))],8,Ot),t.todoOverflow?(v(),s(`div`,At,i(t.$t(`codingBridge.transcript.todoOverflow`,{count:t.todoOverflow})),1)):o(``,!0)])):t.commandText?(v(),s(`div`,jt,[a(C,{code:t.commandText,lang:`bash`,copyable:``},null,8,[`code`])])):t.filePath?(v(),s(`div`,Mt,i(t.filePath),1)):t.inputText?(v(),s(`div`,Nt,[a(C,{code:t.inputText,lang:`json`,copyable:``},null,8,[`code`])])):o(``,!0)])):t.event.kind===`tool_result`?(v(),s(`div`,{key:4,class:n([`group relative overflow-hidden rounded-md`,t.event.is_error?`bg-[var(--el-color-danger-light-9)]`:`bg-[var(--app-sidebar-bg)]`])},[t.event.content?(v(),s(`div`,Pt,[a(w,{content:t.resultText},null,8,[`content`])])):o(``,!0),e(`pre`,{class:n([`m-0 max-h-72 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-xs`,t.event.is_error?`text-[var(--el-color-danger)]`:`text-[var(--app-text-subtle)]`])},i(t.resultDisplay),3)],2)):t.event.kind===`result`?(v(),s(`div`,Ft,[t.event.is_error?(v(),p(T,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(E,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.resultLabel),1)])):t.event.kind===`notice`?(v(),s(`div`,It,[a(D,{class:`mt-0.5 flex-none text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Lt,i(t.noticeText),1)])):t.event.kind===`error`?(v(),s(`div`,Rt,i(t.event.text),1)):o(``,!0)],2)}var Bt=W(lt,[[`render`,zt],[`__scopeId`,`data-v-f71fa078`]]),Vt=`Pondering.Noodling.Conjuring.Brewing.Cooking.Crafting.Churning.Simmering.Percolating.Ruminating.Musing.Marinating.Synthesizing.Computing.Hatching.Forging.Vibing.Working.Thinking.Cogitating.Mulling.Stewing.Tinkering.Wrangling.Spinning.Reticulating.Manifesting.Deliberating`.split(`.`),Ht=[`思考中`,`酝酿中`,`沉思中`,`推敲中`,`构思中`,`计算中`,`琢磨中`,`捣鼓中`,`炼制中`,`召唤中`,`编织中`,`烹饪中`,`咀嚼中`,`盘算中`,`发酵中`,`运转中`,`冥想中`,`鼓捣中`,`熬制中`,`神游中`,`演算中`,`雕琢中`,`头脑风暴中`,`反复斟酌中`],Ut=60,Wt=1500,Gt=28,Kt=y({name:`CodingBridgeThinkingIndicator`,components:{LoadingIcon:z},data(){return{display:``,elapsed:0,charIndex:0,phase:`typing`,currentWord:``,elapsedTimer:0,typeTimer:0}},computed:{words(){return this.$i18n.locale.startsWith(`zh`)?Ht:Vt}},mounted(){this.currentWord=this.pickWord(),this.elapsedTimer=window.setInterval(()=>{this.elapsed+=1},1e3),this.scheduleType(Ut)},beforeUnmount(){window.clearInterval(this.elapsedTimer),window.clearTimeout(this.typeTimer)},methods:{pickWord(){let e=this.words;if(e.length<=1)return e[0]??``;let t=this.currentWord;for(;t===this.currentWord;)t=e[Math.floor(Math.random()*e.length)];return t},scheduleType(e){this.typeTimer=window.setTimeout(this.advance,e)},advance(){let e=this.currentWord;this.phase===`typing`?(this.charIndex+=1,this.display=e.slice(0,this.charIndex),this.charIndex>=e.length?(this.phase=`holding`,this.scheduleType(Wt)):this.scheduleType(Ut)):this.phase===`holding`?(this.phase=`deleting`,this.scheduleType(Gt)):(--this.charIndex,this.display=e.slice(0,Math.max(0,this.charIndex)),this.charIndex<=0?(this.currentWord=this.pickWord(),this.phase=`typing`,this.scheduleType(Ut)):this.scheduleType(Gt))}}}),qt={class:`cb-thinking flex items-center gap-2 text-sm text-[var(--app-text-subtle)] py-1`},Jt={class:`cb-thinking__word`},Yt={class:`cb-thinking__elapsed tabular-nums opacity-60`};function Xt(t,n,o,c,l,d){let f=u(`loading-icon`);return v(),s(`div`,qt,[a(f,{class:`cb-thinking__spinner adc-icon-spin text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Jt,[r(i(t.display),1),n[0]||=e(`span`,{class:`cb-thinking__caret`},`▋`,-1)]),e(`span`,Yt,`(`+i(t.elapsed)+`s)`,1)])}var Zt=W(Kt,[[`render`,Xt],[`__scopeId`,`data-v-ae116215`]]),Qt=y({name:`CodingBridgeComposerSettings`,components:{ElButton:J,ElDialog:K},props:{dialog:{type:Boolean,default:!1},open:{type:Boolean,default:!1}},emits:[`update:open`]}),$t={key:0,class:`cb-settings-inline`},en={class:`cb-settings-rows`};function tn(t,n,o,c,l,d){let h=u(`el-button`),g=u(`el-dialog`);return t.dialog?(v(),p(g,{key:1,"model-value":t.open,title:t.$t(`codingBridge.session.settings`),width:`min(420px, 92vw)`,"align-center":``,"append-to-body":``,class:`cb-settings-dialog`,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:open`,e)},{footer:m(()=>[a(h,{type:`primary`,round:``,onClick:n[0]||=e=>t.$emit(`update:open`,!1)},{default:m(()=>[r(i(t.$t(`common.button.close`)),1)]),_:1})]),default:m(()=>[e(`div`,en,[f(t.$slots,`default`,{},void 0,!0)])]),_:3},8,[`model-value`,`title`])):(v(),s(`div`,$t,[f(t.$slots,`default`,{},void 0,!0)]))}var nn=W(Qt,[[`render`,tn],[`__scopeId`,`data-v-20aa7356`]]),rn=y({name:`CodingBridgeDirectoryDialog`,components:{ContinueIcon:ne,FileIcon:N,FolderIcon:ce,RedoIcon:U,UpIcon:k,ElDialog:K,ElButton:J,ElInput:q},props:{visible:{type:Boolean,default:!1},initialPath:{type:String,default:``}},emits:[`update:visible`,`select`],data(){return{pathInput:``}},computed:{listing(){return this.$store.state.codingBridge?.directory},loading(){return this.$store.state.codingBridge?.directoryLoading===!0},directories(){return(this.listing?.entries??[]).filter(e=>e.type===`dir`)},files(){return(this.listing?.entries??[]).filter(e=>e.type===`file`)},isEmpty(){return!!this.listing&&!this.listing.error&&(this.listing.entries??[]).length===0}},watch:{"listing.path"(e){this.pathInput=e??``}},methods:{onOpen(){this.pathInput=this.initialPath||``,this.$store.dispatch(`codingBridge/browseDir`,this.initialPath||void 0)},goPath(){let e=this.pathInput.trim();e&&this.$store.dispatch(`codingBridge/browseDir`,e)},syncPathInput(){this.pathInput=this.listing?.path??``},onVisibleChange(e){this.$emit(`update:visible`,e),e||this.$store.dispatch(`codingBridge/clearDirectory`)},openDir(e){this.$store.dispatch(`codingBridge/browseDir`,e)},goParent(){this.listing?.parent&&this.$store.dispatch(`codingBridge/browseDir`,this.listing.parent)},refresh(){this.$store.dispatch(`codingBridge/browseDir`,this.listing?.path||this.initialPath||void 0)},chooseCurrent(){this.listing&&!this.listing.error&&(this.$emit(`select`,this.listing.path),this.onVisibleChange(!1))}}}),an={class:`flex flex-col gap-2`},on={class:`flex items-center gap-2 min-w-0`},sn={class:`h-72 overflow-y-auto border border-[var(--app-border-subtle)] rounded-md divide-y divide-[var(--app-border-subtle)]`},cn={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)]`},ln={key:1,class:`h-full flex items-center justify-center text-sm text-[var(--el-color-danger)]`},un=[`onClick`],dn={class:`truncate`,dir:`ltr`},fn={class:`truncate`,dir:`ltr`},pn={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)] py-8`},mn={key:0,class:`text-[11px] text-[var(--app-text-subtle)] px-1`},hn={class:`flex items-center justify-end gap-2`};function gn(t,d,f,h,_,y){let b=u(`up-icon`),x=u(`el-button`),S=u(`continue-icon`),C=u(`el-input`),w=u(`redo-icon`),T=u(`folder-icon`),E=u(`file-icon`),D=u(`el-dialog`);return v(),p(D,{"model-value":t.visible,title:t.$t(`codingBridge.directory.title`),width:`520px`,"append-to-body":``,"onUpdate:modelValue":t.onVisibleChange,onOpen:t.onOpen},{footer:m(()=>[e(`div`,hn,[a(x,{round:``,onClick:d[1]||=e=>t.onVisibleChange(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1}),a(x,{type:`primary`,round:``,disabled:!t.listing||!!t.listing.error,onClick:t.chooseCurrent},{default:m(()=>[r(i(t.$t(`codingBridge.directory.choose`)),1)]),_:1},8,[`disabled`,`onClick`])])]),default:m(()=>[e(`div`,an,[e(`div`,on,[a(x,{size:`small`,circle:``,disabled:!t.listing||!t.listing.parent||t.loading,title:t.$t(`codingBridge.directory.up`),"aria-label":t.$t(`codingBridge.directory.up`),onClick:t.goParent},{default:m(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`]),a(C,{modelValue:t.pathInput,"onUpdate:modelValue":d[0]||=e=>t.pathInput=e,size:`small`,class:`flex-1 min-w-0`,dir:`ltr`,placeholder:t.$t(`codingBridge.directory.pathPlaceholder`),disabled:t.loading,onKeyup:c(t.goPath,[`enter`]),onBlur:t.syncPathInput},{append:m(()=>[a(x,{title:t.$t(`codingBridge.directory.go`),disabled:t.loading||!t.pathInput.trim(),"aria-label":t.$t(`codingBridge.directory.go`),onClick:t.goPath},{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`disabled`,`aria-label`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`disabled`,`onKeyup`,`onBlur`]),a(x,{size:`small`,circle:``,disabled:t.loading,title:t.$t(`codingBridge.directory.refresh`),"aria-label":t.$t(`codingBridge.directory.refresh`),onClick:t.refresh},{default:m(()=>[a(w,{class:n({"adc-icon-spin":t.loading}),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])]),e(`div`,sn,[t.loading&&!t.listing?(v(),s(`div`,cn,i(t.$t(`codingBridge.directory.loading`)),1)):t.listing&&t.listing.error?(v(),s(`div`,ln,i(t.listing.error),1)):(v(),s(l,{key:2},[(v(!0),s(l,null,g(t.directories,n=>(v(),s(`button`,{key:n.path,type:`button`,class:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--app-content-hover-bg)]`,onClick:e=>t.openDir(n.path)},[a(T,{class:`text-[var(--el-color-warning)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,dn,i(n.name),1)],8,un))),128)),(v(!0),s(l,null,g(t.files,t=>(v(),s(`div`,{key:t.path,class:`w-full flex items-center gap-2 px-3 py-2 text-sm text-[var(--app-text-subtle)]`},[a(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,fn,i(t.name),1)]))),128)),t.isEmpty?(v(),s(`div`,pn,i(t.$t(`codingBridge.directory.empty`)),1)):o(``,!0)],64))]),t.listing&&t.listing.truncated?(v(),s(`p`,mn,i(t.$t(`codingBridge.directory.truncated`)),1)):o(``,!0)])]),_:1},8,[`model-value`,`title`,`onUpdate:modelValue`,`onOpen`])}var _n=W(rn,[[`render`,gn]]),vn=`data:image/svg+xml,%3csvg%20fill='%23D97757'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='m4.7144%2015.9555%204.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608%201.5179.1032%202.2767.1578%201.6514.0972%202.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973%209.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686%201.9064%201.4754%202.4893%201.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335%206.6997%200l.9957.1336.419.3642.6192%201.4147%201.0018%202.2282%201.5543%203.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853%201.8517-.5586%202.9021-.3643%201.9429h.2125l.2429-.2429.9835-1.3053%201.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759%201.1293-.34%201.1657-1.0625%201.3478-.8804%201.1414-1.2628%201.7-.7893%201.36.0729.1093.1882-.0183%202.8535-.607%201.5421-.2794%201.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607%201.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929%201.0686%202.0035%201.8092%202.5075%202.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496%202.3436%203.5214.1214%201.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38%2017.959l-1.1414-1.9428-.1397.079-.674%207.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328%201.9672-2.1796%202.9446-1.7243%201.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889%202.386-3.0357%201.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385%204.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429%201.9064-1.3114Z'/%3e%3c/svg%3e`,yn=`data:image/svg+xml,%3csvg%20fill='%23000000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.676l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v2.999l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e`,bn=`data:image/svg+xml,%3csvg%20fill='%23000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%20Copilot%3c/title%3e%3cpath%20d='M23.922%2016.997C23.061%2018.492%2018.063%2022.02%2012%2022.02%205.937%2022.02.939%2018.492.078%2016.997A.641.641%200%200%201%200%2016.741v-2.869a.883.883%200%200%201%20.053-.22c.372-.935%201.347-2.292%202.605-2.656.167-.429.414-1.055.644-1.517a10.098%2010.098%200%200%201-.052-1.086c0-1.331.282-2.499%201.132-3.368.397-.406.89-.717%201.474-.952C7.255%202.937%209.248%201.98%2011.978%201.98c2.731%200%204.767.957%206.166%202.093.584.235%201.077.546%201.474.952.85.869%201.132%202.037%201.132%203.368%200%20.368-.014.733-.052%201.086.23.462.477%201.088.644%201.517%201.258.364%202.233%201.721%202.605%202.656a.841.841%200%200%201%20.053.22v2.869a.641.641%200%200%201-.078.256Zm-11.75-5.992h-.344a4.359%204.359%200%200%201-.355.508c-.77.947-1.918%201.492-3.508%201.492-1.725%200-2.989-.359-3.782-1.259a2.137%202.137%200%200%201-.085-.104L4%2011.746v6.585c1.435.779%204.514%202.179%208%202.179%203.486%200%206.565-1.4%208-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057%201.259-3.782%201.259-1.59%200-2.738-.545-3.508-1.492a4.359%204.359%200%200%201-.355-.508Zm2.328%203.25c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm-5%200c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm3.313-6.185c.136%201.057.403%201.913.878%202.497.442.544%201.134.938%202.344.938%201.573%200%202.292-.337%202.657-.751.384-.435.558-1.15.558-2.361%200-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438%201.578v.021c0%20.265.021.562.063.893Zm-1.626%200c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824%201.025-.462.472-.705%201.179-.705%202.319%200%201.211.175%201.926.558%202.361.365.414%201.084.751%202.657.751%201.21%200%201.902-.394%202.344-.938.475-.584.742-1.44.878-2.497Z'/%3e%3c/svg%3e`;function xn(e){let t=(e instanceof Error?`${e.name} ${e.message}`:String(e??``)).toLowerCase().replaceAll(`_`,`-`);return t.includes(`notallowed`)||t.includes(`not-allowed`)||t.includes(`permission`)?`permission-denied`:t.includes(`notfound`)||t.includes(`not-found`)||t.includes(`audio-capture`)||t.includes(`microphone`)?`microphone-unavailable`:t.includes(`network`)||t.includes(`fetch`)?`network`:t.includes(`abort`)||t.includes(`cancel`)?`aborted`:`unknown`}function Sn(){return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg`].find(e=>MediaRecorder.isTypeSupported?.(e))}function Cn(e){return e.includes(`mp4`)?`m4a`:e.includes(`ogg`)?`ogg`:e.includes(`wav`)?`wav`:`webm`}async function wn(e,t,n,r){let i=new FormData;i.append(`file`,new File([e],t,{type:e.type||`audio/webm`})),i.append(`model`,`gpt-transcribe`),i.append(`response_format`,`json`),n&&i.append(`language`,n);let a=await fetch(`${ge}/v1/audio/transcriptions`,{method:`POST`,headers:{Authorization:`Bearer ${Ce(r)}`},body:i});if(!a.ok)throw Error(`transcription request failed (${a.status})`);return(await a.json()).text?.trim()??``}var Tn=class{mediaDevices;createRecorder;transcribe;stream;recorder;callbacks;chunks=[];language=``;token=``;generation=0;aborted=!1;constructor(e=typeof navigator>`u`?void 0:navigator.mediaDevices,t=(e,t)=>new MediaRecorder(e,t),n=wn){this.mediaDevices=e,this.createRecorder=t,this.transcribe=n}async isSupported(){return!!this.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`}async start(e,t,n){await this.abort();let r=++this.generation;this.callbacks=n,this.language=e,this.token=t,this.chunks=[],this.aborted=!1;try{let e=await this.mediaDevices?.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});if(!e||r!==this.generation){e?.getTracks().forEach(e=>e.stop());return}this.stream=e;let t=Sn();this.recorder=this.createRecorder(e,t?{mimeType:t}:void 0),this.recorder.ondataavailable=e=>{r===this.generation&&e.data.size>0&&this.chunks.push(e.data)},this.recorder.start()}catch(e){let t=xn(e);throw t!==`aborted`&&n.onError(t),await this.abort(),e}}async stop(){let e=this.recorder,t=this.generation;!e||e.state===`inactive`||!this.callbacks||await new Promise(n=>{e.onstop=async()=>{if(this.releaseStream(),t!==this.generation||this.aborted||!this.callbacks)return n();let r=this.callbacks,i=e.mimeType||this.chunks[0]?.type||`audio/webm`,a=new Blob(this.chunks,{type:i});try{if(!a.size)r.onError(`no-speech`);else{let e=await this.transcribe(a,`coding-bridge-voice.${Cn(i)}`,this.language,this.token);if(t!==this.generation||this.aborted)return n();e?r.onResult({finalText:e,interimText:``}):r.onError(`no-speech`)}}catch(e){t===this.generation&&!this.aborted&&r.onError(xn(e))}finally{t===this.generation&&(this.aborted||r.onEnd(),this.reset()),n()}},e.stop()})}async abort(){this.aborted=!0,this.generation+=1;let e=this.recorder;e&&e.state!==`inactive`&&(e.ondataavailable=null,e.onstop=null,e.stop()),this.releaseStream(),this.reset()}async dispose(){await this.abort()}releaseStream(){this.stream?.getTracks().forEach(e=>e.stop()),this.stream=void 0}reset(){this.recorder=void 0,this.callbacks=void 0,this.chunks=[],this.language=``,this.token=``}};function En(){return new Tn}var Dn=50*1024*1024,Q=10,On=60,kn=60,An=80,jn={claude:{src:vn,invertOnDark:!1},codex:{src:yn,invertOnDark:!0},copilot:{src:bn,invertOnDark:!0}},Mn=y({name:`CodingBridgeSessionView`,components:{AddIcon:H,AiIcon:re,AttachmentIcon:B,CloseIcon:Y,CodeIcon:j,ConfirmIcon:A,DeveloperIcon:L,EditIcon:V,ExpandDownIcon:ie,FileIcon:N,FolderOpenIcon:Ne,HistoryIcon:F,MicrophoneIcon:le,MoreIcon:M,PerformanceIcon:P,RedoIcon:U,SecurityIcon:fe,StopIcon:pe,UpIcon:k,ViewIcon:oe,ElInput:q,ElButton:J,ElPopover:O,ElDropdown:D,ElDropdownMenu:E,ElDropdownItem:T,ElUpload:b,ElCheckbox:C,ElSkeleton:te,ElSkeletonItem:ee,TranscriptItem:Bt,ThinkingIndicator:Zt,ComposerSettings:nn,DirectoryDialog:_n,AskUserQuestionCard:De,CopyToClipboard:Te},mixins:[Se,we],emits:[`history`,`devices`],data(){return{prompt:``,cwd:``,model:``,customModelDraft:``,permissionMode:`bypassPermissions`,provider:`claude`,effort:``,directoryVisible:!1,moreOpen:!1,mobileSettings:!1,settingsMql:void 0,slashMenuOpen:!1,slashActiveIndex:0,editingEventId:``,restoreCode:!1,attachmentFileList:[],uploadUrl:ve()+`/api/v1/files/`,maxAttachments:Q,visibleCount:On,pinnedToBottom:!0,scrollPending:!1,transcriptObserver:void 0,observedTranscript:void 0,speechController:void 0,speechSupported:!1,speechState:`idle`,speechBasePrompt:``,speechFinalText:``,speechInterimText:``}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},lastComposer(){let e=this.currentNodeId;return(e?this.$store.state.codingBridge?.lastComposer?.[e]:void 0)??{}},currentNode(){return this.$store.state.codingBridge?.nodes?.find(e=>e.node_id===this.currentNodeId)},nodeOnline(){return this.currentNode?.status===`online`},currentSessionId(){return this.$store.state.codingBridge?.currentSessionId},currentSession(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.sessions?.[e]:void 0},events(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.events?.[e]??[]:[]},eventCount(){return this.events.length},visibleEvents(){let e=this.events;return e.length>this.visibleCount?e.slice(-this.visibleCount):e},hiddenEventCount(){return Math.max(0,this.events.length-this.visibleCount)},historyLoading(){return this.$store.state.codingBridge?.status?.getHistoryDetail===x.Request},pendingQuestion(){let e=this.currentSessionId;if(!e)return;let t=(this.$store.state.codingBridge?.permissions??[]).find(t=>t.session_id===e&&nt(t));return t?{request_id:t.request_id,payload:rt(t)}:void 0},isNewSession(){return!this.currentSessionId},canPickCwd(){return this.isNewSession||!this.currentSession?.started},readonly(){return this.currentSession?.readonly===!0},resumeHint(){return!!this.currentSession?.provider&&!this.currentSession?.started&&!this.readonly},replayLabel(){return!this.currentSession?.provider||this.currentSession?.started?``:this.currentSession.provider===`codex`?this.$t(`codingBridge.history.codexLabel`):this.currentSession.provider===`claude`?this.$t(`codingBridge.history.claudeLabel`):this.providerName(this.currentSession.provider)},running(){let e=this.currentSession?.status;return e===`running`||e===`starting`},thinking(){return this.running&&!this.pendingQuestion},connected(){return this.$store.state.codingBridge?.connection===`connected`},canRetry(){return this.currentSession?.status===`error`&&!this.readonly&&this.connected&&this.nodeOnline&&this.events.some(e=>e.kind===`prompt`)},attachments(){return(this.attachmentFileList||[]).map(e=>{let t=e.response?.file_url||(typeof e.url==`string`&&!e.url.startsWith(`blob:`)?e.url:``);if(!t)return;let n=e.raw,r=n?.type||e.mime_type||``;return{type:this.isImageAttachment(e)?`image`:`file`,url:t,name:e.name,mime_type:r,size:n?.size}}).filter(e=>!!e)},uploadingAttachments(){return(this.attachmentFileList||[]).some(e=>this.isAttachmentUploading(e))},speechActive(){return this.speechState!==`idle`},canSend(){return(!!this.prompt.trim()||this.attachments.length>0)&&!this.uploadingAttachments&&!this.speechActive&&this.connected&&this.nodeOnline},composerHint(){return this.speechState===`stopping`?this.$t(`codingBridge.session.voiceStopping`):this.speechState===`listening`?this.$t(`codingBridge.session.voiceListening`):this.uploadingAttachments?this.$t(`codingBridge.session.uploadingAttachment`):this.providerCaps.length&&!this.currentProviderAvailable?this.$t(`codingBridge.session.providerUnavailableHint`,{name:this.providerName(this.provider)}):this.resumeHint?this.$t(`codingBridge.history.resumeHint`):this.$t(`codingBridge.session.enterHint`)},nodeCapabilities(){let e=this.currentNodeId;return e?this.$store.state.codingBridge?.capabilities?.[e]:void 0},providerCaps(){return this.nodeCapabilities?.providers??[]},currentProviderCap(){return this.providerCaps.find(e=>e.name===this.provider)},canEdit(){return this.readonly?!1:!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_edit},canRestoreCode(){return!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_code_restore},editingActive(){return!!this.editingEventId},currentProviderAvailable(){return this.providerCaps.length?this.currentProviderCap?.available!==!1:!0},providerOptions(){return this.providerCaps.length?this.providerCaps.map(e=>({value:e.name,label:e.label,available:e.available!==!1})):[{label:this.$t(`codingBridge.session.providerClaude`),value:`claude`,available:!0},{label:this.$t(`codingBridge.session.providerCodex`),value:`codex`,available:!0},{label:`GitHub Copilot`,value:`copilot`,available:!0}]},modelOptions(){return this.currentProviderCap?.models??[]},allowCustomModel(){return this.currentProviderCap?.allow_custom_model??!0},effortOptions(){let e=this.currentProviderCap?.efforts;return(e&&e.length?e:[``]).map(e=>({value:e,label:this.effortLabel(e)}))},permissionModeOptions(){let e=this.currentProviderCap?.permission_modes;return(e&&e.length?e:[`default`,`acceptEdits`,`plan`,`bypassPermissions`]).map(e=>({value:e,label:this.permissionModeLabel(e)}))},sessionMeta(){let e=this.currentSession;if(!e)return``;let t=[];return e.provider&&t.push(this.providerName(e.provider)),e.cwd&&t.push(e.cwd),e.model&&t.push(e.model),t.join(` · `)},activeProviderName(){return this.currentSession?.provider||this.provider},slashCommands(){let e=this.activeProviderName;return this.providerCaps.find(t=>t.name===e)?.commands??[]},slashMatches(){let e=this.prompt.match(/^\/(\S*)$/);if(!e)return[];let t=e[1].toLowerCase();return this.slashCommands.filter(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t)))},slashMenuVisible(){return this.slashMenuOpen&&this.slashMatches.length>0},diagnostics(){let e=[];return this.currentNodeId&&e.push({label:this.$t(`codingBridge.session.nodeId`),value:this.currentNodeId}),this.currentSessionId&&e.push({label:this.$t(`codingBridge.session.sessionId`),value:this.currentSessionId}),this.currentSession?.trace_id&&e.push({label:this.$t(`codingBridge.session.traceId`),value:this.currentSession.trace_id}),e}},watch:{eventCount(){this.scrollToBottom()},pendingQuestion(){this.scrollToBottom()},thinking(){this.scrollToBottom()},currentSessionId(){this.cancelSpeechRecognition?.(),this.pinnedToBottom=!0,this.scrollToBottom(),this.visibleCount=On,this.editingEventId=``,this.restoreCode=!1,this.syncSessionSettings()},currentNodeId(){this.cancelSpeechRecognition?.(),this.requestCapabilities(),this.isNewSession&&this.restoreComposerPrefs()},nodeOnline(e){e||this.cancelSpeechRecognition?.()},providerCaps(){if(!this.isNewSession||!this.providerCaps.length)return;let e=this.providerCaps.find(e=>e.name===this.provider);if(!e||e.available===!1){let e=this.providerCaps.find(e=>e.available!==!1);e&&(this.provider=e.name)}},provider(){this.isNewSession&&(this.model=``,this.effort=``)},prompt(e){this.slashMenuOpen=/^\/\S*$/.test(e),this.slashActiveIndex>=this.slashMatches.length&&(this.slashActiveIndex=0)}},mounted(){this.requestCapabilities(),this.syncSessionSettings(),this.scrollToBottom(),this.observeTranscript(),this.watchSettingsBreakpoint(),this.initializeSpeechRecognition?.()},updated(){this.observeTranscript()},beforeUnmount(){this.transcriptObserver?.disconnect(),this.transcriptObserver=void 0,this.observedTranscript=void 0,this.settingsMql?.removeEventListener(`change`,this.onSettingsBreakpoint),this.settingsMql=void 0,this.speechController?.dispose(),this.speechController=void 0},methods:{async initializeSpeechRecognition(){let e=En();this.speechController=e,this.speechSupported=await e.isSupported()},async toggleSpeechRecognition(){if(this.speechState===`listening`){await this.stopSpeechRecognition();return}this.speechState===`idle`&&await this.startSpeechRecognition()},async startSpeechRecognition(){if(!this.speechController||!this.speechSupported)return;let e=await this.ensureSpeechCredential();if(!e){S.error(this.$t(`codingBridge.session.voiceError`));return}this.speechBasePrompt=this.prompt,this.speechFinalText=``,this.speechInterimText=``,this.speechState=`listening`;try{await this.speechController.start(this.$i18n.locale,e,{onResult:this.applySpeechSnapshot,onEnd:this.finishSpeechRecognition,onError:this.handleSpeechError})}catch{this.finishSpeechRecognition()}},async ensureSpeechCredential(){let e=this.$store.state.openaiimage?.credential?.token;if(e)return e;await this.$store.dispatch(`openaiimage/getService`);let t=await this.$store.dispatch(`openaiimage/getApplications`),n=ye([...this.$store.state.applications??[],...t??[]],this.$store.state.openaiimage?.application);return n&&await this.$store.dispatch(`openaiimage/setApplication`,n),e=this.$store.state.openaiimage?.credential?.token,e??``},async stopSpeechRecognition(){if(!(!this.speechController||this.speechState!==`listening`)){this.speechState=`stopping`;try{await this.speechController.stop()}catch{this.handleSpeechError(`unknown`),this.finishSpeechRecognition()}}},async cancelSpeechRecognition(){!this.speechController||this.speechState===`idle`||(this.speechState=`idle`,this.speechInterimText=``,this.applySpeechPrompt(),await this.speechController.abort())},applySpeechSnapshot(e){this.speechState!==`idle`&&(this.speechFinalText=e.finalText,this.speechInterimText=e.interimText,this.applySpeechPrompt())},applySpeechPrompt(){let e=`${this.speechFinalText}${this.speechInterimText}`,t=this.speechBasePrompt&&e?`
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,ot as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{t as b}from"./upload-DPM3VJNR.js";import{h as x,v as S}from"./models-qt9s4QBH.js";import{t as C}from"./checkbox-DXMDpaxv.js";import{t as w}from"./drawer-KN1LRowH.js";import{n as T,r as E,t as D}from"./dropdown-_LBWBf-Y.js";import{t as O}from"./popover-PJLeQqI9.js";import{n as ee,t as te}from"./skeleton-Dj_a_iIP.js";import{t as ne}from"./arrow-right-B8UUyzYE.js";import{t as k}from"./arrow-up-CPa1E8_P.js";import{t as re}from"./brain-BCdV44ve.js";import{t as A}from"./check-C8mVEur2.js";import{t as ie}from"./chevron-down-C9d0FXRE.js";import{t as ae}from"./clipboard-list-D7AvBFtP.js";import{t as j}from"./code-Pa0xuy7_.js";import{t as M}from"./ellipsis-CQoyd1U8.js";import{t as oe}from"./eye-C9gPEb69.js";import{t as se}from"./file-text-CTEvw_kE.js";import{t as N}from"./file-hh1eR7jk.js";import{t as ce}from"./folder-DMqgztyI.js";import{t as P}from"./gauge-BqFWKACq.js";import{t as F}from"./history-DNd_c346.js";import{t as I}from"./info-BWyB8juG.js";import{t as L}from"./laptop-B4VpgJZX.js";import{t as R}from"./link-CBFmk5Ee.js";import{t as z}from"./loader-circle-BOHt8R3r.js";import{t as le}from"./mic-BIEMJL96.js";import{t as ue}from"./monitor-BYunWSkl.js";import{t as B}from"./paperclip-x387dn2o.js";import{t as V}from"./pencil-ppJ1ler-.js";import{t as H}from"./plus-DO3XunBM.js";import{t as U}from"./rotate-cw-BXhODUI7.js";import{t as de}from"./search-68wZrrVQ.js";import{t as fe}from"./shield-7wMqeCnl.js";import{t as pe}from"./square-OTIXmfWE.js";import{t as me}from"./terminal-DVkZFQop.js";import{t as he}from"./trash-2-Bgi3IwhR.js";import{ba as ge}from"./constants-CmC-0Hwp.js";import{O as _e}from"./i18n-BQrNxKw9.js";import{A as W,Ba as G,Ka as K,La as ve,Sn as ye,Tn as be,Va as xe,ct as Se,lo as q,ra as Ce,st as we,to as J,za as Y}from"./index-BDrhpCy4.js";import"./vendor-highlight-BHrfT4-E.js";import{t as Te}from"./CopyToClipboard-sz0qw-Lr.js";import{t as Ee}from"./VueMarkdown-CiiRjbWs.js";import{t as De}from"./AskUserQuestionCard-Stu32_7A.js";import{s as Oe,t as ke}from"./codingBridgeNotify-DrZu58pn.js";import{t as Ae}from"./CodeSnippet-DoIoonBw.js";var je=G(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),Me=G(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Ne=G(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Pe=y({name:`CodingBridgeNotificationToggle`,components:{LoadingIcon:z,NotificationIcon:Me,NotificationOffIcon:je,ElButton:J},data(){return{enabled:!1,busy:!1}},computed:{supported(){return _e()||Oe()}},mounted(){this.enabled=!_e()&&ke()===`granted`},methods:{async onToggle(){this.busy=!0;try{if(this.enabled){await this.$store.dispatch(`codingBridge/disableNotifications`),this.enabled=!1,S.success(this.$t(`codingBridge.notify.disabled`));return}let e=await this.$store.dispatch(`codingBridge/enableNotifications`);e===`enabled`?(this.enabled=!0,S.success(this.$t(`codingBridge.notify.enabled`))):e===`denied`?S.warning(this.$t(`codingBridge.notify.denied`)):S.warning(this.$t(`codingBridge.notify.unsupported`))}catch{S.error(this.$t(`codingBridge.notify.failed`))}finally{this.busy=!1}}}});function Fe(e,t,n,r,i,a){let s=u(`loading-icon`),c=u(`notification-icon`),l=u(`notification-off-icon`),d=u(`el-button`);return e.supported?(v(),p(d,{key:0,circle:``,size:`small`,type:e.enabled?`primary`:`default`,title:e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),disabled:e.busy,"aria-label":e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),onClick:e.onToggle},{default:m(()=>[e.busy?(v(),p(s,{key:0,class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):e.enabled?(v(),p(c,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(l,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`type`,`title`,`disabled`,`aria-label`,`onClick`])):o(``,!0)}var Ie=y({name:`CodingBridgeNodeList`,components:{AddIcon:H,DeleteIcon:he,DesktopIcon:ue,DeveloperIcon:L,EditIcon:V,RedoIcon:U,ElButton:J,NotificationToggle:W(Pe,[[`render`,Fe]])},emits:[`pair`],computed:{nodes(){return this.$store.state.codingBridge?.nodes??[]},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},connection(){return this.$store.state.codingBridge?.connection??`disconnected`},connectionLabel(){return this.$t(`codingBridge.connection.${this.connection}`)},connectionDotClass(){switch(this.connection){case`connected`:return`bg-[var(--el-color-success)]`;case`connecting`:return`bg-[var(--el-color-warning)]`;case`error`:return`bg-[var(--el-color-danger)]`;default:return`bg-[var(--app-text-subtle)]`}}},methods:{onSelect(e){this.$store.dispatch(`codingBridge/selectNode`,e)},onRefresh(){this.$store.dispatch(`codingBridge/getNodes`)},async onRename(e){let t;try{t=((await xe.prompt(this.$t(`codingBridge.nodeList.renamePrompt`),this.$t(`codingBridge.nodeList.rename`),{confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`),inputValue:e.name,inputValidator:e=>{let t=(e??``).trim();return t?[...t].length>64?this.$t(`codingBridge.nodeList.renameTooLong`,{max:64}):!0:this.$t(`codingBridge.nodeList.renameEmpty`)}})).value??``).trim()}catch{return}if(!(!t||t===e.name))try{await this.$store.dispatch(`codingBridge/renameNode`,{nodeId:e.node_id,name:t}),S.success(this.$t(`codingBridge.nodeList.renameSuccess`))}catch{S.error(this.$t(`codingBridge.nodeList.renameFailed`))}},async onDelete(e){try{await xe.confirm(this.$t(`codingBridge.nodeList.removeConfirm`,{name:e.name}),this.$t(`codingBridge.nodeList.remove`),{confirmButtonText:this.$t(`codingBridge.nodeList.remove`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}try{await this.$store.dispatch(`codingBridge/deleteNode`,e.node_id),S.success(this.$t(`codingBridge.nodeList.removeSuccess`))}catch{S.error(this.$t(`codingBridge.nodeList.removeFailed`))}}}}),Le={class:`node-list flex flex-col h-full bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Re={class:`flex items-center justify-between px-4 py-3 border-b border-[var(--app-border-subtle)]`},ze={class:`flex items-center gap-2 font-medium`},Be={class:`flex items-center gap-1`},Ve={class:`flex items-center gap-2 px-4 py-2 text-xs border-b border-[var(--app-border-subtle)]`},He={class:`text-[var(--app-text-subtle)]`},Ue={class:`flex-1 overflow-y-auto`},We={key:0,class:`p-6 text-center text-sm text-[var(--app-text-subtle)]`},Ge={class:`mb-3`},Ke={key:1,class:`list-none m-0 p-0`},qe=[`onClick`],Je={class:`flex-1 min-w-0`},Ye={class:`flex items-center gap-2`},Xe={class:`truncate font-medium`},Ze=[`title`],Qe={class:`text-xs text-[var(--app-text-subtle)] truncate`};function $e(o,c,d,f,p,h){let _=u(`developer-icon`),y=u(`notification-toggle`),b=u(`redo-icon`),x=u(`el-button`),S=u(`add-icon`),C=u(`desktop-icon`),w=u(`edit-icon`),T=u(`delete-icon`);return v(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(o.$t(`codingBridge.nodeList.title`)),1)]),e(`div`,Be,[a(y),a(x,{circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.refresh`),title:o.$t(`codingBridge.nodeList.refresh`),onClick:o.onRefresh},{default:m(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(x,{type:`primary`,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.pair`),title:o.$t(`codingBridge.nodeList.pair`),onClick:c[0]||=e=>o.$emit(`pair`)},{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])])]),e(`div`,Ve,[e(`span`,{class:n([`inline-block w-2 h-2 rounded-full`,o.connectionDotClass])},null,2),e(`span`,He,i(o.connectionLabel),1)]),e(`div`,Ue,[o.nodes.length?(v(),s(`ul`,Ke,[(v(!0),s(l,null,g(o.nodes,r=>(v(),s(`li`,{key:r.node_id,class:n([`group flex items-center gap-3 px-4 py-3 cursor-pointer border-b border-[var(--app-border-subtle)] hover:bg-[var(--app-content-bg)]`,{"bg-[var(--app-content-bg)]":r.node_id===o.currentNodeId}]),onClick:e=>o.onSelect(r.node_id)},[a(C,{class:`text-[var(--app-text-subtle)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,Je,[e(`div`,Ye,[e(`span`,Xe,i(r.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,r.status===`online`?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`]),title:r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)},null,10,Ze)]),e(`div`,Qe,i(r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)),1)]),a(x,{class:`node-action`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.rename`),title:o.$t(`codingBridge.nodeList.rename`),onClick:t(e=>o.onRename(r),[`stop`])},{default:m(()=>[a(w,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(x,{class:`node-action`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.remove`),title:o.$t(`codingBridge.nodeList.remove`),onClick:t(e=>o.onDelete(r),[`stop`])},{default:m(()=>[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])],10,qe))),128))])):(v(),s(`div`,We,[e(`p`,Ge,i(o.$t(`codingBridge.nodeList.empty`)),1),a(x,{type:`primary`,round:``,size:`small`,onClick:c[1]||=e=>o.$emit(`pair`)},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`codingBridge.nodeList.pairFirst`)),1)]),_:1})]))])])}var et=W(Ie,[[`render`,$e],[`__scopeId`,`data-v-37e3f542`]]),tt=e=>{let t=e?.questions;return Array.isArray(t)&&t.length>0&&t.every(e=>e&&typeof e.question==`string`&&Array.isArray(e.options))},nt=e=>e?(e.tool||``).toLowerCase()===`askuserquestion`?!0:tt(e.input):!1,rt=e=>({questions:e.input?.questions??[]}),it=100,X=4e4,at=12e3,ot=6e3,st=50,ct=200,Z=(e,t)=>{if(e.length<=t)return e;let n=((e.length-t)/1024).toFixed(1);return`${e.slice(0,t)}\n\n··· +${n} KB ···`},lt=y({name:`CodingBridgeTranscriptItem`,directives:{highlight:be},components:{CloseIcon:Y,ConfirmIcon:A,EditIcon:V,FileIcon:N,InfoIcon:I,VueMarkdown:Ee,CodeSnippet:Ae,CopyToClipboard:Te},props:{event:{type:Object,required:!0},editable:{type:Boolean,default:!1}},emits:[`edit`],data(){return{renderedText:Z(this.event.text||``,X),streamTimer:0}},computed:{commandText(){let e=this.event.input;if(!e)return``;for(let t of[`command`,`cmd`,`script`]){let n=e[t];if(typeof n==`string`&&n.trim())return Z(n,ot)}return``},filePath(){let e=this.event.input;if(!e)return``;for(let t of[`file_path`,`filePath`,`path`,`notebook_path`,`filename`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return``},toolDescription(){let e=this.event.input?.description;return typeof e==`string`?e:``},toolIcon(){if(this.todoList.length)return ae;if(this.commandText)return me;let e=(this.event.tool??``).toLowerCase();return/read|cat|view/.test(e)?se:/write|edit|create|update|insert/.test(e)?V:/grep|glob|search|find|list/.test(e)?de:j},questionLines(){let e=(this.event.tool??``).toLowerCase(),t=this.event.input?.questions;return!(e===`askuserquestion`||Array.isArray(t))||!Array.isArray(t)?[]:t.filter(e=>e&&typeof e.question==`string`).map(e=>({header:typeof e.header==`string`?e.header:``,question:e.question}))},todoList(){let e=this.event.input?.todos;return!Array.isArray(e)||!(this.event.tool??``).toLowerCase().includes(`todo`)&&Object.keys(this.event.input??{}).filter(e=>e!==`todos`&&e!==`description`).length?[]:e.filter(e=>e&&typeof e.content==`string`).map(e=>({content:e.content,status:typeof e.status==`string`?e.status:`pending`,activeForm:typeof e.activeForm==`string`?e.activeForm:void 0}))},todoItems(){return this.todoList.slice(0,st).map(e=>{let t=e.status===`in_progress`&&e.activeForm?e.activeForm:e.content,n=t.length>ct?`${t.slice(0,ct)}…`:t;return e.status===`completed`?{text:n,status:`completed`,statusLabel:this.$t(`codingBridge.transcript.todoCompleted`),icon:A,iconClass:`text-[var(--el-color-success)]`,textClass:`text-[var(--app-text-subtle)] line-through`}:e.status===`in_progress`?{text:n,status:`in_progress`,statusLabel:this.$t(`codingBridge.transcript.todoInProgress`),icon:z,iconClass:`text-[var(--el-color-primary)]`,textClass:`text-[var(--app-text)] font-medium`}:{text:n,status:`pending`,statusLabel:this.$t(`codingBridge.transcript.todoPending`),icon:pe,iconClass:`text-[var(--app-text-subtle)] opacity-60`,textClass:`text-[var(--app-text-subtle)]`}})},todoProgressLabel(){let e=this.todoList.filter(e=>e.status===`completed`).length;return this.$t(`codingBridge.transcript.todoProgress`,{done:e,total:this.todoList.length})},todoProgressId(){return`cb-todo-progress-${this.event.id}`},todoOverflow(){return Math.max(0,this.todoList.length-st)},inputText(){let e=this.event.input;if(!e)return``;let t={};for(let[n,r]of Object.entries(e))n===`timeout`||n===`description`||(t[n]=r);if(Object.keys(t).length===0)return``;try{return Z(JSON.stringify(t,null,2),ot)}catch{return Z(String(e),ot)}},thinkingText(){return Z(this.event.text||``,X)},resultText(){let e=this.event.content;return typeof e==`string`&&e.length>0?e:`—`},resultDisplay(){return Z(this.resultText,at)},resultLabel(){let e=[];return this.event.is_error?e.push(this.$t(`codingBridge.transcript.turnFailed`)):e.push(this.$t(`codingBridge.transcript.turnDone`)),typeof this.event.cost_usd==`number`&&this.event.cost_usd>0&&e.push(`$${this.event.cost_usd.toFixed(4)}`),e.join(` · `)},hasAttachments(){return!!this.event.attachments?.length},noticeText(){let e=this.event.subtype,t=this.event.command;if(t){if(e===`slash_unavailable`)return this.$t(`codingBridge.notice.slashUnavailable`,{command:t});if(e===`slash_codex_unsupported`)return this.$t(`codingBridge.notice.slashCodexUnsupported`,{command:t})}return this.event.text||``}},watch:{"event.text"(){this.scheduleRender()},"event.streaming"(e){e||this.flushRender()}},beforeUnmount(){this.streamTimer&&window.clearTimeout(this.streamTimer)},methods:{scheduleRender(){if(!this.event.streaming){this.flushRender();return}this.streamTimer||=window.setTimeout(()=>{this.streamTimer=0,this.renderedText=Z(this.event.text||``,X)},it)},flushRender(){this.streamTimer&&=(window.clearTimeout(this.streamTimer),0),this.renderedText=Z(this.event.text||``,X)}}}),ut={key:0,class:`group flex items-end justify-end gap-1.5`},dt=[`title`,`aria-label`],ft={class:`max-w-[85%] rounded-lg px-3 py-2 bg-[var(--el-color-primary)] text-white whitespace-pre-wrap break-words`},pt=[`src`],mt=[`href`],ht=[`src`],gt={key:1,class:`flex h-9 w-9 items-center justify-center rounded bg-white/15`},_t={class:`min-w-0 truncate`},vt={key:2},yt={key:2,class:`whitespace-pre-wrap break-words italic text-[var(--app-text-subtle)] border-l-2 border-[var(--app-border-subtle)] pl-3`},bt={key:3,class:`overflow-hidden rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)]`},xt={class:`flex items-center gap-2 px-2.5 py-1.5 font-medium text-[var(--app-text-subtle)]`},St={key:0,class:`min-w-0 truncate text-xs font-normal opacity-70`},Ct={key:0,class:`flex flex-col gap-1.5 px-2.5 pb-2`},wt={key:0,class:`font-medium text-[var(--app-text)]`},Tt={class:`whitespace-pre-wrap break-words text-[var(--app-text-subtle)]`},Et={key:1,class:`px-2.5 pb-2`},Dt=[`id`],Ot=[`aria-labelledby`],kt={class:`sr-only`},At={key:0,class:`mt-1 text-xs text-[var(--app-text-subtle)]`},jt={key:2,class:`px-2.5 pb-2`},Mt={key:3,class:`px-2.5 pb-2 font-mono text-xs break-all text-[var(--app-text-subtle)]`},Nt={key:4,class:`px-2.5 pb-2`},Pt={key:0,class:`absolute right-1.5 top-1.5 z-10 rounded bg-[var(--app-content-bg)] px-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`},Ft={key:5,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)]`},It={key:6,class:`flex items-start gap-2 rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)] text-[var(--app-text-subtle)] px-3 py-2 text-xs`},Lt={class:`whitespace-pre-wrap break-words`},Rt={key:7,class:`rounded-md bg-[var(--el-color-danger-light-9)] text-[var(--el-color-danger)] px-3 py-2 whitespace-pre-wrap break-words`};function zt(t,r,c,f,m,y){let b=u(`edit-icon`),x=u(`file-icon`),S=u(`vue-markdown`),C=u(`code-snippet`),w=u(`copy-to-clipboard`),T=u(`close-icon`),E=u(`confirm-icon`),D=u(`info-icon`),O=h(`highlight`);return v(),s(`div`,{class:n([`transcript-item text-sm leading-relaxed`,`kind-${t.event.kind}`])},[t.event.kind===`prompt`?(v(),s(`div`,ut,[t.editable?(v(),s(`button`,{key:0,type:`button`,class:`cb-edit-btn opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,title:t.$t(`codingBridge.session.editPrompt`),"aria-label":t.$t(`codingBridge.session.editPrompt`),onClick:r[0]||=e=>t.$emit(`edit`,t.event)},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,dt)):o(``,!0),e(`div`,ft,[t.event.images&&t.event.images.length?(v(),s(`div`,{key:0,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text||t.hasAttachments}])},[(v(!0),s(l,null,g(t.event.images,(e,t)=>(v(),s(`img`,{key:t,src:e,class:`w-16 h-16 rounded object-cover`,alt:``},null,8,pt))),128))],2)):o(``,!0),t.hasAttachments?(v(),s(`div`,{key:1,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text}])},[(v(!0),s(l,null,g(t.event.attachments,(t,n)=>(v(),s(`a`,{key:`${t.url}-${n}`,href:t.url,target:`_blank`,rel:`noopener noreferrer`,class:`flex max-w-[220px] items-center gap-2 rounded-md bg-white/15 px-2 py-1.5 text-xs text-white hover:bg-white/20`},[t.type===`image`?(v(),s(`img`,{key:0,src:t.url,class:`h-9 w-9 rounded object-cover`,alt:``},null,8,ht)):(v(),s(`span`,gt,[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,_t,i(t.name||t.url),1)],8,mt))),128))],2)):o(``,!0),t.event.text?(v(),s(`span`,vt,i(t.event.text),1)):o(``,!0)])])):t.event.kind===`text`?(v(),s(`div`,{key:1,class:n([`cb-stream-text`,{"is-streaming":t.event.streaming}])},[d(a(S,{source:t.renderedText,class:`markdown-body bg-transparent text-[var(--app-text)]`},null,8,[`source`]),[[O]])],2)):t.event.kind===`thinking`?(v(),s(`div`,yt,i(t.thinkingText),1)):t.event.kind===`tool_use`?(v(),s(`div`,bt,[e(`div`,xt,[(v(),p(_(t.toolIcon),{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.event.tool),1),t.toolDescription?(v(),s(`span`,St,i(t.toolDescription),1)):o(``,!0)]),t.questionLines.length?(v(),s(`div`,Ct,[(v(!0),s(l,null,g(t.questionLines,(t,n)=>(v(),s(`div`,{key:n,class:`rounded border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-2.5 py-1.5 text-xs`},[t.header?(v(),s(`div`,wt,i(t.header),1)):o(``,!0),e(`div`,Tt,i(t.question),1)]))),128))])):t.todoItems.length?(v(),s(`div`,Et,[e(`div`,{id:t.todoProgressId,class:`mb-1.5 text-xs text-[var(--app-text-subtle)]`},i(t.todoProgressLabel),9,Dt),e(`ul`,{class:`flex flex-col gap-1`,"aria-labelledby":t.todoProgressId},[(v(!0),s(l,null,g(t.todoItems,(t,r)=>(v(),s(`li`,{key:r,class:`flex items-start gap-2 text-xs`},[(v(),p(_(t.icon),{class:n([`mt-0.5 flex-none`,t.iconClass]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])),e(`span`,kt,i(t.statusLabel),1),e(`span`,{class:n([`min-w-0 break-words`,t.textClass])},i(t.text),3)]))),128))],8,Ot),t.todoOverflow?(v(),s(`div`,At,i(t.$t(`codingBridge.transcript.todoOverflow`,{count:t.todoOverflow})),1)):o(``,!0)])):t.commandText?(v(),s(`div`,jt,[a(C,{code:t.commandText,lang:`bash`,copyable:``},null,8,[`code`])])):t.filePath?(v(),s(`div`,Mt,i(t.filePath),1)):t.inputText?(v(),s(`div`,Nt,[a(C,{code:t.inputText,lang:`json`,copyable:``},null,8,[`code`])])):o(``,!0)])):t.event.kind===`tool_result`?(v(),s(`div`,{key:4,class:n([`group relative overflow-hidden rounded-md`,t.event.is_error?`bg-[var(--el-color-danger-light-9)]`:`bg-[var(--app-sidebar-bg)]`])},[t.event.content?(v(),s(`div`,Pt,[a(w,{content:t.resultText},null,8,[`content`])])):o(``,!0),e(`pre`,{class:n([`m-0 max-h-72 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-xs`,t.event.is_error?`text-[var(--el-color-danger)]`:`text-[var(--app-text-subtle)]`])},i(t.resultDisplay),3)],2)):t.event.kind===`result`?(v(),s(`div`,Ft,[t.event.is_error?(v(),p(T,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(E,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.resultLabel),1)])):t.event.kind===`notice`?(v(),s(`div`,It,[a(D,{class:`mt-0.5 flex-none text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Lt,i(t.noticeText),1)])):t.event.kind===`error`?(v(),s(`div`,Rt,i(t.event.text),1)):o(``,!0)],2)}var Bt=W(lt,[[`render`,zt],[`__scopeId`,`data-v-f71fa078`]]),Vt=`Pondering.Noodling.Conjuring.Brewing.Cooking.Crafting.Churning.Simmering.Percolating.Ruminating.Musing.Marinating.Synthesizing.Computing.Hatching.Forging.Vibing.Working.Thinking.Cogitating.Mulling.Stewing.Tinkering.Wrangling.Spinning.Reticulating.Manifesting.Deliberating`.split(`.`),Ht=[`思考中`,`酝酿中`,`沉思中`,`推敲中`,`构思中`,`计算中`,`琢磨中`,`捣鼓中`,`炼制中`,`召唤中`,`编织中`,`烹饪中`,`咀嚼中`,`盘算中`,`发酵中`,`运转中`,`冥想中`,`鼓捣中`,`熬制中`,`神游中`,`演算中`,`雕琢中`,`头脑风暴中`,`反复斟酌中`],Ut=60,Wt=1500,Gt=28,Kt=y({name:`CodingBridgeThinkingIndicator`,components:{LoadingIcon:z},data(){return{display:``,elapsed:0,charIndex:0,phase:`typing`,currentWord:``,elapsedTimer:0,typeTimer:0}},computed:{words(){return this.$i18n.locale.startsWith(`zh`)?Ht:Vt}},mounted(){this.currentWord=this.pickWord(),this.elapsedTimer=window.setInterval(()=>{this.elapsed+=1},1e3),this.scheduleType(Ut)},beforeUnmount(){window.clearInterval(this.elapsedTimer),window.clearTimeout(this.typeTimer)},methods:{pickWord(){let e=this.words;if(e.length<=1)return e[0]??``;let t=this.currentWord;for(;t===this.currentWord;)t=e[Math.floor(Math.random()*e.length)];return t},scheduleType(e){this.typeTimer=window.setTimeout(this.advance,e)},advance(){let e=this.currentWord;this.phase===`typing`?(this.charIndex+=1,this.display=e.slice(0,this.charIndex),this.charIndex>=e.length?(this.phase=`holding`,this.scheduleType(Wt)):this.scheduleType(Ut)):this.phase===`holding`?(this.phase=`deleting`,this.scheduleType(Gt)):(--this.charIndex,this.display=e.slice(0,Math.max(0,this.charIndex)),this.charIndex<=0?(this.currentWord=this.pickWord(),this.phase=`typing`,this.scheduleType(Ut)):this.scheduleType(Gt))}}}),qt={class:`cb-thinking flex items-center gap-2 text-sm text-[var(--app-text-subtle)] py-1`},Jt={class:`cb-thinking__word`},Yt={class:`cb-thinking__elapsed tabular-nums opacity-60`};function Xt(t,n,o,c,l,d){let f=u(`loading-icon`);return v(),s(`div`,qt,[a(f,{class:`cb-thinking__spinner adc-icon-spin text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Jt,[r(i(t.display),1),n[0]||=e(`span`,{class:`cb-thinking__caret`},`▋`,-1)]),e(`span`,Yt,`(`+i(t.elapsed)+`s)`,1)])}var Zt=W(Kt,[[`render`,Xt],[`__scopeId`,`data-v-ae116215`]]),Qt=y({name:`CodingBridgeComposerSettings`,components:{ElButton:J,ElDialog:K},props:{dialog:{type:Boolean,default:!1},open:{type:Boolean,default:!1}},emits:[`update:open`]}),$t={key:0,class:`cb-settings-inline`},en={class:`cb-settings-rows`};function tn(t,n,o,c,l,d){let h=u(`el-button`),g=u(`el-dialog`);return t.dialog?(v(),p(g,{key:1,"model-value":t.open,title:t.$t(`codingBridge.session.settings`),width:`min(420px, 92vw)`,"align-center":``,"append-to-body":``,class:`cb-settings-dialog`,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:open`,e)},{footer:m(()=>[a(h,{type:`primary`,round:``,onClick:n[0]||=e=>t.$emit(`update:open`,!1)},{default:m(()=>[r(i(t.$t(`common.button.close`)),1)]),_:1})]),default:m(()=>[e(`div`,en,[f(t.$slots,`default`,{},void 0,!0)])]),_:3},8,[`model-value`,`title`])):(v(),s(`div`,$t,[f(t.$slots,`default`,{},void 0,!0)]))}var nn=W(Qt,[[`render`,tn],[`__scopeId`,`data-v-20aa7356`]]),rn=y({name:`CodingBridgeDirectoryDialog`,components:{ContinueIcon:ne,FileIcon:N,FolderIcon:ce,RedoIcon:U,UpIcon:k,ElDialog:K,ElButton:J,ElInput:q},props:{visible:{type:Boolean,default:!1},initialPath:{type:String,default:``}},emits:[`update:visible`,`select`],data(){return{pathInput:``}},computed:{listing(){return this.$store.state.codingBridge?.directory},loading(){return this.$store.state.codingBridge?.directoryLoading===!0},directories(){return(this.listing?.entries??[]).filter(e=>e.type===`dir`)},files(){return(this.listing?.entries??[]).filter(e=>e.type===`file`)},isEmpty(){return!!this.listing&&!this.listing.error&&(this.listing.entries??[]).length===0}},watch:{"listing.path"(e){this.pathInput=e??``}},methods:{onOpen(){this.pathInput=this.initialPath||``,this.$store.dispatch(`codingBridge/browseDir`,this.initialPath||void 0)},goPath(){let e=this.pathInput.trim();e&&this.$store.dispatch(`codingBridge/browseDir`,e)},syncPathInput(){this.pathInput=this.listing?.path??``},onVisibleChange(e){this.$emit(`update:visible`,e),e||this.$store.dispatch(`codingBridge/clearDirectory`)},openDir(e){this.$store.dispatch(`codingBridge/browseDir`,e)},goParent(){this.listing?.parent&&this.$store.dispatch(`codingBridge/browseDir`,this.listing.parent)},refresh(){this.$store.dispatch(`codingBridge/browseDir`,this.listing?.path||this.initialPath||void 0)},chooseCurrent(){this.listing&&!this.listing.error&&(this.$emit(`select`,this.listing.path),this.onVisibleChange(!1))}}}),an={class:`flex flex-col gap-2`},on={class:`flex items-center gap-2 min-w-0`},sn={class:`h-72 overflow-y-auto border border-[var(--app-border-subtle)] rounded-md divide-y divide-[var(--app-border-subtle)]`},cn={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)]`},ln={key:1,class:`h-full flex items-center justify-center text-sm text-[var(--el-color-danger)]`},un=[`onClick`],dn={class:`truncate`,dir:`ltr`},fn={class:`truncate`,dir:`ltr`},pn={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)] py-8`},mn={key:0,class:`text-[11px] text-[var(--app-text-subtle)] px-1`},hn={class:`flex items-center justify-end gap-2`};function gn(t,d,f,h,_,y){let b=u(`up-icon`),x=u(`el-button`),S=u(`continue-icon`),C=u(`el-input`),w=u(`redo-icon`),T=u(`folder-icon`),E=u(`file-icon`),D=u(`el-dialog`);return v(),p(D,{"model-value":t.visible,title:t.$t(`codingBridge.directory.title`),width:`520px`,"append-to-body":``,"onUpdate:modelValue":t.onVisibleChange,onOpen:t.onOpen},{footer:m(()=>[e(`div`,hn,[a(x,{round:``,onClick:d[1]||=e=>t.onVisibleChange(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1}),a(x,{type:`primary`,round:``,disabled:!t.listing||!!t.listing.error,onClick:t.chooseCurrent},{default:m(()=>[r(i(t.$t(`codingBridge.directory.choose`)),1)]),_:1},8,[`disabled`,`onClick`])])]),default:m(()=>[e(`div`,an,[e(`div`,on,[a(x,{size:`small`,circle:``,disabled:!t.listing||!t.listing.parent||t.loading,title:t.$t(`codingBridge.directory.up`),"aria-label":t.$t(`codingBridge.directory.up`),onClick:t.goParent},{default:m(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`]),a(C,{modelValue:t.pathInput,"onUpdate:modelValue":d[0]||=e=>t.pathInput=e,size:`small`,class:`flex-1 min-w-0`,dir:`ltr`,placeholder:t.$t(`codingBridge.directory.pathPlaceholder`),disabled:t.loading,onKeyup:c(t.goPath,[`enter`]),onBlur:t.syncPathInput},{append:m(()=>[a(x,{title:t.$t(`codingBridge.directory.go`),disabled:t.loading||!t.pathInput.trim(),"aria-label":t.$t(`codingBridge.directory.go`),onClick:t.goPath},{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`disabled`,`aria-label`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`disabled`,`onKeyup`,`onBlur`]),a(x,{size:`small`,circle:``,disabled:t.loading,title:t.$t(`codingBridge.directory.refresh`),"aria-label":t.$t(`codingBridge.directory.refresh`),onClick:t.refresh},{default:m(()=>[a(w,{class:n({"adc-icon-spin":t.loading}),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])]),e(`div`,sn,[t.loading&&!t.listing?(v(),s(`div`,cn,i(t.$t(`codingBridge.directory.loading`)),1)):t.listing&&t.listing.error?(v(),s(`div`,ln,i(t.listing.error),1)):(v(),s(l,{key:2},[(v(!0),s(l,null,g(t.directories,n=>(v(),s(`button`,{key:n.path,type:`button`,class:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--app-content-hover-bg)]`,onClick:e=>t.openDir(n.path)},[a(T,{class:`text-[var(--el-color-warning)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,dn,i(n.name),1)],8,un))),128)),(v(!0),s(l,null,g(t.files,t=>(v(),s(`div`,{key:t.path,class:`w-full flex items-center gap-2 px-3 py-2 text-sm text-[var(--app-text-subtle)]`},[a(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,fn,i(t.name),1)]))),128)),t.isEmpty?(v(),s(`div`,pn,i(t.$t(`codingBridge.directory.empty`)),1)):o(``,!0)],64))]),t.listing&&t.listing.truncated?(v(),s(`p`,mn,i(t.$t(`codingBridge.directory.truncated`)),1)):o(``,!0)])]),_:1},8,[`model-value`,`title`,`onUpdate:modelValue`,`onOpen`])}var _n=W(rn,[[`render`,gn]]),vn=`data:image/svg+xml,%3csvg%20fill='%23D97757'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='m4.7144%2015.9555%204.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608%201.5179.1032%202.2767.1578%201.6514.0972%202.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973%209.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686%201.9064%201.4754%202.4893%201.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335%206.6997%200l.9957.1336.419.3642.6192%201.4147%201.0018%202.2282%201.5543%203.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853%201.8517-.5586%202.9021-.3643%201.9429h.2125l.2429-.2429.9835-1.3053%201.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759%201.1293-.34%201.1657-1.0625%201.3478-.8804%201.1414-1.2628%201.7-.7893%201.36.0729.1093.1882-.0183%202.8535-.607%201.5421-.2794%201.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607%201.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929%201.0686%202.0035%201.8092%202.5075%202.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496%202.3436%203.5214.1214%201.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38%2017.959l-1.1414-1.9428-.1397.079-.674%207.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328%201.9672-2.1796%202.9446-1.7243%201.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889%202.386-3.0357%201.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385%204.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429%201.9064-1.3114Z'/%3e%3c/svg%3e`,yn=`data:image/svg+xml,%3csvg%20fill='%23000000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.676l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v2.999l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e`,bn=`data:image/svg+xml,%3csvg%20fill='%23000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%20Copilot%3c/title%3e%3cpath%20d='M23.922%2016.997C23.061%2018.492%2018.063%2022.02%2012%2022.02%205.937%2022.02.939%2018.492.078%2016.997A.641.641%200%200%201%200%2016.741v-2.869a.883.883%200%200%201%20.053-.22c.372-.935%201.347-2.292%202.605-2.656.167-.429.414-1.055.644-1.517a10.098%2010.098%200%200%201-.052-1.086c0-1.331.282-2.499%201.132-3.368.397-.406.89-.717%201.474-.952C7.255%202.937%209.248%201.98%2011.978%201.98c2.731%200%204.767.957%206.166%202.093.584.235%201.077.546%201.474.952.85.869%201.132%202.037%201.132%203.368%200%20.368-.014.733-.052%201.086.23.462.477%201.088.644%201.517%201.258.364%202.233%201.721%202.605%202.656a.841.841%200%200%201%20.053.22v2.869a.641.641%200%200%201-.078.256Zm-11.75-5.992h-.344a4.359%204.359%200%200%201-.355.508c-.77.947-1.918%201.492-3.508%201.492-1.725%200-2.989-.359-3.782-1.259a2.137%202.137%200%200%201-.085-.104L4%2011.746v6.585c1.435.779%204.514%202.179%208%202.179%203.486%200%206.565-1.4%208-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057%201.259-3.782%201.259-1.59%200-2.738-.545-3.508-1.492a4.359%204.359%200%200%201-.355-.508Zm2.328%203.25c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm-5%200c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm3.313-6.185c.136%201.057.403%201.913.878%202.497.442.544%201.134.938%202.344.938%201.573%200%202.292-.337%202.657-.751.384-.435.558-1.15.558-2.361%200-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438%201.578v.021c0%20.265.021.562.063.893Zm-1.626%200c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824%201.025-.462.472-.705%201.179-.705%202.319%200%201.211.175%201.926.558%202.361.365.414%201.084.751%202.657.751%201.21%200%201.902-.394%202.344-.938.475-.584.742-1.44.878-2.497Z'/%3e%3c/svg%3e`;function xn(e){let t=(e instanceof Error?`${e.name} ${e.message}`:String(e??``)).toLowerCase().replaceAll(`_`,`-`);return t.includes(`notallowed`)||t.includes(`not-allowed`)||t.includes(`permission`)?`permission-denied`:t.includes(`notfound`)||t.includes(`not-found`)||t.includes(`audio-capture`)||t.includes(`microphone`)?`microphone-unavailable`:t.includes(`network`)||t.includes(`fetch`)?`network`:t.includes(`abort`)||t.includes(`cancel`)?`aborted`:`unknown`}function Sn(){return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg`].find(e=>MediaRecorder.isTypeSupported?.(e))}function Cn(e){return e.includes(`mp4`)?`m4a`:e.includes(`ogg`)?`ogg`:e.includes(`wav`)?`wav`:`webm`}async function wn(e,t,n,r){let i=new FormData;i.append(`file`,new File([e],t,{type:e.type||`audio/webm`})),i.append(`model`,`gpt-transcribe`),i.append(`response_format`,`json`),n&&i.append(`language`,n);let a=await fetch(`${ge}/v1/audio/transcriptions`,{method:`POST`,headers:{Authorization:`Bearer ${Ce(r)}`},body:i});if(!a.ok)throw Error(`transcription request failed (${a.status})`);return(await a.json()).text?.trim()??``}var Tn=class{mediaDevices;createRecorder;transcribe;stream;recorder;callbacks;chunks=[];language=``;token=``;generation=0;aborted=!1;constructor(e=typeof navigator>`u`?void 0:navigator.mediaDevices,t=(e,t)=>new MediaRecorder(e,t),n=wn){this.mediaDevices=e,this.createRecorder=t,this.transcribe=n}async isSupported(){return!!this.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`}async start(e,t,n){await this.abort();let r=++this.generation;this.callbacks=n,this.language=e,this.token=t,this.chunks=[],this.aborted=!1;try{let e=await this.mediaDevices?.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});if(!e||r!==this.generation){e?.getTracks().forEach(e=>e.stop());return}this.stream=e;let t=Sn();this.recorder=this.createRecorder(e,t?{mimeType:t}:void 0),this.recorder.ondataavailable=e=>{r===this.generation&&e.data.size>0&&this.chunks.push(e.data)},this.recorder.start()}catch(e){let t=xn(e);throw t!==`aborted`&&n.onError(t),await this.abort(),e}}async stop(){let e=this.recorder,t=this.generation;!e||e.state===`inactive`||!this.callbacks||await new Promise(n=>{e.onstop=async()=>{if(this.releaseStream(),t!==this.generation||this.aborted||!this.callbacks)return n();let r=this.callbacks,i=e.mimeType||this.chunks[0]?.type||`audio/webm`,a=new Blob(this.chunks,{type:i});try{if(!a.size)r.onError(`no-speech`);else{let e=await this.transcribe(a,`coding-bridge-voice.${Cn(i)}`,this.language,this.token);if(t!==this.generation||this.aborted)return n();e?r.onResult({finalText:e,interimText:``}):r.onError(`no-speech`)}}catch(e){t===this.generation&&!this.aborted&&r.onError(xn(e))}finally{t===this.generation&&(this.aborted||r.onEnd(),this.reset()),n()}},e.stop()})}async abort(){this.aborted=!0,this.generation+=1;let e=this.recorder;e&&e.state!==`inactive`&&(e.ondataavailable=null,e.onstop=null,e.stop()),this.releaseStream(),this.reset()}async dispose(){await this.abort()}releaseStream(){this.stream?.getTracks().forEach(e=>e.stop()),this.stream=void 0}reset(){this.recorder=void 0,this.callbacks=void 0,this.chunks=[],this.language=``,this.token=``}};function En(){return new Tn}var Dn=50*1024*1024,Q=10,On=60,kn=60,An=80,jn={claude:{src:vn,invertOnDark:!1},codex:{src:yn,invertOnDark:!0},copilot:{src:bn,invertOnDark:!0}},Mn=y({name:`CodingBridgeSessionView`,components:{AddIcon:H,AiIcon:re,AttachmentIcon:B,CloseIcon:Y,CodeIcon:j,ConfirmIcon:A,DeveloperIcon:L,EditIcon:V,ExpandDownIcon:ie,FileIcon:N,FolderOpenIcon:Ne,HistoryIcon:F,MicrophoneIcon:le,MoreIcon:M,PerformanceIcon:P,RedoIcon:U,SecurityIcon:fe,StopIcon:pe,UpIcon:k,ViewIcon:oe,ElInput:q,ElButton:J,ElPopover:O,ElDropdown:D,ElDropdownMenu:E,ElDropdownItem:T,ElUpload:b,ElCheckbox:C,ElSkeleton:te,ElSkeletonItem:ee,TranscriptItem:Bt,ThinkingIndicator:Zt,ComposerSettings:nn,DirectoryDialog:_n,AskUserQuestionCard:De,CopyToClipboard:Te},mixins:[Se,we],emits:[`history`,`devices`],data(){return{prompt:``,cwd:``,model:``,customModelDraft:``,permissionMode:`bypassPermissions`,provider:`claude`,effort:``,directoryVisible:!1,moreOpen:!1,mobileSettings:!1,settingsMql:void 0,slashMenuOpen:!1,slashActiveIndex:0,editingEventId:``,restoreCode:!1,attachmentFileList:[],uploadUrl:ve()+`/api/v1/files/`,maxAttachments:Q,visibleCount:On,pinnedToBottom:!0,scrollPending:!1,transcriptObserver:void 0,observedTranscript:void 0,speechController:void 0,speechSupported:!1,speechState:`idle`,speechBasePrompt:``,speechFinalText:``,speechInterimText:``}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},lastComposer(){let e=this.currentNodeId;return(e?this.$store.state.codingBridge?.lastComposer?.[e]:void 0)??{}},currentNode(){return this.$store.state.codingBridge?.nodes?.find(e=>e.node_id===this.currentNodeId)},nodeOnline(){return this.currentNode?.status===`online`},currentSessionId(){return this.$store.state.codingBridge?.currentSessionId},currentSession(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.sessions?.[e]:void 0},events(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.events?.[e]??[]:[]},eventCount(){return this.events.length},visibleEvents(){let e=this.events;return e.length>this.visibleCount?e.slice(-this.visibleCount):e},hiddenEventCount(){return Math.max(0,this.events.length-this.visibleCount)},historyLoading(){return this.$store.state.codingBridge?.status?.getHistoryDetail===x.Request},pendingQuestion(){let e=this.currentSessionId;if(!e)return;let t=(this.$store.state.codingBridge?.permissions??[]).find(t=>t.session_id===e&&nt(t));return t?{request_id:t.request_id,payload:rt(t)}:void 0},isNewSession(){return!this.currentSessionId},canPickCwd(){return this.isNewSession||!this.currentSession?.started},readonly(){return this.currentSession?.readonly===!0},resumeHint(){return!!this.currentSession?.provider&&!this.currentSession?.started&&!this.readonly},replayLabel(){return!this.currentSession?.provider||this.currentSession?.started?``:this.currentSession.provider===`codex`?this.$t(`codingBridge.history.codexLabel`):this.currentSession.provider===`claude`?this.$t(`codingBridge.history.claudeLabel`):this.providerName(this.currentSession.provider)},running(){let e=this.currentSession?.status;return e===`running`||e===`starting`},thinking(){return this.running&&!this.pendingQuestion},connected(){return this.$store.state.codingBridge?.connection===`connected`},canRetry(){return this.currentSession?.status===`error`&&!this.readonly&&this.connected&&this.nodeOnline&&this.events.some(e=>e.kind===`prompt`)},attachments(){return(this.attachmentFileList||[]).map(e=>{let t=e.response?.file_url||(typeof e.url==`string`&&!e.url.startsWith(`blob:`)?e.url:``);if(!t)return;let n=e.raw,r=n?.type||e.mime_type||``;return{type:this.isImageAttachment(e)?`image`:`file`,url:t,name:e.name,mime_type:r,size:n?.size}}).filter(e=>!!e)},uploadingAttachments(){return(this.attachmentFileList||[]).some(e=>this.isAttachmentUploading(e))},speechActive(){return this.speechState!==`idle`},canSend(){return(!!this.prompt.trim()||this.attachments.length>0)&&!this.uploadingAttachments&&!this.speechActive&&this.connected&&this.nodeOnline},composerHint(){return this.speechState===`stopping`?this.$t(`codingBridge.session.voiceStopping`):this.speechState===`listening`?this.$t(`codingBridge.session.voiceListening`):this.uploadingAttachments?this.$t(`codingBridge.session.uploadingAttachment`):this.providerCaps.length&&!this.currentProviderAvailable?this.$t(`codingBridge.session.providerUnavailableHint`,{name:this.providerName(this.provider)}):this.resumeHint?this.$t(`codingBridge.history.resumeHint`):this.$t(`codingBridge.session.enterHint`)},nodeCapabilities(){let e=this.currentNodeId;return e?this.$store.state.codingBridge?.capabilities?.[e]:void 0},providerCaps(){return this.nodeCapabilities?.providers??[]},currentProviderCap(){return this.providerCaps.find(e=>e.name===this.provider)},canEdit(){return this.readonly?!1:!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_edit},canRestoreCode(){return!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_code_restore},editingActive(){return!!this.editingEventId},currentProviderAvailable(){return this.providerCaps.length?this.currentProviderCap?.available!==!1:!0},providerOptions(){return this.providerCaps.length?this.providerCaps.map(e=>({value:e.name,label:e.label,available:e.available!==!1})):[{label:this.$t(`codingBridge.session.providerClaude`),value:`claude`,available:!0},{label:this.$t(`codingBridge.session.providerCodex`),value:`codex`,available:!0},{label:`GitHub Copilot`,value:`copilot`,available:!0}]},modelOptions(){return this.currentProviderCap?.models??[]},allowCustomModel(){return this.currentProviderCap?.allow_custom_model??!0},effortOptions(){let e=this.currentProviderCap?.efforts;return(e&&e.length?e:[``]).map(e=>({value:e,label:this.effortLabel(e)}))},permissionModeOptions(){let e=this.currentProviderCap?.permission_modes;return(e&&e.length?e:[`default`,`acceptEdits`,`plan`,`bypassPermissions`]).map(e=>({value:e,label:this.permissionModeLabel(e)}))},sessionMeta(){let e=this.currentSession;if(!e)return``;let t=[];return e.provider&&t.push(this.providerName(e.provider)),e.cwd&&t.push(e.cwd),e.model&&t.push(e.model),t.join(` · `)},activeProviderName(){return this.currentSession?.provider||this.provider},slashCommands(){let e=this.activeProviderName;return this.providerCaps.find(t=>t.name===e)?.commands??[]},slashMatches(){let e=this.prompt.match(/^\/(\S*)$/);if(!e)return[];let t=e[1].toLowerCase();return this.slashCommands.filter(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t)))},slashMenuVisible(){return this.slashMenuOpen&&this.slashMatches.length>0},diagnostics(){let e=[];return this.currentNodeId&&e.push({label:this.$t(`codingBridge.session.nodeId`),value:this.currentNodeId}),this.currentSessionId&&e.push({label:this.$t(`codingBridge.session.sessionId`),value:this.currentSessionId}),this.currentSession?.trace_id&&e.push({label:this.$t(`codingBridge.session.traceId`),value:this.currentSession.trace_id}),e}},watch:{eventCount(){this.scrollToBottom()},pendingQuestion(){this.scrollToBottom()},thinking(){this.scrollToBottom()},currentSessionId(){this.cancelSpeechRecognition?.(),this.pinnedToBottom=!0,this.scrollToBottom(),this.visibleCount=On,this.editingEventId=``,this.restoreCode=!1,this.syncSessionSettings()},currentNodeId(){this.cancelSpeechRecognition?.(),this.requestCapabilities(),this.isNewSession&&this.restoreComposerPrefs()},nodeOnline(e){e||this.cancelSpeechRecognition?.()},providerCaps(){if(!this.isNewSession||!this.providerCaps.length)return;let e=this.providerCaps.find(e=>e.name===this.provider);if(!e||e.available===!1){let e=this.providerCaps.find(e=>e.available!==!1);e&&(this.provider=e.name)}},provider(){this.isNewSession&&(this.model=``,this.effort=``)},prompt(e){this.slashMenuOpen=/^\/\S*$/.test(e),this.slashActiveIndex>=this.slashMatches.length&&(this.slashActiveIndex=0)}},mounted(){this.requestCapabilities(),this.syncSessionSettings(),this.scrollToBottom(),this.observeTranscript(),this.watchSettingsBreakpoint(),this.initializeSpeechRecognition?.()},updated(){this.observeTranscript()},beforeUnmount(){this.transcriptObserver?.disconnect(),this.transcriptObserver=void 0,this.observedTranscript=void 0,this.settingsMql?.removeEventListener(`change`,this.onSettingsBreakpoint),this.settingsMql=void 0,this.speechController?.dispose(),this.speechController=void 0},methods:{async initializeSpeechRecognition(){let e=En();this.speechController=e,this.speechSupported=await e.isSupported()},async toggleSpeechRecognition(){if(this.speechState===`listening`){await this.stopSpeechRecognition();return}this.speechState===`idle`&&await this.startSpeechRecognition()},async startSpeechRecognition(){if(!this.speechController||!this.speechSupported)return;let e=await this.ensureSpeechCredential();if(!e){S.error(this.$t(`codingBridge.session.voiceError`));return}this.speechBasePrompt=this.prompt,this.speechFinalText=``,this.speechInterimText=``,this.speechState=`listening`;try{await this.speechController.start(this.$i18n.locale,e,{onResult:this.applySpeechSnapshot,onEnd:this.finishSpeechRecognition,onError:this.handleSpeechError})}catch{this.finishSpeechRecognition()}},async ensureSpeechCredential(){let e=this.$store.state.openaiimage?.credential?.token;if(e)return e;await this.$store.dispatch(`openaiimage/getService`);let t=await this.$store.dispatch(`openaiimage/getApplications`),n=ye([...this.$store.state.applications??[],...t??[]],this.$store.state.openaiimage?.application);return n&&await this.$store.dispatch(`openaiimage/setApplication`,n),e=this.$store.state.openaiimage?.credential?.token,e??``},async stopSpeechRecognition(){if(!(!this.speechController||this.speechState!==`listening`)){this.speechState=`stopping`;try{await this.speechController.stop()}catch{this.handleSpeechError(`unknown`),this.finishSpeechRecognition()}}},async cancelSpeechRecognition(){!this.speechController||this.speechState===`idle`||(this.speechState=`idle`,this.speechInterimText=``,this.applySpeechPrompt(),await this.speechController.abort())},applySpeechSnapshot(e){this.speechState!==`idle`&&(this.speechFinalText=e.finalText,this.speechInterimText=e.interimText,this.applySpeechPrompt())},applySpeechPrompt(){let e=`${this.speechFinalText}${this.speechInterimText}`,t=this.speechBasePrompt&&e?`
|
|
2
2
|
`:``;this.prompt=`${this.speechBasePrompt}${t}${e}`},finishSpeechRecognition(){this.speechState!==`idle`&&(this.speechInterimText=``,this.applySpeechPrompt(),this.speechState=`idle`)},handleSpeechError(e){if(e===`aborted`)return;let t=this.$t({"permission-denied":`codingBridge.session.voicePermissionDenied`,"microphone-unavailable":`codingBridge.session.voiceMicrophoneUnavailable`,"no-speech":`codingBridge.session.voiceNoSpeech`,network:`codingBridge.session.voiceNetworkError`,unknown:`codingBridge.session.voiceError`}[e]);e===`no-speech`?S.warning(t):S.error(t)},watchSettingsBreakpoint(){typeof window>`u`||!window.matchMedia||(this.settingsMql=window.matchMedia(`(max-width: 767px)`),this.mobileSettings=this.settingsMql.matches,this.settingsMql.addEventListener(`change`,this.onSettingsBreakpoint))},onSettingsBreakpoint(e){this.mobileSettings=e.matches,e.matches||(this.moreOpen=!1)},requestCapabilities(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getCapabilities`,this.currentNodeId)},effortLabel(e){let t={"":`codingBridge.session.effortDefault`,low:`codingBridge.session.effortLow`,medium:`codingBridge.session.effortMedium`,high:`codingBridge.session.effortHigh`,max:`codingBridge.session.effortMax`}[e];return t?this.$t(t):e},permissionModeLabel(e){let t={default:`codingBridge.session.permissionModeDefault`,acceptEdits:`codingBridge.session.permissionModeAcceptEdits`,plan:`codingBridge.session.permissionModePlan`,bypassPermissions:`codingBridge.session.permissionModeBypass`}[e];return t?this.$t(t):e},providerName(e){let t=this.providerCaps.find(t=>t.name===e);return t?t.label:{claude:this.$t(`codingBridge.session.providerClaude`),codex:this.$t(`codingBridge.session.providerCodex`),copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return jn[e]??null},syncSessionSettings(){let e=this.currentSession;if(!e){this.restoreComposerPrefs();return}let t=this.lastComposer;e.provider&&(this.provider=e.provider),this.model=e.model??``,this.customModelDraft=``,this.cwd=e.cwd??t.cwd??``,this.effort=e.effort??t.effort??``,this.permissionMode=e.permission_mode??t.permissionMode??`bypassPermissions`},selectModel(e){this.model=e,this.customModelDraft=``,this.closeModelPopover()},applyCustomModel(){let e=this.customModelDraft.trim();e&&(this.model=e,this.customModelDraft=``,this.closeModelPopover())},closeModelPopover(){this.$refs.modelPopover?.hide?.()},onComposerEnter(e){let t=e;t.isComposing||t.keyCode===229||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||(t.preventDefault(),this.onSend())},onComposerKeydown(e){let t=e;if(this.slashMenuVisible&&!t.isComposing&&t.keyCode!==229){if(t.key===`ArrowDown`){t.preventDefault(),this.moveSlash(1);return}if(t.key===`ArrowUp`){t.preventDefault(),this.moveSlash(-1);return}if(t.key===`Escape`){t.preventDefault(),this.slashMenuOpen=!1;return}if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey){t.preventDefault(),this.applySlash(this.slashMatches[this.slashActiveIndex]);return}}t.key===`Enter`&&this.onComposerEnter(t)},moveSlash(e){let t=this.slashMatches.length;t&&(this.slashActiveIndex=(this.slashActiveIndex+e+t)%t,this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-slash-menu__item--active`))?.scrollIntoView({block:`nearest`})}))},applySlash(e){e&&(this.prompt=`/${e.name} `,this.slashMenuOpen=!1,this.slashActiveIndex=0)},onSend(){if(!this.canSend)return;this.cancelSpeechRecognition?.();let e=this.attachments;if(this.editingEventId){this.$store.dispatch(`codingBridge/editPrompt`,{eventId:this.editingEventId,prompt:this.prompt,model:this.model,permissionMode:this.permissionMode,effort:this.effort,attachments:e.length?e:void 0,restoreCode:this.restoreCode}),this.resetComposer();return}this.currentNodeId&&this.$store.commit(`codingBridge/setLastComposer`,{node_id:this.currentNodeId,prefs:{cwd:this.cwd,provider:this.provider,model:this.model,permissionMode:this.permissionMode,effort:this.effort}}),this.$store.dispatch(`codingBridge/sendPrompt`,{prompt:this.prompt,cwd:this.cwd,model:this.model,permissionMode:this.permissionMode,provider:this.provider,effort:this.effort,attachments:e.length?e:void 0}),this.resetComposer()},resetComposer(){this.cancelSpeechRecognition?.(),this.prompt=``,this.speechBasePrompt=``,this.speechFinalText=``,this.speechInterimText=``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.editingEventId=``,this.restoreCode=!1,this.clearAttachments()},cancelEdit(){this.resetComposer()},onAnswerQuestion(e){this.$store.dispatch(`codingBridge/answerQuestion`,{request_id:e.tool_use_id,output:e.output})},onSkipQuestion(e){this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:e.tool_use_id,decision:`deny`})},beforeAttachmentUpload(e){return this.attachmentFileList.length>=Q?(S.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:Q})),!1):e.size>Dn?(S.warning(this.$t(`codingBridge.session.attachmentTooLarge`)),!1):!0},onAttachmentChange(e){if(!e.url&&e.raw&&this.isImageAttachment(e))try{e.url=URL.createObjectURL(e.raw)}catch{}},onAttachmentSuccess(e,t){e?.file_url&&(this.revokeBlobUrl(t),t.url=e.file_url,t.response=e)},onAttachmentError(){S.error(this.$t(`codingBridge.session.attachmentUploadError`))},onAttachmentExceed(){S.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:Q}))},onTriggerAttachmentUpload(){this.$nextTick(()=>{let e=this.$refs.uploader?.$el;(e?.querySelector(`input.el-upload__input`)||e?.querySelector(`input[type="file"]`))?.click()})},isAttachmentUploading(e){return e.status===`ready`||e.status===`uploading`},isImageAttachment(e){return(e.raw?.type||``).startsWith(`image/`)?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||e.url||``)},attachmentPreviewUrl(e){return this.isImageAttachment(e)&&(e.url||e.response?.file_url)||``},removeAttachment(e,t){this.revokeBlobUrl(t),this.attachmentFileList.splice(e,1)},clearAttachments(){for(let e of this.attachmentFileList)this.revokeBlobUrl(e);this.attachmentFileList=[]},revokeBlobUrl(e){if(e.url?.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}},onInterrupt(){this.$store.dispatch(`codingBridge/interruptSession`)},onRetry(){this.$store.dispatch(`codingBridge/retryLastPrompt`)},onEditPrompt(e){this.canEdit&&(this.cancelSpeechRecognition?.(),this.editingEventId=e.id,this.restoreCode=!1,this.prompt=e.text??``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.clearAttachments(),this.attachmentFileList=(e.attachments??[]).map((e,t)=>({name:e.name||e.url,url:e.url,status:`success`,percentage:100,uid:Date.now()+t,response:{file_url:e.url},mime_type:e.mime_type})),this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-composer__input textarea`))?.focus()}))},openDirectory(){this.directoryVisible=!0},onDirectorySelect(e){this.cwd=e},onNewSession(){this.$store.dispatch(`codingBridge/newSession`),this.restoreComposerPrefs(),this.resetComposer()},restoreComposerPrefs(){let e=this.lastComposer;this.cwd=e.cwd??``,this.provider=e.provider??`claude`,this.permissionMode=e.permissionMode??`bypassPermissions`,this.customModelDraft=``,this.$nextTick(()=>{this.model=e.model??``,this.effort=e.effort??``})},scrollToBottom(){if(!this.pinnedToBottom)return;let e=()=>{let e=this.$refs.transcript;e&&(e.scrollTop=e.scrollHeight)};this.$nextTick(()=>{e(),requestAnimationFrame(e)})},observeTranscript(){let e=this.$refs.transcript;e!==this.observedTranscript&&(this.transcriptObserver?.disconnect(),this.transcriptObserver=void 0,this.observedTranscript=e,!(!e||typeof MutationObserver>`u`)&&(this.transcriptObserver=new MutationObserver(()=>this.scheduleScrollToBottom()),this.transcriptObserver.observe(e,{childList:!0,subtree:!0,characterData:!0})))},scheduleScrollToBottom(){!this.pinnedToBottom||this.scrollPending||(this.scrollPending=!0,requestAnimationFrame(()=>{this.scrollPending=!1;let e=this.$refs.transcript;e&&this.pinnedToBottom&&(e.scrollTop=e.scrollHeight)}))},onTranscriptScroll(){let e=this.$refs.transcript;e&&(this.pinnedToBottom=e.scrollHeight-e.scrollTop-e.clientHeight<=An)},loadEarlier(){let e=this.$refs.transcript,t=e?.scrollHeight??0;this.pinnedToBottom=!1,this.visibleCount+=kn,this.$nextTick(()=>{e&&(e.scrollTop=e.scrollHeight-t+e.scrollTop)})}}}),Nn={class:`session-view flex flex-col h-full bg-[var(--app-content-bg)]`},Pn={key:0,class:`flex-1 flex flex-col items-center justify-center text-center p-8 text-[var(--app-text-subtle)]`},Fn={class:`text-sm`},In={class:`flex items-center justify-between gap-3 px-5 py-3 border-b border-[var(--app-border-subtle)]`},Ln={class:`flex items-center gap-2 min-w-0`},Rn=[`title`,`aria-label`],zn={class:`min-w-0`},Bn={class:`flex items-center gap-2 font-medium`},Vn={class:`truncate`},Hn={key:0,class:`text-xs text-[var(--app-text-subtle)] truncate`},Un={key:0,class:`text-[var(--el-color-primary)]`},Wn={class:`flex items-center gap-2 flex-none`},Gn={key:0,class:`px-5 py-2 text-xs bg-[var(--el-color-warning-light-9)] text-[var(--el-color-warning)] border-b border-[var(--app-border-subtle)]`},Kn={key:1,class:`flex flex-wrap items-center gap-x-4 gap-y-1 px-5 py-1.5 text-[11px] text-[var(--app-text-subtle)] border-b border-[var(--app-border-subtle)]`},qn={class:`opacity-70 flex-none`},Jn=[`title`],Yn={key:0,class:`cb-skeleton`},Xn={class:`flex flex-col gap-4`},Zn={class:`flex justify-end`},Qn={class:`flex flex-col gap-1.5`},$n={class:`flex justify-end`},er={class:`flex flex-col gap-1.5`},tr={key:1,class:`m-auto text-center text-sm text-[var(--app-text-subtle)]`},nr=[`title`],rr={key:4,class:`flex justify-center pt-1`},ir={key:2,class:`cb-question-dock flex-none px-5`},ar={class:`border-t border-[var(--app-border-subtle)] p-3`},or={key:0,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)] px-1 py-2`},sr={key:0,class:`mb-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-[var(--el-color-primary-light-9)] px-3 py-2 text-xs text-[var(--app-text)]`},cr={class:`inline-flex items-center gap-1.5`},lr={class:`cb-composer rounded-2xl border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-2.5 transition-colors focus-within:border-[var(--el-color-primary-light-5)]`},ur={key:0,class:`flex flex-wrap gap-2 pb-2`},dr=[`src`,`alt`],fr={key:1,class:`flex h-8 w-8 items-center justify-center rounded bg-[var(--app-content-bg)]`},pr=[`title`],mr={key:2,class:`text-[10px] text-[var(--app-text-subtle)]`},hr=[`title`,`aria-label`,`onClick`],gr={key:1,class:`cb-slash-menu`},_r=[`onMousedown`,`onMouseenter`],vr={class:`cb-slash-menu__name`},yr={key:0,class:`cb-slash-menu__hint`},br={key:1,class:`cb-slash-menu__desc`},xr={ref:`attachmentUploadTrigger`,class:`block h-0 w-0`,"aria-hidden":`true`},Sr={class:`mt-1.5 flex items-center gap-1.5`},Cr=[`title`,`aria-label`],wr=[`disabled`,`title`,`aria-label`,`aria-pressed`],Tr={class:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`},Er={type:`button`,class:`cb-pill`},Dr=[`src`],Or={class:`truncate`},kr=[`src`],Ar={key:1,class:`ml-1 text-xs opacity-60`},jr={key:1,class:`cb-pill cb-pill--static`},Mr=[`src`],Nr={class:`truncate`},Pr=[`title`,`aria-label`],Fr={key:0,class:`cb-setting__label`},Ir={type:`button`,class:`cb-pill`},Lr={class:`truncate`},Rr={class:`cb-model-menu`},zr={class:`truncate`},Br=[`onClick`],Vr={class:`truncate`},Hr={key:0,class:`cb-model-custom`},Ur={key:0,class:`cb-setting__label`},Wr={type:`button`,class:`cb-pill`},Gr={class:`truncate`},Kr={key:0,class:`cb-setting__label`},qr={type:`button`,class:`cb-pill`},Jr={class:`truncate`},Yr={key:0,class:`cb-setting__label`},Xr={type:`button`,class:`cb-pill`},Zr={class:`truncate`},Qr=[`title`,`aria-label`],$r={key:2,class:`cb-pill cb-pill--static`},ei={class:`truncate`},ti={class:`text-[11px] text-[var(--app-text-subtle)] mt-1 px-1`};function ni(d,f,h,_,y,b){let x=u(`developer-icon`),S=u(`el-button`),C=u(`history-icon`),w=u(`add-icon`),T=u(`copy-to-clipboard`),E=u(`el-skeleton-item`),D=u(`el-skeleton`),O=u(`up-icon`),ee=u(`transcript-item`),te=u(`thinking-indicator`),ne=u(`redo-icon`),k=u(`ask-user-question-card`),re=u(`view-icon`),A=u(`edit-icon`),ie=u(`el-checkbox`),ae=u(`file-icon`),j=u(`close-icon`),M=u(`el-input`),oe=u(`el-upload`),se=u(`attachment-icon`),N=u(`stop-icon`),ce=u(`microphone-icon`),P=u(`code-icon`),F=u(`expand-down-icon`),I=u(`confirm-icon`),L=u(`el-dropdown-item`),R=u(`el-dropdown-menu`),z=u(`el-dropdown`),le=u(`more-icon`),ue=u(`ai-icon`),B=u(`el-popover`),V=u(`performance-icon`),H=u(`security-icon`),U=u(`folder-open-icon`),de=u(`composer-settings`),fe=u(`directory-dialog`);return v(),s(`div`,Nn,[d.currentNode?(v(),s(l,{key:1},[e(`div`,In,[e(`div`,Ln,[e(`button`,{type:`button`,class:`cb-devices-btn md:hidden`,title:d.$t(`codingBridge.nodeList.title`),"aria-label":d.$t(`codingBridge.nodeList.title`),onClick:f[1]||=e=>d.$emit(`devices`)},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Rn),e(`div`,zn,[e(`div`,Bn,[e(`span`,Vn,i(d.currentNode.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,d.nodeOnline?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`])},null,2)]),d.currentSession?(v(),s(`div`,Hn,[e(`span`,null,i(d.sessionMeta),1),d.replayLabel?(v(),s(`span`,Un,` · `+i(d.replayLabel),1)):o(``,!0)])):o(``,!0)])]),e(`div`,Wn,[a(S,{size:`small`,round:``,onClick:f[2]||=e=>d.$emit(`history`)},{default:m(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.history.button`)),1)]),_:1}),d.currentSessionId?(v(),p(S,{key:0,size:`small`,round:``,onClick:d.onNewSession},{default:m(()=>[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])):o(``,!0)])]),d.nodeOnline?o(``,!0):(v(),s(`div`,Gn,i(d.$t(`codingBridge.session.deviceOffline`)),1)),d.diagnostics.length?(v(),s(`div`,Kn,[(v(!0),s(l,null,g(d.diagnostics,t=>(v(),s(`span`,{key:t.label,class:`inline-flex items-center gap-1 min-w-0`},[e(`span`,qn,i(t.label)+`:`,1),e(`span`,{class:`font-mono break-all`,title:t.value},i(t.value),9,Jn),a(T,{content:t.value,class:`inline-block flex-none`},null,8,[`content`])]))),128))])):o(``,!0),e(`div`,{ref:`transcript`,class:`flex-1 min-h-0 overflow-y-auto px-5 py-4 flex flex-col gap-3`,onScroll:f[4]||=(...e)=>d.onTranscriptScroll&&d.onTranscriptScroll(...e)},[d.historyLoading&&!d.events.length?(v(),s(`div`,Yn,[a(D,{animated:``},{template:m(()=>[e(`div`,Xn,[e(`div`,Zn,[a(E,{variant:`rect`,class:`cb-sk cb-sk--user`})]),e(`div`,Qn,[a(E,{variant:`text`,style:{width:`55%`}}),a(E,{variant:`text`,style:{width:`88%`}}),a(E,{variant:`text`,style:{width:`70%`}})]),a(E,{variant:`rect`,class:`cb-sk cb-sk--tool`}),e(`div`,$n,[a(E,{variant:`rect`,class:`cb-sk cb-sk--user-sm`})]),e(`div`,er,[a(E,{variant:`text`,style:{width:`80%`}}),a(E,{variant:`text`,style:{width:`45%`}})])])]),_:1})])):d.events.length?o(``,!0):(v(),s(`div`,tr,i(d.$t(`codingBridge.session.startHint`)),1)),d.hiddenEventCount>0?(v(),s(`button`,{key:2,type:`button`,class:`cb-load-earlier mx-auto mb-1 flex items-center gap-1.5 rounded-full border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-1 text-xs text-[var(--app-text-subtle)] hover:text-[var(--el-color-primary)]`,title:`+${d.hiddenEventCount}`,onClick:f[3]||=(...e)=>d.loadEarlier&&d.loadEarlier(...e)},[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.hiddenEventCount),1)],8,nr)):o(``,!0),(v(!0),s(l,null,g(d.visibleEvents,e=>(v(),p(ee,{key:e.id,event:e,editable:d.canEdit,onEdit:d.onEditPrompt},null,8,[`event`,`editable`,`onEdit`]))),128)),d.thinking?(v(),p(te,{key:3})):o(``,!0),d.canRetry?(v(),s(`div`,rr,[a(S,{size:`small`,round:``,onClick:d.onRetry},{default:m(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.retry`)),1)]),_:1},8,[`onClick`])])):o(``,!0)],544),d.pendingQuestion?(v(),s(`div`,ir,[(v(),p(k,{key:d.pendingQuestion.request_id,"tool-use-id":d.pendingQuestion.request_id,payload:d.pendingQuestion.payload,onSubmit:d.onAnswerQuestion,onSkip:d.onSkipQuestion},null,8,[`tool-use-id`,`payload`,`onSubmit`,`onSkip`]))])):o(``,!0),e(`div`,ar,[d.readonly?(v(),s(`div`,or,[a(re,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(d.$t(`codingBridge.history.readonly`)),1),a(S,{class:`ml-auto`,size:`small`,round:``,onClick:d.onNewSession},{default:m(()=>[r(i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])])):(v(),s(l,{key:1},[d.editingActive?(v(),s(`div`,sr,[e(`span`,cr,[a(A,{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.editingBanner`)),1)]),d.canRestoreCode?(v(),p(ie,{key:0,modelValue:d.restoreCode,"onUpdate:modelValue":f[5]||=e=>d.restoreCode=e,size:`small`,class:`cb-restore-code`},{default:m(()=>[r(i(d.$t(`codingBridge.session.editRestoreCode`)),1)]),_:1},8,[`modelValue`])):o(``,!0),e(`button`,{type:`button`,class:`ml-auto cb-edit-cancel`,onClick:f[6]||=(...e)=>d.cancelEdit&&d.cancelEdit(...e)},i(d.$t(`codingBridge.session.editCancel`)),1)])):o(``,!0),e(`div`,lr,[d.attachmentFileList.length?(v(),s(`div`,ur,[(v(!0),s(l,null,g(d.attachmentFileList,(t,n)=>(v(),s(`div`,{key:t.uid||t.name||n,class:`group relative flex max-w-[220px] items-center gap-2 rounded-md border border-[var(--app-border-subtle)] bg-[var(--app-sidebar-bg)] px-2 py-1.5 text-xs`},[d.attachmentPreviewUrl(t)?(v(),s(`img`,{key:0,src:d.attachmentPreviewUrl(t),class:`h-8 w-8 rounded object-cover`,alt:d.$t(`codingBridge.session.attachmentImageAlt`)},null,8,dr)):(v(),s(`span`,fr,[a(ae,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,{class:`min-w-0 flex-1 truncate`,title:t.name},i(t.name),9,pr),d.isAttachmentUploading(t)?(v(),s(`span`,mr,i(Math.round(t.percentage||0))+`% `,1)):o(``,!0),e(`button`,{type:`button`,class:`flex h-5 w-5 items-center justify-center rounded-full text-[var(--app-text-subtle)] hover:bg-[var(--app-content-hover-bg)] hover:text-[var(--el-color-danger)]`,title:d.$t(`codingBridge.session.removeAttachment`),"aria-label":d.$t(`codingBridge.session.removeAttachment`),onClick:e=>d.removeAttachment(n,t)},[a(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,hr)]))),128))])):o(``,!0),d.slashMenuVisible?(v(),s(`ul`,gr,[(v(!0),s(l,null,g(d.slashMatches,(r,a)=>(v(),s(`li`,{key:r.name,class:n([`cb-slash-menu__item`,{"cb-slash-menu__item--active":a===d.slashActiveIndex}]),onMousedown:t(e=>d.applySlash(r),[`prevent`]),onMouseenter:e=>d.slashActiveIndex=a},[e(`span`,vr,`/`+i(r.name),1),r.argument_hint?(v(),s(`span`,yr,i(r.argument_hint),1)):o(``,!0),r.description?(v(),s(`span`,br,i(r.description),1)):o(``,!0)],42,_r))),128))])):o(``,!0),a(M,{modelValue:d.prompt,"onUpdate:modelValue":f[7]||=e=>d.prompt=e,type:`textarea`,autosize:{minRows:2,maxRows:12},resize:`none`,class:`cb-composer__input`,readonly:d.speechActive,placeholder:d.$t(`codingBridge.session.promptPlaceholder`),onKeydown:d.onComposerKeydown},null,8,[`modelValue`,`readonly`,`placeholder`,`onKeydown`]),a(oe,{ref:`uploader`,"file-list":d.attachmentFileList,"onUpdate:fileList":f[8]||=e=>d.attachmentFileList=e,class:`h-0 w-0 overflow-hidden opacity-0`,name:`file`,action:d.uploadUrl,headers:d.headers,multiple:!0,limit:d.maxAttachments,"show-file-list":!1,"before-upload":d.beforeAttachmentUpload,"on-change":d.onAttachmentChange,"on-success":d.onAttachmentSuccess,"on-error":d.onAttachmentError,"on-exceed":d.onAttachmentExceed},{default:m(()=>[e(`span`,xr,null,512)]),_:1},8,[`file-list`,`action`,`headers`,`limit`,`before-upload`,`on-change`,`on-success`,`on-error`,`on-exceed`]),e(`div`,Sr,[e(`button`,{type:`button`,class:`cb-icon-btn`,title:d.$t(`codingBridge.session.attachFile`),"aria-label":d.$t(`codingBridge.session.attachFile`),onClick:f[9]||=(...e)=>d.onTriggerAttachmentUpload&&d.onTriggerAttachmentUpload(...e)},[a(se,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Cr),d.speechSupported?(v(),s(`button`,{key:0,type:`button`,class:n([`cb-icon-btn cb-voice-btn`,{"cb-voice-btn--active":d.speechActive}]),disabled:d.speechState===`stopping`,title:d.$t(d.speechActive?`codingBridge.session.voiceStop`:`codingBridge.session.voiceInput`),"aria-label":d.$t(d.speechActive?`codingBridge.session.voiceStop`:`codingBridge.session.voiceInput`),"aria-pressed":d.speechActive,onClick:f[10]||=(...e)=>d.toggleSpeechRecognition&&d.toggleSpeechRecognition(...e)},[d.speechActive?(v(),p(N,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(ce,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,wr)):o(``,!0),e(`div`,Tr,[d.isNewSession?(v(),p(z,{key:0,trigger:`click`,onCommand:f[11]||=e=>d.provider=e},{dropdown:m(()=>[a(R,null,{default:m(()=>[(v(!0),s(l,null,g(d.providerOptions,e=>(v(),p(L,{key:e.value,command:e.value,disabled:!e.available},{default:m(()=>[a(I,{class:n([`mr-2`,e.value===d.provider?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),d.providerIcon(e.value)?(v(),s(`img`,{key:0,src:d.providerIcon(e.value).src,class:n([`cb-pill__brand mr-1.5`,{"cb-pill__brand--invert":d.providerIcon(e.value).invertOnDark}]),alt:``},null,10,kr)):o(``,!0),r(` `+i(e.label)+` `,1),e.available?o(``,!0):(v(),s(`span`,Ar,i(d.$t(`codingBridge.session.providerUnavailable`)),1))]),_:2},1032,[`command`,`disabled`]))),128))]),_:1})]),default:m(()=>[e(`button`,Er,[d.providerIcon(d.provider)?(v(),s(`img`,{key:0,src:d.providerIcon(d.provider).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.provider).invertOnDark}]),alt:``},null,10,Dr)):(v(),p(P,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Or,i(d.providerName(d.provider)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):(v(),s(`span`,jr,[d.providerIcon(d.currentSession?.provider||`claude`)?(v(),s(`img`,{key:0,src:d.providerIcon(d.currentSession?.provider||`claude`).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.currentSession?.provider||`claude`).invertOnDark}]),alt:``},null,10,Mr)):(v(),p(P,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Nr,i(d.providerName(d.currentSession?.provider||`claude`)),1)])),e(`button`,{type:`button`,class:`cb-icon-btn cb-more-btn`,title:d.$t(`codingBridge.session.settings`),"aria-label":d.$t(`codingBridge.session.settings`),onClick:f[12]||=e=>d.moreOpen=!0},[a(le,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Pr),a(de,{open:d.moreOpen,"onUpdate:open":f[21]||=e=>d.moreOpen=e,dialog:d.mobileSettings},{default:m(()=>[e(`div`,{class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Fr,i(d.$t(`chat.scheduledTasks.form.model`)),1)):o(``,!0),a(B,{ref:`modelPopover`,trigger:`click`,placement:`top-start`,width:260},{reference:m(()=>[e(`button`,Ir,[a(ue,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Lr,i(d.model||d.$t(`codingBridge.session.modelDefault`)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:m(()=>[e(`div`,Rr,[e(`button`,{type:`button`,class:`cb-model-option`,onClick:f[13]||=e=>d.selectModel(``)},[a(I,{class:n([`cb-model-option__check`,d.model?`opacity-0`:`opacity-100`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,zr,i(d.$t(`codingBridge.session.modelDefault`)),1)]),(v(!0),s(l,null,g(d.modelOptions,t=>(v(),s(`button`,{key:t.value,type:`button`,class:`cb-model-option`,onClick:e=>d.selectModel(t.value)},[a(I,{class:n([`cb-model-option__check`,t.value===d.model?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,Vr,i(t.label),1)],8,Br))),128)),d.allowCustomModel?(v(),s(`div`,Hr,[a(M,{modelValue:d.customModelDraft,"onUpdate:modelValue":f[14]||=e=>d.customModelDraft=e,size:`small`,placeholder:d.$t(`codingBridge.session.modelPlaceholder`),onKeyup:c(d.applyCustomModel,[`enter`])},{append:m(()=>[a(S,{disabled:!d.customModelDraft.trim(),"aria-label":d.$t(`common.button.confirm`),title:d.$t(`common.button.confirm`),onClick:d.applyCustomModel},{default:m(()=>[a(I,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0)])]),_:1},512)],2),d.effortOptions.length>1?(v(),s(`div`,{key:0,class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Ur,i(d.$t(`codingBridge.session.effortLabel`)),1)):o(``,!0),a(z,{trigger:`click`,onCommand:f[15]||=e=>d.effort=e},{dropdown:m(()=>[a(R,null,{default:m(()=>[(v(!0),s(l,null,g(d.effortOptions,e=>(v(),p(L,{key:e.value,command:e.value},{default:m(()=>[a(I,{class:n([`mr-2`,e.value===d.effort?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:m(()=>[e(`button`,Wr,[a(V,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Gr,i(d.effortLabel(d.effort)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})],2)):o(``,!0),e(`div`,{class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Kr,i(d.$t(`codingBridge.session.permissionModeLabel`)),1)):o(``,!0),a(z,{trigger:`click`,onCommand:f[16]||=e=>d.permissionMode=e},{dropdown:m(()=>[a(R,null,{default:m(()=>[(v(!0),s(l,null,g(d.permissionModeOptions,e=>(v(),p(L,{key:e.value,command:e.value},{default:m(()=>[a(I,{class:n([`mr-2`,e.value===d.permissionMode?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:m(()=>[e(`button`,qr,[a(H,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Jr,i(d.permissionModeLabel(d.permissionMode)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})],2),d.canPickCwd||d.currentSession?.cwd?(v(),s(`div`,{key:1,class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Yr,i(d.$t(`common.settings.localToolsWorkingDirTitle`)),1)):o(``,!0),d.canPickCwd?(v(),p(B,{key:1,trigger:`click`,placement:`top-start`,width:320},{reference:m(()=>[e(`button`,Xr,[a(U,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Zr,i(d.cwd||d.$t(`codingBridge.session.cwdDefault`)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:m(()=>[a(M,{modelValue:d.cwd,"onUpdate:modelValue":f[20]||=e=>d.cwd=e,size:`small`,clearable:``,class:`cb-cwd-input`,placeholder:d.$t(`codingBridge.session.cwdPlaceholder`)},{suffix:m(()=>[e(`span`,{class:`cb-cwd-browse`,role:`button`,tabindex:`0`,title:d.$t(`codingBridge.directory.title`),"aria-label":d.$t(`codingBridge.directory.title`),onClick:f[17]||=(...e)=>d.openDirectory&&d.openDirectory(...e),onKeydown:[f[18]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`enter`]),f[19]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`space`])]},[a(U,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],40,Qr)]),_:1},8,[`modelValue`,`placeholder`])]),_:1})):(v(),s(`span`,$r,[a(U,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,ei,i(d.currentSession?.cwd),1)]))],2)):o(``,!0)]),_:1},8,[`open`,`dialog`])]),d.running?(v(),p(S,{key:1,circle:``,"aria-label":d.$t(`common.button.stop`),title:d.$t(`common.button.stop`),onClick:d.onInterrupt},{default:m(()=>[a(N,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])):o(``,!0),a(S,{type:`primary`,round:``,disabled:!d.canSend,onClick:d.onSend},{default:m(()=>[r(i(d.editingActive?d.$t(`codingBridge.session.editSubmit`):d.$t(`codingBridge.session.send`)),1)]),_:1},8,[`disabled`,`onClick`])])]),e(`p`,ti,i(d.composerHint),1)],64))])],64)):(v(),s(`div`,Pn,[a(x,{class:`text-4xl mb-3`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,Fn,i(d.$t(`codingBridge.session.noDevice`)),1),a(S,{class:`md:hidden mt-4`,round:``,onClick:f[0]||=e=>d.$emit(`devices`)},{default:m(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.nodeList.title`)),1)]),_:1})])),a(fe,{visible:d.directoryVisible,"onUpdate:visible":f[22]||=e=>d.directoryVisible=e,"initial-path":d.cwd,onSelect:d.onDirectorySelect},null,8,[`visible`,`initial-path`,`onSelect`])])}var ri=W(Mn,[[`render`,ni],[`__scopeId`,`data-v-adb11f90`]]),ii=y({name:`CodingBridgePairDialog`,components:{LinkIcon:R,ElDialog:K,ElInput:q,ElButton:J},props:{visible:{type:Boolean,default:!1},initialCode:{type:String,default:``}},emits:[`update:visible`],data(){return{code:``}},computed:{claiming(){return this.$store.state.codingBridge?.status?.claimPair===x.Request}},watch:{visible(e){e&&this.initialCode&&(this.code=this.initialCode)},initialCode(e){e&&(this.code=e)}},methods:{async onClaim(){let e=this.code.trim();if(e)try{let t=await this.$store.dispatch(`codingBridge/claimPair`,e);S.success(this.$t(`codingBridge.pair.success`,{name:t})),this.code=``,this.$emit(`update:visible`,!1)}catch(e){let t=e?.response?.status;t===404?S.error(this.$t(`codingBridge.pair.invalidCode`)):t===409?S.error(this.$t(`codingBridge.pair.usedCode`)):S.error(this.$t(`codingBridge.pair.failed`))}}}}),ai={class:`content`},oi={class:`text-sm text-[var(--app-text-subtle)] mb-4`},si={class:`steps list-none m-0 p-0 mb-4`},ci={class:`flex gap-3 mb-3`},li={class:`flex-1 min-w-0`},ui={class:`text-sm mb-1`},di={class:`flex gap-3 mb-3`},fi={class:`flex-1 min-w-0`},pi={class:`text-sm mb-1`},mi={class:`flex gap-3`},hi={class:`flex-1 min-w-0`},gi={class:`text-sm`};function _i(t,n,o,s,l,d){let f=u(`el-input`),h=u(`link-icon`),g=u(`el-button`),_=u(`el-dialog`);return v(),p(_,{"model-value":t.visible,width:`520px`,title:t.$t(`codingBridge.pair.title`),center:``,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:visible`,e)},{default:m(()=>[e(`div`,ai,[e(`p`,oi,i(t.$t(`codingBridge.pair.intro`)),1),e(`ol`,si,[e(`li`,ci,[n[3]||=e(`span`,{class:`step-index`},`1`,-1),e(`div`,li,[e(`p`,ui,i(t.$t(`codingBridge.pair.step1`)),1),n[2]||=e(`code`,{class:`cmd`},`pip install coding-bridge`,-1)])]),e(`li`,di,[n[5]||=e(`span`,{class:`step-index`},`2`,-1),e(`div`,fi,[e(`p`,pi,i(t.$t(`codingBridge.pair.step2`)),1),n[4]||=e(`code`,{class:`cmd`},`coding-bridge up`,-1)])]),e(`li`,mi,[n[6]||=e(`span`,{class:`step-index`},`3`,-1),e(`div`,hi,[e(`p`,gi,i(t.$t(`codingBridge.pair.step3`)),1)])])]),a(f,{modelValue:t.code,"onUpdate:modelValue":n[0]||=e=>t.code=e,size:`large`,class:`mb-3`,placeholder:t.$t(`codingBridge.pair.codePlaceholder`),clearable:``,onKeyup:c(t.onClaim,[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeyup`]),a(g,{type:`primary`,round:``,class:`w-full`,loading:t.claiming,disabled:!t.code.trim(),onClick:t.onClaim},{default:m(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.pair.claim`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])]),_:1},8,[`model-value`,`title`])}var vi=W(ii,[[`render`,_i],[`__scopeId`,`data-v-54bd85f1`]]),yi=y({name:`CodingBridgePermissionDialog`,components:{CloseIcon:Y,CodeIcon:j,ConfirmIcon:A,ElDialog:K,ElButton:J},computed:{request(){return(this.$store.state.codingBridge?.permissions??[]).find(e=>!nt(e))},hasInput(){return!!this.request?.input&&Object.keys(this.request.input).length>0},inputText(){try{return JSON.stringify(this.request?.input,null,2)}catch{return String(this.request?.input??``)}}},methods:{onAllow(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`allow`})},onDeny(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`deny`})}}}),bi={key:0,class:`content`},xi={class:`text-sm text-[var(--app-text-subtle)] mb-3`},Si={class:`rounded-md border border-[var(--app-border-subtle)] p-3 mb-3`},Ci={class:`flex items-center gap-2 font-medium`},wi={key:0,class:`text-xs text-[var(--app-text-subtle)] mt-1`},Ti={key:1,class:`mt-2 text-xs overflow-x-auto whitespace-pre-wrap break-words text-[var(--app-text-subtle)] max-h-[200px]`},Ei={class:`flex justify-end gap-2`};function Di(t,n,c,l,d,f){let h=u(`code-icon`),g=u(`close-icon`),_=u(`el-button`),y=u(`confirm-icon`),b=u(`el-dialog`);return v(),p(b,{"model-value":!!t.request,width:`480px`,title:t.$t(`codingBridge.permission.title`),"close-on-click-modal":!1,"show-close":!1,center:``},{footer:m(()=>[e(`div`,Ei,[a(_,{round:``,onClick:t.onDeny},{default:m(()=>[a(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.deny`)),1)]),_:1},8,[`onClick`]),a(_,{type:`primary`,round:``,onClick:t.onAllow},{default:m(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.allow`)),1)]),_:1},8,[`onClick`])])]),default:m(()=>[t.request?(v(),s(`div`,bi,[e(`p`,xi,i(t.$t(`codingBridge.permission.subtitle`)),1),e(`div`,Si,[e(`div`,Ci,[a(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.request.display_name||t.request.title||t.request.tool),1)]),t.request.description?(v(),s(`p`,wi,i(t.request.description),1)):o(``,!0),t.hasInput?(v(),s(`pre`,Ti,i(t.inputText),1)):o(``,!0)])])):o(``,!0)]),_:1},8,[`model-value`,`title`])}var Oi=W(yi,[[`render`,Di]]),ki={claude:{src:vn,invertOnDark:!1},codex:{src:yn,invertOnDark:!0},copilot:{src:bn,invertOnDark:!0}},$=[`claude`,`codex`,`copilot`],Ai=y({name:`CodingBridgeHistoryDrawer`,components:{CodeIcon:j,RedoIcon:U,ElDrawer:w,ElButton:J},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`],data(){return{selectedProviders:[]}},computed:{currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},loading(){return this.$store.state.codingBridge?.status?.getHistory===x.Request},allSessions(){let e=this.currentNodeId;return[...e?this.$store.state.codingBridge?.history?.[e]??[]:[]].sort((e,t)=>(t.updated_at??0)-(e.updated_at??0))},sessions(){return this.selectedProviders.length?this.allSessions.filter(e=>this.selectedProviders.includes(e.provider)):this.allSessions},providerOptions(){let e=new Map;return this.allSessions.forEach(t=>{e.set(t.provider,(e.get(t.provider)??0)+1)}),[...e.entries()].sort(([e],[t])=>{let n=$.indexOf(e),r=$.indexOf(t);return n===r?e.localeCompare(t):(n<0?$.length:n)-(r<0?$.length:r)}).map(([e,t])=>({value:e,label:this.providerLabel(e),count:t,icon:this.providerIcon(e)}))}},watch:{visible(e){e&&this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},currentNodeId(){this.selectedProviders=[]}},methods:{isSelected(e){return this.selectedProviders.includes(e)},toggle(e){this.selectedProviders=this.isSelected(e)?this.selectedProviders.filter(t=>t!==e):[...this.selectedProviders,e]},clearFilter(){this.selectedProviders=[]},providerLabel(e){return{claude:`Claude Code`,codex:`Codex`,copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return ki[e]??null},refresh(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},open(e){this.currentNodeId&&(e.unread&&this.$store.dispatch(`codingBridge/markHistoryRead`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id,updated_at:e.updated_at}),this.$store.dispatch(`codingBridge/reattachSession`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id}),this.$emit(`update:visible`,!1))},formatTime(e){try{return new Date(e).toLocaleString()}catch{return``}}}}),ji={class:`flex flex-col h-full`},Mi={class:`flex items-center justify-between mb-3`},Ni={class:`text-xs text-[var(--app-text-subtle)] m-0`},Pi={key:0,class:`flex flex-wrap items-center gap-1.5 mb-3`},Fi=[`aria-pressed`,`onClick`],Ii=[`src`],Li={class:`chip-count`},Ri={key:1,class:`m-auto text-sm text-[var(--app-text-subtle)]`},zi={key:2,class:`m-auto text-sm text-[var(--app-text-subtle)]`},Bi={key:3,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},Vi={key:4,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},Hi={class:`m-0`},Ui={key:5,class:`list-none m-0 p-0 flex-1 overflow-y-auto flex flex-col gap-2`},Wi=[`onClick`],Gi={class:`flex items-center gap-2 mb-1`},Ki=[`src`,`alt`],qi=[`title`],Ji=[`title`],Yi={class:`text-[11px] text-[var(--app-text-subtle)] truncate`},Xi={key:0},Zi={key:1},Qi={class:`text-[11px] text-[var(--app-text-subtle)] mt-0.5`},$i={key:0},ea={key:1};function ta(t,c,d,f,h,_){let y=u(`redo-icon`),b=u(`el-button`),x=u(`code-icon`),S=u(`el-drawer`);return v(),p(S,{"model-value":t.visible,direction:`rtl`,size:`380px`,title:t.$t(`codingBridge.history.title`),"onUpdate:modelValue":c[1]||=e=>t.$emit(`update:visible`,e)},{default:m(()=>[e(`div`,ji,[e(`div`,Mi,[e(`p`,Ni,i(t.$t(`codingBridge.history.intro`)),1),a(b,{size:`small`,round:``,loading:t.loading,onClick:t.refresh},{default:m(()=>[t.loading?o(``,!0):(v(),p(y,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`codingBridge.history.refresh`)),1)]),_:1},8,[`loading`,`onClick`])]),t.providerOptions.length>1?(v(),s(`div`,Pi,[(v(!0),s(l,null,g(t.providerOptions,r=>(v(),s(`button`,{key:r.value,type:`button`,class:n([`chip`,{"chip--active":t.isSelected(r.value)}]),"aria-pressed":t.isSelected(r.value),onClick:e=>t.toggle(r.value)},[r.icon?(v(),s(`img`,{key:0,src:r.icon.src,class:n([`provider-icon`,{"provider-icon--invert":r.icon.invertOnDark}]),alt:``,"aria-hidden":`true`},null,10,Ii)):(v(),p(x,{key:1,class:`provider-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(r.label),1),e(`span`,Li,i(r.count),1)],10,Fi))),128)),t.selectedProviders.length?(v(),s(`button`,{key:0,type:`button`,class:`chip-clear`,onClick:c[0]||=(...e)=>t.clearFilter&&t.clearFilter(...e)},i(t.$t(`codingBridge.history.filterAll`)),1)):o(``,!0)])):o(``,!0),t.currentNodeId?t.loading&&!t.allSessions.length?(v(),s(`div`,zi,i(t.$t(`codingBridge.history.loading`)),1)):t.allSessions.length?t.sessions.length?(v(),s(`ul`,Ui,[(v(!0),s(l,null,g(t.sessions,r=>(v(),s(`li`,{key:r.provider+`:`+r.session_id,class:`item rounded-lg p-3 cursor-pointer border border-[var(--app-border-subtle)]`,onClick:e=>t.open(r)},[e(`div`,Gi,[t.providerIcon(r.provider)?(v(),s(`img`,{key:0,src:t.providerIcon(r.provider).src,class:n([`provider-icon`,{"provider-icon--invert":t.providerIcon(r.provider).invertOnDark}]),alt:t.providerLabel(r.provider)},null,10,Ki)):(v(),p(x,{key:1,class:`provider-icon`,title:t.providerLabel(r.provider),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`title`])),e(`span`,{class:n([`text-sm truncate flex-1`,r.unread?`font-bold`:`font-normal`]),title:r.unread?t.$t(`codingBridge.history.unread`):void 0},i(r.title),11,qi),r.running?(v(),s(`span`,{key:2,class:`running-dot`,title:t.$t(`codingBridge.history.running`)},null,8,Ji)):o(``,!0)]),e(`div`,Yi,[r.cwd?(v(),s(`span`,Xi,i(r.cwd),1)):o(``,!0),r.git_branch?(v(),s(`span`,Zi,` · `+i(r.git_branch),1)):o(``,!0)]),e(`div`,Qi,[r.updated_at?(v(),s(`span`,$i,i(t.formatTime(r.updated_at)),1)):o(``,!0),r.message_count?(v(),s(`span`,ea,` · `+i(t.$t(`codingBridge.history.messages`,{count:r.message_count})),1)):o(``,!0)])],8,Wi))),128))])):(v(),s(`div`,Vi,[e(`p`,Hi,i(t.$t(`codingBridge.history.filterEmpty`)),1),a(b,{class:`mt-2`,size:`small`,round:``,onClick:t.clearFilter},{default:m(()=>[r(i(t.$t(`codingBridge.history.filterAll`)),1)]),_:1},8,[`onClick`])])):(v(),s(`div`,Bi,i(t.$t(`codingBridge.history.empty`)),1)):(v(),s(`div`,Ri,i(t.$t(`codingBridge.session.noDevice`)),1))])]),_:1},8,[`model-value`,`title`])}var na=y({name:`CodingBridgeIndex`,components:{ElDrawer:w,NodeList:et,SessionView:ri,PairDialog:vi,PermissionDialog:Oi,HistoryDrawer:W(Ai,[[`render`,ta],[`__scopeId`,`data-v-abb16563`]])},data(){return{drawer:!1,pairVisible:!1,historyVisible:!1,initialCode:``}},mounted(){this.$store.dispatch(`codingBridge/connect`),this.$store.dispatch(`codingBridge/getNodes`);let e=this.$route.query.code;typeof e==`string`&&e&&(this.initialCode=e,this.pairVisible=!0),this.restoreFromUrl(),this.handleNotificationDeepLink(),this.cleanUrl()},beforeUnmount(){this.$store.dispatch(`codingBridge/disconnect`)},methods:{openPair(){this.initialCode=``,this.pairVisible=!0},openPairFromDrawer(){this.drawer=!1,this.openPair()},restoreFromUrl(){let e=this.$route.query,t=typeof e.session==`string`?e.session:``,n=typeof e.node==`string`?e.node:``;if(!t||!n)return;let r=e.provider===`codex`||e.provider===`copilot`?e.provider:`claude`;this.$store.commit(`codingBridge/setCurrentNode`,n),this.$store.commit(`codingBridge/setHistoryRef`,{node_id:n,provider:r,session_id:t}),this.$store.dispatch(`codingBridge/getHistory`,n),this.$store.dispatch(`codingBridge/requestSessions`,n)},cleanUrl(){let e=this.$route.query,t=[`session`,`node`,`provider`,`request`,`code`];if(!t.some(t=>t in e))return;let n={...e};t.forEach(e=>delete n[e]),this.$router.replace({query:n}).catch(()=>{})},handleNotificationDeepLink(){let e=this.$route.query.node;typeof e==`string`&&e&&(this.$route.query.session||this.$store.dispatch(`codingBridge/selectNode`,e),this.$store.dispatch(`codingBridge/requestPendingPermissions`,e))}}}),ra={class:`coding-bridge flex flex-row h-full relative`};function ia(e,t,n,r,i,o){let c=u(`node-list`),l=u(`session-view`),d=u(`el-drawer`),f=u(`pair-dialog`),p=u(`permission-dialog`),h=u(`history-drawer`);return v(),s(`div`,ra,[a(c,{class:`sidebar w-[300px] flex-none`,onPair:e.openPair},null,8,[`onPair`]),a(l,{class:`flex-1 min-w-0`,onHistory:t[0]||=t=>e.historyVisible=!0,onDevices:t[1]||=t=>e.drawer=!0}),a(d,{modelValue:e.drawer,"onUpdate:modelValue":t[2]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`300px`,class:`drawer`},{default:m(()=>[a(c,{onPair:e.openPairFromDrawer},null,8,[`onPair`])]),_:1},8,[`modelValue`]),a(f,{visible:e.pairVisible,"onUpdate:visible":t[3]||=t=>e.pairVisible=t,"initial-code":e.initialCode},null,8,[`visible`,`initial-code`]),a(p),a(h,{visible:e.historyVisible,"onUpdate:visible":t[4]||=t=>e.historyVisible=t},null,8,[`visible`])])}var aa=W(na,[[`render`,ia],[`__scopeId`,`data-v-2879fe0f`]]);export{aa as default};
|