@inkeep/open-knowledge 0.86.22 → 0.86.23-beta.1
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/THIRD_PARTY_NOTICES.md +3 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-Iymgoe5U.mjs +1 -0
- package/dist/dist-Ds1SZERP.mjs +2213 -0
- package/dist/{dist-0qA3xZU8.mjs → dist-nfglEvqM.mjs} +1 -1
- package/dist/index.mjs +218 -219
- package/dist/{init-DQY_k8Bb.mjs → init-BMQUc4ul.mjs} +2 -2
- package/dist/init-Dq5MuSis.mjs +1 -0
- package/dist/{launch-json-removal-BToQcc3e.mjs → launch-json-removal-DaL2BiQh.mjs} +1 -1
- package/dist/loader-D6muyenS.mjs +1 -0
- package/dist/{loader-BcKRvBDf.mjs → loader-DX_l-d9D.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-BzZ_8EQ9.mjs → md-manager-BGnqyqi1-I7NmBKjQ.mjs} +108 -108
- package/dist/native/native-config.win32-arm64-msvc.node +0 -0
- package/dist/native/native-config.win32-x64-msvc.node +0 -0
- package/dist/{open-browser-DhYyRIyx.mjs → open-browser-BGyDP4ZD.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-BNlI5MHG.mjs → preview-DTwOZM1t.mjs} +1 -1
- package/dist/preview-DZgLv5oB.mjs +1 -0
- package/dist/public/assets/{AboutSection-LPELvEUl.js → AboutSection-Bddd4fs4.js} +1 -1
- package/dist/public/assets/{AccountSection-Dla17okM.js → AccountSection-ZhKVAZRz.js} +1 -1
- package/dist/public/assets/ActivityModeContent-Cu3J2wnZ.js +1 -0
- package/dist/public/assets/{AddPropertiesButton-C0bGsu-F.js → AddPropertiesButton-BiF-H17k.js} +2 -2
- package/dist/public/assets/AgentConnectionsSection-B9_oKPEW.js +1 -0
- package/dist/public/assets/{AgentDiffPane-BIzndumu.js → AgentDiffPane-h67Ihyuy.js} +1 -1
- package/dist/public/assets/{AppMenubar-ClplcAeM.js → AppMenubar-vPHVy2jk.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-BjrHOhme.js → AttachmentsSection-6uV_ZVHZ.js} +1 -1
- package/dist/public/assets/AuthModal-YZGpNH__.js +3 -0
- package/dist/public/assets/{BugReportHistory-BM589t1t.js → BugReportHistory-CHujhV74.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-BfdDMBqN.js → BugReportHistoryDialog-CaE3cXFx.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-DhpGZlDx.js → ChangedOutsideBadge-BfH3veLO.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-C5fRuWf2.js → CodeMirrorPropInput-_HrEupqc.js} +3 -3
- package/dist/public/assets/{ConsentDialogBody-CaPp8huq.js → ConsentDialogBody-k0k7metW.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-B5CAsULt.js → ContentRulesSection-Br4OQaTJ.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-Czp-0Arc.js → DiffViewBoundary-DFNHnF7f.js} +1 -1
- package/dist/public/assets/{DocumentContext-DDDUTQJi.js → DocumentContext-B6cmniqU.js} +5 -5
- package/dist/public/assets/{EditorModeToggle-Bd8FyUeG.js → EditorModeToggle-DaLqaw6f.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-4RZPPTS9.js → ExcalidrawDocEditor-Dtti2_8y.js} +1 -1
- package/dist/public/assets/FeedbackForm-Cy3p2I18.js +1 -0
- package/dist/public/assets/{GraphPanel-D1tkoAHM.js → GraphPanel-4ARXQVWm.js} +1 -1
- package/dist/public/assets/{HotkeysSection-C9sCf3j3.js → HotkeysSection-D1qQH68p.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-Be_RD2Gk.js → ImportSkillDialog-DooL2Y3J.js} +1 -1
- package/dist/public/assets/{IntegrationsSection-D3htSKMO.js → IntegrationsSection-r5E7Aje8.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-D0uy1PxC.js → LinkPreviewsSection-BrZydaih.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-l01M8Bbg.js → LintConfigEditor-D5WZW3Kb.js} +1 -1
- package/dist/public/assets/{LintingSection-12fgbDnF.js → LintingSection-CU-sc0Ur.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-vcuTAbYr.js → ManagedArtifactProperties-BvSP1BV4.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DXW12uSQ.js +1 -0
- package/dist/public/assets/McpConsentDialogBody-CVZcuVhW.js +1 -0
- package/dist/public/assets/{Mermaid-Dqzqybsn.js → Mermaid-DqNhHNi1.js} +2 -2
- package/dist/public/assets/{MermaidDocEditor-BCNSGhNo.js → MermaidDocEditor-DwEaCHNY.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-Cxln0QK5.js → NetworkAccessSection-Ci0dBnda.js} +1 -1
- package/dist/public/assets/{OkignoreSection-BudJQycp.js → OkignoreSection-DplnnxQb.js} +2 -2
- package/dist/public/assets/{ProjectTemplatesSection-DCliKsre.js → ProjectTemplatesSection-BEchYRnN.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-CGpmYjl6.js → PropertyDisplayRow-B6_pfxvN.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-BCeR1wkm.js → PublishToGitHubDialog-DdtYAP9Y.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-FmoZTlpS.js → RegisteredAgentIcon-B0qjAvei.js} +1 -1
- package/dist/public/assets/ReportBugDialogBody-jHepd9au.js +3 -0
- package/dist/public/assets/ReportBugMenuTrigger-KsljCE5p.js +1 -0
- package/dist/public/assets/SchemaConfigEditor-DlSrtrC2.js +1 -0
- package/dist/public/assets/{SearchSection-Bcm55yb6.js → SearchSection-DUCXR4Qf.js} +1 -1
- package/dist/public/assets/SessionsHost-CBIKgs04.js +2 -0
- package/dist/public/assets/{SettingsDialogBody-BZpyRgRK.js → SettingsDialogBody-CKjYKbWt.js} +2 -2
- package/dist/public/assets/{SettingsSectionHeader-DDNA1hrR.js → SettingsSectionHeader-BKhNIRp2.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DVtBOlIm.js → ShareReceiveDialog-DJbtqR4t.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-NFqekHGn.js → ShareReceiveMissDialog-CDei4CzD.js} +1 -1
- package/dist/public/assets/{SharingSection-Y4AD8HPt.js → SharingSection-C-9tTPow.js} +1 -1
- package/dist/public/assets/SkillCostValue-DK-VfwfI.js +1 -0
- package/dist/public/assets/{SkillForkDialog-CPkWchji.js → SkillForkDialog-BHqkO5bK.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-DyKWxkEY.js → SkillInstallMenu-29VzNm-A.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-D6YyylB6.js → SkillOriginInline-Z5JCe0T2.js} +1 -1
- package/dist/public/assets/{SkillPluginBundleDialog-BmLQqQms.js → SkillPluginBundleDialog-BnQu_DSM.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Bs8p51PI.js → SkillToolbarControls-BVFLkdZj.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-C0pgRzfs.js → SkillsManagerSection-D4YW1uOY.js} +1 -1
- package/dist/public/assets/{SlidesPluginSection-B8KiQkqa.js → SlidesPluginSection-BhUKklqb.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-DxIDubwo.js → SlidesToolbarControls-DXn_DkWH.js} +1 -1
- package/dist/public/assets/{SourceEditor-DP0HyTpn.js → SourceEditor-CJRzYB7x.js} +1 -1
- package/dist/public/assets/{SpellingSettings-CElN7mrA.js → SpellingSettings-C72xD-Zu.js} +1 -1
- package/dist/public/assets/{SyncSection-C1jLDoRh.js → SyncSection-DrCPevDV.js} +1 -1
- package/dist/public/assets/SyncStatusBadge-CF1z14DG.js +1 -0
- package/dist/public/assets/{TemplateRow-DsoFn6-i.js → TemplateRow-4LHta_yW.js} +2 -2
- package/dist/public/assets/{TerminalLaunchContext-DWUMDSpw.js → TerminalLaunchContext-DprnLNoQ.js} +1 -1
- package/dist/public/assets/{TerminalPanel-ByCiyPt3.js → TerminalPanel-D93jMQs_.js} +2 -2
- package/dist/public/assets/{TerminalSection-C8HHQC_K.js → TerminalSection-DjyjBYpU.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-D6hHsUKZ.js → TerminalWindowApp-CZN9GQ0B.js} +1 -1
- package/dist/public/assets/{TextDocEditor-BZCB5p1t.js → TextDocEditor-219p4L8n.js} +1 -1
- package/dist/public/assets/ThemePluginSection-BHfep7sw.js +6 -0
- package/dist/public/assets/ThreadView-HjOlpdvu.js +28 -0
- package/dist/public/assets/{TimelineDiffPane-BiVpBG0u.js → TimelineDiffPane-BNO514Vt.js} +1 -1
- package/dist/public/assets/agent-connections-D6YhmKlS.js +1 -0
- package/dist/public/assets/{agent-registry-DoeDgmSS.js → agent-registry-BdHe0AEQ.js} +1 -1
- package/dist/public/assets/badge-BIamhtRR.js +1 -0
- package/dist/public/assets/{bridge-BeevbgaB.js → bridge-BMIee44l.js} +1 -1
- package/dist/public/assets/{catalog-C1GEA-Va.js → catalog-CEXii1s5.js} +1 -1
- package/dist/public/assets/{client-version-CVbC_NDn.js → client-version-CCcGb1GY.js} +1 -1
- package/dist/public/assets/{comment-chips-bT3Pgeu8.js → comment-chips-Dlk_Uy8T.js} +1 -1
- package/dist/public/assets/{config-provider-4lMZjvv1.js → config-provider-DY_fun1v.js} +1 -1
- package/dist/public/assets/config-schema-zP71feeS.js +1 -0
- package/dist/public/assets/{css-color-to-hex-BRv_r6oZ.js → css-color-to-hex-Csde6-Qs.js} +1 -1
- package/dist/public/assets/{dist-BrKroYq_.js → dist-DjMGDcCv.js} +2 -2
- package/dist/public/assets/{doc-undo-manager-BKDHRnV-.js → doc-undo-manager-Dm2bBXP2.js} +1 -1
- package/dist/public/assets/field-controls-B49FSs4r.js +1 -0
- package/dist/public/assets/field-controls-DBnF9Har.js +6 -0
- package/dist/public/assets/globals-kLKgmkBv.css +1 -0
- package/dist/public/assets/{ime-composition-_BDVzXn4.js → ime-composition-DSJh5ynW.js} +1 -1
- package/dist/public/assets/index-kLtGZT70.js +2209 -0
- package/dist/public/assets/{lint-config-client-DRJNyM2s.js → lint-config-client-B249C1D2.js} +1 -1
- package/dist/public/assets/{lint-plugins-Dufc6pEn.js → lint-plugins-DH147HA7.js} +1 -1
- package/dist/public/assets/{markdown-lint-BuEapKhE.js → markdown-lint-BMeMGAz_.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BQ4c4vDN.js → markdownlint-rule-browser-Bt2f856y.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-3JlvmWi7.js → pending-receive-nav-store-D2Wl34aG.js} +1 -1
- package/dist/public/assets/{preferred-session-events-Crz1K3Z-.js → preferred-session-events-C_8_bodB.js} +1 -1
- package/dist/public/assets/{progress-BK046Tty.js → progress-CdWJE0cw.js} +1 -1
- package/dist/public/assets/{reveal-editor-SLzwvD1I.js → reveal-editor-ChTC5Vss.js} +1 -1
- package/dist/public/assets/saved-themes-client-DFijgxrT.js +1 -0
- package/dist/public/assets/{schema-section-CalUQFIh.js → schema-section-BHt16UFk.js} +1 -1
- package/dist/public/assets/{schemas-api-CD98jV86.js → schemas-api-CL5ZXlEj.js} +4 -4
- package/dist/public/assets/{selection-context-BbfG0HO9.js → selection-context-DYlfZmRT.js} +1 -1
- package/dist/public/assets/{skills-api-zXSg3eSX.js → skills-api-CCijBzjo.js} +1 -1
- package/dist/public/assets/{src-D_7G4loI.js → src-Ca8kxD9e.js} +1 -1
- package/dist/public/assets/storage-scope-GPc8n3Ml.js +1 -0
- package/dist/public/assets/{tag-pill-input-D6mNhknm.js → tag-pill-input-qgfgpKpV.js} +1 -1
- package/dist/public/assets/{telemetry-impl-C8ZWEJkv.js → telemetry-impl-BHjyIgsL.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DNrsQYjz.js → telemetry-startup-BBS84TAP.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BhFGIVo_.js → terminal-launch-events-3vnER_eI.js} +1 -1
- package/dist/public/assets/typing-burst-detector-DjSPAHC0.js +8 -0
- package/dist/public/assets/{uninstall-DFTOzPT_.js → uninstall-Is26Mh1k.js} +1 -1
- package/dist/public/assets/{use-activity-panel-D5VDwOQt.js → use-activity-panel-BNET4arK.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-hiddt1uL.js → use-apply-config-color-theme-Bpi7AD0s.js} +2 -2
- package/dist/public/assets/{use-conflicts-BAjZ5TAV.js → use-conflicts-CIjDyM9c.js} +1 -1
- package/dist/public/assets/use-installed-clis-BTrIR9--.js +2 -0
- package/dist/public/assets/{use-live-xterm-theme-C1wLG0Im.js → use-live-xterm-theme-BJbDRXxo.js} +1 -1
- package/dist/public/assets/{use-open-skill-CFZd4B8h.js → use-open-skill-DbYpOsHm.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-CRj98qO1.js → use-semantic-search-status-7_z6UOU1.js} +1 -1
- package/dist/public/assets/{use-skill-origin-BAc45a3e.js → use-skill-origin-B9YRoKsz.js} +1 -1
- package/dist/public/assets/{use-skill-targets-DIBQkXNG.js → use-skill-targets-DZmqRDS7.js} +1 -1
- package/dist/public/assets/{use-skills-B2fLFrq6.js → use-skills-CkvdjORj.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-B51ji6oG.js → use-terminal-enabled-BSpJ-tlQ.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-B6Z6EtU2.js → use-timeline-entry-diff-ndwvvpVg.js} +1 -1
- package/dist/public/assets/{use-workspace-Bgh-YT5K.js → use-workspace-h2j0Puyv.js} +1 -1
- package/dist/public/index.html +55 -55
- package/dist/public/uninstall.html +4 -4
- package/dist/{registry-probes-DPKKrRUM.mjs → registry-probes-vIdTG_Zj.mjs} +1 -1
- package/dist/{removal-file-path-Bxa6y1-K.mjs → removal-file-path-B4b_lrPp.mjs} +1 -1
- package/dist/{repair-launch-json-GQqTV6X4.mjs → repair-launch-json-N6361aUT.mjs} +1 -1
- package/dist/{repair-mcp-configs-CZ1wHZDY.mjs → repair-mcp-configs-B68Xkqv7.mjs} +1 -1
- package/dist/src-DDe9AS2s.mjs +1 -0
- package/dist/{src-DZwvkGg3.mjs → src-f-qHxbxU.mjs} +1 -1
- package/dist/{start-DGllIRmH.mjs → start-BoUYvOQO.mjs} +3 -3
- package/dist/start-tvNfnwWU.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-CKiX5Z0-.mjs +0 -1
- package/dist/dist-CJAnJkM1.mjs +0 -2213
- package/dist/init-BSBhjVTS.mjs +0 -1
- package/dist/loader-vXeyPd6b.mjs +0 -1
- package/dist/preview-Cvm5I8jO.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-fbqWmmqu.js +0 -1
- package/dist/public/assets/AgentConnectionsSection-DhbJCdHu.js +0 -1
- package/dist/public/assets/AuthModal-DT32BOAJ.js +0 -3
- package/dist/public/assets/FeedbackForm-DTSn-xTq.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-BNV1pKhc.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-BwguVGDQ.js +0 -1
- package/dist/public/assets/ReportBugDialogBody-J5o6Nxwn.js +0 -3
- package/dist/public/assets/ReportBugMenuTrigger-CAUKQKXn.js +0 -1
- package/dist/public/assets/SchemaConfigEditor-CHGUkiVe.js +0 -1
- package/dist/public/assets/SessionsHost-DQ1ys2Oj.js +0 -2
- package/dist/public/assets/SkillCostValue-DBT6aDG-.js +0 -1
- package/dist/public/assets/SyncStatusBadge-uu4Is4Gu.js +0 -1
- package/dist/public/assets/ThemePluginSection-McKmY5If.js +0 -6
- package/dist/public/assets/ThreadView-OBNSZb0r.js +0 -28
- package/dist/public/assets/agent-connections-DSKODCmO.js +0 -1
- package/dist/public/assets/badge-DmdA1C7r.js +0 -1
- package/dist/public/assets/config-schema-CIaXsCAX.js +0 -1
- package/dist/public/assets/field-controls-CCcf2ybM.js +0 -1
- package/dist/public/assets/field-controls-CKb1JSHS.js +0 -6
- package/dist/public/assets/globals-Cr0S8PDH.css +0 -1
- package/dist/public/assets/index-xygm6gU4.js +0 -2209
- package/dist/public/assets/saved-themes-client-D09wxYQm.js +0 -1
- package/dist/public/assets/storage-scope-ldi41iCU.js +0 -1
- package/dist/public/assets/typing-burst-detector-DQWG6VAz.js +0 -8
- package/dist/public/assets/use-installed-clis-BopBqnEZ.js +0 -2
- package/dist/src-DJMiqowA.mjs +0 -1
- package/dist/start-BAXRLMKN.mjs +0 -1
- /package/dist/public/assets/{globals-DHDe92Ga.js → globals-CcgTjZMO.js} +0 -0
package/dist/public/assets/{ShareReceiveDialog-DVtBOlIm.js → ShareReceiveDialog-DJbtqR4t.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-DzgjsZzC.js";import{n as s}from"./dist-BGzUo_18.js";import{t as c}from"./desktop-bridge-types-BxqZkaz9.js";import{t as ee}from"./spinner-Bx8xD6f8.js";import{a as te,c as ne,i as re,n as l,o as u,s as ie,t as d}from"./dialog-BJEjKJjL.js";import{a as f,c as p,i as m,l as h,n as g,o as _,r as ae,s as v}from"./receive-store-3PZqJEKz.js";import{t as oe}from"./share-metadata-rows-C_o8h27z.js";var y=e(n(),1),b=a(),x=e=>({phase:`ready`,seed:e});function S(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function C(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function w(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function T(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var E=t();function D(e){return{kind:e.target.kind,path:c(e.target),repositoryPath:c(e.repositoryTarget),...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function O(e){return e!==null&&e.kind===`launcher-consent`}function k(e){return e!==null&&e.kind===`launcher-miss`}function A(e){let t=(0,b.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?g:i,o=(0,y.useSyncExternalStore)(a.subscribe,a.getSnapshot,M),[c,ee]=(0,y.useState)(0),[te,ne]=(0,y.useState)(o);o!==te&&(ne(o),ee(j));let re,l;t[0]!==o||t[1]!==a?(re=()=>{if(!o)return;let e=v(o);e&&(s.error(e.message),a.dismiss())},l=[o,a],t[0]=o,t[1]=a,t[2]=re,t[3]=l):(re=t[2],l=t[3]),(0,y.useEffect)(re,l);let u;t[4]===o?u=t[5]:(u=k(o)?o:null,t[4]=o,t[5]=u);let ie=u,d;t[6]===o?d=t[7]:(d=O(o)?o:null,t[6]=o,t[7]=d);let f=d??ie;if(!f)return null;let p;return t[8]!==f||t[9]!==n||t[10]!==r||t[11]!==c||t[12]!==a?(p=(0,E.jsx)(N,{payload:f,bridge:n,cloneController:r,store:a},c),t[8]=f,t[9]=n,t[10]=r,t[11]=c,t[12]=a,t[13]=p):p=t[13],p}function j(e){return e+1}function M(){return null}function N(e){let t=(0,b.c)(165),{payload:n,bridge:a,cloneController:g,store:v}=e,{_:S}=i(),[T,A]=(0,y.useState)(!1),[j,M]=(0,y.useState)(null),[N,fe]=(0,y.useState)(!1),[P,pe]=(0,y.useState)(!1),[F,me]=(0,y.useState)(null),[I,L]=(0,y.useState)(null),he=(0,y.useRef)(!1),ge=(0,y.useRef)(null),_e,ve;t[0]===F?(_e=t[1],ve=t[2]):(_e=()=>{F&&ge.current?.focus()},ve=[F],t[0]=F,t[1]=_e,t[2]=ve),(0,y.useEffect)(_e,ve);let ye;t[3]!==I||t[4]!==n?(ye=()=>{O(n)&&I===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),L(x({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:c(n.share.target),targetKind:n.share.target.kind,repositoryPath:c(n.share.repositoryTarget),...n.share.contentRootDepth===null?{}:{contentRootDepth:n.share.contentRootDepth},parentProjectName:n.parentProjectName})))},t[3]=I,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,y.useEffect)(ye,be);let xe;t[8]!==j||t[9]!==g||t[10]!==n?(xe=()=>{if(!g||!k(n)||j!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;g.getAuthStatus(e).then(e=>{M(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),M({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=j,t[9]=g,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==j||t[13]!==n?(Se=[n,j],t[12]=j,t[13]=n,t[14]=Se):Se=t[14],(0,y.useEffect)(xe,Se);let R=k(n)?n:null,Ce=O(n)?n:null,z=R?.share??Ce?.share??null,B,V,H,U,W,we,G,K;if(t[15]!==S||t[16]!==N||t[17]!==a||t[18]!==g||t[19]!==P||t[20]!==I||t[21]!==R||t[22]!==T||t[23]!==z||t[24]!==v){G=Symbol.for(`react.early_return_sentinel`);bb0:{let e=z?{host:z.host,owner:z.owner,repo:z.repo}:null,n;t[33]!==S||t[34]!==z?.target.kind?(n=z?.target.kind===`folder`?S({id:`ugoTXs`}):S({id:`XH30C4`}),t[33]=S,t[34]=z?.target.kind,t[35]=n):n=t[35],K=n,H=async function(){if(!R||!e)return;if(console.log(f({q2_path:`clone`})),!g){s.info(S({id:`27XW26`}),{action:{label:S({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(P)return;me(null),pe(!0);let t=ae(e),n;try{n=await g.runClone({url:t,branch:R.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:D(R.share)}),v.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),s.error(S({id:`438Fca`}))}return}};let i;t[36]!==S||t[37]!==N||t[38]!==g?(i=async function(){if(!(!g||N)){fe(!0);try{let e=await g.startSignIn();fe(!1),e!==null&&M(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),s.error(S({id:`lzwo7p`}))}}},t[36]=S,t[37]=N,t[38]=g,t[39]=i):i=t[39],W=i,U=async function(){if(!(!R||!e||T)){me(null),A(!0),console.log(f({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(f({folder_validate:n.kind})),n.kind===`ok`){let e=R.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=h(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:R.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:D(R.share)}}),v.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),s.error(S({id:`phM8Kh`}))}break}let r=_(n,e);r&&s.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),s.error(S({id:`rlUzXK`}))}A(!1)}};let m;t[40]!==S||t[41]!==a||t[42]!==I||t[43]!==v?(m=function(){if(I===null||I.phase!==`ready`)return;let e=I.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),L(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){L(e=>e===null?e:C(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath,repositoryPath:e.repositoryPath??e.targetPath,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}},pendingBranch:e.branch}),L(ue),v.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);L(e=>e===null?e:w(e,{ok:!1,message:r})),s.error(S({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;L(e=>e===null?e:C(e,{ok:!1,reason:n,message:r})),s.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);L(e=>e===null?e:C(e,{ok:!1,reason:`network-error`,message:n})),s.error(S({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=S,t[41]=a,t[42]=I,t[43]=v,t[44]=m):m=t[44];let y=m,b;t[45]!==I||t[46]!==v?(b=function(){I!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${I.seed.candidatePath}`),L(le),v.dismiss()},t[45]=I,t[46]=v,t[47]=b):b=t[47];let x=b;if(I!==null&&I.phase!==`cancelled`&&I.phase!==`done`&&z!==null){let e=I.seed,n=I.phase===`initializing`||I.phase===`opening`,i;t[48]===x?i=t[49]:(i=e=>{e||x()},t[48]=x,t[49]=i);let a;t[50]===K?a=t[51]:(a=(0,E.jsx)(ne,{children:(0,E.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:K}})}),t[50]=K,t[51]=a);let s;t[52]===z.target?s=t[53]:(s=c(z.target)?`— ${c(z.target)}`:``,t[52]=z.target,t[53]=s);let f;t[54]!==z.owner||t[55]!==z.repo||t[56]!==s?(f=(0,E.jsx)(te,{className:`sr-only`,children:(0,E.jsx)(r,{id:`pgq_xf`,values:{0:z.owner,1:z.repo,2:s}})}),t[54]=z.owner,t[55]=z.repo,t[56]=s,t[57]=f):f=t[57];let p=z.owner,m=z.repo,h;t[58]===z.target?h=t[59]:(h=c(z.target),t[58]=z.target,t[59]=h);let g;t[60]!==z.branch||t[61]!==z.owner||t[62]!==z.repo||t[63]!==z.target.kind||t[64]!==h?(g=(0,E.jsx)(oe,{owner:p,repo:m,path:h,kind:z.target.kind,branch:z.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=z.branch,t[61]=z.owner,t[62]=z.repo,t[63]=z.target.kind,t[64]=h,t[65]=g):g=t[65];let _;t[66]!==a||t[67]!==f||t[68]!==g?(_=(0,E.jsxs)(ie,{children:[a,f,g]}),t[66]=a,t[67]=f,t[68]=g,t[69]=_):_=t[69];let ae;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`KsAPaB`})}),t[70]=ae):ae=t[70];let v;t[71]===e.candidatePath?v=t[72]:(v=(0,E.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=v);let b;t[73]===e.parentProjectName?b=t[74]:(b=e.parentProjectName===null?null:(0,E.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,E.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=b);let S;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,E.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`w7SsvI`})}),t[75]=S):S=t[75];let C;t[76]!==I.message||t[77]!==I.phase?(C=I.phase===`error`?(0,E.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:I.message}):null,t[76]=I.message,t[77]=I.phase,t[78]=C):C=t[78];let w;t[79]!==v||t[80]!==b||t[81]!==C?(w=(0,E.jsxs)(l,{children:[ae,v,b,S,C]}),t[79]=v,t[80]=b,t[81]=C,t[82]=w):w=t[82];let T;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,E.jsx)(r,{id:`dEgA5A`}),t[83]=T):T=t[83];let D;t[84]===x?D=t[85]:(D=(0,E.jsx)(o,{variant:`ghost`,onClick:x,"data-testid":`share-receive-consent-cancel`,children:T}),t[84]=x,t[85]=D);let O=n||I.phase===`error`,k=n||I.phase===`error`,A;t[86]===n?A=t[87]:(A=n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ee,{className:`mr-2 h-4 w-4`,"aria-hidden":`true`}),(0,E.jsx)(r,{id:`NKkZXl`})]}):(0,E.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=A);let j;t[88]!==y||t[89]!==O||t[90]!==k||t[91]!==A?(j=(0,E.jsx)(o,{onClick:y,disabled:O,"aria-disabled":k,"data-testid":`share-receive-consent-initialize`,children:A}),t[88]=y,t[89]=O,t[90]=k,t[91]=A,t[92]=j):j=t[92];let M;t[93]!==D||t[94]!==j?(M=(0,E.jsxs)(u,{children:[D,j]}),t[93]=D,t[94]=j,t[95]=M):M=t[95];let N;t[96]!==_||t[97]!==w||t[98]!==M?(N=(0,E.jsxs)(re,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:ce,onPointerDownOutside:se,children:[_,w,M]}),t[96]=_,t[97]=w,t[98]=M,t[99]=N):N=t[99];let le;t[100]!==i||t[101]!==N?(le=(0,E.jsx)(d,{open:!0,onOpenChange:i,children:N}),t[100]=i,t[101]=N,t[102]=le):le=t[102],G=le;break bb0}if(!R||!z||!e){G=null;break bb0}B=g!==void 0&&!P;let O;t[103]!==S||t[104]!==P?(O=S(P?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=S,t[104]=P,t[105]=O):O=t[105],V=O,we=p(e)}t[15]=S,t[16]=N,t[17]=a,t[18]=g,t[19]=P,t[20]=I,t[21]=R,t[22]=T,t[23]=z,t[24]=v,t[25]=B,t[26]=V,t[27]=H,t[28]=U,t[29]=W,t[30]=we,t[31]=G,t[32]=K}else B=t[25],V=t[26],H=t[27],U=t[28],W=t[29],we=t[30],G=t[31],K=t[32];if(G!==Symbol.for(`react.early_return_sentinel`))return G;let Te=we,Ee=j?.authenticated?j.login:void 0,De;t[106]===F?De=t[107]:(De=F?.detail?m(F.detail):``,t[106]=F,t[107]=De);let Oe=De,q;t[108]===v?q=t[109]:(q=e=>{e||v.dismiss()},t[108]=v,t[109]=q);let J;t[110]===K?J=t[111]:(J=(0,E.jsx)(ne,{children:(0,E.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:K}})}),t[110]=K,t[111]=J);let Y;t[112]===z.target?Y=t[113]:(Y=c(z.target)?` — ${c(z.target)}`:null,t[112]=z.target,t[113]=Y);let X;t[114]!==z.owner||t[115]!==z.repo||t[116]!==Y?(X=(0,E.jsxs)(te,{className:`sr-only`,children:[z.owner,`/`,z.repo,Y]}),t[114]=z.owner,t[115]=z.repo,t[116]=Y,t[117]=X):X=t[117];let ke=z.owner,Ae=z.repo,Z;t[118]===z.target?Z=t[119]:(Z=c(z.target),t[118]=z.target,t[119]=Z);let Q;t[120]!==z.branch||t[121]!==z.owner||t[122]!==z.repo||t[123]!==z.target.kind||t[124]!==Z?(Q=(0,E.jsx)(oe,{owner:ke,repo:Ae,path:Z,kind:z.target.kind,branch:z.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=z.branch,t[121]=z.owner,t[122]=z.repo,t[123]=z.target.kind,t[124]=Z,t[125]=Q):Q=t[125];let je;t[126]!==J||t[127]!==X||t[128]!==Q?(je=(0,E.jsxs)(ie,{children:[J,X,Q]}),t[126]=J,t[127]=X,t[128]=Q,t[129]=je):je=t[129];let Me;t[130]!==g||t[131]!==B||t[132]!==F||t[133]!==Oe||t[134]!==V||t[135]!==P||t[136]!==H||t[137]!==U||t[138]!==T?(Me=F?(0,E.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,E.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,E.jsx)(r,{id:`aiArms`})}),Oe?(0,E.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,E.jsx)(r,{id:`4BITzH`}),` `,(0,E.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Oe,`"`]})]}):null,(0,E.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`Llyqvo`})}),(0,E.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,E.jsx)(`li`,{children:(0,E.jsx)(r,{id:`6LbUG7`})}),(0,E.jsx)(`li`,{children:(0,E.jsx)(r,{id:`_pY_Vq`})}),(0,E.jsx)(`li`,{children:(0,E.jsx)(r,{id:`J6mxC1`})})]}),(0,E.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,E.jsx)(o,{onClick:()=>{H()},"data-testid":`share-receive-clone-retry`,children:(0,E.jsx)(r,{id:`KDw4GX`})}),(0,E.jsx)(o,{variant:`outline`,onClick:()=>{U()},disabled:T||P,"data-testid":`share-receive-error-local`,children:(0,E.jsx)(r,{id:`xFQRu4`})})]})]}):(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,E.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{H()},disabled:g!==void 0&&!B,"aria-disabled":g!==void 0&&!B,children:[(0,E.jsx)(`span`,{className:`text-sm font-semibold`,children:V}),(0,E.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`fj5YiP`})})]}),(0,E.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{U()},disabled:T||P,children:[(0,E.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,E.jsx)(r,{id:`HfI1dR`})}),(0,E.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=g,t[131]=B,t[132]=F,t[133]=Oe,t[134]=V,t[135]=P,t[136]=H,t[137]=U,t[138]=T,t[139]=Me):Me=t[139];let Ne;t[140]!==N||t[141]!==j||t[142]!==g||t[143]!==W||t[144]!==Ee?(Ne=g?(0,E.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:j===null?(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:(0,E.jsx)(r,{id:`UDFrWm`})}):j.authenticated?(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:(0,E.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Ee},components:{0:(0,E.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:(0,E.jsx)(r,{id:`SgKLfA`})}),(0,E.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{W()},disabled:N,children:N?(0,E.jsx)(r,{id:`PKLY-1`}):(0,E.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=N,t[141]=j,t[142]=g,t[143]=W,t[144]=Ee,t[145]=Ne):Ne=t[145];let Pe;t[146]!==F||t[147]!==Te?(Pe=F?null:(0,E.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Te},components:{0:(0,E.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=F,t[147]=Te,t[148]=Pe):Pe=t[148];let Fe;t[149]!==Me||t[150]!==Ne||t[151]!==Pe?(Fe=(0,E.jsxs)(l,{children:[Me,Ne,Pe]}),t[149]=Me,t[150]=Ne,t[151]=Pe,t[152]=Fe):Fe=t[152];let Ie;t[153]===v?Ie=t[154]:(Ie=()=>v.dismiss(),t[153]=v,t[154]=Ie);let Le;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,E.jsx)(r,{id:`dEgA5A`}),t[155]=Le):Le=t[155];let Re;t[156]===Ie?Re=t[157]:(Re=(0,E.jsx)(u,{children:(0,E.jsx)(o,{variant:`outline`,onClick:Ie,children:Le})}),t[156]=Ie,t[157]=Re);let $;t[158]!==je||t[159]!==Fe||t[160]!==Re?($=(0,E.jsxs)(re,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[je,Fe,Re]}),t[158]=je,t[159]=Fe,t[160]=Re,t[161]=$):$=t[161];let ze;return t[162]!==q||t[163]!==$?(ze=(0,E.jsx)(d,{open:!0,onOpenChange:q,children:$}),t[162]=q,t[163]=$,t[164]=ze):ze=t[164],ze}function se(e){return e.preventDefault()}function ce(e){return e.preventDefault()}function le(e){return e===null?e:T(e)}function ue(e){return e===null?e:w(e,{ok:!0})}function de(e){return e===null?e:S(e)}export{A as ShareReceiveDialog};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-DzgjsZzC.js";import{n as s}from"./dist-BGzUo_18.js";import{t as c}from"./desktop-bridge-types-BxqZkaz9.js";import{t as ee}from"./spinner-Bx8xD6f8.js";import{a as te,c as ne,i as re,n as l,o as u,s as ie,t as d}from"./dialog-BJEjKJjL.js";import{a as f,c as p,i as m,l as h,n as g,o as _,r as ae,s as v}from"./receive-store-3PZqJEKz.js";import{t as oe}from"./share-metadata-rows-C_o8h27z.js";var y=e(n(),1),b=a(),x=e=>({phase:`ready`,seed:e});function S(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function C(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function w(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function T(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var E=t();function D(e){return{kind:e.target.kind,path:c(e.target),repositoryPath:c(e.repositoryTarget),...e.contentRootDepth===null?{}:{contentRootDepth:e.contentRootDepth}}}function O(e){return e!==null&&e.kind===`launcher-consent`}function k(e){return e!==null&&e.kind===`launcher-miss`}function A(e){let t=(0,b.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?g:i,o=(0,y.useSyncExternalStore)(a.subscribe,a.getSnapshot,M),[c,ee]=(0,y.useState)(0),[te,ne]=(0,y.useState)(o);o!==te&&(ne(o),ee(j));let re,l;t[0]!==o||t[1]!==a?(re=()=>{if(!o)return;let e=v(o);e&&(s.error(e.message),a.dismiss())},l=[o,a],t[0]=o,t[1]=a,t[2]=re,t[3]=l):(re=t[2],l=t[3]),(0,y.useEffect)(re,l);let u;t[4]===o?u=t[5]:(u=k(o)?o:null,t[4]=o,t[5]=u);let ie=u,d;t[6]===o?d=t[7]:(d=O(o)?o:null,t[6]=o,t[7]=d);let f=d??ie;if(!f)return null;let p;return t[8]!==f||t[9]!==n||t[10]!==r||t[11]!==c||t[12]!==a?(p=(0,E.jsx)(N,{payload:f,bridge:n,cloneController:r,store:a},c),t[8]=f,t[9]=n,t[10]=r,t[11]=c,t[12]=a,t[13]=p):p=t[13],p}function j(e){return e+1}function M(){return null}function N(e){let t=(0,b.c)(165),{payload:n,bridge:a,cloneController:g,store:v}=e,{_:S}=i(),[T,A]=(0,y.useState)(!1),[j,M]=(0,y.useState)(null),[N,fe]=(0,y.useState)(!1),[P,pe]=(0,y.useState)(!1),[F,me]=(0,y.useState)(null),[I,L]=(0,y.useState)(null),he=(0,y.useRef)(!1),ge=(0,y.useRef)(null),_e,ve;t[0]===F?(_e=t[1],ve=t[2]):(_e=()=>{F&&ge.current?.focus()},ve=[F],t[0]=F,t[1]=_e,t[2]=ve),(0,y.useEffect)(_e,ve);let ye;t[3]!==I||t[4]!==n?(ye=()=>{O(n)&&I===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),L(x({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:c(n.share.target),targetKind:n.share.target.kind,repositoryPath:c(n.share.repositoryTarget),...n.share.contentRootDepth===null?{}:{contentRootDepth:n.share.contentRootDepth},parentProjectName:n.parentProjectName})))},t[3]=I,t[4]=n,t[5]=ye):ye=t[5];let be;t[6]===n?be=t[7]:(be=[n],t[6]=n,t[7]=be),(0,y.useEffect)(ye,be);let xe;t[8]!==j||t[9]!==g||t[10]!==n?(xe=()=>{if(!g||!k(n)||j!==null||he.current)return;he.current=!0,fe(!0);let e=n.share.host;g.getAuthStatus(e).then(e=>{M(e)}).catch(t=>{console.warn(`[receive] auth pre-flight probe failed`,t instanceof Error?t.message:t),M({authenticated:!1,host:e})}).finally(()=>{fe(!1)})},t[8]=j,t[9]=g,t[10]=n,t[11]=xe):xe=t[11];let Se;t[12]!==j||t[13]!==n?(Se=[n,j],t[12]=j,t[13]=n,t[14]=Se):Se=t[14],(0,y.useEffect)(xe,Se);let R=k(n)?n:null,Ce=O(n)?n:null,z=R?.share??Ce?.share??null,B,V,H,U,W,we,G,K;if(t[15]!==S||t[16]!==N||t[17]!==a||t[18]!==g||t[19]!==P||t[20]!==I||t[21]!==R||t[22]!==T||t[23]!==z||t[24]!==v){G=Symbol.for(`react.early_return_sentinel`);bb0:{let e=z?{host:z.host,owner:z.owner,repo:z.repo}:null,n;t[33]!==S||t[34]!==z?.target.kind?(n=z?.target.kind===`folder`?S({id:`ugoTXs`}):S({id:`XH30C4`}),t[33]=S,t[34]=z?.target.kind,t[35]=n):n=t[35],K=n,H=async function(){if(!R||!e)return;if(console.log(f({q2_path:`clone`})),!g){s.info(S({id:`27XW26`}),{action:{label:S({id:`B3NAZC`}),onClick:()=>{a.navigator.open()}},duration:8e3});return}if(P)return;me(null),pe(!0);let t=ae(e),n;try{n=await g.runClone({url:t,branch:R.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),pe(!1),me({detail:t instanceof Error?t.message:String(t)});return}if(pe(!1),n.kind===`error`){me({detail:n.detail??null});return}if(n.kind===`ok`){try{await a.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:D(R.share)}),v.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),s.error(S({id:`438Fca`}))}return}};let i;t[36]!==S||t[37]!==N||t[38]!==g?(i=async function(){if(!(!g||N)){fe(!0);try{let e=await g.startSignIn();fe(!1),e!==null&&M(e)}catch(e){let t=e;fe(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),s.error(S({id:`lzwo7p`}))}}},t[36]=S,t[37]=N,t[38]=g,t[39]=i):i=t[39],W=i,U=async function(){if(!(!R||!e||T)){me(null),A(!0),console.log(f({q2_path:`local`}));try{for(;;){let t=await a.dialog.openFolder();if(!t)break;let n=await a.share.validateLocalFolder({folderPath:t,host:e.host,owner:e.owner,repo:e.repo});if(console.log(f({folder_validate:n.kind})),n.kind===`ok`){let e=R.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await a.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let r=h(e,n)!==`true`;try{await a.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...r?{pendingShareBranchSwitch:{share:R.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:D(R.share)}}),v.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),s.error(S({id:`phM8Kh`}))}break}let r=_(n,e);r&&s.error(r)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),s.error(S({id:`rlUzXK`}))}A(!1)}};let m;t[40]!==S||t[41]!==a||t[42]!==I||t[43]!==v?(m=function(){if(I===null||I.phase!==`ready`)return;let e=I.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),L(de),a.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){L(e=>e===null?e:C(e,{ok:!0,projectPath:t.projectPath}));try{await a.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath,repositoryPath:e.repositoryPath??e.targetPath,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}},pendingBranch:e.branch}),L(ue),v.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);L(e=>e===null?e:w(e,{ok:!1,message:r})),s.error(S({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,r=t.message||`Initialization failed.`;L(e=>e===null?e:C(e,{ok:!1,reason:n,message:r})),s.error(r)}).catch(t=>{let n=t instanceof Error?t.message:String(t);L(e=>e===null?e:C(e,{ok:!1,reason:`network-error`,message:n})),s.error(S({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=S,t[41]=a,t[42]=I,t[43]=v,t[44]=m):m=t[44];let y=m,b;t[45]!==I||t[46]!==v?(b=function(){I!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${I.seed.candidatePath}`),L(le),v.dismiss()},t[45]=I,t[46]=v,t[47]=b):b=t[47];let x=b;if(I!==null&&I.phase!==`cancelled`&&I.phase!==`done`&&z!==null){let e=I.seed,n=I.phase===`initializing`||I.phase===`opening`,i;t[48]===x?i=t[49]:(i=e=>{e||x()},t[48]=x,t[49]=i);let a;t[50]===K?a=t[51]:(a=(0,E.jsx)(ne,{children:(0,E.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:K}})}),t[50]=K,t[51]=a);let s;t[52]===z.target?s=t[53]:(s=c(z.target)?`— ${c(z.target)}`:``,t[52]=z.target,t[53]=s);let f;t[54]!==z.owner||t[55]!==z.repo||t[56]!==s?(f=(0,E.jsx)(te,{className:`sr-only`,children:(0,E.jsx)(r,{id:`pgq_xf`,values:{0:z.owner,1:z.repo,2:s}})}),t[54]=z.owner,t[55]=z.repo,t[56]=s,t[57]=f):f=t[57];let p=z.owner,m=z.repo,h;t[58]===z.target?h=t[59]:(h=c(z.target),t[58]=z.target,t[59]=h);let g;t[60]!==z.branch||t[61]!==z.owner||t[62]!==z.repo||t[63]!==z.target.kind||t[64]!==h?(g=(0,E.jsx)(oe,{owner:p,repo:m,path:h,kind:z.target.kind,branch:z.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=z.branch,t[61]=z.owner,t[62]=z.repo,t[63]=z.target.kind,t[64]=h,t[65]=g):g=t[65];let _;t[66]!==a||t[67]!==f||t[68]!==g?(_=(0,E.jsxs)(ie,{children:[a,f,g]}),t[66]=a,t[67]=f,t[68]=g,t[69]=_):_=t[69];let ae;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`KsAPaB`})}),t[70]=ae):ae=t[70];let v;t[71]===e.candidatePath?v=t[72]:(v=(0,E.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=v);let b;t[73]===e.parentProjectName?b=t[74]:(b=e.parentProjectName===null?null:(0,E.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,E.jsx)(r,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=b);let S;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,E.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`w7SsvI`})}),t[75]=S):S=t[75];let C;t[76]!==I.message||t[77]!==I.phase?(C=I.phase===`error`?(0,E.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:I.message}):null,t[76]=I.message,t[77]=I.phase,t[78]=C):C=t[78];let w;t[79]!==v||t[80]!==b||t[81]!==C?(w=(0,E.jsxs)(l,{children:[ae,v,b,S,C]}),t[79]=v,t[80]=b,t[81]=C,t[82]=w):w=t[82];let T;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,E.jsx)(r,{id:`dEgA5A`}),t[83]=T):T=t[83];let D;t[84]===x?D=t[85]:(D=(0,E.jsx)(o,{variant:`ghost`,onClick:x,"data-testid":`share-receive-consent-cancel`,children:T}),t[84]=x,t[85]=D);let O=n||I.phase===`error`,k=n||I.phase===`error`,A;t[86]===n?A=t[87]:(A=n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ee,{className:`mr-2 h-4 w-4`,"aria-hidden":`true`}),(0,E.jsx)(r,{id:`NKkZXl`})]}):(0,E.jsx)(r,{id:`NKkZXl`}),t[86]=n,t[87]=A);let j;t[88]!==y||t[89]!==O||t[90]!==k||t[91]!==A?(j=(0,E.jsx)(o,{onClick:y,disabled:O,"aria-disabled":k,"data-testid":`share-receive-consent-initialize`,children:A}),t[88]=y,t[89]=O,t[90]=k,t[91]=A,t[92]=j):j=t[92];let M;t[93]!==D||t[94]!==j?(M=(0,E.jsxs)(u,{children:[D,j]}),t[93]=D,t[94]=j,t[95]=M):M=t[95];let N;t[96]!==_||t[97]!==w||t[98]!==M?(N=(0,E.jsxs)(re,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:ce,onPointerDownOutside:se,children:[_,w,M]}),t[96]=_,t[97]=w,t[98]=M,t[99]=N):N=t[99];let le;t[100]!==i||t[101]!==N?(le=(0,E.jsx)(d,{open:!0,onOpenChange:i,children:N}),t[100]=i,t[101]=N,t[102]=le):le=t[102],G=le;break bb0}if(!R||!z||!e){G=null;break bb0}B=g!==void 0&&!P;let O;t[103]!==S||t[104]!==P?(O=S(P?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=S,t[104]=P,t[105]=O):O=t[105],V=O,we=p(e)}t[15]=S,t[16]=N,t[17]=a,t[18]=g,t[19]=P,t[20]=I,t[21]=R,t[22]=T,t[23]=z,t[24]=v,t[25]=B,t[26]=V,t[27]=H,t[28]=U,t[29]=W,t[30]=we,t[31]=G,t[32]=K}else B=t[25],V=t[26],H=t[27],U=t[28],W=t[29],we=t[30],G=t[31],K=t[32];if(G!==Symbol.for(`react.early_return_sentinel`))return G;let Te=we,Ee=j?.authenticated?j.login:void 0,De;t[106]===F?De=t[107]:(De=F?.detail?m(F.detail):``,t[106]=F,t[107]=De);let Oe=De,q;t[108]===v?q=t[109]:(q=e=>{e||v.dismiss()},t[108]=v,t[109]=q);let J;t[110]===K?J=t[111]:(J=(0,E.jsx)(ne,{children:(0,E.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:K}})}),t[110]=K,t[111]=J);let Y;t[112]===z.target?Y=t[113]:(Y=c(z.target)?` — ${c(z.target)}`:null,t[112]=z.target,t[113]=Y);let X;t[114]!==z.owner||t[115]!==z.repo||t[116]!==Y?(X=(0,E.jsxs)(te,{className:`sr-only`,children:[z.owner,`/`,z.repo,Y]}),t[114]=z.owner,t[115]=z.repo,t[116]=Y,t[117]=X):X=t[117];let ke=z.owner,Ae=z.repo,Z;t[118]===z.target?Z=t[119]:(Z=c(z.target),t[118]=z.target,t[119]=Z);let Q;t[120]!==z.branch||t[121]!==z.owner||t[122]!==z.repo||t[123]!==z.target.kind||t[124]!==Z?(Q=(0,E.jsx)(oe,{owner:ke,repo:Ae,path:Z,kind:z.target.kind,branch:z.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=z.branch,t[121]=z.owner,t[122]=z.repo,t[123]=z.target.kind,t[124]=Z,t[125]=Q):Q=t[125];let je;t[126]!==J||t[127]!==X||t[128]!==Q?(je=(0,E.jsxs)(ie,{children:[J,X,Q]}),t[126]=J,t[127]=X,t[128]=Q,t[129]=je):je=t[129];let Me;t[130]!==g||t[131]!==B||t[132]!==F||t[133]!==Oe||t[134]!==V||t[135]!==P||t[136]!==H||t[137]!==U||t[138]!==T?(Me=F?(0,E.jsxs)(`div`,{ref:ge,tabIndex:-1,className:`rounded-lg border border-destructive/40 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,E.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,E.jsx)(r,{id:`aiArms`})}),Oe?(0,E.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,E.jsx)(r,{id:`4BITzH`}),` `,(0,E.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Oe,`"`]})]}):null,(0,E.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`Llyqvo`})}),(0,E.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,E.jsx)(`li`,{children:(0,E.jsx)(r,{id:`6LbUG7`})}),(0,E.jsx)(`li`,{children:(0,E.jsx)(r,{id:`_pY_Vq`})}),(0,E.jsx)(`li`,{children:(0,E.jsx)(r,{id:`J6mxC1`})})]}),(0,E.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,E.jsx)(o,{onClick:()=>{H()},"data-testid":`share-receive-clone-retry`,children:(0,E.jsx)(r,{id:`KDw4GX`})}),(0,E.jsx)(o,{variant:`outline`,onClick:()=>{U()},disabled:T||P,"data-testid":`share-receive-error-local`,children:(0,E.jsx)(r,{id:`xFQRu4`})})]})]}):(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,E.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{H()},disabled:g!==void 0&&!B,"aria-disabled":g!==void 0&&!B,children:[(0,E.jsx)(`span`,{className:`text-sm font-semibold`,children:V}),(0,E.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`fj5YiP`})})]}),(0,E.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{U()},disabled:T||P,children:[(0,E.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,E.jsx)(r,{id:`HfI1dR`})}),(0,E.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`_qD6mn`})})]})]}),t[130]=g,t[131]=B,t[132]=F,t[133]=Oe,t[134]=V,t[135]=P,t[136]=H,t[137]=U,t[138]=T,t[139]=Me):Me=t[139];let Ne;t[140]!==N||t[141]!==j||t[142]!==g||t[143]!==W||t[144]!==Ee?(Ne=g?(0,E.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:j===null?(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:(0,E.jsx)(r,{id:`UDFrWm`})}):j.authenticated?(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:(0,E.jsx)(r,{id:`VAHWL_`,values:{signedInLogin:Ee},components:{0:(0,E.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:(0,E.jsx)(r,{id:`SgKLfA`})}),(0,E.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{W()},disabled:N,children:N?(0,E.jsx)(r,{id:`PKLY-1`}):(0,E.jsx)(r,{id:`3jod3l`})})]})}):null,t[140]=N,t[141]=j,t[142]=g,t[143]=W,t[144]=Ee,t[145]=Ne):Ne=t[145];let Pe;t[146]!==F||t[147]!==Te?(Pe=F?null:(0,E.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,E.jsx)(r,{id:`RJ3a8Z`,values:{lookingForUrl:Te},components:{0:(0,E.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=F,t[147]=Te,t[148]=Pe):Pe=t[148];let Fe;t[149]!==Me||t[150]!==Ne||t[151]!==Pe?(Fe=(0,E.jsxs)(l,{children:[Me,Ne,Pe]}),t[149]=Me,t[150]=Ne,t[151]=Pe,t[152]=Fe):Fe=t[152];let Ie;t[153]===v?Ie=t[154]:(Ie=()=>v.dismiss(),t[153]=v,t[154]=Ie);let Le;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,E.jsx)(r,{id:`dEgA5A`}),t[155]=Le):Le=t[155];let Re;t[156]===Ie?Re=t[157]:(Re=(0,E.jsx)(u,{children:(0,E.jsx)(o,{variant:`outline`,onClick:Ie,children:Le})}),t[156]=Ie,t[157]=Re);let $;t[158]!==je||t[159]!==Fe||t[160]!==Re?($=(0,E.jsxs)(re,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[je,Fe,Re]}),t[158]=je,t[159]=Fe,t[160]=Re,t[161]=$):$=t[161];let ze;return t[162]!==q||t[163]!==$?(ze=(0,E.jsx)(d,{open:!0,onOpenChange:q,children:$}),t[162]=q,t[163]=$,t[164]=ze):ze=t[164],ze}function se(e){return e.preventDefault()}function ce(e){return e.preventDefault()}function le(e){return e===null?e:T(e)}function ue(e){return e===null?e:w(e,{ok:!0})}function de(e){return e===null?e:S(e)}export{A as ShareReceiveDialog};
|
package/dist/public/assets/{ShareReceiveMissDialog-NFqekHGn.js → ShareReceiveMissDialog-CDei4CzD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{a as i,i as a,n as o,o as s,r as c}from"./pending-receive-nav-store-D2Wl34aG.js";import{t as l}from"./miss-dialog-store-CsiJb9Ou.js";import{c as u,i as d,n as f,s as p,t as m}from"./dialog-BJEjKJjL.js";import{l as h,u as g}from"./doc-hash-BJkweiX9.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(l.subscribe,l.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=s(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){l.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(i(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){c.arm(o(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(p,{children:(0,y.jsx)(u,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(a,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(f,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(m,{open:!0,onOpenChange:D,children:(0,y.jsxs)(d,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o,t as s}from"./radio-group-G1GR05Rb.js";import{t as c}from"./button-DzgjsZzC.js";import{n as l}from"./dist-BGzUo_18.js";import{t as u}from"./ConfigSharingInfoTooltip-DSloJmkE.js";import{t as d}from"./channel-cli-copy-DOAEiMde.js";import{t as f}from"./skeleton-CrbF9ppq.js";import{t as p}from"./SettingsSectionHeader-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o,t as s}from"./radio-group-G1GR05Rb.js";import{t as c}from"./button-DzgjsZzC.js";import{n as l}from"./dist-BGzUo_18.js";import{t as u}from"./ConfigSharingInfoTooltip-DSloJmkE.js";import{t as d}from"./channel-cli-copy-DOAEiMde.js";import{t as f}from"./skeleton-CrbF9ppq.js";import{t as p}from"./SettingsSectionHeader-BKhNIRp2.js";var m=a(),h=e(n(),1),g=t(),_=`settings-sharing-title`;function v(){let e=(0,m.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,g.jsx)(y,{}):(0,g.jsx)(b,{}),e[0]=n):n=e[0],n}function y(){let e=(0,m.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=d(),e[0]=t):t=e[0];let n=t,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,g.jsx)(r,{id:`cs4mps`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,g.jsx)(`section`,{"aria-labelledby":_,className:`space-y-3`,"data-field":`section:sharing`,children:(0,g.jsx)(p,{titleId:_,title:i,scope:`project`,level:`block`,children:(0,g.jsx)(r,{id:`UbQzWP`,values:{cliCommand:n},components:{0:(0,g.jsx)(`code`,{}),1:(0,g.jsx)(`code`,{}),2:(0,g.jsx)(`code`,{})}})})}),e[2]=a):a=e[2],a}function b(){let e=(0,m.c)(29),{_:t}=i(),[n,a]=(0,h.useState)(null),[d,v]=(0,h.useState)(!1),[y,b]=(0,h.useState)(null),C;e[0]===t?C=e[1]:(C=async function(){let e=window.okDesktop?.sharing;if(e)try{a(await e.status())}catch(e){let n=e;l.error(n instanceof Error?n.message:t({id:`K0N7zS`})),a(S)}},e[0]=t,e[1]=C);let w=C,T;e[2]===w?T=e[3]:(T=()=>{w()},e[2]=w,e[3]=T);let E;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],e[4]=E):E=e[4],(0,h.useEffect)(T,E);let D;e[5]!==t||e[6]!==d||e[7]!==w||e[8]!==n?(D=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||d||n.mode===e)return;v(!0),b(null);let i=null,a=null;try{i=await r.setMode(e)}catch(e){a=e}if(v(!1),a!==null){l.error(a instanceof Error?a.message:t({id:`qZv5ZR`}));return}i!==null&&(i.kind===`refused-tracked`?(b({tracked:i.tracked,remediation:i.remediation}),l.error(t({id:`z2JdQ-`}),{duration:5e3})):i.kind===`no-exclude`?l.warning(i.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:i.reason}})):l.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await w())},e[5]=t,e[6]=d,e[7]=w,e[8]=n,e[9]=D):D=e[9];let O=D;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,g.jsx)(p,{titleId:_,title:(0,g.jsx)(r,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,g.jsxs)(`section`,{"aria-labelledby":_,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,g.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,g.jsx)(`span`,{className:`sr-only`,children:(0,g.jsx)(r,{id:`eQn7nI`})}),(0,g.jsx)(f,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let k=n.mode===`no-git`,A;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,g.jsx)(r,{id:`cs4mps`}),e[12]=A):A=e[12];let j;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,g.jsx)(p,{titleId:_,title:A,scope:`project`,level:`block`,adornment:(0,g.jsx)(u,{}),children:(0,g.jsx)(r,{id:`50gx7V`})}),e[13]=j):j=e[13];let M;e[14]!==d||e[15]!==k||e[16]!==O||e[17]!==n.mode?(M=k?(0,g.jsx)(`p`,{className:`rounded-md border border-warning/40 px-3 py-2 text-sm text-foreground`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,g.jsx)(r,{id:`ju38ms`})}):(0,g.jsxs)(s,{value:n.mode,onValueChange:e=>void O(e),disabled:d,className:`gap-2`,"aria-labelledby":_,"data-testid":`settings-sharing-radiogroup`,children:[(0,g.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,g.jsx)(o,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,g.jsxs)(`span`,{children:[(0,g.jsx)(`span`,{className:`font-medium`,children:(0,g.jsx)(r,{id:`QjzFZj`})}),(0,g.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,g.jsx)(r,{id:`un-K1H`})})]})]}),(0,g.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,g.jsx)(o,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,g.jsxs)(`span`,{children:[(0,g.jsx)(`span`,{className:`font-medium`,children:(0,g.jsx)(r,{id:`0Gd0NU`})}),(0,g.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,g.jsx)(r,{id:`dJw2_7`})})]})]})]}),e[14]=d,e[15]=k,e[16]=O,e[17]=n.mode,e[18]=M):M=e[18];let N;e[19]===y?N=e[20]:(N=y===null?null:(0,g.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,g.jsx)(`p`,{className:`font-semibold`,children:(0,g.jsx)(r,{id:`ZscwQ0`})}),(0,g.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:y.remediation}),(0,g.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>b(null),children:(0,g.jsx)(r,{id:`1QfxQT`})})]}),e[19]=y,e[20]=N);let P;e[21]!==y||e[22]!==n.mode||e[23]!==n.trackedUpstream?(P=n.trackedUpstream.length>0&&n.mode!==`no-git`&&y===null?(0,g.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,g.jsx)(`p`,{className:`font-medium`,children:(0,g.jsx)(r,{id:`LhWYpm`})}),(0,g.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(x)}),(0,g.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,g.jsx)(r,{id:`1XSMhZ`,components:{0:(0,g.jsx)(`code`,{}),1:(0,g.jsx)(`code`,{})}})})]}):null,e[21]=y,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=P):P=e[24];let F;return e[25]!==M||e[26]!==N||e[27]!==P?(F=(0,g.jsxs)(`section`,{"aria-labelledby":_,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[j,M,N,P]}),e[25]=M,e[26]=N,e[27]=P,e[28]=F):F=e[28],F}function x(e){return(0,g.jsx)(`li`,{children:e},e)}function S(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}export{v as SharingSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t,r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{i,n as a,r as o,t as s}from"./tooltip-Bz6z4_se.js";import{et as c}from"./schemas-api-CL5ZXlEj.js";import{t as l}from"./triangle-alert-BXrUEeRU.js";var u=r(),d=e();function f(e){return e<1e3?`${e}`:`${Math.round(e/100)/10}k`}function p(e){let t=(0,u.c)(33),{tokens:r,budget:c}=e,{_:p}=n(),m=c!==void 0&&r>c,h,g,_,v,y,b,x,S;if(t[0]!==p||t[1]!==c||t[2]!==m||t[3]!==r){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=c===void 0?``:f(c),n=m||void 0,u=m?`text-warning`:void 0,C;t[12]===r?C=t[13]:(C=f(r),t[12]=r,t[13]=C);let w=m?(0,d.jsx)(`span`,{role:`img`,"aria-label":p({id:`nem6R7`,values:{budgetLabel:e}}),children:(0,d.jsx)(l,{className:`ms-0.5 inline size-3 align-[-0.1em]`,"aria-hidden":`true`})}):null,T;t[14]!==n||t[15]!==u||t[16]!==C||t[17]!==w?(T=(0,d.jsxs)(`span`,{"data-over-budget":n,className:u,children:[C,w]}),t[14]=n,t[15]=u,t[16]=C,t[17]=w,t[18]=T):T=t[18];let E=T;if(!m){S=E;break bb0}_=o,g=s,t[19]===E?x=t[20]:(x=(0,d.jsx)(i,{asChild:!0,children:E}),t[19]=E,t[20]=x),h=a,v=`right`,y=`max-w-xs`,b=p({id:`JsHvhz`,values:{budgetLabel:e}})}t[0]=p,t[1]=c,t[2]=m,t[3]=r,t[4]=h,t[5]=g,t[6]=_,t[7]=v,t[8]=y,t[9]=b,t[10]=x,t[11]=S}else h=t[4],g=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],S=t[11];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[21]!==h||t[22]!==v||t[23]!==y||t[24]!==b?(C=(0,d.jsx)(h,{side:v,className:y,children:b}),t[21]=h,t[22]=v,t[23]=y,t[24]=b,t[25]=C):C=t[25];let w;t[26]!==g||t[27]!==x||t[28]!==C?(w=(0,d.jsxs)(g,{children:[x,C]}),t[26]=g,t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==_||t[31]!==w?(T=(0,d.jsx)(_,{children:w}),t[30]=_,t[31]=w,t[32]=T):T=t[32],T}function m(e){let n=(0,u.c)(22),{size:r}=e,i=r.alwaysOn+r.onTrigger+r.onDemand,a;n[0]===r.alwaysOn?a=n[1]:(a=(0,d.jsx)(p,{tokens:r.alwaysOn,budget:100}),n[0]=r.alwaysOn,n[1]=a);let o;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,d.jsx)(t,{id:`eTsJYJ`}),n[2]=o):o=n[2];let s;n[3]===a?s=n[4]:(s=(0,d.jsxs)(`span`,{children:[a,` `,o]}),n[3]=a,n[4]=s);let l;n[5]===r.onTrigger?l=n[6]:(l=(0,d.jsxs)(`span`,{children:[(0,d.jsx)(p,{tokens:r.onTrigger,budget:c}),` SKILL.md`]}),n[5]=r.onTrigger,n[6]=l);let f;n[7]===r.onDemand?f=n[8]:(f=(0,d.jsx)(p,{tokens:r.onDemand}),n[7]=r.onDemand,n[8]=f);let m;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,d.jsx)(t,{id:`ae9Ozt`}),n[9]=m):m=n[9];let h;n[10]===f?h=n[11]:(h=(0,d.jsxs)(`span`,{children:[f,` `,m]}),n[10]=f,n[11]=h);let g;n[12]===i?g=n[13]:(g=(0,d.jsx)(p,{tokens:i}),n[12]=i,n[13]=g);let _;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,d.jsx)(t,{id:`ONchxy`}),n[14]=_):_=n[14];let v;n[15]===g?v=n[16]:(v=(0,d.jsxs)(`span`,{className:`text-foreground/80`,children:[g,` `,_]}),n[15]=g,n[16]=v);let y;return n[17]!==v||n[18]!==s||n[19]!==l||n[20]!==h?(y=(0,d.jsxs)(`span`,{"data-testid":`skill-cost-value`,className:`flex flex-col gap-0.5 font-mono text-[13px] text-muted-foreground`,children:[s,l,h,v]}),n[17]=v,n[18]=s,n[19]=l,n[20]=h,n[21]=y):y=n[21],y}export{f as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./label-CvMpFFbN.js";import{t as s}from"./button-DzgjsZzC.js";import{n as c}from"./dist-BGzUo_18.js";import{O as ee}from"./schemas-api-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./label-CvMpFFbN.js";import{t as s}from"./button-DzgjsZzC.js";import{n as c}from"./dist-BGzUo_18.js";import{O as ee}from"./schemas-api-CL5ZXlEj.js";import{a as l,c as te,i as u,n as d,o as f,s as p,t as m}from"./dialog-BJEjKJjL.js";import{t as h}from"./input-BsFOyzfK.js";import{l as ne}from"./skill-scope-DOTLd4gL.js";import{E as re,u as ie}from"./skills-api-CCijBzjo.js";import{t as ae}from"./MultiFileDiff-BFbTHRMN.js";import{t as oe}from"./pierre-theme-DzTcpkj5.js";var se=a(),g=e(n(),1),_=t();function v(e){let t=(0,se.c)(60),{target:n,onOpenChange:a}=e,{_:v}=i(),y=(0,g.useId)(),[b,x]=(0,g.useState)(null),[S,C]=(0,g.useState)(null),[w,T]=(0,g.useState)(!1),[E,D]=(0,g.useState)(!1),[O,k]=(0,g.useState)(``),[A,j]=(0,g.useState)(!1),M;t[0]===n?M=t[1]:(M=()=>{if(x(null),C(null),T(!1),D(!1),!n)return;let{skill:e,editor:t}=n,r=e.absolutePath?.slice(0,-`/${e.path}`.length)??null;if(r===null){T(!0);return}let i=`${r}/${e.path.replace(/\/SKILL\.mdx?$/i,``)}`,a=`${r}/${ne(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,C],[a,x]])ie({source:t,name:e.name},o.signal).then(e=>{o.signal.aborted||(e.ok?n(e.skillMd):T(!0))}).catch(()=>{o.signal.aborted||T(!0)});return()=>o.abort()},t[0]=n,t[1]=M);let N=n?.skill.scope,P=n?.skill.name,F=n?.editor,I;if(t[2]!==N||t[3]!==P||t[4]!==F?(I=[N,P,F],t[2]=N,t[3]=P,t[4]=F,t[5]=I):I=t[5],(0,g.useEffect)(M,I),!n)return null;let{skill:L,editor:R}=n,z;t[6]!==v||t[7]!==R||t[8]!==a||t[9]!==L.name||t[10]!==L.scope||t[11]!==n||t[12]!==O?(z=async function(e){if(!n)return;j(!0);let t=await re({scope:L.scope,name:L.name,editor:R,action:e,...e===`rename`?{toName:O.trim()}:{}});if(j(!1),!t.ok){c.error(v({id:`MIF36T`,values:{0:t.error}}));return}c.success(v(e===`align`?{id:`QKgePK`,values:{editor:R}}:e===`make-source`?{id:`It9oAP`,values:{editor:R}}:{id:`b2ezG_`,values:{0:O.trim()}})),a(!1)},t[6]=v,t[7]=R,t[8]=a,t[9]=L.name,t[10]=L.scope,t[11]=n,t[12]=O,t[13]=z):z=t[13];let B=z,V,H;t[14]!==L.name||t[15]!==O?(H=O.trim(),V=H===``||!ee.test(H)||H===L.name,t[14]=L.name,t[15]=O,t[16]=V,t[17]=H):(V=t[16],H=t[17]);let U=V,W;t[18]!==A||t[19]!==a?(W=e=>{!e&&!A&&a(!1)},t[18]=A,t[19]=a,t[20]=W):W=t[20];let G;t[21]!==R||t[22]!==L.name?(G=(0,_.jsx)(te,{children:(0,_.jsx)(r,{id:`q8aCbb`,values:{0:L.name,editor:R}})}),t[21]=R,t[22]=L.name,t[23]=G):G=t[23];let K;t[24]===R?K=t[25]:(K=(0,_.jsx)(l,{children:(0,_.jsx)(r,{id:`QASTNu`,values:{editor:R}})}),t[24]=R,t[25]=K);let q;t[26]!==K||t[27]!==G?(q=(0,_.jsxs)(p,{children:[G,K]}),t[26]=K,t[27]=G,t[28]=q):q=t[28];let J;t[29]!==S||t[30]!==b||t[31]!==w||t[32]!==L.name?(J=S!==null&&b!==null?(0,_.jsx)(ae,{className:`pierre-diff`,oldFile:{name:L.name,contents:S},newFile:{name:L.name,contents:b},options:{overflow:`wrap`,diffStyle:`unified`,theme:oe()}}):w?(0,_.jsx)(`div`,{className:`flex min-h-56 items-center justify-center px-6 text-center text-muted-foreground text-sm`,children:(0,_.jsx)(r,{id:`5BlXTD`})}):(0,_.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,_.jsx)(r,{id:`1V17kO`})}),t[29]=S,t[30]=b,t[31]=w,t[32]=L.name,t[33]=J):J=t[33];let Y;t[34]!==B||t[35]!==R||t[36]!==y||t[37]!==U||t[38]!==E||t[39]!==L.name||t[40]!==O||t[41]!==H?(Y=E?(0,_.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,_.jsx)(o,{htmlFor:y,children:(0,_.jsx)(r,{id:`pSimwP`,values:{editor:R}})}),(0,_.jsx)(h,{id:y,value:O,onChange:e=>k(e.target.value),placeholder:`${L.name}-${R}`,"aria-invalid":U&&H!==``,onKeyDown:e=>{e.key===`Enter`&&!U&&B(`rename`)}})]}):null,t[34]=B,t[35]=R,t[36]=y,t[37]=U,t[38]=E,t[39]=L.name,t[40]=O,t[41]=H,t[42]=Y):Y=t[42];let X;t[43]!==J||t[44]!==Y?(X=(0,_.jsxs)(d,{className:`min-h-0 flex-1 overflow-auto`,children:[J,Y]}),t[43]=J,t[44]=Y,t[45]=X):X=t[45];let Z;t[46]!==B||t[47]!==A||t[48]!==R||t[49]!==U||t[50]!==E||t[51]!==L.name?(Z=(0,_.jsx)(f,{children:E?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s,{variant:`outline`,onClick:()=>D(!1),disabled:A,children:(0,_.jsx)(r,{id:`iH8pgl`})}),(0,_.jsx)(s,{onClick:()=>void B(`rename`),disabled:A||U,children:(0,_.jsx)(r,{id:`AT0e50`})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s,{variant:`outline`,onClick:()=>{k(`${L.name}-${R}`),D(!0)},disabled:A,children:(0,_.jsx)(r,{id:`AT0e50`})}),(0,_.jsx)(s,{variant:`outline`,onClick:()=>void B(`make-source`),disabled:A,children:(0,_.jsx)(r,{id:`xWomUD`,values:{editor:R}})}),(0,_.jsx)(s,{onClick:()=>void B(`align`),disabled:A,children:(0,_.jsx)(r,{id:`PZn2LP`})})]})}),t[46]=B,t[47]=A,t[48]=R,t[49]=U,t[50]=E,t[51]=L.name,t[52]=Z):Z=t[52];let Q;t[53]!==q||t[54]!==X||t[55]!==Z?(Q=(0,_.jsxs)(u,{className:`flex max-h-[85vh] w-full flex-col sm:max-w-5xl`,children:[q,X,Z]}),t[53]=q,t[54]=X,t[55]=Z,t[56]=Q):Q=t[56];let $;return t[57]!==Q||t[58]!==W?($=(0,_.jsx)(m,{open:!0,onOpenChange:W,children:Q}),t[57]=Q,t[58]=W,t[59]=$):$=t[59],$}export{v as SkillForkDialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./AgentIconCluster-DYP1yNXm.js";import{i as s,n as c,t as l}from"./tooltip-Bz6z4_se.js";import{t as u}from"./button-DzgjsZzC.js";import{n as d}from"./dist-BGzUo_18.js";import{c as f}from"./documents-events-ddyuXdQl.js";import{n as p}from"./constants-editors-DmmORwNP.js";import{n as m,r as h,t as g}from"./skill-targets-schema-D6kA7J61.js";import{t as _}from"./createLucideIcon-DdBzwsHe.js";import{a as v,f as y,i as b,m as x,n as S,o as C,p as w,u as T}from"./dropdown-menu-5XqyQTVx.js";import{t as E}from"./folder-QqUoFRPR.js";import"./constants-skills-BLHVRW90.js";import{i as ee,l as te,n as D,r as O}from"./skill-scope-DOTLd4gL.js";import{a as k,c as A,i as j,l as M,n as N,o as P,s as F,u as I}from"./context-menu-B5MxEep2.js";import{F as L,S as ne,j as R,x as z}from"./skills-api-zXSg3eSX.js";import{t as B}from"./use-skills-B2fLFrq6.js";import{t as V}from"./ChangedOutsideBadge-DhpGZlDx.js";var H=_(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),U=e(n(),1),W=a(),G=t();function K(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(j,{...r}):(0,G.jsx)(b,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function re(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(k,{...r}):(0,G.jsx)(v,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ie(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(N,{...r}):(0,G.jsx)(S,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ae(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(P,{...r}):(0,G.jsx)(C,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function oe(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(F,{...r}):(0,G.jsx)(T,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function se(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(A,{...r}):(0,G.jsx)(y,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ce(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(M,{...r}):(0,G.jsx)(w,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function le(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(I,{...r}):(0,G.jsx)(x,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var q=Object.freeze({hosts:null,source:null}),J=new Map,Y=new Map;function X(e,t){return`${e}:${t}`}function Z(e){return J.get(e)??q}function ue(e,t){let n=Y.get(e)??new Set;return Y.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Y.delete(e)}}function Q(e,t){let n=Z(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?J.delete(e):J.set(e,r);for(let t of Y.get(e)??[])t()}}var de=g.options,fe=m.options,pe=`.agents/`;function me({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${te(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(pe)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?fe:de,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:O(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[O(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=O(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var he=`min-w-[24rem]`;function ge(e,t){let n=(0,W.c)(45),r=t.installingName===e.name,i=(0,U.useRef)(e),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,U.useEffect)(c,l);let u,f;n[3]===e?(u=n[4],f=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},f=[e],n[3]=e,n[4]=u,n[5]=f),(0,U.useEffect)(u,f);let p=r||a,m;n[6]!==e.name||n[7]!==e.scope?(m=X(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=m):m=n[8];let g=m,_,v;n[9]===g?(_=n[10],v=n[11]):(_=e=>ue(g,e),v=()=>Z(g),n[9]=g,n[10]=_,n[11]=v);let y=(0,U.useSyncExternalStore)(_,v),b=y.hosts,x=y.source,S,C;n[12]!==x||n[13]!==g||n[14]!==e.hosts?(S=()=>{x!==null&&e.hosts[0]===x&&Q(g,{source:null})},C=[e.hosts,x,g],n[12]=x,n[13]=g,n[14]=e.hosts,n[15]=S,n[16]=C):(S=n[15],C=n[16]),(0,U.useEffect)(S,C);let w=e.linkMode===!0,T=b??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let ee=E,te=b?b.length>0:e.installed,D=(0,U.useRef)(e.hosts),O,k;n[19]!==b||n[20]!==e.hosts?(O=()=>{b===null&&(D.current=e.hosts)},k=[b,e.hosts],n[19]=b,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,U.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==g||n[26]!==j?(M=()=>{let e=Z(g).hosts;e&&[...e].sort().join(`,`)===j&&Q(g,{hosts:null})},N=[j,g],n[25]=g,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,U.useEffect)(M,N);let P=(0,U.useRef)(null),F=(0,U.useRef)(null),I,ne;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},ne=[],n[29]=I,n[30]=ne):(I=n[29],ne=n[30]),(0,U.useEffect)(I,ne);let B;n[31]!==t||n[32]!==g||n[33]!==e?(B=function(n,r){D.current=n,Q(g,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(h));if(!r.ok){Q(g,{hosts:null});return}D.current=[...r.hosts],Q(g,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=g,n[33]=e,n[34]=B):B=n[34];let V=B,H;return n[35]!==t||n[36]!==V||n[37]!==ee||n[38]!==te||n[39]!==p||n[40]!==x||n[41]!==g||n[42]!==w||n[43]!==e?(H={hostSet:ee,installed:te,installing:p,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),V([...n],!0)},installAll(){let t=e.scope===`global`?fe:de,n=D.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||D.current.includes(e));V([...n,...i],!1)},linkMode:w,sourceHost:x??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>z({scope:e.scope,name:e.name,dir:n,mode:r})).then(ve)},unplaceAt(n){t.runLocationWrite(e,()=>L({scope:e.scope,name:e.name,path:n})).then(_e)},setSource(n){Q(g,{source:n}),t.runLocationWrite(e,()=>R({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(g,{source:null}),d.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=V,n[37]=ee,n[38]=te,n[39]=p,n[40]=x,n[41]=g,n[42]=w,n[43]=e,n[44]=H):H=n[44],H}function _e(e){e.ok||d.error(e.error)}function ve(e){e.ok||d.error(e.error)}function $(e){let t=(0,W.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,G.jsx)(s,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,G.jsx)(c,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,G.jsxs)(l,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function ye(e){let t=(0,W.c)(77),{toggles:n,skill:a,onResolveFork:s,onRunStart:c,menuKind:l}=e,m=l===void 0?`dropdown`:l,{_:h}=i(),{hostSet:g,toggleEditor:_,installAll:v}=n,y=B(),b,x,S,C,w,T,O,k,A,j;if(t[0]!==h||t[1]!==y.data||t[2]!==y.status||t[3]!==g||t[4]!==v||t[5]!==m||t[6]!==s||t[7]!==c||t[8]!==a||t[9]!==_||t[10]!==n){let{pathFor:e,aliases:i,rows:l,sourceRow:M,sourceHost:N,conflicted:P,drifted:F,linked:I,expectedMode:L,convertible:R,customRootRows:z}=me({skill:a,allSkills:y.status===`ready`?y.data:null,hostSet:g,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});w=l,T=M,C=L,x=R,S=z;let B=e=>D(i,e),H=Ee,U=e=>{let t=B(e);return t.length===0?!0:window.confirm(h({id:`Uobeu9`,values:{0:t.map(H).join(`, `),rootRel:e}}))},W;t[21]!==h||t[22]!==a?(W=(e,t)=>{let n=e.includes(`/`)?e:te(e,a?.scope??`project`);return(0,G.jsx)($,{hint:h({id:`0dslv8`,values:{0:H(e),1:H(e),2:a?.name??``,poolRootRel:t,subRoot:n}}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":h({id:`G6Lrs_`,values:{0:H(e)}}),onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(h({id:`iiqOKM`,values:{0:H(e),1:a.name,2:H(e),subRoot:n,poolRootRel:t}}))&&ne({scope:a.scope,root:n,action:`unlink`,exclude:[a.name]}).then(e=>{e.ok?f():d.error(h({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,G.jsx)(o,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=h,t[22]=a,t[23]=W):W=t[23];let K=W;b=n.installing;let re=ee(a),oe=Te,se;t[24]!==h||t[25]!==c||t[26]!==n?(se=(e,t,i)=>{let a=i===`link`?`copy`:`link`;return(0,G.jsx)($,{hint:h(i===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(h(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(c?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:i===`link`?(0,G.jsx)(r,{id:`uUCrBv`}):(0,G.jsx)(r,{id:`iaPtht`})})})},t[24]=h,t[25]=c,t[26]=n,t[27]=se):se=t[27];let ce=se,le;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,G.jsx)(r,{id:`npcziF`}),t[28]=le):le=t[28];let q;t[29]===h?q=t[30]:(q=h({id:`6f_UX4`}),t[29]=h,t[30]=q);let J;t[31]===v?J=t[32]:(J=()=>v(),t[31]=v,t[32]=J);let Y;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,G.jsx)(r,{id:`N40H-G`}),t[33]=Y):Y=t[33];let X;t[34]!==b||t[35]!==J?(X=(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:b,onClick:J,"data-testid":`skill-install-all`,children:Y}),t[34]=b,t[35]=J,t[36]=X):X=t[36];let Z;t[37]!==q||t[38]!==X?(Z=(0,G.jsx)($,{hint:q,children:X}),t[37]=q,t[38]=X,t[39]=Z):Z=t[39],t[40]!==m||t[41]!==Z?(O=(0,G.jsxs)(ae,{menuKind:m,className:`flex items-center justify-between gap-2`,children:[le,Z]}),t[40]=m,t[41]=Z,t[42]=O):O=t[42],k=T===null?null:(0,G.jsx)($,{hint:h({id:`pXB6SL`}),children:(0,G.jsxs)(ie,{menuKind:m,disabled:b,checked:!0,onSelect:we,"data-testid":`skill-source-row`,children:[(0,G.jsx)(E,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:T}),(()=>{let e=oe(T).split(`/`).slice(0,-1).join(`/`),t=B(e);return t.length>0?(0,G.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>K(t,e))}):null})(),(0,G.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,G.jsx)(r,{id:`tiFPjk`})})]})]})}),A=w.map(t=>{let i=e(t),c=t===`agents`?`.agents`:p[t],l=oe(i).split(`/`).slice(0,-1).join(`/`),d=B(l);return(0,G.jsx)($,{hint:P.has(t)?h({id:`8HvJlU`,values:{0:i??c}}):t===N?i?h({id:`ssk6rl`,values:{path:i}}):c:g.has(t)?h(i?{id:`9ieZhu`,values:{path:i}}:{id:`n3T3EE`,values:{label:c}}):re?.editor===t?h({id:`_3S4Ql`,values:{0:a?.name??``,1:re.plugin,2:i??c,label:c}}):h(i?N===void 0?{id:`xk133d`,values:{path:i}}:C===`link`?{id:`1LtA5r`,values:{path:i}}:{id:`opPbzN`,values:{path:i}}:{id:`Pp0Vgd`,values:{label:c}}),children:(0,G.jsxs)(ie,{menuKind:m,disabled:b,checked:g.has(t),onCheckedChange:e=>{P.has(t)||e===!0&&!U(l)||_(t,e===!0)},onSelect:Ce,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,G.jsx)(o,{host:t,"aria-hidden":!0,className:`size-4`}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:i??c}),d.length>0?(0,G.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:d.map(e=>K(e,l))}):null,re?.editor===t&&!g.has(t)?(0,G.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,G.jsx)(r,{id:`scRzTw`})}):null,P.has(t)?(0,G.jsx)($,{hint:h({id:`_O7dJS`}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),s?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,G.jsx)(r,{id:`jng7Ko`})})}):t===N?(0,G.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,G.jsx)(r,{id:`tiFPjk`})}):g.has(t)&&a?.hosts?(0,G.jsxs)(G.Fragment,{children:[!b&&(I.has(t)?`link`:`copy`)!==C?ce(t,i??c,I.has(t)?`link`:`copy`):null,(0,G.jsx)($,{hint:h({id:`nBgzKO`}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,G.jsx)(r,{id:`VNNRfN`})})})]}):null,!b&&F.has(oe(i))?(0,G.jsx)($,{hint:h({id:`iz1LdD`}),children:(0,G.jsx)(V,{testId:`skill-drift-${t}`})}):null]})]})},t)}),j=S.map(e=>{let t=e.display;return(0,G.jsx)($,{hint:e.placed===null?h(N===void 0?{id:`xk133d`,values:{path:t}}:C===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):h({id:`9ieZhu`,values:{path:t}}),children:(0,G.jsxs)(ie,{menuKind:m,disabled:b,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!U(e.root))return;n.placeAt(e.root,C)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Se,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,G.jsx)(o,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,G.jsx)(E,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),B(e.root).length>0?(0,G.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:B(e.root).map(t=>K(t,e.root))}):null,!b&&e.placed!==null&&F.has(e.placed.path)?(0,G.jsx)($,{hint:h({id:`iz1LdD`}),children:(0,G.jsx)(V,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,G.jsxs)(G.Fragment,{children:[!b&&e.placed.mode!==C?ce(e.root,e.display,e.placed.mode):null,(0,G.jsx)($,{hint:h({id:`nBgzKO`}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,G.jsx)(r,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=h,t[1]=y.data,t[2]=y.status,t[3]=g,t[4]=v,t[5]=m,t[6]=s,t[7]=c,t[8]=a,t[9]=_,t[10]=n,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=O,t[18]=k,t[19]=A,t[20]=j}else b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],O=t[17],k=t[18],A=t[19],j=t[20];let M;t[43]!==S||t[44]!==w.length||t[45]!==T?(M=w.length===0&&S.length===0&&T===null?(0,G.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,G.jsx)(r,{id:`MOAoFO`})}):null,t[43]=S,t[44]=w.length,t[45]=T,t[46]=M):M=t[46];let N;t[47]!==h||t[48]!==b||t[49]!==x||t[50]!==C||t[51]!==c||t[52]!==n?(N=x.length>0&&n.convertLocations?(0,G.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=C===`link`?`copy`:`link`,r=x.filter(e=>e.mode!==t);if(r.length===0)return;let i=h(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=h(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(xe).join(`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./AgentIconCluster-DYP1yNXm.js";import{i as s,n as c,t as l}from"./tooltip-Bz6z4_se.js";import{t as u}from"./button-DzgjsZzC.js";import{n as d}from"./dist-BGzUo_18.js";import{c as f}from"./documents-events-ddyuXdQl.js";import{n as p}from"./constants-editors-DmmORwNP.js";import{n as m,r as h,t as g}from"./skill-targets-schema-D6kA7J61.js";import{t as _}from"./createLucideIcon-DdBzwsHe.js";import{a as v,f as y,i as b,m as x,n as S,o as C,p as w,u as T}from"./dropdown-menu-5XqyQTVx.js";import{t as E}from"./folder-QqUoFRPR.js";import"./constants-skills-BLHVRW90.js";import{i as ee,l as te,n as D,r as O}from"./skill-scope-DOTLd4gL.js";import{a as k,c as A,i as j,l as M,n as N,o as P,s as F,u as I}from"./context-menu-B5MxEep2.js";import{F as L,S as ne,j as R,x as z}from"./skills-api-CCijBzjo.js";import{t as B}from"./use-skills-CkvdjORj.js";import{t as V}from"./ChangedOutsideBadge-BfH3veLO.js";var H=_(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),U=e(n(),1),W=a(),G=t();function K(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(j,{...r}):(0,G.jsx)(b,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function re(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(k,{...r}):(0,G.jsx)(v,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ie(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(N,{...r}):(0,G.jsx)(S,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ae(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(P,{...r}):(0,G.jsx)(C,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function oe(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(F,{...r}):(0,G.jsx)(T,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function se(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(A,{...r}):(0,G.jsx)(y,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ce(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(M,{...r}):(0,G.jsx)(w,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function le(e){let t=(0,W.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,G.jsx)(I,{...r}):(0,G.jsx)(x,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var q=Object.freeze({hosts:null,source:null}),J=new Map,Y=new Map;function X(e,t){return`${e}:${t}`}function Z(e){return J.get(e)??q}function ue(e,t){let n=Y.get(e)??new Set;return Y.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Y.delete(e)}}function Q(e,t){let n=Z(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?J.delete(e):J.set(e,r);for(let t of Y.get(e)??[])t()}}var de=g.options,fe=m.options,pe=`.agents/`;function me({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${te(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(pe)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?fe:de,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:O(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[O(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=O(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var he=`min-w-[24rem]`;function ge(e,t){let n=(0,W.c)(45),r=t.installingName===e.name,i=(0,U.useRef)(e),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,U.useEffect)(c,l);let u,f;n[3]===e?(u=n[4],f=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},f=[e],n[3]=e,n[4]=u,n[5]=f),(0,U.useEffect)(u,f);let p=r||a,m;n[6]!==e.name||n[7]!==e.scope?(m=X(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=m):m=n[8];let g=m,_,v;n[9]===g?(_=n[10],v=n[11]):(_=e=>ue(g,e),v=()=>Z(g),n[9]=g,n[10]=_,n[11]=v);let y=(0,U.useSyncExternalStore)(_,v),b=y.hosts,x=y.source,S,C;n[12]!==x||n[13]!==g||n[14]!==e.hosts?(S=()=>{x!==null&&e.hosts[0]===x&&Q(g,{source:null})},C=[e.hosts,x,g],n[12]=x,n[13]=g,n[14]=e.hosts,n[15]=S,n[16]=C):(S=n[15],C=n[16]),(0,U.useEffect)(S,C);let w=e.linkMode===!0,T=b??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let ee=E,te=b?b.length>0:e.installed,D=(0,U.useRef)(e.hosts),O,k;n[19]!==b||n[20]!==e.hosts?(O=()=>{b===null&&(D.current=e.hosts)},k=[b,e.hosts],n[19]=b,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,U.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==g||n[26]!==j?(M=()=>{let e=Z(g).hosts;e&&[...e].sort().join(`,`)===j&&Q(g,{hosts:null})},N=[j,g],n[25]=g,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,U.useEffect)(M,N);let P=(0,U.useRef)(null),F=(0,U.useRef)(null),I,ne;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},ne=[],n[29]=I,n[30]=ne):(I=n[29],ne=n[30]),(0,U.useEffect)(I,ne);let B;n[31]!==t||n[32]!==g||n[33]!==e?(B=function(n,r){D.current=n,Q(g,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(h));if(!r.ok){Q(g,{hosts:null});return}D.current=[...r.hosts],Q(g,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=g,n[33]=e,n[34]=B):B=n[34];let V=B,H;return n[35]!==t||n[36]!==V||n[37]!==ee||n[38]!==te||n[39]!==p||n[40]!==x||n[41]!==g||n[42]!==w||n[43]!==e?(H={hostSet:ee,installed:te,installing:p,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),V([...n],!0)},installAll(){let t=e.scope===`global`?fe:de,n=D.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||D.current.includes(e));V([...n,...i],!1)},linkMode:w,sourceHost:x??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>z({scope:e.scope,name:e.name,dir:n,mode:r})).then(ve)},unplaceAt(n){t.runLocationWrite(e,()=>L({scope:e.scope,name:e.name,path:n})).then(_e)},setSource(n){Q(g,{source:n}),t.runLocationWrite(e,()=>R({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(g,{source:null}),d.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=V,n[37]=ee,n[38]=te,n[39]=p,n[40]=x,n[41]=g,n[42]=w,n[43]=e,n[44]=H):H=n[44],H}function _e(e){e.ok||d.error(e.error)}function ve(e){e.ok||d.error(e.error)}function $(e){let t=(0,W.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,G.jsx)(s,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,G.jsx)(c,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,G.jsxs)(l,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function ye(e){let t=(0,W.c)(77),{toggles:n,skill:a,onResolveFork:s,onRunStart:c,menuKind:l}=e,m=l===void 0?`dropdown`:l,{_:h}=i(),{hostSet:g,toggleEditor:_,installAll:v}=n,y=B(),b,x,S,C,w,T,O,k,A,j;if(t[0]!==h||t[1]!==y.data||t[2]!==y.status||t[3]!==g||t[4]!==v||t[5]!==m||t[6]!==s||t[7]!==c||t[8]!==a||t[9]!==_||t[10]!==n){let{pathFor:e,aliases:i,rows:l,sourceRow:M,sourceHost:N,conflicted:P,drifted:F,linked:I,expectedMode:L,convertible:R,customRootRows:z}=me({skill:a,allSkills:y.status===`ready`?y.data:null,hostSet:g,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});w=l,T=M,C=L,x=R,S=z;let B=e=>D(i,e),H=Ee,U=e=>{let t=B(e);return t.length===0?!0:window.confirm(h({id:`Uobeu9`,values:{0:t.map(H).join(`, `),rootRel:e}}))},W;t[21]!==h||t[22]!==a?(W=(e,t)=>{let n=e.includes(`/`)?e:te(e,a?.scope??`project`);return(0,G.jsx)($,{hint:h({id:`0dslv8`,values:{0:H(e),1:H(e),2:a?.name??``,poolRootRel:t,subRoot:n}}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":h({id:`G6Lrs_`,values:{0:H(e)}}),onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(h({id:`iiqOKM`,values:{0:H(e),1:a.name,2:H(e),subRoot:n,poolRootRel:t}}))&&ne({scope:a.scope,root:n,action:`unlink`,exclude:[a.name]}).then(e=>{e.ok?f():d.error(h({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,G.jsx)(o,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=h,t[22]=a,t[23]=W):W=t[23];let K=W;b=n.installing;let re=ee(a),oe=Te,se;t[24]!==h||t[25]!==c||t[26]!==n?(se=(e,t,i)=>{let a=i===`link`?`copy`:`link`;return(0,G.jsx)($,{hint:h(i===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-warning/40 bg-warning/10 px-1 font-normal text-[10px] text-warning uppercase tracking-wide hover:bg-warning/20 hover:text-warning dark:hover:bg-warning/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(h(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(c?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:i===`link`?(0,G.jsx)(r,{id:`uUCrBv`}):(0,G.jsx)(r,{id:`iaPtht`})})})},t[24]=h,t[25]=c,t[26]=n,t[27]=se):se=t[27];let ce=se,le;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,G.jsx)(r,{id:`npcziF`}),t[28]=le):le=t[28];let q;t[29]===h?q=t[30]:(q=h({id:`6f_UX4`}),t[29]=h,t[30]=q);let J;t[31]===v?J=t[32]:(J=()=>v(),t[31]=v,t[32]=J);let Y;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,G.jsx)(r,{id:`N40H-G`}),t[33]=Y):Y=t[33];let X;t[34]!==b||t[35]!==J?(X=(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:b,onClick:J,"data-testid":`skill-install-all`,children:Y}),t[34]=b,t[35]=J,t[36]=X):X=t[36];let Z;t[37]!==q||t[38]!==X?(Z=(0,G.jsx)($,{hint:q,children:X}),t[37]=q,t[38]=X,t[39]=Z):Z=t[39],t[40]!==m||t[41]!==Z?(O=(0,G.jsxs)(ae,{menuKind:m,className:`flex items-center justify-between gap-2`,children:[le,Z]}),t[40]=m,t[41]=Z,t[42]=O):O=t[42],k=T===null?null:(0,G.jsx)($,{hint:h({id:`pXB6SL`}),children:(0,G.jsxs)(ie,{menuKind:m,disabled:b,checked:!0,onSelect:we,"data-testid":`skill-source-row`,children:[(0,G.jsx)(E,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:T}),(()=>{let e=oe(T).split(`/`).slice(0,-1).join(`/`),t=B(e);return t.length>0?(0,G.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>K(t,e))}):null})(),(0,G.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,G.jsx)(r,{id:`tiFPjk`})})]})]})}),A=w.map(t=>{let i=e(t),c=t===`agents`?`.agents`:p[t],l=oe(i).split(`/`).slice(0,-1).join(`/`),d=B(l);return(0,G.jsx)($,{hint:P.has(t)?h({id:`8HvJlU`,values:{0:i??c}}):t===N?i?h({id:`ssk6rl`,values:{path:i}}):c:g.has(t)?h(i?{id:`9ieZhu`,values:{path:i}}:{id:`n3T3EE`,values:{label:c}}):re?.editor===t?h({id:`_3S4Ql`,values:{0:a?.name??``,1:re.plugin,2:i??c,label:c}}):h(i?N===void 0?{id:`xk133d`,values:{path:i}}:C===`link`?{id:`1LtA5r`,values:{path:i}}:{id:`opPbzN`,values:{path:i}}:{id:`Pp0Vgd`,values:{label:c}}),children:(0,G.jsxs)(ie,{menuKind:m,disabled:b,checked:g.has(t),onCheckedChange:e=>{P.has(t)||e===!0&&!U(l)||_(t,e===!0)},onSelect:Ce,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,G.jsx)(o,{host:t,"aria-hidden":!0,className:`size-4`}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:i??c}),d.length>0?(0,G.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:d.map(e=>K(e,l))}):null,re?.editor===t&&!g.has(t)?(0,G.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,G.jsx)(r,{id:`scRzTw`})}):null,P.has(t)?(0,G.jsx)($,{hint:h({id:`_O7dJS`}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-warning/40 bg-warning/10 px-1 text-[10px] text-warning uppercase tracking-wide hover:bg-warning/20 hover:text-warning dark:hover:bg-warning/20`,onClick:e=>{e.preventDefault(),s?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,G.jsx)(r,{id:`jng7Ko`})})}):t===N?(0,G.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,G.jsx)(r,{id:`tiFPjk`})}):g.has(t)&&a?.hosts?(0,G.jsxs)(G.Fragment,{children:[!b&&(I.has(t)?`link`:`copy`)!==C?ce(t,i??c,I.has(t)?`link`:`copy`):null,(0,G.jsx)($,{hint:h({id:`nBgzKO`}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,G.jsx)(r,{id:`VNNRfN`})})})]}):null,!b&&F.has(oe(i))?(0,G.jsx)($,{hint:h({id:`iz1LdD`}),children:(0,G.jsx)(V,{testId:`skill-drift-${t}`})}):null]})]})},t)}),j=S.map(e=>{let t=e.display;return(0,G.jsx)($,{hint:e.placed===null?h(N===void 0?{id:`xk133d`,values:{path:t}}:C===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):h({id:`9ieZhu`,values:{path:t}}),children:(0,G.jsxs)(ie,{menuKind:m,disabled:b,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!U(e.root))return;n.placeAt(e.root,C)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Se,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,G.jsx)(o,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,G.jsx)(E,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),B(e.root).length>0?(0,G.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:B(e.root).map(t=>K(t,e.root))}):null,!b&&e.placed!==null&&F.has(e.placed.path)?(0,G.jsx)($,{hint:h({id:`iz1LdD`}),children:(0,G.jsx)(V,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,G.jsxs)(G.Fragment,{children:[!b&&e.placed.mode!==C?ce(e.root,e.display,e.placed.mode):null,(0,G.jsx)($,{hint:h({id:`nBgzKO`}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,G.jsx)(r,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=h,t[1]=y.data,t[2]=y.status,t[3]=g,t[4]=v,t[5]=m,t[6]=s,t[7]=c,t[8]=a,t[9]=_,t[10]=n,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=O,t[18]=k,t[19]=A,t[20]=j}else b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],O=t[17],k=t[18],A=t[19],j=t[20];let M;t[43]!==S||t[44]!==w.length||t[45]!==T?(M=w.length===0&&S.length===0&&T===null?(0,G.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,G.jsx)(r,{id:`MOAoFO`})}):null,t[43]=S,t[44]=w.length,t[45]=T,t[46]=M):M=t[46];let N;t[47]!==h||t[48]!==b||t[49]!==x||t[50]!==C||t[51]!==c||t[52]!==n?(N=x.length>0&&n.convertLocations?(0,G.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,G.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=C===`link`?`copy`:`link`,r=x.filter(e=>e.mode!==t);if(r.length===0)return;let i=h(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=h(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(xe).join(`
|
|
2
2
|
`);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${h({id:`Cu6GXQ`})}`)&&(c?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:b,"data-testid":`skill-convert-all`,children:C===`link`?(0,G.jsx)(r,{id:`rcJmK8`}):(0,G.jsx)(r,{id:`LBv_TR`})}),(0,G.jsx)($,{hint:h({id:`0J6nhG`}),children:(0,G.jsx)(u,{variant:`ghost`,size:`sm`,"aria-label":h({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:be,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[47]=h,t[48]=b,t[49]=x,t[50]=C,t[51]=c,t[52]=n,t[53]=N):N=t[53];let P;t[54]===m?P=t[55]:(P=(0,G.jsx)(oe,{menuKind:m}),t[54]=m,t[55]=P);let F;t[56]===h?F=t[57]:(F=h({id:`5ymuTA`}),t[56]=h,t[57]=F);let I;t[58]===a?.scope?I=t[59]:(I=()=>{window.location.hash=a?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=a?.scope,t[59]=I);let L,R;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,G.jsx)(H,{"aria-hidden":!0}),R=(0,G.jsx)(r,{id:`ZBF9fn`}),t[60]=L,t[61]=R):(L=t[60],R=t[61]);let z;t[62]!==m||t[63]!==I?(z=(0,G.jsxs)(re,{menuKind:m,onSelect:I,children:[L,R]}),t[62]=m,t[63]=I,t[64]=z):z=t[64];let U;t[65]!==z||t[66]!==F?(U=(0,G.jsx)($,{hint:F,children:z}),t[65]=z,t[66]=F,t[67]=U):U=t[67];let K;return t[68]!==U||t[69]!==O||t[70]!==k||t[71]!==A||t[72]!==j||t[73]!==M||t[74]!==N||t[75]!==P?(K=(0,G.jsxs)(G.Fragment,{children:[O,k,A,j,M,N,P,U]}),t[68]=U,t[69]=O,t[70]=k,t[71]=A,t[72]=j,t[73]=M,t[74]=N,t[75]=P,t[76]=K):K=t[76],K}function be(e){return e.preventDefault()}function xe(e){return e.display}function Se(e){return e.preventDefault()}function Ce(e){return e.preventDefault()}function we(e){return e.preventDefault()}function Te(e){return(e??``).replace(/^~\//,``)}function Ee(e){return e===`agents`?`.agents`:p[e]??e}export{de as a,ae as c,ce as d,le as f,fe as i,oe as l,ye as n,K as o,H as p,ge as r,re as s,he as t,se as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkillUpdateConflictDialog-D_oqmK3K.js","./dist-Nvb76hAm.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./pierre-theme-DzTcpkj5.js","./preload-helper-Chd9yIcd.js","./engine-compile-DCFDOxYT.js","./lib-BiDTxxNs.js","./ccount-DGTHxXcy.js","./lib-DjmHwbg0.js","./space-separated-tokens-BMeAno6f.js","./lib-qLdVx2Nx.js","./ok-syntax-theme-DvmmMFpb.js","./MultiFileDiff-BFbTHRMN.js","./compiler-runtime-BfE3aGVn.js","./button-DzgjsZzC.js","./dist-CSCUSbQc.js","./dist-BsJYDohW.js","./bundle-mjs-SHeFpKGC.js","./utils-CPqDy6Hr.js","./dialog-BJEjKJjL.js","./electron-drag-strip-D9GZhMg_.js","./dist-DTFuvKje.js","./react-dom-DPxgxlDT.js","./dist-CxbWbOvU.js","./es2015-Dtr4fzLT.js","./x-DM2drskU.js","./createLucideIcon-DdBzwsHe.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{i as s,n as c,t as l}from"./tooltip-Bz6z4_se.js";import{t as u}from"./switch-BKZTXkzu.js";import{t as d}from"./button-DzgjsZzC.js";import{t as f}from"./arrow-up-right-nJaICi16.js";import{t as p}from"./spinner-Bx8xD6f8.js";import{t as m}from"./refresh-cw-CC7UZEnZ.js";import{t as h}from"./undo-2-xEF_s_Io.js";import{t as g}from"./use-skill-origin-
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{i as s,n as c,t as l}from"./tooltip-Bz6z4_se.js";import{t as u}from"./switch-BKZTXkzu.js";import{t as d}from"./button-DzgjsZzC.js";import{t as f}from"./arrow-up-right-nJaICi16.js";import{t as p}from"./spinner-Bx8xD6f8.js";import{t as m}from"./refresh-cw-CC7UZEnZ.js";import{t as h}from"./undo-2-xEF_s_Io.js";import{t as g}from"./use-skill-origin-B9YRoKsz.js";var _=o(),v=e(r(),1),y=n(),b=(0,v.lazy)(async()=>({default:(await t(()=>import(`./SkillUpdateConflictDialog-D_oqmK3K.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url)).SkillUpdateConflictDialog}));function x(e){let t=(0,_.c)(48),{scope:n,name:r}=e,{_:o}=a(),x;t[0]!==r||t[1]!==n?(x={scope:n,name:r},t[0]=r,t[1]=n,t[2]=x):x=t[2];let{origin:S,github:C,displaySource:w,importedTitle:T,canReimport:E,updateAvailable:D,modified:O,autoUpdate:k,gitTracked:A,setAutoUpdate:j,revertable:M,reimport:N,reimporting:P,previewUpdate:F,revert:I,reverting:L}=g(x),[R,z]=(0,v.useState)(null),B;t[3]!==O||t[4]!==F||t[5]!==N?(B=async function(){if(O){let e=await F();e&&z(e);return}await N()},t[3]=O,t[4]=F,t[5]=N,t[6]=B):B=t[6];let V=B,H;t[7]===N?H=t[8]:(H=async function(){await N(),z(null)},t[7]=N,t[8]=H);let U=H;if(!S)return null;let W;t[9]!==w||t[10]!==C||t[11]!==T?(W=C?(0,y.jsxs)(`a`,{href:C,target:`_blank`,rel:`noreferrer`,title:T??void 0,className:`hidden min-w-0 max-w-48 items-center gap-1 hover:text-foreground @xl/toolbar:flex`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:w}),(0,y.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0})]}):(0,y.jsx)(`span`,{title:T??void 0,className:`hidden min-w-0 max-w-48 truncate @xl/toolbar:inline`,children:w}),t[9]=w,t[10]=C,t[11]=T,t[12]=W):W=t[12];let G;t[13]!==o||t[14]!==k||t[15]!==E||t[16]!==A||t[17]!==j?(G=E?(0,y.jsxs)(l,{children:[(0,y.jsx)(s,{asChild:!0,children:(0,y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,children:[(0,y.jsx)(`label`,{htmlFor:`skill-auto-update-switch`,className:`hidden cursor-pointer @xl/toolbar:inline`,children:(0,y.jsx)(i,{id:`2M0JF6`})}),(0,y.jsx)(u,{id:`skill-auto-update-switch`,checked:k&&!A,disabled:A,onCheckedChange:e=>void j(e===!0),"aria-label":o({id:`o9fPtM`}),className:`scale-75`})]})}),(0,y.jsx)(c,{side:`bottom`,children:A?(0,y.jsx)(i,{id:`vy_VIN`}):k?(0,y.jsx)(i,{id:`vGQxBT`}):(0,y.jsx)(i,{id:`9p_QBN`})})]}):null,t[13]=o,t[14]=k,t[15]=E,t[16]=A,t[17]=j,t[18]=G):G=t[18];let K;t[19]===O?K=t[20]:(K=O?(0,y.jsxs)(l,{children:[(0,y.jsx)(s,{asChild:!0,children:(0,y.jsx)(`span`,{className:`shrink-0 rounded-sm bg-warning/10 px-1.5 py-0.5 font-medium text-[11px] text-warning`,children:(0,y.jsx)(i,{id:`tgWuMB`})})}),(0,y.jsx)(c,{side:`bottom`,children:(0,y.jsx)(i,{id:`s0Iold`})})]}):null,t[19]=O,t[20]=K);let q;t[21]!==o||t[22]!==E||t[23]!==O||t[24]!==P||t[25]!==I||t[26]!==M||t[27]!==L?(q=O&&E&&M?(0,y.jsxs)(l,{children:[(0,y.jsx)(d,{variant:`ghost`,size:`sm`,onClick:()=>void I(),disabled:L||P,"aria-label":o({id:`VxLvKE`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,y.jsxs)(s,{children:[L?(0,y.jsx)(p,{icon:h,className:`size-3`,"aria-hidden":!0}):(0,y.jsx)(h,{className:`size-3`,"aria-hidden":!0}),(0,y.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:L?(0,y.jsx)(i,{id:`fIJtam`}):(0,y.jsx)(i,{id:`jJdwCB`})})]})}),(0,y.jsx)(c,{side:`bottom`,children:(0,y.jsx)(i,{id:`XSb9HS`})})]}):null,t[21]=o,t[22]=E,t[23]=O,t[24]=P,t[25]=I,t[26]=M,t[27]=L,t[28]=q):q=t[28];let J;t[29]!==o||t[30]!==E||t[31]!==V||t[32]!==P||t[33]!==L||t[34]!==D?(J=E&&D?(0,y.jsxs)(l,{children:[(0,y.jsx)(d,{variant:`ghost`,size:`sm`,onClick:()=>void V(),disabled:P||L,"aria-label":o({id:`GidGkh`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,y.jsxs)(s,{children:[P?(0,y.jsx)(p,{icon:m,className:`size-3`,"aria-hidden":!0}):(0,y.jsx)(m,{className:`size-3`,"aria-hidden":!0}),(0,y.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:P?(0,y.jsx)(i,{id:`JL3si7`}):(0,y.jsx)(i,{id:`EkH9pt`})})]})}),(0,y.jsx)(c,{side:`bottom`,children:(0,y.jsx)(i,{id:`GidGkh`})})]}):null,t[29]=o,t[30]=E,t[31]=V,t[32]=P,t[33]=L,t[34]=D,t[35]=J):J=t[35];let Y;t[36]!==R||t[37]!==r||t[38]!==U||t[39]!==P?(Y=R?(0,y.jsx)(v.Suspense,{fallback:null,children:(0,y.jsx)(b,{open:!0,onOpenChange:e=>{e||z(null)},skillName:r,localBody:R.localBody,upstreamBody:R.upstreamBody,applying:P,onTakeUpstream:()=>void U()})}):null,t[36]=R,t[37]=r,t[38]=U,t[39]=P,t[40]=Y):Y=t[40];let X;return t[41]!==W||t[42]!==G||t[43]!==K||t[44]!==q||t[45]!==J||t[46]!==Y?(X=(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-muted-foreground text-xs`,children:[W,G,K,q,J,Y]}),t[41]=W,t[42]=G,t[43]=K,t[44]=q,t[45]=J,t[46]=Y,t[47]=X):X=t[47],X}export{x as SkillOriginInline};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{n as s}from"./AgentIconCluster-DYP1yNXm.js";import{t as c}from"./dist-CSCUSbQc.js";import{t as l}from"./checkbox-CKD8LETI.js";import{t as u}from"./label-CvMpFFbN.js";import{i as d,n as ee,o as te,s as ne,t as re}from"./select-pACXgFe2.js";import{t as ie}from"./button-DzgjsZzC.js";import{n as f}from"./dist-BGzUo_18.js";import{n as ae}from"./constants-editors-DmmORwNP.js";import{t as oe}from"./spinner-Bx8xD6f8.js";import{a as se}from"./SkillInstallMenu-DyKWxkEY.js";import{a as ce,c as le,i as ue,n as de,o as fe,s as pe,t as me}from"./dialog-BJEjKJjL.js";import{a as he,i as ge,t as _e}from"./popover-Mb1GgB61.js";import{p as ve,r as ye,t as be}from"./skill-scope-DOTLd4gL.js";import{h as xe,i as Se,p as Ce,x as we}from"./skills-api-zXSg3eSX.js";import{t as Te}from"./use-skills-B2fLFrq6.js";import{t as Ee}from"./use-skill-targets-DIBQkXNG.js";var p=a(),m=t();function h(e){let t=(0,p.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=i===void 0?`default`:i,l=a!==void 0&&a?c:`div`,u;t[5]===n?u=t[6]:(u=o(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),t[5]=n,t[6]=u);let d;return t[7]!==l||t[8]!==r||t[9]!==s||t[10]!==u?(d=(0,m.jsx)(l,{"data-slot":`card`,"data-size":s,className:u,...r}),t[7]=l,t[8]=r,t[9]=s,t[10]=u,t[11]=d):d=t[11],d}function g(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function v(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function De(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-action`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`px-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function y(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var b=e(n(),1);function ke(e){let t=(0,p.c)(2);if(!e.bundle)return null;let n;return t[0]===e?n=t[1]:(n=(0,m.jsx)(Ae,{...e,bundle:e.bundle}),t[0]=e,t[1]=n),n}function Ae(e){let t=(0,p.c)(118),{bundle:n,source:a,defaultScope:o,installOverride:c,onInstalled:h,onOpenChange:g,returnFocus:_}=e,{_:v}=i(),De=(0,b.useId)(),Oe=ve(),[y,ke]=(0,b.useState)(c?.scope??o),Ae;t[0]!==n.names||t[1]!==c?(Ae=()=>c?new Set(n.names):new Set,t[0]=n.names,t[1]=c,t[2]=Ae):Ae=t[2];let[x,Le]=(0,b.useState)(Ae),[S,Re]=(0,b.useState)(!1),ze;t[3]===n.descriptions?ze=t[4]:(ze=()=>new Map(Object.entries(n.descriptions??{})),t[3]=n.descriptions,t[4]=ze);let[Be,Ve]=(0,b.useState)(ze),C=Ee(),[He,Ue]=(0,b.useState)(null),We=C.state.status===`ready`?C.state.data.targets:null,Ge;t[5]!==We||t[6]!==He?(Ge=He??new Set(We??[]),t[5]=We,t[6]=He,t[7]=Ge):Ge=t[7];let w=Ge,T=Te(),Ke=T.status===`ready`?T.data.find(e=>e.scope===y)?.installableEditors:void 0,qe=se.filter(e=>!Ke||Ke.includes(e)||w.has(e)),Je;t[8]!==y||t[9]!==T.data||t[10]!==T.status?(Je=T.status===`ready`?new Set(T.data.filter(e=>e.scope===y).map(Ie)):new Set,t[8]=y,t[9]=T.data,t[10]=T.status,t[11]=Je):Je=t[11];let E=Je,Ye;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=new Set,t[12]=Ye):Ye=t[12];let[D,Xe]=(0,b.useState)(Ye),Ze=new Set;if(C.state.status===`ready`){let e;t[13]===C.state.data.folders?e=t[14]:(e=C.state.data.folders??[],t[13]=C.state.data.folders,t[14]=e);for(let t of e)t.scope===y&&(se.includes(t.host)||t.root&&Ze.add(t.root))}if(T.status===`ready`){for(let e of T.data)if(e.scope===y)for(let t of e.customPlacements??[]){let e=ye(t);e&&Ze.add(e)}}let Qe=[...Ze].sort(),$e=c!==void 0,et,tt;t[15]!==a||t[16]!==$e?(et=()=>{if($e)return;let e=new AbortController;return Se(a,e.signal).then(t=>{e.signal.aborted||!t.ok||Ve(new Map(t.skills.map(Fe)))}),()=>e.abort()},tt=[a,$e],t[15]=a,t[16]=$e,t[17]=et,t[18]=tt):(et=t[17],tt=t[18]),(0,b.useEffect)(et,tt);let{plugin:O,names:k}=n,nt;if(t[19]!==E||t[20]!==k){let e;t[22]===E?e=t[23]:(e=e=>!E.has(e),t[22]=E,t[23]=e),nt=k.filter(e),t[19]=E,t[20]=k,t[21]=nt}else nt=t[21];let A=nt,j=x.size===A.length&&A.length>0,rt;t[24]===x?rt=t[25]:(rt=function(e,t){let n=new Set(x);t?n.add(e):n.delete(e),Le(n)},t[24]=x,t[25]=rt);let it=rt,at;t[26]!==v||t[27]!==D||t[28]!==w||t[29]!==c||t[30]!==h||t[31]!==g||t[32]!==O||t[33]!==y||t[34]!==x||t[35]!==a?(at=async function(){if(Re(!0),c){let e=await c.installSelected([...x]);if(Re(!1),e===null)return;e.size>0&&h?.(e),g(!1);return}let e=await Ce({source:a,skills:[...x],scope:y,install:!1,marketplace:!0});if(!e.ok){Re(!1),f.error(v({id:`Lbl6KA`,values:{0:O??a,1:e.error}}));return}let t=e.results.map(Pe).filter(Ne),n=[...w];if(n.length>0)for(let e of t){let t=await xe({scope:y,name:e,targets:n,linkMode:!0});t.ok||f.error(v({id:`1oSHI0`,values:{0:t.error,skillName:e}}))}for(let e of D)for(let n of t){let t=await we({scope:y,name:n,dir:e,mode:`link`});t.ok||f.error(v({id:`OkC7-2`,values:{0:t.error,skillName:n,root:e}}))}Re(!1);let{imported:r,alreadyImported:i,failed:o}=e;if(o>0){let t=e.results.filter(Me).map(je).join(`, `);f.error(v({id:`cMMb6H`,values:{imported:r,failed:o,failedNames:t}}))}else r===0?f.info(v({id:`uJfwF8`})):i>0?f.success(v({id:`tkIXtS`,values:{imported:r,alreadyImported:i}})):f.success(v({id:`-kKdCC`,values:{0:O??a,imported:r}}));let s=new Map;for(let t of e.results)t.status!==`imported`&&t.status!==`already-imported`||s.set(t.requested,t.name??t.requested);s.size>0&&h?.(s),g(!1)},t[26]=v,t[27]=D,t[28]=w,t[29]=c,t[30]=h,t[31]=g,t[32]=O,t[33]=y,t[34]=x,t[35]=a,t[36]=at):at=t[36];let ot=at,st=me,M;t[37]!==S||t[38]!==g?(M=e=>{!e&&!S&&g(!1)},t[37]=S,t[38]=g,t[39]=M):M=t[39];let ct=ue,N;t[40]===_?N=t[41]:(N=e=>{_&&(e.preventDefault(),_())},t[40]=_,t[41]=N);let P;t[42]!==O||t[43]!==a?(P=(0,m.jsx)(le,{children:O?(0,m.jsx)(r,{id:`J86siq`,values:{plugin:O}}):(0,m.jsx)(r,{id:`Q-DKvr`,values:{source:a}})}),t[42]=O,t[43]=a,t[44]=P):P=t[44];let F;t[45]===O?F=t[46]:(F=(0,m.jsx)(ce,{children:O?(0,m.jsx)(r,{id:`lj4cNf`}):(0,m.jsx)(r,{id:`4mDIcg`})}),t[45]=O,t[46]=F);let I;t[47]!==P||t[48]!==F?(I=(0,m.jsxs)(pe,{children:[P,F]}),t[47]=P,t[48]=F,t[49]=I):I=t[49];let lt=de,L;t[50]!==A.length||t[51]!==x.size?(L=(0,m.jsx)(`p`,{className:`font-medium text-xs font-mono text-foreground/70 uppercase tracking-wider`,children:(0,m.jsx)(r,{id:`lUtr1r`,values:{0:x.size,1:A.length}})}),t[50]=A.length,t[51]=x.size,t[52]=L):L=t[52];let R;t[53]!==j||t[54]!==A?(R=()=>Le(j?new Set:new Set(A)),t[53]=j,t[54]=A,t[55]=R):R=t[55];let z;t[56]===j?z=t[57]:(z=j?(0,m.jsx)(r,{id:`xCJdfg`}):(0,m.jsx)(r,{id:`wgNoIs`}),t[56]=j,t[57]=z);let B;t[58]!==S||t[59]!==R||t[60]!==z?(B=(0,m.jsx)(ie,{variant:`ghost`,size:`sm`,disabled:S,onClick:R,children:z}),t[58]=S,t[59]=R,t[60]=z,t[61]=B):B=t[61];let V;t[62]!==L||t[63]!==B?(V=(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[L,B]}),t[62]=L,t[63]=B,t[64]=V):V=t[64];let H;if(t[65]!==S||t[66]!==Be||t[67]!==E||t[68]!==k||t[69]!==x||t[70]!==it){let e;t[72]!==S||t[73]!==Be||t[74]!==E||t[75]!==x||t[76]!==it?(e=e=>{let t=Be.get(e),n=E.has(e);return(0,m.jsxs)(u,{className:`flex cursor-pointer items-start gap-3 p-3 text-sm font-normal hover:bg-muted/40`,children:[(0,m.jsx)(l,{checked:n||x.has(e),disabled:S||n,onCheckedChange:t=>it(e,t===!0),className:`mt-0.5`}),(0,m.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`font-mono`,children:e}),n?(0,m.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,m.jsx)(r,{id:`eQkgKV`})}):null]}),t?(0,m.jsx)(`span`,{className:`text-1sm text-muted-foreground line-clamp-2`,children:t}):null]})]},e)},t[72]=S,t[73]=Be,t[74]=E,t[75]=x,t[76]=it,t[77]=e):e=t[77],H=k.map(e),t[65]=S,t[66]=Be,t[67]=E,t[68]=k,t[69]=x,t[70]=it,t[71]=H}else H=t[71];let U;t[78]===H?U=t[79]:(U=(0,m.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:H}),t[78]=H,t[79]=U);let W;t[80]===y?W=t[81]:(W=y===`project`?(0,m.jsx)(r,{id:`oVW7VD`}):(0,m.jsx)(r,{id:`7HY6fA`}),t[80]=y,t[81]=W);let ut=$e?null:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`·`}),w.size+D.size>0?(0,m.jsx)(s,{hosts:[...w,...D],iconClassName:`size-3.5`}):(0,m.jsx)(r,{id:`poAsUN`}),(0,m.jsxs)(_e,{children:[(0,m.jsx)(he,{asChild:!0,children:(0,m.jsx)(ie,{variant:`link`,size:`sm`,className:`h-auto px-1`,disabled:S,"data-testid":`plugin-bundle-change-destination`,children:(0,m.jsx)(r,{id:`o-XJ9D`})})}),(0,m.jsxs)(ge,{align:`start`,className:`flex w-72 flex-col gap-4`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,m.jsx)(u,{htmlFor:De,children:(0,m.jsx)(r,{id:`7MSbAT`})}),(0,m.jsxs)(re,{value:y,disabled:S,onValueChange:e=>ke(e),children:[(0,m.jsx)(te,{id:De,className:`w-full`,children:(0,m.jsx)(ne,{})}),(0,m.jsx)(ee,{children:be.map(e=>(0,m.jsx)(d,{value:e,children:Oe[e]},e))})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,m.jsx)(u,{children:(0,m.jsx)(r,{id:`Y5la_5`})}),(0,m.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2`,children:[qe.map(e=>(0,m.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 text-sm font-normal`,children:[(0,m.jsx)(l,{checked:w.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(w);t===!0?n.add(e):n.delete(e),Ue(n)}}),ae[e]??e]},e)),Qe.map(e=>(0,m.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 font-normal text-sm`,children:[(0,m.jsx)(l,{checked:D.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(D);t===!0?n.add(e):n.delete(e),Xe(n)}}),(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e))]})]})]})]})]}),G;t[82]!==W||t[83]!==ut?(G=(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-1sm text-muted-foreground`,"data-testid":`plugin-bundle-destination`,children:[W,ut]}),t[82]=W,t[83]=ut,t[84]=G):G=t[84];let K;t[85]!==lt||t[86]!==V||t[87]!==U||t[88]!==G?(K=(0,m.jsxs)(lt,{className:`flex flex-col gap-4`,children:[V,U,G]}),t[85]=lt,t[86]=V,t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]===g?q=t[91]:(q=()=>g(!1),t[90]=g,t[91]=q);let dt;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,m.jsx)(r,{id:`dEgA5A`}),t[92]=dt):dt=t[92];let J;t[93]!==S||t[94]!==q?(J=(0,m.jsx)(ie,{variant:`outline`,disabled:S,onClick:q,children:dt}),t[93]=S,t[94]=q,t[95]=J):J=t[95];let ft=S||x.size===0,Y;t[96]===ot?Y=t[97]:(Y=()=>void ot(),t[96]=ot,t[97]=Y);let X;t[98]!==S||t[99]!==x.size?(X=S?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),(0,m.jsx)(r,{id:`Wtw22s`})]}):x.size===0?(0,m.jsx)(r,{id:`TKQ7K-`}):(0,m.jsx)(r,{id:`9XwoPv`,values:{0:x.size}}),t[98]=S,t[99]=x.size,t[100]=X):X=t[100];let Z;t[101]!==ft||t[102]!==Y||t[103]!==X?(Z=(0,m.jsx)(ie,{"data-testid":`plugin-bundle-install`,disabled:ft,onClick:Y,children:X}),t[101]=ft,t[102]=Y,t[103]=X,t[104]=Z):Z=t[104];let Q;t[105]!==J||t[106]!==Z?(Q=(0,m.jsxs)(fe,{children:[J,Z]}),t[105]=J,t[106]=Z,t[107]=Q):Q=t[107];let $;t[108]!==ct||t[109]!==N||t[110]!==I||t[111]!==K||t[112]!==Q?($=(0,m.jsxs)(ct,{className:`sm:max-w-lg`,onCloseAutoFocus:N,children:[I,K,Q]}),t[108]=ct,t[109]=N,t[110]=I,t[111]=K,t[112]=Q,t[113]=$):$=t[113];let pt;return t[114]!==st||t[115]!==M||t[116]!==$?(pt=(0,m.jsx)(st,{open:!0,onOpenChange:M,children:$}),t[114]=st,t[115]=M,t[116]=$,t[117]=pt):pt=t[117],pt}function je(e){return e.requested}function Me(e){return e.status===`failed`||e.status===`not-found`}function Ne(e){return typeof e==`string`}function Pe(e){return e.name}function Fe(e){return[e.name,e.description]}function Ie(e){return e.name}export{v as a,_ as c,Oe as i,h as n,y as o,De as r,g as s,ke as t};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{n as s}from"./AgentIconCluster-DYP1yNXm.js";import{t as c}from"./dist-CSCUSbQc.js";import{t as l}from"./checkbox-CKD8LETI.js";import{t as u}from"./label-CvMpFFbN.js";import{i as d,n as ee,o as te,s as ne,t as re}from"./select-pACXgFe2.js";import{t as ie}from"./button-DzgjsZzC.js";import{n as f}from"./dist-BGzUo_18.js";import{n as ae}from"./constants-editors-DmmORwNP.js";import{t as oe}from"./spinner-Bx8xD6f8.js";import{a as se}from"./SkillInstallMenu-29VzNm-A.js";import{a as ce,c as le,i as ue,n as de,o as fe,s as pe,t as me}from"./dialog-BJEjKJjL.js";import{a as he,i as ge,t as _e}from"./popover-Mb1GgB61.js";import{p as ve,r as ye,t as be}from"./skill-scope-DOTLd4gL.js";import{h as xe,i as Se,p as Ce,x as we}from"./skills-api-CCijBzjo.js";import{t as Te}from"./use-skills-CkvdjORj.js";import{t as Ee}from"./use-skill-targets-DZmqRDS7.js";var p=a(),m=t();function h(e){let t=(0,p.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,size:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=i===void 0?`default`:i,l=a!==void 0&&a?c:`div`,u;t[5]===n?u=t[6]:(u=o(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,n),t[5]=n,t[6]=u);let d;return t[7]!==l||t[8]!==r||t[9]!==s||t[10]!==u?(d=(0,m.jsx)(l,{"data-slot":`card`,"data-size":s,className:u,...r}),t[7]=l,t[8]=r,t[9]=s,t[10]=u,t[11]=d):d=t[11],d}function g(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function v(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function De(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-action`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`px-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function y(e){let t=(0,p.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,m.jsx)(`div`,{"data-slot":`card-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var b=e(n(),1);function ke(e){let t=(0,p.c)(2);if(!e.bundle)return null;let n;return t[0]===e?n=t[1]:(n=(0,m.jsx)(Ae,{...e,bundle:e.bundle}),t[0]=e,t[1]=n),n}function Ae(e){let t=(0,p.c)(118),{bundle:n,source:a,defaultScope:o,installOverride:c,onInstalled:h,onOpenChange:g,returnFocus:_}=e,{_:v}=i(),De=(0,b.useId)(),Oe=ve(),[y,ke]=(0,b.useState)(c?.scope??o),Ae;t[0]!==n.names||t[1]!==c?(Ae=()=>c?new Set(n.names):new Set,t[0]=n.names,t[1]=c,t[2]=Ae):Ae=t[2];let[x,Le]=(0,b.useState)(Ae),[S,Re]=(0,b.useState)(!1),ze;t[3]===n.descriptions?ze=t[4]:(ze=()=>new Map(Object.entries(n.descriptions??{})),t[3]=n.descriptions,t[4]=ze);let[Be,Ve]=(0,b.useState)(ze),C=Ee(),[He,Ue]=(0,b.useState)(null),We=C.state.status===`ready`?C.state.data.targets:null,Ge;t[5]!==We||t[6]!==He?(Ge=He??new Set(We??[]),t[5]=We,t[6]=He,t[7]=Ge):Ge=t[7];let w=Ge,T=Te(),Ke=T.status===`ready`?T.data.find(e=>e.scope===y)?.installableEditors:void 0,qe=se.filter(e=>!Ke||Ke.includes(e)||w.has(e)),Je;t[8]!==y||t[9]!==T.data||t[10]!==T.status?(Je=T.status===`ready`?new Set(T.data.filter(e=>e.scope===y).map(Ie)):new Set,t[8]=y,t[9]=T.data,t[10]=T.status,t[11]=Je):Je=t[11];let E=Je,Ye;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=new Set,t[12]=Ye):Ye=t[12];let[D,Xe]=(0,b.useState)(Ye),Ze=new Set;if(C.state.status===`ready`){let e;t[13]===C.state.data.folders?e=t[14]:(e=C.state.data.folders??[],t[13]=C.state.data.folders,t[14]=e);for(let t of e)t.scope===y&&(se.includes(t.host)||t.root&&Ze.add(t.root))}if(T.status===`ready`){for(let e of T.data)if(e.scope===y)for(let t of e.customPlacements??[]){let e=ye(t);e&&Ze.add(e)}}let Qe=[...Ze].sort(),$e=c!==void 0,et,tt;t[15]!==a||t[16]!==$e?(et=()=>{if($e)return;let e=new AbortController;return Se(a,e.signal).then(t=>{e.signal.aborted||!t.ok||Ve(new Map(t.skills.map(Fe)))}),()=>e.abort()},tt=[a,$e],t[15]=a,t[16]=$e,t[17]=et,t[18]=tt):(et=t[17],tt=t[18]),(0,b.useEffect)(et,tt);let{plugin:O,names:k}=n,nt;if(t[19]!==E||t[20]!==k){let e;t[22]===E?e=t[23]:(e=e=>!E.has(e),t[22]=E,t[23]=e),nt=k.filter(e),t[19]=E,t[20]=k,t[21]=nt}else nt=t[21];let A=nt,j=x.size===A.length&&A.length>0,rt;t[24]===x?rt=t[25]:(rt=function(e,t){let n=new Set(x);t?n.add(e):n.delete(e),Le(n)},t[24]=x,t[25]=rt);let it=rt,at;t[26]!==v||t[27]!==D||t[28]!==w||t[29]!==c||t[30]!==h||t[31]!==g||t[32]!==O||t[33]!==y||t[34]!==x||t[35]!==a?(at=async function(){if(Re(!0),c){let e=await c.installSelected([...x]);if(Re(!1),e===null)return;e.size>0&&h?.(e),g(!1);return}let e=await Ce({source:a,skills:[...x],scope:y,install:!1,marketplace:!0});if(!e.ok){Re(!1),f.error(v({id:`Lbl6KA`,values:{0:O??a,1:e.error}}));return}let t=e.results.map(Pe).filter(Ne),n=[...w];if(n.length>0)for(let e of t){let t=await xe({scope:y,name:e,targets:n,linkMode:!0});t.ok||f.error(v({id:`1oSHI0`,values:{0:t.error,skillName:e}}))}for(let e of D)for(let n of t){let t=await we({scope:y,name:n,dir:e,mode:`link`});t.ok||f.error(v({id:`OkC7-2`,values:{0:t.error,skillName:n,root:e}}))}Re(!1);let{imported:r,alreadyImported:i,failed:o}=e;if(o>0){let t=e.results.filter(Me).map(je).join(`, `);f.error(v({id:`cMMb6H`,values:{imported:r,failed:o,failedNames:t}}))}else r===0?f.info(v({id:`uJfwF8`})):i>0?f.success(v({id:`tkIXtS`,values:{imported:r,alreadyImported:i}})):f.success(v({id:`-kKdCC`,values:{0:O??a,imported:r}}));let s=new Map;for(let t of e.results)t.status!==`imported`&&t.status!==`already-imported`||s.set(t.requested,t.name??t.requested);s.size>0&&h?.(s),g(!1)},t[26]=v,t[27]=D,t[28]=w,t[29]=c,t[30]=h,t[31]=g,t[32]=O,t[33]=y,t[34]=x,t[35]=a,t[36]=at):at=t[36];let ot=at,st=me,M;t[37]!==S||t[38]!==g?(M=e=>{!e&&!S&&g(!1)},t[37]=S,t[38]=g,t[39]=M):M=t[39];let ct=ue,N;t[40]===_?N=t[41]:(N=e=>{_&&(e.preventDefault(),_())},t[40]=_,t[41]=N);let P;t[42]!==O||t[43]!==a?(P=(0,m.jsx)(le,{children:O?(0,m.jsx)(r,{id:`J86siq`,values:{plugin:O}}):(0,m.jsx)(r,{id:`Q-DKvr`,values:{source:a}})}),t[42]=O,t[43]=a,t[44]=P):P=t[44];let F;t[45]===O?F=t[46]:(F=(0,m.jsx)(ce,{children:O?(0,m.jsx)(r,{id:`lj4cNf`}):(0,m.jsx)(r,{id:`4mDIcg`})}),t[45]=O,t[46]=F);let I;t[47]!==P||t[48]!==F?(I=(0,m.jsxs)(pe,{children:[P,F]}),t[47]=P,t[48]=F,t[49]=I):I=t[49];let lt=de,L;t[50]!==A.length||t[51]!==x.size?(L=(0,m.jsx)(`p`,{className:`font-medium text-xs font-mono text-foreground/70 uppercase tracking-wider`,children:(0,m.jsx)(r,{id:`lUtr1r`,values:{0:x.size,1:A.length}})}),t[50]=A.length,t[51]=x.size,t[52]=L):L=t[52];let R;t[53]!==j||t[54]!==A?(R=()=>Le(j?new Set:new Set(A)),t[53]=j,t[54]=A,t[55]=R):R=t[55];let z;t[56]===j?z=t[57]:(z=j?(0,m.jsx)(r,{id:`xCJdfg`}):(0,m.jsx)(r,{id:`wgNoIs`}),t[56]=j,t[57]=z);let B;t[58]!==S||t[59]!==R||t[60]!==z?(B=(0,m.jsx)(ie,{variant:`ghost`,size:`sm`,disabled:S,onClick:R,children:z}),t[58]=S,t[59]=R,t[60]=z,t[61]=B):B=t[61];let V;t[62]!==L||t[63]!==B?(V=(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[L,B]}),t[62]=L,t[63]=B,t[64]=V):V=t[64];let H;if(t[65]!==S||t[66]!==Be||t[67]!==E||t[68]!==k||t[69]!==x||t[70]!==it){let e;t[72]!==S||t[73]!==Be||t[74]!==E||t[75]!==x||t[76]!==it?(e=e=>{let t=Be.get(e),n=E.has(e);return(0,m.jsxs)(u,{className:`flex cursor-pointer items-start gap-3 p-3 text-sm font-normal hover:bg-muted/40`,children:[(0,m.jsx)(l,{checked:n||x.has(e),disabled:S||n,onCheckedChange:t=>it(e,t===!0),className:`mt-0.5`}),(0,m.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,m.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`font-mono`,children:e}),n?(0,m.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,m.jsx)(r,{id:`eQkgKV`})}):null]}),t?(0,m.jsx)(`span`,{className:`text-1sm text-muted-foreground line-clamp-2`,children:t}):null]})]},e)},t[72]=S,t[73]=Be,t[74]=E,t[75]=x,t[76]=it,t[77]=e):e=t[77],H=k.map(e),t[65]=S,t[66]=Be,t[67]=E,t[68]=k,t[69]=x,t[70]=it,t[71]=H}else H=t[71];let U;t[78]===H?U=t[79]:(U=(0,m.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-md border border-border divide-y divide-border`,children:H}),t[78]=H,t[79]=U);let W;t[80]===y?W=t[81]:(W=y===`project`?(0,m.jsx)(r,{id:`oVW7VD`}):(0,m.jsx)(r,{id:`7HY6fA`}),t[80]=y,t[81]=W);let ut=$e?null:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,children:`·`}),w.size+D.size>0?(0,m.jsx)(s,{hosts:[...w,...D],iconClassName:`size-3.5`}):(0,m.jsx)(r,{id:`poAsUN`}),(0,m.jsxs)(_e,{children:[(0,m.jsx)(he,{asChild:!0,children:(0,m.jsx)(ie,{variant:`link`,size:`sm`,className:`h-auto px-1`,disabled:S,"data-testid":`plugin-bundle-change-destination`,children:(0,m.jsx)(r,{id:`o-XJ9D`})})}),(0,m.jsxs)(ge,{align:`start`,className:`flex w-72 flex-col gap-4`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,m.jsx)(u,{htmlFor:De,children:(0,m.jsx)(r,{id:`7MSbAT`})}),(0,m.jsxs)(re,{value:y,disabled:S,onValueChange:e=>ke(e),children:[(0,m.jsx)(te,{id:De,className:`w-full`,children:(0,m.jsx)(ne,{})}),(0,m.jsx)(ee,{children:be.map(e=>(0,m.jsx)(d,{value:e,children:Oe[e]},e))})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,m.jsx)(u,{children:(0,m.jsx)(r,{id:`Y5la_5`})}),(0,m.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-2`,children:[qe.map(e=>(0,m.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 text-sm font-normal`,children:[(0,m.jsx)(l,{checked:w.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(w);t===!0?n.add(e):n.delete(e),Ue(n)}}),ae[e]??e]},e)),Qe.map(e=>(0,m.jsxs)(u,{className:`flex cursor-pointer items-center gap-2 font-normal text-sm`,children:[(0,m.jsx)(l,{checked:D.has(e),disabled:S,onCheckedChange:t=>{let n=new Set(D);t===!0?n.add(e):n.delete(e),Xe(n)}}),(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e))]})]})]})]})]}),G;t[82]!==W||t[83]!==ut?(G=(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-1sm text-muted-foreground`,"data-testid":`plugin-bundle-destination`,children:[W,ut]}),t[82]=W,t[83]=ut,t[84]=G):G=t[84];let K;t[85]!==lt||t[86]!==V||t[87]!==U||t[88]!==G?(K=(0,m.jsxs)(lt,{className:`flex flex-col gap-4`,children:[V,U,G]}),t[85]=lt,t[86]=V,t[87]=U,t[88]=G,t[89]=K):K=t[89];let q;t[90]===g?q=t[91]:(q=()=>g(!1),t[90]=g,t[91]=q);let dt;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,m.jsx)(r,{id:`dEgA5A`}),t[92]=dt):dt=t[92];let J;t[93]!==S||t[94]!==q?(J=(0,m.jsx)(ie,{variant:`outline`,disabled:S,onClick:q,children:dt}),t[93]=S,t[94]=q,t[95]=J):J=t[95];let ft=S||x.size===0,Y;t[96]===ot?Y=t[97]:(Y=()=>void ot(),t[96]=ot,t[97]=Y);let X;t[98]!==S||t[99]!==x.size?(X=S?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),(0,m.jsx)(r,{id:`Wtw22s`})]}):x.size===0?(0,m.jsx)(r,{id:`TKQ7K-`}):(0,m.jsx)(r,{id:`9XwoPv`,values:{0:x.size}}),t[98]=S,t[99]=x.size,t[100]=X):X=t[100];let Z;t[101]!==ft||t[102]!==Y||t[103]!==X?(Z=(0,m.jsx)(ie,{"data-testid":`plugin-bundle-install`,disabled:ft,onClick:Y,children:X}),t[101]=ft,t[102]=Y,t[103]=X,t[104]=Z):Z=t[104];let Q;t[105]!==J||t[106]!==Z?(Q=(0,m.jsxs)(fe,{children:[J,Z]}),t[105]=J,t[106]=Z,t[107]=Q):Q=t[107];let $;t[108]!==ct||t[109]!==N||t[110]!==I||t[111]!==K||t[112]!==Q?($=(0,m.jsxs)(ct,{className:`sm:max-w-lg`,onCloseAutoFocus:N,children:[I,K,Q]}),t[108]=ct,t[109]=N,t[110]=I,t[111]=K,t[112]=Q,t[113]=$):$=t[113];let pt;return t[114]!==st||t[115]!==M||t[116]!==$?(pt=(0,m.jsx)(st,{open:!0,onOpenChange:M,children:$}),t[114]=st,t[115]=M,t[116]=$,t[117]=pt):pt=t[117],pt}function je(e){return e.requested}function Me(e){return e.status===`failed`||e.status===`not-found`}function Ne(e){return typeof e==`string`}function Pe(e){return e.name}function Fe(e){return[e.name,e.description]}function Ie(e){return e.name}export{v as a,_ as c,Oe as i,h as n,y as o,De as r,g as s,ke as t};
|
package/dist/public/assets/{SkillToolbarControls-Bs8p51PI.js → SkillToolbarControls-BVFLkdZj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./select-pACXgFe2.js";import{t as m}from"./button-DzgjsZzC.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./select-pACXgFe2.js";import{t as m}from"./button-DzgjsZzC.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-BiF-H17k.js";import{a as y,h as b,r as x,t as S,u as C}from"./dropdown-menu-5XqyQTVx.js";import{n as w}from"./file-plus-DKxOZh2k.js";import{t as T}from"./list-plus-CYMJBvrm.js";import{p as E,t as D}from"./skill-scope-DOTLd4gL.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:m,triggerClassName:h}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===h?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,h),t[4]=h,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(f,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(u,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(s,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(c,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(l,{align:`end`,children:(0,k.jsxs)(d,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==m||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(p,{value:n,onValueChange:v,disabled:m,children:[S,T]}),t[15]=m,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,k.jsx)(h,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:s,problemCount:c,problemMessages:l}=e,{_:u}=i(),d;t[0]!==a||t[1]!==n?(d={scope:n,name:a},t[0]=a,t[1]=n,t[2]=d):d=t[2];let f=M(d),p;t[3]!==f.requestMove||t[4]!==n?(p=(0,k.jsx)(A,{value:n,onRequestMove:f.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=f.requestMove,t[4]=n,t[5]=p):p=t[5];let h;t[6]!==a||t[7]!==n?(h=(0,k.jsx)(_,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=h):h=t[8];let E;t[9]!==p||t[10]!==h?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,h]}),t[9]=p,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==o?(D=o?(0,k.jsx)(v,{onAddProperty:s,problemCount:c,problemMessages:l,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=s,t[13]=c,t[14]=l,t[15]=o,t[16]=D):D=t[16];let j;t[17]===u?j=t[18]:(j=u({id:`Yzs3QX`}),t[17]=u,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(w,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(b,{asChild:!0,children:(0,k.jsx)(m,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===f?F=t[23]:(F=e=>f.requestMove(e),t[22]=f,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(g,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==s||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(C,{}),(0,k.jsxs)(y,{onSelect:s,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=s,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(x,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(S,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==f.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,f.dialog]}),t[36]=f.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
|
package/dist/public/assets/{SkillsManagerSection-C0pgRzfs.js → SkillsManagerSection-D4YW1uOY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o,r as s,t as c}from"./AgentIconCluster-DYP1yNXm.js";import{a as l,c as u,i as d,l as f,o as p,r as m,s as h,t as g}from"./alert-dialog-BA3e7-10.js";import{t as _}from"./button-DzgjsZzC.js";import{n as v}from"./dist-BGzUo_18.js";import{c as y}from"./documents-events-ddyuXdQl.js";import{t as b}from"./createLucideIcon-DdBzwsHe.js";import{t as x}from"./arrow-right-NOQZeKIW.js";import{a as S,h as C,r as w,t as T}from"./dropdown-menu-5XqyQTVx.js";import{t as E}from"./copy-DpWa6i2v.js";import{t as D}from"./trash-2-CchZ0T47.js";import{a as O,c as k,i as A,n as j,o as M,s as N,t as P}from"./dialog-BJEjKJjL.js";import"./constants-skills-BLHVRW90.js";import{t as F}from"./tool-list-format-CS7MZY1Q.js";import{n as I}from"./perf-CPPbaRwr.js";import{t as L}from"./input-BsFOyzfK.js";import{a as R}from"./skill-scope-DOTLd4gL.js";import{t as z}from"./use-skills-B2fLFrq6.js";import{n as B}from"./open-managed-artifact-tab-Bgndx1BG.js";import{t as V}from"./skeleton-CrbF9ppq.js";import{t as H}from"./ChangedOutsideBadge-DhpGZlDx.js";import{t as U}from"./use-skill-targets-DIBQkXNG.js";import{t as ee}from"./SettingsSectionHeader-DDNA1hrR.js";var te=b(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),W=e(n(),1),G=a(),K=t();function q(e){let t=(0,G.c)(25),{icon:n,label:r,detail:i,names:a,tone:o,testId:s}=e,c=o===`destructive`?`text-destructive`:o===`muted`?`text-muted-foreground`:`text-foreground`,l=`mt-0.5 shrink-0 ${c}`,u;t[0]!==n||t[1]!==l?(u=(0,K.jsx)(`span`,{className:l,"aria-hidden":!0,children:n}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d=`font-medium text-xs ${c}`,f;t[3]!==r||t[4]!==d?(f=(0,K.jsx)(`span`,{className:d,children:r}),t[3]=r,t[4]=d,t[5]=f):f=t[5];let p;t[6]===a.length?p=t[7]:(p=(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:a.length}),t[6]=a.length,t[7]=p);let m;t[8]!==f||t[9]!==p?(m=(0,K.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[f,p]}),t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]===i?h=t[12]:(h=i?(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:i}):null,t[11]=i,t[12]=h);let g;t[13]===a?g=t[14]:(g=a.map(ne),t[13]=a,t[14]=g);let _;t[15]===g?_=t[16]:(_=(0,K.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-x-2 gap-y-0.5`,children:g}),t[15]=g,t[16]=_);let v;t[17]!==m||t[18]!==h||t[19]!==_?(v=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m,h,_]}),t[17]=m,t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==u||t[23]!==s?(y=(0,K.jsxs)(`div`,{className:`flex gap-2.5`,"data-testid":s,children:[u,v]}),t[21]=v,t[22]=u,t[23]=s,t[24]=y):y=t[24],y}function ne(e){return(0,K.jsx)(`code`,{className:`break-all text-[11px] text-muted-foreground`,children:e},e)}function re(e){let t=(0,G.c)(51),{open:n,onOpenChange:a,pick:o,keep:s,preview:c,onConfirm:v}=e,{_:y}=i(),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,K.jsx)(f,{children:(0,K.jsx)(r,{id:`Eu-LIb`})}),t[0]=b):b=t[0];let S;t[1]===s?S=t[2]:(S=(0,K.jsxs)(u,{children:[b,(0,K.jsx)(p,{children:(0,K.jsx)(r,{id:`IvKbeq`,values:{keep:s}})})]}),t[1]=s,t[2]=S);let C;t[3]===o?C=t[4]:(C=(0,K.jsx)(`code`,{className:`block break-all font-mono text-[11px]`,children:o}),t[3]=o,t[4]=C);let w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:(0,K.jsx)(r,{id:`kjlQ9D`})}),t[5]=w):w=t[5];let T;t[6]===C?T=t[7]:(T=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 rounded border border-border/60 px-2 py-1.5`,children:[C,w]}),t[6]=C,t[7]=T);let O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(x,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[8]=O):O=t[8];let k;t[9]===s?k=t[10]:(k=(0,K.jsx)(`code`,{className:`block break-all font-mono text-[11px]`,children:s}),t[9]=s,t[10]=k);let A;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:(0,K.jsx)(r,{id:`f1-q9m`})}),t[11]=A):A=t[11];let j;t[12]===k?j=t[13]:(j=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 rounded border border-border/60 bg-muted/40 px-2 py-1.5`,children:[k,A]}),t[12]=k,t[13]=j);let M;t[14]!==T||t[15]!==j?(M=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,"data-testid":`skill-folder-link-direction`,children:[T,O,j]}),t[14]=T,t[15]=j,t[16]=M):M=t[16];let N;t[17]===c.moves?N=t[18]:(N=c.moves.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-moves`,icon:(0,K.jsx)(x,{className:`size-3.5`}),tone:`default`,label:(0,K.jsx)(r,{id:`2Ce6hp`}),names:c.moves}):null,t[17]=c.moves,t[18]=N);let P;t[19]!==y||t[20]!==o||t[21]!==c.drops?(P=c.drops.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-drops`,icon:(0,K.jsx)(E,{className:`size-3.5`}),tone:`muted`,label:(0,K.jsx)(r,{id:`RxF-am`}),detail:y({id:`H8DVOJ`,values:{pick:o}}),names:c.drops}):null,t[19]=y,t[20]=o,t[21]=c.drops,t[22]=P):P=t[22];let F;t[23]!==y||t[24]!==s||t[25]!==c.replaces?(F=c.replaces.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-replaces`,icon:(0,K.jsx)(te,{className:`size-3.5`}),tone:`destructive`,label:(0,K.jsx)(r,{id:`0m4Snh`}),detail:y({id:`jEVipR`,values:{keep:s}}),names:c.replaces}):null,t[23]=y,t[24]=s,t[25]=c.replaces,t[26]=F):F=t[26];let I;t[27]!==y||t[28]!==o||t[29]!==c.removes?(I=c.removes.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-removes`,icon:(0,K.jsx)(D,{className:`size-3.5`}),tone:`destructive`,label:(0,K.jsx)(r,{id:`hs5BRR`}),detail:y({id:`beHZo4`,values:{pick:o}}),names:c.removes}):null,t[27]=y,t[28]=o,t[29]=c.removes,t[30]=I):I=t[30];let L;t[31]!==N||t[32]!==P||t[33]!==F||t[34]!==I?(L=(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[N,P,F,I]}),t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L):L=t[35];let R;t[36]!==M||t[37]!==L?(R=(0,K.jsxs)(m,{className:`flex flex-col gap-4 py-1`,children:[M,L]}),t[36]=M,t[37]=L,t[38]=R):R=t[38];let z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,K.jsx)(d,{children:(0,K.jsx)(r,{id:`dEgA5A`})}),t[39]=z):z=t[39];let B;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsx)(r,{id:`rf0tV1`}),t[40]=B):B=t[40];let V;t[41]===v?V=t[42]:(V=(0,K.jsxs)(h,{children:[z,(0,K.jsx)(_,{onClick:v,"data-testid":`skill-folder-link-confirm`,children:B})]}),t[41]=v,t[42]=V);let H;t[43]!==R||t[44]!==V||t[45]!==S?(H=(0,K.jsxs)(l,{children:[S,R,V]}),t[43]=R,t[44]=V,t[45]=S,t[46]=H):H=t[46];let U;return t[47]!==a||t[48]!==n||t[49]!==H?(U=(0,K.jsx)(g,{open:n,onOpenChange:a,children:H}),t[47]=a,t[48]=n,t[49]=H,t[50]=U):U=t[50],U}function ie(e){let t=(0,G.c)(67),{scope:n}=e,{i18n:a,_:o}=i(),{state:l,saving:u,folderAction:d}=U(),[f,p]=(0,W.useState)(``),[m,h]=(0,W.useState)(null),g,y,b,x,E;if(t[0]!==o||t[1]!==d||t[2]!==a||t[3]!==m||t[4]!==u||t[5]!==n||t[6]!==l.data||t[7]!==l.message||t[8]!==l.status){let e=l.status===`ready`?(l.data.folders??[]).filter(e=>e.scope===n):[],i=new Map(e.map(de)),f=e=>(e.state===`linked`||e.state===`linked-parent`)&&typeof e.target==`string`&&i.has(e.target),p=new Map;for(let t of e){if(!f(t))continue;let e=t.target;p.set(e,[...p.get(e)??[],t])}let D;t[14]===f?D=t[15]:(D=e=>!f(e),t[14]=f,t[15]=D);let O=e.filter(D),k;t[16]!==d||t[17]!==n?(k=(e,t,r)=>{d({scope:n,root:e,action:t,...r===void 0?{}:{target:r}}).catch(ue)},t[16]=d,t[17]=n,t[18]=k):k=t[18];let A=k,j;t[19]===n?j=t[20]:(j=e=>n===`global`?`~/${e}`:e,t[19]=n,t[20]=j);let M=j,N;t[21]!==o||t[22]!==M||t[23]!==d||t[24]!==n?(N=(e,t)=>{let r=M(e),i=M(t);d({scope:n,root:e,action:`link`,target:t,preview:!0}).then(a=>{if(!a){v.error(o({id:`KkRyMI`}));return}if(a.conflicts.length>0){v.error(o({id:`l2BOXd`,values:{0:a.conflicts.join(`, `),pick:r,keep:i}}));return}if(a.strays.length>0){v.error(o({id:`-qBQVd`,values:{0:a.strays.join(`, `),pick:r}}));return}if(a.moves.length+a.removes.length+a.replaces.length>0){h({root:e,target:t,pick:r,keep:i,preview:a});return}return d({scope:n,root:e,action:`link`,target:t})}).catch(le)},t[21]=o,t[22]=M,t[23]=d,t[24]=n,t[25]=N):N=t[25];let P=N,I;t[26]!==d||t[27]!==m||t[28]!==n?(I=()=>{if(!m)return;let{root:e,target:t}=m;h(null),d({scope:n,root:e,action:`link`,target:t}).catch(ce)},t[26]=d,t[27]=m,t[28]=n,t[29]=I):I=t[29],g=I,y=`space-y-2 rounded-lg border bg-card p-3`,b=`settings-skill-folders`;let L;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,K.jsx)(r,{id:`59CUI8`})}),t[30]=L):L=t[30],t[31]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,K.jsxs)(`div`,{children:[L,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`J_jZ5z`})})]}),t[31]=x):x=t[31],E=l.status===`error`?(0,K.jsx)(`div`,{className:`text-1sm text-destructive`,role:`alert`,"data-testid":`skill-targets-error`,children:(0,K.jsx)(r,{id:`ACKMCN`,values:{0:l.message}})}):l.status===`ready`?(0,K.jsx)(`ul`,{className:`space-y-1 pt-1`,children:O.map(t=>{let i=M(t.root),l=p.get(t.root)??[],d=se,f=e.filter(e=>e.root!==t.root&&(e.state===`own`||e.state===`absent`)&&!d(e)),m=(t.state===`own`||t.state===`absent`)&&!d(t);return(0,K.jsxs)(`li`,{className:`text-sm`,"data-testid":`skill-folder-row-${t.host}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(c,{host:t.host,"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:[i,t.state===`linked`||t.state===`linked-parent`?(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[` → `,t.target??`?`]}):null]}),t.drift?(0,K.jsx)(H,{testId:`skill-folder-drift-${t.host}`,title:o({id:`p3m_Gk`,values:{0:t.expected??``}})}):null,t.state===`linked-parent`?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,title:o({id:`yLwx9e`}),children:(0,K.jsx)(r,{id:`nf0wk0`})}):null,d(t)?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,title:o({id:`QP9OU3`}),"data-testid":`skill-folder-hub-destination-only`,children:(0,K.jsx)(r,{id:`mPoOmg`})}):null,m&&f.length>0?(0,K.jsxs)(T,{children:[(0,K.jsx)(C,{asChild:!0,children:(0,K.jsx)(_,{size:`sm`,variant:`ghost`,disabled:u,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] uppercase tracking-wide text-muted-foreground hover:text-foreground`,title:o({id:`g5w1sF`,values:{display:i}}),"data-testid":`skill-folder-link-${t.host}`,children:(0,K.jsx)(r,{id:`yzF66j`})})}),(0,K.jsx)(w,{align:`end`,className:`w-auto`,children:f.map(e=>(0,K.jsxs)(S,{onSelect:()=>P(e.root,t.root),"data-testid":`skill-folder-link-${t.host}-to-${e.root}`,children:[(0,K.jsx)(c,{host:e.host,"aria-hidden":!0,className:`size-4`}),(0,K.jsx)(`span`,{className:`font-mono text-xs`,children:n===`global`?`~/${e.root}`:e.root})]},e.root))})]}):null,t.state===`linked`?(0,K.jsx)(_,{size:`sm`,variant:`ghost`,disabled:u,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] uppercase tracking-wide text-muted-foreground hover:text-foreground`,title:o({id:`MQ5LOx`,values:{display:i}}),onClick:()=>A(t.root,`unlink`),"data-testid":`skill-folder-unlink-${t.host}`,children:(0,K.jsx)(r,{id:`ptQ3_N`})}):null]}),l.length>0?(0,K.jsx)(`p`,{className:`mt-1 ml-6 text-muted-foreground text-xs`,"data-testid":`skill-folder-shared-${t.host}`,children:o({id:`OOLsBh`,values:{0:F([t.host,...l.map(oe)].map(s),a.locale)}})}):null,l.length>0?(0,K.jsx)(`ul`,{className:`mt-1 ml-2 space-y-1 border-border/60 border-l pl-3`,"data-testid":`skill-folder-followers-${t.host}`,children:l.map(e=>(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(c,{host:e.host,"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground text-xs`,children:n===`global`?`~/${e.root}`:e.root}),e.drift?(0,K.jsx)(H,{testId:`skill-folder-drift-${e.host}`,title:o({id:`p3m_Gk`,values:{0:e.expected??``}})}):null,e.state===`linked-parent`?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,title:o({id:`yLwx9e`}),children:(0,K.jsx)(r,{id:`Ef6ukL`})}):(0,K.jsx)(_,{size:`sm`,variant:`ghost`,disabled:u,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide hover:text-foreground`,title:o({id:`9_2oe6`,values:{0:n===`global`?`~/${e.root}`:e.root}}),onClick:()=>A(e.root,`unlink`),"data-testid":`skill-folder-unlink-${e.host}`,children:(0,K.jsx)(r,{id:`ptQ3_N`})})]},e.host))}):null]},t.host)})}):(0,K.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(0,K.jsx)(V,{className:`h-5 w-56`}),(0,K.jsx)(V,{className:`h-5 w-56`})]}),t[0]=o,t[1]=d,t[2]=a,t[3]=m,t[4]=u,t[5]=n,t[6]=l.data,t[7]=l.message,t[8]=l.status,t[9]=g,t[10]=y,t[11]=b,t[12]=x,t[13]=E}else g=t[9],y=t[10],b=t[11],x=t[12],E=t[13];let D;t[32]!==d||t[33]!==f||t[34]!==n?(D=e=>{e.preventDefault();let t=f.trim().replace(/^~\//,``);t!==``&&d({scope:n,root:t,action:`add-root`}).then(()=>p(``)).catch(ae)},t[32]=d,t[33]=f,t[34]=n,t[35]=D):D=t[35];let O;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>p(e.target.value),t[36]=O):O=t[36];let k;t[37]===o?k=t[38]:(k=o({id:`oyBV3W`}),t[37]=o,t[38]=k);let A;t[39]!==o||t[40]!==n?(A=o(n===`global`?{id:`Wboy1j`}:{id:`jpoCue`}),t[39]=o,t[40]=n,t[41]=A):A=t[41];let j;t[42]!==f||t[43]!==u||t[44]!==k||t[45]!==A?(j=(0,K.jsx)(L,{value:f,onChange:O,"aria-label":k,placeholder:A,className:`h-7 flex-1 font-mono text-xs`,disabled:u,"data-testid":`skill-folders-add-root-input`}),t[42]=f,t[43]=u,t[44]=k,t[45]=A,t[46]=j):j=t[46];let M;t[47]!==f||t[48]!==u?(M=u||f.trim()===``,t[47]=f,t[48]=u,t[49]=M):M=t[49];let N;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,K.jsx)(r,{id:`ZW2yR_`}),t[50]=N):N=t[50];let P;t[51]===M?P=t[52]:(P=(0,K.jsx)(_,{type:`submit`,size:`sm`,variant:`secondary`,disabled:M,className:`h-7 px-2 font-normal text-xs`,children:N}),t[51]=M,t[52]=P);let I;t[53]!==P||t[54]!==D||t[55]!==j?(I=(0,K.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:D,"data-testid":`skill-folders-add-root`,children:[j,P]}),t[53]=P,t[54]=D,t[55]=j,t[56]=I):I=t[56];let R;t[57]!==g||t[58]!==m?(R=m?(0,K.jsx)(re,{open:!0,onOpenChange:e=>{e||h(null)},pick:m.pick,keep:m.keep,preview:m.preview,onConfirm:g}):null,t[57]=g,t[58]=m,t[59]=R):R=t[59];let z;return t[60]!==y||t[61]!==I||t[62]!==R||t[63]!==b||t[64]!==x||t[65]!==E?(z=(0,K.jsxs)(`section`,{className:y,"data-testid":b,children:[x,E,I,R]}),t[60]=y,t[61]=I,t[62]=R,t[63]=b,t[64]=x,t[65]=E,t[66]=z):z=t[66],z}function ae(e){return v.error(e instanceof Error?e.message:String(e))}function oe(e){return e.host}function se(e){return e.root===`.agents/skills`&&e.state===`absent`}function ce(e){return v.error(e instanceof Error?e.message:String(e))}function le(e){return v.error(e instanceof Error?e.message:String(e))}function ue(e){return v.error(e instanceof Error?e.message:String(e))}function de(e){return[e.root,e]}function J(e){let t=(0,G.c)(22),{name:n,description:i,hosts:a,emptyHosts:s,onActivate:c,ariaExpanded:l,control:u}=e,d;t[0]===n?d=t[1]:(d=(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground group-hover/button:underline`,children:(0,K.jsx)(`code`,{children:n})}),t[0]=n,t[1]=d);let f;t[2]===i?f=t[3]:(f=(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i}),t[2]=i,t[3]=f);let p;t[4]!==d||t[5]!==f?(p=(0,K.jsxs)(K.Fragment,{children:[d,f]}),t[4]=d,t[5]=f,t[6]=p):p=t[6];let m=p,h;t[7]!==l||t[8]!==m||t[9]!==c?(h=c?(0,K.jsx)(_,{variant:`ghost`,onClick:c,"aria-expanded":l,className:`group/button h-auto w-full flex-col items-start justify-start gap-0.5 whitespace-normal p-0 text-left hover:bg-transparent`,"data-testid":`skill-consent-row-preview`,children:m}):(0,K.jsx)(`span`,{className:`flex flex-col gap-0.5`,children:m}),t[7]=l,t[8]=m,t[9]=c,t[10]=h):h=t[10];let g;t[11]!==s||t[12]!==a?(g=(0,K.jsx)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:a.length>0?(0,K.jsx)(o,{hosts:a}):(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`skill-consent-row-no-hosts`,children:s===`not-added`?(0,K.jsx)(r,{id:`zP6U1P`}):(0,K.jsx)(r,{id:`yOjRUV`})})}),t[11]=s,t[12]=a,t[13]=g):g=t[13];let v;t[14]!==h||t[15]!==g?(v=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[h,g]}),t[14]=h,t[15]=g,t[16]=v):v=t[16];let y;t[17]===u?y=t[18]:(y=u?(0,K.jsx)(`span`,{className:`shrink-0`,children:u}):null,t[17]=u,t[18]=y);let b;return t[19]!==v||t[20]!==y?(b=(0,K.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5`,"data-testid":`skill-consent-row`,children:[v,y]}),t[19]=v,t[20]=y,t[21]=b):b=t[21],b}function fe(e){let t=(0,G.c)(4),{paths:n}=e,r;t[0]===n?r=t[1]:(r=n.map(pe),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,K.jsx)(`ul`,{className:`flex flex-col gap-0.5`,"data-testid":`skill-destination-list`,children:r}),t[2]=r,t[3]=i),i}function pe(e){return(0,K.jsx)(`li`,{children:(0,K.jsx)(`code`,{className:`break-all text-xs text-muted-foreground`,children:e})},e)}function Y(){let{_:e}=i();return t=>{switch(t){case`discovery`:case`open-knowledge-discovery`:return e({id:`olb6oq`});case`write-skill`:case`open-knowledge-write-skill`:return e({id:`I-6_4S`});case`project`:case`open-knowledge`:return e({id:`UMT9C9`});default:return null}}}function X(e){if(!e)return null;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>0?e.slice(0,t):null}function me(e){let t=(0,G.c)(22),{open:n,onDismiss:a,offer:o,onInstall:s,busy:c}=e,l=c===void 0?!1:c,{_:u}=i(),d=Y(),f=o!==null&&o.resolvedHosts.length>0,p;t[0]===a?p=t[1]:(p=e=>{e||a()},t[0]=a,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(k,{children:(0,K.jsx)(r,{id:`w7LRoP`})}),t[2]=m):m=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,K.jsxs)(N,{children:[m,(0,K.jsx)(O,{children:(0,K.jsx)(r,{id:`tX8FLX`})})]}),t[3]=h):h=t[3];let g;t[4]!==d||t[5]!==f||t[6]!==o?(g=o!==null&&(0,K.jsxs)(j,{className:`flex flex-col gap-3 py-1`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,K.jsx)(r,{id:`oy5bJW`})}),(0,K.jsx)(`div`,{className:`rounded-md border border-border bg-card/50`,children:(0,K.jsx)(J,{name:o.name,description:d(o.id)??o.description,hosts:o.resolvedHosts.map(he),emptyHosts:`none-detected`})}),f&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,K.jsx)(r,{id:`0CvV_9`})}),(0,K.jsx)(fe,{paths:o.paths})]})]}),t[4]=d,t[5]=f,t[6]=o,t[7]=g):g=t[7];let v;t[8]!==u||t[9]!==l||t[10]!==f||t[11]!==o||t[12]!==a||t[13]!==s?(v=(0,K.jsx)(M,{children:o===null?(0,K.jsx)(_,{onClick:a,"data-testid":`skills-studio-intro-ack`,children:(0,K.jsx)(r,{id:`76gPWk`})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_,{variant:`outline`,onClick:a,"data-testid":`skills-studio-intro-dismiss`,children:(0,K.jsx)(r,{id:`PBxg_E`})}),(0,K.jsx)(_,{onClick:s,disabled:l||!f,"aria-label":u({id:`fGqEFq`,values:{0:o.name}}),"data-testid":`skills-studio-intro-install`,children:(0,K.jsx)(r,{id:`TKQ7K-`})})]})}),t[8]=u,t[9]=l,t[10]=f,t[11]=o,t[12]=a,t[13]=s,t[14]=v):v=t[14];let y;t[15]!==g||t[16]!==v?(y=(0,K.jsxs)(A,{className:`sm:max-w-md`,"data-testid":`skills-studio-intro`,children:[h,g,v]}),t[15]=g,t[16]=v,t[17]=y):y=t[17];let b;return t[18]!==n||t[19]!==p||t[20]!==y?(b=(0,K.jsx)(P,{open:n,onOpenChange:p,children:y}),t[18]=n,t[19]=p,t[20]=y,t[21]=b):b=t[21],b}function he(e){return e.editor}var Z=`ok-skills-studio-intro-seen-v1`;function Q(){try{return typeof localStorage>`u`?null:localStorage}catch{return null}}function ge(e){let t=e===void 0?Q():e;if(!t)return!0;try{return t.getItem(Z)!==null}catch{return!0}}function _e(e){let t=e===void 0?Q():e;if(t)try{t.setItem(Z,new Date().toISOString())}catch{}}function ve(){let e=(0,G.c)(41),{_:t}=i(),n=Y(),a=z(),o=typeof window<`u`?window.okDesktop??null:null,[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),[d]=(0,W.useState)($),[f,p]=(0,W.useState)(!1),m=!d&&!f,h,g;e[0]===m?(h=e[1],g=e[2]):(h=()=>{if(!o||!m)return;let e=!1;return o.integrations.status().then(t=>{e||c(t)}).catch(t=>{console.warn(`[skills-studio] bridge integrations.status failed; intro skipped:`,t),e||p(!0)}),()=>{e=!0}},g=[o,m],e[0]=m,e[1]=h,e[2]=g),(0,W.useEffect)(h,g);let y;e[3]===t?y=e[4]:(y=async function(e,n){if(o){u(!0);try{let t=await o.integrations.setComponent({component:{kind:`skill`,id:e},enabled:n});c(t.status),t.ok||v.error(t.error)}catch(e){let n=e;v.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(!1)}},e[3]=t,e[4]=y);let b=y,x;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){_e(),p(!0)},e[5]=x):x=e[5];let S=x,C;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,K.jsx)(r,{id:`RojU4W`})}),e[6]=C):C=e[6];let w;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(`div`,{children:[C,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`kEiVv6`})})]}),e[7]=w):w=e[7];let T=w;if(a.status===`error`){let t;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-builtin-skills`,children:[T,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`builtin-skills-unavailable`,children:(0,K.jsx)(r,{id:`annvv7`})})]}),e[8]=t):t=e[8],t}if(a.status!==`ready`){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-builtin-skills`,children:[T,(0,K.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 pt-1`,"data-testid":`builtin-skills-loading`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:(0,K.jsx)(r,{id:`VeVIIk`})}),(0,K.jsx)(V,{className:`h-12 w-full`}),(0,K.jsx)(V,{className:`h-12 w-full`})]})]}),e[9]=t):t=e[9],t}let E=a.data,D,O,k,A,j,M,N,P;if(e[10]!==n||e[11]!==s?.skills||e[12]!==l||e[13]!==a.data){j=Symbol.for(`react.early_return_sentinel`);bb0:{let t=E.filter(be);if(t.length===0){j=null;break bb0}D=l;let i;e[22]===s?.skills?i=e[23]:(i=s?.skills.find(ye)??null,e[22]=s?.skills,e[23]=i),O=i,P=`space-y-2 rounded-lg border bg-card p-3`,k=`settings-builtin-skills`,A=T,M=`divide-y divide-border overflow-hidden rounded-md border border-border bg-background/50`;let a;e[24]===n?a=e[25]:(a=e=>{let t=X(e.absolutePath);return(0,K.jsx)(`li`,{className:`hover:bg-accent`,children:(0,K.jsx)(J,{name:e.name,description:n(e.name)??e.description??``,hosts:R(e),emptyHosts:`not-added`,onActivate:t?()=>{I(`ok/skill/preview-open`,{surface:`settings`,skill:e.name}),B({flavor:`builtin`,source:t,name:e.name,subtitle:``,level:`global`})}:void 0,control:t?(0,K.jsx)(_,{variant:`outline`,size:`sm`,"data-testid":`builtin-skill-manage-${e.name}`,onClick:()=>{I(`ok/skill/preview-open`,{surface:`settings`,skill:e.name}),B({flavor:`builtin`,source:t,name:e.name,subtitle:``,level:`global`})},children:(0,K.jsx)(r,{id:`wckWOP`})}):void 0})},e.name)},e[24]=n,e[25]=a),N=t.map(a)}e[10]=n,e[11]=s?.skills,e[12]=l,e[13]=a.data,e[14]=D,e[15]=O,e[16]=k,e[17]=A,e[18]=j,e[19]=M,e[20]=N,e[21]=P}else D=e[14],O=e[15],k=e[16],A=e[17],j=e[18],M=e[19],N=e[20],P=e[21];if(j!==Symbol.for(`react.early_return_sentinel`))return j;let F;e[26]!==M||e[27]!==N?(F=(0,K.jsx)(`ul`,{className:M,children:N}),e[26]=M,e[27]=N,e[28]=F):F=e[28];let L;e[29]!==b||e[30]!==D||e[31]!==O||e[32]!==s||e[33]!==m?(L=m&&s!==null&&(0,K.jsx)(me,{open:!0,offer:O,busy:D,onDismiss:S,onInstall:()=>{O&&(I(`ok/skill/install`,{surface:`skills-studio-intro`,mode:`install`,skill:O.id,hostCount:O.resolvedHosts.length}),S(),b(O.id,!0))}}),e[29]=b,e[30]=D,e[31]=O,e[32]=s,e[33]=m,e[34]=L):L=e[34];let H;return e[35]!==k||e[36]!==A||e[37]!==F||e[38]!==L||e[39]!==P?(H=(0,K.jsxs)(`section`,{className:P,"data-testid":k,children:[A,F,L]}),e[35]=k,e[36]=A,e[37]=F,e[38]=L,e[39]=P,e[40]=H):H=e[40],H}function ye(e){return!e.installed&&!e.onboarding}function be(e){return e.managed===!0&&e.scope===`global`}function $(){return ge()}function xe(){let e=(0,G.c)(48),{_:t}=i(),n=Y(),a=z(),o=typeof window<`u`?window.okDesktop:void 0,[s,c]=(0,W.useState)(!1),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,K.jsx)(r,{id:`RojU4W`})}),e[0]=l):l=e[0];let u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsxs)(`div`,{children:[l,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`9hEdtC`})})]}),e[1]=u):u=e[1];let d=u;if(a.status===`error`){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-project-skill`,children:[d,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`project-skill-unavailable`,children:(0,K.jsx)(r,{id:`CXDYfm`})})]}),e[2]=t):t=e[2],t}if(a.status!==`ready`){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-project-skill`,children:[d,(0,K.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`pt-1`,"data-testid":`project-skill-loading`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:(0,K.jsx)(r,{id:`VeVIIk`})}),(0,K.jsx)(V,{className:`h-12 w-full`})]})]}),e[3]=t):t=e[3],t}let f,p,m,h,g,y,b,x,S,C,w;if(e[4]!==t||e[5]!==n||e[6]!==s||e[7]!==a.data){m=Symbol.for(`react.early_return_sentinel`);bb0:{let i=a.data.find(Ce)??null;if(i===null){if(!o){m=null;break bb0}let n;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`JHv7ti`})}),e[19]=n):n=e[19];let i;e[20]===t?i=e[21]:(i=()=>{c(!0),o.projectIntegrations.setComponent({component:{kind:`skill`},enabled:!0}).then(Se).catch(e=>{v.error(t({id:`faAcQ3`,values:{0:e instanceof Error?e.message:String(e)}}))}).then(()=>c(!1))},e[20]=t,e[21]=i);let a;e[22]===s?a=e[23]:(a=s?(0,K.jsx)(r,{id:`Wtw22s`}):(0,K.jsx)(r,{id:`TKQ7K-`}),e[22]=s,e[23]=a);let l;e[24]!==s||e[25]!==i||e[26]!==a?(l=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-project-skill`,children:[d,(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border bg-background/50 p-3`,children:[n,(0,K.jsx)(_,{size:`sm`,disabled:s,"data-testid":`project-skill-install`,onClick:i,children:a})]})]}),e[24]=s,e[25]=i,e[26]=a,e[27]=l):l=e[27],m=l;break bb0}let l=X(i.absolutePath),u=n(`project`)??i.description??``;p=l?()=>B({flavor:`builtin`,source:l,name:i.name,subtitle:``,level:`project`}):void 0,S=`space-y-2 rounded-lg border bg-card p-3`,C=`settings-project-skill`,w=d,x=`overflow-hidden rounded-md border border-border bg-background/50`,b=`hover:bg-accent`,f=J,h=i.name,g=u,y=R(i)}e[4]=t,e[5]=n,e[6]=s,e[7]=a.data,e[8]=f,e[9]=p,e[10]=m,e[11]=h,e[12]=g,e[13]=y,e[14]=b,e[15]=x,e[16]=S,e[17]=C,e[18]=w}else f=e[8],p=e[9],m=e[10],h=e[11],g=e[12],y=e[13],b=e[14],x=e[15],S=e[16],C=e[17],w=e[18];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let T;e[28]===p?T=e[29]:(T=p?(0,K.jsx)(_,{variant:`outline`,size:`sm`,onClick:p,"data-testid":`project-skill-manage`,children:(0,K.jsx)(r,{id:`wckWOP`})}):void 0,e[28]=p,e[29]=T);let E;e[30]!==f||e[31]!==p||e[32]!==T||e[33]!==h||e[34]!==g||e[35]!==y?(E=(0,K.jsx)(f,{name:h,description:g,hosts:y,emptyHosts:`not-added`,onActivate:p,control:T}),e[30]=f,e[31]=p,e[32]=T,e[33]=h,e[34]=g,e[35]=y,e[36]=E):E=e[36];let D;e[37]!==E||e[38]!==b?(D=(0,K.jsx)(`li`,{className:b,children:E}),e[37]=E,e[38]=b,e[39]=D):D=e[39];let O;e[40]!==D||e[41]!==x?(O=(0,K.jsx)(`ul`,{className:x,children:D}),e[40]=D,e[41]=x,e[42]=O):O=e[42];let k;return e[43]!==O||e[44]!==S||e[45]!==C||e[46]!==w?(k=(0,K.jsxs)(`section`,{className:S,"data-testid":C,children:[w,O]}),e[43]=O,e[44]=S,e[45]=C,e[46]=w,e[47]=k):k=e[47],k}function Se(e){e.ok?y():v.error(e.error)}function Ce(e){return e.managed===!0&&e.scope===`project`}function we(e){let t=(0,G.c)(15),{scope:n}=e,i=`settings-skills-title-${n}`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(r,{id:`w7LRoP`}),t[0]=a):a=t[0];let o=n===`project`?`project`:`user`,s;t[1]===n?s=t[2]:(s=n===`project`?(0,K.jsx)(r,{id:`0ExRWt`}):(0,K.jsx)(r,{id:`ee15Vl`}),t[1]=n,t[2]=s);let c;t[3]!==o||t[4]!==s||t[5]!==i?(c=(0,K.jsx)(ee,{titleId:i,title:a,scope:o,children:s}),t[3]=o,t[4]=s,t[5]=i,t[6]=c):c=t[6];let l,u;t[7]===n?(l=t[8],u=t[9]):(l=n===`project`?(0,K.jsx)(xe,{}):(0,K.jsx)(ve,{}),u=(0,K.jsx)(ie,{scope:n}),t[7]=n,t[8]=l,t[9]=u);let d;return t[10]!==c||t[11]!==l||t[12]!==u||t[13]!==i?(d=(0,K.jsxs)(`section`,{"aria-labelledby":i,className:`space-y-4`,"data-testid":`settings-skills-section`,children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=i,t[14]=d):d=t[14],d}export{we as SkillsManagerSection};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o,r as s,t as c}from"./AgentIconCluster-DYP1yNXm.js";import{a as l,c as u,i as d,l as f,o as p,r as m,s as h,t as g}from"./alert-dialog-BA3e7-10.js";import{t as _}from"./button-DzgjsZzC.js";import{n as v}from"./dist-BGzUo_18.js";import{c as y}from"./documents-events-ddyuXdQl.js";import{t as b}from"./createLucideIcon-DdBzwsHe.js";import{t as x}from"./arrow-right-NOQZeKIW.js";import{a as S,h as C,r as w,t as T}from"./dropdown-menu-5XqyQTVx.js";import{t as E}from"./copy-DpWa6i2v.js";import{t as D}from"./trash-2-CchZ0T47.js";import{a as O,c as k,i as A,n as j,o as M,s as N,t as P}from"./dialog-BJEjKJjL.js";import"./constants-skills-BLHVRW90.js";import{t as F}from"./tool-list-format-CS7MZY1Q.js";import{n as I}from"./perf-CPPbaRwr.js";import{t as L}from"./input-BsFOyzfK.js";import{a as R}from"./skill-scope-DOTLd4gL.js";import{t as z}from"./use-skills-CkvdjORj.js";import{n as B}from"./open-managed-artifact-tab-Bgndx1BG.js";import{t as V}from"./skeleton-CrbF9ppq.js";import{t as H}from"./ChangedOutsideBadge-BfH3veLO.js";import{t as U}from"./use-skill-targets-DZmqRDS7.js";import{t as ee}from"./SettingsSectionHeader-BKhNIRp2.js";var te=b(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),W=e(n(),1),G=a(),K=t();function q(e){let t=(0,G.c)(25),{icon:n,label:r,detail:i,names:a,tone:o,testId:s}=e,c=o===`destructive`?`text-destructive`:o===`muted`?`text-muted-foreground`:`text-foreground`,l=`mt-0.5 shrink-0 ${c}`,u;t[0]!==n||t[1]!==l?(u=(0,K.jsx)(`span`,{className:l,"aria-hidden":!0,children:n}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d=`font-medium text-xs ${c}`,f;t[3]!==r||t[4]!==d?(f=(0,K.jsx)(`span`,{className:d,children:r}),t[3]=r,t[4]=d,t[5]=f):f=t[5];let p;t[6]===a.length?p=t[7]:(p=(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:a.length}),t[6]=a.length,t[7]=p);let m;t[8]!==f||t[9]!==p?(m=(0,K.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[f,p]}),t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]===i?h=t[12]:(h=i?(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:i}):null,t[11]=i,t[12]=h);let g;t[13]===a?g=t[14]:(g=a.map(ne),t[13]=a,t[14]=g);let _;t[15]===g?_=t[16]:(_=(0,K.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-x-2 gap-y-0.5`,children:g}),t[15]=g,t[16]=_);let v;t[17]!==m||t[18]!==h||t[19]!==_?(v=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m,h,_]}),t[17]=m,t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==u||t[23]!==s?(y=(0,K.jsxs)(`div`,{className:`flex gap-2.5`,"data-testid":s,children:[u,v]}),t[21]=v,t[22]=u,t[23]=s,t[24]=y):y=t[24],y}function ne(e){return(0,K.jsx)(`code`,{className:`break-all text-[11px] text-muted-foreground`,children:e},e)}function re(e){let t=(0,G.c)(51),{open:n,onOpenChange:a,pick:o,keep:s,preview:c,onConfirm:v}=e,{_:y}=i(),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,K.jsx)(f,{children:(0,K.jsx)(r,{id:`Eu-LIb`})}),t[0]=b):b=t[0];let S;t[1]===s?S=t[2]:(S=(0,K.jsxs)(u,{children:[b,(0,K.jsx)(p,{children:(0,K.jsx)(r,{id:`IvKbeq`,values:{keep:s}})})]}),t[1]=s,t[2]=S);let C;t[3]===o?C=t[4]:(C=(0,K.jsx)(`code`,{className:`block break-all font-mono text-[11px]`,children:o}),t[3]=o,t[4]=C);let w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:(0,K.jsx)(r,{id:`kjlQ9D`})}),t[5]=w):w=t[5];let T;t[6]===C?T=t[7]:(T=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 rounded border border-border/60 px-2 py-1.5`,children:[C,w]}),t[6]=C,t[7]=T);let O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(x,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[8]=O):O=t[8];let k;t[9]===s?k=t[10]:(k=(0,K.jsx)(`code`,{className:`block break-all font-mono text-[11px]`,children:s}),t[9]=s,t[10]=k);let A;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:(0,K.jsx)(r,{id:`f1-q9m`})}),t[11]=A):A=t[11];let j;t[12]===k?j=t[13]:(j=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 rounded border border-border/60 bg-muted/40 px-2 py-1.5`,children:[k,A]}),t[12]=k,t[13]=j);let M;t[14]!==T||t[15]!==j?(M=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,"data-testid":`skill-folder-link-direction`,children:[T,O,j]}),t[14]=T,t[15]=j,t[16]=M):M=t[16];let N;t[17]===c.moves?N=t[18]:(N=c.moves.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-moves`,icon:(0,K.jsx)(x,{className:`size-3.5`}),tone:`default`,label:(0,K.jsx)(r,{id:`2Ce6hp`}),names:c.moves}):null,t[17]=c.moves,t[18]=N);let P;t[19]!==y||t[20]!==o||t[21]!==c.drops?(P=c.drops.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-drops`,icon:(0,K.jsx)(E,{className:`size-3.5`}),tone:`muted`,label:(0,K.jsx)(r,{id:`RxF-am`}),detail:y({id:`H8DVOJ`,values:{pick:o}}),names:c.drops}):null,t[19]=y,t[20]=o,t[21]=c.drops,t[22]=P):P=t[22];let F;t[23]!==y||t[24]!==s||t[25]!==c.replaces?(F=c.replaces.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-replaces`,icon:(0,K.jsx)(te,{className:`size-3.5`}),tone:`destructive`,label:(0,K.jsx)(r,{id:`0m4Snh`}),detail:y({id:`jEVipR`,values:{keep:s}}),names:c.replaces}):null,t[23]=y,t[24]=s,t[25]=c.replaces,t[26]=F):F=t[26];let I;t[27]!==y||t[28]!==o||t[29]!==c.removes?(I=c.removes.length>0?(0,K.jsx)(q,{testId:`skill-folder-link-removes`,icon:(0,K.jsx)(D,{className:`size-3.5`}),tone:`destructive`,label:(0,K.jsx)(r,{id:`hs5BRR`}),detail:y({id:`beHZo4`,values:{pick:o}}),names:c.removes}):null,t[27]=y,t[28]=o,t[29]=c.removes,t[30]=I):I=t[30];let L;t[31]!==N||t[32]!==P||t[33]!==F||t[34]!==I?(L=(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[N,P,F,I]}),t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L):L=t[35];let R;t[36]!==M||t[37]!==L?(R=(0,K.jsxs)(m,{className:`flex flex-col gap-4 py-1`,children:[M,L]}),t[36]=M,t[37]=L,t[38]=R):R=t[38];let z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,K.jsx)(d,{children:(0,K.jsx)(r,{id:`dEgA5A`})}),t[39]=z):z=t[39];let B;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsx)(r,{id:`rf0tV1`}),t[40]=B):B=t[40];let V;t[41]===v?V=t[42]:(V=(0,K.jsxs)(h,{children:[z,(0,K.jsx)(_,{onClick:v,"data-testid":`skill-folder-link-confirm`,children:B})]}),t[41]=v,t[42]=V);let H;t[43]!==R||t[44]!==V||t[45]!==S?(H=(0,K.jsxs)(l,{children:[S,R,V]}),t[43]=R,t[44]=V,t[45]=S,t[46]=H):H=t[46];let U;return t[47]!==a||t[48]!==n||t[49]!==H?(U=(0,K.jsx)(g,{open:n,onOpenChange:a,children:H}),t[47]=a,t[48]=n,t[49]=H,t[50]=U):U=t[50],U}function ie(e){let t=(0,G.c)(67),{scope:n}=e,{i18n:a,_:o}=i(),{state:l,saving:u,folderAction:d}=U(),[f,p]=(0,W.useState)(``),[m,h]=(0,W.useState)(null),g,y,b,x,E;if(t[0]!==o||t[1]!==d||t[2]!==a||t[3]!==m||t[4]!==u||t[5]!==n||t[6]!==l.data||t[7]!==l.message||t[8]!==l.status){let e=l.status===`ready`?(l.data.folders??[]).filter(e=>e.scope===n):[],i=new Map(e.map(de)),f=e=>(e.state===`linked`||e.state===`linked-parent`)&&typeof e.target==`string`&&i.has(e.target),p=new Map;for(let t of e){if(!f(t))continue;let e=t.target;p.set(e,[...p.get(e)??[],t])}let D;t[14]===f?D=t[15]:(D=e=>!f(e),t[14]=f,t[15]=D);let O=e.filter(D),k;t[16]!==d||t[17]!==n?(k=(e,t,r)=>{d({scope:n,root:e,action:t,...r===void 0?{}:{target:r}}).catch(ue)},t[16]=d,t[17]=n,t[18]=k):k=t[18];let A=k,j;t[19]===n?j=t[20]:(j=e=>n===`global`?`~/${e}`:e,t[19]=n,t[20]=j);let M=j,N;t[21]!==o||t[22]!==M||t[23]!==d||t[24]!==n?(N=(e,t)=>{let r=M(e),i=M(t);d({scope:n,root:e,action:`link`,target:t,preview:!0}).then(a=>{if(!a){v.error(o({id:`KkRyMI`}));return}if(a.conflicts.length>0){v.error(o({id:`l2BOXd`,values:{0:a.conflicts.join(`, `),pick:r,keep:i}}));return}if(a.strays.length>0){v.error(o({id:`-qBQVd`,values:{0:a.strays.join(`, `),pick:r}}));return}if(a.moves.length+a.removes.length+a.replaces.length>0){h({root:e,target:t,pick:r,keep:i,preview:a});return}return d({scope:n,root:e,action:`link`,target:t})}).catch(le)},t[21]=o,t[22]=M,t[23]=d,t[24]=n,t[25]=N):N=t[25];let P=N,I;t[26]!==d||t[27]!==m||t[28]!==n?(I=()=>{if(!m)return;let{root:e,target:t}=m;h(null),d({scope:n,root:e,action:`link`,target:t}).catch(ce)},t[26]=d,t[27]=m,t[28]=n,t[29]=I):I=t[29],g=I,y=`space-y-2 rounded-lg border bg-card p-3`,b=`settings-skill-folders`;let L;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,K.jsx)(r,{id:`59CUI8`})}),t[30]=L):L=t[30],t[31]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,K.jsxs)(`div`,{children:[L,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`J_jZ5z`})})]}),t[31]=x):x=t[31],E=l.status===`error`?(0,K.jsx)(`div`,{className:`text-1sm text-destructive`,role:`alert`,"data-testid":`skill-targets-error`,children:(0,K.jsx)(r,{id:`ACKMCN`,values:{0:l.message}})}):l.status===`ready`?(0,K.jsx)(`ul`,{className:`space-y-1 pt-1`,children:O.map(t=>{let i=M(t.root),l=p.get(t.root)??[],d=se,f=e.filter(e=>e.root!==t.root&&(e.state===`own`||e.state===`absent`)&&!d(e)),m=(t.state===`own`||t.state===`absent`)&&!d(t);return(0,K.jsxs)(`li`,{className:`text-sm`,"data-testid":`skill-folder-row-${t.host}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(c,{host:t.host,"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:[i,t.state===`linked`||t.state===`linked-parent`?(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[` → `,t.target??`?`]}):null]}),t.drift?(0,K.jsx)(H,{testId:`skill-folder-drift-${t.host}`,title:o({id:`p3m_Gk`,values:{0:t.expected??``}})}):null,t.state===`linked-parent`?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,title:o({id:`yLwx9e`}),children:(0,K.jsx)(r,{id:`nf0wk0`})}):null,d(t)?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,title:o({id:`QP9OU3`}),"data-testid":`skill-folder-hub-destination-only`,children:(0,K.jsx)(r,{id:`mPoOmg`})}):null,m&&f.length>0?(0,K.jsxs)(T,{children:[(0,K.jsx)(C,{asChild:!0,children:(0,K.jsx)(_,{size:`sm`,variant:`ghost`,disabled:u,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] uppercase tracking-wide text-muted-foreground hover:text-foreground`,title:o({id:`g5w1sF`,values:{display:i}}),"data-testid":`skill-folder-link-${t.host}`,children:(0,K.jsx)(r,{id:`yzF66j`})})}),(0,K.jsx)(w,{align:`end`,className:`w-auto`,children:f.map(e=>(0,K.jsxs)(S,{onSelect:()=>P(e.root,t.root),"data-testid":`skill-folder-link-${t.host}-to-${e.root}`,children:[(0,K.jsx)(c,{host:e.host,"aria-hidden":!0,className:`size-4`}),(0,K.jsx)(`span`,{className:`font-mono text-xs`,children:n===`global`?`~/${e.root}`:e.root})]},e.root))})]}):null,t.state===`linked`?(0,K.jsx)(_,{size:`sm`,variant:`ghost`,disabled:u,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] uppercase tracking-wide text-muted-foreground hover:text-foreground`,title:o({id:`MQ5LOx`,values:{display:i}}),onClick:()=>A(t.root,`unlink`),"data-testid":`skill-folder-unlink-${t.host}`,children:(0,K.jsx)(r,{id:`ptQ3_N`})}):null]}),l.length>0?(0,K.jsx)(`p`,{className:`mt-1 ml-6 text-muted-foreground text-xs`,"data-testid":`skill-folder-shared-${t.host}`,children:o({id:`OOLsBh`,values:{0:F([t.host,...l.map(oe)].map(s),a.locale)}})}):null,l.length>0?(0,K.jsx)(`ul`,{className:`mt-1 ml-2 space-y-1 border-border/60 border-l pl-3`,"data-testid":`skill-folder-followers-${t.host}`,children:l.map(e=>(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(c,{host:e.host,"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground text-xs`,children:n===`global`?`~/${e.root}`:e.root}),e.drift?(0,K.jsx)(H,{testId:`skill-folder-drift-${e.host}`,title:o({id:`p3m_Gk`,values:{0:e.expected??``}})}):null,e.state===`linked-parent`?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,title:o({id:`yLwx9e`}),children:(0,K.jsx)(r,{id:`Ef6ukL`})}):(0,K.jsx)(_,{size:`sm`,variant:`ghost`,disabled:u,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide hover:text-foreground`,title:o({id:`9_2oe6`,values:{0:n===`global`?`~/${e.root}`:e.root}}),onClick:()=>A(e.root,`unlink`),"data-testid":`skill-folder-unlink-${e.host}`,children:(0,K.jsx)(r,{id:`ptQ3_N`})})]},e.host))}):null]},t.host)})}):(0,K.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(0,K.jsx)(V,{className:`h-5 w-56`}),(0,K.jsx)(V,{className:`h-5 w-56`})]}),t[0]=o,t[1]=d,t[2]=a,t[3]=m,t[4]=u,t[5]=n,t[6]=l.data,t[7]=l.message,t[8]=l.status,t[9]=g,t[10]=y,t[11]=b,t[12]=x,t[13]=E}else g=t[9],y=t[10],b=t[11],x=t[12],E=t[13];let D;t[32]!==d||t[33]!==f||t[34]!==n?(D=e=>{e.preventDefault();let t=f.trim().replace(/^~\//,``);t!==``&&d({scope:n,root:t,action:`add-root`}).then(()=>p(``)).catch(ae)},t[32]=d,t[33]=f,t[34]=n,t[35]=D):D=t[35];let O;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>p(e.target.value),t[36]=O):O=t[36];let k;t[37]===o?k=t[38]:(k=o({id:`oyBV3W`}),t[37]=o,t[38]=k);let A;t[39]!==o||t[40]!==n?(A=o(n===`global`?{id:`Wboy1j`}:{id:`jpoCue`}),t[39]=o,t[40]=n,t[41]=A):A=t[41];let j;t[42]!==f||t[43]!==u||t[44]!==k||t[45]!==A?(j=(0,K.jsx)(L,{value:f,onChange:O,"aria-label":k,placeholder:A,className:`h-7 flex-1 font-mono text-xs`,disabled:u,"data-testid":`skill-folders-add-root-input`}),t[42]=f,t[43]=u,t[44]=k,t[45]=A,t[46]=j):j=t[46];let M;t[47]!==f||t[48]!==u?(M=u||f.trim()===``,t[47]=f,t[48]=u,t[49]=M):M=t[49];let N;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,K.jsx)(r,{id:`ZW2yR_`}),t[50]=N):N=t[50];let P;t[51]===M?P=t[52]:(P=(0,K.jsx)(_,{type:`submit`,size:`sm`,variant:`secondary`,disabled:M,className:`h-7 px-2 font-normal text-xs`,children:N}),t[51]=M,t[52]=P);let I;t[53]!==P||t[54]!==D||t[55]!==j?(I=(0,K.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:D,"data-testid":`skill-folders-add-root`,children:[j,P]}),t[53]=P,t[54]=D,t[55]=j,t[56]=I):I=t[56];let R;t[57]!==g||t[58]!==m?(R=m?(0,K.jsx)(re,{open:!0,onOpenChange:e=>{e||h(null)},pick:m.pick,keep:m.keep,preview:m.preview,onConfirm:g}):null,t[57]=g,t[58]=m,t[59]=R):R=t[59];let z;return t[60]!==y||t[61]!==I||t[62]!==R||t[63]!==b||t[64]!==x||t[65]!==E?(z=(0,K.jsxs)(`section`,{className:y,"data-testid":b,children:[x,E,I,R]}),t[60]=y,t[61]=I,t[62]=R,t[63]=b,t[64]=x,t[65]=E,t[66]=z):z=t[66],z}function ae(e){return v.error(e instanceof Error?e.message:String(e))}function oe(e){return e.host}function se(e){return e.root===`.agents/skills`&&e.state===`absent`}function ce(e){return v.error(e instanceof Error?e.message:String(e))}function le(e){return v.error(e instanceof Error?e.message:String(e))}function ue(e){return v.error(e instanceof Error?e.message:String(e))}function de(e){return[e.root,e]}function J(e){let t=(0,G.c)(22),{name:n,description:i,hosts:a,emptyHosts:s,onActivate:c,ariaExpanded:l,control:u}=e,d;t[0]===n?d=t[1]:(d=(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground group-hover/button:underline`,children:(0,K.jsx)(`code`,{children:n})}),t[0]=n,t[1]=d);let f;t[2]===i?f=t[3]:(f=(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i}),t[2]=i,t[3]=f);let p;t[4]!==d||t[5]!==f?(p=(0,K.jsxs)(K.Fragment,{children:[d,f]}),t[4]=d,t[5]=f,t[6]=p):p=t[6];let m=p,h;t[7]!==l||t[8]!==m||t[9]!==c?(h=c?(0,K.jsx)(_,{variant:`ghost`,onClick:c,"aria-expanded":l,className:`group/button h-auto w-full flex-col items-start justify-start gap-0.5 whitespace-normal p-0 text-left hover:bg-transparent`,"data-testid":`skill-consent-row-preview`,children:m}):(0,K.jsx)(`span`,{className:`flex flex-col gap-0.5`,children:m}),t[7]=l,t[8]=m,t[9]=c,t[10]=h):h=t[10];let g;t[11]!==s||t[12]!==a?(g=(0,K.jsx)(`span`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:a.length>0?(0,K.jsx)(o,{hosts:a}):(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`skill-consent-row-no-hosts`,children:s===`not-added`?(0,K.jsx)(r,{id:`zP6U1P`}):(0,K.jsx)(r,{id:`yOjRUV`})})}),t[11]=s,t[12]=a,t[13]=g):g=t[13];let v;t[14]!==h||t[15]!==g?(v=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[h,g]}),t[14]=h,t[15]=g,t[16]=v):v=t[16];let y;t[17]===u?y=t[18]:(y=u?(0,K.jsx)(`span`,{className:`shrink-0`,children:u}):null,t[17]=u,t[18]=y);let b;return t[19]!==v||t[20]!==y?(b=(0,K.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5`,"data-testid":`skill-consent-row`,children:[v,y]}),t[19]=v,t[20]=y,t[21]=b):b=t[21],b}function fe(e){let t=(0,G.c)(4),{paths:n}=e,r;t[0]===n?r=t[1]:(r=n.map(pe),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,K.jsx)(`ul`,{className:`flex flex-col gap-0.5`,"data-testid":`skill-destination-list`,children:r}),t[2]=r,t[3]=i),i}function pe(e){return(0,K.jsx)(`li`,{children:(0,K.jsx)(`code`,{className:`break-all text-xs text-muted-foreground`,children:e})},e)}function Y(){let{_:e}=i();return t=>{switch(t){case`discovery`:case`open-knowledge-discovery`:return e({id:`olb6oq`});case`write-skill`:case`open-knowledge-write-skill`:return e({id:`I-6_4S`});case`project`:case`open-knowledge`:return e({id:`UMT9C9`});default:return null}}}function X(e){if(!e)return null;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>0?e.slice(0,t):null}function me(e){let t=(0,G.c)(22),{open:n,onDismiss:a,offer:o,onInstall:s,busy:c}=e,l=c===void 0?!1:c,{_:u}=i(),d=Y(),f=o!==null&&o.resolvedHosts.length>0,p;t[0]===a?p=t[1]:(p=e=>{e||a()},t[0]=a,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(k,{children:(0,K.jsx)(r,{id:`w7LRoP`})}),t[2]=m):m=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,K.jsxs)(N,{children:[m,(0,K.jsx)(O,{children:(0,K.jsx)(r,{id:`tX8FLX`})})]}),t[3]=h):h=t[3];let g;t[4]!==d||t[5]!==f||t[6]!==o?(g=o!==null&&(0,K.jsxs)(j,{className:`flex flex-col gap-3 py-1`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,K.jsx)(r,{id:`oy5bJW`})}),(0,K.jsx)(`div`,{className:`rounded-md border border-border bg-card/50`,children:(0,K.jsx)(J,{name:o.name,description:d(o.id)??o.description,hosts:o.resolvedHosts.map(he),emptyHosts:`none-detected`})}),f&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,K.jsx)(r,{id:`0CvV_9`})}),(0,K.jsx)(fe,{paths:o.paths})]})]}),t[4]=d,t[5]=f,t[6]=o,t[7]=g):g=t[7];let v;t[8]!==u||t[9]!==l||t[10]!==f||t[11]!==o||t[12]!==a||t[13]!==s?(v=(0,K.jsx)(M,{children:o===null?(0,K.jsx)(_,{onClick:a,"data-testid":`skills-studio-intro-ack`,children:(0,K.jsx)(r,{id:`76gPWk`})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_,{variant:`outline`,onClick:a,"data-testid":`skills-studio-intro-dismiss`,children:(0,K.jsx)(r,{id:`PBxg_E`})}),(0,K.jsx)(_,{onClick:s,disabled:l||!f,"aria-label":u({id:`fGqEFq`,values:{0:o.name}}),"data-testid":`skills-studio-intro-install`,children:(0,K.jsx)(r,{id:`TKQ7K-`})})]})}),t[8]=u,t[9]=l,t[10]=f,t[11]=o,t[12]=a,t[13]=s,t[14]=v):v=t[14];let y;t[15]!==g||t[16]!==v?(y=(0,K.jsxs)(A,{className:`sm:max-w-md`,"data-testid":`skills-studio-intro`,children:[h,g,v]}),t[15]=g,t[16]=v,t[17]=y):y=t[17];let b;return t[18]!==n||t[19]!==p||t[20]!==y?(b=(0,K.jsx)(P,{open:n,onOpenChange:p,children:y}),t[18]=n,t[19]=p,t[20]=y,t[21]=b):b=t[21],b}function he(e){return e.editor}var Z=`ok-skills-studio-intro-seen-v1`;function Q(){try{return typeof localStorage>`u`?null:localStorage}catch{return null}}function ge(e){let t=e===void 0?Q():e;if(!t)return!0;try{return t.getItem(Z)!==null}catch{return!0}}function _e(e){let t=e===void 0?Q():e;if(t)try{t.setItem(Z,new Date().toISOString())}catch{}}function ve(){let e=(0,G.c)(41),{_:t}=i(),n=Y(),a=z(),o=typeof window<`u`?window.okDesktop??null:null,[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),[d]=(0,W.useState)($),[f,p]=(0,W.useState)(!1),m=!d&&!f,h,g;e[0]===m?(h=e[1],g=e[2]):(h=()=>{if(!o||!m)return;let e=!1;return o.integrations.status().then(t=>{e||c(t)}).catch(t=>{console.warn(`[skills-studio] bridge integrations.status failed; intro skipped:`,t),e||p(!0)}),()=>{e=!0}},g=[o,m],e[0]=m,e[1]=h,e[2]=g),(0,W.useEffect)(h,g);let y;e[3]===t?y=e[4]:(y=async function(e,n){if(o){u(!0);try{let t=await o.integrations.setComponent({component:{kind:`skill`,id:e},enabled:n});c(t.status),t.ok||v.error(t.error)}catch(e){let n=e;v.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(!1)}},e[3]=t,e[4]=y);let b=y,x;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){_e(),p(!0)},e[5]=x):x=e[5];let S=x,C;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,K.jsx)(r,{id:`RojU4W`})}),e[6]=C):C=e[6];let w;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(`div`,{children:[C,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`kEiVv6`})})]}),e[7]=w):w=e[7];let T=w;if(a.status===`error`){let t;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-builtin-skills`,children:[T,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`builtin-skills-unavailable`,children:(0,K.jsx)(r,{id:`annvv7`})})]}),e[8]=t):t=e[8],t}if(a.status!==`ready`){let t;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-builtin-skills`,children:[T,(0,K.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 pt-1`,"data-testid":`builtin-skills-loading`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:(0,K.jsx)(r,{id:`VeVIIk`})}),(0,K.jsx)(V,{className:`h-12 w-full`}),(0,K.jsx)(V,{className:`h-12 w-full`})]})]}),e[9]=t):t=e[9],t}let E=a.data,D,O,k,A,j,M,N,P;if(e[10]!==n||e[11]!==s?.skills||e[12]!==l||e[13]!==a.data){j=Symbol.for(`react.early_return_sentinel`);bb0:{let t=E.filter(be);if(t.length===0){j=null;break bb0}D=l;let i;e[22]===s?.skills?i=e[23]:(i=s?.skills.find(ye)??null,e[22]=s?.skills,e[23]=i),O=i,P=`space-y-2 rounded-lg border bg-card p-3`,k=`settings-builtin-skills`,A=T,M=`divide-y divide-border overflow-hidden rounded-md border border-border bg-background/50`;let a;e[24]===n?a=e[25]:(a=e=>{let t=X(e.absolutePath);return(0,K.jsx)(`li`,{className:`hover:bg-accent`,children:(0,K.jsx)(J,{name:e.name,description:n(e.name)??e.description??``,hosts:R(e),emptyHosts:`not-added`,onActivate:t?()=>{I(`ok/skill/preview-open`,{surface:`settings`,skill:e.name}),B({flavor:`builtin`,source:t,name:e.name,subtitle:``,level:`global`})}:void 0,control:t?(0,K.jsx)(_,{variant:`outline`,size:`sm`,"data-testid":`builtin-skill-manage-${e.name}`,onClick:()=>{I(`ok/skill/preview-open`,{surface:`settings`,skill:e.name}),B({flavor:`builtin`,source:t,name:e.name,subtitle:``,level:`global`})},children:(0,K.jsx)(r,{id:`wckWOP`})}):void 0})},e.name)},e[24]=n,e[25]=a),N=t.map(a)}e[10]=n,e[11]=s?.skills,e[12]=l,e[13]=a.data,e[14]=D,e[15]=O,e[16]=k,e[17]=A,e[18]=j,e[19]=M,e[20]=N,e[21]=P}else D=e[14],O=e[15],k=e[16],A=e[17],j=e[18],M=e[19],N=e[20],P=e[21];if(j!==Symbol.for(`react.early_return_sentinel`))return j;let F;e[26]!==M||e[27]!==N?(F=(0,K.jsx)(`ul`,{className:M,children:N}),e[26]=M,e[27]=N,e[28]=F):F=e[28];let L;e[29]!==b||e[30]!==D||e[31]!==O||e[32]!==s||e[33]!==m?(L=m&&s!==null&&(0,K.jsx)(me,{open:!0,offer:O,busy:D,onDismiss:S,onInstall:()=>{O&&(I(`ok/skill/install`,{surface:`skills-studio-intro`,mode:`install`,skill:O.id,hostCount:O.resolvedHosts.length}),S(),b(O.id,!0))}}),e[29]=b,e[30]=D,e[31]=O,e[32]=s,e[33]=m,e[34]=L):L=e[34];let H;return e[35]!==k||e[36]!==A||e[37]!==F||e[38]!==L||e[39]!==P?(H=(0,K.jsxs)(`section`,{className:P,"data-testid":k,children:[A,F,L]}),e[35]=k,e[36]=A,e[37]=F,e[38]=L,e[39]=P,e[40]=H):H=e[40],H}function ye(e){return!e.installed&&!e.onboarding}function be(e){return e.managed===!0&&e.scope===`global`}function $(){return ge()}function xe(){let e=(0,G.c)(48),{_:t}=i(),n=Y(),a=z(),o=typeof window<`u`?window.okDesktop:void 0,[s,c]=(0,W.useState)(!1),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,K.jsx)(r,{id:`RojU4W`})}),e[0]=l):l=e[0];let u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsxs)(`div`,{children:[l,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`9hEdtC`})})]}),e[1]=u):u=e[1];let d=u;if(a.status===`error`){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-project-skill`,children:[d,(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`project-skill-unavailable`,children:(0,K.jsx)(r,{id:`CXDYfm`})})]}),e[2]=t):t=e[2],t}if(a.status!==`ready`){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-project-skill`,children:[d,(0,K.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`pt-1`,"data-testid":`project-skill-loading`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:(0,K.jsx)(r,{id:`VeVIIk`})}),(0,K.jsx)(V,{className:`h-12 w-full`})]})]}),e[3]=t):t=e[3],t}let f,p,m,h,g,y,b,x,S,C,w;if(e[4]!==t||e[5]!==n||e[6]!==s||e[7]!==a.data){m=Symbol.for(`react.early_return_sentinel`);bb0:{let i=a.data.find(Ce)??null;if(i===null){if(!o){m=null;break bb0}let n;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,K.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,K.jsx)(r,{id:`JHv7ti`})}),e[19]=n):n=e[19];let i;e[20]===t?i=e[21]:(i=()=>{c(!0),o.projectIntegrations.setComponent({component:{kind:`skill`},enabled:!0}).then(Se).catch(e=>{v.error(t({id:`faAcQ3`,values:{0:e instanceof Error?e.message:String(e)}}))}).then(()=>c(!1))},e[20]=t,e[21]=i);let a;e[22]===s?a=e[23]:(a=s?(0,K.jsx)(r,{id:`Wtw22s`}):(0,K.jsx)(r,{id:`TKQ7K-`}),e[22]=s,e[23]=a);let l;e[24]!==s||e[25]!==i||e[26]!==a?(l=(0,K.jsxs)(`section`,{className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-project-skill`,children:[d,(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border bg-background/50 p-3`,children:[n,(0,K.jsx)(_,{size:`sm`,disabled:s,"data-testid":`project-skill-install`,onClick:i,children:a})]})]}),e[24]=s,e[25]=i,e[26]=a,e[27]=l):l=e[27],m=l;break bb0}let l=X(i.absolutePath),u=n(`project`)??i.description??``;p=l?()=>B({flavor:`builtin`,source:l,name:i.name,subtitle:``,level:`project`}):void 0,S=`space-y-2 rounded-lg border bg-card p-3`,C=`settings-project-skill`,w=d,x=`overflow-hidden rounded-md border border-border bg-background/50`,b=`hover:bg-accent`,f=J,h=i.name,g=u,y=R(i)}e[4]=t,e[5]=n,e[6]=s,e[7]=a.data,e[8]=f,e[9]=p,e[10]=m,e[11]=h,e[12]=g,e[13]=y,e[14]=b,e[15]=x,e[16]=S,e[17]=C,e[18]=w}else f=e[8],p=e[9],m=e[10],h=e[11],g=e[12],y=e[13],b=e[14],x=e[15],S=e[16],C=e[17],w=e[18];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let T;e[28]===p?T=e[29]:(T=p?(0,K.jsx)(_,{variant:`outline`,size:`sm`,onClick:p,"data-testid":`project-skill-manage`,children:(0,K.jsx)(r,{id:`wckWOP`})}):void 0,e[28]=p,e[29]=T);let E;e[30]!==f||e[31]!==p||e[32]!==T||e[33]!==h||e[34]!==g||e[35]!==y?(E=(0,K.jsx)(f,{name:h,description:g,hosts:y,emptyHosts:`not-added`,onActivate:p,control:T}),e[30]=f,e[31]=p,e[32]=T,e[33]=h,e[34]=g,e[35]=y,e[36]=E):E=e[36];let D;e[37]!==E||e[38]!==b?(D=(0,K.jsx)(`li`,{className:b,children:E}),e[37]=E,e[38]=b,e[39]=D):D=e[39];let O;e[40]!==D||e[41]!==x?(O=(0,K.jsx)(`ul`,{className:x,children:D}),e[40]=D,e[41]=x,e[42]=O):O=e[42];let k;return e[43]!==O||e[44]!==S||e[45]!==C||e[46]!==w?(k=(0,K.jsxs)(`section`,{className:S,"data-testid":C,children:[w,O]}),e[43]=O,e[44]=S,e[45]=C,e[46]=w,e[47]=k):k=e[47],k}function Se(e){e.ok?y():v.error(e.error)}function Ce(e){return e.managed===!0&&e.scope===`project`}function we(e){let t=(0,G.c)(15),{scope:n}=e,i=`settings-skills-title-${n}`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(r,{id:`w7LRoP`}),t[0]=a):a=t[0];let o=n===`project`?`project`:`user`,s;t[1]===n?s=t[2]:(s=n===`project`?(0,K.jsx)(r,{id:`0ExRWt`}):(0,K.jsx)(r,{id:`ee15Vl`}),t[1]=n,t[2]=s);let c;t[3]!==o||t[4]!==s||t[5]!==i?(c=(0,K.jsx)(ee,{titleId:i,title:a,scope:o,children:s}),t[3]=o,t[4]=s,t[5]=i,t[6]=c):c=t[6];let l,u;t[7]===n?(l=t[8],u=t[9]):(l=n===`project`?(0,K.jsx)(xe,{}):(0,K.jsx)(ve,{}),u=(0,K.jsx)(ie,{scope:n}),t[7]=n,t[8]=l,t[9]=u);let d;return t[10]!==c||t[11]!==l||t[12]!==u||t[13]!==i?(d=(0,K.jsxs)(`section`,{"aria-labelledby":i,className:`space-y-4`,"data-testid":`settings-skills-section`,children:[c,l,u]}),t[10]=c,t[11]=l,t[12]=u,t[13]=i,t[14]=d):d=t[14],d}export{we as SkillsManagerSection};
|
package/dist/public/assets/{SlidesPluginSection-B8KiQkqa.js → SlidesPluginSection-BhUKklqb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-DzgjsZzC.js";import{t as s}from"./arrow-up-right-nJaICi16.js";import{t as c}from"./terminal-Cpb4l1oH.js";import{n as l}from"./use-settings-route-Bj-m9X61.js";import{r as u,t as d}from"./terminal-command-events-h-p66odT.js";import{i as f,n as p,t as m}from"./input-group-xi315pKE.js";import{t as h}from"./external-link-8lDpeCuR.js";import{t as g}from"./CopyButton-BTy3joJd.js";import{t as _}from"./SettingsSectionHeader-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-DzgjsZzC.js";import{t as s}from"./arrow-up-right-nJaICi16.js";import{t as c}from"./terminal-Cpb4l1oH.js";import{n as l}from"./use-settings-route-Bj-m9X61.js";import{r as u,t as d}from"./terminal-command-events-h-p66odT.js";import{i as f,n as p,t as m}from"./input-group-xi315pKE.js";import{t as h}from"./external-link-8lDpeCuR.js";import{t as g}from"./CopyButton-BTy3joJd.js";import{t as _}from"./SettingsSectionHeader-BKhNIRp2.js";var v=a(),y=e(n(),1),b=t(),x=u(`install-slidev`)??``,S=`https://sli.dev/guide/install`,C=`https://openknowledge.ai/docs/plugins/slidev`;function w(){let e=(0,v.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={kind:`checking`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),i,a;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=!0,t=()=>{let t=window.okDesktop?.slides;if(t==null){r({kind:`unsupported`});return}t.status().then(t=>{e&&r(t.available?{kind:`available`,source:t.source}:{kind:`missing`})}).catch(t=>{console.warn(`[slides] settings availability probe failed:`,t),e&&r({kind:`check-failed`})})};return t(),window.addEventListener(`focus`,t),()=>{e=!1,window.removeEventListener(`focus`,t)}},a=[],e[1]=i,e[2]=a):(i=e[1],a=e[2]),(0,y.useEffect)(i,a),n}function T(){let e=window.okDesktop;return e?.terminal!=null&&e.config?.ptyAvailable===!0}function E(e){let t=(0,v.c)(23),{availability:n}=e,{_:a}=i();if(n.kind===`checking`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`slides-status-checking`,children:(0,b.jsx)(r,{id:`P8AnMN`})}),t[0]=e):e=t[0],e}if(n.kind===`check-failed`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`slides-status-check-failed`,children:(0,b.jsx)(r,{id:`49Mb7P`})}),t[1]=e):e=t[1],e}if(n.kind===`unsupported`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`slides-status-unsupported`,children:(0,b.jsx)(r,{id:`lScd1O`})}),t[2]=e):e=t[2],e}if(n.kind===`available`){let e;return t[3]===n.source?e=t[4]:(e=(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`slides-status-available`,children:n.source===`project-local`?(0,b.jsx)(r,{id:`el2KyL`}):(0,b.jsx)(r,{id:`xxRpzT`})}),t[3]=n.source,t[4]=e),e}let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(`p`,{className:`text-sm text-warning`,children:(0,b.jsx)(r,{id:`HPaAxt`})}),t[5]=l):l=t[5];let u;t[6]===a?u=t[7]:(u=a({id:`hz076O`}),t[6]=a,t[7]=u);let d;t[8]===u?d=t[9]:(d=(0,b.jsx)(f,{readOnly:!0,value:x,"aria-label":u,className:`font-mono text-xs`,"data-testid":`slides-install-command`,onFocus:A}),t[8]=u,t[9]=d);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,b.jsx)(p,{align:`inline-end`,children:(0,b.jsx)(g,{copyContent:x})}),t[10]=h):h=t[10];let _;t[11]===d?_=t[12]:(_=(0,b.jsxs)(m,{children:[d,h]}),t[11]=d,t[12]=_);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=T()?(0,b.jsxs)(o,{type:`button`,size:`sm`,variant:`outline`,"data-testid":`slides-run-install`,onClick:k,children:[(0,b.jsx)(c,{"aria-hidden":!0,className:`size-3.5`}),(0,b.jsx)(r,{id:`hVAkI8`})]}):null,t[13]=y):y=t[13];let C;t[14]===a?C=t[15]:(C=a({id:`NfraGd`}),t[14]=a,t[15]=C);let w,E;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,b.jsx)(r,{id:`1NgrlY`}),E=(0,b.jsx)(s,{"aria-hidden":!0,className:`size-3`}),t[16]=w,t[17]=E):(w=t[16],E=t[17]);let j;t[18]===C?j=t[19]:(j=(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[y,(0,b.jsxs)(`a`,{href:S,target:`_blank`,rel:`noopener noreferrer`,onClick:O,onAuxClick:D,"aria-label":C,className:`inline-flex items-center gap-0.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`slides-install-docs-link`,children:[w,E]})]}),t[18]=C,t[19]=j);let M;return t[20]!==j||t[21]!==_?(M=(0,b.jsxs)(`div`,{className:`space-y-3`,"data-testid":`slides-status-missing`,children:[l,_,j]}),t[20]=j,t[21]=_,t[22]=M):M=t[22],M}function D(e){return h(e,S)}function O(e){return h(e,S)}function k(){typeof window<`u`&&l(window.location.hash)&&window.history.back(),d(`install-slidev`)}function A(e){return e.currentTarget.select()}function j(){let e=(0,v.c)(3),t=w(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,b.jsx)(_,{titleId:`settings-plugin-slides-title`,title:`Slidev`,scope:`user`,beta:!0,docUrl:C,children:(0,b.jsx)(r,{id:`L3w0_C`,components:{0:(0,b.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}),e[0]=n):n=e[0];let i;return e[1]===t?i=e[2]:(i=(0,b.jsxs)(`section`,{"aria-labelledby":`settings-plugin-slides-title`,className:`space-y-4`,"data-testid":`settings-plugin-slides`,children:[n,(0,b.jsx)(`div`,{"aria-live":`polite`,children:(0,b.jsx)(E,{availability:t})})]}),e[1]=t,e[2]=i),i}export{j as SlidesPluginSection};
|