@inkeep/open-knowledge 0.66.1 → 0.66.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/{acp-harness-probe-Bk3Dz297.mjs → acp-harness-probe-C-bmwKC0.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-m3Xu5_Pm.mjs +2 -0
  4. package/dist/{git-handle-C9RPCwJN.mjs → git-handle-CehgIzoK.mjs} +2 -2
  5. package/dist/git-handle-DEJ8aYeH.mjs +1 -0
  6. package/dist/index.mjs +2 -2
  7. package/dist/init-CkmKaAE9.mjs +1 -0
  8. package/dist/{init-DNQN84w4.mjs → init-DwE-82L_.mjs} +3 -3
  9. package/dist/{launch-json-removal-CsfA7Q9t.mjs → launch-json-removal-C5njpRMR.mjs} +2 -2
  10. package/dist/{loader-DOE8T0bD.mjs → loader-Da9QChC_.mjs} +2 -2
  11. package/dist/loader-Dt_OoEGe.mjs +1 -0
  12. package/dist/md-manager-BZCd3Vha.mjs +2 -0
  13. package/dist/{open-browser-Bzfc84xQ.mjs → open-browser-DIMVmm0o.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-Doha4cmP.mjs → preview-BBdR6vmw.mjs} +2 -2
  16. package/dist/preview-oAaqMEbf.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-xON2KhOz.js → ActivityModeContent-B37XJHxx.js} +1 -1
  18. package/dist/public/assets/{AddPropertiesButton-CC1Bimpt.js → AddPropertiesButton-eMa8eBGf.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-BPGzdN_g.js → AgentDiffPane-DHlBPg3c.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-Sg80UfOQ.js → AgentThreadClientBinder-lpLw9XDN.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-BOcChnxP.js → BugReportHistory-CuN8iDlA.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-BgcEcCCO.js → BugReportHistoryDialog-DGj_pTZf.js} +1 -1
  23. package/dist/public/assets/{CodeMirrorPropInput-Dp0ghtC3.js → CodeMirrorPropInput-Be4UuxHJ.js} +1 -1
  24. package/dist/public/assets/{ConsentDialogBody-DQlUb8Vu.js → ConsentDialogBody-XPmv8PGk.js} +1 -1
  25. package/dist/public/assets/{DocumentContext-Ak51fAXi.js → DocumentContext-CZ1LyjXH.js} +1 -1
  26. package/dist/public/assets/{EditorModeToggle-DpkS50Z0.js → EditorModeToggle-jAYPDv4d.js} +1 -1
  27. package/dist/public/assets/{EnableSyncConfirmDialog-DyPeGiVT.js → EnableSyncConfirmDialog-DGwynRzU.js} +1 -1
  28. package/dist/public/assets/{ExcalidrawDocEditor-BKndnS9g.js → ExcalidrawDocEditor-BWNQPfhq.js} +1 -1
  29. package/dist/public/assets/FeedbackForm-BAO3lafp.js +1 -0
  30. package/dist/public/assets/{GraphPanel-BdWJsnt-.js → GraphPanel-DDKxNmOr.js} +1 -1
  31. package/dist/public/assets/{ImportSkillDialog-C5f6Lj0b.js → ImportSkillDialog-D_3ApyBv.js} +1 -1
  32. package/dist/public/assets/{LintConfigEditor-C21DnP0H.js → LintConfigEditor-B3Gj07cI.js} +1 -1
  33. package/dist/public/assets/ManagedArtifactProperties-CV1Prpoj.js +1 -0
  34. package/dist/public/assets/{ManagedArtifactProperties-Dd9YEu9g.js → ManagedArtifactProperties-DeYta-00.js} +1 -1
  35. package/dist/public/assets/{MermaidDocEditor-CftOutDD.js → MermaidDocEditor-CiHzMRN9.js} +1 -1
  36. package/dist/public/assets/{PropertyDisplayRow-B3tLCY9W.js → PropertyDisplayRow-sm9qwuBw.js} +1 -1
  37. package/dist/public/assets/{ReportBugDialogBody-DRDozPGc.js → ReportBugDialogBody-DZA9GXnC.js} +1 -1
  38. package/dist/public/assets/{ReportBugMenuTrigger-Sbn4B06b.js → ReportBugMenuTrigger-D4qlc7zz.js} +2 -2
  39. package/dist/public/assets/{SchemaConfigEditor-DXhpWbEp.js → SchemaConfigEditor-D17w4XxC.js} +1 -1
  40. package/dist/public/assets/{SessionsHost-CGbrz5ge.js → SessionsHost-Cl-gIFYH.js} +2 -2
  41. package/dist/public/assets/{SettingsDialogBody-GRqpQyOX.js → SettingsDialogBody-Cqc-yl4k.js} +1 -1
  42. package/dist/public/assets/{ShareBranchSwitchDialog-DgKD1FWp.js → ShareBranchSwitchDialog-Ct4sBRfQ.js} +1 -1
  43. package/dist/public/assets/{ShareReceiveDialog-BsGWPO5t.js → ShareReceiveDialog-B92aqQEx.js} +1 -1
  44. package/dist/public/assets/{ShareReceiveMissDialog-DX4YDzpC.js → ShareReceiveMissDialog-C9VJyG_D.js} +1 -1
  45. package/dist/public/assets/{SkillCostValue-B4D7Ysdc.js → SkillCostValue-DLUxO68c.js} +1 -1
  46. package/dist/public/assets/{SkillEditBanner-BruoXTh-.js → SkillEditBanner-b0gL75iO.js} +1 -1
  47. package/dist/public/assets/{SkillInstallMenu-QBcuRLjh.js → SkillInstallMenu-BwbbztKY.js} +1 -1
  48. package/dist/public/assets/{SkillOriginInline-Dshp1Rdi.js → SkillOriginInline-DpPKdpar.js} +1 -1
  49. package/dist/public/assets/{SkillToolbarControls-BCXxl3_M.js → SkillToolbarControls-Bap6lIv8.js} +1 -1
  50. package/dist/public/assets/{SlidesToolbarControls-CJxgVynH.js → SlidesToolbarControls-BNqlGZ8e.js} +1 -1
  51. package/dist/public/assets/{SourceEditor-D9_q6g5_.js → SourceEditor-RCKX4Ohe.js} +1 -1
  52. package/dist/public/assets/{TerminalPanel-Lt1-XHX1.js → TerminalPanel-Zo-UDi-u.js} +1 -1
  53. package/dist/public/assets/{TerminalWindowApp-VUZguLdJ.js → TerminalWindowApp-DjRpidld.js} +1 -1
  54. package/dist/public/assets/{TextDocEditor-Cb7BPpJA.js → TextDocEditor--IKVxg88.js} +1 -1
  55. package/dist/public/assets/{ThreadView-Bf53-ggV.js → ThreadView-CUArcRSL.js} +1 -1
  56. package/dist/public/assets/{TimelineDiffPane-B1HLCcW9.js → TimelineDiffPane-D8HcBg2n.js} +1 -1
  57. package/dist/public/assets/{agent-diff-store-XWhp_hqN.js → agent-diff-store-DgFkR0kV.js} +1 -1
  58. package/dist/public/assets/{auth-state-cache-D22yWCCz.js → auth-state-cache-DNrEadrI.js} +1 -1
  59. package/dist/public/assets/{bug-report-send-manager-BBNXam8A.js → bug-report-send-manager-5nrn8Psu.js} +1 -1
  60. package/dist/public/assets/{client-version-B_H8duw7.js → client-version-DewpIoVp.js} +1 -1
  61. package/dist/public/assets/{comment-chips-D0prCEAx.js → comment-chips-mYvhrkxj.js} +1 -1
  62. package/dist/public/assets/{config-provider-D-Y4Wg0x.js → config-provider-DWieljqa.js} +1 -1
  63. package/dist/public/assets/{dist-D1GzYuCD.js → dist-As2x8uCt.js} +1 -1
  64. package/dist/public/assets/{doc-paths-ByyIE836.js → doc-paths-BkNaaTOB.js} +1 -1
  65. package/dist/public/assets/{documents-events-DPqTvBXn.js → documents-events-2g_OBjKU.js} +1 -1
  66. package/dist/public/assets/{file-tree-adapter-Ccbih42A.js → file-tree-adapter-Q4uvZiQM.js} +1 -1
  67. package/dist/public/assets/{file-tree-utils-Jz2v-e9t.js → file-tree-utils-Cy2QEG_5.js} +1 -1
  68. package/dist/public/assets/{folder-config-api-BddKQIga.js → folder-config-api-DhiWnWlS.js} +1 -1
  69. package/dist/public/assets/i18n-CpxzRV_v.js +1 -0
  70. package/dist/public/assets/{index-nJnxhQRq.js → index-DrzqbmWI.js} +7 -7
  71. package/dist/public/assets/{launcher-selection-CUAKUPGW.js → launcher-selection-DTBWt8s2.js} +1 -1
  72. package/dist/public/assets/{lint-config-client-DeGP10La.js → lint-config-client-CQNYXMfG.js} +1 -1
  73. package/dist/public/assets/{markdownlint-rule-browser-Bir8KkrK.js → markdownlint-rule-browser-BTovNATK.js} +1 -1
  74. package/dist/public/assets/{page-list-cache-D2OX_WDU.js → page-list-cache-AR7XhC2q.js} +1 -1
  75. package/dist/public/assets/{pending-receive-nav-store-sErL2uzl.js → pending-receive-nav-store-DXWRYoc_.js} +1 -1
  76. package/dist/public/assets/{progress-DfDRMpm4.js → progress-YLRB2n7w.js} +1 -1
  77. package/dist/public/assets/{project-paths-DX_YsFET.js → project-paths-BmMTa57i.js} +1 -1
  78. package/dist/public/assets/{prop-types-NHOECtyl.js → prop-types-CTZ-Zcfm.js} +1 -1
  79. package/dist/public/assets/{receive-store-6Dih24L8.js → receive-store-RexqPtVU.js} +1 -1
  80. package/dist/public/assets/{selection-context-C95IJZrT.js → selection-context-BcWEVrAI.js} +1 -1
  81. package/dist/public/assets/{skill-scope-4RF9DbEf.js → skill-scope-CauFSzAn.js} +1 -1
  82. package/dist/public/assets/{skills-api-D5W0J2dk.js → skills-api-KE9J-94z.js} +1 -1
  83. package/dist/public/assets/{src-qGi8ucyG.js → src-B5LNuYlK.js} +1 -1
  84. package/dist/public/assets/{startup-marks-Bvho0uc6.js → startup-marks-CUyZjhyC.js} +1 -1
  85. package/dist/public/assets/{tag-pill-input-CtA1wFQO.js → tag-pill-input-CcAyDLGe.js} +1 -1
  86. package/dist/public/assets/{target-navigation-intent-BFUFQkcA.js → target-navigation-intent-D6pgYTG-.js} +1 -1
  87. package/dist/public/assets/{telemetry-startup-C_zn8gFF.js → telemetry-startup-BFCbpnFp.js} +1 -1
  88. package/dist/public/assets/{terminal-cli-display-ZGFW9kw3.js → terminal-cli-display-C2L3vHWw.js} +1 -1
  89. package/dist/public/assets/{typing-burst-detector-B0lg7vla.js → typing-burst-detector-BO09cycJ.js} +1 -1
  90. package/dist/public/assets/{uninstall-BkDWS7iv.js → uninstall-DJhzaTa1.js} +1 -1
  91. package/dist/public/assets/{use-activity-panel-CuqTH-mx.js → use-activity-panel-BCJavN8T.js} +1 -1
  92. package/dist/public/assets/{use-apply-config-color-theme-Ba8Smkdy.js → use-apply-config-color-theme-CwClEWrd.js} +1 -1
  93. package/dist/public/assets/{use-collab-url-DFpuF-wX.js → use-collab-url-DHOOSaDb.js} +1 -1
  94. package/dist/public/assets/{use-live-xterm-theme-c1fyCaal.js → use-live-xterm-theme-_zomIp7z.js} +1 -1
  95. package/dist/public/assets/{use-open-skill-DJmjKHgr.js → use-open-skill-DzG96lKz.js} +1 -1
  96. package/dist/public/assets/{use-settings-route-BQW0aTo0.js → use-settings-route-Dq3eM_ye.js} +1 -1
  97. package/dist/public/assets/{use-skill-origin-WyyVjfzt.js → use-skill-origin-uUY8unvE.js} +1 -1
  98. package/dist/public/assets/{use-skills-BOMFaoLg.js → use-skills-RpG-BeVz.js} +1 -1
  99. package/dist/public/assets/{use-terminal-enabled-T9hbZCmo.js → use-terminal-enabled-DIQ4qqYj.js} +1 -1
  100. package/dist/public/assets/{use-timeline-entry-diff-Blkn7mx5.js → use-timeline-entry-diff-_fLA4Pt0.js} +1 -1
  101. package/dist/public/assets/{use-workspace-BeSzHXgL.js → use-workspace-DRylP9vX.js} +1 -1
  102. package/dist/public/index.html +47 -47
  103. package/dist/public/uninstall.html +3 -3
  104. package/dist/{repair-launch-json-AsKV5LiF.mjs → repair-launch-json-DO_3ABvq.mjs} +2 -2
  105. package/dist/{repair-mcp-configs-BYASBYNt.mjs → repair-mcp-configs-Bmw9_91L.mjs} +2 -2
  106. package/dist/{repair-skills-AGXJVKE-.mjs → repair-skills-BftHPTbX.mjs} +2 -2
  107. package/dist/repair-skills-CPy4iDny.mjs +1 -0
  108. package/dist/{resolve-project-root-XrNPFGNY.mjs → resolve-project-root-BCdGoKNz.mjs} +2 -2
  109. package/dist/{server-lock-DaOXwt6C.mjs → server-lock-CBDjdfxH.mjs} +2 -2
  110. package/dist/server-lock-xg5Njzvf.mjs +1 -0
  111. package/dist/{skill-teardown-BEnDXQv2.mjs → skill-teardown-Bxy5NV-V.mjs} +2 -2
  112. package/dist/src-B13TeG7U.mjs +1 -0
  113. package/dist/{src-BUfAkcnU.mjs → src-CP2xsmg5.mjs} +2 -2
  114. package/dist/{src-Gpb82U0M.mjs → src-D4A03H49.mjs} +2 -2
  115. package/dist/{src-D79M3x9g.mjs → src-DXJo3hyx.mjs} +1 -1
  116. package/dist/{src-Dyk9iCzv.mjs → src-HFlqeGnA.mjs} +4 -4
  117. package/dist/{start-hZ8_kSuC.mjs → start-7t3OZSc5.mjs} +3 -3
  118. package/dist/start-C1hXUjiR.mjs +1 -0
  119. package/package.json +4 -4
  120. package/dist/constants-DXEhJ197.mjs +0 -2
  121. package/dist/git-handle-pDdbSsMj.mjs +0 -1
  122. package/dist/init-D9KKXAfB.mjs +0 -1
  123. package/dist/loader-hcc6a20d.mjs +0 -1
  124. package/dist/md-manager-BUn7RZOJ.mjs +0 -2
  125. package/dist/preview-CHdEIdwL.mjs +0 -1
  126. package/dist/public/assets/FeedbackForm-BNeQXmJD.js +0 -1
  127. package/dist/public/assets/ManagedArtifactProperties-AGHZbLhh.js +0 -1
  128. package/dist/public/assets/i18n-BFtoQNCd.js +0 -1
  129. package/dist/repair-skills-DUxV_xLI.mjs +0 -1
  130. package/dist/server-lock-VtTnds5h.mjs +0 -1
  131. package/dist/src-s7hpfSip.mjs +0 -1
  132. package/dist/start-ky9sRyOI.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{Hs as r,Ls as i,Rs as a,ks as o,qs as s}from"./src-BUfAkcnU.mjs";import{Bi as c,Ir as l,hi as u,jr as d,yn as f}from"./src-Dyk9iCzv.mjs";import{execFileSync as p}from"node:child_process";import{basename as m,dirname as h,isAbsolute as g,join as _,posix as v,relative as y,resolve as b,sep as x,win32 as S}from"node:path";import{cpSync as ee,existsSync as C,lstatSync as te,mkdirSync as ne,readFileSync as re,readdirSync as ie,realpathSync as w,rmSync as ae,statSync as oe}from"node:fs";import{homedir as T}from"node:os";var E=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),D=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),O=n((e=>{let{humanReadableArgName:t}=D();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
1
+ import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{Hs as r,Ls as i,Rs as a,ks as o,qs as s}from"./src-CP2xsmg5.mjs";import{Bi as c,Ir as l,hi as u,jr as d,yn as f}from"./src-HFlqeGnA.mjs";import{execFileSync as p}from"node:child_process";import{basename as m,dirname as h,isAbsolute as g,join as _,posix as v,relative as y,resolve as b,sep as x,win32 as S}from"node:path";import{cpSync as ee,existsSync as C,lstatSync as te,mkdirSync as ne,readFileSync as re,readdirSync as ie,realpathSync as w,rmSync as ae,statSync as oe}from"node:fs";import{homedir as T}from"node:os";var E=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),D=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),O=n((e=>{let{humanReadableArgName:t}=D();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
2
2
  `)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
3
3
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
4
4
  `)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),k=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
@@ -53,4 +53,4 @@ foreach ($d in $dirs) {
53
53
  }
54
54
  [Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g @inkeep/open-knowledge), then restart your editor')
55
55
  exit 127`,I=`// ok-pi-bridge`,L=`${I}-v1`,xe=`ok-pi-managed-extension`;function Se(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(L)}return!1}function R(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=b(e);if(m(t)===`cli.mjs`&&m(h(t))===`dist`)return t;let n=t.split(x),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return _(i.length===0?x:i.join(x),`packages`,`cli`,`dist`,`cli.mjs`)}function z(e={}){return e.mode===`dev`?{command:M,args:[R(),`mcp`],env:{...N}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{command:`/bin/sh`,args:[`-l`,`-c`,P]}}function Ce(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[M,R(),`mcp`],environment:{...N}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,P]}}function we(e){if(typeof e!=`object`||!e)return!1;let t=e;return B(t,z({mode:`published`,platformName:`darwin`}))||B(t,z({mode:`published`,platformName:`win32`}))}function B(e,t){return Object.keys(e).length===Object.keys(t).length?Te(e,t):!1}function Te(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function V(e,t){let n=e=>typeof e==`string`&&e.includes(`# ok-mcp`);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`?e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3]):!1}function Ee(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:V(t.args,t.command)}function De(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&V(r,n)}function H(e){return e===`win32`?S:v}function Oe(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA||i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME||i.join(n,`.config`)}function ke(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.claude.json`)}function U(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env;if(t===`darwin`)return v.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??S.join(n,`AppData`,`Roaming`);return S.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.cursor`,`mcp.json`)}function Ae(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).CODEX_HOME??H(t).join(n,`.codex`)}function G(e={}){return H(e.platformName??process.platform).join(Ae(e),`config.toml`)}function K(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=(e.env??process.env).COPILOT_HOME??H(t).join(n,`.copilot`);return H(t).join(r,`mcp-config.json`)}function je(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function q(e={}){return H(e.platformName??process.platform).join(je(e),`opencode.json`)}function Me(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.openclaw`,`openclaw.json`)}function Ne(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.hermes`,`config.yaml`)}function J(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).PI_CODING_AGENT_DIR??H(t).join(n,`.pi`,`agent`)}function Pe(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function Fe(e,t){let n=H(t);return[{file:n.join(e,`.lmstudio`,`mcp.json`),dir:n.join(e,`.lmstudio`)},{file:n.join(e,`.cache`,`lm-studio`,`mcp.json`),dir:n.join(e,`.cache`,`lm-studio`)}]}function Ie(e){try{return ie(e).length>0}catch{return!1}}function Y(e={}){let t=e.platformName??process.platform,[n,r]=Fe(e.home??T(),t),i=[n,r].find(e=>C(e.file));return i?i.file:Ie(r.dir)?r.file:n.file}const X={claude:{id:`claude`,label:j.claude,configPath:(e,t)=>ke({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.claude`),projectConfigPath:e=>_(e,`.mcp.json`),projectSkillPath:e=>_(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:j[`claude-desktop`],configPath:(e,t)=>U({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(U({home:t}))},cursor:{id:`cursor`,label:j.cursor,configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(W({home:t})),projectConfigPath:e=>_(e,`.cursor`,`mcp.json`),projectSkillPath:e=>_(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:j.codex,configPath:(e,t)=>G({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(G({home:t})),projectConfigPath:e=>_(e,`.codex`,`config.toml`),projectSkillPath:e=>_(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:j.copilot,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(K({home:t})),projectSkillPath:e=>_(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:j.opencode,configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>o,buildEntry:(e,t)=>Ce(t),scope:`global`,detectPath:(e,t)=>h(q({home:t})),projectConfigPath:e=>_(e,`opencode.json`),projectSkillPath:e=>_(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:j.openclaw,configPath:(e,t)=>Me({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:j.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>o,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>J({home:t}),projectConfigPath:e=>_(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>_(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:j.antigravity,configPath:(e,t)=>Pe({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:j[`lm-studio`],configPath:(e,t)=>Y({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(Y({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:j.hermes,configPath:(e,t)=>Ne({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>o,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.hermes`),offerOnlyWhenDetected:!0}};function Le(e){let t=e.filter(e=>!Object.hasOwn(X,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${A.join(`, `)}`);return e.map(e=>X[e])}function Z(e,t){let n;try{n=te(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Q(e,t)}function Re(e,t){Q(e,t)}function Q(e,t){let n;try{n=w(t)}catch{n=b(t)}let r=h(e);for(;r.length>1&&r!==x;){let t;try{t=w(r)}catch(e){if(e.code===`ENOENT`){r=h(r);continue}throw e}let i=y(n,t);if(i===``||!i.startsWith(`..`)&&!g(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ze(e,t,n){try{if(oe(n).size>10485760)return!1}catch{return!1}let r;try{r=re(n,`utf-8`)}catch{return!1}let i=[],a=d(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!$(a))return!1;let o=a[e.topLevelKey];if(!$(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return $(s)?$(s[e.serverName(t)]):!1}function Be(e,t,n={}){if(!s.includes(e.id))return!0;try{return ze(e,t,e.configPath(t,n.home))}catch{return!1}}function Ve(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!Be(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=u(`project`,{checkDesktop:!0}),i=h(r);Z(i,t);let a=C(r)?`overwritten`:`written`;return ae(i,{recursive:!0,force:!0}),ne(h(i),{recursive:!0}),ee(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function He(e,t){let n=y(f(t),f(e));return n.length>0&&!n.startsWith(`..`)&&!g(n)}const Ue=e=>{try{let t=p(`git`,[`rev-parse`,`--show-toplevel`],c({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function We(e,t={}){let n=t.homeDir??T(),r=t.gitTopLevel??Ue,i=b(e),a;try{a=w(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(l(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=h(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&He(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}export{ve as C,me as S,H as _,A as a,J as b,be as c,xe as d,z as f,De as g,we as h,Ve as i,I as l,Se as m,Z as n,j as o,Ee as p,Re as r,X as s,We as t,L as u,Oe as v,ge as x,Le as y};
56
- //# sourceMappingURL=resolve-project-root-XrNPFGNY.mjs.map
56
+ //# sourceMappingURL=resolve-project-root-BCdGoKNz.mjs.map
@@ -1,2 +1,2 @@
1
- import"./src-BUfAkcnU.mjs";import{r as e}from"./logger-Dq-cRhcP.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const y=v(),b=1;function x(e){return new URL(e.url??``,`http://localhost`).searchParams}function S(e){let t=e?.code;return typeof t==`string`?t:void 0}const C=/^[A-Za-z0-9-]{8,64}$/;let w=null;function T(e){return n(e??p(),`.ok`,`machine-id`)}function E(n){if(n===void 0&&w!==null)return w;let r=T(n),i=null;try{let e=l(r,`utf-8`).trim();C.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(w=i),i}const D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===E():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==E()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:E(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??2,runtimeVersion:r.runtimeVersion??y},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(S(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){S(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e){return!Array.isArray(e.capabilities)||e.capabilities.includes(`ui`)}function $(e,t){q({lockName:`server`,lockDir:e,...t})}function ee(e){U({lockName:`server`,lockDir:e})}function te(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,E as _,Z as a,y as b,te as c,V as d,k as f,H as g,q as h,ee as i,O as l,G as m,Y as n,$ as o,W as p,Q as r,X as s,J as t,R as u,S as v,b as x,x as y};
2
- //# sourceMappingURL=server-lock-DaOXwt6C.mjs.map
1
+ import"./src-CP2xsmg5.mjs";import{r as e}from"./logger-Dq-cRhcP.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{fileURLToPath as i}from"node:url";import{closeSync as a,existsSync as o,mkdirSync as s,openSync as c,readFileSync as l,unlinkSync as u,writeFileSync as d,writeSync as f}from"node:fs";import{homedir as p,hostname as m}from"node:os";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(){try{let e=r(t(i(import.meta.url)),`..`,`package.json`),n=JSON.parse(l(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const y=v(),b=1;function x(e){return new URL(e.url??``,`http://localhost`).searchParams}function S(e){let t=e?.code;return typeof t==`string`?t:void 0}const C=/^[A-Za-z0-9-]{8,64}$/;let w=null;function T(e){return n(e??p(),`.ok`,`machine-id`)}function E(n){if(n===void 0&&w!==null)return w;let r=T(n),i=null;try{let e=l(r,`utf-8`).trim();C.test(e)&&(i=e)}catch{}if(i===null){i=h();try{s(t(r),{recursive:!0}),d(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(w=i),i}const D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running at ${e.url??`port ${e.port}`} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===E():e.hostname===m()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(l(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==E()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==m())continue;u(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(l(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;s(n,{recursive:!0});let l=k(n,t),p={pid:process.pid,hostname:m(),port:r.port,...r.url!==void 0&&{url:r.url},startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:E(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??2,runtimeVersion:r.runtimeVersion??y},h=JSON.stringify(p,null,2);for(let e=0;e<3;e++){if(!o(l))try{let e=c(l,`wx`,384);try{f(e,h)}finally{a(e)}return j(l),I(l),z({lockName:t,lockDir:n,lockPath:l})}catch(e){if(S(e)!==`EEXIST`)throw e}let e=L(l,i);if(e){if(N(e)&&e.pid===process.pid)return d(l,h,{encoding:`utf-8`,mode:384}),j(l),I(l),z({lockName:t,lockDir:n,lockPath:l});if(g(e.pid))throw new O(e,l,t);D.warn({pid:e.pid,host:e.hostname},`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{u(l)}catch{}}throw Error(`${i} Failed to acquire ${l} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>q({lockName:t,lockDir:n}),updatePort:(e,r)=>H({lockName:t,lockDir:n,port:e,url:r})}}function B(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=t.hostname;return n===`localhost`||n===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)?t.origin:null}function V(e,t){if(typeof e.url==`string`&&e.url.length>0){let t=B(e.url);if(t!==null)return t}if(e.port>0){let n=t?.fallbackHost??`localhost`;return`http://${n===`0.0.0.0`||n===`::`?`localhost`:n.includes(`:`)&&!n.startsWith(`[`)?`[${n}]`:n}:${e.port}`}return null}function H(e){let{lockName:t,lockDir:n,port:r,url:i}=e,a=`[${t}-lock]`,s=k(n,t);if(!o(s)){D.warn({lockPath:s},`${a} Lock file missing at ${s} during port update — skipping`);return}let c;try{let e=JSON.parse(l(s,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:s},`${a} Corrupt lock at ${s} during port update — skipping`);return}c=e}catch{D.warn({lockPath:s},`${a} Unreadable lock at ${s} during port update — skipping`);return}if(c.pid===process.pid&&N(c)){c.port=r,i===void 0?delete c.url:c.url=i;try{d(s,JSON.stringify(c,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:s,err:e},`${a} Failed to update port in ${s}: ${e instanceof Error?e.message:String(e)}`)}}}function U(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(l(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){S(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{d(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function W(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return null;let i;try{let e=JSON.parse(l(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{u(r)}catch{}return null}return i}function G(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!o(r))return{status:`absent`};let i;try{i=JSON.parse(l(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!_(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:a.pid,hostname:a.hostname,port:a.port,url:typeof a.url==`string`?a.url:void 0,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,capabilities:Array.isArray(a.capabilities)&&a.capabilities.every(e=>typeof e==`string`)?a.capabilities:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{u(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function K(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>W({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function q(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k(n,t);if(M(a)){if(r){U({lockName:t,lockDir:n});return}if(o(a))try{let e=JSON.parse(l(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;u(a),P.delete(a)}catch(e){D.warn({lockPath:a,err:e},`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var J=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function Y(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new J(e.existing,e.lockPath):e}}function X(e,t,n){H({lockName:`server`,lockDir:e,port:t,url:n})}function Z(e){return W({lockName:`server`,lockDir:e})}function Q(e){return!Array.isArray(e.capabilities)||e.capabilities.includes(`ui`)}function $(e,t){q({lockName:`server`,lockDir:e,...t})}function ee(e){U({lockName:`server`,lockDir:e})}function te(e,t){return K({lockName:`server`,lockDir:e,...t})}export{_ as C,g as S,E as _,Z as a,y as b,te as c,V as d,k as f,H as g,q as h,ee as i,O as l,G as m,Y as n,$ as o,W as p,Q as r,X as s,J as t,R as u,S as v,b as x,x as y};
2
+ //# sourceMappingURL=server-lock-CBDjdfxH.mjs.map
@@ -0,0 +1 @@
1
+ import{i as e,o as t,s as n}from"./server-lock-CBDjdfxH.mjs";export{e as markServerLockDraining,t as releaseServerLock,n as updateServerLockPort};
@@ -1,2 +1,2 @@
1
- import{Ys as e}from"./src-BUfAkcnU.mjs";import{xi as t,yi as n}from"./src-Dyk9iCzv.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...t.map(e=>n[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of t){let t=n[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let n of e)o.push({path:a(i,n.skillsRoot,t),bundleId:r,scope:`host`,hostDir:n.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
- //# sourceMappingURL=skill-teardown-BEnDXQv2.mjs.map
1
+ import{Ys as e}from"./src-CP2xsmg5.mjs";import{xi as t,yi as n}from"./src-HFlqeGnA.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...t.map(e=>n[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of t){let t=n[r];o.push({path:a(i,`.agents`,`skills`,t),bundleId:r,scope:`central`});for(let n of e)o.push({path:a(i,n.skillsRoot,t),bundleId:r,scope:`host`,hostDir:n.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
2
+ //# sourceMappingURL=skill-teardown-Bxy5NV-V.mjs.map
@@ -0,0 +1 @@
1
+ import"./src-CP2xsmg5.mjs";import"./resolve-project-root-BCdGoKNz.mjs";import"./src-D4A03H49.mjs";import"./acp-harness-probe-C-bmwKC0.mjs";import"./init-DwE-82L_.mjs";import{n as e}from"./loader-Da9QChC_.mjs";import"./skill-teardown-Bxy5NV-V.mjs";import"./preview-BBdR6vmw.mjs";import"./mcp-migrate-event-9DFnNzHa.mjs";export{e as loadConfig};
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,r as n,t as r}from"./chunk-DTipWd-i.mjs";import{A as i,At as a,Dt as o,E as s,Et as c,Ft as l,G as u,Gt as d,Ht as f,It as p,Jt as m,Kt as h,L as g,Lt as _,Mt as v,P as y,Rt as b,T as x,Ut as S,Vt as C,Wt as w,X as T,Z as E,Zt as D,at as O,bt as ee,ct as te,et as ne,jt as re,kt as k,l as ie,lt as ae,mt as oe,nt as A,q as se,rt as ce,tt as le,v as j,x as M,yt as ue,zt as N}from"./sleep-CKSyI4wt.mjs";import{n as de,t as fe}from"./markdownit-BNz2xGu4.mjs";import P from"node:path";import pe from"node:process";import{fileURLToPath as me}from"node:url";import{access as he,accessSync as ge,readFile as F,readFileSync as _e}from"node:fs";import{EOL as ve,homedir as ye}from"node:os";const be=`state/bug-reports`,xe=_({at:S(),transport:S(),outcome:S(),reference:S().optional(),error:S().optional(),errorCode:S().optional()}),Se=_({reason:S(),at:S(),errorCode:S().optional()});_({version:b().int().catch(1),id:S(),createdAt:S(),bundleLevel:S(),zipBytes:b().int().nonnegative().catch(0),zipDeleted:a().optional(),state:S(),systemWide:a().optional(),projectSlug:S().nullable().optional(),reference:S().optional(),lastError:Se.optional(),attempts:k(xe).optional(),note:S().optional()});const Ce=`.sent.yaml`;_({version:b().int().catch(1),id:S().optional(),sentAt:S().optional(),reference:S().optional()});const we=2,Te={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function Ee({kind:e,runtimeVersion:t}){return{[Te.protocol]:`2`,[Te.runtime]:t,[Te.kind]:e}}const De=[{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/"]+\//g,replacement:`~/`}],Oe=De.map(e=>e.name);function ke(e){let t=new Set,n=0;return{redacted:e.split(`
1
+ import{i as e,o as t,r as n,t as r}from"./chunk-DTipWd-i.mjs";import{A as i,At as a,Dt as o,E as s,Et as c,Ft as l,G as u,Gt as d,Ht as f,It as p,Jt as m,Kt as h,L as g,Lt as _,Mt as v,P as y,Rt as b,T as x,Ut as S,Vt as C,Wt as w,X as T,Z as E,Zt as D,at as O,bt as ee,ct as te,et as ne,jt as re,kt as k,l as ie,lt as ae,mt as oe,nt as A,q as se,rt as ce,tt as le,v as j,x as M,yt as ue,zt as N}from"./sleep-CKSyI4wt.mjs";import{n as de,t as fe}from"./markdownit-BNz2xGu4.mjs";import P from"node:path";import pe from"node:process";import{fileURLToPath as me}from"node:url";import{access as he,accessSync as ge,readFile as F,readFileSync as _e}from"node:fs";import{EOL as ve,homedir as ye}from"node:os";const be=`state/bug-reports`,xe=_({at:S(),transport:S(),outcome:S(),reference:S().optional(),error:S().optional(),errorCode:S().optional()}),Se=_({reason:S(),at:S(),errorCode:S().optional()});_({version:b().int().catch(1),id:S(),createdAt:S(),bundleLevel:S(),zipBytes:b().int().nonnegative().catch(0),zipDeleted:a().optional(),state:S(),systemWide:a().optional(),projectSlug:S().nullable().optional(),reference:S().optional(),lastError:Se.optional(),attempts:k(xe).optional(),note:S().optional()});const Ce=`.sent.yaml`;_({version:b().int().catch(1),id:S().optional(),sentAt:S().optional(),reference:S().optional()});const we=2,Te={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function Ee({kind:e,runtimeVersion:t}){return{[Te.protocol]:`2`,[Te.runtime]:t,[Te.kind]:e}}const De=[{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],Oe=De.map(e=>e.name);function ke(e){let t=new Set,n=0;return{redacted:e.split(`
2
2
  `).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of De)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
3
3
  `),patterns:[...t],lineCount:n}}function Ae(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Me(e.position):`start`in e||`end`in e?Me(e):`line`in e||`column`in e?je(e):``}function je(e){return Ne(e&&e.line)+`:`+Ne(e&&e.column)}function Me(e){return je(e&&e.start)+`-`+je(e&&e.end)}function Ne(e){return e&&typeof e==`number`?e:1}var Pe=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ae(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Pe.prototype.file=``,Pe.prototype.name=``,Pe.prototype.reason=``,Pe.prototype.message=``,Pe.prototype.stack=``,Pe.prototype.column=void 0,Pe.prototype.line=void 0,Pe.prototype.ancestors=void 0,Pe.prototype.cause=void 0,Pe.prototype.fatal=void 0,Pe.prototype.place=void 0,Pe.prototype.ruleId=void 0,Pe.prototype.source=void 0;const Fe=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function Ie(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Le(e){let t=Ie(e);return t!==null&&Fe.has(t)}function Re(e){let t=Ie(e);return t===null?null:Fe.get(t)??null}const ze=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Be(e){ze.lastIndex=0;let t=e.match(ze);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Re(e);if(t===null)return null;n+=t}return n}const Ve=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),He=/^={2,}/,Ue=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/;function We(e,t){return Ue.test(e.slice(t,t+512))}function Ge(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>512?!1:Ue.exec(e.slice(n,t+1))?.[0].length===t+1-n}const Ke=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,qe=/^!(?=\[)/,Je=/^\[\^/,Ye=/^\]\[[^\]]*\]/,Xe=/^\[\[[^\][|]*\|/,Ze=/^#[^\][|]*(?=\]\])/,Qe=/^\]\([^)]*\)/,$e=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,et=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,tt=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/;function nt(e,t){let n=e.indexOf(`
4
4
  `,t),r=n===-1?e.length:n;if(r>t&&e[r-1]===`\r`&&--r,r-t>1024)return 0;let i=e.slice(t,r);return i.length===0||!et.test(i)&&!tt.test(i)?0:i.length}const rt=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/y;function it(e,t){if(e[t]!==`&`)return null;let n=t,r=``;for(;;){rt.lastIndex=n;let t=rt.exec(e)?.[0];if(t===void 0)break;let i=Re(t);if(i===null)break;r+=i,n+=t.length}return n===t?null:{length:n-t,rendered:r}}function at(e){return e===` `||e===` `||e===`
@@ -357,4 +357,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
357
357
  `);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=M9(n.join(`
358
358
  `))[j9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
359
359
  `).replace(/\n+$/,``)}}function P9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=Zm(t);if(n===``)return{identity:{},starterContent:t};let i=$m(n),a=Tne(i);if(a)return{identity:a.identity,starterContent:N9(a.docFrontmatterText,r)};let{frontmatter:o}=Zm(r);if(o!==``)return{identity:M9(i),starterContent:r};let s=M9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:N9(i,r)}}function Ene(e,t){let{docFrontmatterText:n,markdown:r}=wne(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,mt.stringify)({[j9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function Dne(e){return P9(e).starterContent}const F9=e=>e*8+4;F9(92),F9(40);const One=/^(#{1,6})\s+(.+)$/;function kne(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(One);if(!n)return null;let r=n[2].trim(),i=sQ(r,t);return i?{level:n[1].length,text:r,slug:i}:null}Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const Ane={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},jne=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Mne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function Nne(e,t=jne){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const Pne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function I9(e){return e?Pne[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const Fne={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function Ine(e){let t=e?.trim();return t?Fne[I9(t)]??t:`Agent`}function L9(e){if(!e.includes(`%`))return e;let t;try{t=decodeURIComponent(e)}catch{return e}return t===`.`||t===`..`||t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?e:t}function R9(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function Lne(e){return e.split(`/`).map(R9).join(`/`)}function z9(e){return e.split(`/`).map(L9).join(`/`)}function B9(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=L9(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!vn.includes(e))return null}let c=o.startsWith(`/`),l=c?o.slice(1):o,u=c?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[],d=l.split(`/`),f=d.length-1;for(let e=0;e<d.length;e++){let t=L9(d[e]??``);if(e===f&&(t=nn(t)),t===`..`){if(u.length===0)return null;u.pop()}else t!==`.`&&t!==``&&u.push(t)}return u.length===0?null:{docName:u.join(`/`),anchor:a||null}}function Rne(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}const V9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function H9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function U9(e){let t=e.trim();return V9.test(t)||t.startsWith(`//`)}function zne(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(U9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=z9(r<0?n:n.slice(0,r)),a=cn(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=sn(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=B9(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=H9(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function W9(e,t){let n=e.trim();if(!n)return null;if(U9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=H9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Bne(e,t,n){let r=e.trim();if(!r||V9.test(r)||r.startsWith(`//`)||r.startsWith(`#`))return null;let i=r.indexOf(`#`),a=((i>=0?r.slice(0,i):r).split(`?`)[0]??``).trim();if(!a)return null;let o=a.startsWith(`/`),s=o?a.slice(1):a,c=o?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(n.literal?e:L9(e));return c.length===0?null:c.join(`/`)}function G9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function K9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function q9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function J9(e){return e.split(`/`).filter(e=>e!==``)}function Vne(e,t){let n=q9(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function Y9(e,t){let n=q9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:J9(r).length}function X9(e,t){let n=J9(e),r=J9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function Hne(){let e=new Map;function t(t){let n=G9(t);if(n===``)return;let r=K9(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=G9(t),r=K9(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=q9(G9(n)),o=[],s=[];for(let e of i)Vne(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=Y9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=Y9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=X9(a,q9(t));for(let r=1;r<e.length;r++){let i=e[r],o=X9(a,q9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function Une(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function Wne(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function Z9(e){return`pagesBySlug`in e}function Gne(e){return Z9(e)?e.pages:e}function Kne(e,t){return Z9(e)?e.assetPaths??new Set:t??new Set}function qne(e,t){return Z9(e)?e.filePaths??new Set:t??new Set}function Q9(e,t){return e<t?-1:+(e>t)}function Jne(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function Yne(e,t){let n=new Map,r=[...e].sort(Q9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function Xne(e,t){let n=aQ(e);if(n){if(Z9(t))return t.pagesBySlug.get(n);for(let e of t)if(aQ(e)===n)return e}}function Zne(e,t){if(e.includes(`/`))return;let n=aQ(e);if(!n)return;if(Z9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);aQ(t===-1?e:e.slice(t+1))===n&&(r===void 0||Q9(e,r)<0)&&(r=e)}return r}function Qne(e){let t=e.trim();if(!t)return[];let n=aQ(t);return n.length>0&&n!==t?[n]:[]}function $9(e,t){let n=e.trim();if(!n)return;let r=Gne(t);if(r.has(n))return n;let i=Xne(n,t);if(i)return i;for(let e of Qne(n))if(r.has(e))return e;return $ne(n,r)||Zne(n,t)}function $ne(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function ere(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function tre(e,t,n){let r=ere(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(Q9)[0]??null}function nre(e,t,n){let r=W9(e,t);return r===null||r.kind!==`asset`||tre(r.url,Kne(n),qne(n))!==null||$9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{o9 as $,rZ as $a,$Q as $i,j0 as $n,$b as $o,r1 as $r,vn as $s,i4 as $t,Cne as A,uZ as Aa,Et as Ac,C$ as Ai,d2 as An,gx as Ao,q1 as Ar,Un as As,l3 as At,ene as B,aZ as Ba,we as Bc,f$ as Bi,N2 as Bn,ix as Bo,N1 as Br,Cn as Bs,D4 as Bt,j9 as C,LZ as Ca,zt as Cc,E$ as Ci,O2 as Cn,dz as Co,r0 as Cr,fr as Cs,C3 as Ct,Sne as D,EZ as Da,At as Dc,D$ as Di,u2 as Dn,Ew as Do,t0 as Dr,Zn as Ds,m3 as Dt,P9 as E,wZ as Ea,Mt as Ec,O$ as Ei,D2 as En,hP as Eo,c0 as Er,Xn as Es,_3 as Et,lne as F,SZ as Fa,pt as Fc,p$ as Fi,H2 as Fn,hx as Fo,J1 as Fr,Rn as Fs,H4 as Ft,D9 as G,QX as Ga,a$ as Gi,j2 as Gn,Rb as Go,k1 as Gr,jn as Gs,m4 as Gt,$te as H,FX as Ha,be as Hc,s$ as Hi,V2 as Hn,Ab as Ho,T1 as Hr,Mn as Hs,S4 as Ht,mne as I,CZ as Ia,Oe as Ic,m$ as Ii,U2 as In,mx as Io,C1 as Ir,In as Is,V4 as It,Xte as J,PX as Ja,GQ as Ji,$2 as Jn,Hb as Jo,M1 as Jr,kn as Js,u4 as Jt,Yte as K,$X as Ka,n$ as Ki,M2 as Kn,Lb as Ko,D1 as Kr,An as Ks,f4 as Kt,une as L,lZ as La,ke as Lc,h$ as Li,s2 as Ln,fx as Lo,w1 as Lr,xn as Ls,z4 as Lt,_ne as M,_Z as Ma,ft as Mc,_$ as Mi,i2 as Mn,px as Mo,W1 as Mr,Bn as Ms,Y4 as Mt,vne as N,sZ as Na,eee as Nc,g$ as Ni,a2 as Nn,cx as No,G1 as Nr,Vn as Ns,J4 as Nt,A9 as O,FZ as Oa,jt as Oc,A$ as Oi,f2 as On,yx as Oo,i0 as Or,Yn as Os,i3 as Ot,cne as P,gZ as Pa,ct as Pc,b$ as Pi,o2 as Pn,_x as Po,K1 as Pr,Ln as Ps,U4 as Pt,Fte as Q,qX as Qa,XQ as Qi,Y0 as Qn,Gb as Qo,I1 as Qr,yn as Qs,o4 as Qt,one as R,xZ as Ra,Te as Rc,l$ as Ri,c2 as Rn,tx as Ro,x1 as Rr,Sn as Rs,B4 as Rt,kne as S,VZ as Sa,Vt as Sc,T$ as Si,r4 as Sn,Sz as So,o0 as Sr,sr as Ss,j3 as St,Dne as T,AZ as Ta,Ht as Tc,M$ as Ti,A2 as Tn,wF as To,s0 as Tr,Qn as Ts,g3 as Tt,Gte as U,ZX as Ua,d$ as Ui,e2 as Un,Nb as Uo,E1 as Ur,Tn as Us,d4 as Ut,Qte as V,GX as Va,Ce as Vc,o$ as Vi,z2 as Vn,jb as Vo,P1 as Vr,wn as Vs,_4 as Vt,Kte as W,IX as Wa,r$ as Wi,t2 as Wn,Mb as Wo,b1 as Wr,On as Ws,h4 as Wt,Rte as X,NX as Xa,UQ as Xi,e4 as Xn,ox as Xo,R1 as Xr,Dn as Xs,c4 as Xt,h9 as Y,XX as Ya,qQ as Yi,n2 as Yn,ax as Yo,L1 as Yr,Nn as Ys,a4 as Yt,g9 as Z,YX as Za,HQ as Zi,t4 as Zn,Qb as Zo,F1 as Zr,bn as Zs,s4 as Zt,Mne as _,ZZ as _a,an as _c,L$ as _i,x2 as _n,rU as _o,p0 as _r,or as _s,i6 as _t,Une as a,IQ as aa,Kt as ac,l1 as ai,W2 as an,UY as ao,U0 as ar,gb as as,S6 as at,Ine as b,JZ as ba,_n as bc,P$ as bi,Z0 as bn,kz as bo,u0 as br,dr as bs,J3 as bt,Rne as c,EQ as ca,Zt as cc,c1 as ci,l2 as cn,hG as co,z0 as cr,sb as cs,p6 as ct,U9 as d,wQ as da,en as dc,a1 as di,g2 as dn,kG as do,O0 as dr,$m as ds,c6 as dt,jQ as ea,tee as ec,i1 as ei,M0 as en,iZ as eo,k0 as er,Ub as es,gte as et,Bne as f,CQ as fa,$t as fc,$$ as fi,_2 as fn,xG as fo,C0 as fr,sp as fs,f6 as ft,B9 as g,XZ as ga,un as gc,I$ as gi,b2 as gn,vW as go,f0 as gr,er as gs,Q3 as gt,R9 as h,QZ as ha,gn as hc,G$ as hi,y2 as hn,$W as ho,d0 as hr,pr as hs,a6 as ht,$9 as i,RQ as ia,qt as ic,u1 as ii,K0 as in,wX as io,V0 as ir,_b as is,x6 as it,k9 as j,dZ as ja,Ot as jc,y$ as ji,r2 as jn,lx as jo,U1 as jr,Wn as js,Q4 as jt,xne as k,IZ as ka,ht as kc,x$ as ki,p2 as kn,ux as ko,a0 as kr,Hn as ks,d3 as kt,zne as l,pQ as la,Qt as lc,o1 as li,m2 as ln,_G as lo,L0 as lr,Qm as ls,u6 as lt,Lne as m,$Z as ma,fn as mc,H$ as mi,C2 as mn,pG as mo,b0 as mr,I as ms,s6 as mt,Jne as n,LQ as na,Jt as nc,m1 as ni,P0 as nn,jX as no,I0 as nr,Sb as ns,bte as nt,Wne as o,FQ as oa,rn as oc,h1 as oi,J2 as on,NY as oo,W0 as or,mb as os,C6 as ot,z9 as p,aQ as pa,tn as pc,X$ as pi,w2 as pn,fG as po,v0 as pr,to as ps,d6 as pt,Zte as q,nZ as qa,KQ as qi,Q2 as qn,Bb as qo,j1 as qr,Fn as qs,p4 as qt,nre as r,zQ as ra,Gt as rc,f1 as ri,k2 as rn,SX as ro,B0 as rr,yb as rs,v6 as rt,Hne as s,TQ as sa,Xt as sc,_1 as si,q2 as sn,MY as so,R0 as sr,db as ss,_6 as st,Yne as t,BQ as ta,Yt as tc,g1 as ti,N0 as tn,OX as to,H0 as tr,Cb as ts,Nte as tt,W9 as u,SQ as ua,Wt as uc,s1 as ui,h2 as un,gG as uo,J0 as ur,Zm as us,l6 as ut,Ane as v,YZ as va,cn as vc,B$ as vi,S2 as vn,GH as vo,m0 as vr,tr as vs,X3 as vt,Ene as w,DZ as wa,Bt as wc,j$ as wi,X2 as wn,ez as wo,n0 as wr,$n as ws,T3 as wt,I9 as x,WZ as xa,Ut as xc,w$ as xi,Z2 as xn,Oz as xo,l0 as xr,nr as xs,D3 as xt,Nne as y,qZ as ya,pn as yc,N$ as yi,R2 as yn,WH as yo,_0 as yr,ar as ys,Z3 as yt,sne as z,yZ as za,Ee as zc,u$ as zi,G0 as zn,nx as zo,S1 as zr,Pn as zs,O4 as zt};
360
- //# sourceMappingURL=src-BUfAkcnU.mjs.map
360
+ //# sourceMappingURL=src-CP2xsmg5.mjs.map
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{$ as t,Q as n,n as r,r as i,yt as a}from"./sleep-CKSyI4wt.mjs";import{Hc as o,Ic as s,Lc as c,Oo as l,Vc as u}from"./src-BUfAkcnU.mjs";import{Bi as d,Fr as f,ct as p,h as m,lt as h,pi as g,st as _,ut as v}from"./src-Dyk9iCzv.mjs";import{A as y,I as b,L as x,O as S}from"./fs-traced-DcgvOGgW.mjs";import{C,S as w,_ as T,d as E,f as D,r as O}from"./server-lock-DaOXwt6C.mjs";import{t as k}from"./yazl-DejPO9b3.mjs";import{h as ee,m as A,x as j}from"./resolve-project-root-XrNPFGNY.mjs";import{c as te}from"./colors-DSyAT9Cz.mjs";import{a as ne,i as M}from"./acp-harness-probe-Bk3Dz297.mjs";import{D as re,E as N,S as ie,T as P,_ as ae,b as oe,o as se}from"./init-DNQN84w4.mjs";import{n as ce}from"./constants-DXEhJ197.mjs";import{t as le}from"./is-object-Bw0-z8qH.mjs";import"./loader-DOE8T0bD.mjs";import"./skill-teardown-BEnDXQv2.mjs";import"./preview-Doha4cmP.mjs";import{execSync as ue,spawnSync as de}from"node:child_process";import{basename as F,dirname as I,join as L,relative as fe,resolve as R,sep as pe}from"node:path";import{cpSync as me,createWriteStream as he,existsSync as z,lstatSync as ge,mkdirSync as B,mkdtempSync as _e,readFileSync as V,readdirSync as H,readlinkSync as ve,rmSync as ye,statSync as be,writeFileSync as U}from"node:fs";import{arch as xe,freemem as Se,homedir as W,hostname as Ce,platform as we,release as Te,tmpdir as Ee,totalmem as De,type as Oe,uptime as ke}from"node:os";import"node:fs/promises";import{createHash as Ae}from"node:crypto";var je=a();let Me;function Ne(){return Me}function Pe(e,t){if(t!==void 0&&t.length>0)return t;try{return f(e)?.rootPath}catch{return}}function Fe(e){let t=Pe(e.cwd,e.configuredProjectName),n=m({name:`cli`,project:t});return Me=n,n.info({command:e.command,cwd:e.cwd,project:t},`cli command started`),n}const Ie=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Le(e,t,n=f){if(e!==void 0&&!Ie.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Re=null;function ze(e){Re=e}function Be(){return Re??process.cwd()}function G(){return L(W(),`.ok`,`bug-reports`)}function Ve(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=G(),r=`${t}-bugreport`,i=L(n,`${r}.zip`);for(let e=2;z(i);e+=1)i=L(n,`${r}-${e}.zip`);return i}function He(e,t){let n=L(e,`.ok`,`config.yml`);if(z(n))try{let e=V(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return z(L(e,`.ok`))?Ae(`sha256`).update(R(e)).digest(`hex`).slice(0,12):null}function Ue(){let e={timestamp:new Date().toISOString(),platform:we(),osType:Oe(),osRelease:Te(),hostname:`[redacted]`,uptime:ke(),freeMem:Se(),totalMem:De(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ue(`sw_vers -productVersion 2>/dev/null`,d({encoding:`utf8`})).trim()}catch{}try{let t=L(__dirname,`..`,`..`,`package.json`);z(t)&&(e.okVersion=JSON.parse(V(t,`utf8`)).version)}catch{}return e}const We=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Ge(e){let t=F(e);return We.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Ke(e,t){return Xe(e,t).files}const qe=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Je(e,t=ne){let n=L(e,`${t}.ShipIt`);if(!z(n))return[];let r;try{r=H(n)}catch{return[]}return qe.flatMap(e=>r.map(t=>{if(t===e)return{entry:t,suffix:-1};if(!t.startsWith(`${e}.`))return null;let n=t.slice(e.length+1);return/^\d+$/.test(n)?{entry:t,suffix:Number(n)}:null}).filter(e=>e!==null).sort((e,t)=>e.suffix-t.suffix).slice(0,4).map(e=>L(n,e.entry)))}function Ye(e){if(!z(e))return[];try{let t=new Map;for(let n of H(e).filter(e=>e.endsWith(`.yaml`)).sort()){let e=n.endsWith(`.sent.yaml`)?n.slice(0,-u.length):n.slice(0,-5),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t.values()].slice(-25).flat().map(t=>L(e,t))}catch{return[]}}function Xe(e,t){if(!z(t))return{files:[],excludedByProjectSlug:0};let n=H(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>L(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Ge),i=[],a=r.filter(t=>{try{return V(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!Ge(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ze(e){let t=L(e,`.ok`,`local`);return z(t)?{files:[`server.lock`,`last-spawn-error.log`,r].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function Qe(e){let t=L(e,`.ok`,`local`,`logs`);return z(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function $e(e){let t=0,n=new Map,r=e.replace(/("(?:docName|doc\.name|documentName)"\s*:\s*")((?:[^"\\]|\\.)*)"/g,(e,r,i)=>{t+=1;let a=n.get(i);return a===void 0&&(a=`doc#${Ae(`sha256`).update(i).digest(`hex`).slice(0,12)}`,n.set(i,a)),`${r}${a}"`});for(let[e,i]of[...n].sort(([e],[t])=>t.length-e.length)){if(e.length===0||!r.includes(e))continue;let n=r.split(e);t+=n.length-1,r=n.join(i)}return{text:r,count:t}}function et(e){let t=e.revealDocNames?e.content:$e(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=c(t);e.zipfile.addBuffer(Buffer.from(n,`utf8`),e.name),e.bundleFiles.push(e.name),r.length>0&&e.redactions.push({file:e.name,lineCount:i,patterns:r})}else e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name)}function K(e){for(let t of e.files)try{et({zipfile:e.zipfile,name:`${e.prefix}/${F(t)}`,content:V(t,`utf8`),redact:e.redact,revealDocNames:e.revealDocNames,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function tt(t){let{redact:n,outputPath:r,logger:i}=t,a=t.revealDocNames??!1,c=t.userLogsDir??L(W(),`.ok`,`logs`),l=t.projectDir?He(t.projectDir,i):null;B(I(r),{recursive:!0}),i?.info({projectSlug:l},`gathering diagnostic data`);let u=Ue();u.desktop=t.desktop??null,u.language=t.language??null;let{files:d,excludedByProjectSlug:f}=Xe(l,c),{files:p}=t.projectDir?Ze(t.projectDir):{files:[]},{files:m}=t.projectDir?Qe(t.projectDir):{files:[]},h=t.shipItLogFiles??[];i?.info({logFileCount:d.length,logFilesExcludedByProjectSlug:f,lockFileCount:p.length,localSinkFileCount:m.length,shipItLogFileCount:h.length},`files collected`);let g=[],_=[],{ZipFile:v}=await import(`./yazl-BwMlCqRQ.mjs`).then(t=>e(t.default,1)),y=new v;K({zipfile:y,files:[...d,...h],prefix:`logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:p,prefix:`lockdir`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:m,prefix:`local-logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:t.bugReportLedgerFiles??[],prefix:o,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i});for(let e of t.extraFiles??[])try{let t=V(e.sourcePath),n=`extra/${e.zipName??F(e.sourcePath)}`;y.addBuffer(t,n),_.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&et({zipfile:y,name:`note.txt`,content:t.note,redact:n,revealDocNames:a,bundleFiles:_,redactions:g});let b=JSON.stringify(u,null,2);y.addBuffer(Buffer.from(b,`utf8`),`sysinfo.json`),_.push(`sysinfo.json`);let x={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:l,files:_,redactions:g,sysinfo:u};y.addBuffer(Buffer.from(JSON.stringify(x,null,2),`utf8`),`MANIFEST.json`);let S=g.reduce((e,t)=>e+t.lineCount,0),C=new Set(h.map(e=>`logs/${F(e)}`)),w=_.filter(e=>C.has(e)),T=new Set((t.bugReportLedgerFiles??[]).map(e=>`${o}/${F(e)}`)),E=_.filter(e=>T.has(e)),D=l?_.filter(e=>e.startsWith(`logs/`)&&!Ge(e)&&!C.has(e)):[],O=[`# Bug Report Bundle`,``,`Generated: ${x.generatedAt}`,`Project: ${l??`(unscoped)`}`,`Discipline version: ${x.disciplineVersion}`,``,`## Contents`,``,..._.map(e=>`- ${e}`),``,`## Privacy`,``,...D.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...D.map(e=>`- ${e}`),``]:[],...w.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...w.map(e=>`- ${e}`),``]:[],...E.length>0?[`Send history: a small record for each bug report previously generated`,`on this machine — when it was generated, whether sending it`,`succeeded, and why it failed if it did. This is what makes a failed`,`send diagnosable at all. It is machine-wide rather than scoped to`,`this project, so it names the other projects reports were filed`,`from. It carries no document content:`,...E.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${s.join(`, `)}`,S>0?`${S} line(s) were scrubbed across ${g.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
1
+ import{o as e}from"./chunk-DTipWd-i.mjs";import{$ as t,Q as n,n as r,r as i,yt as a}from"./sleep-CKSyI4wt.mjs";import{Hc as o,Ic as s,Lc as c,Oo as l,Vc as u}from"./src-CP2xsmg5.mjs";import{Bi as d,Fr as f,ct as p,h as m,lt as h,pi as g,st as _,ut as v}from"./src-HFlqeGnA.mjs";import{A as y,I as b,L as x,O as S}from"./fs-traced-DcgvOGgW.mjs";import{C,S as w,_ as T,d as E,f as D,r as O}from"./server-lock-CBDjdfxH.mjs";import{t as k}from"./yazl-DejPO9b3.mjs";import{h as ee,m as A,x as j}from"./resolve-project-root-BCdGoKNz.mjs";import{c as te}from"./colors-DSyAT9Cz.mjs";import{a as ne,i as M}from"./acp-harness-probe-C-bmwKC0.mjs";import{D as re,E as N,S as ie,T as P,_ as ae,b as oe,o as se}from"./init-DwE-82L_.mjs";import{n as ce}from"./constants-m3Xu5_Pm.mjs";import{t as le}from"./is-object-Bw0-z8qH.mjs";import"./loader-Da9QChC_.mjs";import"./skill-teardown-Bxy5NV-V.mjs";import"./preview-BBdR6vmw.mjs";import{execSync as ue,spawnSync as de}from"node:child_process";import{basename as F,dirname as I,join as L,relative as fe,resolve as R,sep as pe}from"node:path";import{cpSync as me,createWriteStream as he,existsSync as z,lstatSync as ge,mkdirSync as B,mkdtempSync as _e,readFileSync as V,readdirSync as H,readlinkSync as ve,rmSync as ye,statSync as be,writeFileSync as U}from"node:fs";import{arch as xe,freemem as Se,homedir as W,hostname as Ce,platform as we,release as Te,tmpdir as Ee,totalmem as De,type as Oe,uptime as ke}from"node:os";import"node:fs/promises";import{createHash as Ae}from"node:crypto";var je=a();let Me;function Ne(){return Me}function Pe(e,t){if(t!==void 0&&t.length>0)return t;try{return f(e)?.rootPath}catch{return}}function Fe(e){let t=Pe(e.cwd,e.configuredProjectName),n=m({name:`cli`,project:t});return Me=n,n.info({command:e.command,cwd:e.cwd,project:t},`cli command started`),n}const Ie=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Le(e,t,n=f){if(e!==void 0&&!Ie.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Re=null;function ze(e){Re=e}function Be(){return Re??process.cwd()}function G(){return L(W(),`.ok`,`bug-reports`)}function Ve(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=G(),r=`${t}-bugreport`,i=L(n,`${r}.zip`);for(let e=2;z(i);e+=1)i=L(n,`${r}-${e}.zip`);return i}function He(e,t){let n=L(e,`.ok`,`config.yml`);if(z(n))try{let e=V(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return z(L(e,`.ok`))?Ae(`sha256`).update(R(e)).digest(`hex`).slice(0,12):null}function Ue(){let e={timestamp:new Date().toISOString(),platform:we(),osType:Oe(),osRelease:Te(),hostname:`[redacted]`,uptime:ke(),freeMem:Se(),totalMem:De(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ue(`sw_vers -productVersion 2>/dev/null`,d({encoding:`utf8`})).trim()}catch{}try{let t=L(__dirname,`..`,`..`,`package.json`);z(t)&&(e.okVersion=JSON.parse(V(t,`utf8`)).version)}catch{}return e}const We=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Ge(e){let t=F(e);return We.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Ke(e,t){return Xe(e,t).files}const qe=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Je(e,t=ne){let n=L(e,`${t}.ShipIt`);if(!z(n))return[];let r;try{r=H(n)}catch{return[]}return qe.flatMap(e=>r.map(t=>{if(t===e)return{entry:t,suffix:-1};if(!t.startsWith(`${e}.`))return null;let n=t.slice(e.length+1);return/^\d+$/.test(n)?{entry:t,suffix:Number(n)}:null}).filter(e=>e!==null).sort((e,t)=>e.suffix-t.suffix).slice(0,4).map(e=>L(n,e.entry)))}function Ye(e){if(!z(e))return[];try{let t=new Map;for(let n of H(e).filter(e=>e.endsWith(`.yaml`)).sort()){let e=n.endsWith(`.sent.yaml`)?n.slice(0,-u.length):n.slice(0,-5),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t.values()].slice(-25).flat().map(t=>L(e,t))}catch{return[]}}function Xe(e,t){if(!z(t))return{files:[],excludedByProjectSlug:0};let n=H(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>L(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Ge),i=[],a=r.filter(t=>{try{return V(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!Ge(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ze(e){let t=L(e,`.ok`,`local`);return z(t)?{files:[`server.lock`,`last-spawn-error.log`,r].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function Qe(e){let t=L(e,`.ok`,`local`,`logs`);return z(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function $e(e){let t=0,n=new Map,r=e.replace(/("(?:docName|doc\.name|documentName)"\s*:\s*")((?:[^"\\]|\\.)*)"/g,(e,r,i)=>{t+=1;let a=n.get(i);return a===void 0&&(a=`doc#${Ae(`sha256`).update(i).digest(`hex`).slice(0,12)}`,n.set(i,a)),`${r}${a}"`});for(let[e,i]of[...n].sort(([e],[t])=>t.length-e.length)){if(e.length===0||!r.includes(e))continue;let n=r.split(e);t+=n.length-1,r=n.join(i)}return{text:r,count:t}}function et(e){let t=e.revealDocNames?e.content:$e(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=c(t);e.zipfile.addBuffer(Buffer.from(n,`utf8`),e.name),e.bundleFiles.push(e.name),r.length>0&&e.redactions.push({file:e.name,lineCount:i,patterns:r})}else e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name)}function K(e){for(let t of e.files)try{et({zipfile:e.zipfile,name:`${e.prefix}/${F(t)}`,content:V(t,`utf8`),redact:e.redact,revealDocNames:e.revealDocNames,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function tt(t){let{redact:n,outputPath:r,logger:i}=t,a=t.revealDocNames??!1,c=t.userLogsDir??L(W(),`.ok`,`logs`),l=t.projectDir?He(t.projectDir,i):null;B(I(r),{recursive:!0}),i?.info({projectSlug:l},`gathering diagnostic data`);let u=Ue();u.desktop=t.desktop??null,u.language=t.language??null;let{files:d,excludedByProjectSlug:f}=Xe(l,c),{files:p}=t.projectDir?Ze(t.projectDir):{files:[]},{files:m}=t.projectDir?Qe(t.projectDir):{files:[]},h=t.shipItLogFiles??[];i?.info({logFileCount:d.length,logFilesExcludedByProjectSlug:f,lockFileCount:p.length,localSinkFileCount:m.length,shipItLogFileCount:h.length},`files collected`);let g=[],_=[],{ZipFile:v}=await import(`./yazl-BwMlCqRQ.mjs`).then(t=>e(t.default,1)),y=new v;K({zipfile:y,files:[...d,...h],prefix:`logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:p,prefix:`lockdir`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:m,prefix:`local-logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:t.bugReportLedgerFiles??[],prefix:o,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i});for(let e of t.extraFiles??[])try{let t=V(e.sourcePath),n=`extra/${e.zipName??F(e.sourcePath)}`;y.addBuffer(t,n),_.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&et({zipfile:y,name:`note.txt`,content:t.note,redact:n,revealDocNames:a,bundleFiles:_,redactions:g});let b=JSON.stringify(u,null,2);y.addBuffer(Buffer.from(b,`utf8`),`sysinfo.json`),_.push(`sysinfo.json`);let x={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:l,files:_,redactions:g,sysinfo:u};y.addBuffer(Buffer.from(JSON.stringify(x,null,2),`utf8`),`MANIFEST.json`);let S=g.reduce((e,t)=>e+t.lineCount,0),C=new Set(h.map(e=>`logs/${F(e)}`)),w=_.filter(e=>C.has(e)),T=new Set((t.bugReportLedgerFiles??[]).map(e=>`${o}/${F(e)}`)),E=_.filter(e=>T.has(e)),D=l?_.filter(e=>e.startsWith(`logs/`)&&!Ge(e)&&!C.has(e)):[],O=[`# Bug Report Bundle`,``,`Generated: ${x.generatedAt}`,`Project: ${l??`(unscoped)`}`,`Discipline version: ${x.disciplineVersion}`,``,`## Contents`,``,..._.map(e=>`- ${e}`),``,`## Privacy`,``,...D.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...D.map(e=>`- ${e}`),``]:[],...w.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...w.map(e=>`- ${e}`),``]:[],...E.length>0?[`Send history: a small record for each bug report previously generated`,`on this machine — when it was generated, whether sending it`,`succeeded, and why it failed if it did. This is what makes a failed`,`send diagnosable at all. It is machine-wide rather than scoped to`,`this project, so it names the other projects reports were filed`,`from. It carries no document content:`,...E.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${s.join(`, `)}`,S>0?`${S} line(s) were scrubbed across ${g.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
2
2
  `);y.addBuffer(Buffer.from(O,`utf8`),`README.md`),y.end();let k=he(r);return y.outputStream.pipe(k),await new Promise((e,t)=>{k.on(`close`,e),k.on(`error`,t)}),i?.info({bundlePath:r,fileCount:_.length,redactionCount:S},`bundle written`),{zipPath:r,summary:{projectSlug:l,files:_,redactions:g,redactedLineCount:S,generatedAt:x.generatedAt}}}var nt=e(k(),1),q=e(te(),1);function rt(e){return x({absPath:y(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function it({home:e=W(),env:r=process.env}={}){let i=rt(e),{override:a,preferenceList:o}=S(r),{locale:s,source:c}=l({override:a,storedPreference:i,supportedLocales:t,preferenceList:o,autoDetectableLocales:n});return{preference:i,locale:s,source:c,systemLanguages:o}}function at(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function ot(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J(e,t){if(typeof e==`string`)return at(e,t.contentDir);if(Array.isArray(e))return e.map(e=>J(e,t));if(!ot(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=J(i,t);return n}function st(e,t){let n=V(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
3
3
  `),i=n.split(`
4
4
  `),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=J(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}U(e,r?`${a.join(`
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{$ as t,Q as n,n as r,r as i,yt a
17
17
  `).replace(/\n/g,`\r
18
18
  `));let u=`${i?``:``}${l}`;return u!==r&&b(e,u,{mode:P(e)}),{kind:`removed`}}function xn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function Sn(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Cn(e,t,n,r){if(t.status===`missing`||t.status===`corrupt`)return null;let i=t.lock,a=t.status===`alive`&&O(i)?{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r}:null;return{directory:i.worktreeRoot,server:{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r},ui:a,hostname:i.hostname,lockPath:t.lockPath,binary:n==null?null:p(n),command:n,isDesktop:xn(n)}}function $(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:`stale`}const wn=new Set([`running`,`desktop`,`foreign`]);function Tn(e){switch(e){case`running`:return q.default.green(e);case`desktop`:return q.default.blue(e);case`foreign`:return q.default.cyan(e);case`stale`:return q.default.yellow(e)}}function En(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function Dn(e){return`${En(e.server.usage)} | ${En(e.ui?.usage??null)}`}function On(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null?`—`:String(e.ui.port)}`}function kn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>[e.directory,On(e),Dn(e),$(e),String(e.server.pid),Sn(e.server.startedAt),e.binary??`—`]),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=Tn($(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=q.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
19
19
  `)}async function An(e={}){let t=e.discover??_,n=e.inspect??(e=>Q(e,`server`)),r=e.log??(e=>console.log(e)),i=e.resolveCommand??h,a=e.resolveUsage??v,o=await t(),s=[];for(let e of o){let t=n(e),r=Cn(e,t,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid));r!=null&&s.push(r)}if(e.json){let e=s.map(e=>({...e,displayStatus:$(e)}));r(JSON.stringify(e,null,2));return}r(kn(e.all?s:s.filter(e=>wn.has($(e)))))}function jn(){return new j(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await An({all:t.all===!0||e===`all`,json:t.json===!0})})}async function Mn(e,t=Ne()){let n=Q(e,`server`);if(n.status!==`alive`&&n.status!==`foreign-host`)return null;let r=E(n.lock);if(r===null)return null;try{let n=await fetch(`${r}/api/server-info`,{signal:AbortSignal.timeout(1500)});if(!n.ok)return t?.warn({lockDir:e,baseUrl:r,outcome:`http-error`,status:n.status},`stop client-probe failed`),null;let i=(await n.json())?.collabClients;return typeof i==`number`&&Number.isFinite(i)?i:(t?.warn({lockDir:e,baseUrl:r,outcome:`no-client-count`,received:typeof i},`stop client-probe failed`),null)}catch(n){return t?.warn({lockDir:e,baseUrl:r,outcome:`unreachable`,err:n},`stop client-probe failed`),null}}function Nn(e,t={}){return{targets:Fn(e,t.isAlive??w)?[{name:`server`,pid:e.lock.pid,port:e.lock.port}]:[]}}async function Pn(e){let t=e.inspect??(()=>Q(e.lockDir,`server`)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=e.probeClients??Mn,o=e.logger??Ne(),s=Nn(t(),{isAlive:e.isAlive});if(s.targets.length===0)return r(`No running open-knowledge processes.`),o?.info({lockDir:e.lockDir,targets:0},`stop found nothing to signal`),{stopped:[],failed:[],hadTargets:!1};if(e.force!==!0){let t=await a(e.lockDir,o);if(t!==null&&t>0)return i(`Not stopping: ${t} collaboration client${t===1?``:`s`} (editor window${t===1?``:`s`} or agents) still connected to the server at ${e.lockDir}. Close them, or re-run with --force to terminate anyway.`),o?.warn({lockDir:e.lockDir,clients:t,pids:s.targets.map(e=>e.pid)},`stop declined: live collaboration clients`),{stopped:[],failed:[],hadTargets:!0,declined:{clients:t}}}let c=[],l=[];for(let e of s.targets)try{n(e.pid,`SIGTERM`),c.push(e)}catch(t){l.push({target:e,error:t instanceof Error?t.message:String(t)})}return c.length>0&&r(`Stopped: ${c.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),o?.info({lockDir:e.lockDir,signalled:c.map(e=>({name:e.name,pid:e.pid,port:e.port})),failed:l.map(({target:e,error:t})=>({pid:e.pid,error:t})),forced:e.force===!0},`stop signalled processes`),l.length>0&&i(`Failed to stop: ${l.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:c,failed:l,hadTargets:!0}}function Fn(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function In(e,t=w){let n=await _(),r=null;for(let i of n){let n=Q(i,`server`);if(Fn(n,t)){if(n.lock.port===e)return i;r===null&&n.lock.pid===e&&(r=i)}}return r}async function Ln(e,t){let n=await Pn({lockDir:e,force:t});return(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1),n}function Rn(e,t,n={}){return t===0?`Nothing was running for ${e}, and no other open-knowledge servers are running.`:`Nothing was running for ${e}. ${t} other open-knowledge server${t===1?` is`:`s are`} running${n.listingFollows===!0?``:" — run `ok ps` to list them"}.`}async function zn(e){let t=await _(),n=0;for(let r of t)r!==e&&Fn(Q(r,`server`),w)&&n++;return n}function Bn(e){return new j(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).option(`--force`,`Stop even when editor windows or agents are still connected to the server`).action(async(t,n)=>{let r=n.force===!0,i=t.length===0?void 0:t.join(` `);if(i===void 0){e();let t=g(process.cwd()),n=await Pn({lockDir:t,force:r,log:()=>{}});if(n.hadTargets){if(n.stopped.length>0){let e=n.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1)}else{let e=await zn(t);console.log(Rn(process.cwd(),e,{listingFollows:e>0})),e>0&&await An({})}return}if(i===`all`){let e=await _();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e)Fn(Q(n,`server`),w)&&(await Ln(n,r),t++);t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(i)){let e=Number.parseInt(i,10),t=await In(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}await Ln(t,r);return}let a=R(Be(),i),o=g(a),s=[],c=await Pn({lockDir:o,force:r,log:e=>s.push(e)});if((c.failed.length>0||c.declined!==void 0)&&(process.exitCode=1),c.hadTargets)for(let e of s)console.log(e);else console.log(Rn(a,await zn(o)))})}export{Fe as S,G as _,_n as a,Le as b,un as c,cn as d,Q as f,Ve as g,nn as h,jn as i,fn as l,tn as m,Pn as n,ln as o,on as p,Bn as r,mn as s,Mn as t,pn as u,Be as v,Ne as x,ze as y};
20
- //# sourceMappingURL=src-Gpb82U0M.mjs.map
20
+ //# sourceMappingURL=src-D4A03H49.mjs.map
@@ -1 +1 @@
1
- import{Bc as e,J as t,Ms as n,Ns as r,Qs as i,W as a,ec as o,ks as s,uc as c,x as l,y as u}from"./src-BUfAkcnU.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Aa as _,Ai as v,An as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Cn as O,Cr as k,Ct as A,D as j,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Hr as ne,Ht as re,I as ie,Ii as ae,In as oe,Ir as se,It as ce,J as le,Ji as ue,Jn as de,Jr as fe,Jt as pe,K as me,Ki as he,Kn as ge,Kr as _e,Kt as ve,L as ye,Li as be,Ln as xe,Lr as Se,Lt as Ce,M as we,Ma as Te,Mi as Ee,Mn as De,Mt as Oe,N as ke,Na as Ae,Ni as je,Nn as Me,Nr as Ne,Nt as Pe,O as Fe,Oa as Ie,Oi as Le,On as Re,Ot as ze,P as Be,Pa as Ve,Pi as He,Pn as Ue,Pr as We,Pt as Ge,Q as Ke,Qi as qe,Qn as Je,Qr as Ye,Qt as Xe,R as Ze,Ri as Qe,Rn as $e,Rr as et,Rt as tt,S as nt,Sa as rt,Si as it,Sn as at,Sr as ot,St as st,T as ct,Ta as lt,Ti as ut,Tn as dt,Tr as ft,Tt as pt,U as mt,Ui as ht,Un as gt,Ur as _t,Ut as vt,V as yt,Vi as bt,Vn as xt,Vr as St,Vt as Ct,W as wt,Wi as Tt,Wn as Et,Wr as Dt,Wt as Ot,X as kt,Xi as At,Xn as jt,Xr as Mt,Xt as Nt,Y as Pt,Yi as Ft,Yn as It,Yr as Lt,Yt as Rt,Z as zt,Zi as Bt,Zn as Vt,Zr as Ht,Zt as Ut,_ as Wt,_a as Gt,_i as Kt,_n as qt,_r as Jt,a as Yt,aa as Xt,ai as Zt,an as Qt,ar as $t,at as en,b as tn,ba as nn,bi as rn,bn as an,br as on,bt as sn,c as cn,ca as ln,ci as un,cn as dn,cr as fn,ct as pn,d as mn,da as hn,di as gn,dn as _n,dr as vn,dt as yn,ea as bn,ei as xn,en as Sn,er as Cn,et as wn,f as Tn,fa as En,fi as Dn,fn as On,fr as kn,ft as An,g as jn,ga as Mn,gi as Nn,gn as Pn,gr as Fn,h as In,ha as Ln,hi as Rn,hn as zn,hr as Bn,i as Vn,ia as Hn,ii as Un,in as Wn,ir as Gn,it as Kn,j as qn,ja as Jn,ji as Yn,jn as Xn,jt as Zn,k as Qn,ka as $n,ki as er,kn as tr,kt as nr,l as rr,la as ir,li as ar,ln as or,lr as sr,lt as cr,m as lr,ma as ur,mi as dr,mn as fr,mr as pr,n as mr,na as hr,ni as gr,nn as _r,nr as vr,nt as yr,o as br,oa as xr,oi as Sr,on as Cr,or as wr,ot as Tr,p as Er,pa as Dr,pi as Or,pn as kr,pr as Ar,pt as jr,q as Mr,qi as Nr,qn as Pr,qr as Fr,qt as Ir,r as Lr,ra as Rr,ri as zr,rn as Br,rr as Vr,rt as Hr,s as Ur,sa as Wr,si as Gr,sn as Kr,sr as qr,st as Jr,t as Yr,ta as Xr,ti as Zr,tn as Qr,tr as $r,tt as ei,u as ti,ua as ni,ui as ri,un as ii,ur as ai,ut as oi,v as si,va as ci,vi as li,vn as ui,vr as di,w as fi,wa as pi,wi as mi,wn as hi,wr as gi,wt as _i,x as vi,xa as yi,xi as bi,xn as xi,xr as Si,xt as Ci,y as wi,ya as Ti,yi as Ei,yn as Di,yr as Oi,z as ki,zi as Ai,zn as ji,zr as Mi,zt as Ni}from"./src-Dyk9iCzv.mjs";import{C as Pi,E as Fi,T as Ii,_ as Li,b as Ri,c as zi,d as Bi,g as Vi,i as Hi,l as Ui,m as Wi,n as Gi,p as Ki,s as qi,t as Ji,u as Yi,v as Xi,w as Zi,x as Qi,y as $i}from"./fs-traced-DcgvOGgW.mjs";import{a as ea,d as ta,f as na,i as ra,l as ia,n as aa,r as oa,t as sa,u as ca}from"./logger-Dq-cRhcP.mjs";import{C as la,S as ua,_ as da,a as fa,b as pa,c as ma,d as ha,f as ga,g as _a,h as va,i as ya,l as ba,m as xa,n as Sa,o as Ca,p as wa,r as Ta,s as Ea,t as Da,u as Oa,x as ka}from"./server-lock-DaOXwt6C.mjs";export{lt as AGENT_ID_MAX_LEN,R as AGENT_ID_RE,bt as AGENT_WRITE_ORIGIN,Te as AcpPermissionStore,$n as AcpRegistry,N as AcpThreadManager,ut as AgentFocusBroadcaster,mi as AgentPresenceBroadcaster,ee as AgentSessionCapacityError,ht as AgentSessionManager,st as AutoStartDisabledError,Kt as BUNDLE_IDS,li as BUNDLE_SCOPE,Ei as BUNDLE_SKILL_NAME,Vt as BacklinkIndex,f as CC1Broadcaster,o as CC1_CONTRACT_VERSION,or as CONFIG_FILENAME,X as CONFLICT_MARKER_RE,Se as CURSOR_BUNDLE_PATHS_BY_PLATFORM,tn as ConfigSchema,Xt as DEFAULT_CHECKPOINT_RETENTION,Zr as DEFAULT_EMBEDDINGS_DIMENSIONS,re as DEFAULT_PACK_ID,J as DocumentDurabilityState,gr as EMBEDDINGS_API_KEY_ENV,Yr as EPHEMERAL_PROJECT_DIR_PREFIX,xi as ExposureConsentError,_ as FEATURED_AGENT_IDS,xr as FILE_SYSTEM_WRITER,It as FILE_WATCHER_ORIGIN,Lt as FileEmbeddingsBackend,Wn as GIT_PREFLIGHT_FAIL_SPAN_NAME,Wr as GIT_UPSTREAM_WRITER,Ae as GitDirAccessError,Ee as GitNotAvailableError,je as GitTooOldError,A as HOCUSPOCUS_AUTH_REJECTION_REASONS,_i as HocuspocusAuthRejection,pt as HocuspocusAuthTokenSchema,qt as HomeProjectRootError,_t as INSTALLED_AGENTS_SCHEMES,An as JSON_SCHEMA_DIALECT_2020_12,i as LINEAGE_EPOCH_KEY,$ as LIVE_DERIVED_INDEX_DEBOUNCE_MS,vt as LOG_MD_TEMPLATE,Oe as MANAGED_RENAME_ORIGIN,Le as MAX_ACP_THREADS,Tt as MAX_AGENT_SESSIONS,v as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Y as MIN_EVICTABLE_IDLE_MS,He as MIN_GIT_VERSION,me as MISSING_OK_CONFIG_MESSAGE,Ve as MalformedGitPointerError,Kn as McpLogger,Mr as MissingOkConfigError,Nr as OBSERVER_SYNC_ORIGIN,ii as OK_OKIGNORE_TEMPLATE,rn as ONBOARDING_BUNDLE_IDS,n as ORPHAN_MODES,e as PROTOCOL_VERSION,sa as PinoLogger,ba as ProcessLockCollisionError,Tn as ProjectGitInitError,Pe as ROLLBACK_ORIGIN,_n as ROOT_GITIGNORE_TEMPLATE,pa as RUNTIME_VERSION,ln as SERVICE_WRITER,Ar as SKILL_INSTALL_EVENTS_FILE_REL,a as SKILL_STATE_TARGETS,Ot as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,ve as STARTER_PACKS,Ir as STARTER_PACK_IDS,pe as STARTER_TEMPLATES,Qn as STATE_MANIFEST_FILENAME,ka as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,Sn as SeedPrerequisiteError,Qr as SeedRootDirError,Da as ServerLockCollisionError,mr as SingleFileNotAFileError,Lr as SingleFileNotFoundError,Vn as SingleFileNotMarkdownError,Yt as SingleFileProjectOverrideError,g as StateManifestError,jt as TagIndex,bi as USER_GLOBAL_BUNDLE_IDS,Ge as __getShowAllWalkStatsForTesting,q as __resetShowAllWalkStatsForTesting,Oa as acquireProcessLock,Sa as acquireServerLock,he as applyAgentMarkdownWrite,gt as applyExternalChange,Ct as applySeed,qn as assertCompatibleStateManifest,W as assertGitAvailable,Xn as assertNeverDiskEvent,ui as assertNotHomeProjectRoot,z as attachAcpThreadSocket,sn as attachCollabClientCounter,Ci as attachIdleShutdown,vi as bootServer,p as buildAndOpenSkill,On as buildConfigYmlContent,d as buildExecResult,at as buildIngressPolicy,er as buildOkMcpStdioCommand,dr as buildSkillZip,Rt as buildStarterFolderFrontmatterYaml,ir as buildWipTree,it as bundleSkillMdPath,Mt as canonicalProjectKey,Di as canonicalizeForCompare,De as classifyEvents,Ji as classifyFsPath,Ht as clearAllEmbeddingsKeys,Un as clearContributors,Nt as coercePackId,u as colorFromSeed,ni as commitUpstreamImport,hn as commitWip,En as commitWipFromTree,ae as compareSemver,on as composeEffectiveLinterConfig,Si as composeFrontmatterSchemasConfig,ge as containsConflictMarkers,Me as contentHash,Zt as contributorCount,Ze as countShadowObjects,ki as countStaleAgentWipRefs,x as countWipRefs,ce as createApiExtension,Zn as createAssetServeMiddleware,Pt as createCollaborationHost,Ne as createContentFilter,We as createContentFilterAsync,Ye as createEmbeddingsSecretStore,br as createEphemeralProjectDir,Et as createExternalChangeHandler,In as createFileLogger,mt as createLiveDerivedIndexExtension,zt as createMcpHttpHandler,Dt as createOsProbe,ye as createPersistenceExtension,L as createServer,U as createServerObserverExtension,At as createStreamingErrorWriter,aa as createTestLogger,m as describeStoredEmbeddingsKey,wi as detectClaudeDesktopPresence,be as detectGit,we as detectProjectShape,Cn as detectUserSkillHosts,Jr as discoverLockDirs,gi as discoverMarkdownlintConfig,Qt as emitPreflightFailureSpan,wn as encodeDocName,ei as encodeFolderRoute,yr as encodeSkillRoute,Er as ensureProjectGit,kr as ensureProjectSkillGitignore,Bt as errorResponse,Ue as evictStaleTrackerEntries,Ce as extractHeadings,pn as extractOkBinaryPath,Je as extractWikiLinksFromMarkdown,Qe as fallbackPaths,lr as findEnclosingGitRoot,K as findEnclosingProjectRoot,ft as findNativeMarkdownlintFile,jn as flushFileLogger,H as formatAuthRejectionWire,Sr as formatContributors,Gr as formatContributorsFrom,Ni as formatPackRationale,Dr as gcCheckpointRefs,en as getCurrentMcpLogger,O as getIngressContext,gn as getLocalDir,Wt as getLogFilePath,oa as getLogger,si as getLogsDir,da as getMachineId,$i as getMeter,nn as getMetrics,Ri as getTracer,yi as handleCollabSocketError,et as handleSpawnCursor,hi as hasForwardingHeaders,yt as hasGcLogLatch,l as iconFromClientName,rt as incrementCollabSocketFilteredError,D as incrementServerObserverFire,fr as initContent,ur as initShadowRepo,Qi as initTelemetry,E as initToleranceTelemetryWriter,jr as installJsonSchemaDialect,yn as installPrettyZodErrors,ra as installTestLoggers,$r as installUserSkill,y as isAllowedApiOrigin,Re as isAllowedWorkspaceHostHeader,bn as isConfigDoc,I as isHocuspocusAuthRejectionReason,an as isHomeDir,dt as isHostAdmitted,Ut as isKnownPackId,Xr as isLinkIndexExcludedDoc,tr as isLoopbackAddress,hr as isManagedArtifactDoc,B as isOriginAdmitted,r as isOrphanMode,ue as isPairedWriteOrigin,Mi as isPathWithinDir,P as isPeerAdmitted,ua as isProcessAlive,se as isProjectRoot,Rr as isReservedForUserTree,G as isSelfWrite,Hn as isSystemDoc,fi as isToleranceTelemetryEnabled,la as isValidLockPid,oe as lastKnownHash,Ln as listRescueCheckpoints,Xe as listStarterPacks,Jn as loadCustomAgents,ie as loadPrincipal,Ta as lockAdvertisesUi,ha as lockBaseUrl,ga as lockFilePath,ea as loggerFactory,Fn as loginShapedUserinfoUser,ia as logsCurrentPath,ca as logsPreviousPath,xn as makeLazyEmbeddingsKeyStore,ya as markServerLockDraining,le as mountMcpAndApi,Gi as normalizeFsPath,Jt as originGitHubHost,zn as packageVersionMajorMinor,ze as parseAuthRejectionWire,Ai as parseGitVersion,nr as parseHocuspocusAuthToken,kt as parseKeepaliveConnectionId,xe as pathToDocName,T as planSeed,Ur as prepareSingleFileOpen,cr as processCommand,oi as processUsage,Gn as readAllTargets,$t as readBundleDecision,V as readOwnNativeRules,wa as readProcessLock,xa as readProcessLockDetailed,wt as readProjectHeadState,fe as readProjectLocalSemanticConfig,fa as readServerLock,wr as readServerPackageVersion,qr as readSkillInstallStateSnapshot,ke as readStateManifest,fn as readTargetRecordedAt,sr as readTargetVersion,Pr as reconcile,un as recordContributor,pr as recordSkillInstallEvent,Bn as redactShareSubprocessStderr,Ke as registerAllTools,$e as registerWrite,va as releaseProcessLock,Ca as releaseServerLock,ji as removeLastKnownHash,Vr as reportSkillInstall,pi as resetMetrics,vr as resolveBuiltinSkillHosts,t as resolveBundleEnabled,Rn as resolveBundledSkillDir,Dn as resolveContentDir,w as resolveCursorBinaryDefault,St as resolveCursorSpawnInvocation,ot as resolveEffectiveLinterConfig,zr as resolveEmbeddingsCredential,Fe as resolveGitHubAccountFromUrl,Or as resolveLockDir,k as resolveNativeConfigForDoc,F as resolveNativeMarkdownlintConfig,h as resolvePack,ti as resolvePackageVersion,kn as resolveSkillInstallReportSettings,Hr as resolveUiInfo,ar as restoreContributors,nt as restoreLifecycleFromConflictsJson,_e as rewriteMarkdownLinksForDocumentRename,Fr as rewriteWikiLinksForDocumentRename,Cr as runAuthReposSubprocess,Kr as runAuthStatusSubprocess,_r as runCloneSubprocess,dn as runDeviceFlowSubprocess,Tr as runWithMcpLogger,Z as safeContentPath,tt as safeSubdir,Mn as safetyCheckpoint,di as sameGitHubLogin,Yn as sanitizeClientName,Gt as saveInMemoryCheckpoint,ci as saveVersion,b as seedBasenameIndex,cn as seedEphemeralProjectDir,rr as serializeError,Pi as setActiveSpanAttributes,Ft as setupServerObservers,Ti as shadowGit,Zi as shutdownTelemetry,ta as spansCurrentPath,na as spansPreviousPath,ne as spawnDetached,de as splitMarkdownBlocks,C as startWatcher,qe as streamingProblemEvent,ri as swapContributors,ct as teardownToleranceTelemetryWriter,M as toBroadcasterKey,Hi as tracedAppendFileSync,qi as tracedLinkSync,zi as tracedMkdir,Ui as tracedMkdirSync,Yi as tracedRename,Bi as tracedRenameSync,Ki as tracedRmSync,Wi as tracedRmdirSync,Vi as tracedUnlinkSync,Li as tracedWriteFile,Xi as tracedWriteFileSync,j as trustSystemCertificates,mn as untrackTrackedProjectSkillProjection,xt as updateLastKnownHash,_a as updateProcessLockPort,Ea as updateServerLockPort,Ie as validateAgentId,Br as validateCloneInputs,Nn as validateSkillZip,ma as waitForServerLockDrain,S as withHiddenWindowsConsole,Ii as withSpan,Fi as withSpanSync,ai as writeBundleDecision,Oi as writeMarkdownlintRule,Pn as writeRootGitignoreForNewRepo,Be as writeStateManifest,vn as writeTargetVersion,te as writeTracker};
1
+ import{Bc as e,J as t,Ms as n,Ns as r,Qs as i,W as a,ec as o,ks as s,uc as c,x as l,y as u}from"./src-CP2xsmg5.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Aa as _,Ai as v,An as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Cn as O,Cr as k,Ct as A,D as j,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Hr as ne,Ht as re,I as ie,Ii as ae,In as oe,Ir as se,It as ce,J as le,Ji as ue,Jn as de,Jr as fe,Jt as pe,K as me,Ki as he,Kn as ge,Kr as _e,Kt as ve,L as ye,Li as be,Ln as xe,Lr as Se,Lt as Ce,M as we,Ma as Te,Mi as Ee,Mn as De,Mt as Oe,N as ke,Na as Ae,Ni as je,Nn as Me,Nr as Ne,Nt as Pe,O as Fe,Oa as Ie,Oi as Le,On as Re,Ot as ze,P as Be,Pa as Ve,Pi as He,Pn as Ue,Pr as We,Pt as Ge,Q as Ke,Qi as qe,Qn as Je,Qr as Ye,Qt as Xe,R as Ze,Ri as Qe,Rn as $e,Rr as et,Rt as tt,S as nt,Sa as rt,Si as it,Sn as at,Sr as ot,St as st,T as ct,Ta as lt,Ti as ut,Tn as dt,Tr as ft,Tt as pt,U as mt,Ui as ht,Un as gt,Ur as _t,Ut as vt,V as yt,Vi as bt,Vn as xt,Vr as St,Vt as Ct,W as wt,Wi as Tt,Wn as Et,Wr as Dt,Wt as Ot,X as kt,Xi as At,Xn as jt,Xr as Mt,Xt as Nt,Y as Pt,Yi as Ft,Yn as It,Yr as Lt,Yt as Rt,Z as zt,Zi as Bt,Zn as Vt,Zr as Ht,Zt as Ut,_ as Wt,_a as Gt,_i as Kt,_n as qt,_r as Jt,a as Yt,aa as Xt,ai as Zt,an as Qt,ar as $t,at as en,b as tn,ba as nn,bi as rn,bn as an,br as on,bt as sn,c as cn,ca as ln,ci as un,cn as dn,cr as fn,ct as pn,d as mn,da as hn,di as gn,dn as _n,dr as vn,dt as yn,ea as bn,ei as xn,en as Sn,er as Cn,et as wn,f as Tn,fa as En,fi as Dn,fn as On,fr as kn,ft as An,g as jn,ga as Mn,gi as Nn,gn as Pn,gr as Fn,h as In,ha as Ln,hi as Rn,hn as zn,hr as Bn,i as Vn,ia as Hn,ii as Un,in as Wn,ir as Gn,it as Kn,j as qn,ja as Jn,ji as Yn,jn as Xn,jt as Zn,k as Qn,ka as $n,ki as er,kn as tr,kt as nr,l as rr,la as ir,li as ar,ln as or,lr as sr,lt as cr,m as lr,ma as ur,mi as dr,mn as fr,mr as pr,n as mr,na as hr,ni as gr,nn as _r,nr as vr,nt as yr,o as br,oa as xr,oi as Sr,on as Cr,or as wr,ot as Tr,p as Er,pa as Dr,pi as Or,pn as kr,pr as Ar,pt as jr,q as Mr,qi as Nr,qn as Pr,qr as Fr,qt as Ir,r as Lr,ra as Rr,ri as zr,rn as Br,rr as Vr,rt as Hr,s as Ur,sa as Wr,si as Gr,sn as Kr,sr as qr,st as Jr,t as Yr,ta as Xr,ti as Zr,tn as Qr,tr as $r,tt as ei,u as ti,ua as ni,ui as ri,un as ii,ur as ai,ut as oi,v as si,va as ci,vi as li,vn as ui,vr as di,w as fi,wa as pi,wi as mi,wn as hi,wr as gi,wt as _i,x as vi,xa as yi,xi as bi,xn as xi,xr as Si,xt as Ci,y as wi,ya as Ti,yi as Ei,yn as Di,yr as Oi,z as ki,zi as Ai,zn as ji,zr as Mi,zt as Ni}from"./src-HFlqeGnA.mjs";import{C as Pi,E as Fi,T as Ii,_ as Li,b as Ri,c as zi,d as Bi,g as Vi,i as Hi,l as Ui,m as Wi,n as Gi,p as Ki,s as qi,t as Ji,u as Yi,v as Xi,w as Zi,x as Qi,y as $i}from"./fs-traced-DcgvOGgW.mjs";import{a as ea,d as ta,f as na,i as ra,l as ia,n as aa,r as oa,t as sa,u as ca}from"./logger-Dq-cRhcP.mjs";import{C as la,S as ua,_ as da,a as fa,b as pa,c as ma,d as ha,f as ga,g as _a,h as va,i as ya,l as ba,m as xa,n as Sa,o as Ca,p as wa,r as Ta,s as Ea,t as Da,u as Oa,x as ka}from"./server-lock-CBDjdfxH.mjs";export{lt as AGENT_ID_MAX_LEN,R as AGENT_ID_RE,bt as AGENT_WRITE_ORIGIN,Te as AcpPermissionStore,$n as AcpRegistry,N as AcpThreadManager,ut as AgentFocusBroadcaster,mi as AgentPresenceBroadcaster,ee as AgentSessionCapacityError,ht as AgentSessionManager,st as AutoStartDisabledError,Kt as BUNDLE_IDS,li as BUNDLE_SCOPE,Ei as BUNDLE_SKILL_NAME,Vt as BacklinkIndex,f as CC1Broadcaster,o as CC1_CONTRACT_VERSION,or as CONFIG_FILENAME,X as CONFLICT_MARKER_RE,Se as CURSOR_BUNDLE_PATHS_BY_PLATFORM,tn as ConfigSchema,Xt as DEFAULT_CHECKPOINT_RETENTION,Zr as DEFAULT_EMBEDDINGS_DIMENSIONS,re as DEFAULT_PACK_ID,J as DocumentDurabilityState,gr as EMBEDDINGS_API_KEY_ENV,Yr as EPHEMERAL_PROJECT_DIR_PREFIX,xi as ExposureConsentError,_ as FEATURED_AGENT_IDS,xr as FILE_SYSTEM_WRITER,It as FILE_WATCHER_ORIGIN,Lt as FileEmbeddingsBackend,Wn as GIT_PREFLIGHT_FAIL_SPAN_NAME,Wr as GIT_UPSTREAM_WRITER,Ae as GitDirAccessError,Ee as GitNotAvailableError,je as GitTooOldError,A as HOCUSPOCUS_AUTH_REJECTION_REASONS,_i as HocuspocusAuthRejection,pt as HocuspocusAuthTokenSchema,qt as HomeProjectRootError,_t as INSTALLED_AGENTS_SCHEMES,An as JSON_SCHEMA_DIALECT_2020_12,i as LINEAGE_EPOCH_KEY,$ as LIVE_DERIVED_INDEX_DEBOUNCE_MS,vt as LOG_MD_TEMPLATE,Oe as MANAGED_RENAME_ORIGIN,Le as MAX_ACP_THREADS,Tt as MAX_AGENT_SESSIONS,v as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Y as MIN_EVICTABLE_IDLE_MS,He as MIN_GIT_VERSION,me as MISSING_OK_CONFIG_MESSAGE,Ve as MalformedGitPointerError,Kn as McpLogger,Mr as MissingOkConfigError,Nr as OBSERVER_SYNC_ORIGIN,ii as OK_OKIGNORE_TEMPLATE,rn as ONBOARDING_BUNDLE_IDS,n as ORPHAN_MODES,e as PROTOCOL_VERSION,sa as PinoLogger,ba as ProcessLockCollisionError,Tn as ProjectGitInitError,Pe as ROLLBACK_ORIGIN,_n as ROOT_GITIGNORE_TEMPLATE,pa as RUNTIME_VERSION,ln as SERVICE_WRITER,Ar as SKILL_INSTALL_EVENTS_FILE_REL,a as SKILL_STATE_TARGETS,Ot as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,ve as STARTER_PACKS,Ir as STARTER_PACK_IDS,pe as STARTER_TEMPLATES,Qn as STATE_MANIFEST_FILENAME,ka as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,Sn as SeedPrerequisiteError,Qr as SeedRootDirError,Da as ServerLockCollisionError,mr as SingleFileNotAFileError,Lr as SingleFileNotFoundError,Vn as SingleFileNotMarkdownError,Yt as SingleFileProjectOverrideError,g as StateManifestError,jt as TagIndex,bi as USER_GLOBAL_BUNDLE_IDS,Ge as __getShowAllWalkStatsForTesting,q as __resetShowAllWalkStatsForTesting,Oa as acquireProcessLock,Sa as acquireServerLock,he as applyAgentMarkdownWrite,gt as applyExternalChange,Ct as applySeed,qn as assertCompatibleStateManifest,W as assertGitAvailable,Xn as assertNeverDiskEvent,ui as assertNotHomeProjectRoot,z as attachAcpThreadSocket,sn as attachCollabClientCounter,Ci as attachIdleShutdown,vi as bootServer,p as buildAndOpenSkill,On as buildConfigYmlContent,d as buildExecResult,at as buildIngressPolicy,er as buildOkMcpStdioCommand,dr as buildSkillZip,Rt as buildStarterFolderFrontmatterYaml,ir as buildWipTree,it as bundleSkillMdPath,Mt as canonicalProjectKey,Di as canonicalizeForCompare,De as classifyEvents,Ji as classifyFsPath,Ht as clearAllEmbeddingsKeys,Un as clearContributors,Nt as coercePackId,u as colorFromSeed,ni as commitUpstreamImport,hn as commitWip,En as commitWipFromTree,ae as compareSemver,on as composeEffectiveLinterConfig,Si as composeFrontmatterSchemasConfig,ge as containsConflictMarkers,Me as contentHash,Zt as contributorCount,Ze as countShadowObjects,ki as countStaleAgentWipRefs,x as countWipRefs,ce as createApiExtension,Zn as createAssetServeMiddleware,Pt as createCollaborationHost,Ne as createContentFilter,We as createContentFilterAsync,Ye as createEmbeddingsSecretStore,br as createEphemeralProjectDir,Et as createExternalChangeHandler,In as createFileLogger,mt as createLiveDerivedIndexExtension,zt as createMcpHttpHandler,Dt as createOsProbe,ye as createPersistenceExtension,L as createServer,U as createServerObserverExtension,At as createStreamingErrorWriter,aa as createTestLogger,m as describeStoredEmbeddingsKey,wi as detectClaudeDesktopPresence,be as detectGit,we as detectProjectShape,Cn as detectUserSkillHosts,Jr as discoverLockDirs,gi as discoverMarkdownlintConfig,Qt as emitPreflightFailureSpan,wn as encodeDocName,ei as encodeFolderRoute,yr as encodeSkillRoute,Er as ensureProjectGit,kr as ensureProjectSkillGitignore,Bt as errorResponse,Ue as evictStaleTrackerEntries,Ce as extractHeadings,pn as extractOkBinaryPath,Je as extractWikiLinksFromMarkdown,Qe as fallbackPaths,lr as findEnclosingGitRoot,K as findEnclosingProjectRoot,ft as findNativeMarkdownlintFile,jn as flushFileLogger,H as formatAuthRejectionWire,Sr as formatContributors,Gr as formatContributorsFrom,Ni as formatPackRationale,Dr as gcCheckpointRefs,en as getCurrentMcpLogger,O as getIngressContext,gn as getLocalDir,Wt as getLogFilePath,oa as getLogger,si as getLogsDir,da as getMachineId,$i as getMeter,nn as getMetrics,Ri as getTracer,yi as handleCollabSocketError,et as handleSpawnCursor,hi as hasForwardingHeaders,yt as hasGcLogLatch,l as iconFromClientName,rt as incrementCollabSocketFilteredError,D as incrementServerObserverFire,fr as initContent,ur as initShadowRepo,Qi as initTelemetry,E as initToleranceTelemetryWriter,jr as installJsonSchemaDialect,yn as installPrettyZodErrors,ra as installTestLoggers,$r as installUserSkill,y as isAllowedApiOrigin,Re as isAllowedWorkspaceHostHeader,bn as isConfigDoc,I as isHocuspocusAuthRejectionReason,an as isHomeDir,dt as isHostAdmitted,Ut as isKnownPackId,Xr as isLinkIndexExcludedDoc,tr as isLoopbackAddress,hr as isManagedArtifactDoc,B as isOriginAdmitted,r as isOrphanMode,ue as isPairedWriteOrigin,Mi as isPathWithinDir,P as isPeerAdmitted,ua as isProcessAlive,se as isProjectRoot,Rr as isReservedForUserTree,G as isSelfWrite,Hn as isSystemDoc,fi as isToleranceTelemetryEnabled,la as isValidLockPid,oe as lastKnownHash,Ln as listRescueCheckpoints,Xe as listStarterPacks,Jn as loadCustomAgents,ie as loadPrincipal,Ta as lockAdvertisesUi,ha as lockBaseUrl,ga as lockFilePath,ea as loggerFactory,Fn as loginShapedUserinfoUser,ia as logsCurrentPath,ca as logsPreviousPath,xn as makeLazyEmbeddingsKeyStore,ya as markServerLockDraining,le as mountMcpAndApi,Gi as normalizeFsPath,Jt as originGitHubHost,zn as packageVersionMajorMinor,ze as parseAuthRejectionWire,Ai as parseGitVersion,nr as parseHocuspocusAuthToken,kt as parseKeepaliveConnectionId,xe as pathToDocName,T as planSeed,Ur as prepareSingleFileOpen,cr as processCommand,oi as processUsage,Gn as readAllTargets,$t as readBundleDecision,V as readOwnNativeRules,wa as readProcessLock,xa as readProcessLockDetailed,wt as readProjectHeadState,fe as readProjectLocalSemanticConfig,fa as readServerLock,wr as readServerPackageVersion,qr as readSkillInstallStateSnapshot,ke as readStateManifest,fn as readTargetRecordedAt,sr as readTargetVersion,Pr as reconcile,un as recordContributor,pr as recordSkillInstallEvent,Bn as redactShareSubprocessStderr,Ke as registerAllTools,$e as registerWrite,va as releaseProcessLock,Ca as releaseServerLock,ji as removeLastKnownHash,Vr as reportSkillInstall,pi as resetMetrics,vr as resolveBuiltinSkillHosts,t as resolveBundleEnabled,Rn as resolveBundledSkillDir,Dn as resolveContentDir,w as resolveCursorBinaryDefault,St as resolveCursorSpawnInvocation,ot as resolveEffectiveLinterConfig,zr as resolveEmbeddingsCredential,Fe as resolveGitHubAccountFromUrl,Or as resolveLockDir,k as resolveNativeConfigForDoc,F as resolveNativeMarkdownlintConfig,h as resolvePack,ti as resolvePackageVersion,kn as resolveSkillInstallReportSettings,Hr as resolveUiInfo,ar as restoreContributors,nt as restoreLifecycleFromConflictsJson,_e as rewriteMarkdownLinksForDocumentRename,Fr as rewriteWikiLinksForDocumentRename,Cr as runAuthReposSubprocess,Kr as runAuthStatusSubprocess,_r as runCloneSubprocess,dn as runDeviceFlowSubprocess,Tr as runWithMcpLogger,Z as safeContentPath,tt as safeSubdir,Mn as safetyCheckpoint,di as sameGitHubLogin,Yn as sanitizeClientName,Gt as saveInMemoryCheckpoint,ci as saveVersion,b as seedBasenameIndex,cn as seedEphemeralProjectDir,rr as serializeError,Pi as setActiveSpanAttributes,Ft as setupServerObservers,Ti as shadowGit,Zi as shutdownTelemetry,ta as spansCurrentPath,na as spansPreviousPath,ne as spawnDetached,de as splitMarkdownBlocks,C as startWatcher,qe as streamingProblemEvent,ri as swapContributors,ct as teardownToleranceTelemetryWriter,M as toBroadcasterKey,Hi as tracedAppendFileSync,qi as tracedLinkSync,zi as tracedMkdir,Ui as tracedMkdirSync,Yi as tracedRename,Bi as tracedRenameSync,Ki as tracedRmSync,Wi as tracedRmdirSync,Vi as tracedUnlinkSync,Li as tracedWriteFile,Xi as tracedWriteFileSync,j as trustSystemCertificates,mn as untrackTrackedProjectSkillProjection,xt as updateLastKnownHash,_a as updateProcessLockPort,Ea as updateServerLockPort,Ie as validateAgentId,Br as validateCloneInputs,Nn as validateSkillZip,ma as waitForServerLockDrain,S as withHiddenWindowsConsole,Ii as withSpan,Fi as withSpanSync,ai as writeBundleDecision,Oi as writeMarkdownlintRule,Pn as writeRootGitignoreForNewRepo,Be as writeStateManifest,vn as writeTargetVersion,te as writeTracker};