@inkeep/open-knowledge 0.48.0 → 0.48.2
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/{acp-harness-probe-ctlLmc6O.mjs → acp-harness-probe-CT_w386x.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-CjTU1pBu.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-D7RfHtp_.mjs → init-BqijV4oE.mjs} +3 -3
- package/dist/init-ZA4XaTeF.mjs +1 -0
- package/dist/{launch-json-removal-DphNv7be.mjs → launch-json-removal-CQeMmMgV.mjs} +2 -2
- package/dist/{loader-BtbydYPt.mjs → loader-DrVZy9sg.mjs} +2 -2
- package/dist/loader-gW1YeS2_.mjs +1 -0
- package/dist/{preview-CAWFRCJt.mjs → preview-D59JrWsR.mjs} +2 -2
- package/dist/preview-H5VpQ0aR.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-C3ip7dNC.js → ActivityModeContent-Ls6Ii2AR.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Wi29jCni.js → AgentDiffPane-CRYL--uE.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-FT8wNbjk.js → AgentThreadClientBinder-DkJCXESC.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-C0FXh0Oi.js → ChangedOutsideBadge-C7ib2CLj.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BQoCzCdy.js → CodeMirrorPropInput-TJBj2ROv.js} +1 -1
- package/dist/public/assets/{DocumentContext-CP7yqH5z.js → DocumentContext-x5CUxxhI.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-NV902SqC.js → EditorModeToggle-Bzur2AVh.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-B3txwN8d.js → EnableSyncConfirmDialog-Znrf_6pT.js} +1 -1
- package/dist/public/assets/FeedbackForm-DMTgXOQ0.js +1 -0
- package/dist/public/assets/{GraphPanel-z_BpNtFU.js → GraphPanel-WI6aG2BT.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-JqA7a0sU.js → ImportSkillDialog-DbA_I30Z.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-SRropTDk.js → LintConfigEditor-DtuTsRPs.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-B0bIS4IP.js → ManagedArtifactProperties-673wYJvM.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-CrJ02738.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-BiF_k0VW.js → McpConsentDialogBody-BP8KTHru.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DkkZ1470.js → MermaidDocEditor-CnjxdTzJ.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CtlgCQX3.js → ReportBugDialogBody-DcEMoxKz.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DOmoubBM.js → SchemaConfigEditor-DzyMGxmc.js} +1 -1
- package/dist/public/assets/{SessionsHost-CFGRv_pY.js → SessionsHost-31LO23Wl.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-D_1DunuR.js → SettingsDialogBody-DzlQ13IX.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-DYf_N6bq.js → ShareBranchSwitchDialog-DSnG7Vwo.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-ayJ6qYFK.js → ShareReceiveDialog-hp8-_wD0.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-OcYPcuBz.js → ShareReceiveMissDialog-Cw4ZtAVB.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DBJEqMg4.js → SkillEditBanner-CWVFuS5L.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-FJ-Hk1Uz.js → SkillOriginInline-C5BvTKcL.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DvoPtfHF.js → SkillToolbarControls-B137QbKv.js} +1 -1
- package/dist/public/assets/{SourceEditor-CeQc0tTS.js → SourceEditor-7UYreAPX.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DN4Eag17.js → TerminalPanel-Bb4mBhjy.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CPjZ5xvY.js → TerminalWindowApp-CVRgfXzw.js} +1 -1
- package/dist/public/assets/{TextDocEditor-gUC9Hdas.js → TextDocEditor-DRxNsWPL.js} +1 -1
- package/dist/public/assets/{ThreadView-CPLWVyZk.js → ThreadView-lR-GvL11.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CH9Paxeb.js → TimelineDiffPane-eky-61qS.js} +1 -1
- package/dist/public/assets/{agent-diff-store-c2pI-IqS.js → agent-diff-store-k2Na1UuM.js} +1 -1
- package/dist/public/assets/{agent-visibility-p6xMSDdk.js → agent-visibility-BdUDvgZz.js} +1 -1
- package/dist/public/assets/{auth-state-cache-khzbb5gf.js → auth-state-cache-DGUqbXC_.js} +1 -1
- package/dist/public/assets/{client-version-1hLDBtWZ.js → client-version-BK_KR7U_.js} +1 -1
- package/dist/public/assets/{comment-chips-GFaq2hJN.js → comment-chips-BPKPgIfD.js} +1 -1
- package/dist/public/assets/{config-context-JFJadbOg.js → config-context-BQkCAyV-.js} +1 -1
- package/dist/public/assets/{config-provider-GgI7K6tF.js → config-provider-BxPJaWVp.js} +1 -1
- package/dist/public/assets/{dist-D0lKV18u2.js → dist-B1W6XlK32.js} +1 -1
- package/dist/public/assets/{doc-paths-BuYvs-Sl.js → doc-paths-BPPZUgg6.js} +1 -1
- package/dist/public/assets/{documents-events-CZXYlWJs.js → documents-events-yek6VMZz.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-VPm5Cnie.js → file-tree-adapter-3ja1qlJs.js} +1 -1
- package/dist/public/assets/{file-tree-utils-DEJGOhLm.js → file-tree-utils-Bl84nllO.js} +1 -1
- package/dist/public/assets/{folder-config-api-CkzVN79U.js → folder-config-api-DsCcuh72.js} +1 -1
- package/dist/public/assets/{follow-file-Dlt39wWC.js → follow-file-DFcAxjow.js} +1 -1
- package/dist/public/assets/{globals-i3eL0jPG.js → globals-DTeKgG7r.js} +1 -1
- package/dist/public/assets/{index-CUE-YCY2.js → index-DoaRsdsH.js} +108 -108
- package/dist/public/assets/{lint-config-client-CKLyoxWn.js → lint-config-client-CbBNbz5z.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BJyF5XvC.js → markdownlint-rule-browser-bRkNLTrS.js} +1 -1
- package/dist/public/assets/{navigation-targets-kcw1-114.js → navigation-targets-BekPm3G2.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-CRB-rvl-.js → open-managed-artifact-tab-BIfn2FfR.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-yAE2j52e.js → pending-receive-nav-store-B9cFPfgA.js} +1 -1
- package/dist/public/assets/{prop-types-C-VFVfev.js → prop-types-Bhux6LAG.js} +1 -1
- package/dist/public/assets/{receive-store-C3RyDFMU.js → receive-store-B49FgHLW.js} +1 -1
- package/dist/public/assets/{selection-context-BN5sWQOX.js → selection-context-De7RWVbr.js} +1 -1
- package/dist/public/assets/{skill-actions-gJbOdqsR.js → skill-actions-BPyEVJTE.js} +1 -1
- package/dist/public/assets/{skill-scope-DwDLnOOD.js → skill-scope-VJV5Rx86.js} +1 -1
- package/dist/public/assets/{skills-api-BBaU5yMj.js → skills-api-BMRKwBUl.js} +1 -1
- package/dist/public/assets/{src-BFaead-K.js → src-Ch8D3fT_.js} +1 -1
- package/dist/public/assets/{tag-pill-input-T8jCzKA4.js → tag-pill-input-DtKTv6kf.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-ur7EfH9N.js → target-navigation-intent-NvDqDHJ2.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CIEJD8Ca.js → terminal-launch-events-cjIUscHc.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-D3CzWhx2.js → terminal-telemetry-BoiP_PBP.js} +1 -1
- package/dist/public/assets/typing-burst-detector-VZnl_iVo.js +8 -0
- package/dist/public/assets/{uninstall-Baseq7_l.js → uninstall-Da1ho4P8.js} +1 -1
- package/dist/public/assets/{use-activity-panel-jx8Sg0rQ.js → use-activity-panel-BcGb7XOc.js} +1 -1
- package/dist/public/assets/{use-collab-url-oYOwLAYB.js → use-collab-url-BKsQe4b1.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-DEdN-vX3.js → use-live-xterm-theme-CpBGZzBF.js} +1 -1
- package/dist/public/assets/{use-open-skill-BH3vfRE3.js → use-open-skill-BFI8qRZm.js} +1 -1
- package/dist/public/assets/use-settings-route-B15KAQLp.js +1 -0
- package/dist/public/assets/{use-skill-directory-DTKROB4o.js → use-skill-directory-B5pZTEfG.js} +1 -1
- package/dist/public/assets/{use-skill-origin-LsbeWa_R.js → use-skill-origin-CNiZj4lD.js} +1 -1
- package/dist/public/assets/{use-skills-CtCsB6PZ.js → use-skills-nDAfVSei.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BArDTeSK.js → use-terminal-enabled-DoIFtYZ1.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CdswgYxP.js → use-timeline-entry-diff-Cqn9J0oR.js} +1 -1
- package/dist/public/assets/{use-workspace-3mjuTrTC.js → use-workspace-DVmty0IU.js} +1 -1
- package/dist/public/index.html +44 -44
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-Bk6eqKiY.mjs → repair-launch-json-CK4ECoN2.mjs} +2 -2
- package/dist/{repair-mcp-configs-fC8b4vo_.mjs → repair-mcp-configs-B4k9Cb0d.mjs} +2 -2
- package/dist/{src-DRhXUMyd.mjs → src-BBF7yJHq.mjs} +2 -2
- package/dist/{start-DKwEh9gC.mjs → start-CCjGphea.mjs} +2 -2
- package/dist/start-b6dM2IGi.mjs +1 -0
- package/package.json +5 -5
- package/dist/constants-Bc6SmMHz.mjs +0 -2
- package/dist/init-BNMJDizk.mjs +0 -1
- package/dist/loader-C5LD3Ds_.mjs +0 -1
- package/dist/preview-CyyocNeQ.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DVcz7TWB.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-d28y4KXb.js +0 -1
- package/dist/public/assets/typing-burst-detector-CG82yzgN.js +0 -8
- package/dist/public/assets/use-settings-route-B1Atzr9C.js +0 -1
- package/dist/start-DCnM5DfI.mjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{L as n,Qn as r,hr as i,i as a}from"./DocumentContext-CP7yqH5z.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{s as u}from"./local-menu-action-bus-iy6v2osW.js";import{t as d}from"./utils-CPqDy6Hr.js";import{t as f}from"./use-workspace-3mjuTrTC.js";import{c as p,i as m,n as h,o as g,s as _,t as v}from"./ChangedOutsideBadge-C0FXh0Oi.js";import{t as y}from"./button-RQ5o7P7w.js";import{c as b,i as x,l as S,o as C,t as w}from"./dist-Bi80hc1t.js";import{i as T,n as E,t as D}from"./tooltip-x7BNUa3s.js";import{a as O,c as k,i as A,n as j,o as M,r as N,s as P,t as F}from"./dialog-DwFomKjP.js";import{_ as I,a as L,c as R,d as z,f as B,g as V,h as H,i as U,l as W,m as G,n as K,o as q,p as J,r as Y,s as X,t as ee,u as te}from"./dist-G89kioZo.js";import{a as ne,d as re,f as ie,i as ae,n as oe,o as se,p as ce,u as le}from"./dropdown-menu-DRytYgB4.js";import{t as ue}from"./label-BT2yjpKR.js";import{C as de,a as fe,f as pe,h as me,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe}from"./agent-visibility-p6xMSDdk.js";import{$t as Se,Ba as Ce,Cn as we,Ct as Te,Jt as Ee,Nt as De,Pt as Oe,Ra as ke,Sn as Ae,Ua as je,_n as Me,ai as Ne,gn as Pe,ha as Fe,hn as Ie,it as Le,kt as Re,mn as ze,nn as Be,rt as Ve,tn as He,wn as Ue,xn as We,xr as Ge,yn as Ke}from"./dist-D0lKV18u2.js";import{t as qe}from"./createLucideIcon-BbgVV4EV.js";import{t as Je}from"./RegisteredAgentIcon-CSZXCqwG.js";import{n as Ye,r as Xe}from"./ManagedArtifactProperties-B0bIS4IP.js";import{t as Ze}from"./check-DLRoQSSY.js";import{t as Qe}from"./chevron-right-BjiB8LDf.js";import{n as $e}from"./CopyButton-DfXJBl0I.js";import{t as et}from"./folder-open-ee990ToL.js";import{t as tt}from"./folder-DxrU2PLH.js";import{t as nt}from"./trash-2-Ccq_llrY.js";import{n as rt}from"./dist-DmEZHXvB.js";import{t as it}from"./input-CtKG6a5B.js";import{t as at}from"./dist-CpRBr-Ct.js";import{i as ot}from"./use-settings-route-B1Atzr9C.js";import{t as st}from"./parse-api-error-BFe1cdS7.js";import{J as ct,q as lt,x as ut}from"./navigation-targets-kcw1-114.js";import{c as dt,n as ft,o as pt}from"./documents-events-CZXYlWJs.js";import{a as mt,c as ht,f as gt,n as _t,r as vt}from"./skill-scope-DwDLnOOD.js";import{t as yt}from"./badge-CnYDYmI5.js";import{C as bt,O as xt,S as St,a as Ct,b as wt,j as Tt,k as Et,l as Dt,n as Ot,p as kt,r as At,t as jt,v as Mt,y as Nt}from"./skills-api-BBaU5yMj.js";import{n as Pt}from"./config-context-JFJadbOg.js";import{t as Ft}from"./use-skills-CtCsB6PZ.js";import{t as It}from"./use-open-skill-BH3vfRE3.js";import{n as Lt}from"./clipboard-adapter-DPkNOslT.js";import{t as Rt}from"./DiffView-Bc5gwnAV.js";var Z=e(o(),1),Q=t(),zt=`ContextMenu`,[Bt,Vt]=b(zt,[I]),Ht=I(),[Ut,Wt]=Bt(zt),Gt=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=Z.useState(!1),c=Ht(t),l=w(r),u=Z.useCallback(e=>{s(e),l(e)},[l]);return(0,Q.jsx)(Ut,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,Q.jsx)(B,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};Gt.displayName=zt;var Kt=`ContextMenuTrigger`,qt=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=Wt(Kt,n),o=Ht(n),s=Z.useRef({x:0,y:0}),c=Z.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=Z.useRef(0),u=Z.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return Z.useEffect(()=>u,[u]),Z.useEffect(()=>void(r&&u()),[r,u]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{...o,virtualRef:c}),(0,Q.jsx)(S.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:C(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:C(e.onPointerDown,Cn(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:C(e.onPointerMove,Cn(u)),onPointerCancel:r?e.onPointerCancel:C(e.onPointerCancel,Cn(u)),onPointerUp:r?e.onPointerUp:C(e.onPointerUp,Cn(u))})]})});qt.displayName=Kt;var Jt=`ContextMenuPortal`,Yt=e=>{let{__scopeContextMenu:t,...n}=e,r=Ht(t);return(0,Q.jsx)(W,{...r,...n})};Yt.displayName=Jt;var Xt=`ContextMenuContent`,Zt=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Wt(Xt,n),a=Ht(n),o=Z.useRef(!1);return(0,Q.jsx)(U,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Zt.displayName=Xt;var Qt=`ContextMenuGroup`,$t=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(L,{...i,...r,ref:t})});$t.displayName=Qt;var en=`ContextMenuLabel`,tn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(R,{...i,...r,ref:t})});tn.displayName=en;var nn=`ContextMenuItem`,rn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(q,{...i,...r,ref:t})});rn.displayName=nn;var an=`ContextMenuCheckboxItem`,on=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(Y,{...i,...r,ref:t})});on.displayName=an;var sn=`ContextMenuRadioGroup`,cn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(te,{...i,...r,ref:t})});cn.displayName=sn;var ln=`ContextMenuRadioItem`,un=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(z,{...i,...r,ref:t})});un.displayName=ln;var dn=`ContextMenuItemIndicator`,fn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(X,{...i,...r,ref:t})});fn.displayName=dn;var pn=`ContextMenuSeparator`,mn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(J,{...i,...r,ref:t})});mn.displayName=pn;var hn=`ContextMenuArrow`,gn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(K,{...i,...r,ref:t})});gn.displayName=hn;var _n=`ContextMenuSub`,vn=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Ht(t),[s,c]=x({prop:i,defaultProp:a??!1,onChange:r,caller:_n});return(0,Q.jsx)(G,{...o,open:s,onOpenChange:c,children:n})};vn.displayName=_n;var yn=`ContextMenuSubTrigger`,bn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(V,{...i,...r,ref:t})});bn.displayName=yn;var xn=`ContextMenuSubContent`,Sn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(H,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Sn.displayName=xn;function Cn(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var wn=Gt,Tn=qt,En=Yt,Dn=Zt,On=$t,kn=tn,An=rn,jn=on,Mn=fn,Nn=mn,Pn=vn,Fn=bn,In=Sn,Ln=qe(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),Rn=qe(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),zn=qe(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Bn=qe(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Vn=qe(`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`}]]),$=l();function Hn(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Un(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=st(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Wn(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Hn(e):Un()}var Gn=`ok:skill:cowork:installed`,Kn=`1`,qn=250,Jn=`/api/skill/install-state`;function Yn(e){return`${Gn}:v${e}`}var Xn=new Map;async function Zn(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Xn.get(n);if(r)return r;let i=Qn(e,t);return Xn.set(n,i),i.finally(()=>{Xn.get(n)===i&&Xn.delete(n)}),i}async function Qn(e,t){let n=e.installer===void 0?Wn():e.installer,r=$n(e.storage),i=e.fetchSnapshot??tr,a=e.serverTimeoutMs??qn,o=null;if(!t.force){try{o=await nr(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Yn(o?.currentVersion??e.fallbackSkillVersion??er());if(!t.force&&r?.getItem(s)===Kn)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Kn)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function $n(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function er(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function tr(){let e;try{e=await fetch(Jn,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function nr(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function rr(e){return Zn({},e)}function ir(){return Zn({},{force:!0})}async function ar(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function or(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return ar({target:`claude-cowork`,url:Se({mode:`cowork`},e)},n);case`claude-code`:return ar({target:`claude-code`,url:Se({mode:`code`},e)},n);case`codex`:return ar({target:`codex`,url:He(e)},n);case`cursor`:return ar({target:`cursor`,url:Be(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function sr(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function cr(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var lr=/\.(md|mdx)$/i;function ur(e){return lr.test(e)?e:`${e}.md`}var dr=`open-knowledge:agent-thread-launch`;function fr(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(dr,{detail:e}))}function pr(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(dr,n),()=>t.removeEventListener(dr,n)}function mr(e){if(!e.docName||!e.workspace)return null;let t=ur(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:cr(n,t,r)}}function hr(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function gr(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function _r(e){return ve(e.installUrl).then(()=>void 0)}function vr(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function yr(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function br(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??ur(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:cr(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function xr(e){return`Opened in ${e}.`}function Sr(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function Cr(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function wr(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function Tr(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function Er(e,t,n,r){return e.compose?Ee(Tr(e.compose,t,n,r)):e.selection?We({...e.selection,target:t,transport:r}):e.skill?Ae(e.skill.name,e.skill.scope,n):e.ask?ze(e.ask.relativePath,e.ask.instruction,n,t,r):Ne(e.docContext===null?e.folderRelativePath?Ke(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?Pe(n,e.instruction,r):Ie(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):Me(e.docContext.relativePath,n,e.instruction,r))}function Dr(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${Ve} ${Er(e,De[t].handoffTarget,!1,`terminal`)}`:we(e.docContext?.relativePath??null)}function Or(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${Le} ${Er(e,`claude-code`,!1,`terminal`)}`:Ue(e.docContext?.relativePath??null)}function kr(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function Ar(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function jr(e,t){fr({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:Or(e),docName:kr(e),titleHint:Ar(e)})}async function Mr(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:Er(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=wr(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(xr(u));else{let i=Cr(r),a=Sr(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Mr(e,t,n,r+1)}}})}return a}function Nr(e){return he.find(t=>t.id===e)?.displayName??e}function Pr(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Fr(){return{dispatchHandoff:or,recordHandoff:sr,toast:{success:e=>{rt.success(e)},error:(e,t)=>{rt.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Pr(),getDisplayName:Nr,ensureCoworkSkillInstalled:rr,autoOpen:!0}}function Ir(){let e=(0,$.c)(2),{merged:t}=Pt(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Mr(e,t,{...Fr(),autoOpen:n}),reinstallCoworkSkill:ir},e[0]=n,e[1]=r),r}function Lr(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(wn,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function Rr(e){let t=(0,$.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=d(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Tn,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zr(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(On,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function Br(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Pn,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function Vr(e){let t=(0,$.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=d(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(En,{children:(0,Q.jsx)(Dn,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Hr(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=d(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Q.jsx)(An,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Ur(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=d(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(Qe,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Q.jsxs)(Fn,{"data-slot":`context-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Wr(e){let t=(0,$.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=d(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(In,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Gr(e){let t=(0,$.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=d(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Q.jsx)(Mn,{children:(0,Q.jsx)(Ze,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Q.jsxs)(jn,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function Kr(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=d(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Q.jsx)(kn,{"data-slot":`context-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function qr(e){let t=(0,$.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=d(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Nn,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Jr(e){let t=(0,$.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,Q.jsx)(zr,{...r}):(0,Q.jsx)(ae,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Yr(e){let t=(0,$.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,Q.jsx)(Hr,{...r}):(0,Q.jsx)(ne,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Xr(e){let t=(0,$.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,Q.jsx)(Gr,{...r}):(0,Q.jsx)(oe,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Zr(e){let t=(0,$.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,Q.jsx)(Kr,{...r}):(0,Q.jsx)(se,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Qr(e){let t=(0,$.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,Q.jsx)(qr,{...r}):(0,Q.jsx)(le,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function $r(e){let t=(0,$.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,Q.jsx)(Br,{...r}):(0,Q.jsx)(re,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ei(e){let t=(0,$.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,Q.jsx)(Wr,{...r}):(0,Q.jsx)(ie,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ti(e){let t=(0,$.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,Q.jsx)(Ur,{...r}):(0,Q.jsx)(ce,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var ni=Object.freeze({hosts:null,source:null}),ri=new Map,ii=new Map;function ai(e,t){return`${e}:${t}`}function oi(e){return ri.get(e)??ni}function si(e,t){let n=ii.get(e)??new Set;return ii.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&ii.delete(e)}}function ci(e,t){let n=oi(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?ri.delete(e):ri.set(e,r);for(let t of ii.get(e)??[])t()}}var li=Re.options,ui=`min-w-[24rem]`;function di(e,t){let n=(0,$.c)(45),r=t.installingName===e.name,i=(0,Z.useRef)(e),[a,o]=(0,Z.useState)(!1),s=(0,Z.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,Z.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,Z.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=ai(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>si(m,e),g=()=>oi(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,Z.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&ci(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,Z.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,Z.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,Z.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]!==m||n[26]!==j?(M=()=>{let e=oi(m).hosts;e&&[...e].sort().join(`,`)===j&&ci(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,Z.useEffect)(M,N);let P=(0,Z.useRef)(null),F=(0,Z.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,Z.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,ci(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(Ge));if(!r.ok){ci(m,{hosts:null});return}D.current=[...r.hosts],ci(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,B;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(B={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=D.current.filter(mi),n=e.installableEditors??li,r=li.filter(e=>n.includes(e)||D.current.includes(e));z([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>Nt({scope:e.scope,name:e.name,dir:n,mode:r})).then(pi)},unplaceAt(n){t.runLocationWrite(e,()=>Et({scope:e.scope,name:e.name,path:n})).then(fi)},setSource(n){ci(m,{source:n}),t.runLocationWrite(e,()=>xt({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(ci(m,{source:null}),rt.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=B):B=n[44],B}function fi(e){e.ok||rt.error(e.error)}function pi(e){e.ok||rt.error(e.error)}function mi(e){return!li.includes(e)}function hi(e){let t=(0,$.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(T,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(E,{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,Q.jsxs)(D,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function gi(e){let t=(0,$.c)(165),{toggles:n,skill:r,onResolveFork:i,onRunStart:a,menuKind:o}=e,l=o===void 0?`dropdown`:o,{_:u}=c(),{hostSet:d,toggleEditor:f,installAll:p}=n,m;t[0]===r?m=t[1]:(m=e=>r?`${ht(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=m);let g=m,_=Ft(),b;t[2]!==_.data||t[3]!==_.status||t[4]!==r?(b=r!==void 0&&((r.hosts??[]).includes(`agents`)||_.status===`ready`&&_.data.some(Oi)),t[2]=_.data,t[3]=_.status,t[4]=r,t[5]=b):b=t[5];let x=b,S;t[6]!==_.data||t[7]!==_.status||t[8]!==r?(S=r?.hostAliases??(r&&_.status===`ready`?Object.assign({},..._.data.filter(e=>e.scope===r.scope).map(Di)):{}),t[6]=_.data,t[7]=_.status,t[8]=r,t[9]=S):S=t[9];let C=S,w;t[10]!==_.data||t[11]!==_.status||t[12]!==r?(w=r?.installableEditors??(r&&_.status===`ready`?_.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=_.data,t[11]=_.status,t[12]=r,t[13]=w):w=t[13];let T=w,E,D,O,k,A,j,M;if(t[14]!==u||t[15]!==C||t[16]!==_.data||t[17]!==_.status||t[18]!==d||t[19]!==x||t[20]!==p||t[21]!==T||t[22]!==l||t[23]!==i||t[24]!==a||t[25]!==g||t[26]!==r||t[27]!==f||t[28]!==n){let e=T?new Set(T):null,o;t[36]===C?o=t[37]:(o=e=>!(e in C),t[36]=C,t[37]=o);let c=(x?[`agents`,...li]:li).filter(o).filter(t=>t===`agents`||e===null||e.has(t)||d.has(t)),m;t[38]===g?m=t[39]:(m=e=>g(e),t[38]=g,t[39]=m);let b=new Set(c.map(m)),S=r?.scope===`global`?`~/`:``,w;t[40]!==S||t[41]!==r?(w=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[40]=S,t[41]=r,t[42]=w):w=t[42];let N=w,P=N!==null&&!b.has(N)?N:null,F=P===null?n.sourceHost??r?.hosts?.[0]:void 0,I;t[43]===C?I=t[44]:(I=e=>_t(C,e),t[43]=C,t[44]=I);let L=I,R=Ei,z;t[45]!==u||t[46]!==L?(z=e=>{let t=L(e);return t.length===0?!0:window.confirm(u({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},t[45]=u,t[46]=L,t[47]=z):z=t[47];let B=z,V;t[48]!==u||t[49]!==r?(V=(e,t)=>{let n=e.includes(`/`)?e:ht(e,r?.scope??`project`);return(0,Q.jsx)(hi,{hint:u({id:`0dslv8`,values:{0:R(e),1:R(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":u({id:`G6Lrs_`,values:{0:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(u({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&wt({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?pt():rt.error(u({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(h,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[48]=u,t[49]=r,t[50]=V):V=t[50];let H=V,U;t[51]===r?.conflictHosts?U=t[52]:(U=r?.conflictHosts??[],t[51]=r?.conflictHosts,t[52]=U);let W;t[53]===U?W=t[54]:(W=new Set(U),t[53]=U,t[54]=W);let G=W,K;t[55]===r?.driftPaths?K=t[56]:(K=r?.driftPaths??[],t[55]=r?.driftPaths,t[56]=K);let q;t[57]===K?q=t[58]:(q=new Set(K),t[57]=K,t[58]=q);let J=q;E=n.installing;let Y=Ti,X;t[59]===r?.symlinkedHosts?X=t[60]:(X=r?.symlinkedHosts??[],t[59]=r?.symlinkedHosts,t[60]=X);let ee;t[61]===X?ee=t[62]:(ee=new Set(X),t[61]=X,t[62]=ee);let te=ee,ne=[...[...d].filter(e=>e!==F&&!(e in C)&&!G.has(e)&&!e.includes(`/`)).map(e=>te.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(wi)],re=ne.filter(Ci).length;O=ne.length===0?n.linkMode?`link`:`copy`:re*2>=ne.length?`link`:`copy`;let ie;t[63]!==C||t[64]!==G||t[65]!==d||t[66]!==te||t[67]!==g||t[68]!==F?(ie=[...d].filter(e=>e!==F&&!(e in C)&&!G.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:g(e)??R(e),mode:te.has(e)?`link`:`copy`})),t[63]=C,t[64]=G,t[65]=d,t[66]=te,t[67]=g,t[68]=F,t[69]=ie):ie=t[69];let ae;t[70]===r?.customPlacements?ae=t[71]:(ae=r?.customPlacements??[],t[70]=r?.customPlacements,t[71]=ae);let oe;if(t[72]!==S||t[73]!==ie||t[74]!==ae){let e;t[76]===S?e=t[77]:(e=e=>({target:vt(e),display:`${S}${e.path}`,mode:e.mode}),t[76]=S,t[77]=e),oe=[...ie,...ae.map(e)],t[72]=S,t[73]=ie,t[74]=ae,t[75]=oe}else oe=t[75];D=oe;let se;t[78]!==u||t[79]!==a||t[80]!==n?(se=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(hi,{hint:u(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(y,{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(u(i===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(a?.(),n.convertLocation?.(e,i))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Q.jsx)(s,{id:`uUCrBv`}):(0,Q.jsx)(s,{id:`iaPtht`})})})},t[78]=u,t[79]=a,t[80]=n,t[81]=se):se=t[81];let ce=se,le;t[82]===r?.customPlacements?le=t[83]:(le=r?.customPlacements??[],t[82]=r?.customPlacements,t[83]=le);let ue=new Map(le.map(Si)),de=new Set(ue.keys());if(_.status===`ready`&&r){for(let e of _.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=vt(t);e!==``&&de.add(e)}}let fe=r===void 0?[]:[...de].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:ue.get(e)??null})).filter(e=>!b.has(e.display)&&e.display!==N&&!(e.root in C)),pe;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(s,{id:`npcziF`}),t[84]=pe):pe=t[84];let me;t[85]===u?me=t[86]:(me=u({id:`6f_UX4`}),t[85]=u,t[86]=me);let he;t[87]===p?he=t[88]:(he=()=>p(),t[87]=p,t[88]=he);let ge;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Q.jsx)(s,{id:`N40H-G`}),t[89]=ge):ge=t[89];let _e;t[90]!==E||t[91]!==he?(_e=(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:E,onClick:he,"data-testid":`skill-install-all`,children:ge}),t[90]=E,t[91]=he,t[92]=_e):_e=t[92];let ve;t[93]!==me||t[94]!==_e?(ve=(0,Q.jsx)(hi,{hint:me,children:_e}),t[93]=me,t[94]=_e,t[95]=ve):ve=t[95],t[96]!==l||t[97]!==ve?(k=(0,Q.jsxs)(Zr,{menuKind:l,className:`flex items-center justify-between gap-2`,children:[pe,ve]}),t[96]=l,t[97]=ve,t[98]=k):k=t[98],t[99]!==u||t[100]!==H||t[101]!==E||t[102]!==l||t[103]!==P||t[104]!==L?(A=P===null?null:(0,Q.jsx)(hi,{hint:u({id:`pXB6SL`}),children:(0,Q.jsxs)(Xr,{menuKind:l,disabled:E,checked:!0,onSelect:xi,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(tt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:P}),(()=>{let e=Y(P).split(`/`).slice(0,-1).join(`/`),t=L(e);return t.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>H(t,e))}):null})(),(0,Q.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,Q.jsx)(s,{id:`tiFPjk`})})]})]})}),t[99]=u,t[100]=H,t[101]=E,t[102]=l,t[103]=P,t[104]=L,t[105]=A):A=t[105];let ye;t[106]!==u||t[107]!==H||t[108]!==E||t[109]!==B||t[110]!==G||t[111]!==ce||t[112]!==J||t[113]!==O||t[114]!==d||t[115]!==te||t[116]!==l||t[117]!==i||t[118]!==g||t[119]!==r?.hosts||t[120]!==F||t[121]!==L||t[122]!==f||t[123]!==n?(ye=e=>{let t=g(e),a=e===`agents`?`.agents`:Fe[e],o=Y(t).split(`/`).slice(0,-1).join(`/`),c=L(o);return(0,Q.jsx)(hi,{hint:G.has(e)?u({id:`8HvJlU`,values:{0:t??a}}):e===F?t?u({id:`ssk6rl`,values:{path:t}}):a:d.has(e)?u(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):u(t?O===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(Xr,{menuKind:l,disabled:E,checked:d.has(e),onCheckedChange:t=>{G.has(e)||t===!0&&!B(o)||f(e,t===!0)},onSelect:bi,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(h,{host:e,"aria-hidden":!0,className:`size-4`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:t??a}),c.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:c.map(e=>H(e,o))}):null,G.has(e)?(0,Q.jsx)(hi,{hint:u({id:`_O7dJS`}),children:(0,Q.jsx)(y,{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:t=>{t.preventDefault(),i?.(e)},"data-testid":`skill-fork-chip-${e}`,children:(0,Q.jsx)(s,{id:`jng7Ko`})})}):e===F?(0,Q.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,Q.jsx)(s,{id:`tiFPjk`})}):d.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!E&&(te.has(e)?`link`:`copy`)!==O?ce(e,t??a,te.has(e)?`link`:`copy`):null,(0,Q.jsx)(hi,{hint:u({id:`nBgzKO`}),children:(0,Q.jsx)(y,{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)},"data-testid":`skill-set-source-${e}`,children:(0,Q.jsx)(s,{id:`VNNRfN`})})})]}):null,!E&&J.has(Y(t))?(0,Q.jsx)(hi,{hint:u({id:`iz1LdD`}),children:(0,Q.jsx)(v,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[106]=u,t[107]=H,t[108]=E,t[109]=B,t[110]=G,t[111]=ce,t[112]=J,t[113]=O,t[114]=d,t[115]=te,t[116]=l,t[117]=i,t[118]=g,t[119]=r?.hosts,t[120]=F,t[121]=L,t[122]=f,t[123]=n,t[124]=ye):ye=t[124],j=c.map(ye);let be;t[125]!==u||t[126]!==H||t[127]!==E||t[128]!==B||t[129]!==ce||t[130]!==J||t[131]!==O||t[132]!==l||t[133]!==L||t[134]!==n?(be=e=>(0,Q.jsx)(hi,{hint:e.placed===null?u(O===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):u({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(Xr,{menuKind:l,disabled:E,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!B(e.root))return;n.placeAt(e.root,O)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:yi,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(h,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(tt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),L(e.root).length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:L(e.root).map(t=>H(t,e.root))}):null,!E&&e.placed!==null&&J.has(e.placed.path)?(0,Q.jsx)(hi,{hint:u({id:`iz1LdD`}),children:(0,Q.jsx)(v,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!E&&e.placed.mode!==O?ce(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(hi,{hint:u({id:`nBgzKO`}),children:(0,Q.jsx)(y,{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,Q.jsx)(s,{id:`VNNRfN`})})})]})]})]})},e.root),t[125]=u,t[126]=H,t[127]=E,t[128]=B,t[129]=ce,t[130]=J,t[131]=O,t[132]=l,t[133]=L,t[134]=n,t[135]=be):be=t[135],M=fe.map(be),t[14]=u,t[15]=C,t[16]=_.data,t[17]=_.status,t[18]=d,t[19]=x,t[20]=p,t[21]=T,t[22]=l,t[23]=i,t[24]=a,t[25]=g,t[26]=r,t[27]=f,t[28]=n,t[29]=E,t[30]=D,t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M}else E=t[29],D=t[30],O=t[31],k=t[32],A=t[33],j=t[34],M=t[35];let N;t[136]!==u||t[137]!==E||t[138]!==D||t[139]!==O||t[140]!==a||t[141]!==n?(N=D.length>0&&n.convertLocations?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Q.jsx)(y,{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=O===`link`?`copy`:`link`,r=D.filter(e=>e.mode!==t);if(r.length===0)return;let i=u(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),o=u(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),s=r.map(vi).join(`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{L as n,Qn as r,hr as i,i as a}from"./DocumentContext-x5CUxxhI.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{s as u}from"./local-menu-action-bus-iy6v2osW.js";import{t as d}from"./utils-CPqDy6Hr.js";import{t as f}from"./use-workspace-DVmty0IU.js";import{c as p,i as m,n as h,o as g,s as _,t as v}from"./ChangedOutsideBadge-C7ib2CLj.js";import{t as y}from"./button-RQ5o7P7w.js";import{c as b,i as x,l as S,o as C,t as w}from"./dist-Bi80hc1t.js";import{i as T,n as E,t as D}from"./tooltip-x7BNUa3s.js";import{a as O,c as k,i as A,n as j,o as M,r as N,s as P,t as F}from"./dialog-DwFomKjP.js";import{_ as I,a as L,c as R,d as z,f as B,g as V,h as H,i as U,l as W,m as G,n as K,o as q,p as J,r as Y,s as X,t as ee,u as te}from"./dist-G89kioZo.js";import{a as ne,d as re,f as ie,i as ae,n as oe,o as se,p as ce,u as le}from"./dropdown-menu-DRytYgB4.js";import{t as ue}from"./label-BT2yjpKR.js";import{C as de,a as fe,f as pe,h as me,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe}from"./agent-visibility-BdUDvgZz.js";import{$t as Se,Ba as Ce,Cn as we,Ct as Te,Jt as Ee,Nt as De,Pt as Oe,Ra as ke,Sn as Ae,Ua as je,_n as Me,ai as Ne,gn as Pe,ha as Fe,hn as Ie,it as Le,kt as Re,mn as ze,nn as Be,rt as Ve,tn as He,wn as Ue,xn as We,xr as Ge,yn as Ke}from"./dist-B1W6XlK32.js";import{t as qe}from"./createLucideIcon-BbgVV4EV.js";import{t as Je}from"./RegisteredAgentIcon-CSZXCqwG.js";import{n as Ye,r as Xe}from"./ManagedArtifactProperties-673wYJvM.js";import{t as Ze}from"./check-DLRoQSSY.js";import{t as Qe}from"./chevron-right-BjiB8LDf.js";import{n as $e}from"./CopyButton-DfXJBl0I.js";import{t as et}from"./folder-open-ee990ToL.js";import{t as tt}from"./folder-DxrU2PLH.js";import{t as nt}from"./trash-2-Ccq_llrY.js";import{n as rt}from"./dist-DmEZHXvB.js";import{t as it}from"./input-CtKG6a5B.js";import{t as at}from"./dist-CpRBr-Ct.js";import{i as ot}from"./use-settings-route-B15KAQLp.js";import{t as st}from"./parse-api-error-BFe1cdS7.js";import{J as ct,q as lt,x as ut}from"./navigation-targets-BekPm3G2.js";import{c as dt,n as ft,o as pt}from"./documents-events-yek6VMZz.js";import{a as mt,c as ht,f as gt,n as _t,r as vt}from"./skill-scope-VJV5Rx86.js";import{t as yt}from"./badge-CnYDYmI5.js";import{C as bt,O as xt,S as St,a as Ct,b as wt,j as Tt,k as Et,l as Dt,n as Ot,p as kt,r as At,t as jt,v as Mt,y as Nt}from"./skills-api-BMRKwBUl.js";import{n as Pt}from"./config-context-BQkCAyV-.js";import{t as Ft}from"./use-skills-nDAfVSei.js";import{t as It}from"./use-open-skill-BFI8qRZm.js";import{n as Lt}from"./clipboard-adapter-DPkNOslT.js";import{t as Rt}from"./DiffView-Bc5gwnAV.js";var Z=e(o(),1),Q=t(),zt=`ContextMenu`,[Bt,Vt]=b(zt,[I]),Ht=I(),[Ut,Wt]=Bt(zt),Gt=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=Z.useState(!1),c=Ht(t),l=w(r),u=Z.useCallback(e=>{s(e),l(e)},[l]);return(0,Q.jsx)(Ut,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,Q.jsx)(B,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};Gt.displayName=zt;var Kt=`ContextMenuTrigger`,qt=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=Wt(Kt,n),o=Ht(n),s=Z.useRef({x:0,y:0}),c=Z.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=Z.useRef(0),u=Z.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return Z.useEffect(()=>u,[u]),Z.useEffect(()=>void(r&&u()),[r,u]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{...o,virtualRef:c}),(0,Q.jsx)(S.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:C(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:C(e.onPointerDown,Cn(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:C(e.onPointerMove,Cn(u)),onPointerCancel:r?e.onPointerCancel:C(e.onPointerCancel,Cn(u)),onPointerUp:r?e.onPointerUp:C(e.onPointerUp,Cn(u))})]})});qt.displayName=Kt;var Jt=`ContextMenuPortal`,Yt=e=>{let{__scopeContextMenu:t,...n}=e,r=Ht(t);return(0,Q.jsx)(W,{...r,...n})};Yt.displayName=Jt;var Xt=`ContextMenuContent`,Zt=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Wt(Xt,n),a=Ht(n),o=Z.useRef(!1);return(0,Q.jsx)(U,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Zt.displayName=Xt;var Qt=`ContextMenuGroup`,$t=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(L,{...i,...r,ref:t})});$t.displayName=Qt;var en=`ContextMenuLabel`,tn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(R,{...i,...r,ref:t})});tn.displayName=en;var nn=`ContextMenuItem`,rn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(q,{...i,...r,ref:t})});rn.displayName=nn;var an=`ContextMenuCheckboxItem`,on=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(Y,{...i,...r,ref:t})});on.displayName=an;var sn=`ContextMenuRadioGroup`,cn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(te,{...i,...r,ref:t})});cn.displayName=sn;var ln=`ContextMenuRadioItem`,un=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(z,{...i,...r,ref:t})});un.displayName=ln;var dn=`ContextMenuItemIndicator`,fn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(X,{...i,...r,ref:t})});fn.displayName=dn;var pn=`ContextMenuSeparator`,mn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(J,{...i,...r,ref:t})});mn.displayName=pn;var hn=`ContextMenuArrow`,gn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(K,{...i,...r,ref:t})});gn.displayName=hn;var _n=`ContextMenuSub`,vn=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Ht(t),[s,c]=x({prop:i,defaultProp:a??!1,onChange:r,caller:_n});return(0,Q.jsx)(G,{...o,open:s,onOpenChange:c,children:n})};vn.displayName=_n;var yn=`ContextMenuSubTrigger`,bn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(V,{...i,...r,ref:t})});bn.displayName=yn;var xn=`ContextMenuSubContent`,Sn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ht(n);return(0,Q.jsx)(H,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Sn.displayName=xn;function Cn(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var wn=Gt,Tn=qt,En=Yt,Dn=Zt,On=$t,kn=tn,An=rn,jn=on,Mn=fn,Nn=mn,Pn=vn,Fn=bn,In=Sn,Ln=qe(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),Rn=qe(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),zn=qe(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Bn=qe(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Vn=qe(`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`}]]),$=l();function Hn(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Un(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=st(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Wn(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Hn(e):Un()}var Gn=`ok:skill:cowork:installed`,Kn=`1`,qn=250,Jn=`/api/skill/install-state`;function Yn(e){return`${Gn}:v${e}`}var Xn=new Map;async function Zn(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Xn.get(n);if(r)return r;let i=Qn(e,t);return Xn.set(n,i),i.finally(()=>{Xn.get(n)===i&&Xn.delete(n)}),i}async function Qn(e,t){let n=e.installer===void 0?Wn():e.installer,r=$n(e.storage),i=e.fetchSnapshot??tr,a=e.serverTimeoutMs??qn,o=null;if(!t.force){try{o=await nr(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Yn(o?.currentVersion??e.fallbackSkillVersion??er());if(!t.force&&r?.getItem(s)===Kn)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Kn)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function $n(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function er(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function tr(){let e;try{e=await fetch(Jn,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function nr(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function rr(e){return Zn({},e)}function ir(){return Zn({},{force:!0})}async function ar(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function or(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return ar({target:`claude-cowork`,url:Se({mode:`cowork`},e)},n);case`claude-code`:return ar({target:`claude-code`,url:Se({mode:`code`},e)},n);case`codex`:return ar({target:`codex`,url:He(e)},n);case`cursor`:return ar({target:`cursor`,url:Be(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function sr(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function cr(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var lr=/\.(md|mdx)$/i;function ur(e){return lr.test(e)?e:`${e}.md`}var dr=`open-knowledge:agent-thread-launch`;function fr(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(dr,{detail:e}))}function pr(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(dr,n),()=>t.removeEventListener(dr,n)}function mr(e){if(!e.docName||!e.workspace)return null;let t=ur(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:cr(n,t,r)}}function hr(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function gr(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function _r(e){return ve(e.installUrl).then(()=>void 0)}function vr(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function yr(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function br(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??ur(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:cr(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function xr(e){return`Opened in ${e}.`}function Sr(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function Cr(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function wr(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function Tr(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function Er(e,t,n,r){return e.compose?Ee(Tr(e.compose,t,n,r)):e.selection?We({...e.selection,target:t,transport:r}):e.skill?Ae(e.skill.name,e.skill.scope,n):e.ask?ze(e.ask.relativePath,e.ask.instruction,n,t,r):Ne(e.docContext===null?e.folderRelativePath?Ke(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?Pe(n,e.instruction,r):Ie(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):Me(e.docContext.relativePath,n,e.instruction,r))}function Dr(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${Ve} ${Er(e,De[t].handoffTarget,!1,`terminal`)}`:we(e.docContext?.relativePath??null)}function Or(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${Le} ${Er(e,`claude-code`,!1,`terminal`)}`:Ue(e.docContext?.relativePath??null)}function kr(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function Ar(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function jr(e,t){fr({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:Or(e),docName:kr(e),titleHint:Ar(e)})}async function Mr(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:Er(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=wr(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(xr(u));else{let i=Cr(r),a=Sr(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Mr(e,t,n,r+1)}}})}return a}function Nr(e){return he.find(t=>t.id===e)?.displayName??e}function Pr(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Fr(){return{dispatchHandoff:or,recordHandoff:sr,toast:{success:e=>{rt.success(e)},error:(e,t)=>{rt.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Pr(),getDisplayName:Nr,ensureCoworkSkillInstalled:rr,autoOpen:!0}}function Ir(){let e=(0,$.c)(2),{merged:t}=Pt(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Mr(e,t,{...Fr(),autoOpen:n}),reinstallCoworkSkill:ir},e[0]=n,e[1]=r),r}function Lr(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(wn,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function Rr(e){let t=(0,$.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=d(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Tn,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zr(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(On,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function Br(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Pn,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function Vr(e){let t=(0,$.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=d(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(En,{children:(0,Q.jsx)(Dn,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Hr(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=d(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Q.jsx)(An,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Ur(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=d(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(Qe,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Q.jsxs)(Fn,{"data-slot":`context-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Wr(e){let t=(0,$.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=d(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(In,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Gr(e){let t=(0,$.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=d(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Q.jsx)(Mn,{children:(0,Q.jsx)(Ze,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Q.jsxs)(jn,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function Kr(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=d(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Q.jsx)(kn,{"data-slot":`context-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function qr(e){let t=(0,$.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=d(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Nn,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Jr(e){let t=(0,$.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,Q.jsx)(zr,{...r}):(0,Q.jsx)(ae,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Yr(e){let t=(0,$.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,Q.jsx)(Hr,{...r}):(0,Q.jsx)(ne,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Xr(e){let t=(0,$.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,Q.jsx)(Gr,{...r}):(0,Q.jsx)(oe,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Zr(e){let t=(0,$.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,Q.jsx)(Kr,{...r}):(0,Q.jsx)(se,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Qr(e){let t=(0,$.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,Q.jsx)(qr,{...r}):(0,Q.jsx)(le,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function $r(e){let t=(0,$.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,Q.jsx)(Br,{...r}):(0,Q.jsx)(re,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ei(e){let t=(0,$.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,Q.jsx)(Wr,{...r}):(0,Q.jsx)(ie,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ti(e){let t=(0,$.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,Q.jsx)(Ur,{...r}):(0,Q.jsx)(ce,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var ni=Object.freeze({hosts:null,source:null}),ri=new Map,ii=new Map;function ai(e,t){return`${e}:${t}`}function oi(e){return ri.get(e)??ni}function si(e,t){let n=ii.get(e)??new Set;return ii.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&ii.delete(e)}}function ci(e,t){let n=oi(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?ri.delete(e):ri.set(e,r);for(let t of ii.get(e)??[])t()}}var li=Re.options,ui=`min-w-[24rem]`;function di(e,t){let n=(0,$.c)(45),r=t.installingName===e.name,i=(0,Z.useRef)(e),[a,o]=(0,Z.useState)(!1),s=(0,Z.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,Z.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,Z.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=ai(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>si(m,e),g=()=>oi(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,Z.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&ci(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,Z.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,Z.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,Z.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]!==m||n[26]!==j?(M=()=>{let e=oi(m).hosts;e&&[...e].sort().join(`,`)===j&&ci(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,Z.useEffect)(M,N);let P=(0,Z.useRef)(null),F=(0,Z.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,Z.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,ci(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(Ge));if(!r.ok){ci(m,{hosts:null});return}D.current=[...r.hosts],ci(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,B;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(B={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=D.current.filter(mi),n=e.installableEditors??li,r=li.filter(e=>n.includes(e)||D.current.includes(e));z([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>Nt({scope:e.scope,name:e.name,dir:n,mode:r})).then(pi)},unplaceAt(n){t.runLocationWrite(e,()=>Et({scope:e.scope,name:e.name,path:n})).then(fi)},setSource(n){ci(m,{source:n}),t.runLocationWrite(e,()=>xt({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(ci(m,{source:null}),rt.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=B):B=n[44],B}function fi(e){e.ok||rt.error(e.error)}function pi(e){e.ok||rt.error(e.error)}function mi(e){return!li.includes(e)}function hi(e){let t=(0,$.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(T,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(E,{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,Q.jsxs)(D,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function gi(e){let t=(0,$.c)(165),{toggles:n,skill:r,onResolveFork:i,onRunStart:a,menuKind:o}=e,l=o===void 0?`dropdown`:o,{_:u}=c(),{hostSet:d,toggleEditor:f,installAll:p}=n,m;t[0]===r?m=t[1]:(m=e=>r?`${ht(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=m);let g=m,_=Ft(),b;t[2]!==_.data||t[3]!==_.status||t[4]!==r?(b=r!==void 0&&((r.hosts??[]).includes(`agents`)||_.status===`ready`&&_.data.some(Oi)),t[2]=_.data,t[3]=_.status,t[4]=r,t[5]=b):b=t[5];let x=b,S;t[6]!==_.data||t[7]!==_.status||t[8]!==r?(S=r?.hostAliases??(r&&_.status===`ready`?Object.assign({},..._.data.filter(e=>e.scope===r.scope).map(Di)):{}),t[6]=_.data,t[7]=_.status,t[8]=r,t[9]=S):S=t[9];let C=S,w;t[10]!==_.data||t[11]!==_.status||t[12]!==r?(w=r?.installableEditors??(r&&_.status===`ready`?_.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=_.data,t[11]=_.status,t[12]=r,t[13]=w):w=t[13];let T=w,E,D,O,k,A,j,M;if(t[14]!==u||t[15]!==C||t[16]!==_.data||t[17]!==_.status||t[18]!==d||t[19]!==x||t[20]!==p||t[21]!==T||t[22]!==l||t[23]!==i||t[24]!==a||t[25]!==g||t[26]!==r||t[27]!==f||t[28]!==n){let e=T?new Set(T):null,o;t[36]===C?o=t[37]:(o=e=>!(e in C),t[36]=C,t[37]=o);let c=(x?[`agents`,...li]:li).filter(o).filter(t=>t===`agents`||e===null||e.has(t)||d.has(t)),m;t[38]===g?m=t[39]:(m=e=>g(e),t[38]=g,t[39]=m);let b=new Set(c.map(m)),S=r?.scope===`global`?`~/`:``,w;t[40]!==S||t[41]!==r?(w=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[40]=S,t[41]=r,t[42]=w):w=t[42];let N=w,P=N!==null&&!b.has(N)?N:null,F=P===null?n.sourceHost??r?.hosts?.[0]:void 0,I;t[43]===C?I=t[44]:(I=e=>_t(C,e),t[43]=C,t[44]=I);let L=I,R=Ei,z;t[45]!==u||t[46]!==L?(z=e=>{let t=L(e);return t.length===0?!0:window.confirm(u({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},t[45]=u,t[46]=L,t[47]=z):z=t[47];let B=z,V;t[48]!==u||t[49]!==r?(V=(e,t)=>{let n=e.includes(`/`)?e:ht(e,r?.scope??`project`);return(0,Q.jsx)(hi,{hint:u({id:`0dslv8`,values:{0:R(e),1:R(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":u({id:`G6Lrs_`,values:{0:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(u({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&wt({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?pt():rt.error(u({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(h,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[48]=u,t[49]=r,t[50]=V):V=t[50];let H=V,U;t[51]===r?.conflictHosts?U=t[52]:(U=r?.conflictHosts??[],t[51]=r?.conflictHosts,t[52]=U);let W;t[53]===U?W=t[54]:(W=new Set(U),t[53]=U,t[54]=W);let G=W,K;t[55]===r?.driftPaths?K=t[56]:(K=r?.driftPaths??[],t[55]=r?.driftPaths,t[56]=K);let q;t[57]===K?q=t[58]:(q=new Set(K),t[57]=K,t[58]=q);let J=q;E=n.installing;let Y=Ti,X;t[59]===r?.symlinkedHosts?X=t[60]:(X=r?.symlinkedHosts??[],t[59]=r?.symlinkedHosts,t[60]=X);let ee;t[61]===X?ee=t[62]:(ee=new Set(X),t[61]=X,t[62]=ee);let te=ee,ne=[...[...d].filter(e=>e!==F&&!(e in C)&&!G.has(e)&&!e.includes(`/`)).map(e=>te.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(wi)],re=ne.filter(Ci).length;O=ne.length===0?n.linkMode?`link`:`copy`:re*2>=ne.length?`link`:`copy`;let ie;t[63]!==C||t[64]!==G||t[65]!==d||t[66]!==te||t[67]!==g||t[68]!==F?(ie=[...d].filter(e=>e!==F&&!(e in C)&&!G.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:g(e)??R(e),mode:te.has(e)?`link`:`copy`})),t[63]=C,t[64]=G,t[65]=d,t[66]=te,t[67]=g,t[68]=F,t[69]=ie):ie=t[69];let ae;t[70]===r?.customPlacements?ae=t[71]:(ae=r?.customPlacements??[],t[70]=r?.customPlacements,t[71]=ae);let oe;if(t[72]!==S||t[73]!==ie||t[74]!==ae){let e;t[76]===S?e=t[77]:(e=e=>({target:vt(e),display:`${S}${e.path}`,mode:e.mode}),t[76]=S,t[77]=e),oe=[...ie,...ae.map(e)],t[72]=S,t[73]=ie,t[74]=ae,t[75]=oe}else oe=t[75];D=oe;let se;t[78]!==u||t[79]!==a||t[80]!==n?(se=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(hi,{hint:u(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(y,{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(u(i===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(a?.(),n.convertLocation?.(e,i))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Q.jsx)(s,{id:`uUCrBv`}):(0,Q.jsx)(s,{id:`iaPtht`})})})},t[78]=u,t[79]=a,t[80]=n,t[81]=se):se=t[81];let ce=se,le;t[82]===r?.customPlacements?le=t[83]:(le=r?.customPlacements??[],t[82]=r?.customPlacements,t[83]=le);let ue=new Map(le.map(Si)),de=new Set(ue.keys());if(_.status===`ready`&&r){for(let e of _.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=vt(t);e!==``&&de.add(e)}}let fe=r===void 0?[]:[...de].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:ue.get(e)??null})).filter(e=>!b.has(e.display)&&e.display!==N&&!(e.root in C)),pe;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(s,{id:`npcziF`}),t[84]=pe):pe=t[84];let me;t[85]===u?me=t[86]:(me=u({id:`6f_UX4`}),t[85]=u,t[86]=me);let he;t[87]===p?he=t[88]:(he=()=>p(),t[87]=p,t[88]=he);let ge;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Q.jsx)(s,{id:`N40H-G`}),t[89]=ge):ge=t[89];let _e;t[90]!==E||t[91]!==he?(_e=(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:E,onClick:he,"data-testid":`skill-install-all`,children:ge}),t[90]=E,t[91]=he,t[92]=_e):_e=t[92];let ve;t[93]!==me||t[94]!==_e?(ve=(0,Q.jsx)(hi,{hint:me,children:_e}),t[93]=me,t[94]=_e,t[95]=ve):ve=t[95],t[96]!==l||t[97]!==ve?(k=(0,Q.jsxs)(Zr,{menuKind:l,className:`flex items-center justify-between gap-2`,children:[pe,ve]}),t[96]=l,t[97]=ve,t[98]=k):k=t[98],t[99]!==u||t[100]!==H||t[101]!==E||t[102]!==l||t[103]!==P||t[104]!==L?(A=P===null?null:(0,Q.jsx)(hi,{hint:u({id:`pXB6SL`}),children:(0,Q.jsxs)(Xr,{menuKind:l,disabled:E,checked:!0,onSelect:xi,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(tt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:P}),(()=>{let e=Y(P).split(`/`).slice(0,-1).join(`/`),t=L(e);return t.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>H(t,e))}):null})(),(0,Q.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,Q.jsx)(s,{id:`tiFPjk`})})]})]})}),t[99]=u,t[100]=H,t[101]=E,t[102]=l,t[103]=P,t[104]=L,t[105]=A):A=t[105];let ye;t[106]!==u||t[107]!==H||t[108]!==E||t[109]!==B||t[110]!==G||t[111]!==ce||t[112]!==J||t[113]!==O||t[114]!==d||t[115]!==te||t[116]!==l||t[117]!==i||t[118]!==g||t[119]!==r?.hosts||t[120]!==F||t[121]!==L||t[122]!==f||t[123]!==n?(ye=e=>{let t=g(e),a=e===`agents`?`.agents`:Fe[e],o=Y(t).split(`/`).slice(0,-1).join(`/`),c=L(o);return(0,Q.jsx)(hi,{hint:G.has(e)?u({id:`8HvJlU`,values:{0:t??a}}):e===F?t?u({id:`ssk6rl`,values:{path:t}}):a:d.has(e)?u(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):u(t?O===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(Xr,{menuKind:l,disabled:E,checked:d.has(e),onCheckedChange:t=>{G.has(e)||t===!0&&!B(o)||f(e,t===!0)},onSelect:bi,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(h,{host:e,"aria-hidden":!0,className:`size-4`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:t??a}),c.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:c.map(e=>H(e,o))}):null,G.has(e)?(0,Q.jsx)(hi,{hint:u({id:`_O7dJS`}),children:(0,Q.jsx)(y,{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:t=>{t.preventDefault(),i?.(e)},"data-testid":`skill-fork-chip-${e}`,children:(0,Q.jsx)(s,{id:`jng7Ko`})})}):e===F?(0,Q.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,Q.jsx)(s,{id:`tiFPjk`})}):d.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!E&&(te.has(e)?`link`:`copy`)!==O?ce(e,t??a,te.has(e)?`link`:`copy`):null,(0,Q.jsx)(hi,{hint:u({id:`nBgzKO`}),children:(0,Q.jsx)(y,{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)},"data-testid":`skill-set-source-${e}`,children:(0,Q.jsx)(s,{id:`VNNRfN`})})})]}):null,!E&&J.has(Y(t))?(0,Q.jsx)(hi,{hint:u({id:`iz1LdD`}),children:(0,Q.jsx)(v,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[106]=u,t[107]=H,t[108]=E,t[109]=B,t[110]=G,t[111]=ce,t[112]=J,t[113]=O,t[114]=d,t[115]=te,t[116]=l,t[117]=i,t[118]=g,t[119]=r?.hosts,t[120]=F,t[121]=L,t[122]=f,t[123]=n,t[124]=ye):ye=t[124],j=c.map(ye);let be;t[125]!==u||t[126]!==H||t[127]!==E||t[128]!==B||t[129]!==ce||t[130]!==J||t[131]!==O||t[132]!==l||t[133]!==L||t[134]!==n?(be=e=>(0,Q.jsx)(hi,{hint:e.placed===null?u(O===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):u({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(Xr,{menuKind:l,disabled:E,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!B(e.root))return;n.placeAt(e.root,O)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:yi,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(h,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(tt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),L(e.root).length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:L(e.root).map(t=>H(t,e.root))}):null,!E&&e.placed!==null&&J.has(e.placed.path)?(0,Q.jsx)(hi,{hint:u({id:`iz1LdD`}),children:(0,Q.jsx)(v,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!E&&e.placed.mode!==O?ce(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(hi,{hint:u({id:`nBgzKO`}),children:(0,Q.jsx)(y,{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,Q.jsx)(s,{id:`VNNRfN`})})})]})]})]})},e.root),t[125]=u,t[126]=H,t[127]=E,t[128]=B,t[129]=ce,t[130]=J,t[131]=O,t[132]=l,t[133]=L,t[134]=n,t[135]=be):be=t[135],M=fe.map(be),t[14]=u,t[15]=C,t[16]=_.data,t[17]=_.status,t[18]=d,t[19]=x,t[20]=p,t[21]=T,t[22]=l,t[23]=i,t[24]=a,t[25]=g,t[26]=r,t[27]=f,t[28]=n,t[29]=E,t[30]=D,t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M}else E=t[29],D=t[30],O=t[31],k=t[32],A=t[33],j=t[34],M=t[35];let N;t[136]!==u||t[137]!==E||t[138]!==D||t[139]!==O||t[140]!==a||t[141]!==n?(N=D.length>0&&n.convertLocations?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Q.jsx)(y,{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=O===`link`?`copy`:`link`,r=D.filter(e=>e.mode!==t);if(r.length===0)return;let i=u(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),o=u(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),s=r.map(vi).join(`
|
|
2
2
|
`);window.confirm(`${i}\n\n${o}\n\n${s}\n\n${u({id:`Cu6GXQ`})}`)&&(a?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:E,"data-testid":`skill-convert-all`,children:O===`link`?(0,Q.jsx)(s,{id:`rcJmK8`}):(0,Q.jsx)(s,{id:`LBv_TR`})}),(0,Q.jsx)(hi,{hint:u({id:`0J6nhG`}),children:(0,Q.jsx)(y,{variant:`ghost`,size:`sm`,"aria-label":u({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:_i,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[136]=u,t[137]=E,t[138]=D,t[139]=O,t[140]=a,t[141]=n,t[142]=N):N=t[142];let P;t[143]===l?P=t[144]:(P=(0,Q.jsx)(Qr,{menuKind:l}),t[143]=l,t[144]=P);let F;t[145]===u?F=t[146]:(F=u({id:`jqe7Yq`}),t[145]=u,t[146]=F);let I;t[147]===r?.scope?I=t[148]:(I=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[147]=r?.scope,t[148]=I);let L,R;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(Vn,{"aria-hidden":!0}),R=(0,Q.jsx)(s,{id:`ZBF9fn`}),t[149]=L,t[150]=R):(L=t[149],R=t[150]);let z;t[151]!==l||t[152]!==I?(z=(0,Q.jsxs)(Yr,{menuKind:l,onSelect:I,children:[L,R]}),t[151]=l,t[152]=I,t[153]=z):z=t[153];let B;t[154]!==F||t[155]!==z?(B=(0,Q.jsx)(hi,{hint:F,children:z}),t[154]=F,t[155]=z,t[156]=B):B=t[156];let V;return t[157]!==N||t[158]!==P||t[159]!==B||t[160]!==k||t[161]!==A||t[162]!==j||t[163]!==M?(V=(0,Q.jsxs)(Q.Fragment,{children:[k,A,j,M,N,P,B]}),t[157]=N,t[158]=P,t[159]=B,t[160]=k,t[161]=A,t[162]=j,t[163]=M,t[164]=V):V=t[164],V}function _i(e){return e.preventDefault()}function vi(e){return e.display}function yi(e){return e.preventDefault()}function bi(e){return e.preventDefault()}function xi(e){return e.preventDefault()}function Si(e){return[vt(e),e]}function Ci(e){return e===`link`}function wi(e){return e.mode}function Ti(e){return(e??``).replace(/^~\//,``)}function Ei(e){return e===`agents`?`.agents`:Fe[e]??e}function Di(e){return e.hostAliases??{}}function Oi(e){return e.hosts.includes(`agents`)||e.path.startsWith(`.agents/`)}function ki(e){let t=(0,$.c)(23),{onAddProperty:n,className:r,problemCount:i,problemMessages:a}=e,o=i===void 0?0:i,{_:l}=c(),u=o>0,f;t[0]!==l||t[1]!==u||t[2]!==o?(f=l(u?{id:`3KOHFt`,values:{problemCount:o}}:{id:`81H_23`}),t[0]=l,t[1]=u,t[2]=o,t[3]=f):f=t[3];let p=f,m;t[4]===r?m=t[5]:(m=d(`relative`,r),t[4]=r,t[5]=m);let h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(zn,{}),t[6]=h):h=t[6];let g;t[7]!==u||t[8]!==o?(g=u?(0,Q.jsx)(yt,{variant:`notification`,"aria-hidden":`true`,"data-testid":`add-properties-problem-badge`,className:`pointer-events-none absolute -top-0.5 -right-0.5 size-3.5 rounded-full p-0 font-sans text-[9px] leading-none tabular-nums`,children:o>9?`9+`:o}):null,t[7]=u,t[8]=o,t[9]=g):g=t[9];let _;t[10]===g?_=t[11]:(_=(0,Q.jsxs)(T,{children:[h,g]}),t[10]=g,t[11]=_);let v;t[12]!==p||t[13]!==n||t[14]!==m||t[15]!==_?(v=(0,Q.jsx)(y,{variant:`ghost`,size:`icon`,"aria-label":p,onClick:n,"data-testid":`add-properties-button`,className:m,asChild:!0,children:_}),t[12]=p,t[13]=n,t[14]=m,t[15]=_,t[16]=v):v=t[16];let b;t[17]!==u||t[18]!==a?(b=(0,Q.jsx)(E,{side:`bottom`,children:u?(0,Q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:(0,Q.jsx)(s,{id:`AwrGuz`})}),a?.map(Ai),(0,Q.jsx)(`span`,{className:`pt-0.5 opacity-70`,children:(0,Q.jsx)(s,{id:`yh5-4s`})})]}):(0,Q.jsx)(s,{id:`81H_23`})}),t[17]=u,t[18]=a,t[19]=b):b=t[19];let x;return t[20]!==v||t[21]!==b?(x=(0,Q.jsxs)(D,{children:[v,b]}),t[20]=v,t[21]=b,t[22]=x):x=t[22],x}function Ai(e,t){return(0,Q.jsx)(`span`,{className:`opacity-90`,children:e},t)}function ji(e){return e?at._({id:`wTcjov`}):null}function Mi(e){let t=(0,$.c)(46),{_:i}=c(),a=n(),o=g(),l=de(),d=pe();if(a)return null;let{input:f,installStates:p,dispatch:m}=e,h=f===null,_,v,y,b,x,S,C,w,T,E,D;if(t[0]!==i||t[1]!==m||t[2]!==f||t[3]!==h||t[4]!==p||t[5]!==d||t[6]!==l||t[7]!==o){let e=ji(h),n;t[19]===d?n=t[20]:(n=e=>xe(d,e.id),t[19]=d,t[20]=n);let a=me.filter(n),c;t[21]===d?c=t[22]:(c=e=>ge(d,e.source,e.id,!0,e.supported),t[21]=d,t[22]=c);let u=l.filter(c),g=o?Oe.filter(e=>ye(d,e,o.installedClis)):[];y=a.length>0,b=o!==null&&g.length>0,x=u.length>0,v=Br,t[23]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsxs)(Ur,{children:[(0,Q.jsx)(r,{"aria-hidden":`true`}),(0,Q.jsx)(s,{id:`O7_W_a`})]}),t[23]=D):D=t[23],_=Wr,S=`max-h-80`,C=x?(0,Q.jsxs)(zr,{"aria-label":i({id:`vPKX2i`}),children:[(0,Q.jsxs)(Kr,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(s,{id:`RXEbZy`}),(0,Q.jsx)(be,{})]}),u.map(t=>{let n=t.name;return(0,Q.jsxs)(Hr,{onSelect:()=>{f!==null&&jr(f,{agent:{source:t.source,id:t.id}})},disabled:h,"data-testid":`empty-space-open-in-thread-${t.id}`,"aria-label":e?i({id:`gtGQ9S`,values:{agentName:n,hint:e}}):void 0,children:[(0,Q.jsx)(Je,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`5PrrYw`,values:{agentName:n}})}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[24]!==y||t[25]!==b||t[26]!==x?(w=x&&(b||y)?(0,Q.jsx)(qr,{}):null,t[24]=y,t[25]=b,t[26]=x,t[27]=w):w=t[27],T=b?(0,Q.jsxs)(zr,{"aria-label":i({id:`ALhMYW`}),children:[(0,Q.jsx)(Kr,{children:(0,Q.jsx)(s,{id:`ALhMYW`})}),g.map(t=>{let{displayName:n}=De[t];return(0,Q.jsxs)(Hr,{onSelect:()=>{f!==null&&o.launchInTerminal(f,t)},disabled:h,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":i(e?{id:`AIn2Yv`,values:{displayName:n,hint:e}}:{id:`QYfQdv`,values:{displayName:n}}),children:[(0,Q.jsx)(_e,{id:fe(t),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:n}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,E=y?(0,Q.jsxs)(Q.Fragment,{children:[b?(0,Q.jsx)(qr,{}):null,(0,Q.jsxs)(zr,{"aria-label":i({id:`BBqGS9`}),children:[(0,Q.jsx)(Kr,{children:(0,Q.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let n=!h,{displayName:r}=t,a=i(e?{id:`1ZpfyB`,values:{displayName:r,hint:e}}:{id:`WqLq6M`,values:{displayName:r}});return(0,Q.jsxs)(Hr,{disabled:!n,onSelect:()=>{if(f){if(p[t.id]?.installed!==!0){_r(t);return}m(t.id,f)}},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":a,children:[(0,Q.jsx)(_e,{id:t.id,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=i,t[1]=m,t[2]=f,t[3]=h,t[4]=p,t[5]=d,t[6]=l,t[7]=o,t[8]=_,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D}else _=t[8],v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18];let O;t[28]!==y||t[29]!==b||t[30]!==x?(O=x||b||y?(0,Q.jsx)(qr,{}):null,t[28]=y,t[29]=b,t[30]=x,t[31]=O):O=t[31];let k;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(u,{"aria-hidden":`true`}),t[32]=k):k=t[32];let A;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsxs)(Hr,{onSelect:ot,"data-testid":`empty-space-open-in-settings`,children:[k,(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`jRAGrQ`})})]}),t[33]=A):A=t[33];let j;t[34]!==_||t[35]!==S||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==O?(j=(0,Q.jsxs)(_,{className:S,children:[C,w,T,E,O,A]}),t[34]=_,t[35]=S,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=O,t[41]=j):j=t[41];let M;return t[42]!==v||t[43]!==D||t[44]!==j?(M=(0,Q.jsxs)(v,{children:[D,j]}),t[42]=v,t[43]=D,t[44]=j,t[45]=M):M=t[45],M}function Ni(e){return e?at._({id:`wTcjov`}):null}function Pi(e){let t=(0,$.c)(47),{_:i}=c(),a=n(),o=g(),l=de(),d=pe();if(a)return null;let{input:f,installStates:p,dispatch:m,onBeforeLaunch:h}=e,_=f===null,v,y,b,x,S,C,w,T,E,D,O;if(t[0]!==i||t[1]!==m||t[2]!==f||t[3]!==_||t[4]!==p||t[5]!==h||t[6]!==d||t[7]!==l||t[8]!==o){let e=Ni(_),n;t[20]===d?n=t[21]:(n=e=>xe(d,e.id),t[20]=d,t[21]=n);let a=me.filter(n),c;t[22]===d?c=t[23]:(c=e=>ge(d,e.source,e.id,!0,e.supported),t[22]=d,t[23]=c);let u=l.filter(c),g=o?Oe.filter(e=>ye(d,e,o.installedClis)):[];b=a.length>0,x=o!==null&&g.length>0,S=u.length>0,y=re,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsxs)(ce,{children:[(0,Q.jsx)(r,{"aria-hidden":`true`}),(0,Q.jsx)(s,{id:`O7_W_a`})]}),t[24]=O):O=t[24],v=ie,C=`max-h-80`,w=S?(0,Q.jsxs)(ae,{"aria-label":i({id:`vPKX2i`}),children:[(0,Q.jsxs)(se,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(s,{id:`RXEbZy`}),(0,Q.jsx)(be,{})]}),u.map(t=>{let n=t.name;return(0,Q.jsxs)(ne,{onSelect:()=>{f!==null&&(h?.(),jr(f,{agent:{source:t.source,id:t.id}}))},disabled:_,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?i({id:`gtGQ9S`,values:{agentName:n,hint:e}}):void 0,children:[(0,Q.jsx)(Je,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`5PrrYw`,values:{agentName:n}})}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==b||t[26]!==x||t[27]!==S?(T=S&&(x||b)?(0,Q.jsx)(le,{}):null,t[25]=b,t[26]=x,t[27]=S,t[28]=T):T=t[28],E=x?(0,Q.jsxs)(ae,{"aria-label":i({id:`ALhMYW`}),children:[(0,Q.jsx)(se,{children:(0,Q.jsx)(s,{id:`ALhMYW`})}),g.map(t=>{let{displayName:n}=De[t];return(0,Q.jsxs)(ne,{onSelect:()=>{f!==null&&(h?.(),o.launchInTerminal(f,t))},disabled:_,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":i(e?{id:`AIn2Yv`,values:{displayName:n,hint:e}}:{id:`QYfQdv`,values:{displayName:n}}),children:[(0,Q.jsx)(_e,{id:fe(t),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:n}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,D=b?(0,Q.jsxs)(Q.Fragment,{children:[x?(0,Q.jsx)(le,{}):null,(0,Q.jsxs)(ae,{"aria-label":i({id:`BBqGS9`}),children:[(0,Q.jsx)(se,{children:(0,Q.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let n=!_,{displayName:r}=t,a=i(e?{id:`1ZpfyB`,values:{displayName:r,hint:e}}:{id:`WqLq6M`,values:{displayName:r}});return(0,Q.jsxs)(ne,{disabled:!n,onSelect:()=>{if(f){if(h?.(),p[t.id]?.installed!==!0){_r(t);return}m(t.id,f)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Q.jsx)(_e,{id:t.id,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=i,t[1]=m,t[2]=f,t[3]=_,t[4]=p,t[5]=h,t[6]=d,t[7]=l,t[8]=o,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D,t[19]=O}else v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18],O=t[19];let k;t[29]!==b||t[30]!==x||t[31]!==S?(k=S||x||b?(0,Q.jsx)(le,{}):null,t[29]=b,t[30]=x,t[31]=S,t[32]=k):k=t[32];let A;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(u,{"aria-hidden":`true`}),t[33]=A):A=t[33];let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsxs)(ne,{onSelect:ot,"data-testid":`file-tree-open-in-settings`,children:[A,(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`jRAGrQ`})})]}),t[34]=j):j=t[34];let M;t[35]!==v||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==D||t[41]!==k?(M=(0,Q.jsxs)(v,{className:C,children:[w,T,E,D,k,j]}),t[35]=v,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=k,t[42]=M):M=t[42];let N;return t[43]!==y||t[44]!==O||t[45]!==M?(N=(0,Q.jsxs)(y,{children:[O,M]}),t[43]=y,t[44]=O,t[45]=M,t[46]=N):N=t[46],N}function Fi(e){let t=Ce(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=ke(e);return n?{scope:`global`,name:n.name,rel:n.rel}:null}function Ii(e,t,n){return e.filter(e=>{let r=ut(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=Fi(r.docName);return i?.scope===t&&i.name===n})}function Li(e,t,n){let r=lt(t,n);return e.filter(e=>{let i=ut(e);return i.kind===`skill-file`?i.scope===t.scope&&i.name===t.name&&i.path===n:i.kind===`doc`&&i.docName===r})}function Ri(e,t,n){let r=Fi(e);if(!r||r.rel===null)return null;let i=t.find(e=>e.scope===r.scope&&e.name===r.name);if(!i||i.managed)return null;let a=`references/${r.rel}${n}`;return lt(i,a)===e?{skill:i,filePath:a}:null}function zi(e,t){let n=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),r=[];for(let t of e){let e=Fi(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`,a=n.get(`${i}\u0000${e.name}`);e.rel===null&&a!==void 0?r.push({kind:`retarget`,fromDocName:t,toDocName:ct(a)}):r.push({kind:`close`,docName:t})}return r}function Bi(){let e=(0,$.c)(15),{openTabs:t,closeDocument:n}=a(),r=Ye(),i;e[0]===t?i=e[1]:(i=t.some(Hi),e[0]=t,e[1]=i);let o=i,s;e[2]===o?s=e[3]:(s={enabled:o},e[2]=o,e[3]=s);let c=Ft(s),l=(0,Z.useRef)(null),u;e[4]!==n||e[5]!==t||e[6]!==r||e[7]!==c.data||e[8]!==c.status?(u=()=>{if(c.status!==`ready`)return;let e=c.data,i=`${t.join(``)}\u0002${e.map(Vi).sort().join(``)}`;if(l.current===i)return;l.current=i;let a=zi(t,e);for(let e of a)e.kind===`retarget`?r(e.fromDocName,e.toDocName):n(e.docName)},e[4]=n,e[5]=t,e[6]=r,e[7]=c.data,e[8]=c.status,e[9]=u):u=e[9];let d;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==c?(d=[c,t,r,n],e[10]=n,e[11]=t,e[12]=r,e[13]=c,e[14]=d):d=e[14],(0,Z.useEffect)(u,d)}function Vi(e){return`${e.scope}\u0000${e.name}`}function Hi(e){return Fi(e)!==null}function Ui(e){let t=(0,$.c)(19),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=c(),{setSkillsSidebar:s,closeTabs:l,openTabs:u}=a(),[d,f]=(0,Z.useState)(!1),p;t[0]!==o||t[1]!==l||t[2]!==i||t[3]!==r||t[4]!==u||t[5]!==s?(p=async function(e){s(!0),f(!0);let t=await Ot(e.scope,e.name);if(f(!1),!t.ok){let{error:e}=t;rt.error(o({id:`AtBdnD`,values:{error:e}}));return}rt.success(o({id:`h9QFb9`,values:{0:e.name}})),l(Ii(u,e.scope,e.name),{force:!0}),i(),r(!1)},t[0]=o,t[1]=l,t[2]=i,t[3]=r,t[4]=u,t[5]=s,t[6]=p):p=t[6];let h=p,g=n!==null,_;t[7]!==d||t[8]!==r?(_=e=>{!e&&!d&&r(!1)},t[7]=d,t[8]=r,t[9]=_):_=t[9];let v;t[10]!==o||t[11]!==d||t[12]!==h||t[13]!==n?(v=n?(0,Q.jsx)(m,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:d,onDelete:()=>h(n),customDescription:n.origin?.source&&/\/plugins\/(?:cache|marketplaces)\//.test(n.origin.source)?o({id:`WnsbUT`,values:{0:n.path}}):o({id:`E1Da_b`,values:{0:n.path}})}):null,t[10]=o,t[11]=d,t[12]=h,t[13]=n,t[14]=v):v=t[14];let y;return t[15]!==g||t[16]!==_||t[17]!==v?(y=(0,Q.jsx)(F,{open:g,onOpenChange:_,children:v}),t[15]=g,t[16]=_,t[17]=v,t[18]=y):y=t[18],y}function Wi(e){let t=e.split(`/`);return t.some(e=>e===``||e===`.`||e===`..`)||t.length===0||t.length===1&&t[0].toLowerCase()===`skill.md`?!1:!/\s/.test(e)}function Gi(e){let t=(0,$.c)(66),{target:n,onOpenChange:r}=e,{_:i}=c(),{openTarget:o}=a(),l=(0,Z.useId)(),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.prefix??`references/`)},t[0]=n,t[1]=m);let h=n?.skill.scope,g=n?.skill.name,_=n?.prefix,v;if(t[2]!==h||t[3]!==g||t[4]!==_?(v=[h,g,_],t[2]=h,t[3]=g,t[4]=_,t[5]=v):v=t[5],(0,Z.useEffect)(m,v),!n)return null;let b,x,S,C;t[6]!==u||t[7]!==f?(C=u.trim(),x=C===``||!Wi(C),b=!x&&!f,S=C.includes(`/`)?C.split(`/`).slice(0,-1).join(`/`):null,t[6]=u,t[7]=f,t[8]=b,t[9]=x,t[10]=S,t[11]=C):(b=t[8],x=t[9],S=t[10],C=t[11]);let w=S,T;t[12]!==i||t[13]!==b||t[14]!==r||t[15]!==o||t[16]!==n||t[17]!==C?(T=async function(){if(!n||!b)return;p(!0);let e=/\.mdx?$/i.test(C),t=await Tt({scope:n.skill.scope,name:n.skill.name,path:C,content:e?`# ${C.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){rt.error(i({id:`a_2_uB`,values:{0:t.error,trimmed:C}}));return}if(rt.success(i({id:`MXSt4t`,values:{0:t.path}})),e){let e=lt(n.skill,C);o({kind:`doc`,target:e,docName:e})}r(!1)},t[12]=i,t[13]=b,t[14]=r,t[15]=o,t[16]=n,t[17]=C,t[18]=T):T=t[18];let E=T,D;t[19]!==r||t[20]!==f?(D=e=>{!e&&!f&&r(!1)},t[19]=r,t[20]=f,t[21]=D):D=t[21];let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(k,{children:(0,Q.jsx)(s,{id:`wQvvZY`})}),t[22]=j):j=t[22];let N;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsxs)(P,{children:[j,(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`lM4c-I`})})]}),t[23]=N):N=t[23];let I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(s,{id:`I6gXOa`}),t[24]=I):I=t[24];let L;t[25]===l?L=t[26]:(L=(0,Q.jsx)(ue,{htmlFor:l,children:I}),t[25]=l,t[26]=L);let R;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>d(e.target.value),t[27]=R):R=t[27];let z=x&&C!==``,B;t[28]===E?B=t[29]:(B=e=>{e.key===`Enter`&&E()},t[28]=E,t[29]=B);let V;t[30]!==l||t[31]!==u||t[32]!==z||t[33]!==B?(V=(0,Q.jsx)(it,{id:l,value:u,onChange:R,placeholder:`references/notes.md`,"aria-invalid":z,onKeyDown:B}),t[30]=l,t[31]=u,t[32]=z,t[33]=B,t[34]=V):V=t[34];let H;t[35]!==w||t[36]!==x||t[37]!==C?(H=x&&C!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(s,{id:`fVzizW`})}):w?(0,Q.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,Q.jsx)(s,{id:`9lso1Y`,values:{folderPart:w},components:{0:(0,Q.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null,t[35]=w,t[36]=x,t[37]=C,t[38]=H):H=t[38];let U;t[39]!==L||t[40]!==V||t[41]!==H?(U=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[L,V,H]}),t[39]=L,t[40]=V,t[41]=H,t[42]=U):U=t[42];let W;t[43]===r?W=t[44]:(W=()=>r(!1),t[43]=r,t[44]=W);let G;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(s,{id:`dEgA5A`}),t[45]=G):G=t[45];let K;t[46]!==f||t[47]!==W?(K=(0,Q.jsx)(y,{variant:`outline`,onClick:W,disabled:f,children:G}),t[46]=f,t[47]=W,t[48]=K):K=t[48];let q;t[49]===E?q=t[50]:(q=()=>void E(),t[49]=E,t[50]=q);let J=!b,Y;t[51]===f?Y=t[52]:(Y=f?(0,Q.jsx)(s,{id:`E9bKSA`}):(0,Q.jsx)(s,{id:`hYgDIe`}),t[51]=f,t[52]=Y);let X;t[53]!==q||t[54]!==J||t[55]!==Y?(X=(0,Q.jsx)(y,{onClick:q,disabled:J,children:Y}),t[53]=q,t[54]=J,t[55]=Y,t[56]=X):X=t[56];let ee;t[57]!==K||t[58]!==X?(ee=(0,Q.jsxs)(M,{children:[K,X]}),t[57]=K,t[58]=X,t[59]=ee):ee=t[59];let te;t[60]!==U||t[61]!==ee?(te=(0,Q.jsxs)(A,{className:`sm:max-w-md`,children:[N,U,ee]}),t[60]=U,t[61]=ee,t[62]=te):te=t[62];let ne;return t[63]!==te||t[64]!==D?(ne=(0,Q.jsx)(F,{open:!0,onOpenChange:D,children:te}),t[63]=te,t[64]=D,t[65]=ne):ne=t[65],ne}function Ki(e){let t=(0,$.c)(18),{target:n,onOpenChange:r}=e,{_:i}=c(),{setSkillsSidebar:o,closeTabs:s,openTabs:l}=a(),[u,d]=(0,Z.useState)(!1),f;t[0]!==i||t[1]!==s||t[2]!==r||t[3]!==l||t[4]!==o?(f=async function(e){let{skill:t,filePath:n}=e;o(!0),d(!0);let a=await At({scope:t.scope,name:t.name,path:n});if(d(!1),!a.ok){rt.error(i({id:`CBT70t`,values:{0:a.error}}));return}if(!a.existed){rt.error(i({id:`q4efaG`,values:{filePath:n}})),r(!1);return}rt.success(i({id:`gOmloS`,values:{filePath:n}})),s(Li(l,t,n),{force:!0}),r(!1)},t[0]=i,t[1]=s,t[2]=r,t[3]=l,t[4]=o,t[5]=f):f=t[5];let p=f,h=n!==null,g;t[6]!==u||t[7]!==r?(g=e=>{!e&&!u&&r(!1)},t[6]=u,t[7]=r,t[8]=g):g=t[8];let _;t[9]!==i||t[10]!==u||t[11]!==p||t[12]!==n?(_=n?(0,Q.jsx)(m,{itemName:i({id:`wZPUJx`,values:{0:n.filePath}}),isSubmitting:u,onDelete:()=>p(n),customDescription:i({id:`ppzof_`,values:{0:mt(n.skill.path),1:n.filePath,2:n.skill.name}})}):null,t[9]=i,t[10]=u,t[11]=p,t[12]=n,t[13]=_):_=t[13];let v;return t[14]!==h||t[15]!==g||t[16]!==_?(v=(0,Q.jsx)(F,{open:h,onOpenChange:g,children:_}),t[14]=h,t[15]=g,t[16]=_,t[17]=v):v=t[17],v}function qi(e){let t=(0,$.c)(64),{target:n,onOpenChange:r}=e,{_:i}=c(),a=Ye(),o=(0,Z.useId)(),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),p;t[0]===n?p=t[1]:(p=()=>{n&&u(n.filePath)},t[0]=n,t[1]=p);let m=n?.skill.scope,h=n?.skill.name,g=n?.filePath,_;if(t[2]!==m||t[3]!==h||t[4]!==g?(_=[m,h,g],t[2]=m,t[3]=h,t[4]=g,t[5]=_):_=t[5],(0,Z.useEffect)(p,_),!n)return null;let v,b,x;t[6]!==l||t[7]!==n.filePath?(b=l.trim(),x=b===n.filePath,v=b===``||!Wi(b),t[6]=l,t[7]=n.filePath,t[8]=v,t[9]=b,t[10]=x):(v=t[8],b=t[9],x=t[10]);let S=v,C=!S&&!x&&!d,w;t[11]!==i||t[12]!==C||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==b?(w=async function(){if(!n||!C)return;f(!0);let e=await St({scope:n.skill.scope,name:n.skill.name,from:n.filePath,to:b});if(f(!1),!e.ok){rt.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),rt.success(i({id:`XszXjc`,values:{0:e.to}})),r(!1)},t[11]=i,t[12]=C,t[13]=r,t[14]=a,t[15]=n,t[16]=b,t[17]=w):w=t[17];let T=w,E;t[18]!==r||t[19]!==d?(E=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=E):E=t[20];let D;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(k,{children:(0,Q.jsx)(s,{id:`yckias`})}),t[21]=D):D=t[21];let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsxs)(P,{children:[D,(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`HzVAoz`})})]}),t[22]=j):j=t[22];let N;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(s,{id:`I6gXOa`}),t[23]=N):N=t[23];let I;t[24]===o?I=t[25]:(I=(0,Q.jsx)(ue,{htmlFor:o,children:N}),t[24]=o,t[25]=I);let L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>u(e.target.value),t[26]=L):L=t[26];let R=S&&b!==``,z;t[27]===T?z=t[28]:(z=e=>{e.key===`Enter`&&T()},t[27]=T,t[28]=z);let B;t[29]!==o||t[30]!==l||t[31]!==R||t[32]!==z?(B=(0,Q.jsx)(it,{id:o,value:l,onChange:L,"aria-invalid":R,onKeyDown:z}),t[29]=o,t[30]=l,t[31]=R,t[32]=z,t[33]=B):B=t[33];let V;t[34]!==S||t[35]!==b?(V=S&&b!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(s,{id:`fVzizW`})}):null,t[34]=S,t[35]=b,t[36]=V):V=t[36];let H;t[37]!==I||t[38]!==B||t[39]!==V?(H=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[I,B,V]}),t[37]=I,t[38]=B,t[39]=V,t[40]=H):H=t[40];let U;t[41]===r?U=t[42]:(U=()=>r(!1),t[41]=r,t[42]=U);let W;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(s,{id:`dEgA5A`}),t[43]=W):W=t[43];let G;t[44]!==d||t[45]!==U?(G=(0,Q.jsx)(y,{variant:`outline`,onClick:U,disabled:d,children:W}),t[44]=d,t[45]=U,t[46]=G):G=t[46];let K;t[47]===T?K=t[48]:(K=()=>void T(),t[47]=T,t[48]=K);let q=!C,J;t[49]===d?J=t[50]:(J=d?(0,Q.jsx)(s,{id:`tHKQ6j`}):(0,Q.jsx)(s,{id:`2wxgft`}),t[49]=d,t[50]=J);let Y;t[51]!==K||t[52]!==q||t[53]!==J?(Y=(0,Q.jsx)(y,{onClick:K,disabled:q,children:J}),t[51]=K,t[52]=q,t[53]=J,t[54]=Y):Y=t[54];let X;t[55]!==G||t[56]!==Y?(X=(0,Q.jsxs)(M,{children:[G,Y]}),t[55]=G,t[56]=Y,t[57]=X):X=t[57];let ee;t[58]!==H||t[59]!==X?(ee=(0,Q.jsxs)(A,{className:`sm:max-w-md`,children:[j,H,X]}),t[58]=H,t[59]=X,t[60]=ee):ee=t[60];let te;return t[61]!==ee||t[62]!==E?(te=(0,Q.jsx)(F,{open:!0,onOpenChange:E,children:ee}),t[61]=ee,t[62]=E,t[63]=te):te=t[63],te}function Ji(e){let t=(0,$.c)(59),{target:n,onOpenChange:r}=e,{_:i}=c(),a=(0,Z.useId)(),[o,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(``),[v,b]=(0,Z.useState)(!1),x;t[0]===n?x=t[1]:(x=()=>{if(l(null),d(null),p(!1),h(!1),!n)return;let{skill:e,editor:t}=n,r=e.absolutePath?.slice(0,-`/${e.path}`.length)??null;if(r===null){p(!0);return}let i=`${r}/${e.path.replace(/\/SKILL\.mdx?$/i,``)}`,a=`${r}/${ht(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,d],[a,l]])Dt({source:t,name:e.name},o.signal).then(e=>{o.signal.aborted||(e.ok?n(e.skillMd):p(!0))}).catch(()=>{o.signal.aborted||p(!0)});return()=>o.abort()},t[0]=n,t[1]=x);let S=n?.skill.scope,C=n?.skill.name,w=n?.editor,T;if(t[2]!==S||t[3]!==C||t[4]!==w?(T=[S,C,w],t[2]=S,t[3]=C,t[4]=w,t[5]=T):T=t[5],(0,Z.useEffect)(x,T),!n)return null;let{skill:E,editor:D}=n,N;t[6]!==i||t[7]!==D||t[8]!==r||t[9]!==E.name||t[10]!==E.scope||t[11]!==n||t[12]!==g?(N=async function(e){if(!n)return;b(!0);let t=await bt({scope:E.scope,name:E.name,editor:D,action:e,...e===`rename`?{toName:g.trim()}:{}});if(b(!1),!t.ok){rt.error(i({id:`MIF36T`,values:{0:t.error}}));return}rt.success(i(e===`align`?{id:`QKgePK`,values:{editor:D}}:e===`make-source`?{id:`It9oAP`,values:{editor:D}}:{id:`b2ezG_`,values:{0:g.trim()}})),r(!1)},t[6]=i,t[7]=D,t[8]=r,t[9]=E.name,t[10]=E.scope,t[11]=n,t[12]=g,t[13]=N):N=t[13];let I=N,L,R;t[14]!==E.name||t[15]!==g?(R=g.trim(),L=R===``||!Te.test(R)||R===E.name,t[14]=E.name,t[15]=g,t[16]=L,t[17]=R):(L=t[16],R=t[17]);let z=L,B;t[18]!==v||t[19]!==r?(B=e=>{!e&&!v&&r(!1)},t[18]=v,t[19]=r,t[20]=B):B=t[20];let V;t[21]!==D||t[22]!==E.name?(V=(0,Q.jsx)(k,{children:(0,Q.jsx)(s,{id:`q8aCbb`,values:{0:E.name,editor:D}})}),t[21]=D,t[22]=E.name,t[23]=V):V=t[23];let H;t[24]===D?H=t[25]:(H=(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`QASTNu`,values:{editor:D}})}),t[24]=D,t[25]=H);let U;t[26]!==H||t[27]!==V?(U=(0,Q.jsxs)(P,{children:[V,H]}),t[26]=H,t[27]=V,t[28]=U):U=t[28];let W;t[29]!==u||t[30]!==o||t[31]!==f?(W=u!==null&&o!==null?(0,Q.jsx)(Rt,{oldContent:u,newContent:o,layout:`unified`}):f?(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center px-6 text-center text-muted-foreground text-sm`,children:(0,Q.jsx)(s,{id:`5BlXTD`})}):(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,Q.jsx)(s,{id:`1V17kO`})}),t[29]=u,t[30]=o,t[31]=f,t[32]=W):W=t[32];let G;t[33]!==I||t[34]!==D||t[35]!==a||t[36]!==z||t[37]!==m||t[38]!==E.name||t[39]!==g||t[40]!==R?(G=m?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Q.jsx)(ue,{htmlFor:a,children:(0,Q.jsx)(s,{id:`pSimwP`,values:{editor:D}})}),(0,Q.jsx)(it,{id:a,value:g,onChange:e=>_(e.target.value),placeholder:`${E.name}-${D}`,"aria-invalid":z&&R!==``,onKeyDown:e=>{e.key===`Enter`&&!z&&I(`rename`)}})]}):null,t[33]=I,t[34]=D,t[35]=a,t[36]=z,t[37]=m,t[38]=E.name,t[39]=g,t[40]=R,t[41]=G):G=t[41];let K;t[42]!==W||t[43]!==G?(K=(0,Q.jsxs)(j,{className:`min-h-0 flex-1 overflow-auto`,children:[W,G]}),t[42]=W,t[43]=G,t[44]=K):K=t[44];let q;t[45]!==I||t[46]!==v||t[47]!==D||t[48]!==z||t[49]!==m||t[50]!==E.name?(q=(0,Q.jsx)(M,{children:m?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y,{variant:`outline`,onClick:()=>h(!1),disabled:v,children:(0,Q.jsx)(s,{id:`iH8pgl`})}),(0,Q.jsx)(y,{onClick:()=>void I(`rename`),disabled:v||z,children:(0,Q.jsx)(s,{id:`AT0e50`})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y,{variant:`outline`,onClick:()=>{_(`${E.name}-${D}`),h(!0)},disabled:v,children:(0,Q.jsx)(s,{id:`AT0e50`})}),(0,Q.jsx)(y,{variant:`outline`,onClick:()=>void I(`make-source`),disabled:v,children:(0,Q.jsx)(s,{id:`xWomUD`,values:{editor:D}})}),(0,Q.jsx)(y,{onClick:()=>void I(`align`),disabled:v,children:(0,Q.jsx)(s,{id:`PZn2LP`})})]})}),t[45]=I,t[46]=v,t[47]=D,t[48]=z,t[49]=m,t[50]=E.name,t[51]=q):q=t[51];let J;t[52]!==U||t[53]!==K||t[54]!==q?(J=(0,Q.jsxs)(A,{className:`flex max-h-[85vh] w-full max-w-3xl flex-col`,children:[U,K,q]}),t[52]=U,t[53]=K,t[54]=q,t[55]=J):J=t[55];let Y;return t[56]!==J||t[57]!==B?(Y=(0,Q.jsx)(F,{open:!0,onOpenChange:B,children:J}),t[56]=J,t[57]=B,t[58]=Y):Y=t[58],Y}function Yi(e){let t=(0,$.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=Xe(),c=n!==null,l=(0,Z.useId)(),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.name)},t[0]=n,t[1]=m);let h=n?.scope,g=n?.name,_;if(t[2]!==h||t[3]!==g?(_=[h,g],t[2]=h,t[3]=g,t[4]=_):_=t[4],(0,Z.useEffect)(m,_),!n)return null;let v,b,x,S,C,w;if(t[5]!==r||t[6]!==u||t[7]!==n.name){C=u.trim(),w=C===n.name;let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\s/,t[14]=e):e=t[14];let i;t[15]===u?i=t[16]:(i=e.test(u),t[15]=u,t[16]=i),v=i,S=C.length>64,b=C===``||!Te.test(C)||S,x=!b&&!w&&r.has(C),t[5]=r,t[6]=u,t[7]=n.name,t[8]=v,t[9]=b,t[10]=x,t[11]=S,t[12]=C,t[13]=w}else v=t[8],b=t[9],x=t[10],S=t[11],C=t[12],w=t[13];let T=x,E=!b&&!T&&!w&&!f,D;t[17]!==E||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==C?(D=async function(){if(!n||!E)return;p(!0);let e=await o({scope:n.scope,name:n.name},C);p(!1),e.ok&&(a?.(C),i(!1))},t[17]=E,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=C,t[23]=D):D=t[23];let j=D,N;t[24]===i?N=t[25]:(N=e=>e?null:i(!1),t[24]=i,t[25]=N);let I;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(k,{children:(0,Q.jsx)(s,{id:`dw_3cv`})}),t[26]=I):I=t[26];let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsxs)(P,{children:[I,(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`R9IDFz`})})]}),t[27]=L):L=t[27];let R;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(s,{id:`6YtxFj`}),t[28]=R):R=t[28];let z;t[29]===l?z=t[30]:(z=(0,Q.jsx)(ue,{htmlFor:l,children:R}),t[29]=l,t[30]=z);let B;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>d(e.target.value),t[31]=B):B=t[31];let V;t[32]===j?V=t[33]:(V=e=>{e.key===`Enter`&&j()},t[32]=j,t[33]=V);let H=b||T,U=b&&C!==``||T?`${l}-error`:void 0,W;t[34]!==l||t[35]!==u||t[36]!==V||t[37]!==H||t[38]!==U?(W=(0,Q.jsx)(it,{id:l,value:u,onChange:B,onKeyDown:V,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,maxLength:64,"aria-invalid":H,"aria-describedby":U,className:`font-mono`}),t[34]=l,t[35]=u,t[36]=V,t[37]=H,t[38]=U,t[39]=W):W=t[39];let G;t[40]!==T||t[41]!==v||t[42]!==l||t[43]!==b||t[44]!==S||t[45]!==C?(G=b&&C!==``?(0,Q.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:v?(0,Q.jsx)(s,{id:`iUwpZI`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}}):S?(0,Q.jsx)(s,{id:`lK9c4T`}):(0,Q.jsx)(s,{id:`A50vr3`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}})}):T?(0,Q.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:(0,Q.jsx)(s,{id:`YJ1BTp`})}):null,t[40]=T,t[41]=v,t[42]=l,t[43]=b,t[44]=S,t[45]=C,t[46]=G):G=t[46];let K;t[47]!==z||t[48]!==W||t[49]!==G?(K=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[z,W,G]}),t[47]=z,t[48]=W,t[49]=G,t[50]=K):K=t[50];let q;t[51]===i?q=t[52]:(q=()=>i(!1),t[51]=i,t[52]=q);let J;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Q.jsx)(s,{id:`dEgA5A`}),t[53]=J):J=t[53];let Y;t[54]!==f||t[55]!==q?(Y=(0,Q.jsx)(y,{variant:`outline`,className:`font-mono uppercase`,onClick:q,disabled:f,children:J}),t[54]=f,t[55]=q,t[56]=Y):Y=t[56];let X;t[57]===j?X=t[58]:(X=()=>void j(),t[57]=j,t[58]=X);let ee=!E,te;t[59]===f?te=t[60]:(te=f?(0,Q.jsx)(s,{id:`tHKQ6j`}):(0,Q.jsx)(s,{id:`2wxgft`}),t[59]=f,t[60]=te);let ne;t[61]!==X||t[62]!==ee||t[63]!==te?(ne=(0,Q.jsx)(y,{onClick:X,disabled:ee,children:te}),t[61]=X,t[62]=ee,t[63]=te,t[64]=ne):ne=t[64];let re;t[65]!==Y||t[66]!==ne?(re=(0,Q.jsxs)(M,{children:[Y,ne]}),t[65]=Y,t[66]=ne,t[67]=re):re=t[67];let ie;t[68]!==K||t[69]!==re?(ie=(0,Q.jsxs)(A,{children:[L,K,re]}),t[68]=K,t[69]=re,t[70]=ie):ie=t[70];let ae;return t[71]!==c||t[72]!==ie||t[73]!==N?(ae=(0,Q.jsx)(F,{open:c,onOpenChange:N,children:ie}),t[71]=c,t[72]=ie,t[73]=N,t[74]=ae):ae=t[74],ae}function Xi(){let e=(0,$.c)(5),{_:t}=c(),n=gt(),r=Ye(),i=Ft(),a;return e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==i?(a=async(e,a)=>{if(a===e.scope)return!1;ft(e.scope,e.name);let o=await Mt({name:e.name,fromScope:e.scope,toScope:a});if(dt(e.scope,e.name),!o.ok)return rt.error(t({id:`07eGJB`,values:{0:o.error}})),!1;rt.success(t({id:`yhI6P0`,values:{0:e.name,1:n[a]}}));let s=i.status===`ready`?i.data.find(t=>t.scope===e.scope&&t.name===e.name):void 0;return r(s?ct(s):je(e.scope,e.name),a===`project`&&o.path!==void 0?`${o.path.replace(/\/+$/,``)}/SKILL`:je(a,e.name)),!0},e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Zi(e){let t=(0,$.c)(38),{target:n,onOpenChange:r}=e,i=gt(),a=Xi(),[o,c]=(0,Z.useState)(!1);if(!n)return null;let{scope:l,name:u,toScope:d}=n,f;t[0]!==o||t[1]!==r?(f=e=>!e&&!o&&r(!1),t[0]=o,t[1]=r,t[2]=f):f=t[2];let p=i[d],m;t[3]===p?m=t[4]:(m=(0,Q.jsx)(k,{children:(0,Q.jsx)(s,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[l],g=i[d],_=i[d],v;t[5]!==u||t[6]!==h||t[7]!==g||t[8]!==_?(v={0:h,1:g,2:_,name:u},t[5]=u,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b={0:(0,Q.jsx)(`code`,{className:`font-mono`})},t[10]=b):b=t[10];let x;t[11]===v?x=t[12]:(x=(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`7bIiJ7`,values:v,components:b})}),t[11]=v,t[12]=x);let S;t[13]!==m||t[14]!==x?(S=(0,Q.jsxs)(P,{children:[m,x]}),t[13]=m,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(s,{id:`dEgA5A`}),t[16]=C):C=t[16];let w;t[17]===o?w=t[18]:(w=(0,Q.jsx)(N,{asChild:!0,children:(0,Q.jsx)(y,{variant:`outline`,disabled:o,children:C})}),t[17]=o,t[18]=w);let T;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==l||t[23]!==d?(T=async()=>{c(!0),await a({scope:l,name:u},d),c(!1),r(!1)},t[19]=a,t[20]=u,t[21]=r,t[22]=l,t[23]=d,t[24]=T):T=t[24];let E;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(s,{id:`QWdKwH`}),t[25]=E):E=t[25];let D;t[26]!==o||t[27]!==T?(D=(0,Q.jsx)(y,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:T,children:E}),t[26]=o,t[27]=T,t[28]=D):D=t[28];let j;t[29]!==w||t[30]!==D?(j=(0,Q.jsxs)(M,{children:[w,D]}),t[29]=w,t[30]=D,t[31]=j):j=t[31];let I;t[32]!==S||t[33]!==j?(I=(0,Q.jsxs)(A,{className:`sm:max-w-md`,children:[S,j]}),t[32]=S,t[33]=j,t[34]=I):I=t[34];let L;return t[35]!==f||t[36]!==I?(L=(0,Q.jsx)(F,{open:!0,onOpenChange:f,children:I}),t[35]=f,t[36]=I,t[37]=L):L=t[37],L}function Qi(){let e=(0,$.c)(50),{_:t}=c(),n=It(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),[s,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),b;e[0]===t?b=e[1]:(b=async function(e,n,r){y(e.name);let i=await kt({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(y(null),!i.ok)return rt.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=$i,o=new Set(i.hosts),s=i.hosts.filter(t=>!e.hosts.includes(t)),c=e.hosts.filter(e=>!o.has(e)),l=e=>{let t=i.warningCodes.indexOf(e);return t>=0?i.warnings[t]:void 0},u=l(`no-targets`);if(u)return rt.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&rt.warning(e);let t=l(`no-description`);t&&rt.warning(t)}return i.hosts.length===0?rt.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?rt.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?rt.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?rt.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):rt.success(t({id:`wDgmsr`,values:{0:e.name,1:a(i.hosts)}})),i},e[0]=t,e[1]=b);let x=b,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e,t){if(t.length!==0){y(e.name);for(let{target:n,mode:r}of t){let t=await jt({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){rt.error(t.error);break}}y(null)}},e[2]=S):S=e[2];let C=S,w;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=async function(e,t){y(e.name);let n=await t();return y(null),n},e[3]=w):w=e[3];let T=w,E;e[4]!==t||e[5]!==n?(E=async function(e,r){let i=await Ct({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){rt.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}rt.success(t({id:`0g7rCZ`,values:{0:i.name}})),n(e.scope,i.name)},e[4]=t,e[5]=n,e[6]=E):E=e[6];let D=E,O,k;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{e||i(null)},k=()=>i(null),e[7]=O,e[8]=k):(O=e[7],k=e[8]);let A;e[9]===r?A=e[10]:(A=(0,Q.jsx)(Ui,{skill:r,onOpenChange:O,onDeleted:k}),e[9]=r,e[10]=A);let j=a?.skill??null,M=a?.existingNames??ta,N,P;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{e||o(null)},N=()=>o(null),e[11]=N,e[12]=P):(N=e[11],P=e[12]);let F;e[13]!==j||e[14]!==M?(F=(0,Q.jsx)(Yi,{skill:j,existingNames:M,onOpenChange:P,onRenamed:N}),e[13]=j,e[14]=M,e[15]=F):F=e[15];let I;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{e||l(null)},e[16]=I):I=e[16];let L;e[17]===s?L=e[18]:(L=(0,Q.jsx)(Zi,{target:s,onOpenChange:I}),e[17]=s,e[18]=L);let R;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{e||d(null)},e[19]=R):R=e[19];let z;e[20]===u?z=e[21]:(z=(0,Q.jsx)(qi,{target:u,onOpenChange:R}),e[20]=u,e[21]=z);let B;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{e||p(null)},e[22]=B):B=e[22];let V;e[23]===f?V=e[24]:(V=(0,Q.jsx)(Ki,{target:f,onOpenChange:B}),e[23]=f,e[24]=V);let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{e||h(null)},e[25]=H):H=e[25];let U;e[26]===m?U=e[27]:(U=(0,Q.jsx)(Gi,{target:m,onOpenChange:H}),e[26]=m,e[27]=U);let W;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{e||_(null)},e[28]=W):W=e[28];let G;e[29]===g?G=e[30]:(G=(0,Q.jsx)(Ji,{target:g,onOpenChange:W}),e[29]=g,e[30]=G);let K;e[31]!==F||e[32]!==L||e[33]!==z||e[34]!==V||e[35]!==U||e[36]!==G||e[37]!==A?(K=(0,Q.jsxs)(Q.Fragment,{children:[A,F,L,z,V,U,G]}),e[31]=F,e[32]=L,e[33]=z,e[34]=V,e[35]=U,e[36]=G,e[37]=A,e[38]=K):K=e[38];let q=K,J,Y,X,ee,te,ne;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(J=(e,t)=>o({skill:e,existingNames:t}),Y=(e,t)=>l({scope:e.scope,name:e.name,toScope:t}),X=(e,t)=>d({skill:e,filePath:t}),ee=(e,t)=>p({skill:e,filePath:t}),te=(e,t)=>h(t===void 0?{skill:e}:{skill:e,prefix:t}),ne=(e,t)=>_({skill:e,editor:t}),e[39]=J,e[40]=Y,e[41]=X,e[42]=ee,e[43]=te,e[44]=ne):(J=e[39],Y=e[40],X=e[41],ee=e[42],te=e[43],ne=e[44]);let re;return e[45]!==q||e[46]!==D||e[47]!==x||e[48]!==v?(re={installingName:v,install:x,convertLocations:C,runLocationWrite:T,duplicate:D,requestDelete:i,requestRename:J,requestScopeMove:Y,requestFileRename:X,requestFileDelete:ee,requestFileCreate:te,requestForkResolve:ne,dialogs:q},e[45]=q,e[46]=D,e[47]=x,e[48]=v,e[49]=re):re=e[49],re}function $i(e){return e.map(ea).join(`, `)}function ea(e){return Fe[e]??e}var ta=new Set;function na(e){let t=(0,$.c)(68),{skill:n,filePath:r,actions:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,{_:l}=c(),u=typeof window<`u`?window.okDesktop:void 0,d;t[0]!==r||t[1]!==n.absolutePath?(d=n.absolutePath?`${mt(n.absolutePath)}/${r}`:void 0,t[0]=r,t[1]=n.absolutePath,t[2]=d):d=t[2];let f=d,p;t[3]===n.path?p=t[4]:(p=mt(n.path),t[3]=n.path,t[4]=p);let m=`${p}/${r}`,h;t[5]===l?h=t[6]:(h=async function(e){try{await Lt(e),rt.success(l({id:`SXCSQd`}))}catch{rt.error(l({id:`cRHuuI`}))}},t[5]=l,t[6]=h);let g=h,_;t[7]!==i||t[8]!==r||t[9]!==n?(_=()=>i.requestFileRename(n,r),t[7]=i,t[8]=r,t[9]=n,t[10]=_):_=t[10];let v,y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(Bn,{"aria-hidden":!0}),y=(0,Q.jsx)(s,{id:`2wxgft`}),t[11]=v,t[12]=y):(v=t[11],y=t[12]);let b;t[13]!==o||t[14]!==_?(b=(0,Q.jsxs)(Yr,{menuKind:o,onSelect:_,children:[v,y]}),t[13]=o,t[14]=_,t[15]=b):b=t[15];let x;t[16]!==f||t[17]!==o?(x=u&&f?(0,Q.jsxs)(Yr,{menuKind:o,onSelect:()=>void u.shell.showItemInFolder(f),children:[(0,Q.jsx)(et,{"aria-hidden":!0}),(0,Q.jsx)(s,{id:`LtSYdi`})]}):null,t[16]=f,t[17]=o,t[18]=x):x=t[18];let S,C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)($e,{"aria-hidden":!0}),C=(0,Q.jsx)(s,{id:`zd00pH`}),t[19]=S,t[20]=C):(S=t[19],C=t[20]);let w;t[21]===o?w=t[22]:(w=(0,Q.jsxs)(ti,{menuKind:o,children:[S,C]}),t[21]=o,t[22]=w);let T;t[23]!==f||t[24]!==g||t[25]!==o?(T=f?(0,Q.jsx)(Yr,{menuKind:o,onSelect:()=>void g(f),children:(0,Q.jsx)(s,{id:`z2funE`})}):null,t[23]=f,t[24]=g,t[25]=o,t[26]=T):T=t[26];let E;t[27]!==g||t[28]!==m?(E=()=>void g(m),t[27]=g,t[28]=m,t[29]=E):E=t[29];let D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(s,{id:`xloBjn`}),t[30]=D):D=t[30];let O;t[31]!==o||t[32]!==E?(O=(0,Q.jsx)(Yr,{menuKind:o,onSelect:E,children:D}),t[31]=o,t[32]=E,t[33]=O):O=t[33];let k;t[34]!==o||t[35]!==T||t[36]!==O?(k=(0,Q.jsxs)(Jr,{menuKind:o,children:[T,O]}),t[34]=o,t[35]=T,t[36]=O,t[37]=k):k=t[37];let A;t[38]!==o||t[39]!==k?(A=(0,Q.jsx)(ei,{menuKind:o,children:k}),t[38]=o,t[39]=k,t[40]=A):A=t[40];let j;t[41]!==o||t[42]!==w||t[43]!==A?(j=(0,Q.jsxs)($r,{menuKind:o,children:[w,A]}),t[41]=o,t[42]=w,t[43]=A,t[44]=j):j=t[44];let M;t[45]!==o||t[46]!==j||t[47]!==b||t[48]!==x?(M=(0,Q.jsxs)(Jr,{menuKind:o,children:[b,x,j]}),t[45]=o,t[46]=j,t[47]=b,t[48]=x,t[49]=M):M=t[49];let N;t[50]===o?N=t[51]:(N=(0,Q.jsx)(Qr,{menuKind:o}),t[50]=o,t[51]=N);let P;t[52]!==i||t[53]!==r||t[54]!==n?(P=()=>i.requestFileDelete(n,r),t[52]=i,t[53]=r,t[54]=n,t[55]=P):P=t[55];let F,I;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(nt,{"aria-hidden":!0}),I=(0,Q.jsx)(s,{id:`cnGeoo`}),t[56]=F,t[57]=I):(F=t[56],I=t[57]);let L;t[58]!==o||t[59]!==P?(L=(0,Q.jsxs)(Yr,{menuKind:o,variant:`destructive`,onSelect:P,children:[F,I]}),t[58]=o,t[59]=P,t[60]=L):L=t[60];let R;t[61]!==o||t[62]!==L?(R=(0,Q.jsx)(Jr,{menuKind:o,children:L}),t[61]=o,t[62]=L,t[63]=R):R=t[63];let z;return t[64]!==M||t[65]!==N||t[66]!==R?(z=(0,Q.jsxs)(Q.Fragment,{children:[M,N,R]}),t[64]=M,t[65]=N,t[66]=R,t[67]=z):z=t[67],z}function ra(e){let t=(0,$.c)(15),{skill:n,actions:r,existingNames:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,s=f(),c=_().states,{dispatch:l}=Ir(),u=typeof window<`u`?window.okDesktop:void 0,d;t[0]!==n.name||t[1]!==n.scope||t[2]!==s?(d=yr({skillName:n.name,scope:n.scope,workspace:s}),t[0]=n.name,t[1]=n.scope,t[2]=s,t[3]=d):d=t[3];let p=d,m;t[4]!==l||t[5]!==p||t[6]!==c||t[7]!==o?(m=o===`context`?(0,Q.jsx)(Mi,{input:p,installStates:c,dispatch:l}):(0,Q.jsx)(Pi,{input:p,installStates:c,isElectronHost:u!=null,dispatch:l}),t[4]=l,t[5]=p,t[6]=c,t[7]=o,t[8]=m):m=t[8];let h;return t[9]!==r||t[10]!==i||t[11]!==o||t[12]!==n||t[13]!==m?(h=(0,Q.jsx)(ia,{actions:r,existingNames:i,menuKind:o,skill:n,openWithAi:m}),t[9]=r,t[10]=i,t[11]=o,t[12]=n,t[13]=m,t[14]=h):h=t[14],h}function ia(e){let t=(0,$.c)(124),{actions:n,existingNames:r,menuKind:a,openWithAi:o,skill:l}=e,{_:u}=c(),d=gt(),f=di(l,n),m=typeof window<`u`?window.okDesktop:void 0,h=l.absolutePath,g;t[0]===u?g=t[1]:(g=async function(e){try{await Lt(e),rt.success(u({id:`SXCSQd`}))}catch{rt.error(u({id:`cRHuuI`}))}},t[0]=u,t[1]=g);let _=g,v;t[2]!==h||t[3]!==a?(v=m&&h?(0,Q.jsxs)(Yr,{menuKind:a,onSelect:()=>void m.shell.showItemInFolder(h),children:[(0,Q.jsx)(et,{"aria-hidden":!0}),(0,Q.jsx)(s,{id:`LtSYdi`})]}):null,t[2]=h,t[3]=a,t[4]=v):v=t[4];let y,b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)($e,{"aria-hidden":!0}),b=(0,Q.jsx)(s,{id:`zd00pH`}),t[5]=y,t[6]=b):(y=t[5],b=t[6]);let x;t[7]===a?x=t[8]:(x=(0,Q.jsxs)(ti,{menuKind:a,children:[y,b]}),t[7]=a,t[8]=x);let S;t[9]!==h||t[10]!==_||t[11]!==a?(S=h?(0,Q.jsx)(Yr,{menuKind:a,onSelect:()=>void _(h),children:(0,Q.jsx)(s,{id:`z2funE`})}):null,t[9]=h,t[10]=_,t[11]=a,t[12]=S):S=t[12];let C;t[13]!==_||t[14]!==l.path?(C=()=>void _(l.path),t[13]=_,t[14]=l.path,t[15]=C):C=t[15];let w;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(s,{id:`xloBjn`}),t[16]=w):w=t[16];let T;t[17]!==a||t[18]!==C?(T=(0,Q.jsx)(Yr,{menuKind:a,onSelect:C,children:w}),t[17]=a,t[18]=C,t[19]=T):T=t[19];let E;t[20]!==a||t[21]!==S||t[22]!==T?(E=(0,Q.jsxs)(Jr,{menuKind:a,children:[S,T]}),t[20]=a,t[21]=S,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==a||t[25]!==E?(D=(0,Q.jsx)(ei,{menuKind:a,children:E}),t[24]=a,t[25]=E,t[26]=D):D=t[26];let O;t[27]!==a||t[28]!==D||t[29]!==x?(O=(0,Q.jsxs)($r,{menuKind:a,children:[x,D]}),t[27]=a,t[28]=D,t[29]=x,t[30]=O):O=t[30];let k;t[31]!==a||t[32]!==o||t[33]!==O||t[34]!==v?(k=(0,Q.jsxs)(Jr,{menuKind:a,children:[v,o,O]}),t[31]=a,t[32]=o,t[33]=O,t[34]=v,t[35]=k):k=t[35];let A;t[36]===a?A=t[37]:(A=(0,Q.jsx)(Qr,{menuKind:a}),t[36]=a,t[37]=A);let j;t[38]!==n||t[39]!==r||t[40]!==l?(j=()=>void n.duplicate(l,r),t[38]=n,t[39]=r,t[40]=l,t[41]=j):j=t[41];let M,N;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(i,{"aria-hidden":!0}),N=(0,Q.jsx)(s,{id:`euc6Ns`}),t[42]=M,t[43]=N):(M=t[42],N=t[43]);let P;t[44]!==a||t[45]!==j?(P=(0,Q.jsxs)(Yr,{menuKind:a,onSelect:j,children:[M,N]}),t[44]=a,t[45]=j,t[46]=P):P=t[46];let F;t[47]!==n||t[48]!==r||t[49]!==l?(F=()=>n.requestRename(l,r),t[47]=n,t[48]=r,t[49]=l,t[50]=F):F=t[50];let I,L;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(Bn,{"aria-hidden":!0}),L=(0,Q.jsx)(s,{id:`2wxgft`}),t[51]=I,t[52]=L):(I=t[51],L=t[52]);let R;t[53]!==a||t[54]!==F?(R=(0,Q.jsxs)(Yr,{menuKind:a,onSelect:F,children:[I,L]}),t[53]=a,t[54]=F,t[55]=R):R=t[55];let z;t[56]!==n||t[57]!==l?(z=()=>n.requestFileCreate(l),t[56]=n,t[57]=l,t[58]=z):z=t[58];let B,V;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(p,{"aria-hidden":!0}),V=(0,Q.jsx)(s,{id:`HdkSiO`}),t[59]=B,t[60]=V):(B=t[59],V=t[60]);let H;t[61]!==a||t[62]!==z?(H=(0,Q.jsxs)(Yr,{menuKind:a,onSelect:z,children:[B,V]}),t[61]=a,t[62]=z,t[63]=H):H=t[63];let U,W;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(Rn,{"aria-hidden":!0}),W=(0,Q.jsx)(s,{id:`TKQ7K-`}),t[64]=U,t[65]=W):(U=t[64],W=t[65]);let G;t[66]===a?G=t[67]:(G=(0,Q.jsxs)(ti,{menuKind:a,children:[U,W]}),t[66]=a,t[67]=G);let K;t[68]!==n||t[69]!==l?(K=e=>n.requestForkResolve(l,e),t[68]=n,t[69]=l,t[70]=K):K=t[70];let q;t[71]!==f||t[72]!==a||t[73]!==l||t[74]!==K?(q=(0,Q.jsx)(gi,{toggles:f,skill:l,menuKind:a,onResolveFork:K}),t[71]=f,t[72]=a,t[73]=l,t[74]=K,t[75]=q):q=t[75];let J;t[76]!==a||t[77]!==q?(J=(0,Q.jsx)(Jr,{menuKind:a,children:q}),t[76]=a,t[77]=q,t[78]=J):J=t[78];let Y;t[79]!==a||t[80]!==J?(Y=(0,Q.jsx)(ei,{menuKind:a,className:ui,children:J}),t[79]=a,t[80]=J,t[81]=Y):Y=t[81];let X;t[82]!==a||t[83]!==G||t[84]!==Y?(X=(0,Q.jsxs)($r,{menuKind:a,children:[G,Y]}),t[82]=a,t[83]=G,t[84]=Y,t[85]=X):X=t[85];let ee;t[86]!==n||t[87]!==l?(ee=()=>n.requestScopeMove(l,l.scope===`project`?`global`:`project`),t[86]=n,t[87]=l,t[88]=ee):ee=t[88];let te;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(Ln,{"aria-hidden":!0}),t[89]=te):te=t[89];let ne;t[90]!==d.global||t[91]!==d.project||t[92]!==l.scope?(ne=l.scope===`project`?(0,Q.jsx)(s,{id:`bpytj4`,values:{0:d.global}}):(0,Q.jsx)(s,{id:`bpytj4`,values:{0:d.project}}),t[90]=d.global,t[91]=d.project,t[92]=l.scope,t[93]=ne):ne=t[93];let re;t[94]!==a||t[95]!==ee||t[96]!==ne?(re=(0,Q.jsxs)(Yr,{menuKind:a,onSelect:ee,children:[te,ne]}),t[94]=a,t[95]=ee,t[96]=ne,t[97]=re):re=t[97];let ie;t[98]!==a||t[99]!==P||t[100]!==R||t[101]!==H||t[102]!==X||t[103]!==re?(ie=(0,Q.jsxs)(Jr,{menuKind:a,children:[P,R,H,X,re]}),t[98]=a,t[99]=P,t[100]=R,t[101]=H,t[102]=X,t[103]=re,t[104]=ie):ie=t[104];let ae;t[105]===a?ae=t[106]:(ae=(0,Q.jsx)(Qr,{menuKind:a}),t[105]=a,t[106]=ae);let oe;t[107]!==n||t[108]!==l?(oe=()=>n.requestDelete(l),t[107]=n,t[108]=l,t[109]=oe):oe=t[109];let se,ce;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Q.jsx)(nt,{"aria-hidden":!0}),ce=(0,Q.jsx)(s,{id:`cnGeoo`}),t[110]=se,t[111]=ce):(se=t[110],ce=t[111]);let le;t[112]!==a||t[113]!==oe?(le=(0,Q.jsxs)(Yr,{menuKind:a,variant:`destructive`,onSelect:oe,children:[se,ce]}),t[112]=a,t[113]=oe,t[114]=le):le=t[114];let ue;t[115]!==a||t[116]!==le?(ue=(0,Q.jsx)(Jr,{menuKind:a,children:le}),t[115]=a,t[116]=le,t[117]=ue):ue=t[117];let de;return t[118]!==k||t[119]!==A||t[120]!==ie||t[121]!==ae||t[122]!==ue?(de=(0,Q.jsxs)(Q.Fragment,{children:[k,A,ie,ae,ue]}),t[118]=k,t[119]=A,t[120]=ie,t[121]=ae,t[122]=ue,t[123]=de):de=t[123],de}export{Nr as A,Rr as C,mr as D,vr as E,ur as F,cr as I,Vn as L,jr as M,Ir as N,hr as O,pr as P,zn as R,Ur as S,gr as T,zr as _,Ri as a,Br as b,Mi as c,ui as d,gi as f,Vr as g,Gr as h,Zi as i,_r as j,Dr as k,ki as l,Lr as m,na as n,Bi as o,di as p,Qi as r,Pi as s,ra as t,li as u,Hr as v,br as w,Wr as x,qr as y,Ln as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./dist-Nvb76hAm.js";import{Sa as t,ga as n,kt as r,va as i}from"./dist-
|
|
1
|
+
import{r as e}from"./dist-Nvb76hAm.js";import{Sa as t,ga as n,kt as r,va as i}from"./dist-B1W6XlK32.js";function a(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var o=[`project`,`global`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}function c(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(t.length):e}function l(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function u(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function d(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):e}function f(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function p(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function m(e,t){if(e.includes(`/`))return t===`global`?`~/${e}`:e;let r=e===`agents`?`.agents/skills`:(t===`global`?i:n)[e]??`.${e}/skills`;return t===`global`?`~/${r}`:r}function h(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function g(e){let t=e.hostAliases??{},n=e=>e.split(`/`).slice(0,-1).join(`/`),r=new Set(e.hosts),i=new Set([...e.hosts.filter(e=>!e.includes(`/`)).map(t=>m(t,e.scope).replace(/^~\//,``)),...(e.customPlacements??[]).map(e=>n(e.path)),...e.path.includes(`/`)?[n(e.path.replace(/\/SKILL\.mdx?$/i,``))]:[]]);return Object.entries(t).filter(([e,t])=>!r.has(e)&&i.has(t)).map(([e])=>e)}function _(e){let t=new Set(e.symlinkedHosts??[]),n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({dir:e,symlink:t}))};i(l(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${m(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function v(e,t=e.hosts){let n=r.options,i=g(e);return[...t.includes(`agents`)?[`agents`]:[],...n.filter(e=>t.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>a(e))]}export{d as a,m as c,p as d,f,v as i,s as l,h as n,c as o,a as r,_ as s,o as t,u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jt as e}from"./dist-D0lKV18u2.js";import{t}from"./parse-api-error-BFe1cdS7.js";import{o as n}from"./documents-events-CZXYlWJs.js";async function r(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function i(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await r(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(e,t,n){try{let i=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return i.ok?{ok:!0,...await i.json().catch(()=>null)??{}}:{ok:!1,error:await r(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:i(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function s(){return i(`/api/skills/popular?limit=24`)}async function c(t,n){let r=await i(t?`/api/skills?scope=${t}`:`/api/skills`,n);if(!r.ok)return r;let{ok:a,...o}=r,s=e.safeParse(o);return s.success?{ok:!0,skills:s.data.skills}:{ok:!1,error:`The skills list did not match its schema.`}}async function l(e){return i(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function u(e,t){return i(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function d(e,t){return i(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function f(e,t){return i(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function p(){return i(`/api/skills/installed`)}async function m(e){try{let t=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let n=await t.json().catch(()=>null);return!n||typeof n.docName!=`string`?{ok:!1,error:`Server returned a malformed response.`}:{ok:!0,docName:n.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function h(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[],...typeof i?.path==`string`?{path:i.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok){let e=await r.json().catch(()=>null),n=t(e)??`HTTP ${r.status}`,i=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return i?{ok:!1,error:n,skills:i}:{ok:!1,error:n}}let i=await r.json().catch(()=>null);return!i||typeof i.name!=`string`?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,name:i.name,alreadyImported:i?.alreadyImported??!1,collisionRenamedFrom:i?.collisionRenamedFrom,warnings:i?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let t=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function v(e,t){try{let i=await fetch(`/api/skill-upload?scope=${encodeURIComponent(t)}`,{method:`POST`,body:e});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:`Server returned a malformed upload response.`}:(n(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function y(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function b(e){try{let t=y(e.name,e.existingNames),i=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:t})});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return typeof a?.name==`string`?(n(),{ok:!0,name:a.name}):{ok:!1,error:`Server returned a malformed duplicate response.`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function x(e){let{name:t,fromScope:i,toScope:a}=e;if(i===a)return{ok:!0,scope:a};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:i,toScope:a})});if(!e.ok)return{ok:!1,error:await r(e)};let o=await e.json().catch(()=>null);return n(),{ok:!0,scope:a,...typeof o?.path==`string`?{path:o.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function S(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,committed:i?.committed??!1,...typeof i?.to==`string`?{to:i.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function C(e,t){try{let i=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await r(a)};let o=await a.json().catch(()=>null);return n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(n(),{ok:!0}):t}async function T(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,path:i?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function E(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,from:i?.from??e.from,to:i?.to??e.to,...i?.fromDocName===void 0?{}:{fromDocName:i.fromDocName},...i?.toDocName===void 0?{}:{toDocName:i.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e){try{let t=new URLSearchParams({scope:e.scope,name:e.name,path:e.path}),i=await fetch(`/api/skill-file?${t.toString()}`,{method:`DELETE`});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return n(),{ok:!0,existed:a?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function O(e,t,n){try{let i=new URLSearchParams({name:t,scope:e,...n?{host:n}:{}}),a=await fetch(`/api/skill?${i.toString()}`);return a.ok?{ok:!0,files:(await a.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await r(a)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function k(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await r(n)};let i=await n.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function A(e,t){return k({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function j(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function M(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,placedAt:i?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function N(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(n(),{ok:!0}):t}async function P(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(n(),{ok:!0}):t}async function F(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(n(),{ok:!0}):t}async function I(e){try{let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});return t.ok?{ok:!0}:{ok:!1,error:await r(t)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function L(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return e.dryRun||n(),{ok:!0,updated:i?.updated??!1,source:i?.source??``,localBody:i?.localBody,upstreamBody:i?.upstreamBody,...i?.gitTracked===void 0?{}:{gitTracked:i.gitTracked},warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function R(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{v as A,w as C,o as D,h as E,P as O,E as S,R as T,S as _,b as a,I as b,l as c,g as d,_ as f,A as g,c as h,f as i,T as j,N as k,u as l,p as m,C as n,m as o,j as p,D as r,s,F as t,O as u,x as v,d as w,L as x,M as y};
|
|
1
|
+
import{jt as e}from"./dist-B1W6XlK32.js";import{t}from"./parse-api-error-BFe1cdS7.js";import{o as n}from"./documents-events-yek6VMZz.js";async function r(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function i(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await r(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(e,t,n){try{let i=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return i.ok?{ok:!0,...await i.json().catch(()=>null)??{}}:{ok:!1,error:await r(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:i(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function s(){return i(`/api/skills/popular?limit=24`)}async function c(t,n){let r=await i(t?`/api/skills?scope=${t}`:`/api/skills`,n);if(!r.ok)return r;let{ok:a,...o}=r,s=e.safeParse(o);return s.success?{ok:!0,skills:s.data.skills}:{ok:!1,error:`The skills list did not match its schema.`}}async function l(e){return i(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function u(e,t){return i(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function d(e,t){return i(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function f(e,t){return i(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function p(){return i(`/api/skills/installed`)}async function m(e){try{let t=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let n=await t.json().catch(()=>null);return!n||typeof n.docName!=`string`?{ok:!1,error:`Server returned a malformed response.`}:{ok:!0,docName:n.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function h(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[],...typeof i?.path==`string`?{path:i.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok){let e=await r.json().catch(()=>null),n=t(e)??`HTTP ${r.status}`,i=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return i?{ok:!1,error:n,skills:i}:{ok:!1,error:n}}let i=await r.json().catch(()=>null);return!i||typeof i.name!=`string`?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,name:i.name,alreadyImported:i?.alreadyImported??!1,collisionRenamedFrom:i?.collisionRenamedFrom,warnings:i?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let t=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function v(e,t){try{let i=await fetch(`/api/skill-upload?scope=${encodeURIComponent(t)}`,{method:`POST`,body:e});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:`Server returned a malformed upload response.`}:(n(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function y(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function b(e){try{let t=y(e.name,e.existingNames),i=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:t})});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return typeof a?.name==`string`?(n(),{ok:!0,name:a.name}):{ok:!1,error:`Server returned a malformed duplicate response.`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function x(e){let{name:t,fromScope:i,toScope:a}=e;if(i===a)return{ok:!0,scope:a};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:i,toScope:a})});if(!e.ok)return{ok:!1,error:await r(e)};let o=await e.json().catch(()=>null);return n(),{ok:!0,scope:a,...typeof o?.path==`string`?{path:o.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function S(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,committed:i?.committed??!1,...typeof i?.to==`string`?{to:i.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function C(e,t){try{let i=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await r(a)};let o=await a.json().catch(()=>null);return n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(n(),{ok:!0}):t}async function T(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,path:i?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function E(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,from:i?.from??e.from,to:i?.to??e.to,...i?.fromDocName===void 0?{}:{fromDocName:i.fromDocName},...i?.toDocName===void 0?{}:{toDocName:i.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e){try{let t=new URLSearchParams({scope:e.scope,name:e.name,path:e.path}),i=await fetch(`/api/skill-file?${t.toString()}`,{method:`DELETE`});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return n(),{ok:!0,existed:a?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function O(e,t,n){try{let i=new URLSearchParams({name:t,scope:e,...n?{host:n}:{}}),a=await fetch(`/api/skill?${i.toString()}`);return a.ok?{ok:!0,files:(await a.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await r(a)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function k(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await r(n)};let i=await n.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function A(e,t){return k({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function j(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function M(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,placedAt:i?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function N(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(n(),{ok:!0}):t}async function P(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(n(),{ok:!0}):t}async function F(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(n(),{ok:!0}):t}async function I(e){try{let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});return t.ok?{ok:!0}:{ok:!1,error:await r(t)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function L(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return e.dryRun||n(),{ok:!0,updated:i?.updated??!1,source:i?.source??``,localBody:i?.localBody,upstreamBody:i?.upstreamBody,...i?.gitTracked===void 0?{}:{gitTracked:i.gitTracked},warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function R(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{v as A,w as C,o as D,h as E,P as O,E as S,R as T,S as _,b as a,I as b,l as c,g as d,_ as f,A as g,c as h,f as i,T as j,N as k,u as l,p as m,C as n,m as o,j as p,D as r,s,F as t,O as u,x as v,d as w,L as x,M as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{R as e}from"./CodeMirrorPropInput-
|
|
1
|
+
import{R as e}from"./CodeMirrorPropInput-TJBj2ROv.js";import{$ as t,B as n,C as r,N as i,S as a,V as o,et as s,f as c,v as l,y as u,z as d}from"./config-provider-BxPJaWVp.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-zYQJXuRH.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(a(t.yanchor),a(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=u(a(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
|
|
2
2
|
`);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=g.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=_.define(),O=class extends f{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return d(`span`,[o(`class`,`cm-ySelectionCaret`),o(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[n(``),d(`div`,[o(`class`,`cm-ySelectionCaretDot`)]),n(``),d(`div`,[o(`class`,`cm-ySelectionInfo`)],[n(this.name)]),n(``)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let n=this.conf.ytext,i=n.doc,o=this.conf.awareness,c=[],d=this.conf.awareness.getLocalState();if(d!=null){let t=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=t?e.state.selection.main:null,s=d.cursor==null?null:a(d.cursor.anchor),c=d.cursor==null?null:a(d.cursor.head);if(i!=null){let e=r(n,i.anchor),t=r(n,i.head);(d.cursor==null||!l(s,e)||!l(c,t))&&o.setLocalStateField(`cursor`,{anchor:e,head:t})}else d.cursor!=null&&t&&o.setLocalStateField(`cursor`,null)}o.getStates().forEach((r,a)=>{if(a===o.doc.clientID)return;let l=r.cursor;if(l==null||l.anchor==null||l.head==null)return;let d=u(l.anchor,i),f=u(l.head,i);if(d==null||f==null||d.type!==n||f.type!==n)return;let{color:p=`#30bced`,name:h=`Anonymous`}=r.user||{},g=r.user&&r.user.colorLight||p+`33`,_=s(d.index,f.index),v=t(d.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)c.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{c.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),c.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}c.push({from:f.index,to:f.index,value:m.widget({side:f.index-d.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(c,!0)}},A=g.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=y.define({combine(e){return e[e.length-1]}});_.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=g.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R 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{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{i as o,n as ee,t as te}from"./tooltip-x7BNUa3s.js";import{Sr as ne}from"./dist-
|
|
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{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{i as o,n as ee,t as te}from"./tooltip-x7BNUa3s.js";import{Sr as ne}from"./dist-B1W6XlK32.js";import{t as re}from"./x-B3zGPHCO.js";import{t as ie}from"./badge-CnYDYmI5.js";var s=i(),c=e(n(),1),l=t();function u(e){let t=(0,s.c)(96),{value:n,onChange:i,onBlur:u,placeholder:d,id:f,disabled:p,grammar:ae,entryProblems:m,"aria-describedby":oe,"aria-invalid":se,ref:h}=e,ce=ae===void 0?`frontmatter-tag`:ae,{_:g}=r(),[_,le]=(0,c.useState)(``),[v,ue]=(0,c.useState)(null),[y,b]=(0,c.useState)(null),de=(0,c.useRef)(null),x;t[0]===h?x=t[1]:(x=e=>{de.current=e,typeof h==`function`?h(e):h&&(h.current=e)},t[0]=h,t[1]=x);let fe=x,[S,C]=(0,c.useState)(!1),pe=(0,c.useId)(),w=`${f??pe}-grammar-hint`,T=`${f??pe}-pill`,E;t[2]!==g||t[3]!==d?(E=d??g({id:`M5mfAe`}),t[2]=g,t[3]=d,t[4]=E):E=t[4];let me=E,D=ce===`frontmatter-tag`,O;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{le(``),C(!1),ue(null)},t[5]=O):O=t[5];let k=O,A;t[6]!==v||t[7]!==i||t[8]!==D||t[9]!==n?(A=e=>{let t=e.trim(),r=v===null?-1:n.indexOf(v);if(!t)return r!==-1&&i(n.filter((e,t)=>t!==r)),v!==null&&k(),!0;if(D&&!ne(t))return C(!0),!1;let a=D&&t.startsWith(`#`)?t.slice(1):t,o=n.indexOf(a);if(r===-1)return o===-1&&i([...n,a]),k(),!0;let ee=n.map((e,t)=>t===r?a:e);return i(o===-1||o===r?ee:ee.filter((e,t)=>t!==r)),k(),!0},t[6]=v,t[7]=i,t[8]=D,t[9]=n,t[10]=A):A=t[10];let j=A,M;t[11]!==i||t[12]!==n?(M=e=>{i(n.filter((t,n)=>n!==e))},t[11]=i,t[12]=n,t[13]=M):M=t[13];let N=M,P;t[14]!==j||t[15]!==p||t[16]!==_?(P=e=>{p||(_.trim()!==``&&j(_),le(e),C(!1),b(null),ue(e))},t[14]=j,t[15]=p,t[16]=_,t[17]=P):P=t[17];let F=P,I;t[18]!==y||t[19]!==n?(I=y===null?-1:n.indexOf(y),t[18]=y,t[19]=n,t[20]=I):I=t[20];let L=I,R;t[21]===n?R=t[22]:(R=e=>{b(e===null?null:n[e]??null)},t[21]=n,t[22]=R);let z=R,B,V;t[23]===v?(B=t[24],V=t[25]):(B=()=>{v!==null&&(de.current?.focus(),de.current?.select())},V=[v],t[23]=v,t[24]=B,t[25]=V),(0,c.useEffect)(B,V);let H=S?`true`:se,he=p&&`pointer-events-none opacity-60`,U;t[26]===he?U=t[27]:(U=a(`flex min-h-8 w-full flex-wrap items-center gap-1.5 rounded-lg border border-input bg-transparent px-2 py-1 text-sm transition-colors`,`focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,he),t[26]=he,t[27]=U);let W;if(t[28]!==g||t[29]!==F||t[30]!==p||t[31]!==v||t[32]!==m||t[33]!==y||t[34]!==T||t[35]!==N||t[36]!==D||t[37]!==n){let e;t[39]!==g||t[40]!==F||t[41]!==p||t[42]!==v||t[43]!==m||t[44]!==y||t[45]!==T||t[46]!==N||t[47]!==D?(e=(e,t)=>{if(e===v)return null;let n=D&&!ne(e),r=m?.get(e),i=n||r!==void 0,s=r??(n?`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`:void 0),c=e===y,u=(0,l.jsxs)(ie,{id:`${T}-${t}`,variant:i?`destructive`:`secondary`,"data-tag-invalid":n?`true`:void 0,"data-tag-problem":r===void 0?void 0:`true`,"data-highlighted":c?`true`:void 0,className:a(`gap-1 pl-2 pr-1 normal-case`,i&&`ring-1 ring-destructive/40`,c&&`ring-2 ring-ring/70`),children:[(0,l.jsx)(`button`,{type:`button`,tabIndex:-1,className:`cursor-pointer rounded-sm font-mono`,onDoubleClick:()=>F(e),disabled:p,"aria-label":g({id:`NkNfSr`,values:{tag:e}}),title:s===void 0?g({id:`vHlhDc`}):void 0,children:e}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>N(t),"aria-label":g({id:`D4H2N6`,values:{tag:e}}),className:`rounded-sm p-0.5 hover:bg-background/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,disabled:p,children:(0,l.jsx)(re,{className:`size-3`,"aria-hidden":`true`})})]},e);return s===void 0?u:(0,l.jsxs)(te,{children:[(0,l.jsx)(o,{asChild:!0,children:u}),(0,l.jsx)(ee,{children:s})]},e)},t[39]=g,t[40]=F,t[41]=p,t[42]=v,t[43]=m,t[44]=y,t[45]=T,t[46]=N,t[47]=D,t[48]=e):e=t[48],W=n.map(e),t[28]=g,t[29]=F,t[30]=p,t[31]=v,t[32]=m,t[33]=y,t[34]=T,t[35]=N,t[36]=D,t[37]=n,t[38]=W}else W=t[38];let G;t[49]!==S||t[50]!==y?(G=e=>{le(e.target.value),S&&C(!1),y!==null&&b(null)},t[49]=S,t[50]=y,t[51]=G):G=t[51];let K;t[52]!==j||t[53]!==F||t[54]!==_||t[55]!==S||t[56]!==v||t[57]!==z||t[58]!==L||t[59]!==N||t[60]!==n?(K=e=>{let t=e.currentTarget,r=t.selectionStart===0&&t.selectionEnd===0;if(v===null&&n.length>0){if(e.key===`ArrowLeft`&&(L!==-1||r)){e.preventDefault(),z(L===-1?n.length-1:Math.max(0,L-1));return}if(e.key===`ArrowRight`&&L!==-1){e.preventDefault(),z(L===n.length-1?null:L+1);return}if((e.key===`Home`||e.key===`End`)&&L!==-1){e.preventDefault(),z(e.key===`Home`?0:n.length-1);return}}if(L!==-1&&v===null){if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=n[L];t!==void 0&&F(t);return}if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let t=n[L-1]??null,r=n[L+1]??null;N(L),b(e.key===`Backspace`?t??r:r??t);return}}e.key===`Enter`?(_.trim()||v!==null)&&(e.preventDefault(),j(_)):e.key===`,`?(e.preventDefault(),_.trim()&&j(_)):e.key===`Tab`?_.trim()&&(e.preventDefault(),j(_)):e.key===`Backspace`&&_===``&&n.length>0&&v===null?(e.preventDefault(),N(n.length-1)):e.key===`Escape`&&(v!==null||S?(e.preventDefault(),k(),b(null)):L!==-1&&(e.preventDefault(),b(null)))},t[52]=j,t[53]=F,t[54]=_,t[55]=S,t[56]=v,t[57]=z,t[58]=L,t[59]=N,t[60]=n,t[61]=K):K=t[61];let q;t[62]!==j||t[63]!==_||t[64]!==v||t[65]!==u?(q=()=>{(_.trim()||v!==null)&&!j(_)&&v!==null&&k(),b(null),u?.()},t[62]=j,t[63]=_,t[64]=v,t[65]=u,t[66]=q):q=t[66];let ge=n.length===0?me:``,_e=S?`true`:void 0,J;t[67]!==oe||t[68]!==S||t[69]!==w?(J=[S?w:void 0,oe].filter(Boolean).join(` `)||void 0,t[67]=oe,t[68]=S,t[69]=w,t[70]=J):J=t[70];let ve=S?`true`:se,ye=L===-1?void 0:`${T}-${L}`,Y=S&&`text-destructive placeholder:text-destructive/60`,X;t[71]===Y?X=t[72]:(X=a(`min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`,Y),t[71]=Y,t[72]=X);let Z;t[73]!==fe||t[74]!==p||t[75]!==_||t[76]!==f||t[77]!==G||t[78]!==K||t[79]!==q||t[80]!==ge||t[81]!==_e||t[82]!==J||t[83]!==ve||t[84]!==ye||t[85]!==X?(Z=(0,l.jsx)(`input`,{id:f,ref:fe,type:`text`,value:_,onChange:G,onKeyDown:K,onBlur:q,placeholder:ge,"data-tag-invalid":_e,"aria-describedby":J,"aria-invalid":ve,"aria-activedescendant":ye,disabled:p,className:X}),t[73]=fe,t[74]=p,t[75]=_,t[76]=f,t[77]=G,t[78]=K,t[79]=q,t[80]=ge,t[81]=_e,t[82]=J,t[83]=ve,t[84]=ye,t[85]=X,t[86]=Z):Z=t[86];let Q;t[87]!==S||t[88]!==w?(Q=S&&(0,l.jsx)(`span`,{id:w,role:`alert`,"data-testid":`tag-pill-input-error`,className:`w-full px-1 pt-0.5 text-xs text-destructive`,children:`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`}),t[87]=S,t[88]=w,t[89]=Q):Q=t[89];let $;return t[90]!==H||t[91]!==U||t[92]!==W||t[93]!==Z||t[94]!==Q?($=(0,l.jsxs)(`div`,{"data-slot":`tag-pill-input`,"aria-invalid":H,className:U,children:[W,Z,Q]}),t[90]=H,t[91]=U,t[92]=W,t[93]=Z,t[94]=Q,t[95]=$):$=t[95],$}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./doc-paths-
|
|
1
|
+
import{m as e}from"./doc-paths-BPPZUgg6.js";import{s as t}from"./navigation-targets-BekPm3G2.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=t(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?e({scope:a.scope,name:a.name,path:a.path,...a.host?{host:a.host}:{}}):null,displayState:n(a)}}export{r as t};
|
package/dist/public/assets/{terminal-launch-events-CIEJD8Ca.js → terminal-launch-events-cjIUscHc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./utils-CPqDy6Hr.js";import{h as r,r as i,t as a}from"./agent-visibility-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./utils-CPqDy6Hr.js";import{h as r,r as i,t as a}from"./agent-visibility-BdUDvgZz.js";import{Pt as o}from"./dist-B1W6XlK32.js";import{t as s}from"./createLucideIcon-BbgVV4EV.js";import{_ as c,f as l,l as u}from"./sortable.esm-BT6d9PDz.js";var d=s(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ee=s(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),f=e(t(),1),p={},m=new Set;function h(){return p}function te(e){p={...p,...e};for(let e of m)e()}function g(e){return m.add(e),()=>{m.delete(e)}}function ne(){return(0,f.useSyncExternalStore)(g,h,h)}var _=null,v=new Set;function y(e,t){return e===null||t===null?e===t:e.id!==t.id||e.kind!==t.kind||e.label!==t.label?!1:e.kind===`thread`&&t.kind===`thread`?e.agentId===t.agentId&&e.iconUrl===t.iconUrl:e.kind===`terminal`&&t.kind===`terminal`?e.cli===t.cli:!1}function b(e){if(!y(_,e)){_=e;for(let e of v)e()}}function x(){return _}function S(e){return v.add(e),()=>{v.delete(e)}}function C(){return(0,f.useSyncExternalStore)(S,x,re)}function re(){return null}var w=`open-knowledge:active-terminal-input`;function ie(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent(w,{detail:{text:e,newTab:t?.newTab===!0,submit:t?.submit===!0}}))}function ae(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n!==void 0&&typeof n.text==`string`&&e({text:n.text,newTab:n.newTab===!0,submit:n.submit===!0})};return t.addEventListener(w,n),()=>t.removeEventListener(w,n)}var T=`ok-ask-ai-agent-v2`,E=`ok-ask-ai-default-agent-v1`,D=`ok-preferred-agent-v1`,O=`terminal-cli`;function k(e){return`${O}:${e}`}var A=`in-app-thread`;function j(e){return`${A}:${e.source}:${e.id}`}function M(e){if(e===null)return null;if(e===`in-app-thread`)return{kind:`default`};let t=`${A}:`;if(!e.startsWith(t))return null;let n=e.slice(t.length),r=n.indexOf(`:`);if(r<=0)return null;let i=n.slice(0,r),a=n.slice(r+1);return i!==`registry`&&i!==`custom`||a===``?null:{kind:`concrete`,source:i,id:a}}function N(e){return e===null?null:e===`terminal-cli`?`claude`:o.find(t=>e===k(t))??null}function P(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function F(e){let t=P(e);if(!t)return null;try{let e=t.getItem(T);return e===null?t.getItem(E)??t.getItem(D):e}catch{return null}}function I(e,t){let n=P(t);if(n)try{n.setItem(T,e)}catch(e){console.warn(`[ask-ai] Failed to persist default agent:`,e)}for(let e of L)e()}var L=new Set;function R(){return F()}function z(){for(let e of L)e()}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===`ok-ask-ai-agent-v2`||e.key===null)&&z()});function B(e){return L.add(e),()=>L.delete(e)}function V(){return(0,f.useSyncExternalStore)(B,R,R)}function H(e,t){return o.filter(n=>i(e,n,t))}function U(e){return r.filter(t=>a(e,t.id)).map(e=>e.id)}function W(e){let{sticky:t,effectiveThreadAgent:n,enabledClis:r,enabledDesktopTargets:i,installedClis:a,terminalAvailable:o,threadsAvailable:s,desktopSelectable:c,preferBareTerminal:l,bareTerminalFallback:u}=e;if(l&&o)return{kind:`terminal`};if(s&&M(t)!==null&&n!==null)return{kind:`thread`,agent:n};if(o){let e=N(t);if(e!==null&&r.includes(e))return{kind:`cli`,cli:e}}return c&&t!==null&&i.includes(t)?{kind:`desktop`,target:t}:s&&n!==null?{kind:`thread`,agent:n}:o&&r.length>0?{kind:`cli`,cli:r.find(e=>a[e]===!0)??r[0]}:c&&i.length>0?{kind:`desktop`,target:i[0]}:u&&o?{kind:`terminal`}:{kind:`none`}}var G=`flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,oe=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,K={start:[u.Space],cancel:[u.Esc],end:[u.Space,u.Enter]};function q(e){return n(G,e?`mr-1 opacity-100`:`pointer-events-none absolute right-1 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function se(e){return e?void 0:-1}function ce({className:e,isDragging:t}){return n(e,t&&oe)}function le(e){return e.code===u.Enter&&e.target===e.currentTarget}function ue(e){return e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`}function de(e,t,n){for(let r of e.querySelectorAll(`[data-editor-tab-id]`))if(r.dataset.editorPaneId===t&&r.dataset.editorTabId===n)return r;return null}function fe({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&le(e)?`activate-tab`:`delegate-sortable`}function pe({activeWidth:e,disableMovement:t=!1,isDragging:n,outerStyle:r,transform:i,transition:a}){let o=n&&e?e:void 0;return{...r,transform:t?void 0:c.Transform.toString(i?{...i,scaleX:1,scaleY:1}:null),transition:t?void 0:a,flexBasis:o??r?.flexBasis,maxWidth:o??r?.maxWidth,minWidth:o??r?.minWidth,opacity:r?.opacity,width:o??r?.width,zIndex:n?20:r?.zIndex}}function me(e,t){let n=e?.querySelectorAll(t)??[],r=1/0,i=-1/0;for(let e of n){let t=e.getBoundingClientRect();r=Math.min(r,t.left),i=Math.max(i,t.right)}return Number.isFinite(r)&&Number.isFinite(i)?{left:r,right:i}:null}function he(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}function J(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.kind===`editor-tab`&&typeof t.paneId==`string`&&typeof t.tabId==`string`&&typeof t.splittable==`boolean`&&typeof t.label==`string`}function ge(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.kind===`pane-edge`?typeof t.paneId==`string`&&(t.side===`left`||t.side===`right`):t.kind===`pane-strip`&&typeof t.paneId==`string`&&typeof t.index==`number`&&Number.isInteger(t.index)}function Y(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function X(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}var _e=e=>{let t=e.droppableContainers.filter(e=>e.data.current?.kind===`pane-edge`),n=e.droppableContainers.filter(e=>e.data.current?.kind!==`pane-edge`),r=e.active.data.current,i=e.pointerCoordinates;if(i&&J(r)&&r.splittable){let n=t.find(t=>{let n=e.droppableRects.get(t.id);return n?Y(i,n):!1});if(n)return[{id:n.id,data:{droppableContainer:n,value:0}}]}if(i){let t=n.filter(t=>{let n=e.droppableRects.get(t.id);return n?Y(i,n):!1});if(t.length>0){let n=t.filter(e=>J(e.data.current));return l({...e,droppableContainers:n.length>0?n:t})}let r=n.filter(t=>{let n=t.data.current,r=e.droppableRects.get(t.id);return n?.kind!==`pane-strip`||!r?!1:X(e.collisionRect,r)});if(r.length===0)return[];let a=new Set(r.map(e=>e.data.current?.paneId)),o=n.filter(t=>{let n=t.data.current,r=e.droppableRects.get(t.id);return!J(n)||!a.has(n.paneId)||!r?!1:X(e.collisionRect,r)});return l({...e,droppableContainers:o.length>0?o:r})}return l({...e,droppableContainers:n})},ve=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return l(e)};function ye(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}var Z=`open-knowledge:new-preferred-session`;function be(e=typeof window>`u`?new EventTarget:window){e.dispatchEvent(new CustomEvent(Z))}function Q(e,t=typeof window>`u`?new EventTarget:window){let n=()=>e();return t.addEventListener(Z,n),()=>t.removeEventListener(Z,n)}var $=`open-knowledge:terminal-launch`;function xe(e,t,n,r=typeof window>`u`?new EventTarget:window){r.dispatchEvent(new CustomEvent($,{detail:{prompt:e,cli:t,stage:n?.stage===!0}}))}function Se(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.prompt==`string`&&e(n.prompt,n.cli,{stage:n.stage===!0})};return t.addEventListener($,n),()=>t.removeEventListener($,n)}export{ie as A,A as C,k as D,I as E,ne as F,ee as I,d as L,b as M,C as N,j as O,te as P,W as S,N as T,me as _,ye as a,U as b,_e as c,fe as d,pe as f,ge as g,J as h,Q as i,ae as j,V as k,de as l,se as m,Se as n,K as o,q as p,be as r,he as s,xe as t,ce as u,ue as v,F as w,H as x,ve as y};
|
package/dist/public/assets/{terminal-telemetry-D3CzWhx2.js → terminal-telemetry-BoiP_PBP.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./useQuery-ZeEDLtxh.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{_ as i}from"./agent-visibility-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./useQuery-ZeEDLtxh.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{_ as i}from"./agent-visibility-BdUDvgZz.js";import{t as a}from"./trace-api-DH580DYm.js";var o=r(),s=e(t(),1);function c(e){let t=[`claude-acp`,`codex-acp`,`cursor`,`opencode`],n=e=>{let n=t.indexOf(e);return n===-1?t.length:n};return e.filter(e=>e.supported&&e.harness?.availability===`present`).sort((e,t)=>n(e.id)-n(t.id))}async function l(e){let t=await fetch(`/api/acp/catalog`,{signal:e??AbortSignal.timeout(2e4)});if(!t.ok)throw Error(`agent catalog request failed: HTTP ${t.status}`);let n=await t.json();return{agents:Array.isArray(n.agents)?n.agents:[],stale:n.stale===!0,maxThreads:typeof n.maxThreads==`number`?n.maxThreads:8}}function u(){let e=(0,o.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`acp-catalog`],queryFn:f,staleTime:3e5},e[0]=t):t=e[0];let{data:r}=n(t),a=r?.agents,c,l;e[1]===a?(c=e[2],l=e[3]):(c=()=>{a&&i(a.map(d))},l=[a],e[1]=a,e[2]=c,e[3]=l),(0,s.useEffect)(c,l)}function d(e){return{source:e.source,id:e.id,name:e.name,supported:e.supported,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}function f(e){let{signal:t}=e;return l(t)}var p=`open-knowledge-app`;function m(e){try{a.getTracer(p).startSpan(e).end()}catch(e){console.warn(`[terminal-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function h(){m(`ok.desktop.terminalOpened`)}function g(){m(`ok.desktop.shellConsentGranted`)}export{u as a,l as i,h as n,c as r,g as t};
|