@inkeep/open-knowledge 0.47.0-beta.2 → 0.47.0-beta.3

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.
Files changed (38) hide show
  1. package/dist/{acp-harness-probe-BYLCx-9P.mjs → acp-harness-probe-CeCTY-qL.mjs} +2 -2
  2. package/dist/cli.mjs +7 -7
  3. package/dist/constants-DKHR6SI6.mjs +2 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/{init-4qi6zG9S.mjs → init-BXglYch2.mjs} +3 -3
  6. package/dist/init-Bj3kNomz.mjs +1 -0
  7. package/dist/{launch-json-removal-CwrvAwfU.mjs → launch-json-removal-F1oyHtiZ.mjs} +2 -2
  8. package/dist/{loader-cuv9j2d2.mjs → loader-DLepRIUz.mjs} +2 -2
  9. package/dist/loader-ocfBqpBH.mjs +1 -0
  10. package/dist/{open-browser-4sOlBbCM.mjs → open-browser-CzH7K_gO.mjs} +2 -2
  11. package/dist/{preview-BQIDNBdK.mjs → preview-Cr60R7SV.mjs} +2 -2
  12. package/dist/preview-DbZ45oQ-.mjs +1 -0
  13. package/dist/public/assets/FeedbackForm-DVyMcsII.js +1 -0
  14. package/dist/public/assets/ManagedArtifactProperties-M8zFZm3f.js +1 -0
  15. package/dist/public/assets/{ManagedArtifactProperties-B-Y5eayN.js → ManagedArtifactProperties-q-xRNXgT.js} +1 -1
  16. package/dist/public/assets/{SkillToolbarControls-B4k3LXLX.js → SkillToolbarControls-CQRWLpT3.js} +1 -1
  17. package/dist/public/assets/{index-Bnezs-Zg.js → index-D6A3_yKx.js} +108 -108
  18. package/dist/public/assets/{skill-actions-By3ZQhYp.js → skill-actions-BpRp9hcI.js} +1 -1
  19. package/dist/public/index.html +3 -3
  20. package/dist/{repair-launch-json-BDkJpah_.mjs → repair-launch-json-BtQ1epg0.mjs} +2 -2
  21. package/dist/{repair-mcp-configs-DnQc3393.mjs → repair-mcp-configs-BF-zmoWp.mjs} +2 -2
  22. package/dist/repair-skills-BuqD6hC-.mjs +1 -0
  23. package/dist/{repair-skills-BikzcmQr.mjs → repair-skills-t2iYnlZp.mjs} +2 -2
  24. package/dist/{src-CGOjzQCL.mjs → src-8Ohw4otK.mjs} +1 -1
  25. package/dist/{src-CWDcUomk.mjs → src-BSAmyhAn.mjs} +201 -201
  26. package/dist/{src-Drda0pBn.mjs → src-Dh-kyKvP.mjs} +2 -2
  27. package/dist/start-C3pqqfG9.mjs +1 -0
  28. package/dist/{start-B8X4x2RR.mjs → start-DH_xwOSy.mjs} +3 -3
  29. package/dist/{write-project-skill-B8LGhuHT.mjs → write-project-skill-gCnhI-I2.mjs} +2 -2
  30. package/package.json +4 -4
  31. package/dist/constants-CHd7yi0X.mjs +0 -2
  32. package/dist/init-DVGGoG7U.mjs +0 -1
  33. package/dist/loader-Da51ptLu.mjs +0 -1
  34. package/dist/preview-CpHlywZf.mjs +0 -1
  35. package/dist/public/assets/FeedbackForm-FbNH_TYS.js +0 -1
  36. package/dist/public/assets/ManagedArtifactProperties-Ddk1e_f6.js +0 -1
  37. package/dist/repair-skills-CCM2p_7S.mjs +0 -1
  38. package/dist/start-CPV4EUy8.mjs +0 -1
