@inkeep/open-knowledge 0.42.0-beta.12 → 0.42.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/{acp-harness-probe-CjydUqQ4.mjs → acp-harness-probe-PwxCSk8L.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/cli.mjs +6 -6
  5. package/dist/constants-CcMCMPg3.mjs +2 -0
  6. package/dist/index.d.mts +17 -17
  7. package/dist/index.mjs +1 -1
  8. package/dist/{init-DnPkN5n-.mjs → init-C_ZFDDwH.mjs} +3 -3
  9. package/dist/init-lRVOzPU9.mjs +1 -0
  10. package/dist/{launch-json-removal-BA-sCNdT.mjs → launch-json-removal-DPvJksib.mjs} +2 -2
  11. package/dist/{loader-DCNyG4ZR.mjs → loader-0YCBN4cH.mjs} +2 -2
  12. package/dist/loader-CSY1M15w.mjs +1 -0
  13. package/dist/preview-CiaBar1u.mjs +1 -0
  14. package/dist/{preview-CfZ5AA27.mjs → preview-Cjg4sLCV.mjs} +2 -2
  15. package/dist/public/assets/FeedbackForm-BtLP5P4r.js +1 -0
  16. package/dist/public/assets/ReportBugDialogBody-CkyHWZh9.js +3 -0
  17. package/dist/public/assets/{index-BOJ7Bris.js → index-CFaXQy8P.js} +101 -101
  18. package/dist/public/index.html +1 -1
  19. package/dist/{repair-launch-json-qcHlix78.mjs → repair-launch-json-CZawWAqd.mjs} +2 -2
  20. package/dist/{repair-mcp-configs-DHQ158Ii.mjs → repair-mcp-configs-DpdVVhiU.mjs} +2 -2
  21. package/dist/src-9fqRbYyu.mjs +22 -0
  22. package/dist/{start-B9UTrPaX.mjs → start-FUQOcvoI.mjs} +2 -2
  23. package/dist/start-eE4o515K.mjs +1 -0
  24. package/package.json +4 -4
  25. package/dist/constants-DDOp7euF.mjs +0 -2
  26. package/dist/init-Nb6wwQ_E.mjs +0 -1
  27. package/dist/loader-Bk0QXISJ.mjs +0 -1
  28. package/dist/preview-D-Bg4IXi.mjs +0 -1
  29. package/dist/public/assets/FeedbackForm-BKWqxmdO.js +0 -1
  30. package/dist/public/assets/ReportBugDialogBody-CAnsRf9T.js +0 -2
  31. package/dist/src-DIp07PRS.mjs +0 -22
  32. package/dist/start-9dga8r1v.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{O as r,j as i,no as a,za as o}from"./src-CJ8mKCzo.mjs";import{Fr as s,Jr as c,Pr as l,Tr as u,Yr as d,Zr as f,_r as p,ar as m,c as h,dn as g,fn as _,gn as v,ir as y,l as b,mn as x,qr as S,u as ee,ui as te,va as ne,vr as re}from"./src-CIFd3tOE.mjs";import{K as ie}from"./sleep-B2L0pvp4.mjs";import{M as C,P as w}from"./fs-traced-Cc6WsRtP.mjs";import{C as ae,S as oe,T,d as E,g as se,h as ce,i as le,l as ue,m as de,p as fe,s as pe,t as me,u as he}from"./write-project-skill-CeYehb7h.mjs";import{i as D,n as ge,o as O,r as _e,s as k,t as A}from"./colors-BsmVIwfM.mjs";import{t as ve}from"./constants-DDOp7euF.mjs";import{t as j}from"./is-object-ByG7RnjH.mjs";import{t as ye}from"./preview-CfZ5AA27.mjs";import{createRequire as be}from"node:module";import{execFileSync as xe}from"node:child_process";import Se,{dirname as M,isAbsolute as Ce,join as N,relative as P,resolve as we,sep as Te}from"node:path";import{existsSync as F,lstatSync as Ee,mkdirSync as De,readFileSync as I,readlinkSync as Oe,realpathSync as ke,statSync as Ae,writeFileSync as je}from"node:fs";import{homedir as Me}from"node:os";import L from"node:process";import{fileURLToPath as Ne}from"node:url";import*as Pe from"node:readline";import{inspect as Fe,stripVTControlCharacters as Ie,styleText as R}from"node:util";import{AsyncLocalStorage as Le,AsyncResource as Re}from"node:async_hooks";const ze=new Set([`emacs`,`vim`]);function Be(e){return ze.has(e)}function Ve(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Be))):[]}const z=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,He=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ue=e=>e.name===`space`,We=e=>e.name===`backspace`,Ge=e=>`1234567890`.includes(e.name),Ke=e=>e.name===`enter`||e.name===`return`;var qe=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Je=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ye=class extends Error{name=`ExitPromptError`},Xe=class extends Error{name=`HookError`},Ze=class extends Error{name=`ValidationError`};const Qe=new Le;function $e(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function et(e,t){let n=$e(e);return Qe.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function B(){let e=Qe.getStore();if(!e)throw new Xe(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function tt(){return B().rl}function nt(e){return Re.bind((...t)=>{let n=B(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function rt(e){let t=B(),{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 it(){B().handleChange()}const V={queue(e){let t=B(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(tt());if(r!=null&&typeof r!=`function`)throw new Ze(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=B();nt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=B();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function at(e){return typeof e==`function`}function H(e){return rt(t=>{let n=Re.bind(function(e){t.get()!==e&&(t.set(e),it())});if(t.initialized)return[t.get(),n];let r=at(e)?e():e;return t.set(r),[r,n]})}function ot(e,t){rt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&V.queue(e),n.set(t)})}function st(){return L.platform.startsWith(`win`)?!!L.env.CI||!!L.env.WT_SESSION||!!L.env.TERMINUS_SUBLIME||L.env.ConEmuTask===`{cmd::Cmder}`||L.env.TERM_PROGRAM===`Terminus-Sublime`||L.env.TERM_PROGRAM===`vscode`||L.env.TERM===`xterm-256color`||L.env.TERM===`alacritty`||L.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:L.env.TERM!==`linux`}const ct={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:`╱`},lt={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:`⅒`},ut={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`},dt={...ct,...lt},ft={...ct,...ut},U=st()?dt:ft;Object.entries(lt);const pt={prefix:{idle:R(`blue`,`?`),done:R(`green`,U.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>R(`yellow`,e))},keybindings:[],style:{answer:e=>R(`cyan`,e),message:e=>R(`bold`,e),error:e=>R(`red`,`> ${e}`),defaultAnswer:e=>R(`dim`,`(${e})`),help:e=>R(`dim`,e),highlight:e=>R(`cyan`,e),key:e=>R(`cyan`,R(`bold`,`<${e}>`))}};function mt(){return{...pt,keybindings:Ve()}}function ht(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 gt(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ht(n)&&ht(r)?gt(n,r):r}return t}function _t(...e){return gt(mt(),...e.filter(e=>e!=null))}function vt({status:e=`idle`,theme:t}){let[n,r]=H(!1),[i,a]=H(0),{prefix:o,spinner:s}=_t(t);return ot(()=>{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 yt(e,t){return rt(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 bt(e){return H({current:e})[0]}function xt(e){let t=bt(e);t.current=e,ot(e=>{let n=!1,r=nt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var St=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 Ct=(()=>{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}})(),wt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Tt=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,Et=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Dt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ot=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,kt=/\t{1,1000}/y,At=/[\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,jt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Mt=/\p{M}+/gu,Nt={limit:1/0,ellipsis:``},Pt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Pt(i,Nt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[jt,l],[Et,0],[Dt,o],[kt,s],[At,c],[Ot,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(Mt,``)){let t=e.codePointAt(0)||0;if(S=wt(t)?2:Tt(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===Ot?Ct(e.slice(p,n.lastIndex)):n===At?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}},Ft={limit:1/0,ellipsis:``,ellipsisWidth:0},W=(e,t={})=>Pt(e,Ft,t).width,It=`]8;;`,Lt=RegExp(`(?:\\[(?<code>\\d+)m|\\${It}(?<uri>.*))`,`y`),Rt=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},zt=e=>`[${e}m`,Bt=e=>`${It}${e}`,Vt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:W(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=W(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(It,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())},Ht=e=>{let t=e.split(` `),n=t.length;for(;n&&!W(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ut=(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=W(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=W(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(``),Vt(s,r,t),c=W(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Vt(s,r,t),c=W(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Vt(s,r,t),c=W(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ht(e)));let l=s.join(`
1
+ import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{O as r,j as i,no as a,za as o}from"./src-CJ8mKCzo.mjs";import{Fr as s,Jr as c,Pr as l,Tr as u,Yr as d,Zr as f,_r as p,ar as m,c as h,dn as g,fn as _,gn as v,ir as y,l as b,mn as x,qr as S,u as ee,ui as te,va as ne,vr as re}from"./src-CIFd3tOE.mjs";import{K as ie}from"./sleep-B2L0pvp4.mjs";import{M as C,P as w}from"./fs-traced-Cc6WsRtP.mjs";import{C as ae,S as oe,T,d as E,g as se,h as ce,i as le,l as ue,m as de,p as fe,s as pe,t as me,u as he}from"./write-project-skill-CeYehb7h.mjs";import{i as D,n as ge,o as O,r as _e,s as k,t as A}from"./colors-BsmVIwfM.mjs";import{t as ve}from"./constants-CcMCMPg3.mjs";import{t as j}from"./is-object-ByG7RnjH.mjs";import{t as ye}from"./preview-Cjg4sLCV.mjs";import{createRequire as be}from"node:module";import{execFileSync as xe}from"node:child_process";import Se,{dirname as M,isAbsolute as Ce,join as N,relative as P,resolve as we,sep as Te}from"node:path";import{existsSync as F,lstatSync as Ee,mkdirSync as De,readFileSync as I,readlinkSync as Oe,realpathSync as ke,statSync as Ae,writeFileSync as je}from"node:fs";import{homedir as Me}from"node:os";import L from"node:process";import{fileURLToPath as Ne}from"node:url";import*as Pe from"node:readline";import{inspect as Fe,stripVTControlCharacters as Ie,styleText as R}from"node:util";import{AsyncLocalStorage as Le,AsyncResource as Re}from"node:async_hooks";const ze=new Set([`emacs`,`vim`]);function Be(e){return ze.has(e)}function Ve(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Be))):[]}const z=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,He=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ue=e=>e.name===`space`,We=e=>e.name===`backspace`,Ge=e=>`1234567890`.includes(e.name),Ke=e=>e.name===`enter`||e.name===`return`;var qe=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Je=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},Ye=class extends Error{name=`ExitPromptError`},Xe=class extends Error{name=`HookError`},Ze=class extends Error{name=`ValidationError`};const Qe=new Le;function $e(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function et(e,t){let n=$e(e);return Qe.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function B(){let e=Qe.getStore();if(!e)throw new Xe(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function tt(){return B().rl}function nt(e){return Re.bind((...t)=>{let n=B(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function rt(e){let t=B(),{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 it(){B().handleChange()}const V={queue(e){let t=B(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(tt());if(r!=null&&typeof r!=`function`)throw new Ze(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=B();nt(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=B();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function at(e){return typeof e==`function`}function H(e){return rt(t=>{let n=Re.bind(function(e){t.get()!==e&&(t.set(e),it())});if(t.initialized)return[t.get(),n];let r=at(e)?e():e;return t.set(r),[r,n]})}function ot(e,t){rt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&V.queue(e),n.set(t)})}function st(){return L.platform.startsWith(`win`)?!!L.env.CI||!!L.env.WT_SESSION||!!L.env.TERMINUS_SUBLIME||L.env.ConEmuTask===`{cmd::Cmder}`||L.env.TERM_PROGRAM===`Terminus-Sublime`||L.env.TERM_PROGRAM===`vscode`||L.env.TERM===`xterm-256color`||L.env.TERM===`alacritty`||L.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:L.env.TERM!==`linux`}const ct={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:`╱`},lt={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:`⅒`},ut={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`},dt={...ct,...lt},ft={...ct,...ut},U=st()?dt:ft;Object.entries(lt);const pt={prefix:{idle:R(`blue`,`?`),done:R(`green`,U.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>R(`yellow`,e))},keybindings:[],style:{answer:e=>R(`cyan`,e),message:e=>R(`bold`,e),error:e=>R(`red`,`> ${e}`),defaultAnswer:e=>R(`dim`,`(${e})`),help:e=>R(`dim`,e),highlight:e=>R(`cyan`,e),key:e=>R(`cyan`,R(`bold`,`<${e}>`))}};function mt(){return{...pt,keybindings:Ve()}}function ht(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 gt(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ht(n)&&ht(r)?gt(n,r):r}return t}function _t(...e){return gt(mt(),...e.filter(e=>e!=null))}function vt({status:e=`idle`,theme:t}){let[n,r]=H(!1),[i,a]=H(0),{prefix:o,spinner:s}=_t(t);return ot(()=>{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 yt(e,t){return rt(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 bt(e){return H({current:e})[0]}function xt(e){let t=bt(e);t.current=e,ot(e=>{let n=!1,r=nt((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var St=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 Ct=(()=>{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}})(),wt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Tt=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,Et=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Dt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ot=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,kt=/\t{1,1000}/y,At=/[\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,jt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Mt=/\p{M}+/gu,Nt={limit:1/0,ellipsis:``},Pt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Pt(i,Nt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[jt,l],[Et,0],[Dt,o],[kt,s],[At,c],[Ot,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(Mt,``)){let t=e.codePointAt(0)||0;if(S=wt(t)?2:Tt(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===Ot?Ct(e.slice(p,n.lastIndex)):n===At?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}},Ft={limit:1/0,ellipsis:``,ellipsisWidth:0},W=(e,t={})=>Pt(e,Ft,t).width,It=`]8;;`,Lt=RegExp(`(?:\\[(?<code>\\d+)m|\\${It}(?<uri>.*))`,`y`),Rt=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},zt=e=>`[${e}m`,Bt=e=>`${It}${e}`,Vt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:W(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=W(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(It,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())},Ht=e=>{let t=e.split(` `),n=t.length;for(;n&&!W(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ut=(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=W(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=W(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(``),Vt(s,r,t),c=W(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Vt(s,r,t),c=W(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Vt(s,r,t),c=W(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ht(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===`›`){Lt.lastIndex=e+1;let t=Lt.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+=Bt(``));let e=i?Rt(i):void 0;i&&e&&(r+=zt(e))}else t===`
4
4
  `&&(i&&Rt(i)&&(r+=zt(i)),a&&(r+=Bt(a)))}return r},Wt=/\r?\n/;function Gt(e,t,n){return String(e).normalize().split(Wt).map(e=>Ut(e,t,n)).join(`
@@ -638,6 +638,6 @@ export default function okBridge(pi: {
638
638
  `));let f=`${a?``:``}${u}`;return f!==i&&w(e,f,{mode:Y(e)}),{kind:l?`overwritten`:`written`}}const yi=e=>e!==`project`,bi=e=>e!==`user`;async function xi(){let e=await Zn({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 Si(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??xi)():`both`}async function Ci(e){return nr({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 wi(e){if(e.sharing!==void 0)return e.sharing;let t=An(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??Ci)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Ti(e){if(e===void 0||e===!0)return new Set(s);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(s.filter(e=>t.includes(e)))}function Ei(e,t,n){let r=we(n,e),i;try{i=Ae(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=P(Di(t),Di(r));if(a.startsWith(`..`)||Ce(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function Di(e){try{return ke(e)}catch{return e}}const Oi=`open-knowledge-ui`;function ki(e,t,n){try{return F(e.detectPath?.(t,n)??M(e.configPath(t,n)))}catch{return!1}}function Ai(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&&!ki(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 Mi(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{De(M(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{C(`${o}.lock`,()=>{let t=Jr(o).writePath;if(De(M(t),{recursive:!0}),e.format===`toml`){let n=_i(ni(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=vi(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=gi(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 ji={pi:Lr};function Mi(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=ji[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{De(M(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{C(`${t}.lock`,()=>{let e=null;try{e=I(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}w(t,c,e===null?void 0:{mode:Y(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 Ni(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!F(n)))return{editorId:e.id,label:e.label,path:n}}async function Pi(e){let t=oe(e.editors).filter(e=>e.scope===`global`),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>Ai(t,``,n,e.home))}function Fi(e,t,n,r){let i=Li(e,t,n,r);return i.kind===`present`?i.entry:null}function Ii(e,t,n,r){let i=hi(e,t,r);if(!j(i))return{kind:`no-entry`};let a=i[n];return j(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Li(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!F(i))return{kind:`absent`};try{if(Ae(i).size>ui)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=I(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:Ir(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=ni().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Ii(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,wn.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Ii(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=ai(a);return s?oi(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Ii(c(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Ri(e={}){let t=we(e.cwd??process.cwd()),n=Br(t,{homeDir:e.home}),r=n.projectRoot,i=!F(N(r,`.ok`)),a=n.gitRootPromoted?P(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:Ei(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${k(`[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 c={mode:e.devMcp?`dev`:`published`},d=await ee(r),f;try{f=_(r,{contentDir:o})}catch(t){let i=E.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:d.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 m=f.created.includes(ve),v=!1;if(d.didInit)try{v=x(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{g(r)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore entry at ${r}: ${e instanceof Error?e.message:String(e)}`)}let y=await h(r);y.kind===`untracked`&&console.warn(`[ok] Untracked the OpenKnowledge project skill (${y.dirs.join(`, `)}) — it is now local-only. Teammates will see this as a deletion on their next pull.`);let b=await Si({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),S=e.editors??Wi(r,e.home),te=e.editors??ue.filter(e=>E[e].projectConfigPath!==void 0||E[e].projectSkillPath!==void 0),ne=oe(S),ie=oe(te),C=e.mcp===!1||b===null,w=Array.from(new Map([...ne,...C?[]:ie].map(e=>[e.id,e])).values()),ae=ne.filter(t=>ki(t,r,e.home)),T=[],se=[],ce=new Set;for(let t of w){if(C){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(yi(b)&&ne.includes(t)&&t.scope===`global`&&T.push(Ai(t,r,c,e.home)),bi(b)&&ie.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=Ai(t,r,c,e.home,n);T.push(i),(i.action===`written`||i.action===`overwritten`)&&ce.add(n)}}let de=new Set;for(let t of ie){let n=t.projectSkillPath?.(r);!n||de.has(n)||(de.add(n),se.push(le(t,r,{home:e.home})))}let fe=!C&&b!==null&&bi(b)?ie.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,me=C?[]:ae.map(e=>Ni(e,r)).filter(e=>e!==void 0).filter(e=>!ce.has(e.path)),he=e.installUserSkill??re,D=e.home??Me(),ge=Ti(e.skills),O=!1,_e=!1,A=!1,j=!1,ye=!1;for(let t of s){let n=ge.has(t);if(await u(D,l[t],n).catch(()=>{}),n){O=!0;let n=await he({home:e.home,bundleId:t,force:!0});n===`installed`?_e=!0:n===`failed`?A=!0:n===`no-hosts`?ye=!0:j=!0}else try{pe(D,t)}catch{}}let be=A?`failed`:_e?`installed`:O&&j?`skip-current`:O&&ye?`no-hosts`:`declined`,xe=_e?p(D).map(e=>e.editorId):[],Se=C?`skipped-flag`:`skipped-missing`,M=T.find(e=>e.editorId===`claude`)??T[0]??{action:Se,configPath:E.claude.configPath(r,e.home)},Ce=await zi({projectRoot:r,desiredMode:await wi({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:f.created,contentUpdated:f.updated,contentSkipped:f.skipped,editors:T,projectSkills:se,legacyProjectConfigs:me,skillInstall:be,skillHosts:xe,didGitInit:d.didInit,rootGitignoreCreated:v,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:m?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:M.action,mcpPath:M.configPath,mcpError:`error`in M?M.error:void 0,projectScopeUnsupportedLabels:fe,sharing:Ce}}async function zi(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=An(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=Dn(t);if(n===`local-only`){let e=On(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`}:Bi(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=kn(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Bi(t,o,`remove`)}function Bi(e,t,n){let r=An(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 Vi(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 Hi(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=N(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(A(`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(A(`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(A(`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(A(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(A(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?P(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} ${O(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${O(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${_e(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${Vi(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(A(`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?P(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${O(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${O(`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} ${_e(`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} ${P(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(A(`User-global skill:`)),e.skillInstall){case`installed`:{let t=(e.skillHosts??[]).map(e=>he[e]??e),r=t.length>0?t.join(`, `):`the shared ~/.agents store`;n.push(` open-knowledge ${O(`installed for ${r}`)}`);break}case`skip-current`:n.push(` open-knowledge ${O(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${ge(`skipped (opted out via --no-skills)`)}`);break;case`no-hosts`:n.push(` open-knowledge ${ge(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${k(`open-knowledge install failed — MCP still configured; retry with:`)}`),n.push(` ${k(` ok repair-skills`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(k(`⚠ --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(k(`⚠ 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(ye(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...qi(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(`${O(`✓`)} ${A(`Next steps:`)}`),n.push(` 1. Open your editor (${D(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${D(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${D(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${D(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${D(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${D(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
640
640
  `)}function Ui(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 Wi(e,t){let n=[];for(let r of ue)ki(E[r],e,t)&&n.push(r);return n}function Gi(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Fe(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 Ki(){return new ae(`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 T(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new T(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new T(`--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?Gi():null;try{let r;try{r=await Ri({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 y||e instanceof m){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof b){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-Bk0QXISJ.mjs`),{resolveContentDir:s}=await import(`./src-DHVO9P4d.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-D-Bg4IXi.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(Ui(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Hi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function qi(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${O(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${O(`local-only`)} — already excluded; nothing to do.`):n.push(` ${O(`local-only`)}`):e.action===`removed`?n.push(` ${O(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${O(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
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-CSY1M15w.mjs`),{resolveContentDir:s}=await import(`./src-DHVO9P4d.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-CiaBar1u.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(Ui(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Hi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function qi(e,t){let n=[];switch(e.kind){case`applied`:return n.push(A(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${O(`local-only`)} — appended ${e.appended.length} path(s) to ${A(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${O(`local-only`)} — already excluded; nothing to do.`):n.push(` ${O(`local-only`)}`):e.action===`removed`?n.push(` ${O(`shared`)} — removed OK paths from ${A(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${O(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(k(`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 ${D(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(k(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${D(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${D(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(k(`Sharing mode unavailable: ${e.reason}.`));return n}}export{jn as A,vt as B,nr as C,Un as D,Hn as E,kn as F,H,Nn as I,Cn as L,Pn as M,An as N,On as O,Mn as P,dn as R,Fr as S,Y as T,Ke as U,_t as V,pi as _,Ui as a,ni as b,Hi as c,Fi as d,Ti as f,Ri as g,wi as h,zi as i,Dn as j,Fn as k,qi as l,Ei as m,Oi as n,Li as o,Si as p,ji as r,Wi as s,$ as t,Ki as u,Ai as v,Zn as w,Br as x,Pi as y,xt as z};
643
- //# sourceMappingURL=init-DnPkN5n-.mjs.map
643
+ //# sourceMappingURL=init-C_ZFDDwH.mjs.map
@@ -0,0 +1 @@
1
+ import{g as e}from"./init-C_ZFDDwH.mjs";export{e as runInit};
@@ -1,2 +1,2 @@
1
- import{Jr as e,Zr as t}from"./src-CIFd3tOE.mjs";import{P as n}from"./fs-traced-Cc6WsRtP.mjs";import{D as r,T as i}from"./init-DnPkN5n-.mjs";import{t as a}from"./is-object-ByG7RnjH.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=t(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?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
- //# sourceMappingURL=launch-json-removal-BA-sCNdT.mjs.map
1
+ import{Jr as e,Zr as t}from"./src-CIFd3tOE.mjs";import{P as n}from"./fs-traced-Cc6WsRtP.mjs";import{D as r,T as i}from"./init-C_ZFDDwH.mjs";import{t as a}from"./is-object-ByG7RnjH.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=t(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?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
+ //# sourceMappingURL=launch-json-removal-DPvJksib.mjs.map
@@ -1,4 +1,4 @@
1
- import"./src-CJ8mKCzo.mjs";import{_ as e}from"./src-CIFd3tOE.mjs";import{K as t,l as n,o as r,s as i}from"./sleep-B2L0pvp4.mjs";import{D as a,O as o}from"./fs-traced-Cc6WsRtP.mjs";import{t as s}from"./constants-DDOp7euF.mjs";import{t as c}from"./is-object-ByG7RnjH.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),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=i({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function v(t){let i=t??process.cwd(),c=[],u=o(`user`,i),d=a({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(i,`.ok`,s),m=g(p);if(m.value!==null){let e=r({value:m.value,file:m.path,source:m.source,doc:m.doc});if(e.length>0)throw Error(e.map(n).join(`
1
+ import"./src-CJ8mKCzo.mjs";import{_ as e}from"./src-CIFd3tOE.mjs";import{K as t,l as n,o as r,s as i}from"./sleep-B2L0pvp4.mjs";import{D as a,O as o}from"./fs-traced-Cc6WsRtP.mjs";import{t as s}from"./constants-CcMCMPg3.mjs";import{t as c}from"./is-object-ByG7RnjH.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),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=i({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function v(t){let i=t??process.cwd(),c=[],u=o(`user`,i),d=a({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(i,`.ok`,s),m=g(p);if(m.value!==null){let e=r({value:m.value,file:m.path,source:m.source,doc:m.doc});if(e.length>0)throw Error(e.map(n).join(`
2
2
 
3
3
  `));f=h(f,m.value),c.push(p)}let v=e.safeParse(f);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(n(e))}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-DCNyG4ZR.mjs.map
4
+ //# sourceMappingURL=loader-0YCBN4cH.mjs.map
@@ -0,0 +1 @@
1
+ import{n as e}from"./loader-0YCBN4cH.mjs";export{e as loadConfig};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./preview-Cjg4sLCV.mjs";export{t as formatPreviewBlock,e as previewContent};
@@ -1,3 +1,3 @@
1
- import{Qr as e}from"./src-CIFd3tOE.mjs";import"./constants-DDOp7euF.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(`
1
+ import{Qr as e}from"./src-CIFd3tOE.mjs";import"./constants-CcMCMPg3.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-CfZ5AA27.mjs.map
3
+ //# sourceMappingURL=preview-Cjg4sLCV.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./index-CFaXQy8P.js";export{e as FeedbackForm};
@@ -0,0 +1,3 @@
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{a as c,c as l,i as u,n as d,o as f,s as p,t as m}from"./dialog-TkFkuYVg.js";import{t as h}from"./checkbox-DY-vIhnZ.js";import{o as g}from"./dist-DbWN0KUu.js";import{t as _}from"./check-GqWaoTdV.js";import{n as v,t as y}from"./CopyButton-1Q6Wnnjb.js";import{t as b}from"./loader-circle-Cg5SU7AZ.js";import{n as ee}from"./BugReportHistory-B0qbbAw0.js";import{t as te}from"./triangle-alert-Clgvyc7B.js";import{t as ne}from"./input-D0ZW0Opq.js";import{t as re}from"./badge-Dba4cvJR.js";import{t as x}from"./external-link-T4Nj1gcG.js";import{n as ie}from"./clipboard-adapter--Ja4oXEM.js";import{t as ae}from"./textarea-RSYJwPz9.js";var oe=o(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),se=o(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),ce=a(),S=e(n(),1),C=t(),w=`support@inkeep.com`;function le(e){return`mailto:${w}?subject=${encodeURIComponent(e)}`}function ue(e){let t=(0,ce.c)(7),{href:n}=e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=e=>x(e,n),i=e=>x(e,n),t[0]=n,t[1]=r,t[2]=i);let a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,C.jsx)(`a`,{href:n,onClick:r,onAuxClick:i,className:`text-primary hover:underline`,children:w}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function de(e,t){let n=e.trim();if(t===void 0)return n===``?void 0:n;let r=t.join(`
2
+ `);return n===``?r:`${n}\n\n${r}`}var T=25;function E(e){return e.replace(/\(([^)]*)\)/,(e,t)=>{let n=t.split(/[/\\]/).pop();return n===void 0||n===``?e:`(${n})`})}function D(e){let t=e.split(`
3
+ `).map(e=>E(e.trim())).filter(e=>e!==``);if(t.length===0)return[];let n=t.slice(0,T),r=t.length-n.length;return[`Component stack:`,...n,...r>0?[`... ${r} more frame(s) omitted`]:[]]}function fe(e){let t=[`Crash source: ${e.source}`];return e.docName!==void 0&&t.push(`Document: ${e.docName}`),e.errorMessage!==void 0&&t.push(`Error: ${e.errorMessage}`),e.componentStack!==void 0&&t.push(...D(e.componentStack)),t}function pe(e){return[`Crash source: ${e.kind===`render-process-gone`?`renderer process crash (reason: ${e.context.reason})`:e.kind===`child-process-gone`?`${e.context.processType} process crash (reason: ${e.context.reason})`:e.context.dirtyShutdown?`previous session ended without a clean quit`:`new crash dump found from the previous session`}`,`Crash event: ${e.eventId}`]}var me={step:`compose`,creating:!1,createError:null};function he(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function O(e){return e.split(/[\\/]/).pop()??e}function ge(e){return e.summary.files.some(e=>e.startsWith(`extra/`)&&e!==g)}function k(e){let t=(0,ce.c)(93),{open:n,onOpenChange:a,systemWide:o,crashContext:g,crashInvite:x,screenshot:oe}=e,w=o===void 0?!1:o,T=oe===void 0?null:oe,{_:E}=i(),[D,O]=(0,S.useState)(me),[k,be]=(0,S.useState)(``),[A,xe]=(0,S.useState)(g!==void 0||x!==void 0),j=x?.minidumpAvailable===!0,[M,Se]=(0,S.useState)(j),[N,Ce]=(0,S.useState)(!0),[we,Te]=(0,S.useState)(0),P=(0,S.useRef)(0),Ee=(0,S.useId)(),De=(0,S.useId)(),Oe=(0,S.useId)(),F=(0,S.useId)(),I=(0,S.useId)(),ke=(0,S.useId)(),Ae=(0,S.useId)(),L=(0,S.useId)(),R=(0,S.useId)(),z=(0,S.useId)(),B=(0,S.useId)(),V=D.step===`sending`,H;t[0]!==g||t[1]!==x?(H=g===void 0?x===void 0?void 0:pe(x):fe(g),t[0]=g,t[1]=x,t[2]=H):H=t[2];let U=H,je,Me;t[3]===V?(je=t[4],Me=t[5]):(je=()=>{if(!V)return;Te(0);let e=Date.now(),t=setInterval(()=>{let t=(Date.now()-e)/1e3;Te(Math.min(.9,1-Math.exp(-t/3)))},200);return()=>{clearInterval(t)}},Me=[V],t[3]=V,t[4]=je,t[5]=Me),(0,S.useEffect)(je,Me);let Ne;t[6]!==g||t[7]!==j||t[8]!==x||t[9]!==a||t[10]!==D.step?(Ne=function(e){!e&&D.step===`sending`||(e||(P.current+=1,(D.step===`success`||D.step===`email`||D.step===`failure`)&&(be(``),xe(g!==void 0||x!==void 0),Se(j),Ce(!0)),O(me)),a(e))},t[6]=g,t[7]=j,t[8]=x,t[9]=a,t[10]=D.step,t[11]=Ne):Ne=t[11];let W=Ne,G;t[12]!==E||t[13]!==j||t[14]!==A||t[15]!==M||t[16]!==N||t[17]!==k||t[18]!==U||t[19]!==T?(G=async function(){let e=window.okDesktop?.bugReport;if(!e){O({step:`compose`,creating:!1,createError:E({id:`_0JUKX`})});return}let t=P.current+=1;O({step:`compose`,creating:!0,createError:null});let n=await e.create({level:A?`full`:`standard`,note:de(k,U),...j?{includeCrashDump:M}:{},...T===null?{}:{includeScreenshot:N}});P.current===t&&(n.ok?O({step:`review`,report:{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,summary:n.summary}}):O({step:`compose`,creating:!1,createError:n.error}))},t[12]=E,t[13]=j,t[14]=A,t[15]=M,t[16]=N,t[17]=k,t[18]=U,t[19]=T,t[20]=G):G=t[20];let Pe=G,Fe;t[21]!==k||t[22]!==U?(Fe=async function(e){let t=window.okDesktop?.bugReport;if(!t)return;let n=P.current+=1;O({step:`sending`,report:e});let r=await t.send({zipPath:e.zipPath,metadata:{level:e.summary.level,systemWide:e.summary.systemWide,projectSlug:e.summary.projectSlug,note:de(k,U)}});P.current===n&&(r.ok?O({step:`success`,report:e,reference:r.reference}):r.reason===`email-draft`?O({step:`email`,report:e,mailtoUrl:r.fallback.mailtoUrl}):O({step:`failure`,report:e,mailtoUrl:r.fallback.mailtoUrl}))},t[21]=k,t[22]=U,t[23]=Fe):Fe=t[23];let K=Fe,Ie;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(e){P.current+=1,O({step:`review`,report:e})},t[24]=Ie):Ie=t[24];let Le=Ie,Re;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(e){window.okDesktop?.shell.showItemInFolder(e)},t[25]=Re):Re=t[25];let ze=Re,Be;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Be=function(e){window.okDesktop?.shell.openExternal(e)},t[26]=Be):Be=t[26];let Ve=Be,He;t[27]===we?He=t[28]:(He=Math.round(we*100),t[27]=we,t[28]=He);let Ue=He,We=!V,q;t[29]!==E||t[30]!==g||t[31]!==j||t[32]!==x||t[33]!==A||t[34]!==I||t[35]!==F||t[36]!==Ae||t[37]!==ke||t[38]!==Pe||t[39]!==W||t[40]!==M||t[41]!==N||t[42]!==Oe||t[43]!==De||t[44]!==k||t[45]!==Ee||t[46]!==D.createError||t[47]!==D.creating||t[48]!==D.step||t[49]!==T||t[50]!==R||t[51]!==L||t[52]!==w||t[53]!==B?(q=D.step===`compose`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`cd5EXh`})}),x===void 0&&(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`rD-woT`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-5`,children:[x!==void 0&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border border-chart-3/35 bg-chart-3/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(te,{className:`mt-0.5 size-4 shrink-0 text-chart-3`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`_IGfXZ`})}),(0,C.jsx)(c,{className:`mt-0.5 text-xs`,children:(0,C.jsx)(r,{id:`03wKPg`})})]})]}),D.createError!==null&&(0,C.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`wVa83H`})}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:D.createError}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`5PHgV2`,components:{0:(0,C.jsx)(`code`,{className:`font-mono`})}})})]})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,C.jsxs)(`label`,{htmlFor:Ee,className:`text-sm font-medium`,children:[x===void 0?(0,C.jsx)(r,{id:`y_K0Dz`}):(0,C.jsx)(r,{id:`60vpJN`}),` `,(0,C.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:(0,C.jsx)(r,{id:`NzluOx`})})]}),(0,C.jsx)(ae,{id:Ee,value:k,onChange:e=>be(e.target.value),placeholder:E(x===void 0?{id:`YLMBSd`}:{id:`T3j-7o`}),rows:3,className:`resize-none`,disabled:D.creating})]}),(0,C.jsxs)(`div`,{role:`group`,"aria-labelledby":B,className:`flex flex-col gap-3.5`,children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`p`,{id:B,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`WJjviG`})}),x===void 0&&(0,C.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:g===void 0?(0,C.jsx)(r,{id:`2H43L8`}):(0,C.jsx)(r,{id:`GZzDqc`})})]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:De,checked:!0,disabled:!0,"aria-describedby":Oe,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsxs)(`label`,{htmlFor:De,className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,C.jsx)(r,{id:`FgRAvd`}),(0,C.jsx)(re,{variant:`primary`,className:`text-2xs`,children:(0,C.jsx)(r,{id:`C0hoX6`})})]}),(0,C.jsx)(`p`,{id:Oe,className:`text-1sm text-muted-foreground`,children:w?(0,C.jsx)(r,{id:`ZoOlzR`}):(0,C.jsx)(r,{id:`2FnYUD`})})]})]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:F,checked:A,onCheckedChange:e=>xe(e===!0),"aria-describedby":I,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:F,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`zvjCD4`})}),(0,C.jsx)(`p`,{id:I,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`ULRb5t`})})]})]}),T!==null&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:L,checked:N,onCheckedChange:e=>Ce(e===!0),"aria-describedby":R,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:L,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`IxyZXD`})}),(0,C.jsx)(`p`,{id:R,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`yzYE4B`})}),(0,C.jsx)(`div`,{className:`mt-2 overflow-hidden rounded-md border bg-muted/40`,children:(0,C.jsx)(`img`,{src:T.dataUrl,alt:E({id:`WuntOK`}),className:`block max-h-44 w-full object-contain transition-opacity motion-reduce:transition-none ${N?`opacity-100`:`opacity-40`}`})})]})]}),j&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,C.jsx)(h,{id:ke,checked:M,onCheckedChange:e=>Se(e===!0),"aria-describedby":Ae,disabled:D.creating,className:`mt-0.5`}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,C.jsx)(`label`,{htmlFor:ke,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`8TvlHF`})}),(0,C.jsx)(`p`,{id:Ae,className:`text-1sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`jnCROW`})})]})]})]}),x===void 0&&g===void 0?(0,C.jsx)(ee,{}):null]}),(0,C.jsxs)(f,{children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>W(!1),children:x===void 0?(0,C.jsx)(r,{id:`dEgA5A`}):(0,C.jsx)(r,{id:`PBxg_E`})}),(0,C.jsxs)(s,{onClick:()=>void Pe(),disabled:D.creating,children:[D.creating&&(0,C.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),(0,C.jsx)(r,{id:`Si7mIR`})]})]})]}),t[29]=E,t[30]=g,t[31]=j,t[32]=x,t[33]=A,t[34]=I,t[35]=F,t[36]=Ae,t[37]=ke,t[38]=Pe,t[39]=W,t[40]=M,t[41]=N,t[42]=Oe,t[43]=De,t[44]=k,t[45]=Ee,t[46]=D.createError,t[47]=D.creating,t[48]=D.step,t[49]=T,t[50]=R,t[51]=L,t[52]=w,t[53]=B,t[54]=q):q=t[54];let J;t[55]!==K||t[56]!==D.report||t[57]!==D.step?(J=D.step===`review`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`2AIVbm`})}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`3l_cXP`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:D.report.summary.files.length,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/50 px-3 py-2.5 text-xs text-muted-foreground`,children:[(0,C.jsx)(se,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{children:(0,C.jsx)(r,{id:`-o5XAG`})})]})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>O(me),children:(0,C.jsx)(r,{id:`iH8pgl`})}),(0,C.jsx)(s,{onClick:()=>void K(D.report),children:(0,C.jsx)(r,{id:`O9oQJS`})})]})]}),t[55]=K,t[56]=D.report,t[57]=D.step,t[58]=J):J=t[58];let Y;t[59]!==E||t[60]!==D.report||t[61]!==D.step||t[62]!==Ue?(Y=D.step===`sending`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`M5_9s2`})}),(0,C.jsx)(c,{className:`sr-only`,children:(0,C.jsx)(r,{id:`MJqRO6`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 text-sm`,children:[(0,C.jsx)(b,{className:`size-4 shrink-0 animate-spin text-primary motion-reduce:animate-none`,"aria-hidden":`true`}),(0,C.jsx)(r,{id:`qmL1UG`}),(0,C.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`JJcBCm`,values:{0:he(D.report.zipSizeBytes)}})})]}),(0,C.jsx)(`div`,{role:`progressbar`,"aria-label":E({id:`M5_9s2`}),className:`h-1.5 overflow-hidden rounded-full bg-secondary`,children:(0,C.jsx)(`div`,{className:`h-full rounded-full bg-primary`,style:{width:`${Ue}%`}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>Le(D.report),children:(0,C.jsx)(r,{id:`dEgA5A`})}),(0,C.jsx)(s,{disabled:!0,children:(0,C.jsx)(r,{id:`O9oQJS`})})]})]}),t[59]=E,t[60]=D.report,t[61]=D.step,t[62]=Ue,t[63]=Y):Y=t[63];let X;t[64]!==E||t[65]!==W||t[66]!==D.reference||t[67]!==D.step||t[68]!==z?(X=D.step===`success`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(d,{children:(0,C.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(_,{className:`size-5 shrink-0 text-primary`,"aria-hidden":`true`}),(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`IYciRC`})})]}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`2myNzt`})})]}),(0,C.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,C.jsx)(`label`,{htmlFor:z,className:`text-sm font-medium`,children:(0,C.jsx)(r,{id:`M-IF14`})}),(0,C.jsxs)(`div`,{className:`relative`,children:[(0,C.jsx)(ne,{id:z,readOnly:!0,value:D.reference,onFocus:ve,onClick:_e,className:`select-all bg-muted pr-9 font-mono text-sm font-medium tracking-wide`}),(0,C.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,C.jsx)(y,{copyContent:D.reference,clipboardWrite:ie})})]})]}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`fxJk_6`,components:{0:(0,C.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,C.jsx)(ue,{href:le(E({id:`qEEfPk`,values:{0:D.reference}}))})}})})]})}),(0,C.jsx)(f,{children:(0,C.jsx)(s,{onClick:()=>W(!1),children:(0,C.jsx)(r,{id:`DPfwMq`})})})]}),t[64]=E,t[65]=W,t[66]=D.reference,t[67]=D.step,t[68]=z,t[69]=X):X=t[69];let Z;t[70]!==W||t[71]!==D.mailtoUrl||t[72]!==D.report||t[73]!==D.step?(Z=D.step===`email`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`6zzhQL`})}),(0,C.jsx)(c,{children:(0,C.jsx)(r,{id:`UTgWxm`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:D.report.summary.files.length,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`9XIEYq`,components:{0:(0,C.jsx)(ue,{href:D.mailtoUrl})}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>W(!1),children:(0,C.jsx)(r,{id:`yz7wBu`})}),(0,C.jsx)(s,{onClick:()=>Ve(D.mailtoUrl),children:(0,C.jsx)(r,{id:`GuaJb-`})})]})]}),t[70]=W,t[71]=D.mailtoUrl,t[72]=D.report,t[73]=D.step,t[74]=Z):Z=t[74];let Q;t[75]!==W||t[76]!==K||t[77]!==D.mailtoUrl||t[78]!==D.report||t[79]!==D.step?(Q=D.step===`failure`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(p,{children:[(0,C.jsx)(l,{children:(0,C.jsx)(r,{id:`Wi-VWy`})}),(0,C.jsx)(c,{className:`sr-only`,children:(0,C.jsx)(r,{id:`1OKzC_`})})]}),(0,C.jsxs)(d,{className:`flex flex-col gap-4`,children:[(0,C.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2.5 rounded-md border border-destructive/35 bg-destructive/10 px-3 py-2.5 text-sm`,children:[(0,C.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`font-medium`,children:(0,C.jsx)(r,{id:`Oawo4U`})}),(0,C.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:(0,C.jsx)(r,{id:`2-CeZn`})})]})]}),(0,C.jsx)(ye,{zipPath:D.report.zipPath,zipSizeBytes:D.report.zipSizeBytes,fileCount:null,rawDumpIncluded:ge(D.report),onReveal:ze}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,C.jsx)(r,{id:`9XIEYq`,components:{0:(0,C.jsx)(ue,{href:D.mailtoUrl})}})})]}),(0,C.jsxs)(f,{className:`sm:justify-between`,children:[(0,C.jsx)(s,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>W(!1),children:(0,C.jsx)(r,{id:`yz7wBu`})}),(0,C.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[(0,C.jsx)(s,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>void K(D.report),children:(0,C.jsx)(r,{id:`KDw4GX`})}),(0,C.jsx)(s,{onClick:()=>Ve(D.mailtoUrl),children:(0,C.jsx)(r,{id:`GuaJb-`})})]})]})]}),t[75]=W,t[76]=K,t[77]=D.mailtoUrl,t[78]=D.report,t[79]=D.step,t[80]=Q):Q=t[80];let $;t[81]!==We||t[82]!==q||t[83]!==J||t[84]!==Y||t[85]!==X||t[86]!==Z||t[87]!==Q?($=(0,C.jsxs)(u,{className:`sm:max-w-xl`,showCloseButton:We,children:[q,J,Y,X,Z,Q]}),t[81]=We,t[82]=q,t[83]=J,t[84]=Y,t[85]=X,t[86]=Z,t[87]=Q,t[88]=$):$=t[88];let Ge;return t[89]!==W||t[90]!==n||t[91]!==$?(Ge=(0,C.jsx)(m,{open:n,onOpenChange:W,children:$}),t[89]=W,t[90]=n,t[91]=$,t[92]=Ge):Ge=t[92],Ge}function _e(e){return e.currentTarget.select()}function ve(e){return e.currentTarget.select()}function ye(e){let t=(0,ce.c)(23),{zipPath:n,zipSizeBytes:i,fileCount:a,rawDumpIncluded:o,onReveal:c}=e,l;t[0]===n?l=t[1]:(l=O(n),t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=he(i),t[2]=i,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,C.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-md bg-muted`,children:(0,C.jsx)(oe,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`})}),t[4]=p):p=t[4];let m;t[5]===u?m=t[6]:(m=(0,C.jsx)(`p`,{className:`truncate text-1sm`,title:u,children:u}),t[5]=u,t[6]=m);let h;t[7]!==a||t[8]!==o||t[9]!==f?(h=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a===null?o?(0,C.jsx)(r,{id:`_FLBbi`,values:{sizeText:f}}):(0,C.jsx)(r,{id:`89y7ar`,values:{sizeText:f}}):o?(0,C.jsx)(r,{id:`sn5BEU`,values:{sizeText:f,fileCount:a}}):(0,C.jsx)(r,{id:`3DJEEt`,values:{sizeText:f,fileCount:a}})}),t[7]=a,t[8]=o,t[9]=f,t[10]=h):h=t[10];let g;t[11]!==m||t[12]!==h?(g=(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[m,h]}),t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==c||t[15]!==n?(_=()=>c(n),t[14]=c,t[15]=n,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,C.jsx)(r,{id:`LtSYdi`}),t[17]=v):v=t[17];let y;t[18]===_?y=t[19]:(y=(0,C.jsx)(s,{variant:`link`,className:`h-auto shrink-0 p-0 text-xs`,onClick:_,children:v}),t[18]=_,t[19]=y);let b;return t[20]!==g||t[21]!==y?(b=(0,C.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md border px-3 py-2.5`,children:[p,g,y]}),t[20]=g,t[21]=y,t[22]=b):b=t[22],b}export{k as default};