@inkeep/open-knowledge 0.36.0-beta.6 → 0.36.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/constants-CyKsuF7V.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-BstDp_v4.mjs → init-DmRmDD99.mjs} +3 -3
- package/dist/init-x4r9YK6O.mjs +1 -0
- package/dist/{launch-json-removal-BcCQpGx-.mjs → launch-json-removal-pgEbA527.mjs} +2 -2
- package/dist/loader-C8x8r0sF.mjs +1 -0
- package/dist/{loader-l_BC7vjs.mjs → loader-DMAqxZxV.mjs} +2 -2
- package/dist/{open-browser-DQGzqcdn.mjs → open-browser-Cvdp_y1h.mjs} +2 -2
- package/dist/{preview-B7BjNEAS.mjs → preview-BBUNs8ln.mjs} +2 -2
- package/dist/preview-BQubuyqh.mjs +1 -0
- package/dist/{repair-launch-json-_jEBMO7G.mjs → repair-launch-json-BE1ekKj7.mjs} +2 -2
- package/dist/{repair-mcp-configs-u0ad9dnP.mjs → repair-mcp-configs-D9OnjybK.mjs} +2 -2
- package/dist/{repair-skills-D638Scyb.mjs → repair-skills-CK9KuPiU.mjs} +2 -2
- package/dist/repair-skills-Db8Ny3s4.mjs +1 -0
- package/dist/{src-DNAWQUHg.mjs → src-B02Rt8wv.mjs} +1 -1
- package/dist/{src-up-FAzhh.mjs → src-D_chJWr7.mjs} +381 -381
- package/dist/{src-g3nRJry6.mjs → src-DlLCrfpB.mjs} +2 -2
- package/dist/start-Cb6d-SlK.mjs +1 -0
- package/dist/{start-BCCf0LEE.mjs → start-CuxC0lOc.mjs} +2 -2
- package/dist/{write-project-skill-D3N9lJbe.mjs → write-project-skill-C3-zBR7a.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-0O0dVRLJ.mjs +0 -2
- package/dist/init-PpuK2y4U.mjs +0 -1
- package/dist/loader-KRk29DXE.mjs +0 -1
- package/dist/preview-DuBMNs-o.mjs +0 -1
- package/dist/repair-skills-BwrIt7pC.mjs +0 -1
- package/dist/start-Bt-spF0y.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./gh-detect-Cdvn1Wl3.mjs";import{A as r,D as i,F as a,M as o,N as s,O as c,P as l,d as u,j as d,k as f,n as p,o as m,s as h,v as g,x as _,y as v}from"./init-
|
|
1
|
+
import{i as e,r as t,t as n}from"./gh-detect-Cdvn1Wl3.mjs";import{A as r,D as i,F as a,M as o,N as s,O as c,P as l,d as u,j as d,k as f,n as p,o as m,s as h,v as g,x as _,y as v}from"./init-DmRmDD99.mjs";import{C as y,D as b,E as x,b as S,d as C,f as w,h as T,i as E,n as D,p as O,r as k,t as A,u as j,v as M,x as N,y as P}from"./src-DlLCrfpB.mjs";import{_ as F,a as I,d as L,f as R,g as z,i as B,o as V,r as H,s as U,t as W,u as G,v as K}from"./write-project-skill-C3-zBR7a.mjs";import{n as q}from"./loader-DMAqxZxV.mjs";import{n as J}from"./preview-BBUNs8ln.mjs";import{n as Y,t as X}from"./mcp-migrate-event-C35ikoh2.mjs";export{U as ALL_EDITOR_IDS,G as EDITOR_LABELS,L as EDITOR_TARGETS,R as HOSTS_WITH_USER_SKILL_DIR,p as LAUNCH_CONFIG_NAME,C as PATH_SHIM_BEGIN,w as PATH_SHIM_BLOCK_RE,O as PATH_SHIM_END,i as addOkPathsToGitExclude,W as assertProjectPathSafe,z as buildManagedServerEntry,k as buildMcpConfigDeclineEvent,X as buildMcpConfigMigrateEvent,m as classifyExistingMcpEntry,y as collectReportBundle,t as createTokenStore,x as defaultBugReportZipPath,n as detectGh,h as detectInstalledEditors,c as formatTrackedRemediation,f as getExcludedOkPaths,r as getOkArtifactPaths,F as isEntryUpToDate,K as isOwnManagedEntry,q as loadConfig,e as makeLazyProbeTokenStore,M as parseGitHubBlobUrl,P as parseGitHubShareUrl,S as parseGitHubTreeUrl,N as parseGitUrl,T as pathInstallMarkerPath,J as previewContent,d as probeTrackedOkPaths,u as readExistingMcpEntry,o as readSharingMode,s as readSkillsShared,b as redactContent,l as removeOkPathsFromGitExclude,j as removeOwnMcpEntry,H as removeProjectSkill,I as removeUserGlobalSkillBundle,_ as resolveProjectRoot,E as runStop,a as setSkillsShared,Y as truncatePriorEntry,V as userGlobalSkillBundleTargets,D as validateLocalFolderForShare,g as writeEditorMcpConfig,A as writeProjectAiIntegrations,B as writeProjectSkill,v as writeUserMcpConfigs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{A as r,D as i,Ea as a,Jo as o,la as s}from"./src-S2yxN8_s.mjs";import{$n as c,$t as l,Bn as u,Mr as d,Oa as f,Qn as p,Qt as m,Vn as h,c as g,da as _,dn as v,er as y,fa as b,fn as x,jn as S,l as C,nr as w,rn as ee,tn as te,u as ne,wn as re}from"./src-up-FAzhh.mjs";import{r as ie,t as T}from"./esm-EvSEzE_V.mjs";import{t as ae}from"./constants-0O0dVRLJ.mjs";import{t as E}from"./is-object-DYBErO9v.mjs";import{a as oe,b as se,d as D,g as ce,h as le,i as ue,m as de,p as fe,s as pe,t as me}from"./write-project-skill-D3N9lJbe.mjs";import{i as O,n as he,o as k,r as ge,s as A,t as j}from"./colors-B_qgKwrk.mjs";import{t as _e}from"./preview-B7BjNEAS.mjs";import{createRequire as ve}from"node:module";import{execFileSync as ye}from"node:child_process";import M,{dirname as N,isAbsolute as be,join as P,relative as F,resolve as xe,sep as Se}from"node:path";import{existsSync as I,lstatSync as Ce,mkdirSync as we,readFileSync as L,readlinkSync as Te,realpathSync as Ee,statSync as De,writeFileSync as Oe}from"node:fs";import{homedir as ke}from"node:os";import R from"node:process";import{fileURLToPath as Ae}from"node:url";import{inspect as je,stripVTControlCharacters as Me,styleText as z}from"node:util";import{AsyncLocalStorage as Ne,AsyncResource as Pe}from"node:async_hooks";import*as Fe from"node:readline";const Ie=new Set([`emacs`,`vim`]);function Le(e){return Ie.has(e)}function Re(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Le))):[]}const B=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,ze=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Be=e=>e.name===`space`,Ve=e=>e.name===`backspace`,He=e=>`1234567890`.includes(e.name),Ue=e=>e.name===`enter`||e.name===`return`;var We=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Ge=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ke=class extends Error{name=`ExitPromptError`},qe=class extends Error{name=`HookError`},Je=class extends Error{name=`ValidationError`};const Ye=new Ne;function Xe(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Ze(e,t){let n=Xe(e);return Ye.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function V(){let e=Ye.getStore();if(!e)throw new qe(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Qe(){return V().rl}function $e(e){return Pe.bind((...t)=>{let n=V(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function et(e){let t=V(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function tt(){V().handleChange()}const H={queue(e){let t=V(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Qe());if(r!=null&&typeof r!=`function`)throw new Je(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=V();$e(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=V();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function nt(e){return typeof e==`function`}function U(e){return et(t=>{let n=Pe.bind(function(e){t.get()!==e&&(t.set(e),tt())});if(t.initialized)return[t.get(),n];let r=nt(e)?e():e;return t.set(r),[r,n]})}function rt(e,t){et(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&H.queue(e),n.set(t)})}function it(){return R.platform.startsWith(`win`)?!!R.env.CI||!!R.env.WT_SESSION||!!R.env.TERMINUS_SUBLIME||R.env.ConEmuTask===`{cmd::Cmder}`||R.env.TERM_PROGRAM===`Terminus-Sublime`||R.env.TERM_PROGRAM===`vscode`||R.env.TERM===`xterm-256color`||R.env.TERM===`alacritty`||R.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:R.env.TERM!==`linux`}const at={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},ot={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},st={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ct={...at,...ot},lt={...at,...st},W=it()?ct:lt;Object.entries(ot);const ut={prefix:{idle:z(`blue`,`?`),done:z(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>z(`yellow`,e))},keybindings:[],style:{answer:e=>z(`cyan`,e),message:e=>z(`bold`,e),error:e=>z(`red`,`> ${e}`),defaultAnswer:e=>z(`dim`,`(${e})`),help:e=>z(`dim`,e),highlight:e=>z(`cyan`,e),key:e=>z(`cyan`,z(`bold`,`<${e}>`))}};function dt(){return{...ut,keybindings:Re()}}function ft(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pt(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ft(n)&&ft(r)?pt(n,r):r}return t}function mt(...e){return pt(dt(),...e.filter(e=>e!=null))}function ht({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=mt(t);return rt(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function gt(e,t){return et(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function _t(e){return U({current:e})[0]}function vt(e){let t=_t(e);t.current=e,rt(e=>{let n=!1,r=$e((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var yt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const bt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),xt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,St=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Ct=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,wt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Tt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Et=/\t{1,1000}/y,Dt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Ot=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,kt=/\p{M}+/gu,At={limit:1/0,ellipsis:``},jt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?jt(i,At,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Ot,l],[Ct,0],[wt,o],[Et,s],[Dt,c],[Tt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(kt,``)){let t=e.codePointAt(0)||0;if(S=xt(t)?2:St(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Tt?bt(e.slice(p,n.lastIndex)):n===Dt?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Mt={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>jt(e,Mt,t).width,Nt=`]8;;`,Pt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Nt}(?<uri>.*))`,`y`),Ft=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},It=e=>`[${e}m`,Lt=e=>`${Nt}${e}`,Rt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Nt,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},zt=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Bt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=G(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=G(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Rt(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Rt(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Rt(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>zt(e)));let l=s.join(`
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{A as r,D as i,Ea as a,Jo as o,la as s}from"./src-S2yxN8_s.mjs";import{$n as c,$t as l,Bn as u,Mr as d,Oa as f,Qn as p,Qt as m,Vn as h,c as g,da as _,dn as v,er as y,fa as b,fn as x,jn as S,l as C,nr as w,rn as ee,tn as te,u as ne,wn as re}from"./src-D_chJWr7.mjs";import{r as ie,t as T}from"./esm-EvSEzE_V.mjs";import{t as ae}from"./constants-CyKsuF7V.mjs";import{t as E}from"./is-object-DYBErO9v.mjs";import{a as oe,b as se,d as D,g as ce,h as le,i as ue,m as de,p as fe,s as pe,t as me}from"./write-project-skill-C3-zBR7a.mjs";import{i as O,n as he,o as k,r as ge,s as A,t as j}from"./colors-B_qgKwrk.mjs";import{t as _e}from"./preview-BBUNs8ln.mjs";import{createRequire as ve}from"node:module";import{execFileSync as ye}from"node:child_process";import M,{dirname as N,isAbsolute as be,join as P,relative as F,resolve as xe,sep as Se}from"node:path";import{existsSync as I,lstatSync as Ce,mkdirSync as we,readFileSync as L,readlinkSync as Te,realpathSync as Ee,statSync as De,writeFileSync as Oe}from"node:fs";import{homedir as ke}from"node:os";import R from"node:process";import{fileURLToPath as Ae}from"node:url";import{inspect as je,stripVTControlCharacters as Me,styleText as z}from"node:util";import{AsyncLocalStorage as Ne,AsyncResource as Pe}from"node:async_hooks";import*as Fe from"node:readline";const Ie=new Set([`emacs`,`vim`]);function Le(e){return Ie.has(e)}function Re(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Le))):[]}const B=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,ze=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Be=e=>e.name===`space`,Ve=e=>e.name===`backspace`,He=e=>`1234567890`.includes(e.name),Ue=e=>e.name===`enter`||e.name===`return`;var We=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Ge=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ke=class extends Error{name=`ExitPromptError`},qe=class extends Error{name=`HookError`},Je=class extends Error{name=`ValidationError`};const Ye=new Ne;function Xe(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Ze(e,t){let n=Xe(e);return Ye.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function V(){let e=Ye.getStore();if(!e)throw new qe(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Qe(){return V().rl}function $e(e){return Pe.bind((...t)=>{let n=V(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function et(e){let t=V(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function tt(){V().handleChange()}const H={queue(e){let t=V(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Qe());if(r!=null&&typeof r!=`function`)throw new Je(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=V();$e(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=V();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function nt(e){return typeof e==`function`}function U(e){return et(t=>{let n=Pe.bind(function(e){t.get()!==e&&(t.set(e),tt())});if(t.initialized)return[t.get(),n];let r=nt(e)?e():e;return t.set(r),[r,n]})}function rt(e,t){et(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&H.queue(e),n.set(t)})}function it(){return R.platform.startsWith(`win`)?!!R.env.CI||!!R.env.WT_SESSION||!!R.env.TERMINUS_SUBLIME||R.env.ConEmuTask===`{cmd::Cmder}`||R.env.TERM_PROGRAM===`Terminus-Sublime`||R.env.TERM_PROGRAM===`vscode`||R.env.TERM===`xterm-256color`||R.env.TERM===`alacritty`||R.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:R.env.TERM!==`linux`}const at={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},ot={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},st={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ct={...at,...ot},lt={...at,...st},W=it()?ct:lt;Object.entries(ot);const ut={prefix:{idle:z(`blue`,`?`),done:z(`green`,W.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>z(`yellow`,e))},keybindings:[],style:{answer:e=>z(`cyan`,e),message:e=>z(`bold`,e),error:e=>z(`red`,`> ${e}`),defaultAnswer:e=>z(`dim`,`(${e})`),help:e=>z(`dim`,e),highlight:e=>z(`cyan`,e),key:e=>z(`cyan`,z(`bold`,`<${e}>`))}};function dt(){return{...ut,keybindings:Re()}}function ft(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pt(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ft(n)&&ft(r)?pt(n,r):r}return t}function mt(...e){return pt(dt(),...e.filter(e=>e!=null))}function ht({status:e=`idle`,theme:t}){let[n,r]=U(!1),[i,a]=U(0),{prefix:o,spinner:s}=mt(t);return rt(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function gt(e,t){return et(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function _t(e){return U({current:e})[0]}function vt(e){let t=_t(e);t.current=e,rt(e=>{let n=!1,r=$e((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var yt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const bt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),xt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,St=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Ct=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,wt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Tt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Et=/\t{1,1000}/y,Dt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Ot=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,kt=/\p{M}+/gu,At={limit:1/0,ellipsis:``},jt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?jt(i,At,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Ot,l],[Ct,0],[wt,o],[Et,s],[Dt,c],[Tt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(kt,``)){let t=e.codePointAt(0)||0;if(S=xt(t)?2:St(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Tt?bt(e.slice(p,n.lastIndex)):n===Dt?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Mt={limit:1/0,ellipsis:``,ellipsisWidth:0},G=(e,t={})=>jt(e,Mt,t).width,Nt=`]8;;`,Pt=RegExp(`(?:\\[(?<code>\\d+)m|\\${Nt}(?<uri>.*))`,`y`),Ft=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},It=e=>`[${e}m`,Lt=e=>`${Nt}${e}`,Rt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:G(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=G(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Nt,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},zt=e=>{let t=e.split(` `),n=t.length;for(;n&&!G(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Bt=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=G(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=G(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Rt(s,r,t),c=G(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Rt(s,r,t),c=G(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Rt(s,r,t),c=G(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>zt(e)));let l=s.join(`
|
|
2
2
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){Pt.lastIndex=e+1;let t=Pt.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
3
3
|
`){a&&(r+=Lt(``));let e=i?Ft(i):void 0;i&&e&&(r+=It(e))}else t===`
|
|
4
4
|
`&&(i&&Ft(i)&&(r+=It(i)),a&&(r+=Lt(a)))}return r},Vt=/\r?\n/;function Ht(e,t,n){return String(e).normalize().split(Vt).map(e=>Bt(e,t,n)).join(`
|
|
@@ -638,6 +638,6 @@ export default function okBridge(pi: {
|
|
|
638
638
|
`));let f=`${a?``:``}${u}`;return f!==i&&b(e,f,{mode:Bn(e)}),{kind:l?`overwritten`:`written`}}const _i=e=>e!==`project`,vi=e=>e!==`user`;async function yi(){let e=await Yn({message:`Where should the MCP server be configured?
|
|
639
639
|
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function bi(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??yi)():`both`}async function xi(e){return er({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function Si(e){if(e.sharing!==void 0)return e.sharing;let t=Dn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??xi)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Ci(e){if(e===void 0||e===!0)return new Set(h);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(h.filter(e=>t.includes(e)))}function wi(e,t,n){let r=xe(n,e),i;try{i=De(r)}catch(e){let t=e.code;throw t===`ENOENT`?new $(`--content-dir path does not exist: ${r}`):new $(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new $(`--content-dir must be a directory: ${r}`);let a=F(Ti(t),Ti(r));if(a.startsWith(`..`)||be(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function Ti(e){try{return Ee(e)}catch{return e}}const Ei=`open-knowledge-ui`;function Di(e,t,n){try{return I(e.detectPath?.(t,n)??N(e.configPath(t,n)))}catch{return!1}}function Oi(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0;if(!i&&s&&!Di(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{me(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return Ai(e,o,a,n,{isProjectScope:i!==void 0});let c;try{c=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{we(N(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let l={action:`written`},u;try{_(`${o}.lock`,()=>{let t=Kr(o).writePath;if(we(N(t),{recursive:!0}),e.format===`toml`){let n=hi(ei(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=gi(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=mi(t,e.topLevelKey,a,c,e.serverMapSubKey);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){u=e instanceof Error?e:Error(String(e))}return u?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:u.message,...i===void 0?{}:{configScope:`project`}}:l.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:l.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:l.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const ki={pi:Fr};function Ai(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=ki[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{we(N(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{_(`${t}.lock`,()=>{let e=null;try{e=L(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}b(t,c,e===null?void 0:{mode:Bn(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function ji(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!I(n)))return{editorId:e.id,label:e.label,path:n}}async function Mi(e){let t=se(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>Oi(t,``,n,e.home))}function Ni(e,t,n,r){let i=Fi(e,t,n,r);return i.kind===`present`?i.entry:null}function Pi(e,t,n,r){let i=pi(e,t,r);if(!E(i))return{kind:`no-entry`};let a=i[n];return E(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Fi(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!I(i))return{kind:`absent`};try{if(De(i).size>ci)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=L(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:Pr(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=ei().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Pi(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,xn.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Pi(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=ri(a);return s?ii(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Pi(c(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Ii(e={}){let t=xe(e.cwd??process.cwd()),n=Rr(t,{homeDir:e.home}),r=n.projectRoot,i=!I(P(r,`.ok`)),a=n.gitRootPromoted?F(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:wi(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${A(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await ne(r),d;try{d=l(r,{contentDir:o})}catch(t){let i=D.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let f=d.created.includes(ae),p=!1;if(c.didInit)try{p=te(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{m(r)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore entry at ${r}: ${e instanceof Error?e.message:String(e)}`)}let _=await g(r);_.kind===`untracked`&&console.warn(`[ok] Untracked the OpenKnowledge project skill (${_.dirs.join(`, `)}) — it is now local-only. Teammates will see this as a deletion on their next pull.`);let v=await bi({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),y=e.editors??Hi(r,e.home),b=e.editors??pe.filter(e=>D[e].projectConfigPath!==void 0||D[e].projectSkillPath!==void 0),x=se(y),C=se(b),w=e.mcp===!1||v===null,ee=Array.from(new Map([...x,...w?[]:C].map(e=>[e.id,e])).values()),ie=x.filter(t=>Di(t,r,e.home)),T=[],E=[],ce=new Set;for(let t of ee){if(w){let n=``;try{n=t.configPath(r,e.home)}catch{}T.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(_i(v)&&x.includes(t)&&t.scope===`global`&&T.push(Oi(t,r,s,e.home)),vi(v)&&C.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=Oi(t,r,s,e.home,n);T.push(i),(i.action===`written`||i.action===`overwritten`)&&ce.add(n)}}let le=new Set;for(let t of C){let n=t.projectSkillPath?.(r);!n||le.has(n)||(le.add(n),E.push(ue(t,r,{home:e.home})))}let de=!w&&v!==null&&vi(v)?C.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,fe=w?[]:ie.map(e=>ji(e,r)).filter(e=>e!==void 0).filter(e=>!ce.has(e.path)),me=e.installUserSkill??re,O=e.home??ke(),he=Ci(e.skills),k=!1,ge=!1,j=!1,_e=!1;for(let t of h){let n=he.has(t);if(await S(O,u[t],n).catch(()=>{}),n){k=!0;let n=await me({home:e.home,bundleId:t,force:!0});n===`installed`?ge=!0:n===`failed`?j=!0:_e=!0}else try{oe(O,t)}catch{}}let ve=j?`failed`:ge?`installed`:k&&_e?`skip-current`:`declined`,ye=w?`skipped-flag`:`skipped-missing`,M=T.find(e=>e.editorId===`claude`)??T[0]??{action:ye,configPath:D.claude.configPath(r,e.home)},N=await Li({projectRoot:r,desiredMode:await Si({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:d.created,contentUpdated:d.updated,contentSkipped:d.skipped,editors:T,projectSkills:E,legacyProjectConfigs:fe,skillInstall:ve,didGitInit:c.didInit,rootGitignoreCreated:p,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:f?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:M.action,mcpPath:M.configPath,mcpError:`error`in M?M.error:void 0,projectScopeUnsupportedLabels:de,sharing:N}}async function Li(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=Dn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=wn(t);if(n===`local-only`){let e=Tn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Ri(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=En(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Ri(t,o,`remove`)}function Ri(e,t,n){let r=Dn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function zi(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function Bi(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=P(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(j(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(j(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(j(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(j(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(j(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?F(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${k(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${k(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${ge(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${zi(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(j(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?F(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${k(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${k(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${ge(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${F(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(j(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${k(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${k(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${he(`skipped (opted out via --no-skills)`)}`);break;case`failed`:n.push(` ${A(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${A(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(A(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(A(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(_e(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Gi(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${k(`✓`)} ${j(`Next steps:`)}`),n.push(` 1. Open your editor (${O(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${O(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${O(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${O(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${O(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${O(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
640
640
|
`)}function Vi(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function Hi(e,t){let n=[];for(let r of pe)Di(D[r],e,t)&&n.push(r);return n}function Ui(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:je(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function Wi(){return new T(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new ie(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new ie(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new ie(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?Ui():null;try{let r;try{r=await Ii({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof $){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof v||e instanceof x){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof C){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
|
|
641
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-
|
|
641
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-C8x8r0sF.mjs`),{resolveContentDir:s}=await import(`./src-B02Rt8wv.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-BQubuyqh.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Vi(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Bi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Gi(e,t){let n=[];switch(e.kind){case`applied`:return n.push(j(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${k(`local-only`)} — appended ${e.appended.length} path(s) to ${j(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${k(`local-only`)} — already excluded; nothing to do.`):n.push(` ${k(`local-only`)}`):e.action===`removed`?n.push(` ${k(`shared`)} — removed OK paths from ${j(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${k(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(A(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
642
642
|
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${O(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(A(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${O(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${O(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(A(`Sharing mode unavailable: ${e.reason}.`));return n}}export{wn as A,mt as B,Yn as C,Tn as D,Vn as E,An as F,Ue as H,bn as I,cn as L,Dn as M,kn as N,Mn as O,En as P,vt as R,Nr as S,zn as T,U as V,di as _,Vi as a,ei as b,Bi as c,Ni as d,Ci as f,Ii as g,Si as h,Li as i,jn as j,On as k,Gi as l,wi as m,Ei as n,Fi as o,bi as p,ki as r,Hi as s,$ as t,Wi as u,Oi as v,Bn as w,Rr as x,Mi as y,ht as z};
|
|
643
|
-
//# sourceMappingURL=init-
|
|
643
|
+
//# sourceMappingURL=init-DmRmDD99.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./init-DmRmDD99.mjs";export{e as runInit};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$n as e,fa as t,nr as n}from"./src-
|
|
2
|
-
//# sourceMappingURL=launch-json-removal-
|
|
1
|
+
import{$n as e,fa as t,nr as n}from"./src-D_chJWr7.mjs";import{E as r,w as i}from"./init-DmRmDD99.mjs";import{t as a}from"./is-object-DYBErO9v.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=n(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=e(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(t(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
|
|
2
|
+
//# sourceMappingURL=launch-json-removal-pgEbA527.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-DMAqxZxV.mjs";export{e as loadConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ba as e,Jo as t,Ra as n,za as r}from"./src-S2yxN8_s.mjs";import{_ as i,ca as a,la as o}from"./src-
|
|
1
|
+
import{Ba as e,Jo as t,Ra as n,za as r}from"./src-S2yxN8_s.mjs";import{_ as i,ca as a,la as o}from"./src-D_chJWr7.mjs";import{t as s}from"./constants-CyKsuF7V.mjs";import{t as c}from"./is-object-DYBErO9v.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";var p=t();async function m(e){let t=l(e);try{return await f(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,p.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=r({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...i,source:e}}return i})}function v(t){let r=t??process.cwd(),c=[],u=o(`user`,r),d=a({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(r,`.ok`,s),m=g(p);if(m.value!==null){let t=n({value:m.value,file:m.path,source:m.source,doc:m.doc});if(t.length>0)throw Error(t.map(e).join(`
|
|
2
2
|
|
|
3
3
|
`));f=h(f,m.value),c.push(p)}let v=i.safeParse(f);if(!v.success){let t={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(e(t))}return{config:v.data,sources:c}}function y(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??v,r=new Map,i=new Map,a=m(e.startupCwd);return async o=>{let s=await m(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{v as n,y as t};
|
|
4
|
-
//# sourceMappingURL=loader-
|
|
4
|
+
//# sourceMappingURL=loader-DMAqxZxV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Mr as e}from"./src-
|
|
2
|
-
//# sourceMappingURL=open-browser-
|
|
1
|
+
import{Mr as e}from"./src-D_chJWr7.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}t(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,a]:[a],e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
|
|
2
|
+
//# sourceMappingURL=open-browser-Cvdp_y1h.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{rr as e}from"./src-
|
|
1
|
+
import{rr as e}from"./src-D_chJWr7.mjs";import"./constants-CyKsuF7V.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-BBUNs8ln.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-BBUNs8ln.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./launch-json-removal-
|
|
2
|
-
//# sourceMappingURL=repair-launch-json-
|
|
1
|
+
import{t as e}from"./launch-json-removal-pgEbA527.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-BE1ekKj7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as e,v as t}from"./init-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{d as e,v as t}from"./init-DmRmDD99.mjs";import{_ as n,d as r,s as i}from"./write-project-skill-C3-zBR7a.mjs";import{t as a}from"./mcp-migrate-event-C35ikoh2.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-D9OnjybK.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as e}from"./src-S2yxN8_s.mjs";import{An as t,Bn as n,Dn as r,En as i,In as a,Mn as o,Pn as s,Vn as c,jn as l}from"./src-
|
|
1
|
+
import{C as e}from"./src-S2yxN8_s.mjs";import{An as t,Bn as n,Dn as r,En as i,In as a,Mn as o,Pn as s,Vn as c,jn as l}from"./src-D_chJWr7.mjs";import{t as u}from"./esm-EvSEzE_V.mjs";import{a as d,d as f,f as p,t as m}from"./write-project-skill-C3-zBR7a.mjs";import{dirname as h,join as g,resolve as _}from"node:path";import{existsSync as v,mkdirSync as y,readFileSync as b,readdirSync as x,rmSync as S,statSync as C,writeFileSync as w}from"node:fs";import{homedir as T}from"node:os";const E={existsSync:e=>v(e),isDirectory:e=>{try{return C(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>x(e),readFileSync:e=>b(e),writeFileSync:(e,t)=>{w(e,t)},mkdirSync:(e,t)=>{y(e,t)},rmSync:(e,t)=>{S(e,t)}},D={resolveProjectBundledSkillDir:()=>a(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>a(e,{checkDesktop:!1}),readBundledVersion:()=>r(),readRecordedVersion:e=>t(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>s(e),readBundleDecision:(e,t)=>i(e,t),writeBundleDecision:(e,t,n)=>l(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,r,i,a){let o=e=>{r.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return a({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 r.readRecordedVersion(t)}catch(e){a({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:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({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=n[o.id],c=i.existsSync(g(t,`.agents`,`skills`,s)),l=await r.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(t,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({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 r.writeBundleDecision(t,s,!0)}catch(e){a({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=>i.existsSync(g(t,`.agents`,`skills`,n[e.id])));if(u!==null&&u===l&&m)return a({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:r}of p){let o=j(t,n[e],r,i,a,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 r.writeRecordedVersion(t,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({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??T(),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-
|
|
3
|
+
//# sourceMappingURL=repair-skills-CK9KuPiU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./repair-skills-CK9KuPiU.mjs";export{e as repairSkills};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,Da as t,Zo as n,_a as r,ea as i,f as a,ha as o,na as s,ta as c,u as l,y as u}from"./src-S2yxN8_s.mjs";import{$ as d,$i as f,$r as p,$t as m,A as h,Ai as g,An as _,Ar as v,At as y,B as b,Bi as x,Bn as S,Br as C,Bt as w,C as T,Ca as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dr as P,Dt as F,E as I,Ei as L,En as R,Er as z,Et as B,F as V,Fi as H,Fn as U,Fr as W,Ft as G,G as K,Gi as q,Gn as J,Gr as Y,Gt as X,H as Z,Hi as Q,Hn as $,Hr as ee,Ht as te,I as ne,Ii as re,In as ie,Ir as ae,It as oe,J as se,Ji as ce,Jn as le,Jr as ue,Jt as de,K as fe,Ki as pe,Kn as me,Kr as he,Kt as ge,L as _e,Li as ve,Ln as ye,Lr as be,Lt as xe,M as Se,Mi as Ce,Mn as we,Mr as Te,Mt as Ee,N as De,Ni as Oe,Nn as ke,Nr as Ae,Nt as je,O as Me,Oi as Ne,On as Pe,Or as Fe,Ot as Ie,P as Le,Pi as Re,Pn as ze,Pr as Be,Pt as Ve,Q as He,Qi as Ue,Qr as We,Qt as Ge,R as Ke,Ri as qe,Rn as Je,Rr as Ye,Rt as Xe,S as Ze,Sa as Qe,Si as $e,Sn as et,Sr as tt,St as nt,T as rt,Ta as it,Ti as at,Tn as ot,Tr as st,Tt as ct,U as lt,Ui as ut,Un as dt,Ur as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vr as _t,Vt as vt,W as yt,Wi as bt,Wn as xt,Wr as St,Wt as Ct,X as wt,Xi as Tt,Xn as Et,Xr as Dt,Xt as Ot,Y as kt,Yi as At,Yn as jt,Yr as Mt,Yt as Nt,Z as Pt,Zi as Ft,Zn as It,Zr as Lt,Zt as Rt,_ as zt,_a as Bt,_i as Vt,_n as Ht,_r as Ut,_t as Wt,a as Gt,aa as Kt,ai as qt,an as Jt,ar as Yt,at as Xt,b as Zt,ba as Qt,bi as $t,bn as en,br as tn,bt as nn,c as rn,ci as an,cn as on,cr as sn,d as cn,di as ln,dn as un,dr as dn,ea as fn,ei as pn,en as mn,et as hn,f as gn,fi as _n,fn as vn,fr as yn,g as bn,ga as xn,gi as Sn,gn as Cn,gr as wn,gt as Tn,h as En,ha as Dn,hi as On,hn as kn,hr as An,ht as jn,i as Mn,ia as Nn,ii as Pn,in as Fn,ir as In,it as Ln,j as Rn,ji as zn,jn as Bn,jr as Vn,jt as Hn,k as Un,ki as Wn,kn as Gn,kr as Kn,kt as qn,l as Jn,li as Yn,ln as Xn,lr as Zn,m as Qn,ma as $n,mi as er,mn as tr,mr as nr,mt as rr,n as ir,na as ar,ni as or,nn as sr,nt as cr,o as lr,oa as ur,oi as dr,on as fr,or as pr,ot as mr,p as hr,pa as gr,pi as _r,pn as vr,pr as yr,pt as br,q as xr,qi as Sr,qn as Cr,qr as wr,qt as Tr,r as Er,ra as Dr,ri as Or,rn as kr,rr as Ar,rt as jr,s as Mr,sa as Nr,si as Pr,sn as Fr,sr as Ir,t as Lr,ta as Rr,ti as zr,tn as Br,tt as Vr,u as Hr,ui as Ur,un as Wr,ur as Gr,v as Kr,va as qr,vi as Jr,vn as Yr,vr as Xr,vt as Zr,w as Qr,wa as $r,wi as ei,wn as ti,wr as ni,wt as ri,x as ii,xa as ai,xi as oi,xn as si,xr as ci,xt as li,y as ui,ya as di,yi as fi,yn as pi,yr as mi,yt as hi,z as gi,zi as _i,zn as vi,zr as yi,zt as bi}from"./src-up-FAzhh.mjs";import{A as xi,C as Si,M as Ci,S as wi,T as Ti,_ as Ei,a as Di,b as Oi,c as ki,f as Ai,g as ji,h as Mi,i as Ni,j as Pi,k as Fi,l as Ii,m as Li,n as Ri,o as zi,p as Bi,r as Vi,s as Hi,t as Ui,u as Wi,v as Gi,w as Ki,x as qi,y as Ji}from"./server-lock-D46oe4zF.mjs";export{Qt as AGENT_ID_MAX_LEN,ai as AGENT_ID_RE,ht as AGENT_WRITE_ORIGIN,di as AgentFocusBroadcaster,gr as AgentPresenceBroadcaster,Q as AgentSessionCapacityError,ut as AgentSessionManager,rr as AutoStartDisabledError,Je as BUNDLE_IDS,vi as BUNDLE_SCOPE,S as BUNDLE_SKILL_NAME,Fn as BacklinkIndex,At as CC1Broadcaster,r as CC1_CONTRACT_VERSION,de as CONFIG_FILENAME,Yn as CONFLICT_MARKER_RE,Ir as CURSOR_BUNDLE_PATHS_BY_PLATFORM,zt as ConfigSchema,ue as DEFAULT_CHECKPOINT_RETENTION,ci as DEFAULT_EMBEDDINGS_DIMENSIONS,ct as DEFAULT_PACK_ID,tt as EMBEDDINGS_API_KEY_ENV,Mt as FILE_SYSTEM_WRITER,Y as FILE_WATCHER_ORIGIN,wn as FileEmbeddingsBackend,pt as GIT_PREFLIGHT_FAIL_SPAN_NAME,Dt as GIT_UPSTREAM_WRITER,$r as GitDirAccessError,un as GitNotAvailableError,vn as GitTooOldError,Oe as HOCUSPOCUS_AUTH_REJECTION_REASONS,Re as HocuspocusAuthRejection,H as HocuspocusAuthTokenSchema,yr as INSTALLED_AGENTS_SCHEMES,o as LINEAGE_EPOCH_KEY,_e as LIVE_DERIVED_INDEX_DEBOUNCE_MS,B as LOG_MD_TEMPLATE,Tn as MANAGED_RENAME_ORIGIN,bt as MAX_AGENT_SESSIONS,Xt as MCP_CONNECTION_ID_HEADER,i as MCP_SERVER_NAME,vr as MIN_GIT_VERSION,b as MISSING_OK_CONFIG_MESSAGE,it as MalformedGitPointerError,Pt as McpLogger,mt as MissingOkConfigError,Kn as OBSERVER_SYNC_ORIGIN,Nt as OK_OKIGNORE_TEMPLATE,c as ORPHAN_MODES,n as PROTOCOL_VERSION,qi as PinoLogger,ki as ProcessLockCollisionError,Jn as ProjectGitInitError,Wt as ROLLBACK_ORIGIN,Ot as ROOT_GITIGNORE_TEMPLATE,ji as RUNTIME_VERSION,Lt as SERVICE_WRITER,ke as SKILL_INSTALL_EVENTS_FILE_REL,u as SKILL_STATE_TARGETS,F as STARTER_FOLDERS,Ie as STARTER_FOLDER_FRONTMATTER_FILENAME,qn as STARTER_PACKS,y as STARTER_PACK_IDS,Hn as STARTER_TEMPLATES,rt as STATE_MANIFEST_FILENAME,Ei as STATE_SCHEMA_VERSION,t as SYSTEM_DOC_NAME,xe as SeedPrerequisiteError,Xe as SeedRootDirError,Ui as ServerLockCollisionError,Lr as SingleFileNotAFileError,ir as SingleFileNotFoundError,Er as SingleFileNotMarkdownError,I as StateManifestError,Qr as TagIndex,gt as USER_GLOBAL_BUNDLE_IDS,fr as UiLockCollisionError,Zr as __getShowAllWalkStatsForTesting,hi as __resetShowAllWalkStatsForTesting,Ii as acquireProcessLock,Ri as acquireServerLock,Fr as acquireUiLock,q as applyAgentMarkdownWrite,he as applyExternalChange,ri as applySeed,j as assertCompatibleStateManifest,tr as assertGitAvailable,Ae as assertNeverDiskEvent,br as attachIdleShutdown,Kr as bootServer,O as buildAndOpenSkill,Rt as buildConfigYmlContent,fe as buildExecResult,U as buildSkillZip,Ee as buildStarterFolderFrontmatterYaml,We as buildWipTree,$ as bundleSkillMdPath,Be as classifyEvents,$t as classifyFsPath,_r as clearContributors,Ut as clearEmbeddingsKeyFromAllBackends,je as coercePackId,l as colorFromSeed,p as commitUpstreamImport,pn as commitWip,zr as commitWipFromTree,kn as compareSemver,J as composeEffectiveLinterConfig,Ur as containsConflictMarkers,W as contentHash,er as contributorCount,De as countShadowObjects,Le as countStaleAgentWipRefs,V as countWipRefs,nn as createApiExtension,z as createAssetServeMiddleware,Ar as createContentFilter,In as createContentFilterAsync,Xr as createEmbeddingsSecretStore,Mn as createEphemeralProjectDir,wr as createExternalChangeHandler,gn as createFileLogger,Ke as createLiveDerivedIndexExtension,yt as createMcpHttpHandler,nr as createOsProbe,P as createPersistenceExtension,T as createServer,Rn as createServerObserverExtension,pe as createStreamingErrorWriter,wi as createTestLogger,mi as describeStoredEmbeddingsKey,bn as detectClaudeDesktopPresence,Cn as detectGit,Me as detectProjectShape,hn as discoverLockDirs,le as discoverMarkdownlintConfig,Ct as emitPreflightFailureSpan,xr as encodeDocName,se as encodeFolderRoute,kt as encodeSkillRoute,Hr as ensureProjectGit,Ge as ensureProjectSkillGitignore,Sr as errorResponse,ae as evictStaleTrackerEntries,Vr as extractOkBinaryPath,Jt as extractWikiLinksFromMarkdown,Ht as fallbackPaths,cn as findEnclosingGitRoot,sr as findEnclosingProjectRoot,jt as findNativeMarkdownlintFile,hr as flushFileLogger,re as formatAuthRejectionWire,On as formatContributors,Sn as formatContributorsFrom,nt as formatPackRationale,or as gcCheckpointRefs,He as getCurrentMcpLogger,k as getLocalDir,Qn as getLogFilePath,Si as getLogger,En as getLogsDir,Gi as getMachineId,Rr as getMeter,$n as getMetrics,ar as getTracer,Dn as handleCollabSocketError,sn as handleSpawnCursor,ne as hasGcLogLatch,a as iconFromClientName,xn as incrementCollabSocketFilteredError,Bt as incrementServerObserverFire,m as initContent,Or as initShadowRepo,Dr as initTelemetry,Zt as initToleranceTelemetryWriter,Ln as installPrettyZodErrors,Ki as installTestLoggers,ti as installUserSkill,x as isAllowedApiOrigin,bi as isAllowedWorkspaceHostHeader,Tt as isConfigDoc,ve as isHocuspocusAuthRejectionReason,Ve as isKnownPackId,Ft as isLinkIndexExcludedDoc,w as isLoopbackAddress,Ue as isManagedArtifactDoc,s as isOrphanMode,v as isPairedWriteOrigin,Zn as isPathWithinDir,Ji as isProcessAlive,kr as isProjectRoot,pi as isProjectSkillManaged,f as isReservedForUserTree,be as isSelfWrite,fn as isSystemDoc,ii as isToleranceTelemetryEnabled,Oi as isValidLockPid,Ye as lastKnownHash,Pn as listRescueCheckpoints,G as listStarterPacks,Se as loadPrincipal,Wi as lockFilePath,Ti as loggerFactory,Fi as logsCurrentPath,xi as logsPreviousPath,tn as makeLazyEmbeddingsKeyStore,Vi as markServerLockDraining,Z as mountMcpAndApi,oi as normalizeFsPath,dt as originGitHubHost,mn as packageVersionMajorMinor,qe as parseAuthRejectionWire,Yr as parseGitVersion,_i as parseHocuspocusAuthToken,lt as parseKeepaliveConnectionId,yi as pathToDocName,A as planSeed,Gt as prepareSingleFileOpen,cr as processCommand,jr as processUsage,ot as readAllTargets,R as readBundleDecision,Et as readOwnNativeRules,Ai as readProcessLock,Bi as readProcessLockDetailed,gi as readProjectHeadState,An as readProjectLocalSemanticConfig,Ni as readServerLock,N as readServerPackageVersion,Pe as readSkillInstallStateSnapshot,en as readSkillManagement,Un as readStateManifest,Gn as readTargetRecordedAt,_ as readTargetVersion,on as readUiLock,ln as reconcile,Vt as recordContributor,ze as recordSkillInstallEvent,K as registerAllTools,C as registerWrite,Li as releaseProcessLock,Di as releaseServerLock,Xn as releaseUiLock,_t as removeLastKnownHash,qr as resetMetrics,e as resolveBundleEnabled,ie as resolveBundledSkillDir,ni as resolveContentDir,Gr as resolveCursorBinaryDefault,dn as resolveCursorSpawnInvocation,me as resolveEffectiveLinterConfig,st as resolveLockDir,Cr as resolveNativeConfigForDoc,It as resolveNativeMarkdownlintConfig,oe as resolvePack,Mr as resolvePackageVersion,wt as resolveUiInfo,Jr as restoreContributors,ui as restoreLifecycleFromConflictsJson,Yt as rewriteMarkdownLinksForDocumentRename,pr as rewriteWikiLinksForDocumentRename,X as runAuthReposSubprocess,ge as runAuthStatusSubprocess,vt as runCloneSubprocess,Tr as runDeviceFlowSubprocess,d as runWithMcpLogger,Fe as safeContentPath,li as safeSubdir,qt as safetyCheckpoint,mr as sanitizeClientName,dr as saveInMemoryCheckpoint,Pr as saveVersion,jn as seedBasenameIndex,lr as serializeError,Nn as setActiveSpanAttributes,Vn as setupServerObservers,an as shadowGit,Kt as shutdownTelemetry,si as skillManagementPath,Pi as spansCurrentPath,Ci as spansPreviousPath,yn as spawnDetached,_n as splitMarkdownBlocks,ee as startWatcher,ce as streamingProblemEvent,fi as swapContributors,Ze as teardownToleranceTelemetryWriter,Qe as toBroadcasterKey,$e as tracedAppendFileSync,D as tracedLinkSync,ei as tracedMkdir,at as tracedMkdirSync,L as tracedRename,M as tracedRenameSync,Ne as tracedRmSync,Wn as tracedRmdirSync,g as tracedUnlinkSync,zn as tracedWriteFile,Ce as tracedWriteFileSync,rn as untrackTrackedProjectSkillProjection,ft as updateLastKnownHash,Mi as updateProcessLockPort,zi as updateServerLockPort,Wr as updateUiLockPort,E as validateAgentId,te as validateCloneInputs,ye as validateSkillZip,Hi as waitForServerLockDrain,Te as withHiddenWindowsConsole,ur as withSpan,Nr as withSpanSync,Bn as writeBundleDecision,xt as writeMarkdownlintRule,Br as writeRootGitignoreForNewRepo,et as writeSkillManagement,h as writeStateManifest,we as writeTargetVersion,St as writeTracker};
|
|
1
|
+
import{C as e,Da as t,Zo as n,_a as r,ea as i,f as a,ha as o,na as s,ta as c,u as l,y as u}from"./src-S2yxN8_s.mjs";import{$ as d,$i as f,$r as p,$t as m,A as h,Ai as g,An as _,Ar as v,At as y,B as b,Bi as x,Bn as S,Br as C,Bt as w,C as T,Ca as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dr as P,Dt as F,E as I,Ei as L,En as R,Er as z,Et as B,F as V,Fi as H,Fn as U,Fr as W,Ft as G,G as K,Gi as q,Gn as J,Gr as Y,Gt as X,H as Z,Hi as Q,Hn as $,Hr as ee,Ht as te,I as ne,Ii as re,In as ie,Ir as ae,It as oe,J as se,Ji as ce,Jn as le,Jr as ue,Jt as de,K as fe,Ki as pe,Kn as me,Kr as he,Kt as ge,L as _e,Li as ve,Ln as ye,Lr as be,Lt as xe,M as Se,Mi as Ce,Mn as we,Mr as Te,Mt as Ee,N as De,Ni as Oe,Nn as ke,Nr as Ae,Nt as je,O as Me,Oi as Ne,On as Pe,Or as Fe,Ot as Ie,P as Le,Pi as Re,Pn as ze,Pr as Be,Pt as Ve,Q as He,Qi as Ue,Qr as We,Qt as Ge,R as Ke,Ri as qe,Rn as Je,Rr as Ye,Rt as Xe,S as Ze,Sa as Qe,Si as $e,Sn as et,Sr as tt,St as nt,T as rt,Ta as it,Ti as at,Tn as ot,Tr as st,Tt as ct,U as lt,Ui as ut,Un as dt,Ur as ft,Ut as pt,V as mt,Vi as ht,Vn as gt,Vr as _t,Vt as vt,W as yt,Wi as bt,Wn as xt,Wr as St,Wt as Ct,X as wt,Xi as Tt,Xn as Et,Xr as Dt,Xt as Ot,Y as kt,Yi as At,Yn as jt,Yr as Mt,Yt as Nt,Z as Pt,Zi as Ft,Zn as It,Zr as Lt,Zt as Rt,_ as zt,_a as Bt,_i as Vt,_n as Ht,_r as Ut,_t as Wt,a as Gt,aa as Kt,ai as qt,an as Jt,ar as Yt,at as Xt,b as Zt,ba as Qt,bi as $t,bn as en,br as tn,bt as nn,c as rn,ci as an,cn as on,cr as sn,d as cn,di as ln,dn as un,dr as dn,ea as fn,ei as pn,en as mn,et as hn,f as gn,fi as _n,fn as vn,fr as yn,g as bn,ga as xn,gi as Sn,gn as Cn,gr as wn,gt as Tn,h as En,ha as Dn,hi as On,hn as kn,hr as An,ht as jn,i as Mn,ia as Nn,ii as Pn,in as Fn,ir as In,it as Ln,j as Rn,ji as zn,jn as Bn,jr as Vn,jt as Hn,k as Un,ki as Wn,kn as Gn,kr as Kn,kt as qn,l as Jn,li as Yn,ln as Xn,lr as Zn,m as Qn,ma as $n,mi as er,mn as tr,mr as nr,mt as rr,n as ir,na as ar,ni as or,nn as sr,nt as cr,o as lr,oa as ur,oi as dr,on as fr,or as pr,ot as mr,p as hr,pa as gr,pi as _r,pn as vr,pr as yr,pt as br,q as xr,qi as Sr,qn as Cr,qr as wr,qt as Tr,r as Er,ra as Dr,ri as Or,rn as kr,rr as Ar,rt as jr,s as Mr,sa as Nr,si as Pr,sn as Fr,sr as Ir,t as Lr,ta as Rr,ti as zr,tn as Br,tt as Vr,u as Hr,ui as Ur,un as Wr,ur as Gr,v as Kr,va as qr,vi as Jr,vn as Yr,vr as Xr,vt as Zr,w as Qr,wa as $r,wi as ei,wn as ti,wr as ni,wt as ri,x as ii,xa as ai,xi as oi,xn as si,xr as ci,xt as li,y as ui,ya as di,yi as fi,yn as pi,yr as mi,yt as hi,z as gi,zi as _i,zn as vi,zr as yi,zt as bi}from"./src-D_chJWr7.mjs";import{A as xi,C as Si,M as Ci,S as wi,T as Ti,_ as Ei,a as Di,b as Oi,c as ki,f as Ai,g as ji,h as Mi,i as Ni,j as Pi,k as Fi,l as Ii,m as Li,n as Ri,o as zi,p as Bi,r as Vi,s as Hi,t as Ui,u as Wi,v as Gi,w as Ki,x as qi,y as Ji}from"./server-lock-D46oe4zF.mjs";export{Qt as AGENT_ID_MAX_LEN,ai as AGENT_ID_RE,ht as AGENT_WRITE_ORIGIN,di as AgentFocusBroadcaster,gr as AgentPresenceBroadcaster,Q as AgentSessionCapacityError,ut as AgentSessionManager,rr as AutoStartDisabledError,Je as BUNDLE_IDS,vi as BUNDLE_SCOPE,S as BUNDLE_SKILL_NAME,Fn as BacklinkIndex,At as CC1Broadcaster,r as CC1_CONTRACT_VERSION,de as CONFIG_FILENAME,Yn as CONFLICT_MARKER_RE,Ir as CURSOR_BUNDLE_PATHS_BY_PLATFORM,zt as ConfigSchema,ue as DEFAULT_CHECKPOINT_RETENTION,ci as DEFAULT_EMBEDDINGS_DIMENSIONS,ct as DEFAULT_PACK_ID,tt as EMBEDDINGS_API_KEY_ENV,Mt as FILE_SYSTEM_WRITER,Y as FILE_WATCHER_ORIGIN,wn as FileEmbeddingsBackend,pt as GIT_PREFLIGHT_FAIL_SPAN_NAME,Dt as GIT_UPSTREAM_WRITER,$r as GitDirAccessError,un as GitNotAvailableError,vn as GitTooOldError,Oe as HOCUSPOCUS_AUTH_REJECTION_REASONS,Re as HocuspocusAuthRejection,H as HocuspocusAuthTokenSchema,yr as INSTALLED_AGENTS_SCHEMES,o as LINEAGE_EPOCH_KEY,_e as LIVE_DERIVED_INDEX_DEBOUNCE_MS,B as LOG_MD_TEMPLATE,Tn as MANAGED_RENAME_ORIGIN,bt as MAX_AGENT_SESSIONS,Xt as MCP_CONNECTION_ID_HEADER,i as MCP_SERVER_NAME,vr as MIN_GIT_VERSION,b as MISSING_OK_CONFIG_MESSAGE,it as MalformedGitPointerError,Pt as McpLogger,mt as MissingOkConfigError,Kn as OBSERVER_SYNC_ORIGIN,Nt as OK_OKIGNORE_TEMPLATE,c as ORPHAN_MODES,n as PROTOCOL_VERSION,qi as PinoLogger,ki as ProcessLockCollisionError,Jn as ProjectGitInitError,Wt as ROLLBACK_ORIGIN,Ot as ROOT_GITIGNORE_TEMPLATE,ji as RUNTIME_VERSION,Lt as SERVICE_WRITER,ke as SKILL_INSTALL_EVENTS_FILE_REL,u as SKILL_STATE_TARGETS,F as STARTER_FOLDERS,Ie as STARTER_FOLDER_FRONTMATTER_FILENAME,qn as STARTER_PACKS,y as STARTER_PACK_IDS,Hn as STARTER_TEMPLATES,rt as STATE_MANIFEST_FILENAME,Ei as STATE_SCHEMA_VERSION,t as SYSTEM_DOC_NAME,xe as SeedPrerequisiteError,Xe as SeedRootDirError,Ui as ServerLockCollisionError,Lr as SingleFileNotAFileError,ir as SingleFileNotFoundError,Er as SingleFileNotMarkdownError,I as StateManifestError,Qr as TagIndex,gt as USER_GLOBAL_BUNDLE_IDS,fr as UiLockCollisionError,Zr as __getShowAllWalkStatsForTesting,hi as __resetShowAllWalkStatsForTesting,Ii as acquireProcessLock,Ri as acquireServerLock,Fr as acquireUiLock,q as applyAgentMarkdownWrite,he as applyExternalChange,ri as applySeed,j as assertCompatibleStateManifest,tr as assertGitAvailable,Ae as assertNeverDiskEvent,br as attachIdleShutdown,Kr as bootServer,O as buildAndOpenSkill,Rt as buildConfigYmlContent,fe as buildExecResult,U as buildSkillZip,Ee as buildStarterFolderFrontmatterYaml,We as buildWipTree,$ as bundleSkillMdPath,Be as classifyEvents,$t as classifyFsPath,_r as clearContributors,Ut as clearEmbeddingsKeyFromAllBackends,je as coercePackId,l as colorFromSeed,p as commitUpstreamImport,pn as commitWip,zr as commitWipFromTree,kn as compareSemver,J as composeEffectiveLinterConfig,Ur as containsConflictMarkers,W as contentHash,er as contributorCount,De as countShadowObjects,Le as countStaleAgentWipRefs,V as countWipRefs,nn as createApiExtension,z as createAssetServeMiddleware,Ar as createContentFilter,In as createContentFilterAsync,Xr as createEmbeddingsSecretStore,Mn as createEphemeralProjectDir,wr as createExternalChangeHandler,gn as createFileLogger,Ke as createLiveDerivedIndexExtension,yt as createMcpHttpHandler,nr as createOsProbe,P as createPersistenceExtension,T as createServer,Rn as createServerObserverExtension,pe as createStreamingErrorWriter,wi as createTestLogger,mi as describeStoredEmbeddingsKey,bn as detectClaudeDesktopPresence,Cn as detectGit,Me as detectProjectShape,hn as discoverLockDirs,le as discoverMarkdownlintConfig,Ct as emitPreflightFailureSpan,xr as encodeDocName,se as encodeFolderRoute,kt as encodeSkillRoute,Hr as ensureProjectGit,Ge as ensureProjectSkillGitignore,Sr as errorResponse,ae as evictStaleTrackerEntries,Vr as extractOkBinaryPath,Jt as extractWikiLinksFromMarkdown,Ht as fallbackPaths,cn as findEnclosingGitRoot,sr as findEnclosingProjectRoot,jt as findNativeMarkdownlintFile,hr as flushFileLogger,re as formatAuthRejectionWire,On as formatContributors,Sn as formatContributorsFrom,nt as formatPackRationale,or as gcCheckpointRefs,He as getCurrentMcpLogger,k as getLocalDir,Qn as getLogFilePath,Si as getLogger,En as getLogsDir,Gi as getMachineId,Rr as getMeter,$n as getMetrics,ar as getTracer,Dn as handleCollabSocketError,sn as handleSpawnCursor,ne as hasGcLogLatch,a as iconFromClientName,xn as incrementCollabSocketFilteredError,Bt as incrementServerObserverFire,m as initContent,Or as initShadowRepo,Dr as initTelemetry,Zt as initToleranceTelemetryWriter,Ln as installPrettyZodErrors,Ki as installTestLoggers,ti as installUserSkill,x as isAllowedApiOrigin,bi as isAllowedWorkspaceHostHeader,Tt as isConfigDoc,ve as isHocuspocusAuthRejectionReason,Ve as isKnownPackId,Ft as isLinkIndexExcludedDoc,w as isLoopbackAddress,Ue as isManagedArtifactDoc,s as isOrphanMode,v as isPairedWriteOrigin,Zn as isPathWithinDir,Ji as isProcessAlive,kr as isProjectRoot,pi as isProjectSkillManaged,f as isReservedForUserTree,be as isSelfWrite,fn as isSystemDoc,ii as isToleranceTelemetryEnabled,Oi as isValidLockPid,Ye as lastKnownHash,Pn as listRescueCheckpoints,G as listStarterPacks,Se as loadPrincipal,Wi as lockFilePath,Ti as loggerFactory,Fi as logsCurrentPath,xi as logsPreviousPath,tn as makeLazyEmbeddingsKeyStore,Vi as markServerLockDraining,Z as mountMcpAndApi,oi as normalizeFsPath,dt as originGitHubHost,mn as packageVersionMajorMinor,qe as parseAuthRejectionWire,Yr as parseGitVersion,_i as parseHocuspocusAuthToken,lt as parseKeepaliveConnectionId,yi as pathToDocName,A as planSeed,Gt as prepareSingleFileOpen,cr as processCommand,jr as processUsage,ot as readAllTargets,R as readBundleDecision,Et as readOwnNativeRules,Ai as readProcessLock,Bi as readProcessLockDetailed,gi as readProjectHeadState,An as readProjectLocalSemanticConfig,Ni as readServerLock,N as readServerPackageVersion,Pe as readSkillInstallStateSnapshot,en as readSkillManagement,Un as readStateManifest,Gn as readTargetRecordedAt,_ as readTargetVersion,on as readUiLock,ln as reconcile,Vt as recordContributor,ze as recordSkillInstallEvent,K as registerAllTools,C as registerWrite,Li as releaseProcessLock,Di as releaseServerLock,Xn as releaseUiLock,_t as removeLastKnownHash,qr as resetMetrics,e as resolveBundleEnabled,ie as resolveBundledSkillDir,ni as resolveContentDir,Gr as resolveCursorBinaryDefault,dn as resolveCursorSpawnInvocation,me as resolveEffectiveLinterConfig,st as resolveLockDir,Cr as resolveNativeConfigForDoc,It as resolveNativeMarkdownlintConfig,oe as resolvePack,Mr as resolvePackageVersion,wt as resolveUiInfo,Jr as restoreContributors,ui as restoreLifecycleFromConflictsJson,Yt as rewriteMarkdownLinksForDocumentRename,pr as rewriteWikiLinksForDocumentRename,X as runAuthReposSubprocess,ge as runAuthStatusSubprocess,vt as runCloneSubprocess,Tr as runDeviceFlowSubprocess,d as runWithMcpLogger,Fe as safeContentPath,li as safeSubdir,qt as safetyCheckpoint,mr as sanitizeClientName,dr as saveInMemoryCheckpoint,Pr as saveVersion,jn as seedBasenameIndex,lr as serializeError,Nn as setActiveSpanAttributes,Vn as setupServerObservers,an as shadowGit,Kt as shutdownTelemetry,si as skillManagementPath,Pi as spansCurrentPath,Ci as spansPreviousPath,yn as spawnDetached,_n as splitMarkdownBlocks,ee as startWatcher,ce as streamingProblemEvent,fi as swapContributors,Ze as teardownToleranceTelemetryWriter,Qe as toBroadcasterKey,$e as tracedAppendFileSync,D as tracedLinkSync,ei as tracedMkdir,at as tracedMkdirSync,L as tracedRename,M as tracedRenameSync,Ne as tracedRmSync,Wn as tracedRmdirSync,g as tracedUnlinkSync,zn as tracedWriteFile,Ce as tracedWriteFileSync,rn as untrackTrackedProjectSkillProjection,ft as updateLastKnownHash,Mi as updateProcessLockPort,zi as updateServerLockPort,Wr as updateUiLockPort,E as validateAgentId,te as validateCloneInputs,ye as validateSkillZip,Hi as waitForServerLockDrain,Te as withHiddenWindowsConsole,ur as withSpan,Nr as withSpanSync,Bn as writeBundleDecision,xt as writeMarkdownlintRule,Br as writeRootGitignoreForNewRepo,et as writeSkillManagement,h as writeStateManifest,we as writeTargetVersion,St as writeTracker};
|