@@ -1,2 +1,2 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{F as n,I as r,P as i,Pn as a,_n as o,i as s}from"./DocumentContext-B0g_vd8N.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{l as f}from"./terminal-input-events-BGPQuYMh.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./use-workspace-008C-zhL.js";import{c as h,i as g,n as _,o as v,s as y,t as b}from"./ChangedOutsideBadge-DVfCTGd2.js";import{t as x}from"./button-RQ5o7P7w.js";import{i as S,n as C,t as w}from"./tooltip-x7BNUa3s.js";import{a as T,c as E,i as D,n as O,o as ee,r as k,s as A,t as j}from"./dialog-FGMqkFjm.js";import{a as M,d as N,f as P,i as F,n as I,o as L,p as R,u as z}from"./dropdown-menu-AlVJ7dJz.js";import{t as te}from"./label-G0lbYOgL.js";import{C as B,a as V,f as H,h as U,m as W,n as G,o as K,p as q,r as J,s as Y,t as ne}from"./agent-visibility-CYBYXsoR.js";import{$t as X,Ba as re,Cn as ie,Ct as ae,Jt as oe,Nt as se,Pt as ce,Ra as le,Sn as ue,Ua as de,_n as fe,ai as pe,gn as me,ha as he,hn as ge,it as _e,kt as ve,mn as ye,nn as be,rt as xe,tn as Se,wn as Ce,xn as we,xr as Te,yn as Ee}from"./dist-DIn3VYDc2.js";import{t as De}from"./createLucideIcon-DihYAFEK.js";import{t as Oe}from"./RegisteredAgentIcon-H3tp7x07.js";import{n as ke,r as Ae}from"./ManagedArtifactProperties-B-Y5eayN.js";import{n as je}from"./CopyButton-D6N3opvE.js";import{t as Me}from"./folder-open-Ceue91os.js";import{t as Ne}from"./folder-DcWlgZbb.js";import{t as Pe}from"./trash-2-WxyktwvM.js";import{n as Z}from"./dist-uN7pEWl0.js";import{t as Fe}from"./input-Cm94Cun3.js";import{t as Ie}from"./dist-CzC3AWOn.js";import{i as Le}from"./use-settings-route-CYvmk4XT.js";import{t as Re}from"./parse-api-error-Dmlzsw8v.js";import{G as ze,O as Be,W as Ve}from"./navigation-targets-BDSeZX3c.js";import{c as He,n as Ue,o as We}from"./documents-events-FrlFXuC-.js";import{d as Ge,n as Ke,r as qe,s as Je}from"./skill-scope-DkGQeaIH.js";import{t as Ye}from"./badge-CAMtyz4F.js";import{A as Xe,D as Ze,O as Qe,S as $e,_ as et,c as tt,f as nt,i as rt,n as it,t as at,v as ot,x as st,y as ct}from"./skills-api-BCiYKVSk.js";import{n as lt}from"./config-context-CdjtvoAz.js";import{t as ut}from"./use-skills-B19yYlmR.js";import{t as dt}from"./use-open-skill-C3UqDa0B.js";import{n as ft}from"./clipboard-adapter-Brbch5VX.js";import{t as pt}from"./DiffView-BBC1fcoF.js";var mt=De(`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`}]]),ht=De(`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`}]]),gt=De(`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`}]]),_t=De(`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`}]]),vt=De(`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`}]]),Q=t(),$=e(c(),1),yt=d();function bt(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 xt(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=Re(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 St(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?bt(e):xt()}var Ct=`ok:skill:cowork:installed`,wt=`1`,Tt=250,Et=`/api/skill/install-state`;function Dt(e){return`${Ct}:v${e}`}var Ot=new Map;async function kt(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ot.get(n);if(r)return r;let i=At(e,t);return Ot.set(n,i),i.finally(()=>{Ot.get(n)===i&&Ot.delete(n)}),i}async function At(e,t){let n=e.installer===void 0?St():e.installer,r=jt(e.storage),i=e.fetchSnapshot??Nt,a=e.serverTimeoutMs??Tt,o=null;if(!t.force){try{o=await Pt(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=Dt(o?.currentVersion??e.fallbackSkillVersion??Mt());if(!t.force&&r?.getItem(s)===wt)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,wt)}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 jt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Mt(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Nt(){let e;try{e=await fetch(Et,{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 Pt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Ft(e){return kt({},e)}function It(){return kt({},{force:!0})}async function Lt(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 Rt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Lt({target:`claude-cowork`,url:X({mode:`cowork`},e)},n);case`claude-code`:return Lt({target:`claude-code`,url:X({mode:`code`},e)},n);case`codex`:return Lt({target:`codex`,url:Se(e)},n);case`cursor`:return Lt({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 zt(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)}`)}}var Bt=`open-knowledge:agent-thread-launch`;function Vt(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(Bt,{detail:e}))}function Ht(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(Bt,n),()=>t.removeEventListener(Bt,n)}function Ut(e){if(!e.docName||!e.workspace)return null;let t=i(e.docName),{contentDir:r,pathSeparator:a}=e.workspace;return{docContext:{relativePath:t},projectDir:r,docPath:n(r,t,a)}}function Wt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function Gt(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function Kt(e){return q(e.installUrl).then(()=>void 0)}function qt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Jt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function Yt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:r}=e.workspace;if(e.docName){let a=e.docRelativePath??i(e.docName),o={scope:`doc`,docRelativePath:a,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?o:{...o,selection:e.selection},projectDir:t,docPath:n(t,a,r)}}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 Xt(e){return`Opened in ${e}.`}function Zt(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 Qt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function $t(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 en(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 tn(e,t,n,r){return e.compose?oe(en(e.compose,t,n,r)):e.selection?we({...e.selection,target:t,transport:r}):e.skill?ue(e.skill.name,e.skill.scope,n):e.ask?ye(e.ask.relativePath,e.ask.instruction,n,t,r):pe(e.docContext===null?e.folderRelativePath?Ee(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?me(n,e.instruction,r):ge(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):fe(e.docContext.relativePath,n,e.instruction,r))}function nn(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${xe} ${tn(e,se[t].handoffTarget,!1,`terminal`)}`:ie(e.docContext?.relativePath??null)}function rn(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${_e} ${tn(e,`claude-code`,!1,`terminal`)}`:Ce(e.docContext?.relativePath??null)}function an(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function on(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 sn(e,t){Vt({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:rn(e),docName:an(e),titleHint:on(e)})}async function cn(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:tn(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=$t(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(Xt(u));else{let i=Qt(r),a=Zt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{cn(e,t,n,r+1)}}})}return a}function ln(e){return W.find(t=>t.id===e)?.displayName??e}function un(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function dn(){return{dispatchHandoff:Rt,recordHandoff:zt,toast:{success:e=>{Z.success(e)},error:(e,t)=>{Z.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>un(),getDisplayName:ln,ensureCoworkSkillInstalled:Ft,autoOpen:!0}}function fn(){let e=(0,yt.c)(2),{merged:t}=lt(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>cn(e,t,{...dn(),autoOpen:n}),reinstallCoworkSkill:It},e[0]=n,e[1]=r),r}var pn=Object.freeze({hosts:null,source:null}),mn=new Map,hn=new Map;function gn(e,t){return`${e}:${t}`}function _n(e){return mn.get(e)??pn}function vn(e,t){let n=hn.get(e)??new Set;return hn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&hn.delete(e)}}function yn(e,t){let n=_n(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?mn.delete(e):mn.set(e,r);for(let t of hn.get(e)??[])t()}}var bn=ve.options,xn=`min-w-[24rem]`;function Sn(e,t){let n=(0,yt.c)(45),r=t.installingName===e.name,i=(0,$.useRef)(e),[a,o]=(0,$.useState)(!1),s=(0,$.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,$.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,$.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=gn(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=>vn(m,e),g=()=>_n(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,$.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&&yn(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,$.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,$.useRef)(e.hosts),O,ee;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},ee=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=ee):(O=n[21],ee=n[22]),(0,$.useEffect)(O,ee);let k;n[23]===e.hosts?k=n[24]:(k=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=k);let A=k,j,M;n[25]!==m||n[26]!==A?(j=()=>{let e=_n(m).hosts;e&&[...e].sort().join(`,`)===A&&yn(m,{hosts:null})},M=[A,m],n[25]=m,n[26]=A,n[27]=j,n[28]=M):(j=n[27],M=n[28]),(0,$.useEffect)(j,M);let N=(0,$.useRef)(null),P=(0,$.useRef)(null),F,I;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>{N.current&&clearTimeout(N.current),P.current?.(),P.current=null},I=[],n[29]=F,n[30]=I):(F=n[29],I=n[30]),(0,$.useEffect)(F,I);let L;n[31]!==t||n[32]!==m||n[33]!==e?(L=function(n,r){D.current=n,yn(m,{hosts:n}),N.current&&clearTimeout(N.current);let i=async()=>{P.current=null,N.current=null;let r=await t.install(e,n.filter(Te));if(!r.ok){yn(m,{hosts:null});return}D.current=[...r.hosts],yn(m,{hosts:[...r.hosts]})};r?(P.current=()=>void i(),N.current=setTimeout(()=>void i(),350)):(P.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=L):L=n[34];let R=L,z;return n[35]!==t||n[36]!==R||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(z={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),R([...n],!0)},installAll(){let t=D.current.filter(Tn),n=e.installableEditors??bn,r=bn.filter(e=>n.includes(e)||D.current.includes(e));R([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>ot({scope:e.scope,name:e.name,dir:n,mode:r})).then(wn)},unplaceAt(n){t.runLocationWrite(e,()=>Qe({scope:e.scope,name:e.name,path:n})).then(Cn)},setSource(n){yn(m,{source:n}),t.runLocationWrite(e,()=>Ze({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(yn(m,{source:null}),Z.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=R,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=z):z=n[44],z}function Cn(e){e.ok||Z.error(e.error)}function wn(e){e.ok||Z.error(e.error)}function Tn(e){return!bn.includes(e)}function En(e){let t=(0,yt.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(S,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(C,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(w,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Dn(e){let t=(0,yt.c)(155),{toggles:n,skill:r,onResolveFork:i,onRunStart:a}=e,{_:o}=u(),{hostSet:s,toggleEditor:c,installAll:d}=n,f;t[0]===r?f=t[1]:(f=e=>r?`${Je(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=f);let p=f,m=ut(),h;t[2]!==m.data||t[3]!==m.status||t[4]!==r?(h=r!==void 0&&((r.hosts??[]).includes(`agents`)||m.status===`ready`&&m.data.some(zn)),t[2]=m.data,t[3]=m.status,t[4]=r,t[5]=h):h=t[5];let g=h,v;t[6]!==m.data||t[7]!==m.status||t[8]!==r?(v=r?.hostAliases??(r&&m.status===`ready`?Object.assign({},...m.data.filter(e=>e.scope===r.scope).map(Rn)):{}),t[6]=m.data,t[7]=m.status,t[8]=r,t[9]=v):v=t[9];let y=v,S;t[10]!==m.data||t[11]!==m.status||t[12]!==r?(S=r?.installableEditors??(r&&m.status===`ready`?m.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=m.data,t[11]=m.status,t[12]=r,t[13]=S):S=t[13];let C=S,w,T,E,D,O,ee,k;if(t[14]!==o||t[15]!==y||t[16]!==m.data||t[17]!==m.status||t[18]!==s||t[19]!==g||t[20]!==d||t[21]!==C||t[22]!==i||t[23]!==a||t[24]!==p||t[25]!==r||t[26]!==c||t[27]!==n){let e=C?new Set(C):null,u;t[35]===y?u=t[36]:(u=e=>!(e in y),t[35]=y,t[36]=u);let f=(g?[`agents`,...bn]:bn).filter(u).filter(t=>t===`agents`||e===null||e.has(t)||s.has(t)),h;t[37]===p?h=t[38]:(h=e=>p(e),t[37]=p,t[38]=h);let v=new Set(f.map(h)),S=r?.scope===`global`?`~/`:``,A;t[39]!==S||t[40]!==r?(A=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[39]=S,t[40]=r,t[41]=A):A=t[41];let j=A,M=j!==null&&!v.has(j)?j:null,N=M===null?n.sourceHost??r?.hosts?.[0]:void 0,P;t[42]===y?P=t[43]:(P=e=>Ke(y,e),t[42]=y,t[43]=P);let F=P,R=Ln,z;t[44]!==o||t[45]!==F?(z=e=>{let t=F(e);return t.length===0?!0:window.confirm(o({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},t[44]=o,t[45]=F,t[46]=z):z=t[46];let te=z,B;t[47]!==o||t[48]!==r?(B=(e,t)=>{let n=e.includes(`/`)?e:Je(e,r?.scope??`project`);return(0,Q.jsx)(En,{hint:o({id:`0dslv8`,values:{0:R(e),1:R(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":o({id:`G6Lrs_`,values:{0:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(o({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&ct({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?We():Z.error(o({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(_,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[47]=o,t[48]=r,t[49]=B):B=t[49];let V=B,H;t[50]===r?.conflictHosts?H=t[51]:(H=r?.conflictHosts??[],t[50]=r?.conflictHosts,t[51]=H);let U;t[52]===H?U=t[53]:(U=new Set(H),t[52]=H,t[53]=U);let W=U,G;t[54]===r?.driftPaths?G=t[55]:(G=r?.driftPaths??[],t[54]=r?.driftPaths,t[55]=G);let K;t[56]===G?K=t[57]:(K=new Set(G),t[56]=G,t[57]=K);let q=K;w=n.installing;let J=In,Y;t[58]===r?.symlinkedHosts?Y=t[59]:(Y=r?.symlinkedHosts??[],t[58]=r?.symlinkedHosts,t[59]=Y);let ne;t[60]===Y?ne=t[61]:(ne=new Set(Y),t[60]=Y,t[61]=ne);let X=ne,re=[...[...s].filter(e=>e!==N&&!(e in y)&&!W.has(e)&&!e.includes(`/`)).map(e=>X.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(Fn)],ie=re.filter(Pn).length;E=re.length===0?n.linkMode?`link`:`copy`:ie*2>=re.length?`link`:`copy`;let ae;t[62]!==y||t[63]!==W||t[64]!==s||t[65]!==X||t[66]!==p||t[67]!==N?(ae=[...s].filter(e=>e!==N&&!(e in y)&&!W.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:p(e)??R(e),mode:X.has(e)?`link`:`copy`})),t[62]=y,t[63]=W,t[64]=s,t[65]=X,t[66]=p,t[67]=N,t[68]=ae):ae=t[68];let oe;t[69]===r?.customPlacements?oe=t[70]:(oe=r?.customPlacements??[],t[69]=r?.customPlacements,t[70]=oe);let se;if(t[71]!==S||t[72]!==ae||t[73]!==oe){let e;t[75]===S?e=t[76]:(e=e=>({target:qe(e),display:`${S}${e.path}`,mode:e.mode}),t[75]=S,t[76]=e),se=[...ae,...oe.map(e)],t[71]=S,t[72]=ae,t[73]=oe,t[74]=se}else se=t[74];T=se;let ce;t[77]!==o||t[78]!==a||t[79]!==n?(ce=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(En,{hint:o(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(x,{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(o(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)(l,{id:`uUCrBv`}):(0,Q.jsx)(l,{id:`iaPtht`})})})},t[77]=o,t[78]=a,t[79]=n,t[80]=ce):ce=t[80];let le=ce,ue;t[81]===r?.customPlacements?ue=t[82]:(ue=r?.customPlacements??[],t[81]=r?.customPlacements,t[82]=ue);let de=new Map(ue.map(Nn)),fe=new Set(de.keys());if(m.status===`ready`&&r){for(let e of m.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=qe(t);e!==``&&fe.add(e)}}let pe=r===void 0?[]:[...fe].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:de.get(e)??null})).filter(e=>!v.has(e.display)&&e.display!==j&&!(e.root in y)),me;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Q.jsx)(l,{id:`npcziF`}),t[83]=me):me=t[83];let ge;t[84]===o?ge=t[85]:(ge=o({id:`6f_UX4`}),t[84]=o,t[85]=ge);let _e;t[86]===d?_e=t[87]:(_e=()=>d(),t[86]=d,t[87]=_e);let ve;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Q.jsx)(l,{id:`N40H-G`}),t[88]=ve):ve=t[88];let ye;t[89]!==w||t[90]!==_e?(ye=(0,Q.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:w,onClick:_e,"data-testid":`skill-install-all`,children:ve}),t[89]=w,t[90]=_e,t[91]=ye):ye=t[91],t[92]!==ge||t[93]!==ye?(D=(0,Q.jsxs)(L,{className:`flex items-center justify-between gap-2`,children:[me,(0,Q.jsx)(En,{hint:ge,children:ye})]}),t[92]=ge,t[93]=ye,t[94]=D):D=t[94],t[95]!==o||t[96]!==V||t[97]!==w||t[98]!==M||t[99]!==F?(O=M===null?null:(0,Q.jsx)(En,{hint:o({id:`pXB6SL`}),children:(0,Q.jsxs)(I,{disabled:w,checked:!0,onSelect:Mn,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(Ne,{"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:M}),(()=>{let e=J(M).split(`/`).slice(0,-1).join(`/`),t=F(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=>V(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)(l,{id:`tiFPjk`})})]})]})}),t[95]=o,t[96]=V,t[97]=w,t[98]=M,t[99]=F,t[100]=O):O=t[100];let be;t[101]!==o||t[102]!==V||t[103]!==w||t[104]!==te||t[105]!==W||t[106]!==le||t[107]!==q||t[108]!==E||t[109]!==s||t[110]!==X||t[111]!==i||t[112]!==p||t[113]!==r?.hosts||t[114]!==N||t[115]!==F||t[116]!==c||t[117]!==n?(be=e=>{let t=p(e),a=e===`agents`?`.agents`:he[e],u=J(t).split(`/`).slice(0,-1).join(`/`),d=F(u);return(0,Q.jsx)(En,{hint:W.has(e)?o({id:`8HvJlU`,values:{0:t??a}}):e===N?t?o({id:`ssk6rl`,values:{path:t}}):a:s.has(e)?o(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):o(t?E===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(I,{disabled:w,checked:s.has(e),onCheckedChange:t=>{W.has(e)||t===!0&&!te(u)||c(e,t===!0)},onSelect:jn,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(_,{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}),d.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:d.map(e=>V(e,u))}):null,W.has(e)?(0,Q.jsx)(En,{hint:o({id:`_O7dJS`}),children:(0,Q.jsx)(x,{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)(l,{id:`jng7Ko`})})}):e===N?(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)(l,{id:`tiFPjk`})}):s.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!w&&(X.has(e)?`link`:`copy`)!==E?le(e,t??a,X.has(e)?`link`:`copy`):null,(0,Q.jsx)(En,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(x,{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)(l,{id:`VNNRfN`})})})]}):null,!w&&q.has(J(t))?(0,Q.jsx)(En,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(b,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[101]=o,t[102]=V,t[103]=w,t[104]=te,t[105]=W,t[106]=le,t[107]=q,t[108]=E,t[109]=s,t[110]=X,t[111]=i,t[112]=p,t[113]=r?.hosts,t[114]=N,t[115]=F,t[116]=c,t[117]=n,t[118]=be):be=t[118],ee=f.map(be);let xe;t[119]!==o||t[120]!==V||t[121]!==w||t[122]!==te||t[123]!==le||t[124]!==q||t[125]!==E||t[126]!==F||t[127]!==n?(xe=e=>(0,Q.jsx)(En,{hint:e.placed===null?o(E===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):o({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(I,{disabled:w,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!te(e.root))return;n.placeAt(e.root,E)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:An,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(_,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(Ne,{"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}),F(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:F(e.root).map(t=>V(t,e.root))}):null,!w&&e.placed!==null&&q.has(e.placed.path)?(0,Q.jsx)(En,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(b,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!w&&e.placed.mode!==E?le(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(En,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(x,{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)(l,{id:`VNNRfN`})})})]})]})]})},e.root),t[119]=o,t[120]=V,t[121]=w,t[122]=te,t[123]=le,t[124]=q,t[125]=E,t[126]=F,t[127]=n,t[128]=xe):xe=t[128],k=pe.map(xe),t[14]=o,t[15]=y,t[16]=m.data,t[17]=m.status,t[18]=s,t[19]=g,t[20]=d,t[21]=C,t[22]=i,t[23]=a,t[24]=p,t[25]=r,t[26]=c,t[27]=n,t[28]=w,t[29]=T,t[30]=E,t[31]=D,t[32]=O,t[33]=ee,t[34]=k}else w=t[28],T=t[29],E=t[30],D=t[31],O=t[32],ee=t[33],k=t[34];let A;t[129]!==o||t[130]!==w||t[131]!==T||t[132]!==E||t[133]!==a||t[134]!==n?(A=T.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)(x,{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=E===`link`?`copy`:`link`,r=T.filter(e=>e.mode!==t);if(r.length===0)return;let i=o(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),s=o(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),c=r.map(kn).join(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{F as n,I as r,P as i,Pn as a,_n as o,i as s}from"./DocumentContext-B0g_vd8N.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{l as f}from"./terminal-input-events-BGPQuYMh.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./use-workspace-008C-zhL.js";import{c as h,i as g,n as _,o as v,s as y,t as b}from"./ChangedOutsideBadge-DVfCTGd2.js";import{t as x}from"./button-RQ5o7P7w.js";import{i as S,n as C,t as w}from"./tooltip-x7BNUa3s.js";import{a as T,c as E,i as D,n as O,o as ee,r as k,s as A,t as j}from"./dialog-FGMqkFjm.js";import{a as M,d as N,f as P,i as F,n as I,o as L,p as R,u as z}from"./dropdown-menu-AlVJ7dJz.js";import{t as te}from"./label-G0lbYOgL.js";import{C as B,a as V,f as H,h as U,m as W,n as G,o as K,p as q,r as J,s as Y,t as ne}from"./agent-visibility-CYBYXsoR.js";import{$t as X,Ba as re,Cn as ie,Ct as ae,Jt as oe,Nt as se,Pt as ce,Ra as le,Sn as ue,Ua as de,_n as fe,ai as pe,gn as me,ha as he,hn as ge,it as _e,kt as ve,mn as ye,nn as be,rt as xe,tn as Se,wn as Ce,xn as we,xr as Te,yn as Ee}from"./dist-DIn3VYDc2.js";import{t as De}from"./createLucideIcon-DihYAFEK.js";import{t as Oe}from"./RegisteredAgentIcon-H3tp7x07.js";import{n as ke,r as Ae}from"./ManagedArtifactProperties-q-xRNXgT.js";import{n as je}from"./CopyButton-D6N3opvE.js";import{t as Me}from"./folder-open-Ceue91os.js";import{t as Ne}from"./folder-DcWlgZbb.js";import{t as Pe}from"./trash-2-WxyktwvM.js";import{n as Z}from"./dist-uN7pEWl0.js";import{t as Fe}from"./input-Cm94Cun3.js";import{t as Ie}from"./dist-CzC3AWOn.js";import{i as Le}from"./use-settings-route-CYvmk4XT.js";import{t as Re}from"./parse-api-error-Dmlzsw8v.js";import{G as ze,O as Be,W as Ve}from"./navigation-targets-BDSeZX3c.js";import{c as He,n as Ue,o as We}from"./documents-events-FrlFXuC-.js";import{d as Ge,n as Ke,r as qe,s as Je}from"./skill-scope-DkGQeaIH.js";import{t as Ye}from"./badge-CAMtyz4F.js";import{A as Xe,D as Ze,O as Qe,S as $e,_ as et,c as tt,f as nt,i as rt,n as it,t as at,v as ot,x as st,y as ct}from"./skills-api-BCiYKVSk.js";import{n as lt}from"./config-context-CdjtvoAz.js";import{t as ut}from"./use-skills-B19yYlmR.js";import{t as dt}from"./use-open-skill-C3UqDa0B.js";import{n as ft}from"./clipboard-adapter-Brbch5VX.js";import{t as pt}from"./DiffView-BBC1fcoF.js";var mt=De(`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`}]]),ht=De(`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`}]]),gt=De(`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`}]]),_t=De(`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`}]]),vt=De(`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`}]]),Q=t(),$=e(c(),1),yt=d();function bt(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 xt(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=Re(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 St(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?bt(e):xt()}var Ct=`ok:skill:cowork:installed`,wt=`1`,Tt=250,Et=`/api/skill/install-state`;function Dt(e){return`${Ct}:v${e}`}var Ot=new Map;async function kt(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ot.get(n);if(r)return r;let i=At(e,t);return Ot.set(n,i),i.finally(()=>{Ot.get(n)===i&&Ot.delete(n)}),i}async function At(e,t){let n=e.installer===void 0?St():e.installer,r=jt(e.storage),i=e.fetchSnapshot??Nt,a=e.serverTimeoutMs??Tt,o=null;if(!t.force){try{o=await Pt(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=Dt(o?.currentVersion??e.fallbackSkillVersion??Mt());if(!t.force&&r?.getItem(s)===wt)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,wt)}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 jt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Mt(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Nt(){let e;try{e=await fetch(Et,{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 Pt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Ft(e){return kt({},e)}function It(){return kt({},{force:!0})}async function Lt(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 Rt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Lt({target:`claude-cowork`,url:X({mode:`cowork`},e)},n);case`claude-code`:return Lt({target:`claude-code`,url:X({mode:`code`},e)},n);case`codex`:return Lt({target:`codex`,url:Se(e)},n);case`cursor`:return Lt({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 zt(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)}`)}}var Bt=`open-knowledge:agent-thread-launch`;function Vt(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(Bt,{detail:e}))}function Ht(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(Bt,n),()=>t.removeEventListener(Bt,n)}function Ut(e){if(!e.docName||!e.workspace)return null;let t=i(e.docName),{contentDir:r,pathSeparator:a}=e.workspace;return{docContext:{relativePath:t},projectDir:r,docPath:n(r,t,a)}}function Wt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function Gt(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function Kt(e){return q(e.installUrl).then(()=>void 0)}function qt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Jt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function Yt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:r}=e.workspace;if(e.docName){let a=e.docRelativePath??i(e.docName),o={scope:`doc`,docRelativePath:a,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?o:{...o,selection:e.selection},projectDir:t,docPath:n(t,a,r)}}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 Xt(e){return`Opened in ${e}.`}function Zt(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 Qt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function $t(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 en(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 tn(e,t,n,r){return e.compose?oe(en(e.compose,t,n,r)):e.selection?we({...e.selection,target:t,transport:r}):e.skill?ue(e.skill.name,e.skill.scope,n):e.ask?ye(e.ask.relativePath,e.ask.instruction,n,t,r):pe(e.docContext===null?e.folderRelativePath?Ee(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?me(n,e.instruction,r):ge(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):fe(e.docContext.relativePath,n,e.instruction,r))}function nn(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${xe} ${tn(e,se[t].handoffTarget,!1,`terminal`)}`:ie(e.docContext?.relativePath??null)}function rn(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${_e} ${tn(e,`claude-code`,!1,`terminal`)}`:Ce(e.docContext?.relativePath??null)}function an(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function on(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 sn(e,t){Vt({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:rn(e),docName:an(e),titleHint:on(e)})}async function cn(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:tn(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=$t(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(Xt(u));else{let i=Qt(r),a=Zt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{cn(e,t,n,r+1)}}})}return a}function ln(e){return W.find(t=>t.id===e)?.displayName??e}function un(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function dn(){return{dispatchHandoff:Rt,recordHandoff:zt,toast:{success:e=>{Z.success(e)},error:(e,t)=>{Z.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>un(),getDisplayName:ln,ensureCoworkSkillInstalled:Ft,autoOpen:!0}}function fn(){let e=(0,yt.c)(2),{merged:t}=lt(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>cn(e,t,{...dn(),autoOpen:n}),reinstallCoworkSkill:It},e[0]=n,e[1]=r),r}var pn=Object.freeze({hosts:null,source:null}),mn=new Map,hn=new Map;function gn(e,t){return`${e}:${t}`}function _n(e){return mn.get(e)??pn}function vn(e,t){let n=hn.get(e)??new Set;return hn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&hn.delete(e)}}function yn(e,t){let n=_n(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?mn.delete(e):mn.set(e,r);for(let t of hn.get(e)??[])t()}}var bn=ve.options,xn=`min-w-[24rem]`;function Sn(e,t){let n=(0,yt.c)(45),r=t.installingName===e.name,i=(0,$.useRef)(e),[a,o]=(0,$.useState)(!1),s=(0,$.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,$.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,$.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=gn(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=>vn(m,e),g=()=>_n(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,$.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&&yn(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,$.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,$.useRef)(e.hosts),O,ee;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},ee=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=ee):(O=n[21],ee=n[22]),(0,$.useEffect)(O,ee);let k;n[23]===e.hosts?k=n[24]:(k=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=k);let A=k,j,M;n[25]!==m||n[26]!==A?(j=()=>{let e=_n(m).hosts;e&&[...e].sort().join(`,`)===A&&yn(m,{hosts:null})},M=[A,m],n[25]=m,n[26]=A,n[27]=j,n[28]=M):(j=n[27],M=n[28]),(0,$.useEffect)(j,M);let N=(0,$.useRef)(null),P=(0,$.useRef)(null),F,I;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>{N.current&&clearTimeout(N.current),P.current?.(),P.current=null},I=[],n[29]=F,n[30]=I):(F=n[29],I=n[30]),(0,$.useEffect)(F,I);let L;n[31]!==t||n[32]!==m||n[33]!==e?(L=function(n,r){D.current=n,yn(m,{hosts:n}),N.current&&clearTimeout(N.current);let i=async()=>{P.current=null,N.current=null;let r=await t.install(e,n.filter(Te));if(!r.ok){yn(m,{hosts:null});return}D.current=[...r.hosts],yn(m,{hosts:[...r.hosts]})};r?(P.current=()=>void i(),N.current=setTimeout(()=>void i(),350)):(P.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=L):L=n[34];let R=L,z;return n[35]!==t||n[36]!==R||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(z={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),R([...n],!0)},installAll(){let t=D.current.filter(Tn),n=e.installableEditors??bn,r=bn.filter(e=>n.includes(e)||D.current.includes(e));R([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>ot({scope:e.scope,name:e.name,dir:n,mode:r})).then(wn)},unplaceAt(n){t.runLocationWrite(e,()=>Qe({scope:e.scope,name:e.name,path:n})).then(Cn)},setSource(n){yn(m,{source:n}),t.runLocationWrite(e,()=>Ze({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(yn(m,{source:null}),Z.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=R,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=z):z=n[44],z}function Cn(e){e.ok||Z.error(e.error)}function wn(e){e.ok||Z.error(e.error)}function Tn(e){return!bn.includes(e)}function En(e){let t=(0,yt.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(S,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(C,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(w,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Dn(e){let t=(0,yt.c)(155),{toggles:n,skill:r,onResolveFork:i,onRunStart:a}=e,{_:o}=u(),{hostSet:s,toggleEditor:c,installAll:d}=n,f;t[0]===r?f=t[1]:(f=e=>r?`${Je(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=f);let p=f,m=ut(),h;t[2]!==m.data||t[3]!==m.status||t[4]!==r?(h=r!==void 0&&((r.hosts??[]).includes(`agents`)||m.status===`ready`&&m.data.some(zn)),t[2]=m.data,t[3]=m.status,t[4]=r,t[5]=h):h=t[5];let g=h,v;t[6]!==m.data||t[7]!==m.status||t[8]!==r?(v=r?.hostAliases??(r&&m.status===`ready`?Object.assign({},...m.data.filter(e=>e.scope===r.scope).map(Rn)):{}),t[6]=m.data,t[7]=m.status,t[8]=r,t[9]=v):v=t[9];let y=v,S;t[10]!==m.data||t[11]!==m.status||t[12]!==r?(S=r?.installableEditors??(r&&m.status===`ready`?m.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=m.data,t[11]=m.status,t[12]=r,t[13]=S):S=t[13];let C=S,w,T,E,D,O,ee,k;if(t[14]!==o||t[15]!==y||t[16]!==m.data||t[17]!==m.status||t[18]!==s||t[19]!==g||t[20]!==d||t[21]!==C||t[22]!==i||t[23]!==a||t[24]!==p||t[25]!==r||t[26]!==c||t[27]!==n){let e=C?new Set(C):null,u;t[35]===y?u=t[36]:(u=e=>!(e in y),t[35]=y,t[36]=u);let f=(g?[`agents`,...bn]:bn).filter(u).filter(t=>t===`agents`||e===null||e.has(t)||s.has(t)),h;t[37]===p?h=t[38]:(h=e=>p(e),t[37]=p,t[38]=h);let v=new Set(f.map(h)),S=r?.scope===`global`?`~/`:``,A;t[39]!==S||t[40]!==r?(A=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[39]=S,t[40]=r,t[41]=A):A=t[41];let j=A,M=j!==null&&!v.has(j)?j:null,N=M===null?n.sourceHost??r?.hosts?.[0]:void 0,P;t[42]===y?P=t[43]:(P=e=>Ke(y,e),t[42]=y,t[43]=P);let F=P,R=Ln,z;t[44]!==o||t[45]!==F?(z=e=>{let t=F(e);return t.length===0?!0:window.confirm(o({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},t[44]=o,t[45]=F,t[46]=z):z=t[46];let te=z,B;t[47]!==o||t[48]!==r?(B=(e,t)=>{let n=e.includes(`/`)?e:Je(e,r?.scope??`project`);return(0,Q.jsx)(En,{hint:o({id:`0dslv8`,values:{0:R(e),1:R(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":o({id:`G6Lrs_`,values:{0:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(o({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&ct({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?We():Z.error(o({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(_,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[47]=o,t[48]=r,t[49]=B):B=t[49];let V=B,H;t[50]===r?.conflictHosts?H=t[51]:(H=r?.conflictHosts??[],t[50]=r?.conflictHosts,t[51]=H);let U;t[52]===H?U=t[53]:(U=new Set(H),t[52]=H,t[53]=U);let W=U,G;t[54]===r?.driftPaths?G=t[55]:(G=r?.driftPaths??[],t[54]=r?.driftPaths,t[55]=G);let K;t[56]===G?K=t[57]:(K=new Set(G),t[56]=G,t[57]=K);let q=K;w=n.installing;let J=In,Y;t[58]===r?.symlinkedHosts?Y=t[59]:(Y=r?.symlinkedHosts??[],t[58]=r?.symlinkedHosts,t[59]=Y);let ne;t[60]===Y?ne=t[61]:(ne=new Set(Y),t[60]=Y,t[61]=ne);let X=ne,re=[...[...s].filter(e=>e!==N&&!(e in y)&&!W.has(e)&&!e.includes(`/`)).map(e=>X.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(Fn)],ie=re.filter(Pn).length;E=re.length===0?n.linkMode?`link`:`copy`:ie*2>=re.length?`link`:`copy`;let ae;t[62]!==y||t[63]!==W||t[64]!==s||t[65]!==X||t[66]!==p||t[67]!==N?(ae=[...s].filter(e=>e!==N&&!(e in y)&&!W.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:p(e)??R(e),mode:X.has(e)?`link`:`copy`})),t[62]=y,t[63]=W,t[64]=s,t[65]=X,t[66]=p,t[67]=N,t[68]=ae):ae=t[68];let oe;t[69]===r?.customPlacements?oe=t[70]:(oe=r?.customPlacements??[],t[69]=r?.customPlacements,t[70]=oe);let se;if(t[71]!==S||t[72]!==ae||t[73]!==oe){let e;t[75]===S?e=t[76]:(e=e=>({target:qe(e),display:`${S}${e.path}`,mode:e.mode}),t[75]=S,t[76]=e),se=[...ae,...oe.map(e)],t[71]=S,t[72]=ae,t[73]=oe,t[74]=se}else se=t[74];T=se;let ce;t[77]!==o||t[78]!==a||t[79]!==n?(ce=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(En,{hint:o(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(x,{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(o(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)(l,{id:`uUCrBv`}):(0,Q.jsx)(l,{id:`iaPtht`})})})},t[77]=o,t[78]=a,t[79]=n,t[80]=ce):ce=t[80];let le=ce,ue;t[81]===r?.customPlacements?ue=t[82]:(ue=r?.customPlacements??[],t[81]=r?.customPlacements,t[82]=ue);let de=new Map(ue.map(Nn)),fe=new Set(de.keys());if(m.status===`ready`&&r){for(let e of m.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=qe(t);e!==``&&fe.add(e)}}let pe=r===void 0?[]:[...fe].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:de.get(e)??null})).filter(e=>!v.has(e.display)&&e.display!==j&&!(e.root in y)),me;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Q.jsx)(l,{id:`npcziF`}),t[83]=me):me=t[83];let ge;t[84]===o?ge=t[85]:(ge=o({id:`6f_UX4`}),t[84]=o,t[85]=ge);let _e;t[86]===d?_e=t[87]:(_e=()=>d(),t[86]=d,t[87]=_e);let ve;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Q.jsx)(l,{id:`N40H-G`}),t[88]=ve):ve=t[88];let ye;t[89]!==w||t[90]!==_e?(ye=(0,Q.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:w,onClick:_e,"data-testid":`skill-install-all`,children:ve}),t[89]=w,t[90]=_e,t[91]=ye):ye=t[91],t[92]!==ge||t[93]!==ye?(D=(0,Q.jsxs)(L,{className:`flex items-center justify-between gap-2`,children:[me,(0,Q.jsx)(En,{hint:ge,children:ye})]}),t[92]=ge,t[93]=ye,t[94]=D):D=t[94],t[95]!==o||t[96]!==V||t[97]!==w||t[98]!==M||t[99]!==F?(O=M===null?null:(0,Q.jsx)(En,{hint:o({id:`pXB6SL`}),children:(0,Q.jsxs)(I,{disabled:w,checked:!0,onSelect:Mn,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(Ne,{"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:M}),(()=>{let e=J(M).split(`/`).slice(0,-1).join(`/`),t=F(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=>V(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)(l,{id:`tiFPjk`})})]})]})}),t[95]=o,t[96]=V,t[97]=w,t[98]=M,t[99]=F,t[100]=O):O=t[100];let be;t[101]!==o||t[102]!==V||t[103]!==w||t[104]!==te||t[105]!==W||t[106]!==le||t[107]!==q||t[108]!==E||t[109]!==s||t[110]!==X||t[111]!==i||t[112]!==p||t[113]!==r?.hosts||t[114]!==N||t[115]!==F||t[116]!==c||t[117]!==n?(be=e=>{let t=p(e),a=e===`agents`?`.agents`:he[e],u=J(t).split(`/`).slice(0,-1).join(`/`),d=F(u);return(0,Q.jsx)(En,{hint:W.has(e)?o({id:`8HvJlU`,values:{0:t??a}}):e===N?t?o({id:`ssk6rl`,values:{path:t}}):a:s.has(e)?o(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):o(t?E===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(I,{disabled:w,checked:s.has(e),onCheckedChange:t=>{W.has(e)||t===!0&&!te(u)||c(e,t===!0)},onSelect:jn,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(_,{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}),d.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:d.map(e=>V(e,u))}):null,W.has(e)?(0,Q.jsx)(En,{hint:o({id:`_O7dJS`}),children:(0,Q.jsx)(x,{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)(l,{id:`jng7Ko`})})}):e===N?(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)(l,{id:`tiFPjk`})}):s.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!w&&(X.has(e)?`link`:`copy`)!==E?le(e,t??a,X.has(e)?`link`:`copy`):null,(0,Q.jsx)(En,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(x,{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)(l,{id:`VNNRfN`})})})]}):null,!w&&q.has(J(t))?(0,Q.jsx)(En,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(b,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[101]=o,t[102]=V,t[103]=w,t[104]=te,t[105]=W,t[106]=le,t[107]=q,t[108]=E,t[109]=s,t[110]=X,t[111]=i,t[112]=p,t[113]=r?.hosts,t[114]=N,t[115]=F,t[116]=c,t[117]=n,t[118]=be):be=t[118],ee=f.map(be);let xe;t[119]!==o||t[120]!==V||t[121]!==w||t[122]!==te||t[123]!==le||t[124]!==q||t[125]!==E||t[126]!==F||t[127]!==n?(xe=e=>(0,Q.jsx)(En,{hint:e.placed===null?o(E===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):o({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(I,{disabled:w,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!te(e.root))return;n.placeAt(e.root,E)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:An,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(_,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(Ne,{"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}),F(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:F(e.root).map(t=>V(t,e.root))}):null,!w&&e.placed!==null&&q.has(e.placed.path)?(0,Q.jsx)(En,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(b,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!w&&e.placed.mode!==E?le(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(En,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(x,{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)(l,{id:`VNNRfN`})})})]})]})]})},e.root),t[119]=o,t[120]=V,t[121]=w,t[122]=te,t[123]=le,t[124]=q,t[125]=E,t[126]=F,t[127]=n,t[128]=xe):xe=t[128],k=pe.map(xe),t[14]=o,t[15]=y,t[16]=m.data,t[17]=m.status,t[18]=s,t[19]=g,t[20]=d,t[21]=C,t[22]=i,t[23]=a,t[24]=p,t[25]=r,t[26]=c,t[27]=n,t[28]=w,t[29]=T,t[30]=E,t[31]=D,t[32]=O,t[33]=ee,t[34]=k}else w=t[28],T=t[29],E=t[30],D=t[31],O=t[32],ee=t[33],k=t[34];let A;t[129]!==o||t[130]!==w||t[131]!==T||t[132]!==E||t[133]!==a||t[134]!==n?(A=T.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)(x,{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=E===`link`?`copy`:`link`,r=T.filter(e=>e.mode!==t);if(r.length===0)return;let i=o(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),s=o(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),c=r.map(kn).join(`
2
2
  `);window.confirm(`${i}\n\n${s}\n\n${c}\n\n${o({id:`Cu6GXQ`})}`)&&(a?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:w,"data-testid":`skill-convert-all`,children:E===`link`?(0,Q.jsx)(l,{id:`rcJmK8`}):(0,Q.jsx)(l,{id:`LBv_TR`})}),(0,Q.jsx)(En,{hint:o({id:`0J6nhG`}),children:(0,Q.jsx)(x,{variant:`ghost`,size:`sm`,"aria-label":o({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:On,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[129]=o,t[130]=w,t[131]=T,t[132]=E,t[133]=a,t[134]=n,t[135]=A):A=t[135];let j;t[136]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(z,{}),t[136]=j):j=t[136];let N;t[137]===o?N=t[138]:(N=o({id:`jqe7Yq`}),t[137]=o,t[138]=N);let P;t[139]===r?.scope?P=t[140]:(P=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[139]=r?.scope,t[140]=P);let F,R;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(vt,{"aria-hidden":!0}),R=(0,Q.jsx)(l,{id:`ZBF9fn`}),t[141]=F,t[142]=R):(F=t[141],R=t[142]);let te;t[143]===P?te=t[144]:(te=(0,Q.jsxs)(M,{onSelect:P,children:[F,R]}),t[143]=P,t[144]=te);let B;t[145]!==N||t[146]!==te?(B=(0,Q.jsx)(En,{hint:N,children:te}),t[145]=N,t[146]=te,t[147]=B):B=t[147];let V;return t[148]!==B||t[149]!==D||t[150]!==O||t[151]!==ee||t[152]!==k||t[153]!==A?(V=(0,Q.jsxs)(Q.Fragment,{children:[D,O,ee,k,A,j,B]}),t[148]=B,t[149]=D,t[150]=O,t[151]=ee,t[152]=k,t[153]=A,t[154]=V):V=t[154],V}function On(e){return e.preventDefault()}function kn(e){return e.display}function An(e){return e.preventDefault()}function jn(e){return e.preventDefault()}function Mn(e){return e.preventDefault()}function Nn(e){return[qe(e),e]}function Pn(e){return e===`link`}function Fn(e){return e.mode}function In(e){return(e??``).replace(/^~\//,``)}function Ln(e){return e===`agents`?`.agents`:he[e]??e}function Rn(e){return e.hostAliases??{}}function zn(e){return e.hosts.includes(`agents`)||e.path.startsWith(`.agents/`)}function Bn(e){let t=(0,yt.c)(23),{onAddProperty:n,className:r,problemCount:i,problemMessages:a}=e,o=i===void 0?0:i,{_:s}=u(),c=o>0,d;t[0]!==s||t[1]!==c||t[2]!==o?(d=s(c?{id:`3KOHFt`,values:{problemCount:o}}:{id:`81H_23`}),t[0]=s,t[1]=c,t[2]=o,t[3]=d):d=t[3];let f=d,m;t[4]===r?m=t[5]:(m=p(`relative`,r),t[4]=r,t[5]=m);let h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(gt,{}),t[6]=h):h=t[6];let g;t[7]!==c||t[8]!==o?(g=c?(0,Q.jsx)(Ye,{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]=c,t[8]=o,t[9]=g):g=t[9];let _;t[10]===g?_=t[11]:(_=(0,Q.jsxs)(S,{children:[h,g]}),t[10]=g,t[11]=_);let v;t[12]!==f||t[13]!==n||t[14]!==m||t[15]!==_?(v=(0,Q.jsx)(x,{variant:`ghost`,size:`icon`,"aria-label":f,onClick:n,"data-testid":`add-properties-button`,className:m,asChild:!0,children:_}),t[12]=f,t[13]=n,t[14]=m,t[15]=_,t[16]=v):v=t[16];let y;t[17]!==c||t[18]!==a?(y=(0,Q.jsx)(C,{side:`bottom`,children:c?(0,Q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:(0,Q.jsx)(l,{id:`AwrGuz`})}),a?.map(Vn)]}):(0,Q.jsx)(l,{id:`81H_23`})}),t[17]=c,t[18]=a,t[19]=y):y=t[19];let b;return t[20]!==v||t[21]!==y?(b=(0,Q.jsxs)(w,{children:[v,y]}),t[20]=v,t[21]=y,t[22]=b):b=t[22],b}function Vn(e,t){return(0,Q.jsx)(`span`,{className:`opacity-90`,children:e},t)}function Hn(e){return e?Ie._({id:`wTcjov`}):null}function Un(e){let t=(0,yt.c)(47),{_:n}=u(),i=r(),a=v(),s=B(),c=H();if(i)return null;let{input:d,installStates:p,dispatch:m,onBeforeLaunch:h}=e,g=d===null,_,y,b,x,S,C,w,T,E,D,O;if(t[0]!==n||t[1]!==m||t[2]!==d||t[3]!==g||t[4]!==p||t[5]!==h||t[6]!==c||t[7]!==s||t[8]!==a){let e=Hn(g),r;t[20]===c?r=t[21]:(r=e=>ne(c,e.id),t[20]=c,t[21]=r);let i=U.filter(r),u;t[22]===c?u=t[23]:(u=e=>G(c,e.source,e.id,!0,e.supported),t[22]=c,t[23]=u);let f=s.filter(u),v=a?ce.filter(e=>J(c,e,a.installedClis)):[];b=i.length>0,x=a!==null&&v.length>0,S=f.length>0,y=N,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsxs)(R,{children:[(0,Q.jsx)(o,{"aria-hidden":`true`}),(0,Q.jsx)(l,{id:`O7_W_a`})]}),t[24]=O):O=t[24],_=P,C=`max-h-80`,w=S?(0,Q.jsxs)(F,{"aria-label":n({id:`vPKX2i`}),children:[(0,Q.jsxs)(L,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(l,{id:`RXEbZy`}),(0,Q.jsx)(Y,{})]}),f.map(t=>{let r=t.name;return(0,Q.jsxs)(M,{onSelect:()=>{d!==null&&(h?.(),sn(d,{agent:{source:t.source,id:t.id}}))},disabled:g,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:r,hint:e}}):void 0,children:[(0,Q.jsx)(Oe,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(l,{id:`5PrrYw`,values:{agentName:r}})}),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)(z,{}):null,t[25]=b,t[26]=x,t[27]=S,t[28]=T):T=t[28],E=x?(0,Q.jsxs)(F,{"aria-label":n({id:`ALhMYW`}),children:[(0,Q.jsx)(L,{children:(0,Q.jsx)(l,{id:`ALhMYW`})}),v.map(t=>{let{displayName:r}=se[t];return(0,Q.jsxs)(M,{onSelect:()=>{d!==null&&(h?.(),a.launchInTerminal(d,t))},disabled:g,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Q.jsx)(K,{id:V(t),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:r}),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)(z,{}):null,(0,Q.jsxs)(F,{"aria-label":n({id:`BBqGS9`}),children:[(0,Q.jsx)(L,{children:(0,Q.jsx)(l,{id:`BBqGS9`})}),i.map(t=>{let r=!g,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Q.jsxs)(M,{disabled:!r,onSelect:()=>{if(d){if(h?.(),p[t.id]?.installed!==!0){Kt(t);return}m(t.id,d)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Q.jsx)(K,{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]=n,t[1]=m,t[2]=d,t[3]=g,t[4]=p,t[5]=h,t[6]=c,t[7]=s,t[8]=a,t[9]=_,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 _=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 ee;t[29]!==b||t[30]!==x||t[31]!==S?(ee=S||x||b?(0,Q.jsx)(z,{}):null,t[29]=b,t[30]=x,t[31]=S,t[32]=ee):ee=t[32];let k;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(f,{"aria-hidden":`true`}),t[33]=k):k=t[33];let A;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsxs)(M,{onSelect:Le,"data-testid":`file-tree-open-in-settings`,children:[k,(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(l,{id:`jRAGrQ`})})]}),t[34]=A):A=t[34];let j;t[35]!==_||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==D||t[41]!==ee?(j=(0,Q.jsxs)(_,{className:C,children:[w,T,E,D,ee,A]}),t[35]=_,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=ee,t[42]=j):j=t[42];let I;return t[43]!==y||t[44]!==O||t[45]!==j?(I=(0,Q.jsxs)(y,{children:[O,j]}),t[43]=y,t[44]=O,t[45]=j,t[46]=I):I=t[46],I}function Wn(e){let t=re(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=le(e);return n?{scope:`global`,name:n.name,rel:n.rel}:null}function Gn(e,t,n){return e.filter(e=>{let r=Be(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=Wn(r.docName);return i?.scope===t&&i.name===n})}function Kn(e,t){let n=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),r=[];for(let t of e){let e=Wn(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:ze(a)}):r.push({kind:`close`,docName:t})}return r}function qn(){let e=(0,yt.c)(15),{openTabs:t,closeDocument:n}=s(),r=ke(),i;e[0]===t?i=e[1]:(i=t.some(Yn),e[0]=t,e[1]=i);let a=i,o;e[2]===a?o=e[3]:(o={enabled:a},e[2]=a,e[3]=o);let c=ut(o),l=(0,$.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(Jn).sort().join(``)}`;if(l.current===i)return;l.current=i;let a=Kn(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,$.useEffect)(u,d)}function Jn(e){return`${e.scope}\u0000${e.name}`}function Yn(e){return Wn(e)!==null}function Xn(e){let t=(0,yt.c)(19),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:a}=u(),{setSkillsSidebar:o,closeTabs:c,openTabs:l}=s(),[d,f]=(0,$.useState)(!1),p;t[0]!==a||t[1]!==c||t[2]!==i||t[3]!==r||t[4]!==l||t[5]!==o?(p=async function(e){o(!0),f(!0);let t=await it(e.scope,e.name);if(f(!1),!t.ok){let{error:e}=t;Z.error(a({id:`AtBdnD`,values:{error:e}}));return}Z.success(a({id:`h9QFb9`,values:{0:e.name}})),c(Gn(l,e.scope,e.name),{force:!0}),i(),r(!1)},t[0]=a,t[1]=c,t[2]=i,t[3]=r,t[4]=l,t[5]=o,t[6]=p):p=t[6];let m=p,h=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]!==a||t[11]!==d||t[12]!==m||t[13]!==n?(v=n?(0,Q.jsx)(g,{itemName:a({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:d,onDelete:()=>m(n),customDescription:n.origin?.source&&/\/plugins\/(?:cache|marketplaces)\//.test(n.origin.source)?a({id:`WnsbUT`,values:{0:n.path}}):a({id:`E1Da_b`,values:{0:n.path}})}):null,t[10]=a,t[11]=d,t[12]=m,t[13]=n,t[14]=v):v=t[14];let y;return t[15]!==h||t[16]!==_||t[17]!==v?(y=(0,Q.jsx)(j,{open:h,onOpenChange:_,children:v}),t[15]=h,t[16]=_,t[17]=v,t[18]=y):y=t[18],y}function Zn(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 Qn(e){let t=(0,yt.c)(66),{target:n,onOpenChange:r}=e,{_:i}=u(),{openTarget:a}=s(),o=(0,$.useId)(),[c,d]=(0,$.useState)(``),[f,p]=(0,$.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,$.useEffect)(m,v),!n)return null;let y,b,S,C;t[6]!==c||t[7]!==f?(C=c.trim(),b=C===``||!Zn(C),y=!b&&!f,S=C.includes(`/`)?C.split(`/`).slice(0,-1).join(`/`):null,t[6]=c,t[7]=f,t[8]=y,t[9]=b,t[10]=S,t[11]=C):(y=t[8],b=t[9],S=t[10],C=t[11]);let w=S,O;t[12]!==i||t[13]!==y||t[14]!==r||t[15]!==a||t[16]!==n||t[17]!==C?(O=async function(){if(!n||!y)return;p(!0);let e=/\.mdx?$/i.test(C),t=await Xe({scope:n.skill.scope,name:n.skill.name,path:C,content:e?`# ${C.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){Z.error(i({id:`a_2_uB`,values:{0:t.error,trimmed:C}}));return}if(Z.success(i({id:`MXSt4t`,values:{0:t.path}})),e){let e=Ve(n.skill,C);a({kind:`doc`,target:e,docName:e})}r(!1)},t[12]=i,t[13]=y,t[14]=r,t[15]=a,t[16]=n,t[17]=C,t[18]=O):O=t[18];let k=O,M;t[19]!==r||t[20]!==f?(M=e=>{!e&&!f&&r(!1)},t[19]=r,t[20]=f,t[21]=M):M=t[21];let N;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(E,{children:(0,Q.jsx)(l,{id:`wQvvZY`})}),t[22]=N):N=t[22];let P;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsxs)(A,{children:[N,(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`lM4c-I`})})]}),t[23]=P):P=t[23];let F;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(l,{id:`I6gXOa`}),t[24]=F):F=t[24];let I;t[25]===o?I=t[26]:(I=(0,Q.jsx)(te,{htmlFor:o,children:F}),t[25]=o,t[26]=I);let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>d(e.target.value),t[27]=L):L=t[27];let R=b&&C!==``,z;t[28]===k?z=t[29]:(z=e=>{e.key===`Enter`&&k()},t[28]=k,t[29]=z);let B;t[30]!==o||t[31]!==c||t[32]!==R||t[33]!==z?(B=(0,Q.jsx)(Fe,{id:o,value:c,onChange:L,placeholder:`references/notes.md`,"aria-invalid":R,onKeyDown:z}),t[30]=o,t[31]=c,t[32]=R,t[33]=z,t[34]=B):B=t[34];let V;t[35]!==w||t[36]!==b||t[37]!==C?(V=b&&C!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(l,{id:`fVzizW`})}):w?(0,Q.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,Q.jsx)(l,{id:`9lso1Y`,values:{folderPart:w},components:{0:(0,Q.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null,t[35]=w,t[36]=b,t[37]=C,t[38]=V):V=t[38];let H;t[39]!==I||t[40]!==B||t[41]!==V?(H=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[I,B,V]}),t[39]=I,t[40]=B,t[41]=V,t[42]=H):H=t[42];let U;t[43]===r?U=t[44]:(U=()=>r(!1),t[43]=r,t[44]=U);let W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(l,{id:`dEgA5A`}),t[45]=W):W=t[45];let G;t[46]!==f||t[47]!==U?(G=(0,Q.jsx)(x,{variant:`outline`,onClick:U,disabled:f,children:W}),t[46]=f,t[47]=U,t[48]=G):G=t[48];let K;t[49]===k?K=t[50]:(K=()=>void k(),t[49]=k,t[50]=K);let q=!y,J;t[51]===f?J=t[52]:(J=f?(0,Q.jsx)(l,{id:`E9bKSA`}):(0,Q.jsx)(l,{id:`hYgDIe`}),t[51]=f,t[52]=J);let Y;t[53]!==K||t[54]!==q||t[55]!==J?(Y=(0,Q.jsx)(x,{onClick:K,disabled:q,children:J}),t[53]=K,t[54]=q,t[55]=J,t[56]=Y):Y=t[56];let ne;t[57]!==G||t[58]!==Y?(ne=(0,Q.jsxs)(ee,{children:[G,Y]}),t[57]=G,t[58]=Y,t[59]=ne):ne=t[59];let X;t[60]!==H||t[61]!==ne?(X=(0,Q.jsxs)(D,{className:`sm:max-w-md`,children:[P,H,ne]}),t[60]=H,t[61]=ne,t[62]=X):X=t[62];let re;return t[63]!==X||t[64]!==M?(re=(0,Q.jsx)(j,{open:!0,onOpenChange:M,children:X}),t[63]=X,t[64]=M,t[65]=re):re=t[65],re}function $n(e){let t=(0,yt.c)(64),{target:n,onOpenChange:r}=e,{_:i}=u(),a=ke(),o=(0,$.useId)(),[s,c]=(0,$.useState)(``),[d,f]=(0,$.useState)(!1),p;t[0]===n?p=t[1]:(p=()=>{n&&c(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,$.useEffect)(p,_),!n)return null;let v,y,b;t[6]!==s||t[7]!==n.filePath?(y=s.trim(),b=y===n.filePath,v=y===``||!Zn(y),t[6]=s,t[7]=n.filePath,t[8]=v,t[9]=y,t[10]=b):(v=t[8],y=t[9],b=t[10]);let S=v,C=!S&&!b&&!d,w;t[11]!==i||t[12]!==C||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==y?(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:y});if(f(!1),!e.ok){Z.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),Z.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]=y,t[17]=w):w=t[17];let O=w,k;t[18]!==r||t[19]!==d?(k=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=k):k=t[20];let M;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(E,{children:(0,Q.jsx)(l,{id:`yckias`})}),t[21]=M):M=t[21];let N;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsxs)(A,{children:[M,(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`HzVAoz`})})]}),t[22]=N):N=t[22];let P;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(l,{id:`I6gXOa`}),t[23]=P):P=t[23];let F;t[24]===o?F=t[25]:(F=(0,Q.jsx)(te,{htmlFor:o,children:P}),t[24]=o,t[25]=F);let I;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>c(e.target.value),t[26]=I):I=t[26];let L=S&&y!==``,R;t[27]===O?R=t[28]:(R=e=>{e.key===`Enter`&&O()},t[27]=O,t[28]=R);let z;t[29]!==o||t[30]!==s||t[31]!==L||t[32]!==R?(z=(0,Q.jsx)(Fe,{id:o,value:s,onChange:I,"aria-invalid":L,onKeyDown:R}),t[29]=o,t[30]=s,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==S||t[35]!==y?(B=S&&y!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(l,{id:`fVzizW`})}):null,t[34]=S,t[35]=y,t[36]=B):B=t[36];let V;t[37]!==F||t[38]!==z||t[39]!==B?(V=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[F,z,B]}),t[37]=F,t[38]=z,t[39]=B,t[40]=V):V=t[40];let H;t[41]===r?H=t[42]:(H=()=>r(!1),t[41]=r,t[42]=H);let U;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(l,{id:`dEgA5A`}),t[43]=U):U=t[43];let W;t[44]!==d||t[45]!==H?(W=(0,Q.jsx)(x,{variant:`outline`,onClick:H,disabled:d,children:U}),t[44]=d,t[45]=H,t[46]=W):W=t[46];let G;t[47]===O?G=t[48]:(G=()=>void O(),t[47]=O,t[48]=G);let K=!C,q;t[49]===d?q=t[50]:(q=d?(0,Q.jsx)(l,{id:`tHKQ6j`}):(0,Q.jsx)(l,{id:`2wxgft`}),t[49]=d,t[50]=q);let J;t[51]!==G||t[52]!==K||t[53]!==q?(J=(0,Q.jsx)(x,{onClick:G,disabled:K,children:q}),t[51]=G,t[52]=K,t[53]=q,t[54]=J):J=t[54];let Y;t[55]!==W||t[56]!==J?(Y=(0,Q.jsxs)(ee,{children:[W,J]}),t[55]=W,t[56]=J,t[57]=Y):Y=t[57];let ne;t[58]!==V||t[59]!==Y?(ne=(0,Q.jsxs)(D,{className:`sm:max-w-md`,children:[N,V,Y]}),t[58]=V,t[59]=Y,t[60]=ne):ne=t[60];let X;return t[61]!==ne||t[62]!==k?(X=(0,Q.jsx)(j,{open:!0,onOpenChange:k,children:ne}),t[61]=ne,t[62]=k,t[63]=X):X=t[63],X}function er(e){let t=(0,yt.c)(59),{target:n,onOpenChange:r}=e,{_:i}=u(),a=(0,$.useId)(),[o,s]=(0,$.useState)(null),[c,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(!1),[m,h]=(0,$.useState)(!1),[g,_]=(0,$.useState)(``),[v,y]=(0,$.useState)(!1),b;t[0]===n?b=t[1]:(b=()=>{if(s(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}/${Je(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,d],[a,s]])tt({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]=b);let S=n?.skill.scope,C=n?.skill.name,w=n?.editor,k;if(t[2]!==S||t[3]!==C||t[4]!==w?(k=[S,C,w],t[2]=S,t[3]=C,t[4]=w,t[5]=k):k=t[5],(0,$.useEffect)(b,k),!n)return null;let{skill:M,editor:N}=n,P;t[6]!==i||t[7]!==N||t[8]!==r||t[9]!==M.name||t[10]!==M.scope||t[11]!==n||t[12]!==g?(P=async function(e){if(!n)return;y(!0);let t=await $e({scope:M.scope,name:M.name,editor:N,action:e,...e===`rename`?{toName:g.trim()}:{}});if(y(!1),!t.ok){Z.error(i({id:`MIF36T`,values:{0:t.error}}));return}Z.success(i(e===`align`?{id:`QKgePK`,values:{editor:N}}:e===`make-source`?{id:`It9oAP`,values:{editor:N}}:{id:`b2ezG_`,values:{0:g.trim()}})),r(!1)},t[6]=i,t[7]=N,t[8]=r,t[9]=M.name,t[10]=M.scope,t[11]=n,t[12]=g,t[13]=P):P=t[13];let F=P,I,L;t[14]!==M.name||t[15]!==g?(L=g.trim(),I=L===``||!ae.test(L)||L===M.name,t[14]=M.name,t[15]=g,t[16]=I,t[17]=L):(I=t[16],L=t[17]);let R=I,z;t[18]!==v||t[19]!==r?(z=e=>{!e&&!v&&r(!1)},t[18]=v,t[19]=r,t[20]=z):z=t[20];let B;t[21]!==N||t[22]!==M.name?(B=(0,Q.jsx)(E,{children:(0,Q.jsx)(l,{id:`q8aCbb`,values:{0:M.name,editor:N}})}),t[21]=N,t[22]=M.name,t[23]=B):B=t[23];let V;t[24]===N?V=t[25]:(V=(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`QASTNu`,values:{editor:N}})}),t[24]=N,t[25]=V);let H;t[26]!==V||t[27]!==B?(H=(0,Q.jsxs)(A,{children:[B,V]}),t[26]=V,t[27]=B,t[28]=H):H=t[28];let U;t[29]!==c||t[30]!==o||t[31]!==f?(U=c!==null&&o!==null?(0,Q.jsx)(pt,{oldContent:c,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)(l,{id:`5BlXTD`})}):(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,Q.jsx)(l,{id:`1V17kO`})}),t[29]=c,t[30]=o,t[31]=f,t[32]=U):U=t[32];let W;t[33]!==F||t[34]!==N||t[35]!==a||t[36]!==R||t[37]!==m||t[38]!==M.name||t[39]!==g||t[40]!==L?(W=m?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Q.jsx)(te,{htmlFor:a,children:(0,Q.jsx)(l,{id:`pSimwP`,values:{editor:N}})}),(0,Q.jsx)(Fe,{id:a,value:g,onChange:e=>_(e.target.value),placeholder:`${M.name}-${N}`,"aria-invalid":R&&L!==``,onKeyDown:e=>{e.key===`Enter`&&!R&&F(`rename`)}})]}):null,t[33]=F,t[34]=N,t[35]=a,t[36]=R,t[37]=m,t[38]=M.name,t[39]=g,t[40]=L,t[41]=W):W=t[41];let G;t[42]!==U||t[43]!==W?(G=(0,Q.jsxs)(O,{className:`min-h-0 flex-1 overflow-auto`,children:[U,W]}),t[42]=U,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==F||t[46]!==v||t[47]!==N||t[48]!==R||t[49]!==m||t[50]!==M.name?(K=(0,Q.jsx)(ee,{children:m?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(x,{variant:`outline`,onClick:()=>h(!1),disabled:v,children:(0,Q.jsx)(l,{id:`iH8pgl`})}),(0,Q.jsx)(x,{onClick:()=>void F(`rename`),disabled:v||R,children:(0,Q.jsx)(l,{id:`AT0e50`})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(x,{variant:`outline`,onClick:()=>{_(`${M.name}-${N}`),h(!0)},disabled:v,children:(0,Q.jsx)(l,{id:`AT0e50`})}),(0,Q.jsx)(x,{variant:`outline`,onClick:()=>void F(`make-source`),disabled:v,children:(0,Q.jsx)(l,{id:`xWomUD`,values:{editor:N}})}),(0,Q.jsx)(x,{onClick:()=>void F(`align`),disabled:v,children:(0,Q.jsx)(l,{id:`PZn2LP`})})]})}),t[45]=F,t[46]=v,t[47]=N,t[48]=R,t[49]=m,t[50]=M.name,t[51]=K):K=t[51];let q;t[52]!==H||t[53]!==G||t[54]!==K?(q=(0,Q.jsxs)(D,{className:`flex max-h-[85vh] w-full max-w-3xl flex-col`,children:[H,G,K]}),t[52]=H,t[53]=G,t[54]=K,t[55]=q):q=t[55];let J;return t[56]!==q||t[57]!==z?(J=(0,Q.jsx)(j,{open:!0,onOpenChange:z,children:q}),t[56]=q,t[57]=z,t[58]=J):J=t[58],J}function tr(e){let t=(0,yt.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=Ae(),s=n!==null,c=(0,$.useId)(),[u,d]=(0,$.useState)(``),[f,p]=(0,$.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,$.useEffect)(m,_),!n)return null;let v,y,b,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,y=C===``||!ae.test(C)||S,b=!y&&!w&&r.has(C),t[5]=r,t[6]=u,t[7]=n.name,t[8]=v,t[9]=y,t[10]=b,t[11]=S,t[12]=C,t[13]=w}else v=t[8],y=t[9],b=t[10],S=t[11],C=t[12],w=t[13];let O=b,k=!y&&!O&&!w&&!f,M;t[17]!==k||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==C?(M=async function(){if(!n||!k)return;p(!0);let e=await o({scope:n.scope,name:n.name},C);p(!1),e.ok&&(a?.(C),i(!1))},t[17]=k,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=C,t[23]=M):M=t[23];let N=M,P;t[24]===i?P=t[25]:(P=e=>e?null:i(!1),t[24]=i,t[25]=P);let F;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(E,{children:(0,Q.jsx)(l,{id:`dw_3cv`})}),t[26]=F):F=t[26];let I;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsxs)(A,{children:[F,(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`R9IDFz`})})]}),t[27]=I):I=t[27];let L;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(l,{id:`6YtxFj`}),t[28]=L):L=t[28];let R;t[29]===c?R=t[30]:(R=(0,Q.jsx)(te,{htmlFor:c,children:L}),t[29]=c,t[30]=R);let z;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>d(e.target.value),t[31]=z):z=t[31];let B;t[32]===N?B=t[33]:(B=e=>{e.key===`Enter`&&N()},t[32]=N,t[33]=B);let V=y||O,H=y&&C!==``||O?`${c}-error`:void 0,U;t[34]!==c||t[35]!==u||t[36]!==B||t[37]!==V||t[38]!==H?(U=(0,Q.jsx)(Fe,{id:c,value:u,onChange:z,onKeyDown:B,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,maxLength:64,"aria-invalid":V,"aria-describedby":H,className:`font-mono`}),t[34]=c,t[35]=u,t[36]=B,t[37]=V,t[38]=H,t[39]=U):U=t[39];let W;t[40]!==O||t[41]!==v||t[42]!==c||t[43]!==y||t[44]!==S||t[45]!==C?(W=y&&C!==``?(0,Q.jsx)(`p`,{id:`${c}-error`,className:`text-xs text-destructive`,children:v?(0,Q.jsx)(l,{id:`iUwpZI`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}}):S?(0,Q.jsx)(l,{id:`lK9c4T`}):(0,Q.jsx)(l,{id:`A50vr3`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}})}):O?(0,Q.jsx)(`p`,{id:`${c}-error`,className:`text-xs text-destructive`,children:(0,Q.jsx)(l,{id:`YJ1BTp`})}):null,t[40]=O,t[41]=v,t[42]=c,t[43]=y,t[44]=S,t[45]=C,t[46]=W):W=t[46];let G;t[47]!==R||t[48]!==U||t[49]!==W?(G=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[R,U,W]}),t[47]=R,t[48]=U,t[49]=W,t[50]=G):G=t[50];let K;t[51]===i?K=t[52]:(K=()=>i(!1),t[51]=i,t[52]=K);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Q.jsx)(l,{id:`dEgA5A`}),t[53]=q):q=t[53];let J;t[54]!==f||t[55]!==K?(J=(0,Q.jsx)(x,{variant:`outline`,className:`font-mono uppercase`,onClick:K,disabled:f,children:q}),t[54]=f,t[55]=K,t[56]=J):J=t[56];let Y;t[57]===N?Y=t[58]:(Y=()=>void N(),t[57]=N,t[58]=Y);let ne=!k,X;t[59]===f?X=t[60]:(X=f?(0,Q.jsx)(l,{id:`tHKQ6j`}):(0,Q.jsx)(l,{id:`2wxgft`}),t[59]=f,t[60]=X);let re;t[61]!==Y||t[62]!==ne||t[63]!==X?(re=(0,Q.jsx)(x,{onClick:Y,disabled:ne,children:X}),t[61]=Y,t[62]=ne,t[63]=X,t[64]=re):re=t[64];let ie;t[65]!==J||t[66]!==re?(ie=(0,Q.jsxs)(ee,{children:[J,re]}),t[65]=J,t[66]=re,t[67]=ie):ie=t[67];let oe;t[68]!==G||t[69]!==ie?(oe=(0,Q.jsxs)(D,{children:[I,G,ie]}),t[68]=G,t[69]=ie,t[70]=oe):oe=t[70];let se;return t[71]!==s||t[72]!==oe||t[73]!==P?(se=(0,Q.jsx)(j,{open:s,onOpenChange:P,children:oe}),t[71]=s,t[72]=oe,t[73]=P,t[74]=se):se=t[74],se}function nr(){let e=(0,yt.c)(5),{_:t}=u(),n=Ge(),r=ke(),i=ut(),a;return e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==i?(a=async(e,a)=>{if(a===e.scope)return!1;Ue(e.scope,e.name);let o=await et({name:e.name,fromScope:e.scope,toScope:a});if(He(e.scope,e.name),!o.ok)return Z.error(t({id:`07eGJB`,values:{0:o.error}})),!1;Z.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?ze(s):de(e.scope,e.name),a===`project`&&o.path!==void 0?`${o.path.replace(/\/+$/,``)}/SKILL`:de(a,e.name)),!0},e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function rr(e){let t=(0,yt.c)(38),{target:n,onOpenChange:r}=e,i=Ge(),a=nr(),[o,s]=(0,$.useState)(!1);if(!n)return null;let{scope:c,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)(E,{children:(0,Q.jsx)(l,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[c],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 y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y={0:(0,Q.jsx)(`code`,{className:`font-mono`})},t[10]=y):y=t[10];let b;t[11]===v?b=t[12]:(b=(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`7bIiJ7`,values:v,components:y})}),t[11]=v,t[12]=b);let S;t[13]!==m||t[14]!==b?(S=(0,Q.jsxs)(A,{children:[m,b]}),t[13]=m,t[14]=b,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(l,{id:`dEgA5A`}),t[16]=C):C=t[16];let w;t[17]===o?w=t[18]:(w=(0,Q.jsx)(k,{asChild:!0,children:(0,Q.jsx)(x,{variant:`outline`,disabled:o,children:C})}),t[17]=o,t[18]=w);let O;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==c||t[23]!==d?(O=async()=>{s(!0),await a({scope:c,name:u},d),s(!1),r(!1)},t[19]=a,t[20]=u,t[21]=r,t[22]=c,t[23]=d,t[24]=O):O=t[24];let M;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(l,{id:`QWdKwH`}),t[25]=M):M=t[25];let N;t[26]!==o||t[27]!==O?(N=(0,Q.jsx)(x,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:O,children:M}),t[26]=o,t[27]=O,t[28]=N):N=t[28];let P;t[29]!==w||t[30]!==N?(P=(0,Q.jsxs)(ee,{children:[w,N]}),t[29]=w,t[30]=N,t[31]=P):P=t[31];let F;t[32]!==S||t[33]!==P?(F=(0,Q.jsxs)(D,{className:`sm:max-w-md`,children:[S,P]}),t[32]=S,t[33]=P,t[34]=F):F=t[34];let I;return t[35]!==f||t[36]!==F?(I=(0,Q.jsx)(j,{open:!0,onOpenChange:f,children:F}),t[35]=f,t[36]=F,t[37]=I):I=t[37],I}function ir(){let e=(0,yt.c)(45),{_:t}=u(),n=dt(),[r,i]=(0,$.useState)(null),[a,o]=(0,$.useState)(null),[s,c]=(0,$.useState)(null),[l,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(null),[g,_]=(0,$.useState)(null),v;e[0]===t?v=e[1]:(v=async function(e,n,r){_(e.name);let i=await nt({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(_(null),!i.ok)return Z.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=ar,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 Z.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&Z.warning(e);let t=l(`no-description`);t&&Z.warning(t)}return i.hosts.length===0?Z.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?Z.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?Z.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?Z.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):Z.success(t({id:`wDgmsr`,values:{0:e.name,1:a(i.hosts)}})),i},e[0]=t,e[1]=v);let y=v,b;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=async function(e,t){if(t.length!==0){_(e.name);for(let{target:n,mode:r}of t){let t=await at({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){Z.error(t.error);break}}_(null)}},e[2]=b):b=e[2];let x=b,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e,t){_(e.name);let n=await t();return _(null),n},e[3]=S):S=e[3];let C=S,w;e[4]!==t||e[5]!==n?(w=async function(e,r){let i=await rt({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){Z.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}Z.success(t({id:`0g7rCZ`,values:{0:i.name}})),n(e.scope,i.name)},e[4]=t,e[5]=n,e[6]=w):w=e[6];let T=w,E,D;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||i(null)},D=()=>i(null),e[7]=E,e[8]=D):(E=e[7],D=e[8]);let O;e[9]===r?O=e[10]:(O=(0,Q.jsx)(Xn,{skill:r,onOpenChange:E,onDeleted:D}),e[9]=r,e[10]=O);let ee=a?.skill??null,k=a?.existingNames??sr,A,j;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{e||o(null)},A=()=>o(null),e[11]=A,e[12]=j):(A=e[11],j=e[12]);let M;e[13]!==ee||e[14]!==k?(M=(0,Q.jsx)(tr,{skill:ee,existingNames:k,onOpenChange:j,onRenamed:A}),e[13]=ee,e[14]=k,e[15]=M):M=e[15];let N;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{e||c(null)},e[16]=N):N=e[16];let P;e[17]===s?P=e[18]:(P=(0,Q.jsx)(rr,{target:s,onOpenChange:N}),e[17]=s,e[18]=P);let F;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{e||d(null)},e[19]=F):F=e[19];let I;e[20]===l?I=e[21]:(I=(0,Q.jsx)($n,{target:l,onOpenChange:F}),e[20]=l,e[21]=I);let L;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{e||p(null)},e[22]=L):L=e[22];let R;e[23]===f?R=e[24]:(R=(0,Q.jsx)(Qn,{target:f,onOpenChange:L}),e[23]=f,e[24]=R);let z;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{e||h(null)},e[25]=z):z=e[25];let te;e[26]===m?te=e[27]:(te=(0,Q.jsx)(er,{target:m,onOpenChange:z}),e[26]=m,e[27]=te);let B;e[28]!==M||e[29]!==P||e[30]!==I||e[31]!==R||e[32]!==te||e[33]!==O?(B=(0,Q.jsxs)(Q.Fragment,{children:[O,M,P,I,R,te]}),e[28]=M,e[29]=P,e[30]=I,e[31]=R,e[32]=te,e[33]=O,e[34]=B):B=e[34];let V=B,H,U,W,G,K;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(H=(e,t)=>o({skill:e,existingNames:t}),U=(e,t)=>c({scope:e.scope,name:e.name,toScope:t}),W=(e,t)=>d({skill:e,filePath:t}),G=(e,t)=>p(t===void 0?{skill:e}:{skill:e,prefix:t}),K=(e,t)=>h({skill:e,editor:t}),e[35]=H,e[36]=U,e[37]=W,e[38]=G,e[39]=K):(H=e[35],U=e[36],W=e[37],G=e[38],K=e[39]);let q;return e[40]!==V||e[41]!==T||e[42]!==y||e[43]!==g?(q={installingName:g,install:y,convertLocations:x,runLocationWrite:C,duplicate:T,requestDelete:i,requestRename:H,requestScopeMove:U,requestFileRename:W,requestFileCreate:G,requestForkResolve:K,dialogs:V},e[40]=V,e[41]=T,e[42]=y,e[43]=g,e[44]=q):q=e[44],q}function ar(e){return e.map(or).join(`, `)}function or(e){return he[e]??e}var sr=new Set;function cr(e){let t=(0,yt.c)(29),{skill:n,filePath:r,actions:i}=e,{_:a}=u(),o=typeof window<`u`?window.okDesktop:void 0,s=n.absolutePath?`${n.absolutePath}/${r}`:void 0,c=`${n.path}/${r}`,d;t[0]===a?d=t[1]:(d=async function(e){try{await ft(e),Z.success(a({id:`SXCSQd`}))}catch{Z.error(a({id:`cRHuuI`}))}},t[0]=a,t[1]=d);let f=d,p;t[2]!==i||t[3]!==r||t[4]!==n?(p=()=>i.requestFileRename(n,r),t[2]=i,t[3]=r,t[4]=n,t[5]=p):p=t[5];let m,h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(_t,{"aria-hidden":!0}),h=(0,Q.jsx)(l,{id:`2wxgft`}),t[6]=m,t[7]=h):(m=t[6],h=t[7]);let g;t[8]===p?g=t[9]:(g=(0,Q.jsxs)(M,{onSelect:p,children:[m,h]}),t[8]=p,t[9]=g);let _;t[10]===s?_=t[11]:(_=o&&s?(0,Q.jsxs)(M,{onSelect:()=>void o.shell.showItemInFolder(s),children:[(0,Q.jsx)(Me,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`LtSYdi`})]}):null,t[10]=s,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsxs)(R,{children:[(0,Q.jsx)(je,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`zd00pH`})]}),t[12]=v):v=t[12];let y;t[13]!==s||t[14]!==f?(y=s?(0,Q.jsx)(M,{onSelect:()=>void f(s),children:(0,Q.jsx)(l,{id:`z2funE`})}):null,t[13]=s,t[14]=f,t[15]=y):y=t[15];let b;t[16]!==f||t[17]!==c?(b=()=>void f(c),t[16]=f,t[17]=c,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(l,{id:`xloBjn`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,Q.jsx)(M,{onSelect:b,children:x}),t[20]=b,t[21]=S);let C;t[22]!==S||t[23]!==y?(C=(0,Q.jsxs)(N,{children:[v,(0,Q.jsxs)(P,{children:[y,S]})]}),t[22]=S,t[23]=y,t[24]=C):C=t[24];let w;return t[25]!==C||t[26]!==g||t[27]!==_?(w=(0,Q.jsxs)(Q.Fragment,{children:[g,_,C]}),t[25]=C,t[26]=g,t[27]=_,t[28]=w):w=t[28],w}function lr(e){let t=(0,yt.c)(86),{skill:n,actions:r,existingNames:i}=e,{_:o}=u(),s=m(),c=Ge(),d=y().states,{dispatch:f}=fn(),p=Sn(n,r),g=typeof window<`u`?window.okDesktop:void 0,_=n.absolutePath,v;t[0]===o?v=t[1]:(v=async function(e){try{await ft(e),Z.success(o({id:`SXCSQd`}))}catch{Z.error(o({id:`cRHuuI`}))}},t[0]=o,t[1]=v);let b=v,x;t[2]===_?x=t[3]:(x=g&&_?(0,Q.jsxs)(M,{onSelect:()=>void g.shell.showItemInFolder(_),children:[(0,Q.jsx)(Me,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`LtSYdi`})]}):null,t[2]=_,t[3]=x);let S;t[4]!==n.name||t[5]!==n.scope||t[6]!==s?(S=Jt({skillName:n.name,scope:n.scope,workspace:s}),t[4]=n.name,t[5]=n.scope,t[6]=s,t[7]=S):S=t[7];let C;t[8]!==f||t[9]!==d||t[10]!==S?(C=(0,Q.jsx)(Un,{input:S,installStates:d,isElectronHost:g!=null,dispatch:f}),t[8]=f,t[9]=d,t[10]=S,t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(R,{children:[(0,Q.jsx)(je,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`zd00pH`})]}),t[12]=w):w=t[12];let T;t[13]!==_||t[14]!==b?(T=_?(0,Q.jsx)(M,{onSelect:()=>void b(_),children:(0,Q.jsx)(l,{id:`z2funE`})}):null,t[13]=_,t[14]=b,t[15]=T):T=t[15];let E;t[16]!==b||t[17]!==n.path?(E=()=>void b(n.path),t[16]=b,t[17]=n.path,t[18]=E):E=t[18];let D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(l,{id:`xloBjn`}),t[19]=D):D=t[19];let O;t[20]===E?O=t[21]:(O=(0,Q.jsx)(M,{onSelect:E,children:D}),t[20]=E,t[21]=O);let ee;t[22]!==T||t[23]!==O?(ee=(0,Q.jsxs)(N,{children:[w,(0,Q.jsxs)(P,{children:[T,O]})]}),t[22]=T,t[23]=O,t[24]=ee):ee=t[24];let k;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(z,{}),t[25]=k):k=t[25];let A;t[26]!==r||t[27]!==i||t[28]!==n?(A=()=>void r.duplicate(n,i),t[26]=r,t[27]=i,t[28]=n,t[29]=A):A=t[29];let j,F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(a,{"aria-hidden":!0}),F=(0,Q.jsx)(l,{id:`euc6Ns`}),t[30]=j,t[31]=F):(j=t[30],F=t[31]);let I;t[32]===A?I=t[33]:(I=(0,Q.jsxs)(M,{onSelect:A,children:[j,F]}),t[32]=A,t[33]=I);let L;t[34]!==r||t[35]!==i||t[36]!==n?(L=()=>r.requestRename(n,i),t[34]=r,t[35]=i,t[36]=n,t[37]=L):L=t[37];let te,B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(_t,{"aria-hidden":!0}),B=(0,Q.jsx)(l,{id:`2wxgft`}),t[38]=te,t[39]=B):(te=t[38],B=t[39]);let V;t[40]===L?V=t[41]:(V=(0,Q.jsxs)(M,{onSelect:L,children:[te,B]}),t[40]=L,t[41]=V);let H;t[42]!==r||t[43]!==n?(H=()=>r.requestFileCreate(n),t[42]=r,t[43]=n,t[44]=H):H=t[44];let U,W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(h,{"aria-hidden":!0}),W=(0,Q.jsx)(l,{id:`HdkSiO`}),t[45]=U,t[46]=W):(U=t[45],W=t[46]);let G;t[47]===H?G=t[48]:(G=(0,Q.jsxs)(M,{onSelect:H,children:[U,W]}),t[47]=H,t[48]=G);let K;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsxs)(R,{children:[(0,Q.jsx)(ht,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`TKQ7K-`})]}),t[49]=K):K=t[49];let q;t[50]!==r||t[51]!==n?(q=e=>r.requestForkResolve(n,e),t[50]=r,t[51]=n,t[52]=q):q=t[52];let J;t[53]!==p||t[54]!==n||t[55]!==q?(J=(0,Q.jsxs)(N,{children:[K,(0,Q.jsx)(P,{className:xn,children:(0,Q.jsx)(Dn,{toggles:p,skill:n,onResolveFork:q})})]}),t[53]=p,t[54]=n,t[55]=q,t[56]=J):J=t[56];let Y;t[57]!==r||t[58]!==n?(Y=()=>r.requestScopeMove(n,n.scope===`project`?`global`:`project`),t[57]=r,t[58]=n,t[59]=Y):Y=t[59];let ne;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(mt,{"aria-hidden":!0}),t[60]=ne):ne=t[60];let X;t[61]!==c.global||t[62]!==c.project||t[63]!==n.scope?(X=n.scope===`project`?(0,Q.jsx)(l,{id:`bpytj4`,values:{0:c.global}}):(0,Q.jsx)(l,{id:`bpytj4`,values:{0:c.project}}),t[61]=c.global,t[62]=c.project,t[63]=n.scope,t[64]=X):X=t[64];let re;t[65]!==Y||t[66]!==X?(re=(0,Q.jsxs)(M,{onSelect:Y,children:[ne,X]}),t[65]=Y,t[66]=X,t[67]=re):re=t[67];let ie;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(z,{}),t[68]=ie):ie=t[68];let ae;t[69]!==r||t[70]!==n?(ae=()=>r.requestDelete(n),t[69]=r,t[70]=n,t[71]=ae):ae=t[71];let oe,se;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(Pe,{"aria-hidden":!0}),se=(0,Q.jsx)(l,{id:`cnGeoo`}),t[72]=oe,t[73]=se):(oe=t[72],se=t[73]);let ce;t[74]===ae?ce=t[75]:(ce=(0,Q.jsxs)(M,{variant:`destructive`,onSelect:ae,children:[oe,se]}),t[74]=ae,t[75]=ce);let le;return t[76]!==ee||t[77]!==I||t[78]!==V||t[79]!==x||t[80]!==G||t[81]!==J||t[82]!==re||t[83]!==ce||t[84]!==C?(le=(0,Q.jsxs)(Q.Fragment,{children:[x,C,ee,k,I,V,G,J,re,ie,ce]}),t[76]=ee,t[77]=I,t[78]=V,t[79]=x,t[80]=G,t[81]=J,t[82]=re,t[83]=ce,t[84]=C,t[85]=le):le=t[85],le}export{vt as C,Ht as S,mt as T,nn as _,qn as a,sn as b,bn as c,Sn as d,Yt as f,Wt as g,Ut as h,rr as i,xn as l,qt as m,cr as n,Un as o,Gt as p,ir as r,Bn as s,lr as t,Dn as u,ln as v,gt as w,fn as x,Kt as y};
@@ -58,7 +58,7 @@
58
58
  -->
59
59
  <script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let ct = null; try { const c = localStorage.getItem('ok-color-theme-v1'); if (c && ['dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', 'custom'].includes(c)) ct = c; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let customCss = null; if (ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (o?.css) { customCss = o.css; dark = !!o.dark; } } } catch {} if (!customCss) ct = null; } else if (ct) { dark = !['catppuccin-latte'].includes(ct); } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (customCss) { const s = document.createElement('style'); s.id = 'ok-custom-theme'; s.textContent = customCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
60
60
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
61
- <script type="module" crossorigin src="./assets/index-Bnezs-Zg.js"></script>
61
+ <script type="module" crossorigin src="./assets/index-D6A3_yKx.js"></script>
62
62
  <link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
63
63
  <link rel="modulepreload" crossorigin href="./assets/dist-CzC3AWOn.js">
64
64
  <link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
@@ -164,7 +164,7 @@
164
164
  <link rel="modulepreload" crossorigin href="./assets/lint-config-client-D7DpNIwn.js">
165
165
  <link rel="modulepreload" crossorigin href="./assets/selection-context-BgucOSM-.js">
166
166
  <link rel="modulepreload" crossorigin href="./assets/use-skills-B19yYlmR.js">
167
- <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-B-Y5eayN.js">
167
+ <link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-q-xRNXgT.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-BQttSYlY.js">
169
169
  <link rel="modulepreload" crossorigin href="./assets/cursor-D_UKSHL6.js">
170
170
  <link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-H3tp7x07.js">
@@ -176,7 +176,7 @@
176
176
  <link rel="modulepreload" crossorigin href="./assets/use-open-skill-C3UqDa0B.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/use-settings-route-CYvmk4XT.js">
178
178
  <link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-Brbch5VX.js">
179
- <link rel="modulepreload" crossorigin href="./assets/skill-actions-By3ZQhYp.js">
179
+ <link rel="modulepreload" crossorigin href="./assets/skill-actions-BpRp9hcI.js">
180
180
  <link rel="modulepreload" crossorigin href="./assets/arrow-up-right-CxtRAecj.js">
181
181
  <link rel="modulepreload" crossorigin href="./assets/case-sensitive-DjnVZ1Bg.js">
182
182
  <link rel="modulepreload" crossorigin href="./assets/chevron-left-B-obKYha.js">
@@ -1,2 +1,2 @@
1
- import{t as e}from"./launch-json-removal-CwrvAwfU.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
- //# sourceMappingURL=repair-launch-json-BDkJpah_.mjs.map
1
+ import{t as e}from"./launch-json-removal-F1oyHtiZ.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
+ //# sourceMappingURL=repair-launch-json-BtQ1epg0.mjs.map
@@ -1,2 +1,2 @@
1
- import{b as e,d as t,l as n}from"./write-project-skill-B8LGhuHT.mjs";import{d as r,v as i}from"./init-4qi6zG9S.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(e){let r=e.logger??u,i=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of n){let n=t[o],s=c(()=>n.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:n,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),n.projectConfigPath){let t=n.projectConfigPath,i=c(()=>t(e.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:n,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(t){let n={scope:t.scope,editorId:t.editorId,configPath:t.configPath},o=r(t.target,t.cwd,t.home,t.configPathOverride);if(o===null)return{...n,outcome:`no-entry`};if(e(o))return{...n,outcome:`canonical`};t.logger(a({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:o}));let s=i(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...n,outcome:`write-failed`,error:e}}return s.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:s.declineReason}),{...n,outcome:`declined`}):{...n,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-DnQc3393.mjs.map
1
+ import{b as e,d as t,l as n}from"./write-project-skill-gCnhI-I2.mjs";import{d as r,v as i}from"./init-BXglYch2.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(e){let r=e.logger??u,i=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of n){let n=t[o],s=c(()=>n.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:n,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),n.projectConfigPath){let t=n.projectConfigPath,i=c(()=>t(e.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:n,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(t){let n={scope:t.scope,editorId:t.editorId,configPath:t.configPath},o=r(t.target,t.cwd,t.home,t.configPathOverride);if(o===null)return{...n,outcome:`no-entry`};if(e(o))return{...n,outcome:`canonical`};t.logger(a({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:o}));let s=i(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...n,outcome:`write-failed`,error:e}}return s.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:s.declineReason}),{...n,outcome:`declined`}):{...n,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-BF-zmoWp.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-t2iYnlZp.mjs";export{e as repairSkills};
@@ -1,4 +1,4 @@
1
- import{R as e}from"./src-pJ6LEXKc.mjs";import{Qn as t,Zn as n,ar as r,dr as i,fr as a,nr as o,rr as s,sr as c,tr as l}from"./src-CWDcUomk.mjs";import{T as u,a as d,d as f,f as p,o as m,s as h,t as g}from"./write-project-skill-B8LGhuHT.mjs";import{n as _,s as v,t as y}from"./colors-BsmVIwfM.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>c(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>c(e,{checkDesktop:!1}),readBundledVersion:()=>t(),readRecordedVersion:e=>l(e,`cli-hosts`),writeRecordedVersion:(e,t)=>s(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>r(e),readBundleDecision:(e,t)=>n(e,t),writeBundleDecision:(e,t,n)=>o(e,t,n),removeBundleFromDisk:(e,t)=>h(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=!1;if(r.existsSync(s))o.push({kind:`central`,path:s,outcome:`skipped-present`});else try{I(n,s,r),c=!0,o.push({kind:`central`,path:s,outcome:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(r.existsSync(u)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-present`});continue}try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:c}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=f[t.editorId]?.projectConfigPath?.(e);if(!z(c,n)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{g(o,e),I(i,o,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`created`}),r({event:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function V(t,n,r,o){let s=e=>{n.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await n.readRecordedVersion(t)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of a)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let a of d){let s=i[a.id],c=r.existsSync(x(t,`.agents`,`skills`,s)),l=await n.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{n.removeBundleFromDisk(t,a.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:a.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}p.push(a)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(x(t,`.agents`,`skills`,i[e.id])));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===a.length,_=[];for(let{id:e,sourceDir:n}of p){let a=R(t,i[e],n,r,o,l);h.push(...a.entries),_.push({id:e,centralWritten:a.centralWritten})}let v=h.some(e=>e.kind===`central`&&e.outcome===`failed`);if(g&&!v){let e=null;try{await n.writeRecordedVersion(t,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t,centralWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:g?e?`all-writes-failed`:`central-write-failed`:`bundle-unresolved`})}return{outcome:`done`,version:l,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=m(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=d(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function U(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function W(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`present`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-present`).length,i=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,a=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} present, ${i} skipped, ${a} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
1
+ import{R as e}from"./src-pJ6LEXKc.mjs";import{Qn as t,Zn as n,ar as r,dr as i,fr as a,nr as o,rr as s,sr as c,tr as l}from"./src-BSAmyhAn.mjs";import{T as u,a as d,d as f,f as p,o as m,s as h,t as g}from"./write-project-skill-gCnhI-I2.mjs";import{n as _,s as v,t as y}from"./colors-BsmVIwfM.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>c(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>c(e,{checkDesktop:!1}),readBundledVersion:()=>t(),readRecordedVersion:e=>l(e,`cli-hosts`),writeRecordedVersion:(e,t)=>s(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>r(e),readBundleDecision:(e,t)=>n(e,t),writeBundleDecision:(e,t,n)=>o(e,t,n),removeBundleFromDisk:(e,t)=>h(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=!1;if(r.existsSync(s))o.push({kind:`central`,path:s,outcome:`skipped-present`});else try{I(n,s,r),c=!0,o.push({kind:`central`,path:s,outcome:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(r.existsSync(u)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-present`});continue}try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:c}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=f[t.editorId]?.projectConfigPath?.(e);if(!z(c,n)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{g(o,e),I(i,o,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`created`}),r({event:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function V(t,n,r,o){let s=e=>{n.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await n.readRecordedVersion(t)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of a)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let a of d){let s=i[a.id],c=r.existsSync(x(t,`.agents`,`skills`,s)),l=await n.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{n.removeBundleFromDisk(t,a.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:a.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}p.push(a)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(x(t,`.agents`,`skills`,i[e.id])));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===a.length,_=[];for(let{id:e,sourceDir:n}of p){let a=R(t,i[e],n,r,o,l);h.push(...a.entries),_.push({id:e,centralWritten:a.centralWritten})}let v=h.some(e=>e.kind===`central`&&e.outcome===`failed`);if(g&&!v){let e=null;try{await n.writeRecordedVersion(t,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t,centralWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:g?e?`all-writes-failed`:`central-write-failed`:`bundle-unresolved`})}return{outcome:`done`,version:l,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=m(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=d(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function U(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function W(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`present`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-present`).length,i=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,a=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} present, ${i} skipped, ${a} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
2
2
  `)}function G(){return new u(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").option(`-y, --yes`,`Skip the confirmation prompt for removing directories left by a pre-0.42 install.`).action(async e=>{let t=await H({projectDir:C(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null,confirmLegacyCleanup:t=>K(t,{yes:e.yes===!0})});process.stdout.write(`${W(t)}\n`),process.exitCode=U(t)})}async function K(e,t){let n=j(),r=e=>`~/${S(n,e)}`,i=t.input??process.stdin,a=[``,y(`A previous version of OpenKnowledge installed its skill into agent tools you may never have used.`),_(`(Versions before 0.42 wrote to every host a third-party installer knew about — see issue #820.)`)];if(e.skillDirs.length>0&&a.push(``,`${y(`Remove OpenKnowledge skills:`)} ${e.skillDirs.length}`,...e.skillDirs.map(e=>` ${r(e)}`)),e.emptyDirs.length>0){let t=e.skillDirs.length>0?`Then remove these, which hold nothing else once the above are gone:`:`Remove these empty directories, left behind by that install:`;a.push(``,`${y(t)} ${e.emptyDirs.length}`,...e.emptyDirs.map(e=>` ${r(e)}`))}if(a.push(``,_(`Nothing outside these paths is touched. A directory that still holds anything is kept.`)),process.stdout.write(`${a.join(`
3
3
  `)}\n`),t.yes)return!0;if(!i.isTTY)return process.stdout.write(`${v("Not a terminal — skipping cleanup. Re-run with `ok repair-skills --yes` to remove these.")}\n`),!1;let o=M({input:i,output:process.stdout});try{let e=(await o.question(`\n${y(`Remove them?`)} ${_(`[y/N] `)}`)).trim().toLowerCase();return e===`y`||e===`yes`}finally{o.close()}}export{G as n,H as t};
4
- //# sourceMappingURL=repair-skills-BikzcmQr.mjs.map
4
+ //# sourceMappingURL=repair-skills-t2iYnlZp.mjs.map
@@ -1 +1 @@
1
- import{Mo as e,No as t,P as n,Po as r,R as i,Yo as a,Zo as o,d as s,l as c,ss as l,ws as u}from"./src-pJ6LEXKc.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dt as P,E as F,Ei as I,En as L,Et as R,F as z,Fi as B,Fn as V,Fr as H,Ft as U,G as W,Gi as G,Gn as K,Gr as q,Gt as J,H as Y,Hi as X,Hn as Z,Hr as Q,Ht as $,I as ee,Ii as te,In as ne,Ir as re,It as ie,J as ae,Ji as oe,Jn as se,Jr as ce,Jt as le,K as ue,Ki as de,Kn as fe,Kr as pe,Kt as me,L as he,Li as ge,Ln as _e,Lr as ve,Lt as ye,M as be,Mi as xe,Mn as Se,Mr as Ce,Mt as we,N as Te,Ni as Ee,Nn as De,Nr as Oe,Nt as ke,O as Ae,Oi as je,On as Me,Ot as Ne,P as Pe,Pi as Fe,Pn as Ie,Pr as Le,Pt as Re,Q as ze,Qi as Be,Qn as Ve,Qr as He,Qt as Ue,R as We,Ri as Ge,Rn as Ke,Rr as qe,Rt as Je,S as Ye,Si as Xe,Sn as Ze,Sr as Qe,St as $e,T as et,Ti as tt,Tn as nt,Tt as rt,U as it,Ui as at,Un as ot,Ur as st,Ut as ct,V as lt,Vi as ut,Vn as dt,Vr as ft,Vt as pt,W as mt,Wi as ht,Wn as gt,Wr as _t,Wt as vt,X as yt,Xi as bt,Xn as xt,Xr as St,Xt as Ct,Y as wt,Yi as Tt,Yn as Et,Yr as Dt,Yt as Ot,Z as kt,Zi as At,Zn as jt,Zr as Mt,Zt as Nt,_ as Pt,_a as Ft,_n as It,_r as Lt,_t as Rt,a as zt,aa as Bt,ai as Vt,an as Ht,ar as Ut,at as Wt,b as Gt,bi as Kt,bn as qt,br as Jt,bt as Yt,c as Xt,ca as Zt,ci as Qt,cn as $t,cr as en,ct as tn,d as nn,da as rn,di as an,dn as on,dr as sn,ea as cn,ei as ln,en as un,er as dn,et as fn,f as pn,fa as mn,fi as hn,fn as gn,fr as _n,g as vn,ga as yn,gi as bn,gn as xn,gr as Sn,gt as Cn,h as wn,ha as Tn,hi as En,hn as Dn,hr as On,ht as kn,i as An,ia as jn,ii as Mn,in as Nn,ir as Pn,it as Fn,j as In,ji as Ln,jn as Rn,jr as zn,jt as Bn,k as Vn,ki as Hn,kn as Un,kr as Wn,kt as Gn,l as Kn,la as qn,li as Jn,ln as Yn,lr as Xn,m as Zn,ma as Qn,mi as $n,mn as er,mr as tr,n as nr,na as rr,ni as ir,nn as ar,nr as or,nt as sr,o as cr,oa as lr,oi as ur,on as dr,or as fr,ot as pr,p as mr,pa as hr,pi as gr,pn as _r,pr as vr,q as yr,qi as br,qn as xr,qr as Sr,qt as Cr,r as wr,ra as Tr,ri as Er,rn as Dr,rr as Or,rt as kr,s as Ar,sa as jr,si as Mr,sn as Nr,sr as Pr,st as Fr,t as Ir,ta as Lr,ti as Rr,tn as zr,tr as Br,tt as Vr,u as Hr,ua as Ur,ui as Wr,un as Gr,ur as Kr,v as qr,vi as Jr,vn as Yr,vr as Xr,vt as Zr,w as Qr,wi as $r,wn as ei,wt as ti,x as ni,xi as ri,xn as ii,xr as ai,xt as oi,y as si,yi as ci,yn as li,yr as ui,yt as di,z as fi,zi as pi,zn as mi,zr as hi,zt as gi}from"./src-CWDcUomk.mjs";import{C as _i,E as vi,T as yi,_ as bi,b as xi,c as Si,d as Ci,g as wi,i as Ti,l as Ei,m as Di,n as Oi,p as ki,s as Ai,t as ji,u as Mi,v as Ni,w as Pi,x as Fi,y as Ii}from"./fs-traced-OS6B1cZZ.mjs";import{a as Li,d as Ri,f as zi,i as Bi,l as Vi,n as Hi,r as Ui,t as Wi,u as Gi}from"./logger-5LePyO3n.mjs";import{S as Ki,_ as qi,a as Ji,c as Yi,f as Xi,g as Zi,h as Qi,i as $i,l as ea,m as ta,n as na,o as ra,p as ia,r as aa,s as oa,t as sa,u as ca,v as la,x as ua}from"./server-lock-DgWnoftI.mjs";export{Zt as AGENT_ID_MAX_LEN,qn as AGENT_ID_RE,$r as AGENT_WRITE_ORIGIN,Tn as AcpPermissionStore,mn as AcpRegistry,ri as AcpThreadManager,ci as AgentFocusBroadcaster,Jr as AgentPresenceBroadcaster,tt as AgentSessionCapacityError,I as AgentSessionManager,Cn as AutoStartDisabledError,Xn as BUNDLE_IDS,Kr as BUNDLE_SCOPE,sn as BUNDLE_SKILL_NAME,C as BacklinkIndex,te as CC1Broadcaster,o as CC1_CONTRACT_VERSION,Gr as CONFIG_FILENAME,Ie as CONFLICT_MARKER_RE,Oe as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Pt as ConfigSchema,X as DEFAULT_CHECKPOINT_RETENTION,Dt as DEFAULT_EMBEDDINGS_DIMENSIONS,U as DEFAULT_PACK_ID,lt as DocumentDurabilityState,St as EMBEDDINGS_API_KEY_ENV,hr as FEATURED_AGENT_IDS,at as FILE_SYSTEM_WRITER,Ke as FILE_WATCHER_ORIGIN,st as FileEmbeddingsBackend,Nt as GIT_PREFLIGHT_FAIL_SPAN_NAME,ht as GIT_UPSTREAM_WRITER,yn as GitDirAccessError,h as GitNotAvailableError,un as GitTooOldError,Rt as HOCUSPOCUS_AUTH_REJECTION_REASONS,Zr as HocuspocusAuthRejection,di as HocuspocusAuthTokenSchema,hi as INSTALLED_AGENTS_SCHEMES,a as LINEAGE_EPOCH_KEY,We as LIVE_DERIVED_INDEX_DEBOUNCE_MS,ie as LOG_MD_TEMPLATE,rt as MANAGED_RENAME_ORIGIN,Xe as MAX_ACP_THREADS,M as MAX_AGENT_SESSIONS,Fr as MCP_CONNECTION_ID_HEADER,e as MCP_SERVER_NAME,je as MIN_EVICTABLE_IDLE_MS,zr as MIN_GIT_VERSION,Y as MISSING_OK_CONFIG_MESSAGE,Ft as MalformedGitPointerError,d as McpLogger,it as MissingOkConfigError,_ as OBSERVER_SYNC_ORIGIN,on as OK_OKIGNORE_TEMPLATE,t as ORPHAN_MODES,u as PROTOCOL_VERSION,Wi as PinoLogger,Yi as ProcessLockCollisionError,Kn as ProjectGitInitError,R as ROLLBACK_ORIGIN,gn as ROOT_GITIGNORE_TEMPLATE,Zi as RUNTIME_VERSION,an as RemoteConfigError,G as SERVICE_WRITER,Pn as SKILL_INSTALL_EVENTS_FILE_REL,n as SKILL_STATE_TARGETS,ye as STARTER_FOLDERS,Je as STARTER_FOLDER_FRONTMATTER_FILENAME,gi as STARTER_PACKS,T as STARTER_PACK_IDS,pt as STARTER_TEMPLATES,et as STATE_MANIFEST_FILENAME,qi as STATE_SCHEMA_VERSION,l as SYSTEM_DOC_NAME,Cr as SeedPrerequisiteError,le as SeedRootDirError,sa as ServerLockCollisionError,Ir as SingleFileNotAFileError,nr as SingleFileNotFoundError,wr as SingleFileNotMarkdownError,F as StateManifestError,mi as TagIndex,_n as USER_GLOBAL_BUNDLE_IDS,Z as UiLockCollisionError,P as __getShowAllWalkStatsForTesting,Ne as __resetShowAllWalkStatsForTesting,ea as acquireProcessLock,na as acquireServerLock,ot as acquireUiLock,Hn as applyAgentMarkdownWrite,Se as applyExternalChange,Re as applySeed,j as assertCompatibleStateManifest,ar as assertGitAvailable,qt as assertNeverDiskEvent,Kt as attachAcpThreadSocket,kn as attachIdleShutdown,qr as bootServer,xr as buildAndOpenSkill,_r as buildConfigYmlContent,ae as buildExecResult,D as buildOkMcpStdioCommand,fr as buildSkillZip,$ as buildStarterFolderFrontmatterYaml,de as buildWipTree,vr as bundleSkillMdPath,_t as canonicalProjectKey,ii as classifyEvents,ji as classifyFsPath,q as clearAllEmbeddingsKeys,He as clearContributors,ct as coercePackId,c as colorFromSeed,br as commitUpstreamImport,oe as commitWip,Tt as commitWipFromTree,Dr as compareSemver,Sn as composeEffectiveLinterConfig,Lt as composeFrontmatterSchemasConfig,V as containsConflictMarkers,Ze as contentHash,m as contributorCount,Pe as countShadowObjects,z as countStaleAgentWipRefs,ee as countWipRefs,Gn as createApiExtension,Qt as createAssetServeMiddleware,Wn as createContentFilter,y as createContentFilterAsync,pe as createEmbeddingsSecretStore,An as createEphemeralProjectDir,De as createExternalChangeHandler,pn as createFileLogger,fi as createLiveDerivedIndexExtension,ue as createMcpHttpHandler,w as createOsProbe,Te as createPersistenceExtension,E as createServer,In as createServerObserverExtension,Ee as createStreamingErrorWriter,Hi as createTestLogger,Sr as describeStoredEmbeddingsKey,vn as detectClaudeDesktopPresence,Nn as detectGit,Ae as detectProjectShape,se as detectUserSkillHosts,sr as discoverLockDirs,Jt as discoverMarkdownlintConfig,Ue as emitPreflightFailureSpan,wt as encodeDocName,yt as encodeFolderRoute,kt as encodeSkillRoute,Hr as ensureProjectGit,er as ensureProjectSkillGitignore,Fe as errorResponse,O as evictStaleTrackerEntries,b as extractHeadings,kr as extractOkBinaryPath,dt as extractWikiLinksFromMarkdown,Ht as fallbackPaths,nn as findEnclosingGitRoot,Yr as findEnclosingProjectRoot,ai as findNativeMarkdownlintFile,mr as flushFileLogger,Yt as formatAuthRejectionWire,ln as formatContributors,Rr as formatContributorsFrom,we as formatPackRationale,bt as gcCheckpointRefs,fn as getCurrentMcpLogger,Vt as getLocalDir,Zn as getLogFilePath,Ui as getLogger,wn as getLogsDir,la as getMachineId,Ii as getMeter,Tr as getMetrics,xi as getTracer,jn as handleCollabSocketError,Le as handleSpawnCursor,hn as hasForwardingHeaders,he as hasGcLogLatch,s as iconFromClientName,Bt as incrementCollabSocketFilteredError,lr as incrementServerObserverFire,Dn as initContent,At as initShadowRepo,Fi as initTelemetry,Gt as initToleranceTelemetryWriter,pr as installPrettyZodErrors,Bi as installTestLoggers,Et as installUserSkill,Wr as isAllowedApiOrigin,En as isAllowedWorkspaceHostHeader,ge as isConfigDoc,oi as isHocuspocusAuthRejectionReason,vt as isKnownPackId,Ge as isLinkIndexExcludedDoc,bn as isLoopbackAddress,pi as isManagedArtifactDoc,r as isOrphanMode,Ln as isPairedWriteOrigin,H as isPathWithinDir,ua as isProcessAlive,li as isProjectRoot,gr as isRemoteAdmitted,S as isReservedForUserTree,ei as isSelfWrite,ut as isSystemDoc,ni as isToleranceTelemetryEnabled,Ki as isValidLockPid,nt as lastKnownHash,Be as listRescueCheckpoints,J as listStarterPacks,Qn as loadCustomAgents,be as loadPrincipal,ca as lockFilePath,Li as loggerFactory,Vi as logsCurrentPath,Gi as logsPreviousPath,ce as makeLazyEmbeddingsKeyStore,aa as markServerLockDraining,mt as mountMcpAndApi,Oi as normalizeFsPath,tr as originGitHubHost,xn as packageVersionMajorMinor,$e as parseAuthRejectionWire,dr as parseGitVersion,A as parseHocuspocusAuthToken,W as parseKeepaliveConnectionId,L as pathToDocName,ke as planSeed,zt as prepareSingleFileOpen,Fn as processCommand,Wt as processUsage,xt as readAllTargets,jt as readBundleDecision,Qe as readOwnNativeRules,Xi as readProcessLock,ia as readProcessLockDetailed,x as readProjectHeadState,Q as readProjectLocalSemanticConfig,$i as readServerLock,Ve as readServerPackageVersion,p as readSkillInstallStateSnapshot,Vn as readStateManifest,dn as readTargetRecordedAt,Br as readTargetVersion,gt as readUiLock,ne as reconcile,ir as recordContributor,Ut as recordSkillInstallEvent,yr as registerAllTools,N as registerWrite,ta as releaseProcessLock,Ji as releaseServerLock,K as releaseUiLock,Me as removeLastKnownHash,jr as resetMetrics,i as resolveBundleEnabled,Pr as resolveBundledSkillDir,ur as resolveContentDir,re as resolveCursorBinaryDefault,ve as resolveCursorSpawnInvocation,Xr as resolveEffectiveLinterConfig,Mt as resolveEmbeddingsCredential,Mr as resolveLockDir,ui as resolveNativeConfigForDoc,k as resolveNativeMarkdownlintConfig,me as resolvePack,Ar as resolvePackageVersion,$n as resolveRemoteAccess,ze as resolveUiInfo,Er as restoreContributors,si as restoreLifecycleFromConflictsJson,zn as rewriteMarkdownLinksForDocumentRename,Ce as rewriteWikiLinksForDocumentRename,Nr as runAuthReposSubprocess,$t as runAuthStatusSubprocess,Ot as runCloneSubprocess,Yn as runDeviceFlowSubprocess,Vr as runWithMcpLogger,Jn as safeContentPath,Bn as safeSubdir,f as safetyCheckpoint,tn as sanitizeClientName,cn as saveInMemoryCheckpoint,Lr as saveVersion,ti as seedBasenameIndex,cr as serializeError,_i as setActiveSpanAttributes,xe as setupServerObservers,rr as shadowGit,Pi as shutdownTelemetry,Ri as spansCurrentPath,zi as spansPreviousPath,qe as spawnDetached,_e as splitMarkdownBlocks,Un as startWatcher,B as streamingProblemEvent,Mn as swapContributors,Ye as teardownToleranceTelemetryWriter,Ur as toBroadcasterKey,Ti as tracedAppendFileSync,Ai as tracedLinkSync,Si as tracedMkdir,Ei as tracedMkdirSync,Mi as tracedRename,Ci as tracedRenameSync,ki as tracedRmSync,Di as tracedRmdirSync,wi as tracedUnlinkSync,bi as tracedWriteFile,Ni as tracedWriteFileSync,Qr as trustSystemCertificates,Xt as untrackTrackedProjectSkillProjection,v as updateLastKnownHash,Qi as updateProcessLockPort,ra as updateServerLockPort,fe as updateUiLockPort,rn as validateAgentId,Ct as validateCloneInputs,en as validateSkillZip,oa as waitForServerLockDrain,ft as withHiddenWindowsConsole,yi as withSpan,vi as withSpanSync,or as writeBundleDecision,On as writeMarkdownlintRule,It as writeRootGitignoreForNewRepo,g as writeStateManifest,Or as writeTargetVersion,Rn as writeTracker};
1
+ import{Mo as e,No as t,P as n,Po as r,R as i,Yo as a,Zo as o,d as s,l as c,ss as l,ws as u}from"./src-pJ6LEXKc.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dt as P,E as F,Ei as I,En as L,Et as R,F as z,Fi as B,Fn as V,Fr as H,Ft as U,G as W,Gi as G,Gn as K,Gr as q,Gt as J,H as Y,Hi as X,Hn as Z,Hr as Q,Ht as $,I as ee,Ii as te,In as ne,Ir as re,It as ie,J as ae,Ji as oe,Jn as se,Jr as ce,Jt as le,K as ue,Ki as de,Kn as fe,Kr as pe,Kt as me,L as he,Li as ge,Ln as _e,Lr as ve,Lt as ye,M as be,Mi as xe,Mn as Se,Mr as Ce,Mt as we,N as Te,Ni as Ee,Nn as De,Nr as Oe,Nt as ke,O as Ae,Oi as je,On as Me,Ot as Ne,P as Pe,Pi as Fe,Pn as Ie,Pr as Le,Pt as Re,Q as ze,Qi as Be,Qn as Ve,Qr as He,Qt as Ue,R as We,Ri as Ge,Rn as Ke,Rr as qe,Rt as Je,S as Ye,Si as Xe,Sn as Ze,Sr as Qe,St as $e,T as et,Ti as tt,Tn as nt,Tt as rt,U as it,Ui as at,Un as ot,Ur as st,Ut as ct,V as lt,Vi as ut,Vn as dt,Vr as ft,Vt as pt,W as mt,Wi as ht,Wn as gt,Wr as _t,Wt as vt,X as yt,Xi as bt,Xn as xt,Xr as St,Xt as Ct,Y as wt,Yi as Tt,Yn as Et,Yr as Dt,Yt as Ot,Z as kt,Zi as At,Zn as jt,Zr as Mt,Zt as Nt,_ as Pt,_a as Ft,_n as It,_r as Lt,_t as Rt,a as zt,aa as Bt,ai as Vt,an as Ht,ar as Ut,at as Wt,b as Gt,bi as Kt,bn as qt,br as Jt,bt as Yt,c as Xt,ca as Zt,ci as Qt,cn as $t,cr as en,ct as tn,d as nn,da as rn,di as an,dn as on,dr as sn,ea as cn,ei as ln,en as un,er as dn,et as fn,f as pn,fa as mn,fi as hn,fn as gn,fr as _n,g as vn,ga as yn,gi as bn,gn as xn,gr as Sn,gt as Cn,h as wn,ha as Tn,hi as En,hn as Dn,hr as On,ht as kn,i as An,ia as jn,ii as Mn,in as Nn,ir as Pn,it as Fn,j as In,ji as Ln,jn as Rn,jr as zn,jt as Bn,k as Vn,ki as Hn,kn as Un,kr as Wn,kt as Gn,l as Kn,la as qn,li as Jn,ln as Yn,lr as Xn,m as Zn,ma as Qn,mi as $n,mn as er,mr as tr,n as nr,na as rr,ni as ir,nn as ar,nr as or,nt as sr,o as cr,oa as lr,oi as ur,on as dr,or as fr,ot as pr,p as mr,pa as hr,pi as gr,pn as _r,pr as vr,q as yr,qi as br,qn as xr,qr as Sr,qt as Cr,r as wr,ra as Tr,ri as Er,rn as Dr,rr as Or,rt as kr,s as Ar,sa as jr,si as Mr,sn as Nr,sr as Pr,st as Fr,t as Ir,ta as Lr,ti as Rr,tn as zr,tr as Br,tt as Vr,u as Hr,ua as Ur,ui as Wr,un as Gr,ur as Kr,v as qr,vi as Jr,vn as Yr,vr as Xr,vt as Zr,w as Qr,wi as $r,wn as ei,wt as ti,x as ni,xi as ri,xn as ii,xr as ai,xt as oi,y as si,yi as ci,yn as li,yr as ui,yt as di,z as fi,zi as pi,zn as mi,zr as hi,zt as gi}from"./src-BSAmyhAn.mjs";import{C as _i,E as vi,T as yi,_ as bi,b as xi,c as Si,d as Ci,g as wi,i as Ti,l as Ei,m as Di,n as Oi,p as ki,s as Ai,t as ji,u as Mi,v as Ni,w as Pi,x as Fi,y as Ii}from"./fs-traced-OS6B1cZZ.mjs";import{a as Li,d as Ri,f as zi,i as Bi,l as Vi,n as Hi,r as Ui,t as Wi,u as Gi}from"./logger-5LePyO3n.mjs";import{S as Ki,_ as qi,a as Ji,c as Yi,f as Xi,g as Zi,h as Qi,i as $i,l as ea,m as ta,n as na,o as ra,p as ia,r as aa,s as oa,t as sa,u as ca,v as la,x as ua}from"./server-lock-DgWnoftI.mjs";export{Zt as AGENT_ID_MAX_LEN,qn as AGENT_ID_RE,$r as AGENT_WRITE_ORIGIN,Tn as AcpPermissionStore,mn as AcpRegistry,ri as AcpThreadManager,ci as AgentFocusBroadcaster,Jr as AgentPresenceBroadcaster,tt as AgentSessionCapacityError,I as AgentSessionManager,Cn as AutoStartDisabledError,Xn as BUNDLE_IDS,Kr as BUNDLE_SCOPE,sn as BUNDLE_SKILL_NAME,C as BacklinkIndex,te as CC1Broadcaster,o as CC1_CONTRACT_VERSION,Gr as CONFIG_FILENAME,Ie as CONFLICT_MARKER_RE,Oe as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Pt as ConfigSchema,X as DEFAULT_CHECKPOINT_RETENTION,Dt as DEFAULT_EMBEDDINGS_DIMENSIONS,U as DEFAULT_PACK_ID,lt as DocumentDurabilityState,St as EMBEDDINGS_API_KEY_ENV,hr as FEATURED_AGENT_IDS,at as FILE_SYSTEM_WRITER,Ke as FILE_WATCHER_ORIGIN,st as FileEmbeddingsBackend,Nt as GIT_PREFLIGHT_FAIL_SPAN_NAME,ht as GIT_UPSTREAM_WRITER,yn as GitDirAccessError,h as GitNotAvailableError,un as GitTooOldError,Rt as HOCUSPOCUS_AUTH_REJECTION_REASONS,Zr as HocuspocusAuthRejection,di as HocuspocusAuthTokenSchema,hi as INSTALLED_AGENTS_SCHEMES,a as LINEAGE_EPOCH_KEY,We as LIVE_DERIVED_INDEX_DEBOUNCE_MS,ie as LOG_MD_TEMPLATE,rt as MANAGED_RENAME_ORIGIN,Xe as MAX_ACP_THREADS,M as MAX_AGENT_SESSIONS,Fr as MCP_CONNECTION_ID_HEADER,e as MCP_SERVER_NAME,je as MIN_EVICTABLE_IDLE_MS,zr as MIN_GIT_VERSION,Y as MISSING_OK_CONFIG_MESSAGE,Ft as MalformedGitPointerError,d as McpLogger,it as MissingOkConfigError,_ as OBSERVER_SYNC_ORIGIN,on as OK_OKIGNORE_TEMPLATE,t as ORPHAN_MODES,u as PROTOCOL_VERSION,Wi as PinoLogger,Yi as ProcessLockCollisionError,Kn as ProjectGitInitError,R as ROLLBACK_ORIGIN,gn as ROOT_GITIGNORE_TEMPLATE,Zi as RUNTIME_VERSION,an as RemoteConfigError,G as SERVICE_WRITER,Pn as SKILL_INSTALL_EVENTS_FILE_REL,n as SKILL_STATE_TARGETS,ye as STARTER_FOLDERS,Je as STARTER_FOLDER_FRONTMATTER_FILENAME,gi as STARTER_PACKS,T as STARTER_PACK_IDS,pt as STARTER_TEMPLATES,et as STATE_MANIFEST_FILENAME,qi as STATE_SCHEMA_VERSION,l as SYSTEM_DOC_NAME,Cr as SeedPrerequisiteError,le as SeedRootDirError,sa as ServerLockCollisionError,Ir as SingleFileNotAFileError,nr as SingleFileNotFoundError,wr as SingleFileNotMarkdownError,F as StateManifestError,mi as TagIndex,_n as USER_GLOBAL_BUNDLE_IDS,Z as UiLockCollisionError,P as __getShowAllWalkStatsForTesting,Ne as __resetShowAllWalkStatsForTesting,ea as acquireProcessLock,na as acquireServerLock,ot as acquireUiLock,Hn as applyAgentMarkdownWrite,Se as applyExternalChange,Re as applySeed,j as assertCompatibleStateManifest,ar as assertGitAvailable,qt as assertNeverDiskEvent,Kt as attachAcpThreadSocket,kn as attachIdleShutdown,qr as bootServer,xr as buildAndOpenSkill,_r as buildConfigYmlContent,ae as buildExecResult,D as buildOkMcpStdioCommand,fr as buildSkillZip,$ as buildStarterFolderFrontmatterYaml,de as buildWipTree,vr as bundleSkillMdPath,_t as canonicalProjectKey,ii as classifyEvents,ji as classifyFsPath,q as clearAllEmbeddingsKeys,He as clearContributors,ct as coercePackId,c as colorFromSeed,br as commitUpstreamImport,oe as commitWip,Tt as commitWipFromTree,Dr as compareSemver,Sn as composeEffectiveLinterConfig,Lt as composeFrontmatterSchemasConfig,V as containsConflictMarkers,Ze as contentHash,m as contributorCount,Pe as countShadowObjects,z as countStaleAgentWipRefs,ee as countWipRefs,Gn as createApiExtension,Qt as createAssetServeMiddleware,Wn as createContentFilter,y as createContentFilterAsync,pe as createEmbeddingsSecretStore,An as createEphemeralProjectDir,De as createExternalChangeHandler,pn as createFileLogger,fi as createLiveDerivedIndexExtension,ue as createMcpHttpHandler,w as createOsProbe,Te as createPersistenceExtension,E as createServer,In as createServerObserverExtension,Ee as createStreamingErrorWriter,Hi as createTestLogger,Sr as describeStoredEmbeddingsKey,vn as detectClaudeDesktopPresence,Nn as detectGit,Ae as detectProjectShape,se as detectUserSkillHosts,sr as discoverLockDirs,Jt as discoverMarkdownlintConfig,Ue as emitPreflightFailureSpan,wt as encodeDocName,yt as encodeFolderRoute,kt as encodeSkillRoute,Hr as ensureProjectGit,er as ensureProjectSkillGitignore,Fe as errorResponse,O as evictStaleTrackerEntries,b as extractHeadings,kr as extractOkBinaryPath,dt as extractWikiLinksFromMarkdown,Ht as fallbackPaths,nn as findEnclosingGitRoot,Yr as findEnclosingProjectRoot,ai as findNativeMarkdownlintFile,mr as flushFileLogger,Yt as formatAuthRejectionWire,ln as formatContributors,Rr as formatContributorsFrom,we as formatPackRationale,bt as gcCheckpointRefs,fn as getCurrentMcpLogger,Vt as getLocalDir,Zn as getLogFilePath,Ui as getLogger,wn as getLogsDir,la as getMachineId,Ii as getMeter,Tr as getMetrics,xi as getTracer,jn as handleCollabSocketError,Le as handleSpawnCursor,hn as hasForwardingHeaders,he as hasGcLogLatch,s as iconFromClientName,Bt as incrementCollabSocketFilteredError,lr as incrementServerObserverFire,Dn as initContent,At as initShadowRepo,Fi as initTelemetry,Gt as initToleranceTelemetryWriter,pr as installPrettyZodErrors,Bi as installTestLoggers,Et as installUserSkill,Wr as isAllowedApiOrigin,En as isAllowedWorkspaceHostHeader,ge as isConfigDoc,oi as isHocuspocusAuthRejectionReason,vt as isKnownPackId,Ge as isLinkIndexExcludedDoc,bn as isLoopbackAddress,pi as isManagedArtifactDoc,r as isOrphanMode,Ln as isPairedWriteOrigin,H as isPathWithinDir,ua as isProcessAlive,li as isProjectRoot,gr as isRemoteAdmitted,S as isReservedForUserTree,ei as isSelfWrite,ut as isSystemDoc,ni as isToleranceTelemetryEnabled,Ki as isValidLockPid,nt as lastKnownHash,Be as listRescueCheckpoints,J as listStarterPacks,Qn as loadCustomAgents,be as loadPrincipal,ca as lockFilePath,Li as loggerFactory,Vi as logsCurrentPath,Gi as logsPreviousPath,ce as makeLazyEmbeddingsKeyStore,aa as markServerLockDraining,mt as mountMcpAndApi,Oi as normalizeFsPath,tr as originGitHubHost,xn as packageVersionMajorMinor,$e as parseAuthRejectionWire,dr as parseGitVersion,A as parseHocuspocusAuthToken,W as parseKeepaliveConnectionId,L as pathToDocName,ke as planSeed,zt as prepareSingleFileOpen,Fn as processCommand,Wt as processUsage,xt as readAllTargets,jt as readBundleDecision,Qe as readOwnNativeRules,Xi as readProcessLock,ia as readProcessLockDetailed,x as readProjectHeadState,Q as readProjectLocalSemanticConfig,$i as readServerLock,Ve as readServerPackageVersion,p as readSkillInstallStateSnapshot,Vn as readStateManifest,dn as readTargetRecordedAt,Br as readTargetVersion,gt as readUiLock,ne as reconcile,ir as recordContributor,Ut as recordSkillInstallEvent,yr as registerAllTools,N as registerWrite,ta as releaseProcessLock,Ji as releaseServerLock,K as releaseUiLock,Me as removeLastKnownHash,jr as resetMetrics,i as resolveBundleEnabled,Pr as resolveBundledSkillDir,ur as resolveContentDir,re as resolveCursorBinaryDefault,ve as resolveCursorSpawnInvocation,Xr as resolveEffectiveLinterConfig,Mt as resolveEmbeddingsCredential,Mr as resolveLockDir,ui as resolveNativeConfigForDoc,k as resolveNativeMarkdownlintConfig,me as resolvePack,Ar as resolvePackageVersion,$n as resolveRemoteAccess,ze as resolveUiInfo,Er as restoreContributors,si as restoreLifecycleFromConflictsJson,zn as rewriteMarkdownLinksForDocumentRename,Ce as rewriteWikiLinksForDocumentRename,Nr as runAuthReposSubprocess,$t as runAuthStatusSubprocess,Ot as runCloneSubprocess,Yn as runDeviceFlowSubprocess,Vr as runWithMcpLogger,Jn as safeContentPath,Bn as safeSubdir,f as safetyCheckpoint,tn as sanitizeClientName,cn as saveInMemoryCheckpoint,Lr as saveVersion,ti as seedBasenameIndex,cr as serializeError,_i as setActiveSpanAttributes,xe as setupServerObservers,rr as shadowGit,Pi as shutdownTelemetry,Ri as spansCurrentPath,zi as spansPreviousPath,qe as spawnDetached,_e as splitMarkdownBlocks,Un as startWatcher,B as streamingProblemEvent,Mn as swapContributors,Ye as teardownToleranceTelemetryWriter,Ur as toBroadcasterKey,Ti as tracedAppendFileSync,Ai as tracedLinkSync,Si as tracedMkdir,Ei as tracedMkdirSync,Mi as tracedRename,Ci as tracedRenameSync,ki as tracedRmSync,Di as tracedRmdirSync,wi as tracedUnlinkSync,bi as tracedWriteFile,Ni as tracedWriteFileSync,Qr as trustSystemCertificates,Xt as untrackTrackedProjectSkillProjection,v as updateLastKnownHash,Qi as updateProcessLockPort,ra as updateServerLockPort,fe as updateUiLockPort,rn as validateAgentId,Ct as validateCloneInputs,en as validateSkillZip,oa as waitForServerLockDrain,ft as withHiddenWindowsConsole,yi as withSpan,vi as withSpanSync,or as writeBundleDecision,On as writeMarkdownlintRule,It as writeRootGitignoreForNewRepo,g as writeStateManifest,Or as writeTargetVersion,Rn as writeTracker};