@inkeep/open-knowledge 0.29.0-beta.1 → 0.29.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 (82) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +6 -6
  4. package/dist/constants-iJEQPyMf.mjs +2 -0
  5. package/dist/{dist-D1WPeGDD.mjs → dist-BC-5uOuA.mjs} +1 -1
  6. package/dist/{dist-enzS4QJb.mjs → dist-DU6kAT_L.mjs} +5 -5
  7. package/dist/{gh-detect-CkD5P0-7.mjs → gh-detect-C8cgnhPS.mjs} +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-CD7gPvxY.mjs → init-BB94DLRV.mjs} +4 -4
  10. package/dist/init-DmRFXjVl.mjs +1 -0
  11. package/dist/{loader-BNccmd7o.mjs → loader-C8BAnl-B.mjs} +2 -2
  12. package/dist/loader-CEde1zp9.mjs +1 -0
  13. package/dist/{open-browser-DamMPOar.mjs → open-browser-Csh_BnzS.mjs} +2 -2
  14. package/dist/{preview-CJTJyhRe.mjs → preview-B3hDDzfT.mjs} +2 -2
  15. package/dist/preview-C6Q_b6ow.mjs +1 -0
  16. package/dist/public/assets/{ActivityModeContent-CxxS8nFq.js → ActivityModeContent-2tp1Q_zI.js} +1 -1
  17. package/dist/public/assets/{CodeMirrorPropInput-CI_BdrFO.js → CodeMirrorPropInput-Cl2krBi1.js} +1 -1
  18. package/dist/public/assets/{ConsentDialogBody-CG9T8kVb.js → ConsentDialogBody-DpW_fWHO.js} +1 -1
  19. package/dist/public/assets/{DocumentContext-H8ueoY2i.js → DocumentContext-BMXtV-Ln.js} +1 -1
  20. package/dist/public/assets/{EnableSyncConfirmDialog-Bfx-F020.js → EnableSyncConfirmDialog-8psqtAAY.js} +1 -1
  21. package/dist/public/assets/{GraphPanel-Bq38mdVO.js → GraphPanel-SzbCW7lv.js} +1 -1
  22. package/dist/public/assets/{ManagedArtifactProperties-BSPBOnr-.js → ManagedArtifactProperties-YzNV7lSB.js} +1 -1
  23. package/dist/public/assets/{McpConsentDialogBody-iiKQkaSO.js → McpConsentDialogBody-DL5wtFki.js} +1 -1
  24. package/dist/public/assets/{MermaidDocEditor-DeLvY3mL.js → MermaidDocEditor-CpXnSnNc.js} +1 -1
  25. package/dist/public/assets/PropertyPanel-BjgqBOzt.js +2 -0
  26. package/dist/public/assets/{SettingsDialogBody-CI2EJgcM.js → SettingsDialogBody-okqOz3JG.js} +1 -1
  27. package/dist/public/assets/{ShareBranchSwitchDialog-DCB8oBto.js → ShareBranchSwitchDialog-CHK_z72s.js} +1 -1
  28. package/dist/public/assets/{ShareReceiveDialog-Dd0J6bu0.js → ShareReceiveDialog-B7LADZTY.js} +1 -1
  29. package/dist/public/assets/{ShareReceiveMissDialog-CXxQa4KW.js → ShareReceiveMissDialog-DjXRStpL.js} +1 -1
  30. package/dist/public/assets/{SkillEditorActions-CYONKTh4.js → SkillEditorActions-BY6-FtCh.js} +1 -1
  31. package/dist/public/assets/{SourceEditor-9SpbjiWH.js → SourceEditor-CKhJOjEN.js} +1 -1
  32. package/dist/public/assets/{TerminalPanel-Cc0voOqd.js → TerminalPanel-DcsneHQ6.js} +2 -2
  33. package/dist/public/assets/{agent-presence-BH_OoZBC.js → agent-presence-CDhPSQ1V.js} +1 -1
  34. package/dist/public/assets/{auth-state-cache-Chy1TIhv.js → auth-state-cache-Sf96j0tb.js} +1 -1
  35. package/dist/public/assets/{calendar-BN0WiQjJ.js → calendar-Cpuc24Im.js} +1 -1
  36. package/dist/public/assets/{config-provider-C8aBdDar.js → config-provider-ChqdK0oC.js} +1 -1
  37. package/dist/public/assets/{dist-D5fPTJjV.js → dist-CZpHX_li.js} +1 -1
  38. package/dist/public/assets/{dist-AuN-WRQ2.js → dist-D9rK70V6.js} +1 -1
  39. package/dist/public/assets/{doc-hash-I00EhzUZ.js → doc-hash-DpRfN6nP.js} +1 -1
  40. package/dist/public/assets/{documents-events-BvkJvzEE.js → documents-events-BBnySus9.js} +1 -1
  41. package/dist/public/assets/{file-tree-adapter-DvAE1kkw.js → file-tree-adapter-Czoj_1kM.js} +1 -1
  42. package/dist/public/assets/index-cgyL6Dw7.js +2003 -0
  43. package/dist/public/assets/keyboard-shortcuts-Bh19wFn8.js +1 -0
  44. package/dist/public/assets/{navigation-targets-u2AFSpqT.js → navigation-targets-dSNCMciZ.js} +1 -1
  45. package/dist/public/assets/{open-managed-artifact-tab-BX3OwOLJ.js → open-managed-artifact-tab-Cp8GwMMz.js} +1 -1
  46. package/dist/public/assets/{pending-receive-nav-store-DD8Ei1lo.js → pending-receive-nav-store-81v0u2oK.js} +1 -1
  47. package/dist/public/assets/{prop-types-B0pfL-iG.js → prop-types-CjhSDm4-.js} +1 -1
  48. package/dist/public/assets/{receive-store-Dt6o4uQU.js → receive-store-BV3siC5s.js} +1 -1
  49. package/dist/public/assets/{selection-context-BVfXsapt.js → selection-context-BEXgwMs6.js} +1 -1
  50. package/dist/public/assets/{skill-actions-D6y739v8.js → skill-actions-CU2OFW3l.js} +1 -1
  51. package/dist/public/assets/{skills-api-C4PwgAoY.js → skills-api-Bp3kco7L.js} +1 -1
  52. package/dist/public/assets/{src-ibmWGcks.js → src-BYue3aqY.js} +1 -1
  53. package/dist/public/assets/{target-navigation-intent-P7IapNEj.js → target-navigation-intent-hg3FepK0.js} +1 -1
  54. package/dist/public/assets/{typing-burst-detector-DXjPfO7_.js → typing-burst-detector-DsAscwX2.js} +1 -1
  55. package/dist/public/assets/{workspace-paths-BTMolBhv.js → workspace-paths-YQ-7XBlO.js} +1 -1
  56. package/dist/public/index.html +29 -29
  57. package/dist/{repair-launch-json-B0B568xb.mjs → repair-launch-json-0_w3Th4l.mjs} +2 -2
  58. package/dist/{repair-mcp-configs-Cz7vaVvt.mjs → repair-mcp-configs-B5jS3LgK.mjs} +2 -2
  59. package/dist/repair-skills-B0B7a5IA.mjs +1 -0
  60. package/dist/{repair-skills-DoroYY8I.mjs → repair-skills-C_l1phOf.mjs} +2 -2
  61. package/dist/server-lock-GuuouVft-DSQyMetL.mjs +1 -0
  62. package/dist/{server-lock-iLcBw_q0-rwg8rOgA.mjs → server-lock-iLcBw_q0-CdaRzkXM.mjs} +2 -2
  63. package/dist/{src-BGLE9r6j.mjs → src-DigXo6He.mjs} +2 -2
  64. package/dist/{start-D8BbQM4c.mjs → start-Bz36N1Vk.mjs} +2 -2
  65. package/dist/start-szYTsrPy.mjs +1 -0
  66. package/dist/write-project-skill-BnCIY7g1.mjs +36 -0
  67. package/package.json +1 -1
  68. package/dist/constants-DzwzGnge.mjs +0 -2
  69. package/dist/init-BwZjunnX.mjs +0 -1
  70. package/dist/loader-B2tdFV2u.mjs +0 -1
  71. package/dist/preview-CloAm65l.mjs +0 -1
  72. package/dist/public/assets/PropertyPanel-M1FqAxBu.js +0 -2
  73. package/dist/public/assets/index-CWW9ADpk.js +0 -2003
  74. package/dist/public/assets/keyboard-shortcuts-BuZN2bTe.js +0 -1
  75. package/dist/repair-skills-DRT6PpNy.mjs +0 -1
  76. package/dist/server-lock-GuuouVft-C8t6Ffyt.mjs +0 -1
  77. package/dist/start-CSu4I80l.mjs +0 -1
  78. package/dist/write-project-skill-8alJi7YJ.mjs +0 -36
  79. /package/dist/public/assets/{cursor-Diqcx2dn.js → cursor-CjNH7VrK.js} +0 -0
  80. /package/dist/public/assets/{external-link-27uXLNxg.js → external-link-BjECE2gH.js} +0 -0
  81. /package/dist/public/assets/{format-2O9Da5Lm.js → format-EMqSStmm.js} +0 -0
  82. /package/dist/public/assets/{textarea-CfltWSGa.js → textarea-DtAQz2_P.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{J as e}from"./CodeMirrorPropInput-CI_BdrFO.js";import{B as t,C as n,H as r,P as i,V as a,b as o,et as s,p as c,tt as l,w as u,y as d}from"./config-provider-C8aBdDar.js";import{$ as f,Et as p,J as m,Ot as h,Q as g,X as _,jt as v,xt as y}from"./dist-Dot7Y1W_.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(n(t.yanchor),n(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return u(this.ytext,e,t)}fromYPos(e){let t=o(n(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=h.define({combine(e){return e[e.length-1]}}),C=y.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
1
+ import{J as e}from"./CodeMirrorPropInput-Cl2krBi1.js";import{B as t,C as n,H as r,P as i,V as a,b as o,et as s,p as c,tt as l,w as u,y as d}from"./config-provider-ChqdK0oC.js";import{$ as f,Et as p,J as m,Ot as h,Q as g,X as _,jt as v,xt as y}from"./dist-Dot7Y1W_.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(n(t.yanchor),n(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return u(this.ytext,e,t)}fromYPos(e){let t=o(n(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=h.define({combine(e){return e[e.length-1]}}),C=y.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
2
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=g.fromClass(w),E=_.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=y.define(),O=class extends f{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return t(`span`,[r(`class`,`cm-ySelectionCaret`),r(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[a(`⁠`),t(`div`,[r(`class`,`cm-ySelectionCaretDot`)]),a(`⁠`),t(`div`,[r(`class`,`cm-ySelectionInfo`)],[a(this.name)]),a(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=v.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,r=t.doc,i=this.conf.awareness,a=[],c=this.conf.awareness.getLocalState();if(c!=null){let r=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),a=r?e.state.selection.main:null,o=c.cursor==null?null:n(c.cursor.anchor),s=c.cursor==null?null:n(c.cursor.head);if(a!=null){let e=u(t,a.anchor),n=u(t,a.head);(c.cursor==null||!d(o,e)||!d(s,n))&&i.setLocalStateField(`cursor`,{anchor:e,head:n})}else c.cursor!=null&&r&&i.setLocalStateField(`cursor`,null)}i.getStates().forEach((n,c)=>{if(c===i.doc.clientID)return;let u=n.cursor;if(u==null||u.anchor==null||u.head==null)return;let d=o(u.anchor,r),f=o(u.head,r);if(d==null||f==null||d.type!==t||f.type!==t)return;let{color:p=`#30bced`,name:h=`Anonymous`}=n.user||{},g=n.user&&n.user.colorLight||p+`33`,_=l(d.index,f.index),v=s(d.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)a.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{a.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),a.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;a.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}a.push({from:f.index,to:f.index,value:m.widget({side:f.index-d.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(a,!0)}},A=g.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=h.define({combine(e){return e[e.length-1]}});y.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[_.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=g.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,_.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as t};
@@ -1 +1 @@
1
- import{a as e}from"./navigation-targets-u2AFSpqT.js";import{l as t}from"./doc-hash-I00EhzUZ.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=e(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?t({scope:a.scope,name:a.name,path:a.path}):null,displayState:n(a)}}export{r as t};
1
+ import{a as e}from"./navigation-targets-dSNCMciZ.js";import{l as t}from"./doc-hash-DpRfN6nP.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=e(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?t({scope:a.scope,name:a.name,path:a.path}):null,displayState:n(a)}}export{r as t};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i}from"./DocumentContext-H8ueoY2i.js";import{n as a,r as o}from"./dist-CQw2y-s3.js";import{a as s,c,i as ee,n as te,o as ne,r as re,s as l,t as ie,u}from"./panel-BH2RZRZQ.js";import{Cr as d,Kn as ae,it as f,tt as p}from"./dist-D5fPTJjV.js";import{i as oe}from"./button-cneJOVxD.js";import{B as m,I as h}from"./CodeMirrorPropInput-CI_BdrFO.js";import{i as se}from"./prop-types-B0pfL-iG.js";import{t as g}from"./dist-BvBijIC5.js";import{i as _}from"./startup-marks-DDtA9pbt.js";var v=e(t(),1),y=r(),b=new Map;function x(e,t){b.set(e,t)}function S(e){let t=b.get(e)??null;return b.delete(e),t}function C(e){b.delete(e)}function w(e,t){let n=(0,y.c)(4),r=t===void 0?!1:t,[i,a]=(0,v.useState)(void 0),o=(0,v.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,v.useEffect)(s,c),i}var T=n(),ce=300;async function le(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(g._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=f.safeParse(n);throw e.success?Error(e.data.title):new m(g._({id:`zlErBl`}),{status:t.status})}let r=p.safeParse(n);if(!r.success)throw new m(g._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var E=32,D=12,O=6,k=`open-knowledge:outline-nav`;function A(e){let t=(0,y.c)(2),n;return t[0]===e?n=t[1]:(n=(0,T.jsx)(_,{name:`outline-panel`,children:(0,T.jsx)(j,{...e})}),t[0]=e,t[1]=n),n}function j(e){let t=(0,y.c)(50),{docName:n,isSourceMode:r,className:d}=e,f=d===void 0?``:d,{_:p}=o(),{pages:m,loading:h}=se(),g=u(),{activeProvider:_,activeDocName:b}=i(),S,C;t[0]===n?(S=t[1],C=t[2]):(S=[`page-headings`,n],C=()=>le(n),t[0]=n,t[1]=S,t[2]=C);let A;t[3]!==n||t[4]!==h||t[5]!==m?(A=!h&&(m.has(n)||ae(n)),t[3]=n,t[4]=h,t[5]=m,t[6]=A):A=t[6];let j;t[7]!==S||t[8]!==C||t[9]!==A?(j={queryKey:S,queryFn:C,enabled:A,staleTime:1/0},t[7]=S,t[8]=C,t[9]=A,t[10]=j):j=t[10];let{data:N,isLoading:P,error:F}=c(j),I;t[11]===N?I=t[12]:(I=N===void 0?[]:N,t[11]=N,t[12]=I);let L=I,R,z;t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==g?(R=()=>{if(!_||b!==n)return;let e=_.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,g.invalidateQueries({queryKey:[`page-headings`,n]})},ce)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},z=[_,b,n,g],t[13]=b,t[14]=_,t[15]=n,t[16]=g,t[17]=R,t[18]=z):(R=t[17],z=t[18]),(0,v.useEffect)(R,z);let B;t[19]===L?B=t[20]:(B=L.map(M),t[19]=L,t[20]=B);let V=w(B,r),H;t[21]!==V||t[22]!==L?(H=V?L.findIndex(e=>e.slug===V):-1,t[21]=V,t[22]=L,t[23]=H):H=t[23];let U=H,W;t[24]!==n||t[25]!==r?(W=function(e,t){let i={index:e,slug:t,mode:r?`source`:`wysiwyg`};i.mode===`source`&&x(n,{kind:`outline`,detail:i}),window.dispatchEvent(new CustomEvent(k,{detail:i}))},t[24]=n,t[25]=r,t[26]=W):W=t[26];let G=W,K=((U>=0?L[U].level:1)-1)*D+(D-O)/2,q=U*E+(E-O)/2,J;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,T.jsx)(l,{children:(0,T.jsx)(a,{id:`dD7NPy`})}),t[27]=J):J=t[27];let Y;t[28]!==L.length||t[29]!==P?(Y=!P&&(0,T.jsx)(re,{children:L.length}),t[28]=L.length,t[29]=P,t[30]=Y):Y=t[30];let X;t[31]===Y?X=t[32]:(X=(0,T.jsxs)(ne,{children:[J,Y]}),t[31]=Y,t[32]=X);let Z;t[33]!==p||t[34]!==U||t[35]!==V||t[36]!==F||t[37]!==G||t[38]!==L||t[39]!==P||t[40]!==K||t[41]!==q?(Z=F?(0,T.jsx)(s,{className:`px-2`,children:F instanceof Error?F.message:p({id:`GuqOb1`})}):L.length===0&&!P?(0,T.jsx)(ee,{className:`px-2`,children:(0,T.jsx)(a,{id:`0BB9ID`})}):(0,T.jsxs)(`nav`,{"aria-label":p({id:`BymzO4`}),className:`relative`,children:[U>=0&&(0,T.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:O,height:O,transform:`translate(${K}px, ${q}px)`}}),L.map((e,t)=>{let n=e.slug===V;return(0,T.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>G(t,e.slug),className:oe(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*D+20}px`},title:e.text,children:e.text},t)})]}),t[33]=p,t[34]=U,t[35]=V,t[36]=F,t[37]=G,t[38]=L,t[39]=P,t[40]=K,t[41]=q,t[42]=Z):Z=t[42];let Q;t[43]!==P||t[44]!==Z?(Q=(0,T.jsx)(te,{className:`px-3 py-2`,"aria-busy":P,children:Z}),t[43]=P,t[44]=Z,t[45]=Q):Q=t[45];let $;return t[46]!==f||t[47]!==X||t[48]!==Q?($=(0,T.jsxs)(ie,{className:f,children:[X,Q]}),t[46]=f,t[47]=X,t[48]=Q,t[49]=$):$=t[49],$}function M(e){return e.slug}var N={words:0,chars:0,tokens:0},P=/[ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿豈-﫿＀-￯฀-๿ក-៿]/,F=/[\p{L}\p{N}]/u,I=new Set([`text`,`inlineCode`,`code`,`tag`]),L=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),R=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function z(e,t){if(!e)return;let n=e.type;if(!L.has(n)){if(I.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i}from"./DocumentContext-BMXtV-Ln.js";import{n as a,r as o}from"./dist-CQw2y-s3.js";import{a as s,c,i as ee,n as te,o as ne,r as re,s as l,t as ie,u}from"./panel-BH2RZRZQ.js";import{Cr as d,Kn as ae,it as f,tt as p}from"./dist-CZpHX_li.js";import{i as oe}from"./button-cneJOVxD.js";import{B as m,I as h}from"./CodeMirrorPropInput-Cl2krBi1.js";import{i as se}from"./prop-types-CjhSDm4-.js";import{t as g}from"./dist-BvBijIC5.js";import{i as _}from"./startup-marks-DDtA9pbt.js";var v=e(t(),1),y=r(),b=new Map;function x(e,t){b.set(e,t)}function S(e){let t=b.get(e)??null;return b.delete(e),t}function C(e){b.delete(e)}function w(e,t){let n=(0,y.c)(4),r=t===void 0?!1:t,[i,a]=(0,v.useState)(void 0),o=(0,v.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,v.useEffect)(s,c),i}var T=n(),ce=300;async function le(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(g._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=f.safeParse(n);throw e.success?Error(e.data.title):new m(g._({id:`zlErBl`}),{status:t.status})}let r=p.safeParse(n);if(!r.success)throw new m(g._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var E=32,D=12,O=6,k=`open-knowledge:outline-nav`;function A(e){let t=(0,y.c)(2),n;return t[0]===e?n=t[1]:(n=(0,T.jsx)(_,{name:`outline-panel`,children:(0,T.jsx)(j,{...e})}),t[0]=e,t[1]=n),n}function j(e){let t=(0,y.c)(50),{docName:n,isSourceMode:r,className:d}=e,f=d===void 0?``:d,{_:p}=o(),{pages:m,loading:h}=se(),g=u(),{activeProvider:_,activeDocName:b}=i(),S,C;t[0]===n?(S=t[1],C=t[2]):(S=[`page-headings`,n],C=()=>le(n),t[0]=n,t[1]=S,t[2]=C);let A;t[3]!==n||t[4]!==h||t[5]!==m?(A=!h&&(m.has(n)||ae(n)),t[3]=n,t[4]=h,t[5]=m,t[6]=A):A=t[6];let j;t[7]!==S||t[8]!==C||t[9]!==A?(j={queryKey:S,queryFn:C,enabled:A,staleTime:1/0},t[7]=S,t[8]=C,t[9]=A,t[10]=j):j=t[10];let{data:N,isLoading:P,error:F}=c(j),I;t[11]===N?I=t[12]:(I=N===void 0?[]:N,t[11]=N,t[12]=I);let L=I,R,z;t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==g?(R=()=>{if(!_||b!==n)return;let e=_.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,g.invalidateQueries({queryKey:[`page-headings`,n]})},ce)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},z=[_,b,n,g],t[13]=b,t[14]=_,t[15]=n,t[16]=g,t[17]=R,t[18]=z):(R=t[17],z=t[18]),(0,v.useEffect)(R,z);let B;t[19]===L?B=t[20]:(B=L.map(M),t[19]=L,t[20]=B);let V=w(B,r),H;t[21]!==V||t[22]!==L?(H=V?L.findIndex(e=>e.slug===V):-1,t[21]=V,t[22]=L,t[23]=H):H=t[23];let U=H,W;t[24]!==n||t[25]!==r?(W=function(e,t){let i={index:e,slug:t,mode:r?`source`:`wysiwyg`};i.mode===`source`&&x(n,{kind:`outline`,detail:i}),window.dispatchEvent(new CustomEvent(k,{detail:i}))},t[24]=n,t[25]=r,t[26]=W):W=t[26];let G=W,K=((U>=0?L[U].level:1)-1)*D+(D-O)/2,q=U*E+(E-O)/2,J;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,T.jsx)(l,{children:(0,T.jsx)(a,{id:`dD7NPy`})}),t[27]=J):J=t[27];let Y;t[28]!==L.length||t[29]!==P?(Y=!P&&(0,T.jsx)(re,{children:L.length}),t[28]=L.length,t[29]=P,t[30]=Y):Y=t[30];let X;t[31]===Y?X=t[32]:(X=(0,T.jsxs)(ne,{children:[J,Y]}),t[31]=Y,t[32]=X);let Z;t[33]!==p||t[34]!==U||t[35]!==V||t[36]!==F||t[37]!==G||t[38]!==L||t[39]!==P||t[40]!==K||t[41]!==q?(Z=F?(0,T.jsx)(s,{className:`px-2`,children:F instanceof Error?F.message:p({id:`GuqOb1`})}):L.length===0&&!P?(0,T.jsx)(ee,{className:`px-2`,children:(0,T.jsx)(a,{id:`0BB9ID`})}):(0,T.jsxs)(`nav`,{"aria-label":p({id:`BymzO4`}),className:`relative`,children:[U>=0&&(0,T.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:O,height:O,transform:`translate(${K}px, ${q}px)`}}),L.map((e,t)=>{let n=e.slug===V;return(0,T.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>G(t,e.slug),className:oe(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*D+20}px`},title:e.text,children:e.text},t)})]}),t[33]=p,t[34]=U,t[35]=V,t[36]=F,t[37]=G,t[38]=L,t[39]=P,t[40]=K,t[41]=q,t[42]=Z):Z=t[42];let Q;t[43]!==P||t[44]!==Z?(Q=(0,T.jsx)(te,{className:`px-3 py-2`,"aria-busy":P,children:Z}),t[43]=P,t[44]=Z,t[45]=Q):Q=t[45];let $;return t[46]!==f||t[47]!==X||t[48]!==Q?($=(0,T.jsxs)(ie,{className:f,children:[X,Q]}),t[46]=f,t[47]=X,t[48]=Q,t[49]=$):$=t[49],$}function M(e){return e.slug}var N={words:0,chars:0,tokens:0},P=/[ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿豈-﫿＀-￯฀-๿ក-៿]/,F=/[\p{L}\p{N}]/u,I=new Set([`text`,`inlineCode`,`code`,`tag`]),L=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),R=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function z(e,t){if(!e)return;let n=e.type;if(!L.has(n)){if(I.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
2
2
  `));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)z(n,t);if(R.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
3
3
  `)&&t.push(`
4
4
  `)}}}}function B(e){try{let t=h().parseToMdast(e),n=[];return z(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function V(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))F.test(n)&&t++;return t}function H(e){let t=globalThis.Intl.Segmenter;if(!t)return V(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function U(e){let t=P.test(e)?1.5:4;return Math.ceil(e.length/t)}function W(e){return e?{words:P.test(e)?H(e):V(e),chars:e.length,tokens:U(e)}:{words:0,chars:0,tokens:0}}function G(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=d(e);return t.trim()?W(B(t)):{words:0,chars:0,tokens:0}}function K(e,{isMarkdown:t}){let n=e.trim();return n?W(t?B(e):n):N}var q=new Map,J=new Set,Y=(e,t)=>`${t}:${e}`;function X(){for(let e of J)e()}function Z(e,t,n){let r=Y(e,t);if(n===null){q.delete(r)&&X();return}let i=q.get(r);i&&i.words===n.words&&i.chars===n.chars&&i.tokens===n.tokens||(q.set(r,n),X())}function Q(e,t){return e===null?null:q.get(Y(e,t))??null}function $(e){return J.add(e),()=>{J.delete(e)}}function ue(e){let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{r as n}from"./dist-CQw2y-s3.js";import{fn as r}from"./dist-D5fPTJjV.js";import{u as i}from"./button-cneJOVxD.js";var a=i(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),o=i(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),s=i(`pencil`,[[`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`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),c=i(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),l=[`global`,`project`];function u(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var d=`open-knowledge-pack-`;function f(e){return e.startsWith(d)?e.slice(20):e}function p(){let{_:e}=n();return{project:e({id:`e0NrBM`}),global:e({id:`2GT3Hf`})}}function m(){let{_:e}=n();return{project:e({id:`HyvSqq`}),global:e({id:`C7XjNB`})}}var h=e(t(),1);function g(){let[e]=(0,h.useState)(_);return e}function _(){return r()!=null}function v(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var y=/\.(md|mdx)$/i;function b(e){return y.test(e)?e:`${e}.md`}export{f as a,m as c,o as d,a as f,l as i,c as l,v as n,u as o,g as r,p as s,b as t,s as u};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{r as n}from"./dist-CQw2y-s3.js";import{fn as r}from"./dist-CZpHX_li.js";import{u as i}from"./button-cneJOVxD.js";var a=i(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),o=i(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),s=i(`pencil`,[[`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`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),c=i(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),l=[`global`,`project`];function u(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var d=`open-knowledge-pack-`;function f(e){return e.startsWith(d)?e.slice(20):e}function p(){let{_:e}=n();return{project:e({id:`e0NrBM`}),global:e({id:`2GT3Hf`})}}function m(){let{_:e}=n();return{project:e({id:`HyvSqq`}),global:e({id:`C7XjNB`})}}var h=e(t(),1);function g(){let[e]=(0,h.useState)(_);return e}function _(){return r()!=null}function v(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var y=/\.(md|mdx)$/i;function b(e){return y.test(e)?e:`${e}.md`}export{f as a,m as c,o as d,a as f,l as i,c as l,v as n,u as o,g as r,p as s,b as t,s as u};
@@ -48,7 +48,7 @@
48
48
  -->
49
49
  <script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } if (dark) document.documentElement.classList.add('dark'); if (window.okDesktop) document.documentElement.classList.add('electron-mode'); })();</script>
50
50
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
51
- <script type="module" crossorigin src="./assets/index-CWW9ADpk.js"></script>
51
+ <script type="module" crossorigin src="./assets/index-cgyL6Dw7.js"></script>
52
52
  <link rel="modulepreload" crossorigin href="./assets/chunk-CFjPhJqf.js">
53
53
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-2ej06EnG.js">
54
54
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-CHcJEDvG.js">
@@ -64,11 +64,11 @@
64
64
  <link rel="modulepreload" crossorigin href="./assets/stex-4t0JIuX_.js">
65
65
  <link rel="modulepreload" crossorigin href="./assets/floating-ui.dom-DVRWCLii.js">
66
66
  <link rel="modulepreload" crossorigin href="./assets/trace-api-D6fqC5Nw.js">
67
- <link rel="modulepreload" crossorigin href="./assets/dist-D5fPTJjV.js">
67
+ <link rel="modulepreload" crossorigin href="./assets/dist-CZpHX_li.js">
68
68
  <link rel="modulepreload" crossorigin href="./assets/compiler-runtime-CVnuRdak.js">
69
69
  <link rel="modulepreload" crossorigin href="./assets/dist-BVOt51sU.js">
70
70
  <link rel="modulepreload" crossorigin href="./assets/config-context-CE3SCVYc.js">
71
- <link rel="modulepreload" crossorigin href="./assets/config-provider-C8aBdDar.js">
71
+ <link rel="modulepreload" crossorigin href="./assets/config-provider-ChqdK0oC.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/dist-BvBijIC5.js">
73
73
  <link rel="modulepreload" crossorigin href="./assets/dist-CQw2y-s3.js">
74
74
  <link rel="modulepreload" crossorigin href="./assets/button-cneJOVxD.js">
@@ -76,14 +76,14 @@
76
76
  <link rel="modulepreload" crossorigin href="./assets/trash-2-Dcpo0Di-.js">
77
77
  <link rel="modulepreload" crossorigin href="./assets/triangle-alert-c3yCucJv.js">
78
78
  <link rel="modulepreload" crossorigin href="./assets/react-dom-C-oc-P2K.js">
79
- <link rel="modulepreload" crossorigin href="./assets/doc-hash-I00EhzUZ.js">
80
- <link rel="modulepreload" crossorigin href="./assets/navigation-targets-u2AFSpqT.js">
79
+ <link rel="modulepreload" crossorigin href="./assets/doc-hash-DpRfN6nP.js">
80
+ <link rel="modulepreload" crossorigin href="./assets/navigation-targets-dSNCMciZ.js">
81
81
  <link rel="modulepreload" crossorigin href="./assets/documents-fetch-DqIXnUVU.js">
82
- <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-CI_BdrFO.js">
83
- <link rel="modulepreload" crossorigin href="./assets/dist-AuN-WRQ2.js">
84
- <link rel="modulepreload" crossorigin href="./assets/documents-events-BvkJvzEE.js">
82
+ <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-Cl2krBi1.js">
83
+ <link rel="modulepreload" crossorigin href="./assets/dist-D9rK70V6.js">
84
+ <link rel="modulepreload" crossorigin href="./assets/documents-events-BBnySus9.js">
85
85
  <link rel="modulepreload" crossorigin href="./assets/parse-api-error-CqtA8BcL.js">
86
- <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-BX3OwOLJ.js">
86
+ <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-Cp8GwMMz.js">
87
87
  <link rel="modulepreload" crossorigin href="./assets/dist-BSkHa6UR.js">
88
88
  <link rel="modulepreload" crossorigin href="./assets/dist-fpPv-rVb.js">
89
89
  <link rel="modulepreload" crossorigin href="./assets/propagation-api-BHhJitgG.js">
@@ -97,44 +97,44 @@
97
97
  <link rel="modulepreload" crossorigin href="./assets/chevron-down-BvNcCN1f.js">
98
98
  <link rel="modulepreload" crossorigin href="./assets/chevron-right-DSNnH-Vb.js">
99
99
  <link rel="modulepreload" crossorigin href="./assets/startup-marks-DDtA9pbt.js">
100
- <link rel="modulepreload" crossorigin href="./assets/prop-types-B0pfL-iG.js">
101
- <link rel="modulepreload" crossorigin href="./assets/workspace-paths-BTMolBhv.js">
100
+ <link rel="modulepreload" crossorigin href="./assets/prop-types-CjhSDm4-.js">
101
+ <link rel="modulepreload" crossorigin href="./assets/workspace-paths-YQ-7XBlO.js">
102
102
  <link rel="modulepreload" crossorigin href="./assets/eye-WB1l5kVb.js">
103
103
  <link rel="modulepreload" crossorigin href="./assets/git-branch-q0qWPEwd.js">
104
104
  <link rel="modulepreload" crossorigin href="./assets/info-BlYnsVoP.js">
105
105
  <link rel="modulepreload" crossorigin href="./assets/loader-circle-B7Gv_Djz.js">
106
106
  <link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-DeKIxKnc.js">
107
107
  <link rel="modulepreload" crossorigin href="./assets/input-tW78aNaR.js">
108
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-H8ueoY2i.js">
108
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-BMXtV-Ln.js">
109
109
  <link rel="modulepreload" crossorigin href="./assets/checkbox-DurEHAAx.js">
110
110
  <link rel="modulepreload" crossorigin href="./assets/dist-CyYz03up.js">
111
- <link rel="modulepreload" crossorigin href="./assets/skills-api-C4PwgAoY.js">
111
+ <link rel="modulepreload" crossorigin href="./assets/skills-api-Bp3kco7L.js">
112
112
  <link rel="modulepreload" crossorigin href="./assets/label-DPn_C7ZD.js">
113
113
  <link rel="modulepreload" crossorigin href="./assets/radio-group-CXUz67M8.js">
114
- <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-Bfx-F020.js">
114
+ <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-8psqtAAY.js">
115
115
  <link rel="modulepreload" crossorigin href="./assets/arrow-up-right-Crm0Btez.js">
116
116
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-CluaccKu.js">
117
- <link rel="modulepreload" crossorigin href="./assets/cursor-Diqcx2dn.js">
118
- <link rel="modulepreload" crossorigin href="./assets/skill-actions-D6y739v8.js">
119
- <link rel="modulepreload" crossorigin href="./assets/textarea-CfltWSGa.js">
120
- <link rel="modulepreload" crossorigin href="./assets/external-link-27uXLNxg.js">
121
- <link rel="modulepreload" crossorigin href="./assets/keyboard-shortcuts-BuZN2bTe.js">
122
- <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-Chy1TIhv.js">
117
+ <link rel="modulepreload" crossorigin href="./assets/cursor-CjNH7VrK.js">
118
+ <link rel="modulepreload" crossorigin href="./assets/skill-actions-CU2OFW3l.js">
119
+ <link rel="modulepreload" crossorigin href="./assets/textarea-DtAQz2_P.js">
120
+ <link rel="modulepreload" crossorigin href="./assets/external-link-BjECE2gH.js">
121
+ <link rel="modulepreload" crossorigin href="./assets/keyboard-shortcuts-Bh19wFn8.js">
122
+ <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-Sf96j0tb.js">
123
123
  <link rel="modulepreload" crossorigin href="./assets/toggle-group-CXHn0FKi.js">
124
124
  <link rel="modulepreload" crossorigin href="./assets/panel-BH2RZRZQ.js">
125
- <link rel="modulepreload" crossorigin href="./assets/format-2O9Da5Lm.js">
126
- <link rel="modulepreload" crossorigin href="./assets/selection-context-BVfXsapt.js">
127
- <link rel="modulepreload" crossorigin href="./assets/PropertyPanel-M1FqAxBu.js">
125
+ <link rel="modulepreload" crossorigin href="./assets/format-EMqSStmm.js">
126
+ <link rel="modulepreload" crossorigin href="./assets/selection-context-BEXgwMs6.js">
127
+ <link rel="modulepreload" crossorigin href="./assets/PropertyPanel-BjgqBOzt.js">
128
128
  <link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-PJQ_kr0I.js">
129
- <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-DD8Ei1lo.js">
129
+ <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-81v0u2oK.js">
130
130
  <link rel="modulepreload" crossorigin href="./assets/chevron-left-BEP8MhU3.js">
131
- <link rel="modulepreload" crossorigin href="./assets/agent-presence-BH_OoZBC.js">
132
- <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-DXjPfO7_.js">
131
+ <link rel="modulepreload" crossorigin href="./assets/agent-presence-CDhPSQ1V.js">
132
+ <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-DsAscwX2.js">
133
133
  <link rel="modulepreload" crossorigin href="./assets/project-paths-Cv9JzTbQ.js">
134
- <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-DvAE1kkw.js">
135
- <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-P7IapNEj.js">
134
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-Czoj_1kM.js">
135
+ <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-hg3FepK0.js">
136
136
  <link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-BxRtlIhJ.js">
137
- <link rel="modulepreload" crossorigin href="./assets/receive-store-Dt6o4uQU.js">
137
+ <link rel="modulepreload" crossorigin href="./assets/receive-store-BV3siC5s.js">
138
138
  <link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
139
139
  <link rel="stylesheet" crossorigin href="./assets/index-Ba1S3D-p.css">
140
140
  </head>
@@ -1,2 +1,2 @@
1
- import{S as e,r as t}from"./init-CD7gPvxY.mjs";import{t as n}from"./is-object-Cg453afR.mjs";import{join as r}from"node:path";import{existsSync as i,readFileSync as a}from"node:fs";const o=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],t];function s(e){if(e.runtimeExecutable===`/bin/sh`&&Array.isArray(e.runtimeArgs)){let t=e.runtimeArgs[2];if(typeof t==`string`){if(t.includes(`# ok-ui-v1`))return`canonical`;if(/# ok-ui-v\d+/.test(t))return`legacy-bare`}return`preserved`}if(e.runtimeExecutable===`powershell`&&Array.isArray(e.runtimeArgs)){let t=e.runtimeArgs[3];if(typeof t==`string`){if(t.includes(`# ok-ui-win-v1`))return`canonical`;if(/# ok-ui-win-v\d+/.test(t))return`legacy-bare`}return`preserved`}if(e.runtimeExecutable===`npx`&&Array.isArray(e.runtimeArgs)){for(let t of o)if(c(e.runtimeArgs,t))return`legacy-bare`}return`preserved`}function c(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function l(t){let o=t.logger??u,c=r(t.projectDir,`.claude`,`launch.json`);if(t.reclaimDisableEnv===`1`)return o({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:c,outcome:`skipped-reclaim-disabled`},repairedCount:0};if(!i(c))return{outcome:{configPath:c,outcome:`no-file`},repairedCount:0};let l;try{let e=a(c,`utf-8`).trim();l=e?JSON.parse(e):{}}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`launch-json-repair-read-failed`,configPath:c,error:t}),{outcome:{configPath:c,outcome:`read-failed`,error:t},repairedCount:0}}if(!n(l)){let e=`launch.json root is not an object`;return o({event:`launch-json-repair-read-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`read-failed`,error:e},repairedCount:0}}let d=l.configurations;if(!Array.isArray(d))return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let f=d.find(e=>n(e)&&e.name===`open-knowledge-ui`);if(!f)return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let p=s(f);if(p===`canonical`)return{outcome:{configPath:c,outcome:`canonical`},repairedCount:0};if(p===`preserved`)return{outcome:{configPath:c,outcome:`preserved`},repairedCount:0};let m=e(t.projectDir,{mode:`published`});if(m.action===`failed`){let e=m.error??`unknown write failure`;return o({event:`launch-json-repair-write-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`write-failed`,error:e},repairedCount:0}}return o({event:`launch-json-repair-applied`,configPath:c}),{outcome:{configPath:c,outcome:`repaired`},repairedCount:1}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{l as repairLaunchJson};
2
- //# sourceMappingURL=repair-launch-json-B0B568xb.mjs.map
1
+ import{S as e,r as t}from"./init-BB94DLRV.mjs";import{t as n}from"./is-object-Cg453afR.mjs";import{join as r}from"node:path";import{existsSync as i,readFileSync as a}from"node:fs";const o=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],t];function s(e){if(e.runtimeExecutable===`/bin/sh`&&Array.isArray(e.runtimeArgs)){let t=e.runtimeArgs[2];if(typeof t==`string`){if(t.includes(`# ok-ui-v1`))return`canonical`;if(/# ok-ui-v\d+/.test(t))return`legacy-bare`}return`preserved`}if(e.runtimeExecutable===`powershell`&&Array.isArray(e.runtimeArgs)){let t=e.runtimeArgs[3];if(typeof t==`string`){if(t.includes(`# ok-ui-win-v1`))return`canonical`;if(/# ok-ui-win-v\d+/.test(t))return`legacy-bare`}return`preserved`}if(e.runtimeExecutable===`npx`&&Array.isArray(e.runtimeArgs)){for(let t of o)if(c(e.runtimeArgs,t))return`legacy-bare`}return`preserved`}function c(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function l(t){let o=t.logger??u,c=r(t.projectDir,`.claude`,`launch.json`);if(t.reclaimDisableEnv===`1`)return o({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:c,outcome:`skipped-reclaim-disabled`},repairedCount:0};if(!i(c))return{outcome:{configPath:c,outcome:`no-file`},repairedCount:0};let l;try{let e=a(c,`utf-8`).trim();l=e?JSON.parse(e):{}}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`launch-json-repair-read-failed`,configPath:c,error:t}),{outcome:{configPath:c,outcome:`read-failed`,error:t},repairedCount:0}}if(!n(l)){let e=`launch.json root is not an object`;return o({event:`launch-json-repair-read-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`read-failed`,error:e},repairedCount:0}}let d=l.configurations;if(!Array.isArray(d))return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let f=d.find(e=>n(e)&&e.name===`open-knowledge-ui`);if(!f)return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let p=s(f);if(p===`canonical`)return{outcome:{configPath:c,outcome:`canonical`},repairedCount:0};if(p===`preserved`)return{outcome:{configPath:c,outcome:`preserved`},repairedCount:0};let m=e(t.projectDir,{mode:`published`});if(m.action===`failed`){let e=m.error??`unknown write failure`;return o({event:`launch-json-repair-write-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`write-failed`,error:e},repairedCount:0}}return o({event:`launch-json-repair-applied`,configPath:c}),{outcome:{configPath:c,outcome:`repaired`},repairedCount:1}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{l as repairLaunchJson};
2
+ //# sourceMappingURL=repair-launch-json-0_w3Th4l.mjs.map
@@ -1,2 +1,2 @@
1
- import{g as e,w as t}from"./init-CD7gPvxY.mjs";import{_ as n,d as r,s as i}from"./write-project-skill-8alJi7YJ.mjs";import{t as a}from"./mcp-migrate-event-D0NrGjvc.mjs";import{homedir as o}from"node:os";function s(e){let t=e.logger??u,n=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return t({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of i){let i=r[o],s=c(()=>i.configPath(``,n));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:i,home:n,cwd:``,configPath:s,configPathOverride:void 0,logger:t})),i.projectConfigPath){let n=i.projectConfigPath,r=c(()=>n(e.projectDir));r!==null&&a.push(l({scope:`project`,editorId:o,target:i,home:void 0,cwd:e.projectDir,configPath:r,configPathOverride:r,logger:t}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(r){let i={scope:r.scope,editorId:r.editorId,configPath:r.configPath},o=e(r.target,r.cwd,r.home,r.configPathOverride);if(o===null)return{...i,outcome:`no-entry`};if(n(o))return{...i,outcome:`canonical`};r.logger(a({scope:r.scope,surface:`cli-repair`,editorId:r.editorId,configPath:r.configPath,priorEntry:o}));let s=t(r.target,r.cwd,{mode:`published`,skipAvailabilityCheck:!0},r.home,r.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return r.logger({event:`mcp-config-repair-write-failed`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,error:e}),{...i,outcome:`write-failed`,error:e}}return s.action===`declined`?(r.logger({event:`mcp-config-repair-declined`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,reason:s.declineReason}),{...i,outcome:`declined`}):{...i,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-Cz7vaVvt.mjs.map
1
+ import{g as e,w as t}from"./init-BB94DLRV.mjs";import{_ as n,d as r,s as i}from"./write-project-skill-BnCIY7g1.mjs";import{t as a}from"./mcp-migrate-event-D0NrGjvc.mjs";import{homedir as o}from"node:os";function s(e){let t=e.logger??u,n=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return t({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of i){let i=r[o],s=c(()=>i.configPath(``,n));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:i,home:n,cwd:``,configPath:s,configPathOverride:void 0,logger:t})),i.projectConfigPath){let n=i.projectConfigPath,r=c(()=>n(e.projectDir));r!==null&&a.push(l({scope:`project`,editorId:o,target:i,home:void 0,cwd:e.projectDir,configPath:r,configPathOverride:r,logger:t}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(r){let i={scope:r.scope,editorId:r.editorId,configPath:r.configPath},o=e(r.target,r.cwd,r.home,r.configPathOverride);if(o===null)return{...i,outcome:`no-entry`};if(n(o))return{...i,outcome:`canonical`};r.logger(a({scope:r.scope,surface:`cli-repair`,editorId:r.editorId,configPath:r.configPath,priorEntry:o}));let s=t(r.target,r.cwd,{mode:`published`,skipAvailabilityCheck:!0},r.home,r.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return r.logger({event:`mcp-config-repair-write-failed`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,error:e}),{...i,outcome:`write-failed`,error:e}}return s.action===`declined`?(r.logger({event:`mcp-config-repair-declined`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,reason:s.declineReason}),{...i,outcome:`declined`}):{...i,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-B5jS3LgK.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-C_l1phOf.mjs";export{e as repairSkills};
@@ -1,3 +1,3 @@
1
- import{ua as e}from"./server-lock-iLcBw_q0-rwg8rOgA.mjs";import{Jr as t,Lr as n,Wr as r,ca as i,d as a,ei as o,ia as s,ut as c,zr as l}from"./dist-enzS4QJb.mjs";import{t as u}from"./esm-CsQUg9js.mjs";import{a as d,d as f,f as p,t as m}from"./write-project-skill-8alJi7YJ.mjs";import{dirname as h,join as g,resolve as _}from"node:path";import{homedir as v}from"node:os";import{existsSync as y,mkdirSync as b,readFileSync as x,readdirSync as S,rmSync as C,statSync as w,writeFileSync as T}from"node:fs";const E={existsSync:e=>y(e),isDirectory:e=>{try{return w(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>S(e),readFileSync:e=>x(e),writeFileSync:(e,t)=>{T(e,t)},mkdirSync:(e,t)=>{b(e,t)},rmSync:(e,t)=>{C(e,t)}},D={resolveProjectBundledSkillDir:()=>o(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>o(e,{checkDesktop:!1}),readBundledVersion:()=>l(),readRecordedVersion:e=>r(e,`cli-hosts`),writeRecordedVersion:(e,t)=>i(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>t(e),readBundleDecision:(e,t)=>n(e,t),writeBundleDecision:(e,t,n)=>s(e,t,n),removeBundleFromDisk:(e,t)=>d(e,t)};function O(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function k(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(h(t),{recursive:!0}),A(e,t,n)}function A(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=g(e,r),a=g(t,r);n.isDirectory(i)?A(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function j(e,t,n,r,i,a){let o=[],s=g(e,`.agents`,`skills`,t),c=r.existsSync(s),l=!1;try{k(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,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=g(e,c.hostDir),u=g(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}let d=r.existsSync(u);try{k(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,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:l}}function M(e,t){if(!e)return!1;try{if(!t.existsSync(e))return!1;let n=t.readFileSync(e).toString(`utf8`);return n.includes(`# ok-mcp-v1`)||n.includes(`# ok-mcp-win-v1`)}catch{return!1}}function N(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=g(e,t.hostDir,`skills`,`open-knowledge`),s=g(o,`SKILL.md`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&M(l,n);if(!c&&!u){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{m(o,e),k(i,o,n);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`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 P(t,n,r,i){let o=e=>{n.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),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){i({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 c)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return i({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=a[o.id],c=r.existsSync(g(t,`.agents`,`skills`,s)),l=await n.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{n.removeBundleFromDisk(t,o.id),i({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){i({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){i({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(g(t,`.agents`,`skills`,a[e.id])));if(u!==null&&u===l&&m)return i({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],_=d.length===c.length,v=!0;for(let{id:e,sourceDir:n}of p){let o=j(t,a[e],n,r,i,l);h.push(...o.entries),o.centralWritten||(v=!1)}let y=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(_&&v&&y){let e=null;try{await n.writeRecordedVersion(t,l),i({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),i({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:l,entries:h}}async function F(e){let t=e.logger??O,n=e.fs??E,r=e.home??v(),i={...D,...e.deps};return e.reclaimDisableEnv===`1`?(t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`}):{status:`done`,project:N(e.projectDir,i,n,t),user:await P(r,i,n,t)}}function I(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 L(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===`reclaimed`).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} reclaimed, ${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`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return t.join(`
1
+ import{ua as e}from"./server-lock-iLcBw_q0-CdaRzkXM.mjs";import{Jr as t,Lr as n,Wr as r,ca as i,d as a,ei as o,ia as s,ut as c,zr as l}from"./dist-DU6kAT_L.mjs";import{t as u}from"./esm-CsQUg9js.mjs";import{a as d,d as f,f as p,t as m}from"./write-project-skill-BnCIY7g1.mjs";import{dirname as h,join as g,resolve as _}from"node:path";import{homedir as v}from"node:os";import{existsSync as y,mkdirSync as b,readFileSync as x,readdirSync as S,rmSync as C,statSync as w,writeFileSync as T}from"node:fs";const E={existsSync:e=>y(e),isDirectory:e=>{try{return w(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>S(e),readFileSync:e=>x(e),writeFileSync:(e,t)=>{T(e,t)},mkdirSync:(e,t)=>{b(e,t)},rmSync:(e,t)=>{C(e,t)}},D={resolveProjectBundledSkillDir:()=>o(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>o(e,{checkDesktop:!1}),readBundledVersion:()=>l(),readRecordedVersion:e=>r(e,`cli-hosts`),writeRecordedVersion:(e,t)=>i(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>t(e),readBundleDecision:(e,t)=>n(e,t),writeBundleDecision:(e,t,n)=>s(e,t,n),removeBundleFromDisk:(e,t)=>d(e,t)};function O(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function k(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(h(t),{recursive:!0}),A(e,t,n)}function A(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=g(e,r),a=g(t,r);n.isDirectory(i)?A(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function j(e,t,n,r,i,a){let o=[],s=g(e,`.agents`,`skills`,t),c=r.existsSync(s),l=!1;try{k(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,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=g(e,c.hostDir),u=g(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}let d=r.existsSync(u);try{k(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,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:l}}function M(e,t){if(!e)return!1;try{if(!t.existsSync(e))return!1;let n=t.readFileSync(e).toString(`utf8`);return n.includes(`# ok-mcp-v1`)||n.includes(`# ok-mcp-win-v1`)}catch{return!1}}function N(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=g(e,t.hostDir,`skills`,`open-knowledge`),s=g(o,`SKILL.md`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&M(l,n);if(!c&&!u){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{m(o,e),k(i,o,n);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`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 P(t,n,r,i){let o=e=>{n.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),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){i({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 c)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return i({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=a[o.id],c=r.existsSync(g(t,`.agents`,`skills`,s)),l=await n.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{n.removeBundleFromDisk(t,o.id),i({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){i({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){i({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(g(t,`.agents`,`skills`,a[e.id])));if(u!==null&&u===l&&m)return i({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],_=d.length===c.length,v=!0;for(let{id:e,sourceDir:n}of p){let o=j(t,a[e],n,r,i,l);h.push(...o.entries),o.centralWritten||(v=!1)}let y=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(_&&v&&y){let e=null;try{await n.writeRecordedVersion(t,l),i({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),i({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:l,entries:h}}async function F(e){let t=e.logger??O,n=e.fs??E,r=e.home??v(),i={...D,...e.deps};return e.reclaimDisableEnv===`1`?(t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`}):{status:`done`,project:N(e.projectDir,i,n,t),user:await P(r,i,n,t)}}function I(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 L(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===`reclaimed`).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} reclaimed, ${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`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return t.join(`
2
2
  `)}function R(){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.").action(async()=>{let e=await F({projectDir:_(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null});process.stdout.write(`${L(e)}\n`),process.exitCode=I(e)})}export{R as n,F as t};
3
- //# sourceMappingURL=repair-skills-DoroYY8I.mjs.map
3
+ //# sourceMappingURL=repair-skills-C_l1phOf.mjs.map
@@ -0,0 +1 @@
1
+ import{_ as e,f as t,y as n}from"./server-lock-iLcBw_q0-CdaRzkXM.mjs";export{t as markServerLockDraining,e as releaseServerLock,n as updateServerLockPort};