@inkeep/open-knowledge 0.58.0-beta.11 → 0.58.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/{acp-harness-probe-BEeqLM1e.mjs → acp-harness-probe-Dfv_uQNP.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-e1BSt71N.mjs +2 -0
  4. package/dist/index.d.mts +17 -17
  5. package/dist/index.mjs +11 -11
  6. package/dist/{init-DTgyXqMA.mjs → init-FvfqNSOd.mjs} +3 -3
  7. package/dist/init-cfMv0WeA.mjs +1 -0
  8. package/dist/{launch-json-removal-Bup49Sx1.mjs → launch-json-removal-B6WDLjiv.mjs} +2 -2
  9. package/dist/loader-CZpJwuV6.mjs +1 -0
  10. package/dist/{loader-DOVe5HC9.mjs → loader-ShWmrYui.mjs} +2 -2
  11. package/dist/{open-browser-y7HA6bX8.mjs → open-browser-XCXpL8oR.mjs} +2 -2
  12. package/dist/{preview-CPQM3RYG.mjs → preview-2-v6P1hO.mjs} +2 -2
  13. package/dist/preview-DFgeB8zI.mjs +1 -0
  14. package/dist/public/assets/{ActivityModeContent-B7vQuqrR.js → ActivityModeContent-D7_xgv7P.js} +1 -1
  15. package/dist/public/assets/{AgentDiffPane-DGxVIMVq.js → AgentDiffPane-DHKJVpBK.js} +1 -1
  16. package/dist/public/assets/{CodeMirrorPropInput-CGK6hmpN.js → CodeMirrorPropInput-DXR5-JFo.js} +1 -1
  17. package/dist/public/assets/{DocumentContext-CinbQ92j.js → DocumentContext-Br_dSI9H.js} +20 -20
  18. package/dist/public/assets/{EditorModeToggle-BoyqVhHR.js → EditorModeToggle-CANd5c2J.js} +1 -1
  19. package/dist/public/assets/{EnableSyncConfirmDialog-Ciji3GZn.js → EnableSyncConfirmDialog-BAOzmcZq.js} +1 -1
  20. package/dist/public/assets/{ExcalidrawDocEditor-ChOFZn7i.js → ExcalidrawDocEditor-Cvc6wabb.js} +1 -1
  21. package/dist/public/assets/FeedbackForm-D2mhxqam.js +1 -0
  22. package/dist/public/assets/{ImportSkillDialog-tV6aPKk7.js → ImportSkillDialog-B6tXjot5.js} +1 -1
  23. package/dist/public/assets/{LintConfigEditor-DuA-NXIS.js → LintConfigEditor-Cw_PGYRz.js} +1 -1
  24. package/dist/public/assets/{ManagedArtifactProperties-DXHfhBzn.js → ManagedArtifactProperties-BInM0KSe.js} +1 -1
  25. package/dist/public/assets/ManagedArtifactProperties-jmbtLGDS.js +1 -0
  26. package/dist/public/assets/{MermaidDocEditor-B-QzuF1n.js → MermaidDocEditor-3FqhD9lF.js} +1 -1
  27. package/dist/public/assets/{PropertyDisplayRow-BuyrHRje.js → PropertyDisplayRow-CtBxU1Ak.js} +1 -1
  28. package/dist/public/assets/{SchemaConfigEditor-CkL-e25Z.js → SchemaConfigEditor-DhyxzCmv.js} +1 -1
  29. package/dist/public/assets/{SessionsHost-BPH09tZz.js → SessionsHost-CB0yLBVw.js} +2 -2
  30. package/dist/public/assets/{SettingsDialogBody-L6N4LxUC.js → SettingsDialogBody-DZR4EUUX.js} +3 -3
  31. package/dist/public/assets/{ShareReceiveMissDialog-_wXX_j_p.js → ShareReceiveMissDialog-bQE-yeQ6.js} +1 -1
  32. package/dist/public/assets/{SkillInstallMenu-B4kN_NL-.js → SkillInstallMenu-Df58OcE7.js} +1 -1
  33. package/dist/public/assets/{SkillToolbarControls-nOQsvkPG.js → SkillToolbarControls-DhzDa8xm.js} +1 -1
  34. package/dist/public/assets/{SourceEditor-MTZsjUlQ.js → SourceEditor-DAiuKGfG.js} +1 -1
  35. package/dist/public/assets/{TerminalWindowApp-hxIJ8MZN.js → TerminalWindowApp-BtmxrE8e.js} +1 -1
  36. package/dist/public/assets/{TextDocEditor-C9AJuPKq.js → TextDocEditor-CE4yndXU.js} +1 -1
  37. package/dist/public/assets/{ThreadView-Bwvzn-7R.js → ThreadView-CweBhNmN.js} +5 -5
  38. package/dist/public/assets/{TimelineDiffPane-BI6MR1YA.js → TimelineDiffPane-DDdiKvM5.js} +1 -1
  39. package/dist/public/assets/{agent-diff-store-COGZ0vEh.js → agent-diff-store-pclUz0aI.js} +1 -1
  40. package/dist/public/assets/{auth-state-cache-BM2pwWxf.js → auth-state-cache-D6Tks0Xw.js} +3 -3
  41. package/dist/public/assets/{client-version-C6rd6p9V.js → client-version-DDQ9xEIT.js} +1 -1
  42. package/dist/public/assets/{comment-chips-j_tvalF0.js → comment-chips-dIt1vXQ_.js} +1 -1
  43. package/dist/public/assets/{config-provider-sF-r6DD2.js → config-provider-tHkdYhw-.js} +3 -3
  44. package/dist/public/assets/{follow-file-D0cc7Tog.js → follow-file-JEQI8xw4.js} +1 -1
  45. package/dist/public/assets/{globals-BIkjmIKR.css → globals-tRU8O5cm.css} +1 -1
  46. package/dist/public/assets/i18n-C2uEep4d.js +1 -0
  47. package/dist/public/assets/index-627Ovxlz.js +2096 -0
  48. package/dist/public/assets/messages-BHDcBKgv.js +1 -0
  49. package/dist/public/assets/messages-BJnM3Dga.js +1 -0
  50. package/dist/public/assets/messages-BUGfzfF2.js +1 -0
  51. package/dist/public/assets/messages-BaKdNrlr.js +1 -0
  52. package/dist/public/assets/messages-BzpyYTFC.js +1 -0
  53. package/dist/public/assets/messages-C972mg8q.js +1 -0
  54. package/dist/public/assets/{messages-D1T06mzm.js → messages-CuqqiR9b.js} +1 -1
  55. package/dist/public/assets/messages-D81XOcCT.js +1 -0
  56. package/dist/public/assets/messages-DAEEmDbT.js +1 -0
  57. package/dist/public/assets/messages-DX5v9pJd.js +1 -0
  58. package/dist/public/assets/messages-DagLatIQ.js +1 -0
  59. package/dist/public/assets/messages-z-ne5Pbu.js +1 -0
  60. package/dist/public/assets/{pending-receive-nav-store-B1PhEPxI.js → pending-receive-nav-store-CD1tgq0g.js} +1 -1
  61. package/dist/public/assets/{selection-context-DDDwmdw6.js → selection-context-D2Mghtd2.js} +1 -1
  62. package/dist/public/assets/{skill-actions-CanhwMVw.js → skill-actions-XyB8ZE4l.js} +1 -1
  63. package/dist/public/assets/{src-nI94K4Jv.js → src-CVjDuNGv.js} +1 -1
  64. package/dist/public/assets/{telemetry-impl-DDjYKppL.js → telemetry-impl-Dz1N6oIK.js} +1 -1
  65. package/dist/public/assets/{telemetry-startup-ujb1QPqT.js → telemetry-startup-hWX5HNgA.js} +1 -1
  66. package/dist/public/assets/{typing-burst-detector-C71jkGN_.js → typing-burst-detector-DAuaPW3s.js} +2 -2
  67. package/dist/public/assets/{uninstall-DA1901LS.js → uninstall-DqWW2ke7.js} +1 -1
  68. package/dist/public/assets/{use-activity-panel-BY16reWV.js → use-activity-panel-BQS8YgFm.js} +1 -1
  69. package/dist/public/assets/{use-open-skill-DbxWL28h.js → use-open-skill-BN_i8Eku.js} +1 -1
  70. package/dist/public/assets/{use-popular-skills-C2eU3yPp.js → use-popular-skills-BAd04Q2w.js} +1 -1
  71. package/dist/public/assets/{use-terminal-enabled-G7X3-68G.js → use-terminal-enabled-DCAIeUQs.js} +1 -1
  72. package/dist/public/assets/use-timeline-entry-diff-Dhao_9vO.js +6 -0
  73. package/dist/public/index.html +24 -24
  74. package/dist/public/uninstall.html +5 -5
  75. package/dist/{repair-launch-json-C7cMsX_u.mjs → repair-launch-json-BYSX4lZ4.mjs} +2 -2
  76. package/dist/{repair-mcp-configs-ClGfTJpT.mjs → repair-mcp-configs-BXIuvoqd.mjs} +2 -2
  77. package/dist/repair-skills-CS14x_hO.mjs +1 -0
  78. package/dist/{repair-skills-IyM2RV1-.mjs → repair-skills-DltCY6z2.mjs} +2 -2
  79. package/dist/server-lock-CnbGjeVA.mjs +2 -0
  80. package/dist/server-lock-DCiTFRYj.mjs +1 -0
  81. package/dist/{skill-teardown-Cn7cfIYa.mjs → skill-teardown-DhZjMVeU.mjs} +2 -2
  82. package/dist/{src-vHdNPukY.mjs → src-5XnFzMUO.mjs} +1 -1
  83. package/dist/src-B4cqEhZL.mjs +1 -0
  84. package/dist/{src-D356u9An.mjs → src-DVlcBUL2.mjs} +24 -24
  85. package/dist/{src-CrHWeR5-.mjs → src-OuxJ-RtG.mjs} +3 -3
  86. package/dist/start-CScrvLcu.mjs +1 -0
  87. package/dist/{start-B3LinnWE.mjs → start-D1YfTqhe.mjs} +4 -4
  88. package/dist/{ui-Bl8Rbh53.mjs → ui-CNdWjnA7.mjs} +3 -3
  89. package/dist/{write-project-skill-BPDDCXLT.mjs → write-project-skill-GQSmUhGW.mjs} +2 -2
  90. package/package.json +4 -4
  91. package/dist/constants-DVdmH8pu.mjs +0 -2
  92. package/dist/init-BuB3fuLV.mjs +0 -1
  93. package/dist/loader-31xqf1Zs.mjs +0 -1
  94. package/dist/preview-CDR7hjND.mjs +0 -1
  95. package/dist/public/assets/FeedbackForm-DRZsrnQ9.js +0 -1
  96. package/dist/public/assets/ManagedArtifactProperties-ElNATzsn.js +0 -1
  97. package/dist/public/assets/i18n-3MuYBaiE.js +0 -1
  98. package/dist/public/assets/index-CzPE3ZH9.js +0 -2096
  99. package/dist/public/assets/messages-BnRcVtqj.js +0 -1
  100. package/dist/public/assets/messages-C00eLNs7.js +0 -1
  101. package/dist/public/assets/messages-C5bmYd43.js +0 -1
  102. package/dist/public/assets/messages-Cd0YMp5L.js +0 -1
  103. package/dist/public/assets/messages-D-pqY9SX.js +0 -1
  104. package/dist/public/assets/messages-DV9j-Nuy.js +0 -1
  105. package/dist/public/assets/messages-DdkGPpV2.js +0 -1
  106. package/dist/public/assets/messages-Dh5RFQKD.js +0 -1
  107. package/dist/public/assets/messages-Np0xKUyO.js +0 -1
  108. package/dist/public/assets/messages-fHg_QLx1.js +0 -1
  109. package/dist/public/assets/messages-zHVeim4Y.js +0 -1
  110. package/dist/public/assets/use-timeline-entry-diff-6-XXpuwT.js +0 -6
  111. package/dist/repair-skills-Deon-PUG.mjs +0 -1
  112. package/dist/server-lock-BmpC4xda.mjs +0 -2
  113. package/dist/server-lock-CSpIbtA5.mjs +0 -1
  114. package/dist/src-DYu0cH0G.mjs +0 -1
  115. package/dist/start-COUGziKD.mjs +0 -1
  116. /package/dist/public/assets/{globals-CZErGZFp.js → globals-B6ItdNTJ.js} +0 -0
package/dist/index.mjs CHANGED
@@ -430,22 +430,22 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
430
430
  `){return e.split(n).reduce((e,n)=>{let r=t?n.trim():n;return r&&e.push(r),e},[])}function j1(e,t){return A1(e,!0).map(e=>t(e))}function M1(e){return(0,i1.exists)(e,i1.FOLDER)}function N1(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Phe(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function P1(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function F1(e){return Array.isArray(e)?e:[e]}function I1(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function L1(e){return F1(e).map(e=>e instanceof String?e:String(e))}function R1(e,t=0){if(e==null)return t;let n=parseInt(e,10);return Number.isNaN(n)?t:n}function z1(e,t){let n=[];for(let r=0,i=e.length;r<i;r++)n.push(t,e[r]);return n}function B1(e){return(Array.isArray(e)?Buffer.concat(e):e).toString(`utf-8`)}function Fhe(e,t){let n={};return t.forEach(t=>{e[t]!==void 0&&(n[t]=e[t])}),n}function Ihe(e=0){return new Promise(t=>setTimeout(t,e))}function V1(e){if(e!==!1)return e}var H1,U1,W1,G1=h1({"src/lib/utils/util.ts"(){t0(),H1=`\0`,U1=()=>{},W1=Object.prototype.toString.call.bind(Object.prototype.toString)}});function K1(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function q1(e,t){let n=s1(e)?`string`:typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function J1(e){return!!e&&W1(e)===`[object Object]`}function Y1(e){return typeof e==`function`}var X1,Z1,Q1,$1,e0,t0=h1({"src/lib/utils/argument-filters.ts"(){G1(),X1=e=>Array.isArray(e),Z1=e=>typeof e==`number`,Q1=e=>typeof e==`string`||s1(e),$1=e=>Q1(e)||Array.isArray(e)&&e.every(Q1),e0=e=>e==null||`number|boolean|function`.includes(typeof e)?!1:typeof e.length==`number`}}),n0,Lhe=h1({"src/lib/utils/exit-codes.ts"(){n0=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e[e.ERROR=1]=`ERROR`,e[e.NOT_FOUND=-2]=`NOT_FOUND`,e[e.UNCLEAN=128]=`UNCLEAN`,e))(n0||{})}}),r0,Rhe=h1({"src/lib/utils/git-output-streams.ts"(){r0=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString(`utf8`),this.stdErr.toString(`utf8`))}}}});function zhe(){throw Error(`LineParser:useMatches not implemented`)}var i0,a0,Bhe=h1({"src/lib/utils/line-parser.ts"(){i0=class{constructor(e,t){this.matches=[],this.useMatches=zhe,this.parse=(e,t)=>(this.resetMatches(),this._regExp.every((t,n)=>this.addMatch(t,n,e(n)))?this.useMatches(t,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){let r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},a0=class extends i0{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Vhe(...e){let t=process.cwd(),n=Object.assign({baseDir:t,...o0},...e.filter(e=>typeof e==`object`&&e));return n.baseDir=n.baseDir||t,n.trimmed=n.trimmed===!0,n}var o0,Hhe=h1({"src/lib/utils/simple-git-options.ts"(){o0={binary:`git`,maxConcurrentProcesses:5,config:[],trimmed:!1}}});function s0(e,t=[]){return J1(e)?Object.keys(e).reduce((t,n)=>{let r=e[n];if(s1(r))t.push(r);else if(q1(r,[`boolean`]))t.push(n+`=`+r);else if(Array.isArray(r))for(let e of r)q1(e,[`string`,`number`])||t.push(n+`=`+e);else t.push(n);return t},t):t}function c0(e,t=0,n=!1){let r=[];for(let n=0,i=t<0?e.length:t;n<i;n++)`string|number`.includes(typeof e[n])&&r.push(String(e[n]));return s0(l0(e),r),n||r.push(...Uhe(e)),r}function Uhe(e){return L1(K1(O1(e,+(typeof O1(e)==`function`)),X1,[]))}function l0(e){return K1(O1(e,+!!Y1(O1(e))),J1)}function u0(e,t=!0){let n=w1(O1(e));return t||T1(n)?n:void 0}var Whe=h1({"src/lib/utils/task-options.ts"(){t0(),G1()}});function d0(e,t){return e(t.stdOut,t.stdErr)}function f0(e,t,n,r=!0){return F1(n).forEach(n=>{for(let i=A1(n,r),a=0,o=i.length;a<o;a++){let n=(e=0)=>{if(!(a+e>=o))return i[a+e]};t.some(({parse:t})=>t(n,e))}}),e}var Ghe=h1({"src/lib/utils/task-parser.ts"(){G1()}}),p0={};g1(p0,{ExitCodes:()=>n0,GitOutputStreams:()=>r0,LineParser:()=>i0,NOOP:()=>U1,NULL:()=>H1,RemoteLineParser:()=>a0,append:()=>N1,appendTaskOptions:()=>s0,asArray:()=>F1,asCamelCase:()=>I1,asFunction:()=>w1,asNumber:()=>R1,asStringArray:()=>L1,bufferToString:()=>B1,callTaskParser:()=>d0,createInstanceConfig:()=>Vhe,delay:()=>Ihe,filterArray:()=>X1,filterFunction:()=>Y1,filterHasLength:()=>e0,filterNumber:()=>Z1,filterPlainObject:()=>J1,filterPrimitives:()=>q1,filterString:()=>Q1,filterStringOrStringArray:()=>$1,filterType:()=>K1,first:()=>D1,folderExists:()=>M1,forEachLineWithContent:()=>j1,getTrailingOptions:()=>c0,including:()=>Phe,isUserFunction:()=>T1,last:()=>O1,objectToString:()=>W1,orVoid:()=>V1,parseStringResponse:()=>f0,pick:()=>Fhe,prefixedArray:()=>z1,remove:()=>P1,splitOn:()=>E1,toLinesWithContent:()=>A1,trailingFunctionArgument:()=>u0,trailingOptionsArgument:()=>l0});var m0=h1({"src/lib/utils/index.ts"(){t0(),Lhe(),Rhe(),Bhe(),Hhe(),Whe(),Ghe(),G1()}}),h0={};g1(h0,{CheckRepoActions:()=>v0,checkIsBareRepoTask:()=>_0,checkIsRepoRootTask:()=>g0,checkIsRepoTask:()=>Khe});function Khe(e){switch(e){case`bare`:return _0();case`root`:return g0()}return{commands:[`rev-parse`,`--is-inside-work-tree`],format:`utf-8`,onError:y0,parser:b0}}function g0(){return{commands:[`rev-parse`,`--git-dir`],format:`utf-8`,onError:y0,parser(e){return/^\.(git)?$/.test(e.trim())}}}function _0(){return{commands:[`rev-parse`,`--is-bare-repository`],format:`utf-8`,onError:y0,parser:b0}}function qhe(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var v0,y0,b0,x0=h1({"src/lib/tasks/check-is-repo.ts"(){m0(),v0=(e=>(e.BARE=`bare`,e.IN_TREE=`tree`,e.IS_REPO_ROOT=`root`,e))(v0||{}),y0=({exitCode:e},t,n,r)=>{if(e===128&&qhe(t))return n(Buffer.from(`false`));r(t)},b0=e=>e.trim()===`true`}});function Jhe(e,t){let n=new S0(e),r=e?w0:C0;return A1(t).forEach(e=>{let t=e.replace(r,``);n.paths.push(t),(T0.test(t)?n.folders:n.files).push(t)}),n}var S0,C0,w0,T0,Yhe=h1({"src/lib/responses/CleanSummary.ts"(){m0(),S0=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},C0=/^[a-z]+\s*/i,w0=/^[a-z]+\s+[a-z]+\s*/i,T0=/\/$/}}),E0={};g1(E0,{EMPTY_COMMANDS:()=>N0,adhocExecTask:()=>D0,configurationErrorTask:()=>O0,isBufferTask:()=>j0,isEmptyTask:()=>M0,straightThroughBufferTask:()=>A0,straightThroughStringTask:()=>k0});function D0(e){return{commands:N0,format:`empty`,parser:e}}function O0(e){return{commands:N0,format:`empty`,parser(){throw typeof e==`string`?new S1(e):e}}}function k0(e,t=!1){return{commands:e,format:`utf-8`,parser(e){return t?String(e).trim():e}}}function A0(e){return{commands:e,format:`buffer`,parser(e){return e}}}function j0(e){return e.format===`buffer`}function M0(e){return e.format===`empty`||!e.commands.length}var N0,P0=h1({"src/lib/tasks/task.ts"(){C1(),N0=[]}}),F0={};g1(F0,{CONFIG_ERROR_INTERACTIVE_MODE:()=>L0,CONFIG_ERROR_MODE_REQUIRED:()=>R0,CONFIG_ERROR_UNKNOWN_OPTION:()=>z0,CleanOptions:()=>B0,cleanTask:()=>I0,cleanWithOptionsTask:()=>Xhe,isCleanOptionsArray:()=>Zhe});function Xhe(e,t){let{cleanMode:n,options:r,valid:i}=Qhe(e);return n?i.options?(r.push(...t),r.some(tge)?O0(L0):I0(n,r)):O0(z0+JSON.stringify(e)):O0(R0)}function I0(e,t){return{commands:[`clean`,`-${e}`,...t],format:`utf-8`,parser(t){return Jhe(e===`n`,t)}}}function Zhe(e){return Array.isArray(e)&&e.every(e=>V0.has(e))}function Qhe(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,``).split(``).forEach(e=>{$he(e)?(t=e,r.cleanMode=!0):r.options=r.options&&ege(n[n.length]=`-${e}`)}),{cleanMode:t,options:n,valid:r}}function $he(e){return e===`f`||e===`n`}function ege(e){return/^-[a-z]$/i.test(e)&&V0.has(e.charAt(1))}function tge(e){return/^-[^\-]/.test(e)?e.indexOf(`i`)>0:e===`--interactive`}var L0,R0,z0,B0,V0,H0=h1({"src/lib/tasks/clean.ts"(){Yhe(),m0(),P0(),L0=`Git clean interactive mode is not supported`,R0=`Git clean mode parameter ("n" or "f") is required`,z0=`Git clean unknown option found in: `,B0=(e=>(e.DRY_RUN=`n`,e.FORCE=`f`,e.IGNORED_INCLUDED=`x`,e.IGNORED_ONLY=`X`,e.EXCLUDING=`e`,e.QUIET=`q`,e.RECURSIVE=`d`,e))(B0||{}),V0=new Set([`i`,...L1(Object.values(B0))])}});function nge(e){let t=new W0;for(let n of U0(e))t.addValue(n.file,String(n.key),n.value);return t}function rge(e,t){let n=null,r=[],i=new Map;for(let a of U0(e,t))a.key===t&&(r.push(n=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function ige(e){return e.replace(/^(file):/,``)}function*U0(e,t=null){let n=e.split(`\0`);for(let e=0,r=n.length-1;e<r;){let r=ige(n[e++]),i=n[e++],a=t;if(i.includes(`
431
431
  `)){let e=E1(i,`
432
432
  `);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var W0,age=h1({"src/lib/responses/ConfigList.ts"(){m0(),W0=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{}),this._all}addFile(e){if(!(e in this.values)){let t=O1(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function G0(e,t){return typeof e==`string`&&Object.hasOwn(K0,e)?e:t}function oge(e,t,n,r){let i=[`config`,`--${r}`];return n&&i.push(`--add`),i.push(e,t),{commands:i,format:`utf-8`,parser(e){return e}}}function sge(e,t){let n=[`config`,`--null`,`--show-origin`,`--get-all`,e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:`utf-8`,parser(t){return rge(t,e)}}}function cge(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return nge(e)}}}function lge(){return{addConfig(e,t,...n){return this._runTask(oge(e,t,n[0]===!0,G0(n[1],`local`)),u0(arguments))},getConfig(e,t){return this._runTask(sge(e,G0(t,void 0)),u0(arguments))},listConfig(...e){return this._runTask(cge(G0(e[0],void 0)),u0(arguments))}}}var K0,q0=h1({"src/lib/tasks/config.ts"(){age(),m0(),K0=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(K0||{})}});function uge(e){return Y0.has(e)}var J0,Y0,X0=h1({"src/lib/tasks/diff-name-status.ts"(){J0=(e=>(e.ADDED=`A`,e.COPIED=`C`,e.DELETED=`D`,e.MODIFIED=`M`,e.RENAMED=`R`,e.CHANGED=`T`,e.UNMERGED=`U`,e.UNKNOWN=`X`,e.BROKEN=`B`,e))(J0||{}),Y0=new Set(Object.values(J0))}});function dge(...e){return new e2().param(...e)}function fge(e){let t=new Set,n={};return j1(e,e=>{let[r,i,a]=e.split(H1);t.add(r),(n[r]=n[r]||[]).push({line:R1(i),path:r,preview:a})}),{paths:t,results:n}}function pge(){return{grep(e){let t=u0(arguments),n=c0(arguments);for(let e of Z0)if(n.includes(e))return this._runTask(O0(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=dge().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return fge(e)}},t)}}}var Z0,Q0,$0,e2,t2=h1({"src/lib/tasks/grep.ts"(){m0(),P0(),Z0=[`-h`],Q0=Symbol(`grepQuery`),e2=class{constructor(){this[$0]=[]}*[($0=Q0,Symbol.iterator)](){for(let e of this[Q0])yield e}and(...e){return e.length&&this[Q0].push(`--and`,`(`,...z1(e,`-e`),`)`),this}param(...e){return this[Q0].push(...z1(e,`-e`)),this}}}}),n2={};g1(n2,{ResetMode:()=>i2,getResetMode:()=>hge,resetTask:()=>mge});function mge(e,t){let n=[`reset`];return r2(e)&&n.push(`--${e}`),n.push(...t),k0(n)}function hge(e){if(r2(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function r2(e){return typeof e==`string`&&a2.includes(e)}var i2,a2,o2=h1({"src/lib/tasks/reset.ts"(){m0(),P0(),i2=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(i2||{}),a2=L1(Object.values(i2))}});function gge(){return(0,c1.default)(`simple-git`)}function s2(e,t,n){return!t||!String(t).replace(/\s*/,``)?n?(t,...r)=>{e(t,...r),n(t,...r)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function _ge(e,t,{namespace:n}){if(typeof e==`string`)return e;let r=t&&t.namespace||``;return r.startsWith(n)?r.substr(n.length+1):r||n}function c2(e,t,n,r=gge()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=_ge(K1(t,Q1),o,r);return l(n);function c(t,n){return N1(a,c2(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&s2(o,n)||U1,s=s2(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var l2=h1({"src/lib/git-logger.ts"(){m0(),c1.default.formatters.L=e=>String(e0(e)?e.length:`-`),c1.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):W1(e)}}),u2,vge=h1({"src/lib/runners/tasks-pending-queue.ts"(){y1(),l2(),u2=class e{constructor(e=`GitExecutor`){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){let n=e.getName(t.commands[0]);return{task:t,logger:c2(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new v1(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function d2(e,t){return{method:D1(e.commands)||``,commands:t}}function yge(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function f2(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var p2,bge=h1({"src/lib/runners/git-executor-chain.ts"(){y1(),P0(),m0(),vge(),p2=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new u2}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:t}=this._queue.attempt(e);return await(M0(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof v1?Object.assign(t,{task:e}):new v1(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,d2(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...d2(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),j0(e)?d0(e.parser,a):d0(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...d2(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,W1(e)),c(new r0(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(s)))},l);if(u)return r.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,i,s.length,a),l(u);r.info(`retrieving task output complete`),c(new r0(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let a=i.sibling(`output`),o=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},d2(e,e.commands));return new Promise(s=>{let c=[],l=[];i.info(`%s %o`,t,n),i(`%O`,o);let u=this._beforeSpawn(e,n);if(u)return s({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec(`spawn.before`,void 0,{...d2(e,n),kill(e){u=e||u}});let d=Pe(t,n,o);d.stdout.on(`data`,f2(c,`stdOut`,i,a.step(`stdOut`))),d.stderr.on(`data`,f2(l,`stdErr`,i,a.step(`stdErr`))),d.on(`error`,yge(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...d2(e,n),spawned:d,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...d2(e,t),kill(e){n=e||n}}),n}}}}),m2={};g1(m2,{GitExecutor:()=>h2});var h2,xge=h1({"src/lib/runners/git-executor.ts"(){bge(),h2=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new p2(this,this._scheduler,this._plugins)}chain(){return new p2(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function Sge(e,t,n=U1){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof b1?Cge(t):t,void 0)})}function Cge(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=U1};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),n}}var wge=h1({"src/lib/task-callback.ts"(){x1(),m0()}});function g2(e,t){return D0(n=>{if(!M1(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var Tge=h1({"src/lib/tasks/change-working-directory.ts"(){m0(),P0()}});function _2(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=P1(t,`-B`)),k0(t)}function Ege(){return{checkout(){return this._runTask(_2(c0(arguments,1)),u0(arguments))},checkoutBranch(e,t){return this._runTask(_2([`-b`,e,t,...c0(arguments)]),u0(arguments))},checkoutLocalBranch(e){return this._runTask(_2([`-b`,e,...c0(arguments)]),u0(arguments))}}}var Dge=h1({"src/lib/tasks/checkout.ts"(){m0(),P0()}});function Oge(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function kge(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return f0(Oge(),[v2],e)}})}}}var v2,Age=h1({"src/lib/tasks/count-objects.ts"(){m0(),v2=new i0(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=I1(t);Object.hasOwn(e,r)&&(e[r]=R1(n))})}});function jge(e){return f0({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},y2,e)}var y2,Mge=h1({"src/lib/parsers/parse-commit.ts"(){m0(),y2=[new i0(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new i0(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new i0(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new i0(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function Nge(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...z1(e,`-m`),...t,...n],format:`utf-8`,parser:jge}}function Pge(){return{commit(t,...n){let r=u0(arguments),i=e(t)||Nge(F1(t),F1(K1(n[0],$1,[])),[...L1(K1(n[1],X1,[])),...c0(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!$1(e)&&O0(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var Fge=h1({"src/lib/tasks/commit.ts"(){Mge(),m0(),P0()}});function Ige(){return{firstCommit(){return this._runTask(k0([`rev-list`,`--max-parents=0`,`HEAD`],!0),u0(arguments))}}}var Lge=h1({"src/lib/tasks/first-commit.ts"(){m0(),P0()}});function Rge(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),k0(n,!0)}var zge=h1({"src/lib/tasks/hash-object.ts"(){P0()}});function Bge(e,t,n){let r=String(n).trim(),i;if(i=x2.exec(r))return new b2(e,t,!1,i[1]);if(i=S2.exec(r))return new b2(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new b2(e,t,/^re/i.test(r),a)}var b2,x2,S2,Vge=h1({"src/lib/responses/InitSummary.ts"(){b2=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},x2=/^Init.+ repository in (.+)$/,S2=/^Rein.+ in (.+)$/}});function Hge(e){return e.includes(C2)}function Uge(e=!1,t,n){let r=[`init`,...n];return e&&!Hge(r)&&r.splice(1,0,C2),{commands:r,format:`utf-8`,parser(e){return Bge(r.includes(`--bare`),t,e)}}}var C2,Wge=h1({"src/lib/tasks/init.ts"(){Vge(),C2=`--bare`}});function w2(e){for(let t=0;t<e.length;t++){let n=T2.exec(e[t]);if(n)return`--${n[1]}`}return``}function Gge(e){return T2.test(e)}var T2,E2=h1({"src/lib/args/log-format.ts"(){T2=/^--(stat|numstat|name-only|name-status)(=|$)/}}),D2,Kge=h1({"src/lib/responses/DiffSummary.ts"(){D2=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function O2(e=``){let t=N2[e];return e=>f0(new D2,t,e,!1)}var k2,A2,j2,M2,N2,P2=h1({"src/lib/parsers/parse-diff-summary.ts"(){E2(),Kge(),X0(),m0(),k2=[new i0(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:R1(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new i0(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:R1(n),after:R1(r),binary:!0})}),new i0(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=R1(t),e.insertions=R1(r?.[1]),e.deletions=R1(i?.[1])})],A2=[new i0(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=R1(t),a=R1(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new i0(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],j2=[new i0(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],M2=[new i0(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:V1(uge(t)&&t),from:V1(!!a&&r!==a&&r),similarity:R1(n)})})],N2={"":k2,"--stat":k2,"--numstat":A2,"--name-status":M2,"--name-only":j2}}});function qge(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function F2(e=R2,t=z2,n=``){let r=O2(n);return function(n){let i=A1(n.trim(),!1,I2).map(function(n){let i=n.split(L2),a=qge(i[0].split(e),t);return i.length>1&&i[1].trim()&&(a.diff=r(i[1])),a});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var I2,L2,R2,z2,B2=h1({"src/lib/parsers/parse-list-log-summary.ts"(){m0(),P2(),E2(),I2=`òòòòòò `,L2=` òò`,R2=` ò `,z2=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),V2={};g1(V2,{diffSummaryTask:()=>Jge,validateLogFormatConfig:()=>H2});function Jge(e){let t=w2(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),H2(n)||{commands:n,format:`utf-8`,parser:O2(t)}}function H2(e){let t=e.filter(Gge);if(t.length>1)return O0(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return O0(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var U2=h1({"src/lib/tasks/diff.ts"(){E2(),P2(),P0()}});function Yge(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function Xge(e){return Object.keys(e).reduce((t,n)=>(n in G2||(t[n]=e[n]),t),{})}function W2(e={},t=[]){let n=K1(e.splitter,Q1,R2),[r,i]=Yge(J1(e.format)?e.format:{hash:`%H`,date:e.strictDate===!1?`%ai`:`%aI`,message:`%s`,refs:`%D`,body:e.multiLine?`%B`:`%b`,author_name:e.mailMap===!1?`%an`:`%aN`,author_email:e.mailMap===!1?`%ae`:`%aE`},n),a=[],o=[`--pretty=format:${I2}${i}${L2}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return Q1(e.file)&&o.push(`--follow`,o1(e.file)),s0(Xge(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function Zge(e,t,n){let r=F2(e,t,w2(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function Qge(){return{log(...n){let r=u0(arguments),i=W2(l0(arguments),L1(K1(arguments[0],X1,[]))),a=t(...n)||H2(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return Zge(e.splitter,e.fields,e.commands)}function t(e,t){return Q1(e)&&Q1(t)&&O0(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var G2,K2=h1({"src/lib/tasks/log.ts"(){E2(),B2(),m0(),P0(),U2(),G2=(e=>(e[e[`--pretty`]=0]=`--pretty`,e[e[`max-count`]=1]=`max-count`,e[e.maxCount=2]=`maxCount`,e[e.n=3]=`n`,e[e.file=4]=`file`,e[e.format=5]=`format`,e[e.from=6]=`from`,e[e.to=7]=`to`,e[e.splitter=8]=`splitter`,e[e.symmetric=9]=`symmetric`,e[e.mailMap=10]=`mailMap`,e[e.multiLine=11]=`multiLine`,e[e.strictDate=12]=`strictDate`,e))(G2||{})}}),q2,J2,$ge=h1({"src/lib/responses/MergeSummary.ts"(){q2=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},J2=class{constructor(){this.conflicts=[],this.merges=[],this.result=`success`}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(`, `)}`:`OK`}}}}),Y2,X2,e_e=h1({"src/lib/responses/PullSummary.ts"(){Y2=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},X2=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function Z2(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Q2(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:R1(t&&t[1]||`0`),delta:R1(n&&n[1]||`0`)}}var $2,t_e=h1({"src/lib/parsers/parse-remote-objects.ts"(){m0(),$2=[new a0(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Z2(e.remoteMessages);Object.assign(i,{[r]:R1(n)})}),new a0(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Z2(e.remoteMessages);Object.assign(i,{[r]:R1(n)})}),new a0(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=Z2(e.remoteMessages);i.total=Q2(t),i.reused=Q2(n),i.packReused=R1(r)})]}});function e4(e,t){return f0({remoteMessages:new n4},t4,t)}var t4,n4,r4=h1({"src/lib/parsers/parse-remote-messages.ts"(){m0(),t_e(),t4=[new a0(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...$2,new a0([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new a0([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:R1(t),summary:n,url:r}})],n4=class{constructor(){this.all=[]}}}});function n_e(e,t){let n=f0(new X2,c4,[e,t]);return n.message&&n}var i4,a4,o4,s4,c4,l4,u4,d4=h1({"src/lib/parsers/parse-pull.ts"(){e_e(),m0(),r4(),i4=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,a4=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,o4=/^(create|delete) mode \d+ (.+)/,s4=[new i0(i4,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new i0(a4,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new i0(o4,(e,[t,n])=>{N1(e.files,n),N1(t===`create`?e.created:e.deleted,n)})],c4=[new i0(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new i0(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new i0(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],l4=(e,t)=>f0(new Y2,s4,[e,t]),u4=(e,t)=>Object.assign(new Y2,l4(e,t),e4(e,t))}}),f4,p4,m4,r_e=h1({"src/lib/parsers/parse-merge.ts"(){$ge(),m0(),d4(),f4=[new i0(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new i0(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new q2(t,n))}),new i0(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new q2(t,n,{deleteRef:r}))}),new i0(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new q2(t,null))}),new i0(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],p4=(e,t)=>Object.assign(m4(e,t),u4(e,t)),m4=e=>f0(new J2,f4,e)}});function h4(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=p4(e,t);if(n.failed)throw new b1(n);return n}}:O0(`Git.merge requires at least one option`)}var i_e=h1({"src/lib/tasks/merge.ts"(){x1(),r_e(),P0()}});function a_e(e,t,n){let r=n.includes(`deleted`),i=n.includes(`tag`)||/^refs\/tags/.test(e),a=!n.includes(`new`);return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var g4,_4,v4,o_e=h1({"src/lib/parsers/parse-push.ts"(){m0(),r4(),g4=[new i0(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new i0(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new i0(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(a_e(t,n,r))}),new i0(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new i0(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],_4=(e,t)=>{let n=v4(e,t),r=e4(e,t);return{...n,...r}},v4=(e,t)=>f0({pushed:[]},g4,[e,t])}}),y4={};g1(y4,{pushTagsTask:()=>s_e,pushTask:()=>b4});function s_e(e={},t){return N1(t,`--tags`),b4(e,t)}function b4(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),P1(n,`-v`),N1(n,`--verbose`),N1(n,`--porcelain`),{commands:n,format:`utf-8`,parser:_4}}var x4=h1({"src/lib/tasks/push.ts"(){o_e(),m0()}});function c_e(){return{showBuffer(){let e=[`show`,...c0(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(A0(e),u0(arguments))},show(){let e=[`show`,...c0(arguments,1)];return this._runTask(k0(e),u0(arguments))}}}var l_e=h1({"src/lib/tasks/show.ts"(){m0(),P0()}}),S4,C4,u_e=h1({"src/lib/responses/FileStatusSummary.ts"(){S4=/^(.+)\0(.+)$/,C4=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=S4.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function w4(e){let[t,n]=e.split(H1);return{from:n||t,to:t}}function T4(e,t,n){return[`${e}${t}`,n]}function E4(e,...t){return t.map(t=>T4(e,t,(e,t)=>e.conflicted.push(t)))}function d_e(e,t){let n=t.trim();switch(` `){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(` `,n.charAt(0),n.slice(2));default:return}function r(t,n,r){let i=`${t}${n}`,a=O4.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new C4(r,t,n))}}var D4,O4,k4,f_e=h1({"src/lib/responses/StatusSummary.ts"(){m0(),u_e(),D4=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},O4=new Map([T4(` `,`A`,(e,t)=>e.created.push(t)),T4(` `,`D`,(e,t)=>e.deleted.push(t)),T4(` `,`M`,(e,t)=>e.modified.push(t)),T4(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),T4(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),T4(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),T4(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),T4(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),T4(`R`,` `,(e,t)=>{e.renamed.push(w4(t))}),T4(`R`,`M`,(e,t)=>{let n=w4(t);e.renamed.push(n),e.modified.push(n.to)}),T4(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),T4(`?`,`?`,(e,t)=>e.not_added.push(t)),...E4(`A`,`A`,`U`),...E4(`D`,`D`,`U`),...E4(`U`,`A`,`D`,`U`),[`##`,(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,s=n.exec(t);e.ahead=s&&+s[1]||0,s=r.exec(t),e.behind=s&&+s[1]||0,s=i.exec(t),e.current=K1(s?.[1],Q1,null),s=a.exec(t),e.tracking=K1(s?.[1],Q1,null),s=o.exec(t),s&&(e.current=K1(s?.[1],Q1,e.current)),e.detached=/\(no branch\)/.test(t)}]]),k4=function(e){let t=e.split(H1),n=new D4;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=H1+(t[e++]||``)),d_e(n,r))}return n}}});function p_e(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!A4.includes(e))],parser(e){return k4(e)}}}var A4,m_e=h1({"src/lib/tasks/status.ts"(){f_e(),A4=[`--null`,`-z`]}});function j4(e=0,t=0,n=0,r=``,i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},`toString`,{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function h_e(){return j4(0,0,0,``,!1)}function g_e(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:__e,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(M4));r(t)}})}}}function __e(e){return e===M4?h_e():f0(j4(0,0,0,e),N4,e)}var M4,N4,v_e=h1({"src/lib/tasks/version.ts"(){m0(),M4=`installed=false`,N4=[new i0(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,j4(R1(t),R1(n),R1(r),i))}),new i0(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,j4(R1(t),R1(n),r,i))})]}});function P4(e,t,n,...r){return Q1(n)?t(n,K1(r[0],Q1),c0(arguments)):O0(`git.${e}() requires a string 'repoPath'`)}function y_e(){return{clone(e,...t){return this._runTask(P4(`clone`,F4,K1(e,Q1),...t),u0(arguments))},mirror(e,...t){return this._runTask(P4(`mirror`,I4,K1(e,Q1),...t),u0(arguments))}}}var F4,I4,b_e=h1({"src/lib/tasks/clone.ts"(){P0(),m0(),F4=(e,t,n)=>{let r=[`clone`,...n];return Q1(e)&&r.push(o1(e)),Q1(t)&&r.push(o1(t)),k0(r)},I4=(e,t,n)=>(N1(n,`--mirror`),F4(e,t,n))}}),L4={};g1(L4,{SimpleGitApi:()=>R4});var R4,x_e=h1({"src/lib/simple-git-api.ts"(){wge(),Tge(),Dge(),Age(),Fge(),q0(),Lge(),t2(),zge(),Wge(),K2(),i_e(),x4(),l_e(),m_e(),P0(),v_e(),m0(),b_e(),R4=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&Sge(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(k0([`add`,...F1(e)]),u0(arguments))}cwd(e){let t=u0(arguments);return typeof e==`string`?this._runTask(g2(e,this._executor),t):typeof e?.path==`string`?this._runTask(g2(e.path,e.root&&this._executor||void 0),t):this._runTask(O0(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(Rge(e,t===!0),u0(arguments))}init(e){return this._runTask(Uge(e===!0,this._executor.cwd,c0(arguments)),u0(arguments))}merge(){return this._runTask(h4(c0(arguments)),u0(arguments))}mergeFromTo(e,t){return Q1(e)&&Q1(t)?this._runTask(h4([e,t,...c0(arguments)]),u0(arguments,!1)):this._runTask(O0(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=b4({remote:K1(arguments[0],Q1),branch:K1(arguments[1],Q1)},c0(arguments));return this._runTask(e,u0(arguments))}stash(){return this._runTask(k0([`stash`,...c0(arguments)]),u0(arguments))}status(){return this._runTask(p_e(c0(arguments)),u0(arguments))}},Object.assign(R4.prototype,Ege(),y_e(),Pge(),lge(),kge(),Ige(),pge(),Qge(),c_e(),g_e())}}),z4={};g1(z4,{Scheduler:()=>V4});var B4,V4,S_e=h1({"src/lib/runners/scheduler.ts"(){m0(),l2(),B4=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,l1.createDeferred)();return{promise:t,done:n,id:e}}})(),V4=class{constructor(e=2){this.concurrency=e,this.logger=c2(``,`scheduler`),this.pending=[],this.running=[],this.logger(`Constructed, concurrency=%s`,e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`,this.pending.length,this.running.length,this.concurrency);return}let e=N1(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),P1(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=N1(this.pending,B4());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),H4={};g1(H4,{applyPatchTask:()=>C_e});function C_e(e,t){return k0([`apply`,...t,...e])}var w_e=h1({"src/lib/tasks/apply-patch.ts"(){P0()}});function T_e(e,t){return{branch:e,hash:t,success:!0}}function E_e(e){return{branch:e,hash:null,success:!1}}var U4,D_e=h1({"src/lib/responses/BranchDeleteSummary.ts"(){U4=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function W4(e,t){return t===1&&K4.test(e)}var G4,K4,q4,J4,O_e=h1({"src/lib/parsers/parse-branch-delete.ts"(){D_e(),m0(),G4=/(\S+)\s+\(\S+\s([^)]+)\)/,K4=/^error[^']+'([^']+)'/m,q4=[new i0(G4,(e,[t,n])=>{let r=T_e(t,n);e.all.push(r),e.branches[t]=r}),new i0(K4,(e,[t])=>{let n=E_e(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],J4=(e,t)=>f0(new U4,q4,[e,t])}}),Y4,k_e=h1({"src/lib/responses/BranchSummary.ts"(){Y4=class{constructor(){this.all=[],this.branches={},this.current=``,this.detached=!1}push(e,t,n,r,i){e===`*`&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e===`*`,linkedWorkTree:e===`+`,name:n,commit:r,label:i}}}}});function X4(e){return e?e.charAt(0):``}function Z4(e,t=!1){return f0(new Y4,t?[$4]:Q4,e)}var Q4,$4,A_e=h1({"src/lib/parsers/parse-branch.ts"(){k_e(),m0(),Q4=[new i0(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(X4(t),!0,n,r,i)}),new i0(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(X4(t),!1,n,r,i)})],$4=new i0(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),e3={};g1(e3,{branchLocalTask:()=>M_e,branchTask:()=>j_e,containsDeleteBranchCommand:()=>t3,deleteBranchTask:()=>P_e,deleteBranchesTask:()=>N_e});function t3(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function j_e(e){let t=t3(e),n=e.includes(`--show-current`),r=[`branch`,...e];return r.length===1&&r.push(`-a`),r.includes(`-v`)||r.splice(1,0,`-v`),{format:`utf-8`,commands:r,parser(e,r){return t?J4(e,r).all[0]:Z4(e,n)}}}function M_e(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return Z4(e)}}}function N_e(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return J4(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!W4(String(n),e))return i(n);r(t)}}}function P_e(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return J4(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!W4(String(i),e))return o(i);throw new b1(n.parser(B1(r),B1(t)),String(i))}};return n}var F_e=h1({"src/lib/tasks/branch.ts"(){x1(),O_e(),A_e(),m0()}});function I_e(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&he(t)}var n3,L_e=h1({"src/lib/responses/CheckIgnore.ts"(){n3=e=>e.split(/\n/g).map(I_e).filter(Boolean)}}),r3={};g1(r3,{checkIgnoreTask:()=>R_e});function R_e(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:n3}}var z_e=h1({"src/lib/tasks/check-ignore.ts"(){L_e()}});function B_e(e,t){return f0({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},i3,[e,t])}var i3,V_e=h1({"src/lib/parsers/parse-fetch.ts"(){m0(),i3=[new i0(/From (.+)$/,(e,[t])=>{e.remote=t}),new i0(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new i0(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new i0(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new i0(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),a3={};g1(a3,{fetchTask:()=>U_e});function H_e(e){return/^--upload-pack(=|$)/.test(e)}function U_e(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(H_e)?O0(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:B_e}}var W_e=h1({"src/lib/tasks/fetch.ts"(){V_e(),P0()}});function G_e(e){return f0({moves:[]},o3,e)}var o3,K_e=h1({"src/lib/parsers/parse-move.ts"(){m0(),o3=[new i0(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),s3={};g1(s3,{moveTask:()=>q_e});function q_e(e,t){return{commands:[`mv`,`-v`,...F1(e),t],format:`utf-8`,parser:G_e}}var J_e=h1({"src/lib/tasks/move.ts"(){K_e(),m0()}}),c3={};g1(c3,{pullTask:()=>Y_e});function Y_e(e,t,n){let r=[`pull`,...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:`utf-8`,parser(e,t){return u4(e,t)},onError(e,t,n,r){let i=n_e(B1(e.stdOut),B1(e.stdErr));if(i)return r(new b1(i));r(t)}}}var X_e=h1({"src/lib/tasks/pull.ts"(){x1(),d4(),m0()}});function Z_e(e){let t={};return l3(e,([e])=>t[e]={name:e}),Object.values(t)}function Q_e(e){let t={};return l3(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:``,push:``}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,``)]=n)}),Object.values(t)}function l3(e,t){j1(e,e=>t(e.split(/\s+/)))}var $_e=h1({"src/lib/responses/GetRemoteSummary.ts"(){m0()}}),u3={};g1(u3,{addRemoteTask:()=>eve,getRemotesTask:()=>tve,listRemotesTask:()=>nve,remoteTask:()=>rve,removeRemoteTask:()=>ive});function eve(e,t,n){return k0([`remote`,`add`,...n,e,t])}function tve(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?Q_e:Z_e}}function nve(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),k0(t)}function rve(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),k0(t)}function ive(e){return k0([`remote`,`remove`,e])}var ave=h1({"src/lib/tasks/remote.ts"(){$_e(),P0()}}),d3={};g1(d3,{stashListTask:()=>ove});function ove(e={},t){let n=W2(e),r=[`stash`,`list`,...n.commands,...t],i=F2(n.splitter,n.fields,w2(r));return H2(r)||{commands:r,format:`utf-8`,parser:i}}var sve=h1({"src/lib/tasks/stash-list.ts"(){E2(),B2(),U2(),K2()}}),f3={};g1(f3,{addSubModuleTask:()=>cve,initSubModuleTask:()=>lve,subModuleTask:()=>p3,updateSubModuleTask:()=>uve});function cve(e,t){return p3([`add`,e,t])}function lve(e){return p3([`init`,...e])}function p3(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),k0(t)}function uve(e){return p3([`update`,...e])}var dve=h1({"src/lib/tasks/sub-module.ts"(){P0()}});function fve(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?m3(e,t):0:n?1:-1}function m3(e,t){return e===t?0:e>t?1:-1}function pve(e){return e.trim()}function h3(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var g3,_3,mve=h1({"src/lib/responses/TagList.ts"(){g3=class{constructor(e,t){this.all=e,this.latest=t}},_3=function(e,t=!1){let n=e.split(`
433
- `).map(pve).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return fve(h3(n[0]),h3(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=m3(h3(n[e]),h3(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new g3(n,r)}}}),v3={};g1(v3,{addAnnotatedTagTask:()=>_ve,addTagTask:()=>gve,tagListTask:()=>hve});function hve(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return _3(e,t)}}}function gve(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function _ve(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var vve=h1({"src/lib/tasks/tag.ts"(){mve()}}),yve=Mhe({"src/git.js"(e,t){var{GitExecutor:n}=(xge(),_1(m2)),{SimpleGitApi:r}=(x_e(),_1(L4)),{Scheduler:i}=(S_e(),_1(z4)),{adhocExecTask:a,configurationErrorTask:o}=(P0(),_1(E0)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(m0(),_1(p0)),{applyPatchTask:g}=(w_e(),_1(H4)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:y,deleteBranchTask:b}=(F_e(),_1(e3)),{checkIgnoreTask:x}=(z_e(),_1(r3)),{checkIsRepoTask:S}=(x0(),_1(h0)),{cleanWithOptionsTask:C,isCleanOptionsArray:w}=(H0(),_1(F0)),{diffSummaryTask:T}=(U2(),_1(V2)),{fetchTask:E}=(W_e(),_1(a3)),{moveTask:D}=(J_e(),_1(s3)),{pullTask:ee}=(X_e(),_1(c3)),{pushTagsTask:te}=(x4(),_1(y4)),{addRemoteTask:ne,getRemotesTask:re,listRemotesTask:ie,remoteTask:ae,removeRemoteTask:oe}=(ave(),_1(u3)),{getResetMode:O,resetTask:se}=(o2(),_1(n2)),{stashListTask:k}=(sve(),_1(d3)),{addSubModuleTask:ce,initSubModuleTask:le,subModuleTask:ue,updateSubModuleTask:A}=(dve(),_1(f3)),{addAnnotatedTagTask:j,addTagTask:de,tagListTask:fe}=(vve(),_1(v3)),{straightThroughBufferTask:pe,straightThroughStringTask:me}=(P0(),_1(E0));function M(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(M.prototype=Object.create(r.prototype)).constructor=M,M.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},M.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},M.prototype.stashList=function(e){return this._runTask(k(h(arguments)||{},c(e)&&e||[]),m(arguments))},M.prototype.mv=function(e,t){return this._runTask(D(e,t),m(arguments))},M.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},M.prototype.pull=function(e,t,n,r){return this._runTask(ee(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.fetch=function(e,t){return this._runTask(E(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},M.prototype.tags=function(e,t){return this._runTask(fe(p(arguments)),m(arguments))},M.prototype.rebase=function(){return this._runTask(me([`rebase`,...p(arguments)]),m(arguments))},M.prototype.reset=function(e){return this._runTask(se(O(e),p(arguments)),m(arguments))},M.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(me([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},M.prototype.addTag=function(e){let t=typeof e==`string`?de(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},M.prototype.addAnnotatedTag=function(e,t){return this._runTask(j(e,t),m(arguments))},M.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(b(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(y(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.branch=function(e,t){return this._runTask(_(p(arguments)),m(arguments))},M.prototype.branchLocal=function(e){return this._runTask(v(),m(arguments))},M.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(me(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},M.prototype.submoduleAdd=function(e,t,n){return this._runTask(ce(e,t),m(arguments))},M.prototype.submoduleUpdate=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},M.prototype.submoduleInit=function(e,t){return this._runTask(le(p(arguments,!0)),m(arguments))},M.prototype.subModule=function(e,t){return this._runTask(ue(p(arguments)),m(arguments))},M.prototype.listRemote=function(){return this._runTask(ie(p(arguments)),m(arguments))},M.prototype.addRemote=function(e,t,n){return this._runTask(ne(e,t,p(arguments)),m(arguments))},M.prototype.removeRemote=function(e,t){return this._runTask(oe(e),m(arguments))},M.prototype.getRemotes=function(e,t){return this._runTask(re(e===!0),m(arguments))},M.prototype.remote=function(e,t){return this._runTask(ae(p(arguments)),m(arguments))},M.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(me(n),m(arguments))},M.prototype.updateServerInfo=function(e){return this._runTask(me([`update-server-info`]),m(arguments))},M.prototype.pushTags=function(e,t){let n=te({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},M.prototype.rm=function(e){return this._runTask(me([`rm`,`-f`,...s(e)]),m(arguments))},M.prototype.rmKeepLocal=function(e){return this._runTask(me([`rm`,`--cached`,...s(e)]),m(arguments))},M.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},M.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},M.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?pe(r):me(r);return this._runTask(a,n)},M.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):me([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},M.prototype.diffSummary=function(){return this._runTask(T(p(arguments,1)),m(arguments))},M.prototype.applyPatch=function(e){let t=d(e)?g(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},M.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(me(e,!0),m(arguments))},M.prototype.clean=function(e,t,n){let r=w(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(C(i,a),m(arguments))},M.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},M.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},M.prototype.checkIgnore=function(e,t){return this._runTask(x(s(f(e,d,[]))),m(arguments))},M.prototype.checkIsRepo=function(e,t){return this._runTask(S(f(e,u)),m(arguments))},t.exports=M}});y1(),y1(),y1(),x1(),C1(),x0(),H0(),q0(),X0(),t2(),o2(),m0(),m0(),(0,l1.deferred)().promise,m0(),y1(),m0(),m0(),m0(),m0(),yve(),x1(),e1(`checkpoint-chain`);function y3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function bve(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}e1(`shadow-lock`),e1(`shadow-op-gate`),e1(`shadow-repo`),(()=>{let e=process.env.OK_GIT_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})(),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_GC_TIMEOUT_MS;if(!e)return 6e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:6e5})(),jX.fileSystem,jX.gitUpstream,jX.service,jX.generator,e1(`bridge-loss-detector`),e1(`checkpoint`);function b3(e){let t=me(e).toLowerCase();return El.includes(t)}function xve(e){let t=e.toLowerCase();for(let n of El)if(t.endsWith(n))return e.slice(0,-n.length);return e}function Sve(e){return e===`__system__`}const Cve=new Set(Sl);function wve(e){return Cve.has(e)}function Tve(e){return wl(e)}function Eve(e){return Sve(e)||wve(e)||Tve(e)}e1(`parse-pool`),Math.max(1,Math.min(4,ae()-1)),t1(()=>{}),e1(`bridge-watchdog`),t1(()=>{}),e1(`server-observers`),e1(`server-observers`),e1(`agent-sessions`),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Fe(s);const Dve=Qa({source:F(),pluginProvider:F().optional(),skill:F().optional(),ref:F().optional(),contentHash:F(),files:z(F()).optional(),localHash:F().optional(),baselineRef:F().optional(),publisher:F().optional(),importedAt:aa(),autoUpdate:L().optional()});Qa({schema:U(1),skills:V(F(),Dve).default({})}),new Set(Object.values(Hl)),new Set([...new Set([`.git`,`node_modules`]),`scripts`,`references`]);const x3=[`agents`,`claude`,`cursor`,`codex`,`opencode`,`pi`,`copilot`];var Ove=i(((e,t)=>{t.exports=n;function n(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}n.prototype.go=function(e){this.pending<this.max?i(this,e):this.waiting.push(e)},n.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)},n.prototype.hold=function(){return r(this)};function r(e){e.pending+=1;var t=!1;return n;function n(n){if(t)throw Error(`callback called twice`);if(t=!0,e.error=e.error||n,--e.pending,e.waiting.length>0&&e.pending<e.max)i(e,e.waiting.shift());else if(e.pending===0){var a=e.listeners;e.listeners=[],a.forEach(r)}}function r(t){t(e.error)}}function i(e,t){t(r(e))}})),kve=i((e=>{var n=t(`fs`),r=t(`util`),i=t(`stream`),a=i.Readable,o=i.PassThrough,s=Ove(),c=t(`events`).EventEmitter;e.BufferSlicer=d,e.FdSlicer=l,r.inherits(l,c);function l(e){c.call(this),this.fd=e,this.pend=new s,this.pend.max=1,this.refCount=0}l.prototype.read=function(e,t,r,i,a){var o=this;o.pend.go(function(s){n.read(o.fd,e,t,r,i,function(e,t,n){s(),a(e,t,n)})})},l.prototype.createReadStream=function(e){return new u(this,e)},l.prototype.ref=function(){this.refCount+=1},l.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount<0)throw Error(`invalid unref`);if(e.refCount>0)return;n.close(e.fd,t);function t(t){t?e.emit(`error`,t):e.emit(`close`)}},r.inherits(u,a);function u(e,t){t||={},a.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start}u.prototype._read=function(e){var t=this,r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.push(null),this._cleanup();return}t.context.pend.go(function(e){var i=Buffer.allocUnsafe(r);n.read(t.context.fd,i,0,r,t.pos,function(n,r){n?t.destroy(n):r===0?(t.push(null),t._cleanup()):(t.pos+=r,t.push(i.slice(0,r))),e()})})},u.prototype._destroy=function(e,t){this._cleanup(),t(e)},u.prototype._cleanup=function(){this.context!=null&&(this.context.unref(),this.context=null)},r.inherits(d,c);function d(e){c.call(this),this.refCount=0,this.buffer=e}d.prototype.read=function(e,t,n,r,i){if(!(0<=t&&t<=e.length))throw RangeError(`offset outside buffer: 0 <= `+t+` <= `+e.length);if(r<0)throw RangeError(`position is negative: `+r);if(t+n>e.length&&(n=e.length-t),r+n>this.buffer.length&&(n=this.buffer.length-r),n<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(e,t,r,r+n),setImmediate(function(){i(null,n)})},d.prototype.createReadStream=function(e){e||={};var t=new o(e);t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=65536,i=0;;){var a=i+r;if(a>=n.length){i<n.length&&t.write(n.slice(i,n.length));break}t.write(n.slice(i,a)),i=a}return t.end(),t},d.prototype.ref=function(){this.refCount+=1},d.prototype.unref=function(){if(--this.refCount,this.refCount<0)throw Error(`invalid unref`)}})),Ave=i(((e,t)=>{let n=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function r(e){let t=-1;for(let r of e)t=n[(t^r)&255]^t>>>8;return(t^-1)>>>0}t.exports=r}));i((e=>{t(`fs`);var n=t(`zlib`);kve();var r=t(`util`),i=t(`events`).EventEmitter,a=t(`stream`).Transform,o=t(`stream`).PassThrough,s=t(`stream`).Writable;let c=typeof n.crc32==`function`?n.crc32:Ave();r.inherits(l,i);function l(e,t,n,r,a,o,s,c,l,u){var f=this;i.call(f),f.reader=e,f.reader.on(`error`,function(e){d(f,e)}),f.reader.once(`close`,function(){f.emit(`close`)}),f.readEntryCursor=t,f.fileSize=n,f.entryCount=r,f.comment=a,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!c,f.validateEntrySizes=!!l,f.strictFileNames=!!u,f.isOpen=!0,f.emittedError=!1,f.hasEachEntryBeenCalled=!1,f.lazyEntries||f._readEntry()}l.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function u(e,t){e.autoClose&&e.close(),d(e,t)}function d(e,t){e.emittedError||(e.emittedError=!0,e.emit(`error`,t))}l.prototype.readEntry=function(){if(!this.lazyEntries)throw Error(`readEntry() called without lazyEntries:true`);this._readEntry()},l.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit(`end`)});return}if(!e.emittedError){var t=T(46);v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){var r=new f,i=t.readUInt32LE(0);if(i!==33639248)return u(e,Error(`invalid central directory file header signature: 0x`+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),r.generalPurposeBitFlag&64)return u(e,Error(`strong encryption is not supported`));e.readEntryCursor+=46,t=T(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){r.fileNameRaw=t.subarray(0,r.fileNameLength);var i=r.fileNameLength+r.extraFieldLength;r.extraFieldRaw=t.subarray(r.fileNameLength,i),r.fileCommentRaw=t.subarray(i,i+r.fileCommentLength);try{r.extraFields=_(r.extraFieldRaw)}catch(t){return u(e,t)}if(e.decodeStrings){var a=(r.generalPurposeBitFlag&2048)!=0;r.fileComment=C(r.fileCommentRaw,a),r.fileName=h(r.generalPurposeBitFlag,r.fileNameRaw,r.extraFields,e.strictFileNames);var o=g(r.fileName);if(o!=null)return u(e,Error(o))}else r.fileComment=r.fileCommentRaw,r.fileName=r.fileNameRaw;r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1;for(var s=0;s<r.extraFields.length;s++){var c=r.extraFields[s];if(c.id===1){var l=c.data,d=0;if(r.uncompressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include uncompressed size`));r.uncompressedSize=w(l,d),d+=8}if(r.compressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include compressed size`));r.compressedSize=w(l,d),d+=8}if(r.relativeOffsetOfLocalHeader===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include relative header offset`));r.relativeOffsetOfLocalHeader=w(l,d),d+=8}break}}if(e.validateEntrySizes&&r.compressionMethod===0){var f=r.uncompressedSize;if(r.isEncrypted()&&(f+=12),r.compressedSize!==f){var p=`compressed/uncompressed size mismatch for stored file: `+r.compressedSize+` != `+r.uncompressedSize;return u(e,Error(p))}}e.emit(`entry`,r),e.lazyEntries||e._readEntry()}})}})}},l.prototype.eachEntry=function(){let e=this;if(!e.lazyEntries)throw Error(`eachEntry() requires lazyEntries: true`);if(e.hasEachEntryBeenCalled)throw Error(`eachEntry() must only be called once per ZipFile`);e.hasEachEntryBeenCalled=!0;let t=null;e.on(`entry`,r),e.on(`end`,i),e.on(`error`,a);function n(){e.removeListener(`entry`,r),e.removeListener(`end`,i),e.removeListener(`error`,a),e.autoClose&&e.close()}function r(e){let{resolve:n}=t;t=null,n({value:e})}function i(){let{resolve:e}=t;t=null,n(),e({done:!0})}function a(e){let{reject:r}=t;t=null,n(),r(e)}return{[Symbol.asyncIterator](){return this},next(){let n=new Promise((e,n)=>{if(t!=null)throw Error(`next() called before previous Promise was resolved.`);t={resolve:e,reject:n}});return e.readEntry(),n},return(e){return n(),Promise.resolve({done:!0,value:e})},throw(e){return n(),Promise.reject(e)}}},l.prototype.openReadStream=function(e,t,n){var r=this,i=0,a=e.compressedSize;if(n??(n=t,t=null),t==null)t={};else{if(t.decodeFileData===!1){if(t.decrypt!=null)throw Error(`cannot use options.decrypt when options.decodeFileData === false`);if(t.decompress!=null)throw Error(`cannot use options.decompress when options.decodeFileData === false`)}else{if(t.decrypt!=null){if(!e.isEncrypted())throw Error(`options.decrypt can only be specified for encrypted entries. See also option decodeFileData.`);if(t.decrypt!==!1)throw Error(`invalid options.decrypt value: `+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw Error(`entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.`)}if(t.decompress!=null){if(!e.isCompressed())throw Error(`options.decompress can only be specified for compressed entries. See also option decodeFileData.`);if(!(t.decompress===!1||t.decompress===!0))throw Error(`invalid options.decompress value: `+t.decompress);s=t.decompress}}if(t.start!=null){if(i=t.start,i<0)throw Error(`options.start < 0`);if(i>e.compressedSize)throw Error(`options.start > entry.compressedSize`)}if(t.end!=null){if(a=t.end,a<0)throw Error(`options.end < 0`);if(a>e.compressedSize)throw Error(`options.end > entry.compressedSize`);if(a<i)throw Error(`options.end < options.start`)}}var o=t.decodeFileData===!1||(e.compressionMethod===0||e.compressionMethod===8&&t.decompress===!1)&&(!e.isEncrypted()||t.decrypt===!1);if((t.start!=null||t.end!=null)&&!o)throw Error(`start/end range require options.decodeFileData === false for non-trivial encoded entries.`);if(!r.isOpen)return n(Error(`closed`));if(e.isEncrypted()&&!o&&t.decrypt!==!1)return n(Error(`entry is encrypted, and options.decodeFileData !== false`));var s;if(o)s=!1;else if(e.compressionMethod===8)s=t.decodeFileData!==!0;else return n(Error(`unsupported compression method: `+e.compressionMethod));r.readLocalFileHeader(e,{minimal:!0},function(t,o){if(t)return n(t);r.openReadStreamLowLevel(o.fileDataStart,e.compressedSize,i,a,s,e.uncompressedSize,n)})},l.prototype.openReadStreamLowLevel=function(e,t,r,i,a,o,s){var c=this;e+t;var l=c.reader.createReadStream({start:e+r,end:e+i}),u=l;if(a){var d=!1,f=n.createInflateRaw();l.on(`error`,function(e){setImmediate(function(){d||f.emit(`error`,e)})}),l.pipe(f),c.validateEntrySizes?(u=new y(o),f.on(`error`,function(e){setImmediate(function(){d||u.emit(`error`,e)})}),f.pipe(u)):u=f,E(u,function(){d=!0,f!==u&&f.unpipe(u),l.unpipe(f),l.destroy()})}s(null,u)},l.prototype.readLocalFileHeader=function(e,t,n){var r=this;n??(n=t,t=null),t??={},r.reader.ref();var i=T(30);v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader,function(a){try{if(a)return n(a);var o=i.readUInt32LE(0);if(o!==67324752)return n(Error(`invalid local file header signature: 0x`+o.toString(16)));var s=i.readUInt16LE(26),c=i.readUInt16LE(28),l=e.relativeOffsetOfLocalHeader+30+s+c;if(l+e.compressedSize>r.fileSize)return n(Error(`file data overflows file bounds: `+l+` + `+e.compressedSize+` > `+r.fileSize));if(t.minimal)return n(null,{fileDataStart:l});var u=new p;u.fileDataStart=l,u.versionNeededToExtract=i.readUInt16LE(4),u.generalPurposeBitFlag=i.readUInt16LE(6),u.compressionMethod=i.readUInt16LE(8),u.lastModFileTime=i.readUInt16LE(10),u.lastModFileDate=i.readUInt16LE(12),u.crc32=i.readUInt32LE(14),u.compressedSize=i.readUInt32LE(18),u.uncompressedSize=i.readUInt32LE(22),u.fileNameLength=s,u.extraFieldLength=c,i=T(s+c),r.reader.ref(),v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader+30,function(e){try{return e?n(e):(u.fileName=i.subarray(0,s),u.extraField=i.subarray(s),n(null,u))}finally{r.reader.unref()}})}finally{r.reader.unref()}})},l.prototype.openReadStreamPromise=function(e,t){return new Promise((n,r)=>{this.openReadStream(e,t,function(e,t){if(e)return r(e);n(t)})})},l.prototype.openReadStreamLowLevelPromise=function(e,t,n,r,i,a){return new Promise((o,s)=>{this.openReadStream(e,t,n,r,i,a,function(e,t){if(e)return s(e);o(t)})})},l.prototype.readLocalFileHeaderPromise=function(e,t){return new Promise((n,r)=>{this.readLocalFileHeader(e,t,function(e,t){if(e)return r(e);n(t)})})};function f(){}f.prototype.getLastModDate=function(e){if(e??={},!e.forceDosFormat)for(var t=0;t<this.extraFields.length;t++){var n=this.extraFields[t];if(n.id===21589){var r=n.data;if(r.length<5||!(r[0]&1))continue;var i=r.readInt32LE(1);return new Date(i*1e3)}else if(n.id===10){var r=n.data;if(r.length!==32||r.readUInt16LE(4)!==1||r.readUInt16LE(6)!==24)continue;var a=(r.readUInt32LE(8)+4294967296*r.readInt32LE(12))/1e4-0xa9730b66800;return new Date(a)}}return m(this.lastModFileDate,this.lastModFileTime,e.timezone)},f.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(this.compressionMethod===0||this.compressionMethod===8)},f.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!=0},f.prototype.isCompressed=function(){return this.compressionMethod===8};function p(){}function m(e,t,n){var r=e&31,i=(e>>5&15)-1,a=(e>>9&127)+1980,o=0,s=(t&31)*2,c=t>>5&63,l=t>>11&31;if(n==null||n===`local`)return new Date(a,i,r,l,c,s,o);if(n===`UTC`)return new Date(Date.UTC(a,i,r,l,c,s,o));throw Error(`unrecognized options.timezone: `+options.timezone)}function h(e,t,n,r){for(var i=null,a=0;a<n.length;a++){var o=n[a];if(o.id===28789){if(o.data.length<6||o.data.readUInt8(0)!==1)continue;var s=o.data.readUInt32LE(1);if(c(t)!==s)continue;i=C(o.data.subarray(5),!0);break}}return i??=C(t,(e&2048)!=0),r||(i=i.replace(/\\/g,`/`)),i}function g(e){return e.indexOf(`\\`)===-1?/^[a-zA-Z]:/.test(e)||/^\//.test(e)?`absolute path: `+e:e.split(`/`).indexOf(`..`)===-1?null:`invalid relative path: `+e:`invalid characters in fileName: `+e}function _(e){for(var t=[],n=0;n<e.length-3;){var r=e.readUInt16LE(n+0),i=e.readUInt16LE(n+2),a=n+4,o=a+i;if(o>e.length)throw Error(`extra field length exceeds extra field buffer size`);var s=e.subarray(a,o);t.push({id:r,data:s}),n=o}return t}function v(e,t,n,r,i,a){if(r===0)return setImmediate(function(){a(null,T(0))});e.read(t,n,r,i,function(e,t){if(e)return a(e);if(t<r)return a(Error(`unexpected EOF`));a()})}r.inherits(y,a);function y(e){a.call(this),this.actualByteCount=0,this.expectedByteCount=e}y.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r=`too many bytes in the stream. expected `+this.expectedByteCount+`. got at least `+this.actualByteCount;return n(Error(r))}n(null,e)},y.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t=`not enough bytes in the stream. expected `+this.expectedByteCount+`. got only `+this.actualByteCount;return e(Error(t))}e()},r.inherits(b,i);function b(){i.call(this),this.refCount=0}b.prototype.ref=function(){this.refCount+=1},b.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount>0)return;if(e.refCount<0)throw Error(`invalid unref`);e.close(t);function t(t){if(t)return e.emit(`error`,t);e.emit(`close`)}},b.prototype.createReadStream=function(e){e??={};var t=e.start,n=e.end;if(t===n){var r=new o;return setImmediate(function(){r.end()}),r}var i=this._readStreamForRange(t,n),a=!1,s=new x(this);i.on(`error`,function(e){setImmediate(function(){a||s.emit(`error`,e)})}),E(s,function(){i.unpipe(s),s.unref(),i.destroy()});var c=new y(n-t);return s.on(`error`,function(e){setImmediate(function(){a||c.emit(`error`,e)})}),E(c,function(){a=!0,s.unpipe(c),s.destroy()}),i.pipe(s).pipe(c)},b.prototype._readStreamForRange=function(e,t){throw Error(`not implemented`)},b.prototype.read=function(e,t,n,r,i){var a=this.createReadStream({start:r,end:r+n}),o=new s,c=0;o._write=function(n,r,i){n.copy(e,t+c,0,n.length),c+=n.length,i()},o.on(`finish`,i),a.on(`error`,function(e){i(e)}),a.pipe(o)},b.prototype.close=function(e){setImmediate(e)},r.inherits(x,o);function x(e){o.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}x.prototype._flush=function(e){this.unref(),e()},x.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var S=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function C(e,t){if(t)return e.toString(`utf8`);for(var n=``,r=0;r<e.length;r++)n+=S[e[r]];return n}function w(e,t){var n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n}var T=typeof Buffer.allocUnsafe==`function`?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};function E(e,t){typeof e.destroy==`function`?e._destroy=function(e,n){t(),n?.(e)}:e.destroy=t}}))(),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})});const S3={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...S3,propertyKey:F().min(1).optional(),propertyPath:z(eo([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const C3=Ca();no(`action`,[B({action:U(`edit`),id:C3,body:F(),summary:F().optional()}),B({action:U(`resolve`),id:C3,summary:F().optional()}),B({action:U(`reopen`),id:C3,summary:F().optional()}),B({action:U(`replace`),id:C3,...S3,summary:F().optional()}),B({action:U(`queue`),id:C3,summary:F().optional()}),B({action:U(`unqueue`),id:C3,summary:F().optional()}),B({action:U(`dispatch-prepare`),id:C3,summary:F().optional()}),B({action:U(`dispatch-complete`),id:C3,summary:F().optional()}),B({action:U(`dispatch-prepare-batch`),ids:z(C3).min(1).max(200),summary:F().optional()}),B({action:U(`dispatch-complete-batch`),ids:z(C3).min(1).max(200),summary:F().optional()})]);const w3="Absolute host path inside the target OpenKnowledge project. Required when the MCP server is registered globally (e.g. `npx @inkeep/open-knowledge mcp` once at the host level, routing per call), unless the MCP client advertises exactly one root via the `roots` capability — that single root is then used as the implicit `cwd`. Optional when the server is anchored to a single project (the per-project HTTP MCP server defaults to its configured project root).";F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const jve=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),Mve=z(V(F(),R()));V(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(PJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),jve.optional(),z(MJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const Nve=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function T3(e){return{text:Nve,...e}}new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),Il.cursor,Il.codex,Il[`claude-desktop`],e1(`embeddings`),e1(`embeddings`);function Pve(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}Pve(is),e1(`embeddings`),e1(`embeddings`);const Fve=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,Ive=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,E3=String.raw`([^\]\n]*)`,D3=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,O3=e=>RegExp(`(!?)${Fve}`,e),k3=(e,t)=>RegExp(`(!?)\\[${e}\\]${Ive}`,t);O3(`y`),O3(`g`),k3(E3,`y`),k3(D3,`y`),k3(E3,`g`),k3(D3,`g`);const Lve=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp(Lve,`y`);function A3(e){return e.replace(/\\/g,`/`)}function j3(e){return{...e,windowsHide:!0}}B({target:H(Object.keys({"claude-cowork":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},"claude-code":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},codex:{type:`app-bundle`,appName:`Codex`,urlScheme:`codex:`,probeScheme:`codex`,quitFirst:!0},cursor:{type:`cli-binary`,binaryName:`cursor`,urlScheme:`cursor:`}})),url:F().min(1).max(4096),workspacePath:F().optional()}),B({}).loose(),e1(`installed-skills-marker`);var M3=e(i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?T.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ee=e=>new D(e);if(ee.isPathValid=e=>T(e&&T.convert(e),e,p),ee.default=ee,t.exports=ee,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}}))(),1);const N3=e1(`content-filter`);Fe(s);const P3=[`.claude`,`.cursor`,`.codex`,`.agents`,`.opencode`,`.pi`],F3=new Set([`node_modules`,`.venv`,`venv`,`env`,`__pycache__`,`vendor`,`dist`,`build`,`out`,`output`,`.next`,`.nuxt`,`.svelte-kit`,`.astro`,`.turbo`,`.cache`,`.parcel-cache`,`coverage`,`.git`,`.ok`,`.open-knowledge`,`.openknowledge`,...P3,`Library`,`Applications`,`.Trash`]),Rve=new Set([`.git`,`node_modules`,`.ok`,`.open-knowledge`,`.openknowledge`,...P3]),I3=new Set([`worktrees`,`local`]);function L3(e){let t=us(e);if(!ds(t))throw Error(`Invalid attachment folder path`);if(t===`./`)return{kind:`sibling`};if(t===`/`||t===`.`)return{kind:`content-root`};let n=t.startsWith(`./`),r=(n?t.slice(2):t).split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`);return r===``?n?{kind:`sibling`}:{kind:`content-root`}:{kind:n?`doc-relative`:`fixed`,path:r}}function zve(e){throw Error(`[AttachmentFolderShape] unhandled variant: ${JSON.stringify(e)}`)}function Bve(e,t,n){let r=me(e).slice(1).toLowerCase();if(!Vo.has(r)||t.kind===`sibling`)return!1;let i=e.lastIndexOf(`/`),a=i===-1?``:e.slice(0,i);if(t.kind===`content-root`)return a===``;if(t.kind===`fixed`)return a===t.path||a.startsWith(`${t.path}/`);if(t.kind===`doc-relative`){let e=a===``?[]:a.split(`/`),r=t.path.split(`/`);for(let t=0;t<=e.length-r.length;t++)if(r.every((n,r)=>e[t+r]===n)&&n(e.slice(0,t).join(`/`)))return!0;return!1}return zve(t)}function R3(e,t){let n=e.split(`/`);for(let e=0;e<n.length;e++){let r=n[e],i=r.toLowerCase()===`.ok`?`.ok`:r;if(Rve.has(i)&&!(t&&i===`.ok`&&!I3.has((n[e+1]??``).toLowerCase())))return!0}return!1}function z3(e){return e.startsWith(`${Tl}/`)}function Vve(e){return e===`.ok`||e===`.ok/skills`||e.startsWith(`.ok/skills/`)}const B3=new Set([`.ok`,...P3]),Hve=new Set([...F3].filter(e=>!B3.has(e))),Uve=[`.git`,`node_modules`,`.ok/local`,`.ok/worktrees`].flatMap(e=>[e,`${e}/**`,`**/${e}`,`**/${e}/**`]);function Wve(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);return t.includes(`..`)?!1:t.some(e=>Hve.has(e))?!0:t.some((e,n)=>e.toLowerCase()===`.ok`&&I3.has((t[n+1]??``).toLowerCase()))}const Gve=[`.gitignore`,`.ok`,`.ok/config.yml`,`.ok/.gitignore`,`.ok/schemas/frontmatter.json`,`.ok/templates/example.md`,`.ok/skills/example/SKILL.md`,`docs/.ok`,`docs/.ok/frontmatter.yml`,`docs/.ok/templates/example.md`,...P3.flatMap(e=>[e,`${e}/skills/example/SKILL.md`])];function Kve(e){let t=e.trim();if(!t||t.startsWith(`!`)||t.startsWith(`#`))return!1;let n=t.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);if(n.includes(`..`))return!0;if(Wve(t))return!1;if(n.some(e=>B3.has(e)))return!0;try{let e=(0,M3.default)().add(t);return Gve.some(t=>e.ignores(t))}catch{return!0}}function qve(e){let t=e.filter(e=>e.length>0&&!e.startsWith(`!`)&&!e.startsWith(`#`)&&!Kve(e));return[...new Set([...t,...Uve])]}function V3(e,t){for(let n=0;n<t;n++)if(F3.has(e[n])||e[n].toLowerCase()===`.ok`)return!0;return!1}function H3(e){let t=e.split(`/`),n=t.length;return n<3||t[n-3]!==`.ok`||t[n-2]!==`templates`||me(t[n-1])!==`.md`?!1:!V3(t,n-3)}function U3(e){let t=e.split(`/`),n=t.length;return t[n-1]===`.ok`?!V3(t,n-1):n>=2&&t[n-1]===`templates`&&t[n-2]===`.ok`?!V3(t,n-2):!1}function Jve(e){let t=e.split(`/`),n=t.length;return t[0]===`.ok`&&(n===2&&(t[1]===`config.yml`||t[1]===`.gitignore`)||n===3&&t[1]===`schemas`&&t[2].toLowerCase().endsWith(`.json`))||H3(e)?!0:n>=2&&t[n-1]===`frontmatter.yml`&&t[n-2]===`.ok`?!V3(t,n-2):!1}function Yve(e){return e===`.ok`||e===`.ok/schemas`?!0:U3(e)}function Xve(e,t){for(let n of t)if(e===n||e.startsWith(`${n}/`))return!0;return!1}function W3(e,t){if(t.size===0)return!1;for(let n of t)if(e.startsWith(`${n}/`))return!0;return!1}function Zve(e,t){if(t.size===0)return!1;for(let n of t)if(n===e||n.startsWith(`${e}/`)||e.startsWith(`${n}/`))return!0;return!1}const Qve=new Set([`.DS_Store`,`.localized`]);function G3(e){return Qve.has(e.slice(e.lastIndexOf(`/`)+1))}const $ve=new Set([`.ssh`,`.aws`,`.gnupg`,`.kube`,`.docker`]);function K3(e){for(let t of e.split(`/`))if($ve.has(t.toLowerCase()))return!0;return!1}const eye=new Set([`credentials`,`.netrc`,`.npmrc`,`.pgpass`,`.git-credentials`]),tye=[`.pem`,`.key`,`.p12`,`.pfx`,`.keystore`,`.jks`,`.ppk`];function q3(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();if(t===`.env`||t.startsWith(`.env.`)||eye.has(t)||t.startsWith(`id_rsa`)||t.startsWith(`id_ed25519`)||t.startsWith(`id_ecdsa`)||t.startsWith(`id_dsa`))return!0;for(let e of tye)if(t.endsWith(e))return!0;return!1}function nye(e,t){return t===e||t.startsWith(`${e}/`)}const J3=[`.gitignore`,`.okignore`];function rye(e,t){let n=iye(e);if(n===null)return[];let r=[];Y3(N(n,`info`,`exclude`),t,r,`info/exclude`);let i=aye(e);return i&&Y3(i,t,r,`global excludesfile`),r}function iye(e){let t=u(`git`,[`rev-parse`,`--git-common-dir`],j3({cwd:e,encoding:`utf-8`,timeout:5e3}));return t.status!==0||!t.stdout?null:ve(e,t.stdout.trim())}function aye(e){let t=u(`git`,[`config`,`--get`,`--type=path`,`core.excludesfile`],j3({cwd:e,encoding:`utf-8`,timeout:5e3}));if(t.status===0&&t.stdout){let e=t.stdout.trim();if(e)return e}return oye()}function oye(){let e=process.env.XDG_CONFIG_HOME?.trim();return N(e&&e.length>0?e:N(O(),`.config`),`git`,`ignore`)}function Y3(e,t,n,r){if(g(e))try{let r=S(e,`utf-8`);t.value+=r.length,n.push(...Z3(r))}catch(t){N3.warn({path:e,err:t},`Failed to read ${r} at ${e}`)}}function sye(e){let{projectDir:t,contentDir:n,onAfterRebuild:r,singleDocRelPath:i}=e,a=e.inPlaceSkillDirs??new Set,o=L3(e.attachmentFolderPath??`./`),s=e.skillRootPaths??new Set,c=A3(_e(t,n)),l=c.startsWith(`..`),u,d,f,p,m=0,h=0,_=0;function v(){let e=(0,M3.default)(),r=(0,M3.default)();e.add(`.git`);let i=[],a=0,o=0;for(let n of J3){let o=N(t,n);if(g(o))try{let t=S(o,`utf-8`);a+=t.length;let s=Z3(t);i.push(...s),e.add(s),n===`.okignore`&&r.add(s)}catch(e){N3.warn({path:o,err:e},`Failed to read ${n} at ${o}`)}}if(c&&!l)for(let t of J3){let i=N(n,t);if(g(i))try{let n=S(i,`utf-8`);a+=n.length,o++;let s=Z3(n).map(e=>Q3(e,c));e.add(s),t===`.okignore`&&r.add(s)}catch(e){N3.warn({path:i,err:e},`Failed to read ${t} at ${i}`)}}let s={value:a};o+=$3(n,t,e,r,s),a=s.value;let v=rye(t,s);a=s.value,v.length>0&&(i.push(...v),e.add(v));let y=qve(i);return u=e,d=r,f=i,p=y,m=i.length,h=o,_=a,{patternCount:m,nestedFileCount:h,bytes:_}}v();let y=new Map;function b(e,t){if(l&&t?.pathBase!==`project`)return!1;let n=t?.pathBase===`project`||!c?e:`${c}/${e}`;return n.startsWith(`..`)?!1:u.ignores(n)}function x(e,t){return t.pathBase===`project`||!c?e:`${c}/${e}`}function C(e){if(l)return!1;let t=c?`${c}/${e}`:e;return d.ignores(t)}let w=()=>{i===void 0&&X3(n,``,b,y)};w();function T(e){return Eve(xve(e))}function E(e){for(let t of e.split(`/`))if(F3.has(t))return!0;return l?!1:b(e)}return{isExcluded(e,t){if(T(e)||q3(e)||K3(e)||!t?.bypassFilters&&Xve(e,s)&&!W3(e,a))return!0;if(!t?.bypassFilters&&(z3(e)||W3(e,a)&&!b(e))){if(i!==void 0)return e!==i;if(b3(e))return!1;let t=me(e).slice(1).toLowerCase();return!Vo.has(t)}if(!t?.bypassFilters&&H3(e)||!t?.bypassFilters&&t?.syncScope!==void 0&&Jve(x(e,t.syncScope))&&!b(e,t.syncScope))return i===void 0?!1:e!==i;if(R3(e,t?.showOk)||G3(e))return!0;if(i!==void 0)return e!==i;if(t?.bypassFilters)return t.respectOkignore===!0&&C(e);if(E(e))return!0;if(b3(e)||Bve(e,o,e=>(y.get(e)??0)>0))return!1;let n=me(e).slice(1).toLowerCase();if(Vo.has(n)){let t=pe(e),n=t===`.`?``:t;if((y.get(n)??0)>0)return!1}return!0},isDirExcluded(e,t){if(K3(e))return!0;if(!t?.bypassFilters&&(Vve(e)||U3(e)||t?.syncScope!==void 0&&Yve(x(e,t.syncScope))||Zve(e,a)))return!1;if(R3(e,t?.showOk))return!0;if(i!==void 0)return!nye(e,i);if(t?.bypassFilters)return t.respectOkignore===!0&&(C(e)||C(`${e}/`));for(let t of e.split(`/`))if(F3.has(t))return!0;return l?!1:b(e,t?.syncScope)||b(`${e}/`,t?.syncScope)},isPathIgnored(e,t){return T(e)||q3(e)||K3(e)?!0:z3(e)||W3(e,a)&&!b(e)||H3(e)?!1:R3(e)||G3(e)?!0:t?.bypassFilters?!1:E(e)},getWatcherIgnoreGlobs(){return p},incrementMdDir(e){let t=e===`.`?``:e;y.set(t,(y.get(t)??0)+1)},decrementMdDir(e){let t=e===`.`?``:e,n=y.get(t)??0;n<=1?y.delete(t):y.set(t,n-1)},rebuildDirCount(){let e=new Map(y);y.clear();try{w()}catch(t){for(let[t,n]of e)y.set(t,n);N3.warn({err:t instanceof Error?t:Error(String(t))},`content-filter rebuildDirCount walk failed — retaining previous counts`)}},setAttachmentFolderPath(e){o=L3(e)},async rebuildIgnorePatterns(){if(e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){N3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}let t=u,n=d,i=f,o=p,s=m,c=h,l=_,g=Date.now();return She(`config.ignore.rebuild`,{attributes:{}},async e=>{try{let t=v();y.clear(),w();let n=Date.now()-g;if(e.setAttributes({"ok.ignore.pattern_count":t.patternCount,"ok.ignore.nested_file_count":t.nestedFileCount,"ok.ignore.bytes":t.bytes}),N3.info({patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n},`content-filter rebuild succeeded`),r)try{r()}catch(e){N3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter onAfterRebuild callback threw — derived views may be stale`)}return{ok:!0,patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n}}catch(e){u=t,d=n,f=i,p=o,m=s,h=c,_=l,y.clear();try{w()}catch(e){N3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter rollback dirCount re-walk failed — sibling-asset counts may be stale until next rebuild`)}let r=e instanceof Error?e.message:String(e);return N3.warn({err:e instanceof Error?e:Error(r)},`content-filter rebuild failed — rolled back to previous state`),{ok:!1,error:{message:r}}}})}}}function X3(e,t,n,r){let i;try{i=C(e,{withFileTypes:!0})}catch(t){N3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);return}for(let a of i){let i=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){if(F3.has(a.name)||n(i)||n(`${i}/`))continue;X3(N(e,a.name),i,n,r)}else a.isFile()&&b3(a.name)&&!n(i)&&r.set(t,(r.get(t)??0)+1)}}function Z3(e){return e.split(`
433
+ `).map(pve).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return fve(h3(n[0]),h3(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=m3(h3(n[e]),h3(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new g3(n,r)}}}),v3={};g1(v3,{addAnnotatedTagTask:()=>_ve,addTagTask:()=>gve,tagListTask:()=>hve});function hve(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return _3(e,t)}}}function gve(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function _ve(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var vve=h1({"src/lib/tasks/tag.ts"(){mve()}}),yve=Mhe({"src/git.js"(e,t){var{GitExecutor:n}=(xge(),_1(m2)),{SimpleGitApi:r}=(x_e(),_1(L4)),{Scheduler:i}=(S_e(),_1(z4)),{adhocExecTask:a,configurationErrorTask:o}=(P0(),_1(E0)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(m0(),_1(p0)),{applyPatchTask:g}=(w_e(),_1(H4)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:y,deleteBranchTask:b}=(F_e(),_1(e3)),{checkIgnoreTask:x}=(z_e(),_1(r3)),{checkIsRepoTask:S}=(x0(),_1(h0)),{cleanWithOptionsTask:C,isCleanOptionsArray:w}=(H0(),_1(F0)),{diffSummaryTask:T}=(U2(),_1(V2)),{fetchTask:E}=(W_e(),_1(a3)),{moveTask:D}=(J_e(),_1(s3)),{pullTask:ee}=(X_e(),_1(c3)),{pushTagsTask:te}=(x4(),_1(y4)),{addRemoteTask:ne,getRemotesTask:re,listRemotesTask:ie,remoteTask:ae,removeRemoteTask:oe}=(ave(),_1(u3)),{getResetMode:O,resetTask:se}=(o2(),_1(n2)),{stashListTask:k}=(sve(),_1(d3)),{addSubModuleTask:ce,initSubModuleTask:le,subModuleTask:ue,updateSubModuleTask:A}=(dve(),_1(f3)),{addAnnotatedTagTask:j,addTagTask:de,tagListTask:fe}=(vve(),_1(v3)),{straightThroughBufferTask:pe,straightThroughStringTask:me}=(P0(),_1(E0));function M(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(M.prototype=Object.create(r.prototype)).constructor=M,M.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},M.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},M.prototype.stashList=function(e){return this._runTask(k(h(arguments)||{},c(e)&&e||[]),m(arguments))},M.prototype.mv=function(e,t){return this._runTask(D(e,t),m(arguments))},M.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},M.prototype.pull=function(e,t,n,r){return this._runTask(ee(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.fetch=function(e,t){return this._runTask(E(f(e,u),f(t,u),p(arguments)),m(arguments))},M.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},M.prototype.tags=function(e,t){return this._runTask(fe(p(arguments)),m(arguments))},M.prototype.rebase=function(){return this._runTask(me([`rebase`,...p(arguments)]),m(arguments))},M.prototype.reset=function(e){return this._runTask(se(O(e),p(arguments)),m(arguments))},M.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(me([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},M.prototype.addTag=function(e){let t=typeof e==`string`?de(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},M.prototype.addAnnotatedTag=function(e,t){return this._runTask(j(e,t),m(arguments))},M.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(b(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(y(e,typeof t==`boolean`?t:!1),m(arguments))},M.prototype.branch=function(e,t){return this._runTask(_(p(arguments)),m(arguments))},M.prototype.branchLocal=function(e){return this._runTask(v(),m(arguments))},M.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(me(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},M.prototype.submoduleAdd=function(e,t,n){return this._runTask(ce(e,t),m(arguments))},M.prototype.submoduleUpdate=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},M.prototype.submoduleInit=function(e,t){return this._runTask(le(p(arguments,!0)),m(arguments))},M.prototype.subModule=function(e,t){return this._runTask(ue(p(arguments)),m(arguments))},M.prototype.listRemote=function(){return this._runTask(ie(p(arguments)),m(arguments))},M.prototype.addRemote=function(e,t,n){return this._runTask(ne(e,t,p(arguments)),m(arguments))},M.prototype.removeRemote=function(e,t){return this._runTask(oe(e),m(arguments))},M.prototype.getRemotes=function(e,t){return this._runTask(re(e===!0),m(arguments))},M.prototype.remote=function(e,t){return this._runTask(ae(p(arguments)),m(arguments))},M.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(me(n),m(arguments))},M.prototype.updateServerInfo=function(e){return this._runTask(me([`update-server-info`]),m(arguments))},M.prototype.pushTags=function(e,t){let n=te({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},M.prototype.rm=function(e){return this._runTask(me([`rm`,`-f`,...s(e)]),m(arguments))},M.prototype.rmKeepLocal=function(e){return this._runTask(me([`rm`,`--cached`,...s(e)]),m(arguments))},M.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},M.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},M.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?pe(r):me(r);return this._runTask(a,n)},M.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):me([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},M.prototype.diffSummary=function(){return this._runTask(T(p(arguments,1)),m(arguments))},M.prototype.applyPatch=function(e){let t=d(e)?g(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},M.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(me(e,!0),m(arguments))},M.prototype.clean=function(e,t,n){let r=w(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(C(i,a),m(arguments))},M.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},M.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},M.prototype.checkIgnore=function(e,t){return this._runTask(x(s(f(e,d,[]))),m(arguments))},M.prototype.checkIsRepo=function(e,t){return this._runTask(S(f(e,u)),m(arguments))},t.exports=M}});y1(),y1(),y1(),x1(),C1(),x0(),H0(),q0(),X0(),t2(),o2(),m0(),m0(),(0,l1.deferred)().promise,m0(),y1(),m0(),m0(),m0(),m0(),yve(),x1(),e1(`checkpoint-chain`);function y3(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function bve(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}e1(`shadow-lock`),e1(`shadow-op-gate`),e1(`shadow-repo`),(()=>{let e=process.env.OK_GIT_TIMEOUT_MS;if(!e)return 3e4;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:3e4})(),(()=>{let e=process.env.OK_SHADOW_MAINTENANCE_GC_TIMEOUT_MS;if(!e)return 6e5;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:6e5})(),jX.fileSystem,jX.gitUpstream,jX.service,jX.generator,e1(`bridge-loss-detector`),e1(`checkpoint`);function b3(e){let t=me(e).toLowerCase();return El.includes(t)}function xve(e){let t=e.toLowerCase();for(let n of El)if(t.endsWith(n))return e.slice(0,-n.length);return e}function Sve(e){return e===`__system__`}const Cve=new Set(Sl);function wve(e){return Cve.has(e)}function Tve(e){return wl(e)}function Eve(e){return Sve(e)||wve(e)||Tve(e)}e1(`parse-pool`),Math.max(1,Math.min(4,ae()-1)),t1(()=>{}),e1(`bridge-watchdog`),t1(()=>{}),e1(`server-observers`),e1(`server-observers`),e1(`agent-sessions`);function Dve(){try{let e=ve(pe(Se(import.meta.url)),`..`,`package.json`),t=JSON.parse(S(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}Dve(),RegExp(`^(?:${`do you mind.i would like you to.i'd like you to.i want you to.i need you to.i would like to.i'd like to.i want to.i need to.we need to.we want to.we should.go ahead and.take a look at.have a look at.look into.look at.help me with.help me to.help me.can you.could you.would you.will you.can we.could we.should we.let's.lets.try to.please.kindly.hello.alright.actually.anyway.also.okay.hey.hi.yo.ok.so.pls.plz.just.maybe`.split(`.`).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})\\b(?:[\\s,:;!.\\-–—]+|$)`,`i`),Fe(s);const Ove=Qa({source:F(),pluginProvider:F().optional(),skill:F().optional(),ref:F().optional(),contentHash:F(),files:z(F()).optional(),localHash:F().optional(),baselineRef:F().optional(),publisher:F().optional(),importedAt:aa(),autoUpdate:L().optional()});Qa({schema:U(1),skills:V(F(),Ove).default({})}),new Set(Object.values(Hl)),new Set([...new Set([`.git`,`node_modules`]),`scripts`,`references`]);const x3=[`agents`,`claude`,`cursor`,`codex`,`opencode`,`pi`,`copilot`];var kve=i(((e,t)=>{t.exports=n;function n(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}n.prototype.go=function(e){this.pending<this.max?i(this,e):this.waiting.push(e)},n.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)},n.prototype.hold=function(){return r(this)};function r(e){e.pending+=1;var t=!1;return n;function n(n){if(t)throw Error(`callback called twice`);if(t=!0,e.error=e.error||n,--e.pending,e.waiting.length>0&&e.pending<e.max)i(e,e.waiting.shift());else if(e.pending===0){var a=e.listeners;e.listeners=[],a.forEach(r)}}function r(t){t(e.error)}}function i(e,t){t(r(e))}})),Ave=i((e=>{var n=t(`fs`),r=t(`util`),i=t(`stream`),a=i.Readable,o=i.PassThrough,s=kve(),c=t(`events`).EventEmitter;e.BufferSlicer=d,e.FdSlicer=l,r.inherits(l,c);function l(e){c.call(this),this.fd=e,this.pend=new s,this.pend.max=1,this.refCount=0}l.prototype.read=function(e,t,r,i,a){var o=this;o.pend.go(function(s){n.read(o.fd,e,t,r,i,function(e,t,n){s(),a(e,t,n)})})},l.prototype.createReadStream=function(e){return new u(this,e)},l.prototype.ref=function(){this.refCount+=1},l.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount<0)throw Error(`invalid unref`);if(e.refCount>0)return;n.close(e.fd,t);function t(t){t?e.emit(`error`,t):e.emit(`close`)}},r.inherits(u,a);function u(e,t){t||={},a.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start}u.prototype._read=function(e){var t=this,r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.push(null),this._cleanup();return}t.context.pend.go(function(e){var i=Buffer.allocUnsafe(r);n.read(t.context.fd,i,0,r,t.pos,function(n,r){n?t.destroy(n):r===0?(t.push(null),t._cleanup()):(t.pos+=r,t.push(i.slice(0,r))),e()})})},u.prototype._destroy=function(e,t){this._cleanup(),t(e)},u.prototype._cleanup=function(){this.context!=null&&(this.context.unref(),this.context=null)},r.inherits(d,c);function d(e){c.call(this),this.refCount=0,this.buffer=e}d.prototype.read=function(e,t,n,r,i){if(!(0<=t&&t<=e.length))throw RangeError(`offset outside buffer: 0 <= `+t+` <= `+e.length);if(r<0)throw RangeError(`position is negative: `+r);if(t+n>e.length&&(n=e.length-t),r+n>this.buffer.length&&(n=this.buffer.length-r),n<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(e,t,r,r+n),setImmediate(function(){i(null,n)})},d.prototype.createReadStream=function(e){e||={};var t=new o(e);t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=65536,i=0;;){var a=i+r;if(a>=n.length){i<n.length&&t.write(n.slice(i,n.length));break}t.write(n.slice(i,a)),i=a}return t.end(),t},d.prototype.ref=function(){this.refCount+=1},d.prototype.unref=function(){if(--this.refCount,this.refCount<0)throw Error(`invalid unref`)}})),jve=i(((e,t)=>{let n=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function r(e){let t=-1;for(let r of e)t=n[(t^r)&255]^t>>>8;return(t^-1)>>>0}t.exports=r}));i((e=>{t(`fs`);var n=t(`zlib`);Ave();var r=t(`util`),i=t(`events`).EventEmitter,a=t(`stream`).Transform,o=t(`stream`).PassThrough,s=t(`stream`).Writable;let c=typeof n.crc32==`function`?n.crc32:jve();r.inherits(l,i);function l(e,t,n,r,a,o,s,c,l,u){var f=this;i.call(f),f.reader=e,f.reader.on(`error`,function(e){d(f,e)}),f.reader.once(`close`,function(){f.emit(`close`)}),f.readEntryCursor=t,f.fileSize=n,f.entryCount=r,f.comment=a,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!c,f.validateEntrySizes=!!l,f.strictFileNames=!!u,f.isOpen=!0,f.emittedError=!1,f.hasEachEntryBeenCalled=!1,f.lazyEntries||f._readEntry()}l.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function u(e,t){e.autoClose&&e.close(),d(e,t)}function d(e,t){e.emittedError||(e.emittedError=!0,e.emit(`error`,t))}l.prototype.readEntry=function(){if(!this.lazyEntries)throw Error(`readEntry() called without lazyEntries:true`);this._readEntry()},l.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit(`end`)});return}if(!e.emittedError){var t=T(46);v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){var r=new f,i=t.readUInt32LE(0);if(i!==33639248)return u(e,Error(`invalid central directory file header signature: 0x`+i.toString(16)));if(r.versionMadeBy=t.readUInt16LE(4),r.versionNeededToExtract=t.readUInt16LE(6),r.generalPurposeBitFlag=t.readUInt16LE(8),r.compressionMethod=t.readUInt16LE(10),r.lastModFileTime=t.readUInt16LE(12),r.lastModFileDate=t.readUInt16LE(14),r.crc32=t.readUInt32LE(16),r.compressedSize=t.readUInt32LE(20),r.uncompressedSize=t.readUInt32LE(24),r.fileNameLength=t.readUInt16LE(28),r.extraFieldLength=t.readUInt16LE(30),r.fileCommentLength=t.readUInt16LE(32),r.internalFileAttributes=t.readUInt16LE(36),r.externalFileAttributes=t.readUInt32LE(38),r.relativeOffsetOfLocalHeader=t.readUInt32LE(42),r.generalPurposeBitFlag&64)return u(e,Error(`strong encryption is not supported`));e.readEntryCursor+=46,t=T(r.fileNameLength+r.extraFieldLength+r.fileCommentLength),v(e.reader,t,0,t.length,e.readEntryCursor,function(n){if(n)return u(e,n);if(!e.emittedError){r.fileNameRaw=t.subarray(0,r.fileNameLength);var i=r.fileNameLength+r.extraFieldLength;r.extraFieldRaw=t.subarray(r.fileNameLength,i),r.fileCommentRaw=t.subarray(i,i+r.fileCommentLength);try{r.extraFields=_(r.extraFieldRaw)}catch(t){return u(e,t)}if(e.decodeStrings){var a=(r.generalPurposeBitFlag&2048)!=0;r.fileComment=C(r.fileCommentRaw,a),r.fileName=h(r.generalPurposeBitFlag,r.fileNameRaw,r.extraFields,e.strictFileNames);var o=g(r.fileName);if(o!=null)return u(e,Error(o))}else r.fileComment=r.fileCommentRaw,r.fileName=r.fileNameRaw;r.comment=r.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1;for(var s=0;s<r.extraFields.length;s++){var c=r.extraFields[s];if(c.id===1){var l=c.data,d=0;if(r.uncompressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include uncompressed size`));r.uncompressedSize=w(l,d),d+=8}if(r.compressedSize===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include compressed size`));r.compressedSize=w(l,d),d+=8}if(r.relativeOffsetOfLocalHeader===4294967295){if(d+8>l.length)return u(e,Error(`zip64 extended information extra field does not include relative header offset`));r.relativeOffsetOfLocalHeader=w(l,d),d+=8}break}}if(e.validateEntrySizes&&r.compressionMethod===0){var f=r.uncompressedSize;if(r.isEncrypted()&&(f+=12),r.compressedSize!==f){var p=`compressed/uncompressed size mismatch for stored file: `+r.compressedSize+` != `+r.uncompressedSize;return u(e,Error(p))}}e.emit(`entry`,r),e.lazyEntries||e._readEntry()}})}})}},l.prototype.eachEntry=function(){let e=this;if(!e.lazyEntries)throw Error(`eachEntry() requires lazyEntries: true`);if(e.hasEachEntryBeenCalled)throw Error(`eachEntry() must only be called once per ZipFile`);e.hasEachEntryBeenCalled=!0;let t=null;e.on(`entry`,r),e.on(`end`,i),e.on(`error`,a);function n(){e.removeListener(`entry`,r),e.removeListener(`end`,i),e.removeListener(`error`,a),e.autoClose&&e.close()}function r(e){let{resolve:n}=t;t=null,n({value:e})}function i(){let{resolve:e}=t;t=null,n(),e({done:!0})}function a(e){let{reject:r}=t;t=null,n(),r(e)}return{[Symbol.asyncIterator](){return this},next(){let n=new Promise((e,n)=>{if(t!=null)throw Error(`next() called before previous Promise was resolved.`);t={resolve:e,reject:n}});return e.readEntry(),n},return(e){return n(),Promise.resolve({done:!0,value:e})},throw(e){return n(),Promise.reject(e)}}},l.prototype.openReadStream=function(e,t,n){var r=this,i=0,a=e.compressedSize;if(n??(n=t,t=null),t==null)t={};else{if(t.decodeFileData===!1){if(t.decrypt!=null)throw Error(`cannot use options.decrypt when options.decodeFileData === false`);if(t.decompress!=null)throw Error(`cannot use options.decompress when options.decodeFileData === false`)}else{if(t.decrypt!=null){if(!e.isEncrypted())throw Error(`options.decrypt can only be specified for encrypted entries. See also option decodeFileData.`);if(t.decrypt!==!1)throw Error(`invalid options.decrypt value: `+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw Error(`entry is encrypted and compressed, and options.decompress !== false. See also option decodeFileData.`)}if(t.decompress!=null){if(!e.isCompressed())throw Error(`options.decompress can only be specified for compressed entries. See also option decodeFileData.`);if(!(t.decompress===!1||t.decompress===!0))throw Error(`invalid options.decompress value: `+t.decompress);s=t.decompress}}if(t.start!=null){if(i=t.start,i<0)throw Error(`options.start < 0`);if(i>e.compressedSize)throw Error(`options.start > entry.compressedSize`)}if(t.end!=null){if(a=t.end,a<0)throw Error(`options.end < 0`);if(a>e.compressedSize)throw Error(`options.end > entry.compressedSize`);if(a<i)throw Error(`options.end < options.start`)}}var o=t.decodeFileData===!1||(e.compressionMethod===0||e.compressionMethod===8&&t.decompress===!1)&&(!e.isEncrypted()||t.decrypt===!1);if((t.start!=null||t.end!=null)&&!o)throw Error(`start/end range require options.decodeFileData === false for non-trivial encoded entries.`);if(!r.isOpen)return n(Error(`closed`));if(e.isEncrypted()&&!o&&t.decrypt!==!1)return n(Error(`entry is encrypted, and options.decodeFileData !== false`));var s;if(o)s=!1;else if(e.compressionMethod===8)s=t.decodeFileData!==!0;else return n(Error(`unsupported compression method: `+e.compressionMethod));r.readLocalFileHeader(e,{minimal:!0},function(t,o){if(t)return n(t);r.openReadStreamLowLevel(o.fileDataStart,e.compressedSize,i,a,s,e.uncompressedSize,n)})},l.prototype.openReadStreamLowLevel=function(e,t,r,i,a,o,s){var c=this;e+t;var l=c.reader.createReadStream({start:e+r,end:e+i}),u=l;if(a){var d=!1,f=n.createInflateRaw();l.on(`error`,function(e){setImmediate(function(){d||f.emit(`error`,e)})}),l.pipe(f),c.validateEntrySizes?(u=new y(o),f.on(`error`,function(e){setImmediate(function(){d||u.emit(`error`,e)})}),f.pipe(u)):u=f,E(u,function(){d=!0,f!==u&&f.unpipe(u),l.unpipe(f),l.destroy()})}s(null,u)},l.prototype.readLocalFileHeader=function(e,t,n){var r=this;n??(n=t,t=null),t??={},r.reader.ref();var i=T(30);v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader,function(a){try{if(a)return n(a);var o=i.readUInt32LE(0);if(o!==67324752)return n(Error(`invalid local file header signature: 0x`+o.toString(16)));var s=i.readUInt16LE(26),c=i.readUInt16LE(28),l=e.relativeOffsetOfLocalHeader+30+s+c;if(l+e.compressedSize>r.fileSize)return n(Error(`file data overflows file bounds: `+l+` + `+e.compressedSize+` > `+r.fileSize));if(t.minimal)return n(null,{fileDataStart:l});var u=new p;u.fileDataStart=l,u.versionNeededToExtract=i.readUInt16LE(4),u.generalPurposeBitFlag=i.readUInt16LE(6),u.compressionMethod=i.readUInt16LE(8),u.lastModFileTime=i.readUInt16LE(10),u.lastModFileDate=i.readUInt16LE(12),u.crc32=i.readUInt32LE(14),u.compressedSize=i.readUInt32LE(18),u.uncompressedSize=i.readUInt32LE(22),u.fileNameLength=s,u.extraFieldLength=c,i=T(s+c),r.reader.ref(),v(r.reader,i,0,i.length,e.relativeOffsetOfLocalHeader+30,function(e){try{return e?n(e):(u.fileName=i.subarray(0,s),u.extraField=i.subarray(s),n(null,u))}finally{r.reader.unref()}})}finally{r.reader.unref()}})},l.prototype.openReadStreamPromise=function(e,t){return new Promise((n,r)=>{this.openReadStream(e,t,function(e,t){if(e)return r(e);n(t)})})},l.prototype.openReadStreamLowLevelPromise=function(e,t,n,r,i,a){return new Promise((o,s)=>{this.openReadStream(e,t,n,r,i,a,function(e,t){if(e)return s(e);o(t)})})},l.prototype.readLocalFileHeaderPromise=function(e,t){return new Promise((n,r)=>{this.readLocalFileHeader(e,t,function(e,t){if(e)return r(e);n(t)})})};function f(){}f.prototype.getLastModDate=function(e){if(e??={},!e.forceDosFormat)for(var t=0;t<this.extraFields.length;t++){var n=this.extraFields[t];if(n.id===21589){var r=n.data;if(r.length<5||!(r[0]&1))continue;var i=r.readInt32LE(1);return new Date(i*1e3)}else if(n.id===10){var r=n.data;if(r.length!==32||r.readUInt16LE(4)!==1||r.readUInt16LE(6)!==24)continue;var a=(r.readUInt32LE(8)+4294967296*r.readInt32LE(12))/1e4-0xa9730b66800;return new Date(a)}}return m(this.lastModFileDate,this.lastModFileTime,e.timezone)},f.prototype.canDecodeFileData=function(){return!this.isEncrypted()&&(this.compressionMethod===0||this.compressionMethod===8)},f.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!=0},f.prototype.isCompressed=function(){return this.compressionMethod===8};function p(){}function m(e,t,n){var r=e&31,i=(e>>5&15)-1,a=(e>>9&127)+1980,o=0,s=(t&31)*2,c=t>>5&63,l=t>>11&31;if(n==null||n===`local`)return new Date(a,i,r,l,c,s,o);if(n===`UTC`)return new Date(Date.UTC(a,i,r,l,c,s,o));throw Error(`unrecognized options.timezone: `+options.timezone)}function h(e,t,n,r){for(var i=null,a=0;a<n.length;a++){var o=n[a];if(o.id===28789){if(o.data.length<6||o.data.readUInt8(0)!==1)continue;var s=o.data.readUInt32LE(1);if(c(t)!==s)continue;i=C(o.data.subarray(5),!0);break}}return i??=C(t,(e&2048)!=0),r||(i=i.replace(/\\/g,`/`)),i}function g(e){return e.indexOf(`\\`)===-1?/^[a-zA-Z]:/.test(e)||/^\//.test(e)?`absolute path: `+e:e.split(`/`).indexOf(`..`)===-1?null:`invalid relative path: `+e:`invalid characters in fileName: `+e}function _(e){for(var t=[],n=0;n<e.length-3;){var r=e.readUInt16LE(n+0),i=e.readUInt16LE(n+2),a=n+4,o=a+i;if(o>e.length)throw Error(`extra field length exceeds extra field buffer size`);var s=e.subarray(a,o);t.push({id:r,data:s}),n=o}return t}function v(e,t,n,r,i,a){if(r===0)return setImmediate(function(){a(null,T(0))});e.read(t,n,r,i,function(e,t){if(e)return a(e);if(t<r)return a(Error(`unexpected EOF`));a()})}r.inherits(y,a);function y(e){a.call(this),this.actualByteCount=0,this.expectedByteCount=e}y.prototype._transform=function(e,t,n){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var r=`too many bytes in the stream. expected `+this.expectedByteCount+`. got at least `+this.actualByteCount;return n(Error(r))}n(null,e)},y.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t=`not enough bytes in the stream. expected `+this.expectedByteCount+`. got only `+this.actualByteCount;return e(Error(t))}e()},r.inherits(b,i);function b(){i.call(this),this.refCount=0}b.prototype.ref=function(){this.refCount+=1},b.prototype.unref=function(){var e=this;if(--e.refCount,e.refCount>0)return;if(e.refCount<0)throw Error(`invalid unref`);e.close(t);function t(t){if(t)return e.emit(`error`,t);e.emit(`close`)}},b.prototype.createReadStream=function(e){e??={};var t=e.start,n=e.end;if(t===n){var r=new o;return setImmediate(function(){r.end()}),r}var i=this._readStreamForRange(t,n),a=!1,s=new x(this);i.on(`error`,function(e){setImmediate(function(){a||s.emit(`error`,e)})}),E(s,function(){i.unpipe(s),s.unref(),i.destroy()});var c=new y(n-t);return s.on(`error`,function(e){setImmediate(function(){a||c.emit(`error`,e)})}),E(c,function(){a=!0,s.unpipe(c),s.destroy()}),i.pipe(s).pipe(c)},b.prototype._readStreamForRange=function(e,t){throw Error(`not implemented`)},b.prototype.read=function(e,t,n,r,i){var a=this.createReadStream({start:r,end:r+n}),o=new s,c=0;o._write=function(n,r,i){n.copy(e,t+c,0,n.length),c+=n.length,i()},o.on(`finish`,i),a.on(`error`,function(e){i(e)}),a.pipe(o)},b.prototype.close=function(e){setImmediate(e)},r.inherits(x,o);function x(e){o.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}x.prototype._flush=function(e){this.unref(),e()},x.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var S=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function C(e,t){if(t)return e.toString(`utf8`);for(var n=``,r=0;r<e.length;r++)n+=S[e[r]];return n}function w(e,t){var n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n}var T=typeof Buffer.allocUnsafe==`function`?function(e){return Buffer.allocUnsafe(e)}:function(e){return new Buffer(e)};function E(e,t){typeof e.destroy==`function`?e._destroy=function(e,n){t(),n?.(e)}:e.destroy=t}}))(),Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})});const S3={start:I().int().nonnegative().optional(),end:I().int().nonnegative().optional(),quote:F().min(1).optional(),prefix:F().max(1e3).optional(),suffix:F().max(1e3).optional()};B({docName:F().min(1),...S3,propertyKey:F().min(1).optional(),propertyPath:z(eo([F(),I().int().nonnegative()])).optional(),body:F(),queue:L().optional(),summary:F().optional()});const C3=Ca();no(`action`,[B({action:U(`edit`),id:C3,body:F(),summary:F().optional()}),B({action:U(`resolve`),id:C3,summary:F().optional()}),B({action:U(`reopen`),id:C3,summary:F().optional()}),B({action:U(`replace`),id:C3,...S3,summary:F().optional()}),B({action:U(`queue`),id:C3,summary:F().optional()}),B({action:U(`unqueue`),id:C3,summary:F().optional()}),B({action:U(`dispatch-prepare`),id:C3,summary:F().optional()}),B({action:U(`dispatch-complete`),id:C3,summary:F().optional()}),B({action:U(`dispatch-prepare-batch`),ids:z(C3).min(1).max(200),summary:F().optional()}),B({action:U(`dispatch-complete-batch`),ids:z(C3).min(1).max(200),summary:F().optional()})]);const w3="Absolute host path inside the target OpenKnowledge project. Required when the MCP server is registered globally (e.g. `npx @inkeep/open-knowledge mcp` once at the host level, routing per call), unless the MCP client advertises exactly one root via the `roots` capability — that single root is then used as the implicit `cwd`. Optional when the server is anchored to a single project (the per-project HTTP MCP server defaults to its configured project root).";F().max(200).optional().describe(`Optional one-line user-outcome description (≤80 chars). Appears as a bullet in the timeline.`),F().length(40).regex(/^[0-9a-f]+$/i).describe("A 40-character commit SHA identifying a saved version. Produced by `checkpoint`, listed by `history` as `entries[].version`, and consumed here — the same `version` field name across all three."),F().nullable().describe("Route-only preview URL (`/#/<doc>`, no host:port), or null when no UI is running."),F().optional().describe(`How the previewUrl was resolved (e.g. the UI lock).`),F().optional().describe(`Route of the prior/removed path, for closing a stale preview tab.`);const Mve=B({value:F(),truncatedFrom:I().optional(),hint:F().optional()}).describe(`Normalized change-note summary, when one was recorded.`),Nve=z(V(F(),R()));V(F(),R()).optional().describe("Preview-attach hint (`{ action, previewUrl?, message? }`) when relevant."),z(PJ).describe('Outbound internal links in the just-written doc that do not resolve. Always present — `[]` means every link resolves. Each: `{ href (as written), resolvedTo (the docName or content-root file path it pointed at, or null), reason: "no-such-doc" | "no-such-file" | "unresolvable" }`. Report-only — the write landed regardless; fix in a follow-up edit.'),Mve.optional(),z(MJ).min(1).optional().describe("Advisory entries discriminated by `kind`. Write-integrity kinds — `content-divergence` (converged Y.Text didn't byte-match what you composed) and `disk-edit-reconciled` (an out-of-band disk edit was folded in before your write) — mean re-read the doc. The renderability kind `mermaid-parse-error` means the write landed but that fence will not render — fix it and re-edit."),z(B({name:F(),description:F().optional()})).min(1).optional().describe("Templates the parent folder offers, present only when a create passed no `template`. A nudge — the write already landed; pass `template` next time to match the folder's shape.");const Pve=F().optional().describe("Auto-duplicated body text. `textPlusStructured` mirrors the visible body here as a Claude / Claude Desktop client-quirk workaround (those clients hide `content[]` when `structuredContent` is present). Internal — programmatic consumers should prefer the `content[0].text` channel.");function T3(e){return{text:Pve,...e}}new class{capacity;store;writeIndex=0;filled=!1;constructor(e){if(!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer, got ${e}`);this.capacity=e,this.store=Array(e)}push(e){this.store[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.writeIndex===0&&(this.filled=!0)}read(){let e=[],t=this.filled?this.capacity:this.writeIndex;for(let n=1;n<=t;n++){let t=(this.writeIndex-n+this.capacity)%this.capacity,r=this.store[t];r!==void 0&&e.push(r)}return e}get size(){return this.filled?this.capacity:this.writeIndex}}(256),Il.cursor,Il.codex,Il[`claude-desktop`],e1(`embeddings`),e1(`embeddings`);function Fve(e){try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``);return`${t.protocol}//${t.host.toLowerCase()}${n}`}catch{return e.trim().replace(/\/+$/,``)}}Fve(is),e1(`embeddings`),e1(`embeddings`);const Ive=String.raw`\[\[([^\n#[\]|]+)(?:#([^\n[\]|]+))?(?:\|([^\n[\]]+))?\]\]`,Lve=String.raw`\((<[^>\n]+>|[^)\s\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'|\([^)\n]*\)))?)\)`,E3=String.raw`([^\]\n]*)`,D3=String.raw`([^\]\n]*(?:\][^[\]\n]*)?)`,O3=e=>RegExp(`(!?)${Ive}`,e),k3=(e,t)=>RegExp(`(!?)\\[${e}\\]${Lve}`,t);O3(`y`),O3(`g`),k3(E3,`y`),k3(D3,`y`),k3(E3,`g`),k3(D3,`g`);const Rve=String.raw`(!?)\[([^\]\n]*)\](?:\[([^\]\n]*)\])?`;new RegExp(Rve,`y`);function A3(e){return e.replace(/\\/g,`/`)}function j3(e){return{...e,windowsHide:!0}}B({target:H(Object.keys({"claude-cowork":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},"claude-code":{type:`app-bundle`,appName:`Claude`,urlScheme:`claude:`,probeScheme:`claude`,quitFirst:!1},codex:{type:`app-bundle`,appName:`Codex`,urlScheme:`codex:`,probeScheme:`codex`,quitFirst:!0},cursor:{type:`cli-binary`,binaryName:`cursor`,urlScheme:`cursor:`}})),url:F().min(1).max(4096),workspacePath:F().optional()}),B({}).loose(),e1(`installed-skills-marker`);var M3=e(i(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));let u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s);var S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}};let C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?T.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let ee=e=>new D(e);if(ee.isPathValid=e=>T(e&&T.convert(e),e,p),ee.default=ee,t.exports=ee,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}}))(),1);const N3=e1(`content-filter`);Fe(s);const P3=[`.claude`,`.cursor`,`.codex`,`.agents`,`.opencode`,`.pi`],F3=new Set([`node_modules`,`.venv`,`venv`,`env`,`__pycache__`,`vendor`,`dist`,`build`,`out`,`output`,`.next`,`.nuxt`,`.svelte-kit`,`.astro`,`.turbo`,`.cache`,`.parcel-cache`,`coverage`,`.git`,`.ok`,`.open-knowledge`,`.openknowledge`,...P3,`Library`,`Applications`,`.Trash`]),zve=new Set([`.git`,`node_modules`,`.ok`,`.open-knowledge`,`.openknowledge`,...P3]),I3=new Set([`worktrees`,`local`]);function L3(e){let t=us(e);if(!ds(t))throw Error(`Invalid attachment folder path`);if(t===`./`)return{kind:`sibling`};if(t===`/`||t===`.`)return{kind:`content-root`};let n=t.startsWith(`./`),r=(n?t.slice(2):t).split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`);return r===``?n?{kind:`sibling`}:{kind:`content-root`}:{kind:n?`doc-relative`:`fixed`,path:r}}function Bve(e){throw Error(`[AttachmentFolderShape] unhandled variant: ${JSON.stringify(e)}`)}function Vve(e,t,n){let r=me(e).slice(1).toLowerCase();if(!Vo.has(r)||t.kind===`sibling`)return!1;let i=e.lastIndexOf(`/`),a=i===-1?``:e.slice(0,i);if(t.kind===`content-root`)return a===``;if(t.kind===`fixed`)return a===t.path||a.startsWith(`${t.path}/`);if(t.kind===`doc-relative`){let e=a===``?[]:a.split(`/`),r=t.path.split(`/`);for(let t=0;t<=e.length-r.length;t++)if(r.every((n,r)=>e[t+r]===n)&&n(e.slice(0,t).join(`/`)))return!0;return!1}return Bve(t)}function R3(e,t){let n=e.split(`/`);for(let e=0;e<n.length;e++){let r=n[e],i=r.toLowerCase()===`.ok`?`.ok`:r;if(zve.has(i)&&!(t&&i===`.ok`&&!I3.has((n[e+1]??``).toLowerCase())))return!0}return!1}function z3(e){return e.startsWith(`${Tl}/`)}function Hve(e){return e===`.ok`||e===`.ok/skills`||e.startsWith(`.ok/skills/`)}const B3=new Set([`.ok`,...P3]),Uve=new Set([...F3].filter(e=>!B3.has(e))),Wve=[`.git`,`node_modules`,`.ok/local`,`.ok/worktrees`].flatMap(e=>[e,`${e}/**`,`**/${e}`,`**/${e}/**`]);function Gve(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);return t.includes(`..`)?!1:t.some(e=>Uve.has(e))?!0:t.some((e,n)=>e.toLowerCase()===`.ok`&&I3.has((t[n+1]??``).toLowerCase()))}const Kve=[`.gitignore`,`.ok`,`.ok/config.yml`,`.ok/.gitignore`,`.ok/schemas/frontmatter.json`,`.ok/templates/example.md`,`.ok/skills/example/SKILL.md`,`docs/.ok`,`docs/.ok/frontmatter.yml`,`docs/.ok/templates/example.md`,...P3.flatMap(e=>[e,`${e}/skills/example/SKILL.md`])];function qve(e){let t=e.trim();if(!t||t.startsWith(`!`)||t.startsWith(`#`))return!1;let n=t.replace(/^\/+/,``).replace(/\/+$/,``).split(`/`);if(n.includes(`..`))return!0;if(Gve(t))return!1;if(n.some(e=>B3.has(e)))return!0;try{let e=(0,M3.default)().add(t);return Kve.some(t=>e.ignores(t))}catch{return!0}}function Jve(e){let t=e.filter(e=>e.length>0&&!e.startsWith(`!`)&&!e.startsWith(`#`)&&!qve(e));return[...new Set([...t,...Wve])]}function V3(e,t){for(let n=0;n<t;n++)if(F3.has(e[n])||e[n].toLowerCase()===`.ok`)return!0;return!1}function H3(e){let t=e.split(`/`),n=t.length;return n<3||t[n-3]!==`.ok`||t[n-2]!==`templates`||me(t[n-1])!==`.md`?!1:!V3(t,n-3)}function U3(e){let t=e.split(`/`),n=t.length;return t[n-1]===`.ok`?!V3(t,n-1):n>=2&&t[n-1]===`templates`&&t[n-2]===`.ok`?!V3(t,n-2):!1}function Yve(e){let t=e.split(`/`),n=t.length;return t[0]===`.ok`&&(n===2&&(t[1]===`config.yml`||t[1]===`.gitignore`)||n===3&&t[1]===`schemas`&&t[2].toLowerCase().endsWith(`.json`))||H3(e)?!0:n>=2&&t[n-1]===`frontmatter.yml`&&t[n-2]===`.ok`?!V3(t,n-2):!1}function Xve(e){return e===`.ok`||e===`.ok/schemas`?!0:U3(e)}function Zve(e,t){for(let n of t)if(e===n||e.startsWith(`${n}/`))return!0;return!1}function W3(e,t){if(t.size===0)return!1;for(let n of t)if(e.startsWith(`${n}/`))return!0;return!1}function Qve(e,t){if(t.size===0)return!1;for(let n of t)if(n===e||n.startsWith(`${e}/`)||e.startsWith(`${n}/`))return!0;return!1}const $ve=new Set([`.DS_Store`,`.localized`]);function G3(e){return $ve.has(e.slice(e.lastIndexOf(`/`)+1))}const eye=new Set([`.ssh`,`.aws`,`.gnupg`,`.kube`,`.docker`]);function K3(e){for(let t of e.split(`/`))if(eye.has(t.toLowerCase()))return!0;return!1}const tye=new Set([`credentials`,`.netrc`,`.npmrc`,`.pgpass`,`.git-credentials`]),nye=[`.pem`,`.key`,`.p12`,`.pfx`,`.keystore`,`.jks`,`.ppk`];function q3(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();if(t===`.env`||t.startsWith(`.env.`)||tye.has(t)||t.startsWith(`id_rsa`)||t.startsWith(`id_ed25519`)||t.startsWith(`id_ecdsa`)||t.startsWith(`id_dsa`))return!0;for(let e of nye)if(t.endsWith(e))return!0;return!1}function rye(e,t){return t===e||t.startsWith(`${e}/`)}const J3=[`.gitignore`,`.okignore`];function iye(e,t){let n=aye(e);if(n===null)return[];let r=[];Y3(N(n,`info`,`exclude`),t,r,`info/exclude`);let i=oye(e);return i&&Y3(i,t,r,`global excludesfile`),r}function aye(e){let t=u(`git`,[`rev-parse`,`--git-common-dir`],j3({cwd:e,encoding:`utf-8`,timeout:5e3}));return t.status!==0||!t.stdout?null:ve(e,t.stdout.trim())}function oye(e){let t=u(`git`,[`config`,`--get`,`--type=path`,`core.excludesfile`],j3({cwd:e,encoding:`utf-8`,timeout:5e3}));if(t.status===0&&t.stdout){let e=t.stdout.trim();if(e)return e}return sye()}function sye(){let e=process.env.XDG_CONFIG_HOME?.trim();return N(e&&e.length>0?e:N(O(),`.config`),`git`,`ignore`)}function Y3(e,t,n,r){if(g(e))try{let r=S(e,`utf-8`);t.value+=r.length,n.push(...Z3(r))}catch(t){N3.warn({path:e,err:t},`Failed to read ${r} at ${e}`)}}function cye(e){let{projectDir:t,contentDir:n,onAfterRebuild:r,singleDocRelPath:i}=e,a=e.inPlaceSkillDirs??new Set,o=L3(e.attachmentFolderPath??`./`),s=e.skillRootPaths??new Set,c=A3(_e(t,n)),l=c.startsWith(`..`),u,d,f,p,m=0,h=0,_=0;function v(){let e=(0,M3.default)(),r=(0,M3.default)();e.add(`.git`);let i=[],a=0,o=0;for(let n of J3){let o=N(t,n);if(g(o))try{let t=S(o,`utf-8`);a+=t.length;let s=Z3(t);i.push(...s),e.add(s),n===`.okignore`&&r.add(s)}catch(e){N3.warn({path:o,err:e},`Failed to read ${n} at ${o}`)}}if(c&&!l)for(let t of J3){let i=N(n,t);if(g(i))try{let n=S(i,`utf-8`);a+=n.length,o++;let s=Z3(n).map(e=>Q3(e,c));e.add(s),t===`.okignore`&&r.add(s)}catch(e){N3.warn({path:i,err:e},`Failed to read ${t} at ${i}`)}}let s={value:a};o+=$3(n,t,e,r,s),a=s.value;let v=iye(t,s);a=s.value,v.length>0&&(i.push(...v),e.add(v));let y=Jve(i);return u=e,d=r,f=i,p=y,m=i.length,h=o,_=a,{patternCount:m,nestedFileCount:h,bytes:_}}v();let y=new Map;function b(e,t){if(l&&t?.pathBase!==`project`)return!1;let n=t?.pathBase===`project`||!c?e:`${c}/${e}`;return n.startsWith(`..`)?!1:u.ignores(n)}function x(e,t){return t.pathBase===`project`||!c?e:`${c}/${e}`}function C(e){if(l)return!1;let t=c?`${c}/${e}`:e;return d.ignores(t)}let w=()=>{i===void 0&&X3(n,``,b,y)};w();function T(e){return Eve(xve(e))}function E(e){for(let t of e.split(`/`))if(F3.has(t))return!0;return l?!1:b(e)}return{isExcluded(e,t){if(T(e)||q3(e)||K3(e)||!t?.bypassFilters&&Zve(e,s)&&!W3(e,a))return!0;if(!t?.bypassFilters&&(z3(e)||W3(e,a)&&!b(e))){if(i!==void 0)return e!==i;if(b3(e))return!1;let t=me(e).slice(1).toLowerCase();return!Vo.has(t)}if(!t?.bypassFilters&&H3(e)||!t?.bypassFilters&&t?.syncScope!==void 0&&Yve(x(e,t.syncScope))&&!b(e,t.syncScope))return i===void 0?!1:e!==i;if(R3(e,t?.showOk)||G3(e))return!0;if(i!==void 0)return e!==i;if(t?.bypassFilters)return t.respectOkignore===!0&&C(e);if(E(e))return!0;if(b3(e)||Vve(e,o,e=>(y.get(e)??0)>0))return!1;let n=me(e).slice(1).toLowerCase();if(Vo.has(n)){let t=pe(e),n=t===`.`?``:t;if((y.get(n)??0)>0)return!1}return!0},isDirExcluded(e,t){if(K3(e))return!0;if(!t?.bypassFilters&&(Hve(e)||U3(e)||t?.syncScope!==void 0&&Xve(x(e,t.syncScope))||Qve(e,a)))return!1;if(R3(e,t?.showOk))return!0;if(i!==void 0)return!rye(e,i);if(t?.bypassFilters)return t.respectOkignore===!0&&(C(e)||C(`${e}/`));for(let t of e.split(`/`))if(F3.has(t))return!0;return l?!1:b(e,t?.syncScope)||b(`${e}/`,t?.syncScope)},isPathIgnored(e,t){return T(e)||q3(e)||K3(e)?!0:z3(e)||W3(e,a)&&!b(e)||H3(e)?!1:R3(e)||G3(e)?!0:t?.bypassFilters?!1:E(e)},getWatcherIgnoreGlobs(){return p},incrementMdDir(e){let t=e===`.`?``:e;y.set(t,(y.get(t)??0)+1)},decrementMdDir(e){let t=e===`.`?``:e,n=y.get(t)??0;n<=1?y.delete(t):y.set(t,n-1)},rebuildDirCount(){let e=new Map(y);y.clear();try{w()}catch(t){for(let[t,n]of e)y.set(t,n);N3.warn({err:t instanceof Error?t:Error(String(t))},`content-filter rebuildDirCount walk failed — retaining previous counts`)}},setAttachmentFolderPath(e){o=L3(e)},async rebuildIgnorePatterns(){if(e.rescanInPlaceSkillDirs)try{a=e.rescanInPlaceSkillDirs()}catch(e){N3.warn({err:e},`in-place skill re-scan failed — keeping previous allow-list`)}let t=u,n=d,i=f,o=p,s=m,c=h,l=_,g=Date.now();return She(`config.ignore.rebuild`,{attributes:{}},async e=>{try{let t=v();y.clear(),w();let n=Date.now()-g;if(e.setAttributes({"ok.ignore.pattern_count":t.patternCount,"ok.ignore.nested_file_count":t.nestedFileCount,"ok.ignore.bytes":t.bytes}),N3.info({patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n},`content-filter rebuild succeeded`),r)try{r()}catch(e){N3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter onAfterRebuild callback threw — derived views may be stale`)}return{ok:!0,patternCount:t.patternCount,nestedFileCount:t.nestedFileCount,bytes:t.bytes,durationMs:n}}catch(e){u=t,d=n,f=i,p=o,m=s,h=c,_=l,y.clear();try{w()}catch(e){N3.warn({err:e instanceof Error?e:Error(String(e))},`content-filter rollback dirCount re-walk failed — sibling-asset counts may be stale until next rebuild`)}let r=e instanceof Error?e.message:String(e);return N3.warn({err:e instanceof Error?e:Error(r)},`content-filter rebuild failed — rolled back to previous state`),{ok:!1,error:{message:r}}}})}}}function X3(e,t,n,r){let i;try{i=C(e,{withFileTypes:!0})}catch(t){N3.warn({dir:e,err:t},`Failed to read directory for dir-count: ${e}`);return}for(let a of i){let i=t?`${t}/${a.name}`:a.name;if(a.isDirectory()){if(F3.has(a.name)||n(i)||n(`${i}/`))continue;X3(N(e,a.name),i,n,r)}else a.isFile()&&b3(a.name)&&!n(i)&&r.set(t,(r.get(t)??0)+1)}}function Z3(e){return e.split(`
434
434
  `).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`))}function Q3(e,t){let n=e.startsWith(`!`),r=n?e.slice(1):e,i=r.startsWith(`/`)?r.slice(1):r,a=i.endsWith(`/`)?i.slice(0,-1):i,o=r.startsWith(`/`)||a.includes(`/`)?`${t}/${i}`:`${t}/**/${i}`;return n?`!${o}`:o}function $3(e,t,n,r,i){let a;try{a=C(e,{withFileTypes:!0})}catch(t){return N3.warn({dir:e,err:t},`Failed to read directory ${e}`),0}let o=0;for(let s of a){if(!s.isDirectory()||F3.has(s.name))continue;let a=N(e,s.name),c=A3(_e(t,a));if(!c.startsWith(`..`)&&!(n.ignores(c)||n.ignores(`${c}/`))){for(let e of J3){let t=N(a,e);if(g(t))try{let a=S(t,`utf-8`);i.value+=a.length;let s=Z3(a).map(e=>Q3(e,c));n.add(s),e===`.okignore`&&r.add(s),o++}catch(n){N3.warn({path:t,err:n},`Failed to read nested ${e} at ${t}`)}}o+=$3(a,t,n,r,i)}}return o}function e6(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&r6(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&r6(e.charCodeAt(r)))for(r++;r<e.length&&r6(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&r6(e.charCodeAt(r))){for(r++;r<e.length&&r6(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
435
435
  `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(n6(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(t6(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(t6(t));return o=15}if(n6(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
436
- `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!n6(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,n6(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!r6(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(t6(e)||n6(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function t6(e){return e===32||e===9}function n6(e){return e===10||e===13}function r6(e){return e>=48&&e<=57}var cye;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(cye||={});const i6=Array(20).fill(0).map((e,t)=>` `.repeat(t)),a6={" ":{"\n":Array(200).fill(0).map((e,t)=>`
436
+ `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!n6(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,n6(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!r6(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(t6(e)||n6(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function t6(e){return e===32||e===9}function n6(e){return e===10||e===13}function r6(e){return e>=48&&e<=57}var lye;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(lye||={});const i6=Array(20).fill(0).map((e,t)=>` `.repeat(t)),a6={" ":{"\n":Array(200).fill(0).map((e,t)=>`
437
437
  `+` `.repeat(t)),"\r":Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
438
438
  `+` `.repeat(t))}," ":{"\n":Array(200).fill(0).map((e,t)=>`
439
439
  `+` `.repeat(t)),"\r":Array(200).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
440
- `+` `.repeat(t))}},lye=[`
440
+ `+` `.repeat(t))}},uye=[`
441
441
  `,`\r`,`\r
442
- `];function uye(e,t,n){let r,i,a,o,s;if(t){for(o=t.offset,s=o+t.length,a=o;a>0&&!s6(e,a-1);)a--;let c=s;for(;c<e.length&&!s6(e,c);)c++;i=e.substring(a,c),r=dye(i,n)}else i=e,r=0,a=0,o=0,s=e.length;let c=fye(n,e),l=lye.includes(c),u=0,d=0,f;f=n.insertSpaces?i6[n.tabSize||4]??o6(i6[1],n.tabSize||4):` `;let p=f===` `?` `:` `,m=e6(i,!1),h=!1;function g(){if(u>1)return o6(c,u)+o6(f,r+d);let e=f.length*(r+d);return!l||e>a6[p][c].length?c+o6(f,r+d):e<=0?c:a6[p][c][e]}function _(){let e=m.scan();for(u=0;e===15||e===14;)e===14&&n.keepLines?u+=1:e===14&&(u=1),e=m.scan();return h=e===16||m.getTokenError()!==0,e}let v=[];function y(n,r,i){!h&&(!t||r<s&&i>o)&&e.substring(r,i)!==n&&v.push({offset:r,length:i-r,content:n})}let b=_();if(n.keepLines&&u>0&&y(o6(c,u),0,0),b!==17){let e=m.getTokenOffset()+a;y(f.length*r<20&&n.insertSpaces?i6[f.length*r]:o6(f,r),a,e)}for(;b!==17;){let e=m.getTokenOffset()+m.getTokenLength()+a,t=_(),r=``,i=!1;for(;u===0&&(t===12||t===13);){let n=m.getTokenOffset()+a;y(i6[1],e,n),e=m.getTokenOffset()+m.getTokenLength()+a,i=t===12,r=i?g():``,t=_()}if(t===2)b!==1&&d--,n.keepLines&&u>0||!n.keepLines&&b!==1?r=g():n.keepLines&&(r=i6[1]);else if(t===4)b!==3&&d--,n.keepLines&&u>0||!n.keepLines&&b!==3?r=g():n.keepLines&&(r=i6[1]);else{switch(b){case 3:case 1:d++,r=n.keepLines&&u>0||!n.keepLines?g():i6[1];break;case 5:r=n.keepLines&&u>0||!n.keepLines?g():i6[1];break;case 12:r=g();break;case 13:u>0?r=g():i||(r=i6[1]);break;case 6:n.keepLines&&u>0?r=g():i||(r=i6[1]);break;case 10:n.keepLines&&u>0?r=g():t===6&&!i&&(r=``);break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&u>0?r=g():(t===12||t===13)&&!i?r=i6[1]:t!==5&&t!==17&&(h=!0);break;case 16:h=!0;break}u>0&&(t===12||t===13)&&(r=g())}t===17&&(r=n.keepLines&&u>0?g():n.insertFinalNewline?c:``);let o=m.getTokenOffset()+a;y(r,e,o),b=t}return v}function o6(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}function dye(e,t){let n=0,r=0,i=t.tabSize||4;for(;n<e.length;){let t=e.charAt(n);if(t===i6[1])r++;else if(t===` `)r+=i;else break;n++}return Math.floor(r/i)}function fye(e,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n===`\r`)return e+1<t.length&&t.charAt(e+1)===`
442
+ `];function dye(e,t,n){let r,i,a,o,s;if(t){for(o=t.offset,s=o+t.length,a=o;a>0&&!s6(e,a-1);)a--;let c=s;for(;c<e.length&&!s6(e,c);)c++;i=e.substring(a,c),r=fye(i,n)}else i=e,r=0,a=0,o=0,s=e.length;let c=pye(n,e),l=uye.includes(c),u=0,d=0,f;f=n.insertSpaces?i6[n.tabSize||4]??o6(i6[1],n.tabSize||4):` `;let p=f===` `?` `:` `,m=e6(i,!1),h=!1;function g(){if(u>1)return o6(c,u)+o6(f,r+d);let e=f.length*(r+d);return!l||e>a6[p][c].length?c+o6(f,r+d):e<=0?c:a6[p][c][e]}function _(){let e=m.scan();for(u=0;e===15||e===14;)e===14&&n.keepLines?u+=1:e===14&&(u=1),e=m.scan();return h=e===16||m.getTokenError()!==0,e}let v=[];function y(n,r,i){!h&&(!t||r<s&&i>o)&&e.substring(r,i)!==n&&v.push({offset:r,length:i-r,content:n})}let b=_();if(n.keepLines&&u>0&&y(o6(c,u),0,0),b!==17){let e=m.getTokenOffset()+a;y(f.length*r<20&&n.insertSpaces?i6[f.length*r]:o6(f,r),a,e)}for(;b!==17;){let e=m.getTokenOffset()+m.getTokenLength()+a,t=_(),r=``,i=!1;for(;u===0&&(t===12||t===13);){let n=m.getTokenOffset()+a;y(i6[1],e,n),e=m.getTokenOffset()+m.getTokenLength()+a,i=t===12,r=i?g():``,t=_()}if(t===2)b!==1&&d--,n.keepLines&&u>0||!n.keepLines&&b!==1?r=g():n.keepLines&&(r=i6[1]);else if(t===4)b!==3&&d--,n.keepLines&&u>0||!n.keepLines&&b!==3?r=g():n.keepLines&&(r=i6[1]);else{switch(b){case 3:case 1:d++,r=n.keepLines&&u>0||!n.keepLines?g():i6[1];break;case 5:r=n.keepLines&&u>0||!n.keepLines?g():i6[1];break;case 12:r=g();break;case 13:u>0?r=g():i||(r=i6[1]);break;case 6:n.keepLines&&u>0?r=g():i||(r=i6[1]);break;case 10:n.keepLines&&u>0?r=g():t===6&&!i&&(r=``);break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&u>0?r=g():(t===12||t===13)&&!i?r=i6[1]:t!==5&&t!==17&&(h=!0);break;case 16:h=!0;break}u>0&&(t===12||t===13)&&(r=g())}t===17&&(r=n.keepLines&&u>0?g():n.insertFinalNewline?c:``);let o=m.getTokenOffset()+a;y(r,e,o),b=t}return v}function o6(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}function fye(e,t){let n=0,r=0,i=t.tabSize||4;for(;n<e.length;){let t=e.charAt(n);if(t===i6[1])r++;else if(t===` `)r+=i;else break;n++}return Math.floor(r/i)}function pye(e,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n===`\r`)return e+1<t.length&&t.charAt(e+1)===`
443
443
  `?`\r
444
444
  `:`\r`;if(n===`
445
445
  `)return`
446
446
  `}return e&&e.eol||`
447
447
  `}function s6(e,t){return`\r
448
- `.indexOf(e.charAt(t))!==-1}var c6;(function(e){e.DEFAULT={allowTrailingComma:!1}})(c6||={});function pye(e,t=[],n=c6.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return f6(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function l6(e,t=[],n=c6.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}f6(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:mye(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function u6(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function d6(e){switch(e.type){case`array`:return e.children.map(d6);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=d6(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function f6(e,t,n=c6.DEFAULT){let r=e6(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),te()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function ee(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,te()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function te(){switch(r.getToken()){case 3:return ee();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):te()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function mye(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}function hye(e,t,n,r){let i=t.slice(),a=l6(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=u6(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return p6(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=u6(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return p6(e,{offset:i,length:a-i,content:``},r)}else return p6(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return p6(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return p6(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return p6(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return p6(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function p6(e,t,n){if(!n.formattingOptions)return[t];let r=m6(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!s6(r,i-1);)i--;for(;a<r.length&&!s6(r,a);)a++}let o=uye(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=m6(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function m6(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var gye;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(gye||={});var _ye;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(_ye||={});const vye=pye,yye=l6,h6=d6;var bye;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(bye||={});function g6(e,t,n,r){return hye(e,t,n,r)}function _6(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=m6(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}e1(`mermaid-validator`),e1(`saved-themes`);const xye=/^[A-Za-z0-9-]{8,64}$/;let v6=null;function Sye(e){return N(e??O(),`.ok`,`machine-id`)}function Cye(e){if(e===void 0&&v6!==null)return v6;let t=Sye(e),n=null;try{let e=S(t,`utf-8`).trim();xye.test(e)&&(n=e)}catch{}if(n===null){n=je();try{v(pe(t),{recursive:!0}),ne(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){e1(`machine-id`).warn({path:t,err:e},`Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(v6=n),n}function wye(){try{let e=ve(pe(Se(import.meta.url)),`..`,`package.json`),t=JSON.parse(S(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}wye(),e1(`process-lock`);function Tye(e,t){return ve(e,`${t}.lock`)}new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}},e1(`git-context`);const y6={discovery:`open-knowledge-discovery`,project:`open-knowledge`,"write-skill":`open-knowledge-write-skill`};new Set(Object.values(y6));const Eye=Object.keys(y6),Dye={discovery:`user`,project:`project`,"write-skill":`user`},b6=Eye.filter(e=>Dye[e]===`user`);var Oye=e(a(),1);const x6=`OpenKnowledge.app/Contents/Resources/cli/dist/assets/skills`;function kye(e,t={}){let n=t.platform??process.platform,r=t.checkDesktop??!1,i=t.home??O(),a=[],o=process.env.NODE_ENV===`test`;r&&n===`darwin`&&(o||a.push(N(`/Applications`,x6,e)),(!o||t.home!==void 0)&&a.push(N(i,`Applications`,x6,e))),a.push(Se(new URL(`../dist/assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`../assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`./assets/skills/${e}`,import.meta.url)));for(let e of a)if(g(e))return e;throw Error(`Bundled skill asset directory not found for bundle '${e}'. Tried: ${a.join(`, `)}. This usually means the CLI build did not copy packages/server/assets into dist/assets. Run \`cd packages/cli && bun run build\` before publishing.`)}Fe(x),[...jl];function S6(e,t){return[...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({editor:e,root:t})),{editor:`agents`,root:t}]}S6(kl,Vl),[...S6(Al,Vl)].sort((e,t)=>{let n=x3.indexOf(e.editor),r=x3.indexOf(t.editor);return(n===-1?x3.length:n)-(r===-1?x3.length:r)||e.editor.localeCompare(t.editor)}),e1(`upload-streaming`),e1(`backlinks`),e1(`tag-index`),e1(`derived-document-index`),e1(`file-watcher`);function Aye(e){try{return ee(ve(e,`.ok/config.yml`)).isFile()}catch(e){let t=e?.code;if(t===`ENOENT`||t===`ENOTDIR`)return!1;throw e}}e1(`git-checkout`),t1(()=>{}),e1(`asset-references`);const jye=global.Request;var C6=class extends jye{constructor(e,t){if(typeof e==`object`&&j6 in e){let n=t!==void 0&&`body`in t&&t.body!=null;if(e[B6]&&!n)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);e=e[j6]()}t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}};const w6=e=>{let t=[],n=e.rawHeaders;for(let e=0,r=n.length;e<r;e+=2){let r=n[e];r.charCodeAt(0)!==58&&t.push([r,n[e+1]])}return new Headers(t)},Mye=Symbol(`wrapBodyStream`),Nye=new Set([`latin1`,`binary`,`hex`,`base64`,`base64url`]),Pye=e=>e===null||Nye.has(e),T6=Symbol(`bodyBufferedBeforeDisconnect`),E6=Symbol(`bodyBufferedLengthBeforeDisconnect`),D6=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??`utf8`),O6=e=>!(e instanceof Ie)&&!!e.complete&&!!e.readableAborted&&typeof e.read==`function`&&Pye(e.readableEncoding),k6=(e,t)=>{if(e.readableDidRead&&!t||!O6(e))return;let n=e;if(n[T6]!==void 0)return n[T6];let r,i=e.errored;if(i&&i.code!==`ECONNRESET`)r=i;else if(n[E6]!==void 0&&e.readableLength!==n[E6])r=U6();else{let n=t??[],i=e.read();i!==null&&n.push(D6(i,e.readableEncoding));let a=n.length===1?n[0]:Buffer.concat(n);r=a;let o=e.headers[`content-length`];if(typeof o==`string`&&/^\d+$/.test(o)){let e=Number(o);Number.isSafeInteger(e)&&a.length!==e&&(r=U6())}}return n[T6]=r,r},A6=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},Fye=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new C6(t,a);return Object.defineProperty(e,`method`,{get(){return`TRACE`}}),e}if(!(e===`GET`||e===`HEAD`))if(`rawBody`in r&&r.rawBody instanceof Buffer)a.body=new ReadableStream({start(e){e.enqueue(r.rawBody),e.close()}});else if(r[Mye]){let e;a.body=new ReadableStream({async pull(t){try{if(!e){let e=k6(r);if(e!==void 0){A6(t,e);return}}e||=Oe.toWeb(r).getReader();let{done:n,value:i}=await e.read();n?t.close():t.enqueue(i)}catch(e){t.error(e)}}})}else{let e=k6(r);e===void 0?a.body=Oe.toWeb(r):a.body=new ReadableStream({start(t){A6(t,e)}})}return new C6(t,a)},j6=Symbol(`getRequestCache`),M6=Symbol(`requestCache`),N6=Symbol(`incomingKey`),P6=Symbol(`urlKey`),Iye=Symbol(`methodKey`),F6=Symbol(`headersKey`),I6=Symbol(`abortControllerKey`),L6=Symbol(`getAbortController`),Lye=Symbol(`abortRequest`),R6=Symbol(`bodyBuffer`),z6=Symbol(`bodyReadPromise`),B6=Symbol(`bodyConsumedDirectly`),V6=Symbol(`bodyLockReader`),H6=Symbol(`abortReason`),U6=()=>TypeError(`Body is unusable`),W6=()=>Promise.reject(U6()),Rye=new TextDecoder,zye=e=>{if(e[B6])return W6();e[B6]=!0},Bye=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Vye=e=>(e[F6]||=w6(e[N6])).get(`content-type`)||``,Hye=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Uye=e=>{if(!Hye.test(e))return TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t===`CONNECT`||t===`TRACK`||t===`TRACE`&&e!==`TRACE`)return TypeError(`'${e}' HTTP method is unsupported.`)},G6=(e,t,n)=>{if(e[B6])return W6();let r=e.method;if(r===`GET`||r===`HEAD`)return e[j6]()[t]();let i=Uye(r);if(i)return Promise.reject(i);if(e[M6]&&r!==`TRACE`)return e[M6][t]();let a=zye(e);if(a)return a;let o=Wye(e);if(o){let t=Promise.resolve(n(o,e));return e[R6]=void 0,t}return Gye(e).then(t=>{let r=n(t,e);return e[R6]=void 0,r})},Wye=e=>{let t=e[N6];if(`rawBody`in t&&t.rawBody instanceof Buffer)return t.rawBody},K6=(e,t)=>{if(t.errored)return t.errored;let n=e[H6];return n===void 0?Error(`Client connection prematurely closed.`):n instanceof Error?n:Error(String(n))},Gye=e=>{if(e[R6])return Promise.resolve(e[R6]);if(e[z6])return e[z6];let t=e[N6];if(t.readableDidRead)return W6();let n=k6(t);if(n!==void 0)return n instanceof Error?Promise.reject(n):(e[R6]=n,Promise.resolve(n));let r=new Promise((n,r)=>{let i=[],a=!1,o=e=>{a||(a=!0,f(),e())},s=a=>{let s=t.errored??a;return!O6(t)||s&&s.code!==`ECONNRESET`?!1:(o(()=>{let o=k6(t,i);o instanceof Error?r(o):o===void 0?r(a??K6(e,t)):(e[R6]=o,n(o))}),!0)},c=e=>{i.push(D6(e,t.readableEncoding))},l=()=>{o(()=>{let t=i.length===1?i[0]:Buffer.concat(i);e[R6]=t,n(t)})},u=e=>{s(e)||o(()=>{r(e)})},d=()=>{if(t.readableEnded){l();return}s()||o(()=>{r(K6(e,t))})},f=()=>{t.off(`data`,c),t.off(`end`,l),t.off(`error`,u),t.off(`close`,d),e[z6]=void 0};t.on(`data`,c),t.on(`end`,l),t.on(`error`,u),t.on(`close`,d),queueMicrotask(()=>{a||(t.readableEnded?l():t.errored?u(t.errored):t.destroyed&&d())})});return e[z6]=r,r},q6={get method(){return this[Iye]},get url(){return this[P6]},get headers(){return this[F6]||=w6(this[N6])},[Lye](e){this[H6]===void 0&&(this[H6]=e);let t=this[I6];t&&!t.signal.aborted&&t.abort(e)},[L6](){return this[I6]||=new AbortController,this[H6]!==void 0&&!this[I6].signal.aborted&&this[I6].abort(this[H6]),this[I6]},[j6](){let e=this[L6]();if(this[M6])return this[M6];let t=this.method;if(this[B6]&&!(t===`GET`||t===`HEAD`)){this[R6]=void 0;let n={method:t===`TRACE`?`GET`:t,headers:this.headers,signal:e.signal};t!==`TRACE`&&(n.body=new ReadableStream({start(e){e.close()}}),n.duplex=`half`);let r=new C6(this[P6],n);return t===`TRACE`&&Object.defineProperty(r,`method`,{get(){return`TRACE`}}),this[M6]=r}return this[M6]=Fye(this.method,this[P6],this.headers,this[N6],e)},get body(){if(!this[B6])return this[j6]().body;let e=this[j6]();return!this[V6]&&e.body&&(this[V6]=e.body.getReader()),e.body},get bodyUsed(){return this[B6]?!0:this[M6]?this[M6].bodyUsed:!1}};Object.defineProperty(q6,`signal`,{get(){return this[L6]().signal}}),[`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`keepalive`].forEach(e=>{Object.defineProperty(q6,e,{get(){return this[j6]()[e]}})}),[`clone`,`formData`].forEach(e=>{Object.defineProperty(q6,e,{value:function(){if(this[B6]){if(e===`clone`)throw U6();return W6()}return this[j6]()[e]()}})}),Object.defineProperty(q6,`text`,{value:function(){return G6(this,`text`,e=>Rye.decode(e))}}),Object.defineProperty(q6,`arrayBuffer`,{value:function(){return G6(this,`arrayBuffer`,e=>Bye(e))}}),Object.defineProperty(q6,`blob`,{value:function(){return G6(this,`blob`,(e,t)=>{let n=Vye(t);return new Response(e,n?{headers:{"content-type":n}}:void 0).blob()})}}),Object.defineProperty(q6,`json`,{value:function(){return this[B6]?W6():this.text().then(JSON.parse)}}),Object.defineProperty(q6,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[M6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(q6,C6.prototype);const J6=Symbol(`responseCache`),Y6=Symbol(`getResponseCache`),X6=Symbol(`cache`),Z6=global.Response;var Q6=class e{#e;#t;[Y6](){let e=this[X6],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[X6],this[J6]||=new Z6(this.#e,t?{status:this.#t?.status,statusText:this.#t?.statusText,headers:t}:this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof Z6){let t=n[J6];if(t){this.#t=t,this[Y6]();return}this.#t=n instanceof e?n.#t:n,r=new Headers(n.headers)}else this.#t=n;(t==null||typeof t==`string`||t?.getReader!==void 0||t instanceof Blob||t instanceof Uint8Array)&&(this[X6]=[n?.status||200,t??null,r||n?.headers])}get headers(){let e=this[X6];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(e[1]===null?void 0:{"content-type":`text/plain; charset=UTF-8`}))),e[2]):this[Y6]().headers}get status(){return this[X6]?.[0]??this[Y6]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(Q6.prototype,e,{get(){return this[Y6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(Q6.prototype,e,{value:function(){return this[Y6]()[e]()}})}),Object.defineProperty(Q6.prototype,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[J6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(Q6,Z6),Object.setPrototypeOf(Q6.prototype,Z6.prototype);const Kye=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,qye=e=>e instanceof URL?e.href:Kye.test(e)?e:new URL(e).href,Jye=new Set([301,302,303,307,308]);Object.defineProperty(Q6,`redirect`,{value:function(e,t=302){if(!Jye.has(t))throw RangeError(`Invalid status code`);return new Q6(null,{status:t,headers:{location:qye(e)}})},writable:!0,configurable:!0}),Object.defineProperty(Q6,`json`,{value:function(e,t){let n=JSON.stringify(e);if(n===void 0)throw TypeError(`The data is not JSON serializable`);let r=t?.headers,i;return r?(i=new Headers(r),i.has(`content-type`)||i.set(`content-type`,`application/json`)):i={"content-type":`application/json`},new Q6(n,{status:t?.status??200,statusText:t?.statusText,headers:i})},writable:!0,configurable:!0}),globalThis.CloseEvent,globalThis.ErrorEvent,new Response(null,{headers:{"x-hono-already-sent":`true`}}),e1(`suggest-links`),`${Bl}`,`${Ml.join(`
448
+ `.indexOf(e.charAt(t))!==-1}var c6;(function(e){e.DEFAULT={allowTrailingComma:!1}})(c6||={});function mye(e,t=[],n=c6.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return f6(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function l6(e,t=[],n=c6.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}f6(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:hye(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function u6(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function d6(e){switch(e.type){case`array`:return e.children.map(d6);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=d6(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function f6(e,t,n=c6.DEFAULT){let r=e6(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),te()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function ee(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,te()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function te(){switch(r.getToken()){case 3:return ee();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):te()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function hye(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}function gye(e,t,n,r){let i=t.slice(),a=l6(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=u6(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return p6(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=u6(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return p6(e,{offset:i,length:a-i,content:``},r)}else return p6(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return p6(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return p6(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return p6(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return p6(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function p6(e,t,n){if(!n.formattingOptions)return[t];let r=m6(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!s6(r,i-1);)i--;for(;a<r.length&&!s6(r,a);)a++}let o=dye(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=m6(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function m6(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var _ye;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(_ye||={});var vye;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(vye||={});const yye=mye,bye=l6,h6=d6;var xye;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(xye||={});function g6(e,t,n,r){return gye(e,t,n,r)}function _6(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=m6(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}e1(`mermaid-validator`),e1(`saved-themes`);const Sye=/^[A-Za-z0-9-]{8,64}$/;let v6=null;function Cye(e){return N(e??O(),`.ok`,`machine-id`)}function wye(e){if(e===void 0&&v6!==null)return v6;let t=Cye(e),n=null;try{let e=S(t,`utf-8`).trim();Sye.test(e)&&(n=e)}catch{}if(n===null){n=je();try{v(pe(t),{recursive:!0}),ne(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){e1(`machine-id`).warn({path:t,err:e},`Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(v6=n),n}e1(`process-lock`);function Tye(e,t){return ve(e,`${t}.lock`)}new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}},e1(`git-context`);const y6={discovery:`open-knowledge-discovery`,project:`open-knowledge`,"write-skill":`open-knowledge-write-skill`};new Set(Object.values(y6));const Eye=Object.keys(y6),Dye={discovery:`user`,project:`project`,"write-skill":`user`},b6=Eye.filter(e=>Dye[e]===`user`);var Oye=e(a(),1);const x6=`OpenKnowledge.app/Contents/Resources/cli/dist/assets/skills`;function kye(e,t={}){let n=t.platform??process.platform,r=t.checkDesktop??!1,i=t.home??O(),a=[],o=process.env.NODE_ENV===`test`;r&&n===`darwin`&&(o||a.push(N(`/Applications`,x6,e)),(!o||t.home!==void 0)&&a.push(N(i,`Applications`,x6,e))),a.push(Se(new URL(`../dist/assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`../assets/skills/${e}`,import.meta.url))),a.push(Se(new URL(`./assets/skills/${e}`,import.meta.url)));for(let e of a)if(g(e))return e;throw Error(`Bundled skill asset directory not found for bundle '${e}'. Tried: ${a.join(`, `)}. This usually means the CLI build did not copy packages/server/assets into dist/assets. Run \`cd packages/cli && bun run build\` before publishing.`)}Fe(x),[...jl];function S6(e,t){return[...Object.entries(e).filter(e=>e[1]!==null).map(([e,t])=>({editor:e,root:t})),{editor:`agents`,root:t}]}S6(kl,Vl),[...S6(Al,Vl)].sort((e,t)=>{let n=x3.indexOf(e.editor),r=x3.indexOf(t.editor);return(n===-1?x3.length:n)-(r===-1?x3.length:r)||e.editor.localeCompare(t.editor)}),e1(`upload-streaming`),e1(`backlinks`),e1(`tag-index`),e1(`derived-document-index`),e1(`file-watcher`);function Aye(e){try{return ee(ve(e,`.ok/config.yml`)).isFile()}catch(e){let t=e?.code;if(t===`ENOENT`||t===`ENOTDIR`)return!1;throw e}}e1(`git-checkout`),t1(()=>{}),e1(`asset-references`);const jye=global.Request;var C6=class extends jye{constructor(e,t){if(typeof e==`object`&&j6 in e){let n=t!==void 0&&`body`in t&&t.body!=null;if(e[B6]&&!n)throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);e=e[j6]()}t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}};const w6=e=>{let t=[],n=e.rawHeaders;for(let e=0,r=n.length;e<r;e+=2){let r=n[e];r.charCodeAt(0)!==58&&t.push([r,n[e+1]])}return new Headers(t)},Mye=Symbol(`wrapBodyStream`),Nye=new Set([`latin1`,`binary`,`hex`,`base64`,`base64url`]),Pye=e=>e===null||Nye.has(e),T6=Symbol(`bodyBufferedBeforeDisconnect`),E6=Symbol(`bodyBufferedLengthBeforeDisconnect`),D6=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??`utf8`),O6=e=>!(e instanceof Ie)&&!!e.complete&&!!e.readableAborted&&typeof e.read==`function`&&Pye(e.readableEncoding),k6=(e,t)=>{if(e.readableDidRead&&!t||!O6(e))return;let n=e;if(n[T6]!==void 0)return n[T6];let r,i=e.errored;if(i&&i.code!==`ECONNRESET`)r=i;else if(n[E6]!==void 0&&e.readableLength!==n[E6])r=U6();else{let n=t??[],i=e.read();i!==null&&n.push(D6(i,e.readableEncoding));let a=n.length===1?n[0]:Buffer.concat(n);r=a;let o=e.headers[`content-length`];if(typeof o==`string`&&/^\d+$/.test(o)){let e=Number(o);Number.isSafeInteger(e)&&a.length!==e&&(r=U6())}}return n[T6]=r,r},A6=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},Fye=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new C6(t,a);return Object.defineProperty(e,`method`,{get(){return`TRACE`}}),e}if(!(e===`GET`||e===`HEAD`))if(`rawBody`in r&&r.rawBody instanceof Buffer)a.body=new ReadableStream({start(e){e.enqueue(r.rawBody),e.close()}});else if(r[Mye]){let e;a.body=new ReadableStream({async pull(t){try{if(!e){let e=k6(r);if(e!==void 0){A6(t,e);return}}e||=Oe.toWeb(r).getReader();let{done:n,value:i}=await e.read();n?t.close():t.enqueue(i)}catch(e){t.error(e)}}})}else{let e=k6(r);e===void 0?a.body=Oe.toWeb(r):a.body=new ReadableStream({start(t){A6(t,e)}})}return new C6(t,a)},j6=Symbol(`getRequestCache`),M6=Symbol(`requestCache`),N6=Symbol(`incomingKey`),P6=Symbol(`urlKey`),Iye=Symbol(`methodKey`),F6=Symbol(`headersKey`),I6=Symbol(`abortControllerKey`),L6=Symbol(`getAbortController`),Lye=Symbol(`abortRequest`),R6=Symbol(`bodyBuffer`),z6=Symbol(`bodyReadPromise`),B6=Symbol(`bodyConsumedDirectly`),V6=Symbol(`bodyLockReader`),H6=Symbol(`abortReason`),U6=()=>TypeError(`Body is unusable`),W6=()=>Promise.reject(U6()),Rye=new TextDecoder,zye=e=>{if(e[B6])return W6();e[B6]=!0},Bye=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Vye=e=>(e[F6]||=w6(e[N6])).get(`content-type`)||``,Hye=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Uye=e=>{if(!Hye.test(e))return TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t===`CONNECT`||t===`TRACK`||t===`TRACE`&&e!==`TRACE`)return TypeError(`'${e}' HTTP method is unsupported.`)},G6=(e,t,n)=>{if(e[B6])return W6();let r=e.method;if(r===`GET`||r===`HEAD`)return e[j6]()[t]();let i=Uye(r);if(i)return Promise.reject(i);if(e[M6]&&r!==`TRACE`)return e[M6][t]();let a=zye(e);if(a)return a;let o=Wye(e);if(o){let t=Promise.resolve(n(o,e));return e[R6]=void 0,t}return Gye(e).then(t=>{let r=n(t,e);return e[R6]=void 0,r})},Wye=e=>{let t=e[N6];if(`rawBody`in t&&t.rawBody instanceof Buffer)return t.rawBody},K6=(e,t)=>{if(t.errored)return t.errored;let n=e[H6];return n===void 0?Error(`Client connection prematurely closed.`):n instanceof Error?n:Error(String(n))},Gye=e=>{if(e[R6])return Promise.resolve(e[R6]);if(e[z6])return e[z6];let t=e[N6];if(t.readableDidRead)return W6();let n=k6(t);if(n!==void 0)return n instanceof Error?Promise.reject(n):(e[R6]=n,Promise.resolve(n));let r=new Promise((n,r)=>{let i=[],a=!1,o=e=>{a||(a=!0,f(),e())},s=a=>{let s=t.errored??a;return!O6(t)||s&&s.code!==`ECONNRESET`?!1:(o(()=>{let o=k6(t,i);o instanceof Error?r(o):o===void 0?r(a??K6(e,t)):(e[R6]=o,n(o))}),!0)},c=e=>{i.push(D6(e,t.readableEncoding))},l=()=>{o(()=>{let t=i.length===1?i[0]:Buffer.concat(i);e[R6]=t,n(t)})},u=e=>{s(e)||o(()=>{r(e)})},d=()=>{if(t.readableEnded){l();return}s()||o(()=>{r(K6(e,t))})},f=()=>{t.off(`data`,c),t.off(`end`,l),t.off(`error`,u),t.off(`close`,d),e[z6]=void 0};t.on(`data`,c),t.on(`end`,l),t.on(`error`,u),t.on(`close`,d),queueMicrotask(()=>{a||(t.readableEnded?l():t.errored?u(t.errored):t.destroyed&&d())})});return e[z6]=r,r},q6={get method(){return this[Iye]},get url(){return this[P6]},get headers(){return this[F6]||=w6(this[N6])},[Lye](e){this[H6]===void 0&&(this[H6]=e);let t=this[I6];t&&!t.signal.aborted&&t.abort(e)},[L6](){return this[I6]||=new AbortController,this[H6]!==void 0&&!this[I6].signal.aborted&&this[I6].abort(this[H6]),this[I6]},[j6](){let e=this[L6]();if(this[M6])return this[M6];let t=this.method;if(this[B6]&&!(t===`GET`||t===`HEAD`)){this[R6]=void 0;let n={method:t===`TRACE`?`GET`:t,headers:this.headers,signal:e.signal};t!==`TRACE`&&(n.body=new ReadableStream({start(e){e.close()}}),n.duplex=`half`);let r=new C6(this[P6],n);return t===`TRACE`&&Object.defineProperty(r,`method`,{get(){return`TRACE`}}),this[M6]=r}return this[M6]=Fye(this.method,this[P6],this.headers,this[N6],e)},get body(){if(!this[B6])return this[j6]().body;let e=this[j6]();return!this[V6]&&e.body&&(this[V6]=e.body.getReader()),e.body},get bodyUsed(){return this[B6]?!0:this[M6]?this[M6].bodyUsed:!1}};Object.defineProperty(q6,`signal`,{get(){return this[L6]().signal}}),[`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`keepalive`].forEach(e=>{Object.defineProperty(q6,e,{get(){return this[j6]()[e]}})}),[`clone`,`formData`].forEach(e=>{Object.defineProperty(q6,e,{value:function(){if(this[B6]){if(e===`clone`)throw U6();return W6()}return this[j6]()[e]()}})}),Object.defineProperty(q6,`text`,{value:function(){return G6(this,`text`,e=>Rye.decode(e))}}),Object.defineProperty(q6,`arrayBuffer`,{value:function(){return G6(this,`arrayBuffer`,e=>Bye(e))}}),Object.defineProperty(q6,`blob`,{value:function(){return G6(this,`blob`,(e,t)=>{let n=Vye(t);return new Response(e,n?{headers:{"content-type":n}}:void 0).blob()})}}),Object.defineProperty(q6,`json`,{value:function(){return this[B6]?W6():this.text().then(JSON.parse)}}),Object.defineProperty(q6,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[M6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(q6,C6.prototype);const J6=Symbol(`responseCache`),Y6=Symbol(`getResponseCache`),X6=Symbol(`cache`),Z6=global.Response;var Q6=class e{#e;#t;[Y6](){let e=this[X6],t=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[X6],this[J6]||=new Z6(this.#e,t?{status:this.#t?.status,statusText:this.#t?.statusText,headers:t}:this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof Z6){let t=n[J6];if(t){this.#t=t,this[Y6]();return}this.#t=n instanceof e?n.#t:n,r=new Headers(n.headers)}else this.#t=n;(t==null||typeof t==`string`||t?.getReader!==void 0||t instanceof Blob||t instanceof Uint8Array)&&(this[X6]=[n?.status||200,t??null,r||n?.headers])}get headers(){let e=this[X6];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(e[1]===null?void 0:{"content-type":`text/plain; charset=UTF-8`}))),e[2]):this[Y6]().headers}get status(){return this[X6]?.[0]??this[Y6]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(Q6.prototype,e,{get(){return this[Y6]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(Q6.prototype,e,{value:function(){return this[Y6]()[e]()}})}),Object.defineProperty(Q6.prototype,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[J6]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(Q6,Z6),Object.setPrototypeOf(Q6.prototype,Z6.prototype);const Kye=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,qye=e=>e instanceof URL?e.href:Kye.test(e)?e:new URL(e).href,Jye=new Set([301,302,303,307,308]);Object.defineProperty(Q6,`redirect`,{value:function(e,t=302){if(!Jye.has(t))throw RangeError(`Invalid status code`);return new Q6(null,{status:t,headers:{location:qye(e)}})},writable:!0,configurable:!0}),Object.defineProperty(Q6,`json`,{value:function(e,t){let n=JSON.stringify(e);if(n===void 0)throw TypeError(`The data is not JSON serializable`);let r=t?.headers,i;return r?(i=new Headers(r),i.has(`content-type`)||i.set(`content-type`,`application/json`)):i={"content-type":`application/json`},new Q6(n,{status:t?.status??200,statusText:t?.statusText,headers:i})},writable:!0,configurable:!0}),globalThis.CloseEvent,globalThis.ErrorEvent,new Response(null,{headers:{"x-hono-already-sent":`true`}}),e1(`suggest-links`),`${Bl}`,`${Ml.join(`
449
449
  `)}`,i(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),e1(`link-preview.guarded-fetch`),e1(`link-preview.cache`),e1(`local-op-security`),e1(`clone-flow`),Fe(s),e1(`managed-artifact-persistence`),e1(`managed-rename`);var $6=i(((e,t)=>{function n(e){if(e.length===0)return;let t=Object.create(null),n=0;for(;n<e.length;++n){let t=e.charCodeAt(n);if(u[t]!==1){if(t!==47||n===0)return;break}}if(n===e.length)return;let i=e.slice(0,n).toLowerCase(),a=++n;for(;n<e.length;++n)if(u[e.charCodeAt(n)]!==1){if(n===a||r(e,n,t)===void 0)return;break}if(n!==a)return{type:i,subtype:e.slice(a,n).toLowerCase(),params:t}}function r(e,t,n){for(;t<e.length;){for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)return;let r,i=t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(u[n]!==1){if(n!==61)return;break}}if(t===e.length||(r=e.slice(i,t),++t,t===e.length))return;let a=``,o;if(e.charCodeAt(t)===34){o=++t;let n=!1;for(;t<e.length;++t){let r=e.charCodeAt(t);if(r===92){n?(o=t,n=!1):(a+=e.slice(o,t),n=!0);continue}if(r===34){if(n){o=t,n=!1;continue}a+=e.slice(o,t);break}if(n&&=(o=t-1,!1),d[r]!==1)return}if(t===e.length)return;++t}else{for(o=t;t<e.length;++t)if(u[e.charCodeAt(t)]!==1){if(t===o)return;break}a=e.slice(o,t)}r=r.toLowerCase(),n[r]===void 0&&(n[r]=a)}return n}function i(e,t){if(e.length===0)return;let n=Object.create(null),r=0;for(;r<e.length;++r)if(u[e.charCodeAt(r)]!==1){if(a(e,r,n,t)===void 0)return;break}return{type:e.slice(0,r).toLowerCase(),params:n}}function a(e,t,n,r){for(;t<e.length;){for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}if(t===e.length)return;let i,a=t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(u[n]!==1){if(n===61)break;return}}if(t===e.length)return;let o=``,s,l;if(i=e.slice(a,t),i.charCodeAt(i.length-1)===42){let n=++t;for(;t<e.length;++t){let n=e.charCodeAt(t);if(f[n]!==1){if(n!==39)return;break}}if(t===e.length)return;for(l=e.slice(n,t),++t;t<e.length&&e.charCodeAt(t)!==39;++t);if(t===e.length||(++t,t===e.length))return;s=t;let r=0;for(;t<e.length;++t){let n=e.charCodeAt(t);if(p[n]!==1){if(n===37){let n,i;if(t+2<e.length&&(n=m[e.charCodeAt(t+1)])!==-1&&(i=m[e.charCodeAt(t+2)])!==-1){let a=(n<<4)+i;o+=e.slice(s,t),o+=String.fromCharCode(a),t+=2,s=t+1,a>=128?r=2:r===0&&(r=1);continue}return}break}}if(o+=e.slice(s,t),o=c(o,l,r),o===void 0)return}else{if(++t,t===e.length)return;if(e.charCodeAt(t)===34){s=++t;let n=!1;for(;t<e.length;++t){let r=e.charCodeAt(t);if(r===92){n?(s=t,n=!1):(o+=e.slice(s,t),n=!0);continue}if(r===34){if(n){s=t,n=!1;continue}o+=e.slice(s,t);break}if(n&&=(s=t-1,!1),d[r]!==1)return}if(t===e.length)return;++t}else{for(s=t;t<e.length;++t)if(u[e.charCodeAt(t)]!==1){if(t===s)return;break}o=e.slice(s,t)}if(o=r(o,2),o===void 0)return}i=i.toLowerCase(),n[i]===void 0&&(n[i]=o)}return n}function o(e){let t;for(;;)switch(e){case`utf-8`:case`utf8`:return s.utf8;case`latin1`:case`ascii`:case`us-ascii`:case`iso-8859-1`:case`iso8859-1`:case`iso88591`:case`iso_8859-1`:case`windows-1252`:case`iso_8859-1:1987`:case`cp1252`:case`x-cp1252`:return s.latin1;case`utf16le`:case`utf-16le`:case`ucs2`:case`ucs-2`:return s.utf16le;case`base64`:return s.base64;default:if(t===void 0){t=!0,e=e.toLowerCase();continue}return s.other.bind(e)}}let s={utf8:(e,t)=>{if(e.length===0)return``;if(typeof e==`string`){if(t<2)return e;e=Buffer.from(e,`latin1`)}return e.utf8Slice(0,e.length)},latin1:(e,t)=>e.length===0?``:typeof e==`string`?e:e.latin1Slice(0,e.length),utf16le:(e,t)=>e.length===0?``:(typeof e==`string`&&(e=Buffer.from(e,`latin1`)),e.ucs2Slice(0,e.length)),base64:(e,t)=>e.length===0?``:(typeof e==`string`&&(e=Buffer.from(e,`latin1`)),e.base64Slice(0,e.length)),other:(t,n)=>{if(t.length===0)return``;typeof t==`string`&&(t=Buffer.from(t,`latin1`));try{return new TextDecoder(e).decode(t)}catch{}}};function c(e,t,n){let r=o(t);if(r)return r(e,n)}function l(e){if(typeof e!=`string`)return``;for(let t=e.length-1;t>=0;--t)switch(e.charCodeAt(t)){case 47:case 92:return e=e.slice(t+1),e===`..`||e===`.`?``:e}return e===`..`||e===`.`?``:e}let u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.exports={basename:l,convertToUTF8:c,getDecoder:o,parseContentType:n,parseDisposition:i}})),Yye=i(((e,t)=>{function n(e,t,n,r,i){for(let a=0;a<i;++a)if(e[t+a]!==n[r+a])return!1;return!0}var r=class{constructor(e,t){if(typeof t!=`function`)throw Error(`Missing match callback`);if(typeof e==`string`)e=Buffer.from(e);else if(!Buffer.isBuffer(e))throw Error(`Expected Buffer for needle, got ${typeof e}`);let n=e.length;if(this.maxMatches=1/0,this.matches=0,this._cb=t,this._lookbehindSize=0,this._needle=e,this._bufPos=0,this._lookbehind=Buffer.allocUnsafe(n),this._occ=[n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n],n>1)for(let t=0;t<n-1;++t)this._occ[e[t]]=n-1-t}reset(){this.matches=0,this._lookbehindSize=0,this._bufPos=0}push(e,t){let n;Buffer.isBuffer(e)||(e=Buffer.from(e,`latin1`));let r=e.length;for(this._bufPos=t||0;n!==r&&this.matches<this.maxMatches;)n=i(this,e);return n}destroy(){let e=this._lookbehindSize;e&&this._cb(!1,this._lookbehind,0,e,!1),this.reset()}};function i(e,t){let r=t.length,i=e._needle,o=i.length,s=-e._lookbehindSize,c=o-1,l=i[c],u=r-o,d=e._occ,f=e._lookbehind;if(s<0){for(;s<0&&s<=u;){let n=s+c,r=n<0?f[e._lookbehindSize+n]:t[n];if(r===l&&a(e,t,s,c))return e._lookbehindSize=0,++e.matches,s>-e._lookbehindSize?e._cb(!0,f,0,e._lookbehindSize+s,!1):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[r]}for(;s<0&&!a(e,t,s,r-s);)++s;if(s<0){let n=e._lookbehindSize+s;return n>0&&e._cb(!1,f,0,n,!1),e._lookbehindSize-=n,f.copy(f,0,n,e._lookbehindSize),f.set(t,e._lookbehindSize),e._lookbehindSize+=r,e._bufPos=r,r}e._cb(!1,f,0,e._lookbehindSize,!1),e._lookbehindSize=0}s+=e._bufPos;let p=i[0];for(;s<=u;){let r=t[s+c];if(r===l&&t[s]===p&&n(i,0,t,s,c))return++e.matches,s>0?e._cb(!0,t,e._bufPos,s,!0):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[r]}for(;s<r;){if(t[s]!==p||!n(t,s,i,0,r-s)){++s;continue}t.copy(f,0,s,r),e._lookbehindSize=r-s;break}return s>0&&e._cb(!1,t,e._bufPos,s<r?s:r,!0),e._bufPos=r,r}function a(e,t,n,r){let i=e._lookbehind,a=e._lookbehindSize,o=e._needle;for(let e=0;e<r;++e,++n)if((n<0?i[a+n]:t[n])!==o[e])return!1;return!0}t.exports=r})),Xye=i(((e,n)=>{let{Readable:r,Writable:i}=t(`stream`),a=Yye(),{basename:o,convertToUTF8:s,getDecoder:c,parseContentType:l,parseDisposition:u}=$6(),d=Buffer.from(`\r
450
450
  `),f=Buffer.from(`\r`),p=Buffer.from(`-`);function m(){}let h=16*1024;var g=class{constructor(e){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name=``,this.value=``,this.crlf=0,this.cb=e}reset(){this.header=Object.create(null),this.pairCount=0,this.byteCount=0,this.state=0,this.name=``,this.value=``,this.crlf=0}push(e,t,n){let r=t;for(;t<n;)switch(this.state){case 0:{let i=!1;for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(w[n]!==1){if(n!==58||(this.name+=e.latin1Slice(r,t),this.name.length===0))return-1;++t,i=!0,this.state=1;break}}if(!i){this.name+=e.latin1Slice(r,t);break}}case 1:{let i=!1;for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(n!==32&&n!==9){r=t,i=!0,this.state=2;break}}if(!i)break}case 2:switch(this.crlf){case 0:for(;t<n;++t){if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];if(T[n]!==1){if(n!==13)return-1;++this.crlf;break}}this.value+=e.latin1Slice(r,t++);break;case 1:if(this.byteCount===h||(++this.byteCount,e[t++]!==10))return-1;++this.crlf;break;case 2:{if(this.byteCount===h)return-1;++this.byteCount;let n=e[t];n===32||n===9?(r=t,this.crlf=0):(++this.pairCount<2e3&&(this.name=this.name.toLowerCase(),this.header[this.name]===void 0?this.header[this.name]=[this.value]:this.header[this.name].push(this.value)),n===13?(++this.crlf,++t):(r=t,this.crlf=0,this.state=0,this.name=``,this.value=``));break}case 3:{if(this.byteCount===h||(++this.byteCount,e[t++]!==10))return-1;let n=this.header;return this.reset(),this.cb(n),t}}break}return t}},_=class extends r{constructor(e,t){super(e),this.truncated=!1,this._readcb=null,this.once(`end`,()=>{if(this._read(),--t._fileEndsLeft===0&&t._finalcb){let e=t._finalcb;t._finalcb=null,process.nextTick(e)}})}_read(e){let t=this._readcb;t&&(this._readcb=null,t())}};let v={push:(e,t)=>{},destroy:()=>{}};function y(e,t){let n=e._writecb;e._writecb=null,t?e.destroy(t):n&&n()}function b(e,t){return e}var x=class extends i{constructor(e){let t={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.highWaterMark==`number`?e.highWaterMark:void 0};if(super(t),!e.conType.params||typeof e.conType.params.boundary!=`string`)throw Error(`Multipart: Boundary not found`);let n=e.conType.params.boundary,r=typeof e.defParamCharset==`string`&&e.defParamCharset?c(e.defParamCharset):b,i=e.defCharset||`utf8`,h=e.preservePath,y={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.fileHwm==`number`?e.fileHwm:void 0},x=e.limits,S=x&&typeof x.fieldSize==`number`?x.fieldSize:1*1024*1024,C=x&&typeof x.fileSize==`number`?x.fileSize:1/0,w=x&&typeof x.files==`number`?x.files:1/0,T=x&&typeof x.fields==`number`?x.fields:1/0,E=x&&typeof x.parts==`number`?x.parts:1/0,D=-1,ee=0,te=0,ne=!1;this._fileEndsLeft=0,this._fileStream=void 0,this._complete=!1;let re=0,ie,ae=0,oe,O,se,k,ce=!1,le=!1,ue=!1;this._hparser=null;let A=new g(e=>{this._hparser=null,ne=!1,se=`text/plain`,oe=i,O=`7bit`,k=void 0,ce=!1;let t;if(!e[`content-disposition`]){ne=!0;return}let n=u(e[`content-disposition`][0],r);if(!n||n.type!==`form-data`){ne=!0;return}if(n.params&&(n.params.name&&(k=n.params.name),n.params[`filename*`]?t=n.params[`filename*`]:n.params.filename&&(t=n.params.filename),t!==void 0&&!h&&(t=o(t))),e[`content-type`]){let t=l(e[`content-type`][0]);t&&(se=`${t.type}/${t.subtype}`,t.params&&typeof t.params.charset==`string`&&(oe=t.params.charset.toLowerCase()))}if(e[`content-transfer-encoding`]&&(O=e[`content-transfer-encoding`][0].toLowerCase()),se===`application/octet-stream`||t!==void 0){if(te===w){le||(le=!0,this.emit(`filesLimit`)),ne=!0;return}if(++te,this.listenerCount(`file`)===0){ne=!0;return}re=0,this._fileStream=new _(y,this),++this._fileEndsLeft,this.emit(`file`,k,this._fileStream,{filename:t,encoding:O,mimeType:se})}else{if(ee===T){ue||(ue=!0,this.emit(`fieldsLimit`)),ne=!0;return}if(++ee,this.listenerCount(`field`)===0){ne=!0;return}ie=[],ae=0}}),j=0,de=(e,t,n,r,i)=>{retrydata:for(;t;){if(this._hparser!==null){let e=this._hparser.push(t,n,r);if(e===-1){this._hparser=null,A.reset(),this.emit(`error`,Error(`Malformed part header`));break}n=e}if(n===r)break;if(j!==0){if(j===1){switch(t[n]){case 45:j=2,++n;break;case 13:j=3,++n;break;default:j=0}if(n===r)return}if(j===2){if(j=0,t[n]===45){this._complete=!0,this._bparser=v;return}let e=this._writecb;this._writecb=m,de(!1,p,0,1,!1),this._writecb=e}else if(j===3)if(j=0,t[n]===10){if(++n,D>=E||(this._hparser=A,n===r))break;continue retrydata}else{let e=this._writecb;this._writecb=m,de(!1,f,0,1,!1),this._writecb=e}}if(!ne){if(this._fileStream){let e,a=Math.min(r-n,C-re);i?e=t.slice(n,n+a):(e=Buffer.allocUnsafe(a),t.copy(e,0,n,n+a)),re+=e.length,re===C?(e.length>0&&this._fileStream.push(e),this._fileStream.emit(`limit`),this._fileStream.truncated=!0,ne=!0):this._fileStream.push(e)||(this._writecb&&(this._fileStream._readcb=this._writecb),this._writecb=null)}else if(ie!==void 0){let e,a=Math.min(r-n,S-ae);i?e=t.slice(n,n+a):(e=Buffer.allocUnsafe(a),t.copy(e,0,n,n+a)),ae+=a,ie.push(e),ae===S&&(ne=!0,ce=!0)}}break}if(e){if(j=1,this._fileStream)this._fileStream.push(null),this._fileStream=null;else if(ie!==void 0){let e;switch(ie.length){case 0:e=``;break;case 1:e=s(ie[0],oe,0);break;default:e=s(Buffer.concat(ie,ae),oe,0)}ie=void 0,ae=0,this.emit(`field`,k,e,{nameTruncated:!1,valueTruncated:ce,encoding:O,mimeType:se})}++D===E&&this.emit(`partsLimit`)}};this._bparser=new a(`\r\n--${n}`,de),this._writecb=null,this._finalcb=null,this.write(d)}static detect(e){return e.type===`multipart`&&e.subtype===`form-data`}_write(e,t,n){this._writecb=n,this._bparser.push(e,0),this._writecb&&y(this)}_destroy(e,t){this._hparser=null,this._bparser=v,e||=C(this);let n=this._fileStream;n&&(this._fileStream=null,n.destroy(e)),t(e)}_final(e){if(this._bparser.destroy(),!this._complete)return e(Error(`Unexpected end of form`));this._fileEndsLeft?this._finalcb=S.bind(null,this,e):S(this,e)}};function S(e,t,n){if(n)return t(n);n=C(e),t(n)}function C(e){if(e._hparser)return Error(`Malformed part header`);let t=e._fileStream;if(t&&(e._fileStream=null,t.destroy(Error(`Unexpected end of file`))),!e._complete)return Error(`Unexpected end of form`)}let w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];n.exports=x})),Zye=i(((e,n)=>{let{Writable:r}=t(`stream`),{getDecoder:i}=$6();var a=class extends r{constructor(e){let t={autoDestroy:!0,emitClose:!0,highWaterMark:typeof e.highWaterMark==`number`?e.highWaterMark:void 0};super(t);let n=e.defCharset||`utf8`;e.conType.params&&typeof e.conType.params.charset==`string`&&(n=e.conType.params.charset),this.charset=n;let r=e.limits;this.fieldSizeLimit=r&&typeof r.fieldSize==`number`?r.fieldSize:1*1024*1024,this.fieldsLimit=r&&typeof r.fields==`number`?r.fields:1/0,this.fieldNameSizeLimit=r&&typeof r.fieldNameSize==`number`?r.fieldNameSize:100,this._inKey=!0,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,this._fields=0,this._key=``,this._val=``,this._byte=-2,this._lastPos=0,this._encode=0,this._decoder=i(n)}static detect(e){return e.type===`application`&&e.subtype===`x-www-form-urlencoded`}_write(e,t,n){if(this._fields>=this.fieldsLimit)return n();let r=0,i=e.length;if(this._lastPos=0,this._byte!==-2){if(r=o(this,e,r,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();this._inKey?++this._bytesKey:++this._bytesVal}main:for(;r<i;)if(this._inKey){for(r=s(this,e,r,i);r<i;){switch(e[r]){case 61:this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._key=this._decoder(this._key,this._encode),this._encode=0,this._inKey=!1;continue main;case 38:if(this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._key=this._decoder(this._key,this._encode),this._encode=0,this._bytesKey>0&&this.emit(`field`,this._key,``,{nameTruncated:this._keyTrunc,valueTruncated:!1,encoding:this.charset,mimeType:`text/plain`}),this._key=``,this._val=``,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit(`fieldsLimit`),n();continue;case 43:this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._key+=` `,this._lastPos=r+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r)),this._lastPos=r+1,this._byte=-1,r=o(this,e,r+1,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();++this._bytesKey,r=s(this,e,r,i);continue}++r,++this._bytesKey,r=s(this,e,r,i)}this._lastPos<r&&(this._key+=e.latin1Slice(this._lastPos,r))}else{for(r=c(this,e,r,i);r<i;){switch(e[r]){case 38:if(this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._lastPos=++r,this._inKey=!0,this._val=this._decoder(this._val,this._encode),this._encode=0,(this._bytesKey>0||this._bytesVal>0)&&this.emit(`field`,this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:`text/plain`}),this._key=``,this._val=``,this._keyTrunc=!1,this._valTrunc=!1,this._bytesKey=0,this._bytesVal=0,++this._fields>=this.fieldsLimit)return this.emit(`fieldsLimit`),n();continue main;case 43:this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._val+=` `,this._lastPos=r+1;break;case 37:if(this._encode===0&&(this._encode=1),this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r)),this._lastPos=r+1,this._byte=-1,r=o(this,e,r+1,i),r===-1)return n(Error(`Malformed urlencoded form`));if(r>=i)return n();++this._bytesVal,r=c(this,e,r,i);continue}++r,++this._bytesVal,r=c(this,e,r,i)}this._lastPos<r&&(this._val+=e.latin1Slice(this._lastPos,r))}n()}_final(e){if(this._byte!==-2)return e(Error(`Malformed urlencoded form`));(!this._inKey||this._bytesKey>0||this._bytesVal>0)&&(this._inKey?this._key=this._decoder(this._key,this._encode):this._val=this._decoder(this._val,this._encode),this.emit(`field`,this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:`text/plain`})),e()}};function o(e,t,n,r){if(n>=r)return r;if(e._byte===-1){let i=l[t[n++]];if(i===-1)return-1;if(i>=8&&(e._encode=2),n<r){let r=l[t[n++]];if(r===-1)return-1;e._inKey?e._key+=String.fromCharCode((i<<4)+r):e._val+=String.fromCharCode((i<<4)+r),e._byte=-2,e._lastPos=n}else e._byte=i}else{let r=l[t[n++]];if(r===-1)return-1;e._inKey?e._key+=String.fromCharCode((e._byte<<4)+r):e._val+=String.fromCharCode((e._byte<<4)+r),e._byte=-2,e._lastPos=n}return n}function s(e,t,n,r){if(e._bytesKey>e.fieldNameSizeLimit){for(e._keyTrunc||e._lastPos<n&&(e._key+=t.latin1Slice(e._lastPos,n-1)),e._keyTrunc=!0;n<r;++n){let r=t[n];if(r===61||r===38)break;++e._bytesKey}e._lastPos=n}return n}function c(e,t,n,r){if(e._bytesVal>e.fieldSizeLimit){for(e._valTrunc||e._lastPos<n&&(e._val+=t.latin1Slice(e._lastPos,n-1)),e._valTrunc=!0;n<r&&t[n]!==38;++n)++e._bytesVal;e._lastPos=n}return n}let l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];n.exports=a}));i(((e,t)=>{let{parseContentType:n}=$6();function r(e){let t=e.headers,r=n(t[`content-type`]);if(!r)throw Error(`Malformed content type`);for(let n of i){if(!n.detect(r))continue;let i={limits:e.limits,headers:t,conType:r,highWaterMark:void 0,fileHwm:void 0,defCharset:void 0,defParamCharset:void 0,preservePath:!1};return e.highWaterMark&&(i.highWaterMark=e.highWaterMark),e.fileHwm&&(i.fileHwm=e.fileHwm),i.defCharset=e.defCharset,i.defParamCharset=e.defParamCharset,i.preservePath=e.preservePath,new n(i)}throw Error(`Unsupported content type: ${t[`content-type`]}`)}let i=[Xye(),Zye()].filter(function(e){return typeof e.detect==`function`});t.exports=e=>{if((typeof e!=`object`||!e)&&(e={}),typeof e.headers!=`object`||e.headers===null||typeof e.headers[`content-type`]!=`string`)throw Error(`Missing Content-Type`);return r(e)}}))(),e1(`rename-log`),y6.project,Object.fromEntries(Object.entries(Hl).map(([e,t])=>[t,e])),[`These are patterns to adapt to your domain, not a layout to copy verbatim.`,"To build a variant: create your own folders (via `write` or your editor) and reuse only the ideas that fit.","To adopt this pack as-is: re-run without `--dry-run`."].join(`
451
451
  `),Object.assign({"3g2":`video/3gpp2`,"3gp":`video/3gpp`,"3gpp":`video/3gpp`,"3mf":`model/3mf`,aac:`audio/aac`,ac:`application/pkix-attr-cert`,adp:`audio/adpcm`,adts:`audio/aac`,ai:`application/postscript`,aml:`application/automationml-aml+xml`,amlx:`application/automationml-amlx+zip`,amr:`audio/amr`,apng:`image/apng`,appcache:`text/cache-manifest`,appinstaller:`application/appinstaller`,appx:`application/appx`,appxbundle:`application/appxbundle`,asc:`application/pgp-keys`,atom:`application/atom+xml`,atomcat:`application/atomcat+xml`,atomdeleted:`application/atomdeleted+xml`,atomsvc:`application/atomsvc+xml`,au:`audio/basic`,avci:`image/avci`,avcs:`image/avcs`,avif:`image/avif`,aw:`application/applixware`,bdoc:`application/bdoc`,bin:`application/octet-stream`,bmp:`image/bmp`,bpk:`application/octet-stream`,btf:`image/prs.btif`,btif:`image/prs.btif`,buffer:`application/octet-stream`,ccxml:`application/ccxml+xml`,cdfx:`application/cdfx+xml`,cdmia:`application/cdmi-capability`,cdmic:`application/cdmi-container`,cdmid:`application/cdmi-domain`,cdmio:`application/cdmi-object`,cdmiq:`application/cdmi-queue`,cer:`application/pkix-cert`,cgm:`image/cgm`,cjs:`application/node`,class:`application/java-vm`,coffee:`text/coffeescript`,conf:`text/plain`,cpl:`application/cpl+xml`,cpt:`application/mac-compactpro`,crl:`application/pkix-crl`,css:`text/css`,csv:`text/csv`,cu:`application/cu-seeme`,cwl:`application/cwl`,cww:`application/prs.cww`,davmount:`application/davmount+xml`,dbk:`application/docbook+xml`,deb:`application/octet-stream`,def:`text/plain`,deploy:`application/octet-stream`,dib:`image/bmp`,"disposition-notification":`message/disposition-notification`,dist:`application/octet-stream`,distz:`application/octet-stream`,dll:`application/octet-stream`,dmg:`application/octet-stream`,dms:`application/octet-stream`,doc:`application/msword`,dot:`application/msword`,dpx:`image/dpx`,drle:`image/dicom-rle`,dsc:`text/prs.lines.tag`,dssc:`application/dssc+der`,dtd:`application/xml-dtd`,dump:`application/octet-stream`,dwd:`application/atsc-dwd+xml`,ear:`application/java-archive`,ecma:`application/ecmascript`,elc:`application/octet-stream`,emf:`image/emf`,eml:`message/rfc822`,emma:`application/emma+xml`,emotionml:`application/emotionml+xml`,eps:`application/postscript`,epub:`application/epub+zip`,exe:`application/octet-stream`,exi:`application/exi`,exp:`application/express`,exr:`image/aces`,ez:`application/andrew-inset`,fdf:`application/fdf`,fdt:`application/fdt+xml`,fits:`image/fits`,g3:`image/g3fax`,gbr:`application/rpki-ghostbusters`,geojson:`application/geo+json`,gif:`image/gif`,glb:`model/gltf-binary`,gltf:`model/gltf+json`,gml:`application/gml+xml`,gpx:`application/gpx+xml`,gram:`application/srgs`,grxml:`application/srgs+xml`,gxf:`application/gxf`,gz:`application/gzip`,h261:`video/h261`,h263:`video/h263`,h264:`video/h264`,heic:`image/heic`,heics:`image/heic-sequence`,heif:`image/heif`,heifs:`image/heif-sequence`,hej2:`image/hej2k`,held:`application/atsc-held+xml`,hjson:`application/hjson`,hlp:`application/winhlp`,hqx:`application/mac-binhex40`,hsj2:`image/hsj2`,htm:`text/html`,html:`text/html`,ics:`text/calendar`,ief:`image/ief`,ifb:`text/calendar`,iges:`model/iges`,igs:`model/iges`,img:`application/octet-stream`,in:`text/plain`,ini:`text/plain`,ink:`application/inkml+xml`,inkml:`application/inkml+xml`,ipfix:`application/ipfix`,iso:`application/octet-stream`,its:`application/its+xml`,jade:`text/jade`,jar:`application/java-archive`,jhc:`image/jphc`,jls:`image/jls`,jp2:`image/jp2`,jpe:`image/jpeg`,jpeg:`image/jpeg`,jpf:`image/jpx`,jpg:`image/jpeg`,jpg2:`image/jp2`,jpgm:`image/jpm`,jpgv:`video/jpeg`,jph:`image/jph`,jpm:`image/jpm`,jpx:`image/jpx`,js:`text/javascript`,json:`application/json`,json5:`application/json5`,jsonld:`application/ld+json`,jsonml:`application/jsonml+json`,jsx:`text/jsx`,jt:`model/jt`,jxl:`image/jxl`,jxr:`image/jxr`,jxra:`image/jxra`,jxrs:`image/jxrs`,jxs:`image/jxs`,jxsc:`image/jxsc`,jxsi:`image/jxsi`,jxss:`image/jxss`,kar:`audio/midi`,ktx:`image/ktx`,ktx2:`image/ktx2`,less:`text/less`,lgr:`application/lgr+xml`,list:`text/plain`,litcoffee:`text/coffeescript`,log:`text/plain`,lostxml:`application/lost+xml`,lrf:`application/octet-stream`,m1v:`video/mpeg`,m21:`application/mp21`,m2a:`audio/mpeg`,m2t:`video/mp2t`,m2ts:`video/mp2t`,m2v:`video/mpeg`,m3a:`audio/mpeg`,m4a:`audio/mp4`,m4p:`application/mp4`,m4s:`video/iso.segment`,ma:`application/mathematica`,mads:`application/mads+xml`,maei:`application/mmt-aei+xml`,man:`text/troff`,manifest:`text/cache-manifest`,map:`application/json`,mar:`application/octet-stream`,markdown:`text/markdown`,mathml:`application/mathml+xml`,mb:`application/mathematica`,mbox:`application/mbox`,md:`text/markdown`,mdx:`text/mdx`,me:`text/troff`,mesh:`model/mesh`,meta4:`application/metalink4+xml`,metalink:`application/metalink+xml`,mets:`application/mets+xml`,mft:`application/rpki-manifest`,mid:`audio/midi`,midi:`audio/midi`,mime:`message/rfc822`,mj2:`video/mj2`,mjp2:`video/mj2`,mjs:`text/javascript`,mml:`text/mathml`,mods:`application/mods+xml`,mov:`video/quicktime`,mp2:`audio/mpeg`,mp21:`application/mp21`,mp2a:`audio/mpeg`,mp3:`audio/mpeg`,mp4:`video/mp4`,mp4a:`audio/mp4`,mp4s:`application/mp4`,mp4v:`video/mp4`,mpd:`application/dash+xml`,mpe:`video/mpeg`,mpeg:`video/mpeg`,mpf:`application/media-policy-dataset+xml`,mpg:`video/mpeg`,mpg4:`video/mp4`,mpga:`audio/mpeg`,mpp:`application/dash-patch+xml`,mrc:`application/marc`,mrcx:`application/marcxml+xml`,ms:`text/troff`,mscml:`application/mediaservercontrol+xml`,msh:`model/mesh`,msi:`application/octet-stream`,msix:`application/msix`,msixbundle:`application/msixbundle`,msm:`application/octet-stream`,msp:`application/octet-stream`,mtl:`model/mtl`,mts:`video/mp2t`,musd:`application/mmt-usd+xml`,mxf:`application/mxf`,mxmf:`audio/mobile-xmf`,mxml:`application/xv+xml`,n3:`text/n3`,nb:`application/mathematica`,nq:`application/n-quads`,nt:`application/n-triples`,obj:`model/obj`,oda:`application/oda`,oga:`audio/ogg`,ogg:`audio/ogg`,ogv:`video/ogg`,ogx:`application/ogg`,omdoc:`application/omdoc+xml`,onepkg:`application/onenote`,onetmp:`application/onenote`,onetoc:`application/onenote`,onetoc2:`application/onenote`,opf:`application/oebps-package+xml`,opus:`audio/ogg`,otf:`font/otf`,owl:`application/rdf+xml`,oxps:`application/oxps`,p10:`application/pkcs10`,p7c:`application/pkcs7-mime`,p7m:`application/pkcs7-mime`,p7s:`application/pkcs7-signature`,p8:`application/pkcs8`,pdf:`application/pdf`,pfr:`application/font-tdpfr`,pgp:`application/pgp-encrypted`,pkg:`application/octet-stream`,pki:`application/pkixcmp`,pkipath:`application/pkix-pkipath`,pls:`application/pls+xml`,png:`image/png`,prc:`model/prc`,prf:`application/pics-rules`,provx:`application/provenance+xml`,ps:`application/postscript`,pskcxml:`application/pskc+xml`,pti:`image/prs.pti`,qt:`video/quicktime`,raml:`application/raml+yaml`,rapd:`application/route-apd+xml`,rdf:`application/rdf+xml`,relo:`application/p2p-overlay+xml`,rif:`application/reginfo+xml`,rl:`application/resource-lists+xml`,rld:`application/resource-lists-diff+xml`,rmi:`audio/midi`,rnc:`application/relax-ng-compact-syntax`,rng:`application/xml`,roa:`application/rpki-roa`,roff:`text/troff`,rq:`application/sparql-query`,rs:`application/rls-services+xml`,rsat:`application/atsc-rsat+xml`,rsd:`application/rsd+xml`,rsheet:`application/urc-ressheet+xml`,rss:`application/rss+xml`,rtf:`text/rtf`,rtx:`text/richtext`,rusd:`application/route-usd+xml`,s3m:`audio/s3m`,sbml:`application/sbml+xml`,scq:`application/scvp-cv-request`,scs:`application/scvp-cv-response`,sdp:`application/sdp`,senmlx:`application/senml+xml`,sensmlx:`application/sensml+xml`,ser:`application/java-serialized-object`,setpay:`application/set-payment-initiation`,setreg:`application/set-registration-initiation`,sgi:`image/sgi`,sgm:`text/sgml`,sgml:`text/sgml`,shex:`text/shex`,shf:`application/shf+xml`,shtml:`text/html`,sieve:`application/sieve`,sig:`application/pgp-signature`,sil:`audio/silk`,silo:`model/mesh`,siv:`application/sieve`,slim:`text/slim`,slm:`text/slim`,sls:`application/route-s-tsid+xml`,smi:`application/smil+xml`,smil:`application/smil+xml`,snd:`audio/basic`,so:`application/octet-stream`,spdx:`text/spdx`,spp:`application/scvp-vp-response`,spq:`application/scvp-vp-request`,spx:`audio/ogg`,sql:`application/sql`,sru:`application/sru+xml`,srx:`application/sparql-results+xml`,ssdl:`application/ssdl+xml`,ssml:`application/ssml+xml`,stk:`application/hyperstudio`,stl:`model/stl`,stpx:`model/step+xml`,stpxz:`model/step-xml+zip`,stpz:`model/step+zip`,styl:`text/stylus`,stylus:`text/stylus`,svg:`image/svg+xml`,svgz:`image/svg+xml`,swidtag:`application/swid+xml`,t:`text/troff`,t38:`image/t38`,td:`application/urc-targetdesc+xml`,tei:`application/tei+xml`,teicorpus:`application/tei+xml`,text:`text/plain`,tfi:`application/thraud+xml`,tfx:`image/tiff-fx`,tif:`image/tiff`,tiff:`image/tiff`,toml:`application/toml`,tr:`text/troff`,trig:`application/trig`,ts:`video/mp2t`,tsd:`application/timestamped-data`,tsv:`text/tab-separated-values`,ttc:`font/collection`,ttf:`font/ttf`,ttl:`text/turtle`,ttml:`application/ttml+xml`,txt:`text/plain`,u3d:`model/u3d`,u8dsn:`message/global-delivery-status`,u8hdr:`message/global-headers`,u8mdn:`message/global-disposition-notification`,u8msg:`message/global`,ubj:`application/ubjson`,uri:`text/uri-list`,uris:`text/uri-list`,urls:`text/uri-list`,vcard:`text/vcard`,vrml:`model/vrml`,vtt:`text/vtt`,vxml:`application/voicexml+xml`,war:`application/java-archive`,wasm:`application/wasm`,wav:`audio/wav`,weba:`audio/webm`,webm:`video/webm`,webmanifest:`application/manifest+json`,webp:`image/webp`,wgsl:`text/wgsl`,wgt:`application/widget`,wif:`application/watcherinfo+xml`,wmf:`image/wmf`,woff:`font/woff`,woff2:`font/woff2`,wrl:`model/vrml`,wsdl:`application/wsdl+xml`,wspolicy:`application/wspolicy+xml`,x3d:`model/x3d+xml`,x3db:`model/x3d+fastinfoset`,x3dbz:`model/x3d+binary`,x3dv:`model/x3d-vrml`,x3dvz:`model/x3d+vrml`,x3dz:`model/x3d+xml`,xaml:`application/xaml+xml`,xav:`application/xcap-att+xml`,xca:`application/xcap-caps+xml`,xcs:`application/calendar+xml`,xdf:`application/xcap-diff+xml`,xdssc:`application/dssc+xml`,xel:`application/xcap-el+xml`,xenc:`application/xenc+xml`,xer:`application/patch-ops-error+xml`,xfdf:`application/xfdf`,xht:`application/xhtml+xml`,xhtml:`application/xhtml+xml`,xhvml:`application/xv+xml`,xlf:`application/xliff+xml`,xm:`audio/xm`,xml:`text/xml`,xns:`application/xcap-ns+xml`,xop:`application/xop+xml`,xpl:`application/xproc+xml`,xsd:`application/xml`,xsf:`application/prs.xsf+xml`,xsl:`application/xml`,xslt:`application/xml`,xspf:`application/xspf+xml`,xvm:`application/xv+xml`,xvml:`application/xv+xml`,yaml:`text/yaml`,yang:`application/yang`,yin:`application/yin+xml`,yml:`text/yaml`,zip:`application/zip`},{m4v:`video/mp4`,mkv:`video/x-matroska`,flac:`audio/flac`,toml:`application/toml`,lock:`text/plain`,"7z":`application/x-7z-compressed`,tar:`application/x-tar`,rar:`application/vnd.rar`,xls:`application/vnd.ms-excel`,ppt:`application/vnd.ms-powerpoint`,odt:`application/vnd.oasis.opendocument.text`,ods:`application/vnd.oasis.opendocument.spreadsheet`,odp:`application/vnd.oasis.opendocument.presentation`,pages:`application/vnd.apple.pages`,numbers:`application/vnd.apple.numbers`,key:`application/vnd.apple.keynote`,mobi:`application/x-mobipocket-ebook`}),e1(`file-ops`),e1(`search`),e1(`skill-import`),e1(`skill-install`),e1(`history`),e1(`skills-leaderboard`),e1(`timeline`),e1(`api`),B({enabled:L(),active:L(),git:B({state:H([`not-applicable`,`ready`,`missing`,`conflict`,`unavailable`]),ownership:H([`open-knowledge`,`existing`]).optional()}),applied:L().optional(),reason:H([`git-conflict`,`git-unavailable`,`config-write`]).optional()}),B({enabled:L()}).strict(),B({principalId:F().optional(),tabSessionId:F().optional(),expectedServerInstanceId:F().optional(),expectedBranch:F().optional(),expectedDocLineageEpoch:F().optional(),clientProtocolVersion:I().optional(),clientRuntimeVersion:F().optional(),clientKind:F().optional()}).loose(),e1(`conflict-storage`);const e8=_o(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),t8=eo([F(),I().int()]),n8=F();Qa({ttl:I().optional(),pollInterval:I().optional()});const Qye=B({ttl:I().optional()}),$ye=B({taskId:F()}),r8=Qa({progressToken:t8.optional(),"io.modelcontextprotocol/related-task":$ye.optional()}),i8=B({_meta:r8.optional()}),a8=i8.extend({task:Qye.optional()}),o8=B({method:F(),params:i8.loose().optional()}),s8=B({_meta:r8.optional()}),c8=B({method:F(),params:s8.loose().optional()}),l8=Qa({_meta:r8.optional()}),u8=eo([F(),I().int()]),ebe=B({jsonrpc:U(`2.0`),id:u8,...o8.shape}).strict(),tbe=B({jsonrpc:U(`2.0`),...c8.shape}).strict(),d8=B({jsonrpc:U(`2.0`),id:u8,result:l8}).strict();var nbe;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(nbe||={});const f8=B({jsonrpc:U(`2.0`),id:u8.optional(),error:B({code:I().int(),message:F(),data:R().optional()})}).strict();eo([ebe,tbe,d8,f8]),eo([d8,f8]);const p8=l8.strict(),rbe=s8.extend({requestId:u8.optional(),reason:F().optional()}),m8=c8.extend({method:U(`notifications/cancelled`),params:rbe}),h8=B({icons:z(B({src:F(),mimeType:F().optional(),sizes:z(F()).optional(),theme:H([`light`,`dark`]).optional()})).optional()}),g8=B({name:F(),title:F().optional()}),_8=g8.extend({...g8.shape,...h8.shape,version:F(),websiteUrl:F().optional(),description:F().optional()}),ibe=vo(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,io(B({form:io(B({applyDefaults:L().optional()}),V(F(),R())).optional(),url:e8.optional()}),V(F(),R()).optional())),abe=Qa({list:e8.optional(),cancel:e8.optional(),requests:Qa({sampling:Qa({createMessage:e8.optional()}).optional(),elicitation:Qa({create:e8.optional()}).optional()}).optional()}),obe=Qa({list:e8.optional(),cancel:e8.optional(),requests:Qa({tools:Qa({call:e8.optional()}).optional()}).optional()}),sbe=B({experimental:V(F(),e8).optional(),sampling:B({context:e8.optional(),tools:e8.optional()}).optional(),elicitation:ibe.optional(),roots:B({listChanged:L().optional()}).optional(),tasks:abe.optional(),extensions:V(F(),e8).optional()}),cbe=i8.extend({protocolVersion:F(),capabilities:sbe,clientInfo:_8}),lbe=o8.extend({method:U(`initialize`),params:cbe}),ube=B({experimental:V(F(),e8).optional(),logging:e8.optional(),completions:e8.optional(),prompts:B({listChanged:L().optional()}).optional(),resources:B({subscribe:L().optional(),listChanged:L().optional()}).optional(),tools:B({listChanged:L().optional()}).optional(),tasks:obe.optional(),extensions:V(F(),e8).optional()}),dbe=l8.extend({protocolVersion:F(),capabilities:ube,serverInfo:_8,instructions:F().optional()}),fbe=c8.extend({method:U(`notifications/initialized`),params:s8.optional()}),v8=o8.extend({method:U(`ping`),params:i8.optional()}),pbe=B({progress:I(),total:lo(I()),message:lo(F())}),mbe=B({...s8.shape,...pbe.shape,progressToken:t8}),y8=c8.extend({method:U(`notifications/progress`),params:mbe}),hbe=i8.extend({cursor:n8.optional()}),b8=o8.extend({params:hbe.optional()}),x8=l8.extend({nextCursor:n8.optional()}),gbe=H([`working`,`input_required`,`completed`,`failed`,`cancelled`]),S8=B({taskId:F(),status:gbe,ttl:eo([I(),Ka()]),createdAt:F(),lastUpdatedAt:F(),pollInterval:lo(I()),statusMessage:lo(F())}),C8=l8.extend({task:S8}),_be=s8.merge(S8),w8=c8.extend({method:U(`notifications/tasks/status`),params:_be}),T8=o8.extend({method:U(`tasks/get`),params:i8.extend({taskId:F()})}),E8=l8.merge(S8),D8=o8.extend({method:U(`tasks/result`),params:i8.extend({taskId:F()})});l8.loose();const O8=b8.extend({method:U(`tasks/list`)}),k8=x8.extend({tasks:z(S8)}),A8=o8.extend({method:U(`tasks/cancel`),params:i8.extend({taskId:F()})});l8.merge(S8);const j8=B({uri:F(),mimeType:lo(F()),_meta:V(F(),R()).optional()}),M8=j8.extend({text:F()}),N8=F().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),P8=j8.extend({blob:N8}),F8=H([`user`,`assistant`]),I8=B({audience:z(F8).optional(),priority:I().min(0).max(1).optional(),lastModified:aa({offset:!0}).optional()}),L8=B({...g8.shape,...h8.shape,uri:F(),description:lo(F()),mimeType:lo(F()),size:lo(I()),annotations:I8.optional(),_meta:lo(Qa({}))}),vbe=B({...g8.shape,...h8.shape,uriTemplate:F(),description:lo(F()),mimeType:lo(F()),annotations:I8.optional(),_meta:lo(Qa({}))}),ybe=b8.extend({method:U(`resources/list`)}),bbe=x8.extend({resources:z(L8)}),xbe=b8.extend({method:U(`resources/templates/list`)}),Sbe=x8.extend({resourceTemplates:z(vbe)}),R8=i8.extend({uri:F()}),Cbe=R8,wbe=o8.extend({method:U(`resources/read`),params:Cbe}),Tbe=l8.extend({contents:z(eo([M8,P8]))}),Ebe=c8.extend({method:U(`notifications/resources/list_changed`),params:s8.optional()}),Dbe=R8,Obe=o8.extend({method:U(`resources/subscribe`),params:Dbe}),kbe=R8,Abe=o8.extend({method:U(`resources/unsubscribe`),params:kbe}),jbe=s8.extend({uri:F()}),Mbe=c8.extend({method:U(`notifications/resources/updated`),params:jbe}),Nbe=B({name:F(),description:lo(F()),required:lo(L())}),Pbe=B({...g8.shape,...h8.shape,description:lo(F()),arguments:lo(z(Nbe)),_meta:lo(Qa({}))}),Fbe=b8.extend({method:U(`prompts/list`)}),Ibe=x8.extend({prompts:z(Pbe)}),Lbe=i8.extend({name:F(),arguments:V(F(),F()).optional()}),Rbe=o8.extend({method:U(`prompts/get`),params:Lbe}),z8=B({type:U(`text`),text:F(),annotations:I8.optional(),_meta:V(F(),R()).optional()}),B8=B({type:U(`image`),data:N8,mimeType:F(),annotations:I8.optional(),_meta:V(F(),R()).optional()}),V8=B({type:U(`audio`),data:N8,mimeType:F(),annotations:I8.optional(),_meta:V(F(),R()).optional()}),zbe=B({type:U(`tool_use`),name:F(),id:F(),input:V(F(),R()),_meta:V(F(),R()).optional()}),Bbe=B({type:U(`resource`),resource:eo([M8,P8]),annotations:I8.optional(),_meta:V(F(),R()).optional()}),H8=eo([z8,B8,V8,L8.extend({type:U(`resource_link`)}),Bbe]),Vbe=B({role:F8,content:H8}),Hbe=l8.extend({description:F().optional(),messages:z(Vbe)}),Ube=c8.extend({method:U(`notifications/prompts/list_changed`),params:s8.optional()}),Wbe=B({title:F().optional(),readOnlyHint:L().optional(),destructiveHint:L().optional(),idempotentHint:L().optional(),openWorldHint:L().optional()}),Gbe=B({taskSupport:H([`required`,`optional`,`forbidden`]).optional()}),U8=B({...g8.shape,...h8.shape,description:F().optional(),inputSchema:B({type:U(`object`),properties:V(F(),e8).optional(),required:z(F()).optional()}).catchall(R()),outputSchema:B({type:U(`object`),properties:V(F(),e8).optional(),required:z(F()).optional()}).catchall(R()).optional(),annotations:Wbe.optional(),execution:Gbe.optional(),_meta:V(F(),R()).optional()}),Kbe=b8.extend({method:U(`tools/list`)}),qbe=x8.extend({tools:z(U8)}),W8=l8.extend({content:z(H8).default([]),structuredContent:V(F(),R()).optional(),isError:L().optional()});W8.or(l8.extend({toolResult:R()}));const Jbe=a8.extend({name:F(),arguments:V(F(),R()).optional()}),Ybe=o8.extend({method:U(`tools/call`),params:Jbe}),Xbe=c8.extend({method:U(`notifications/tools/list_changed`),params:s8.optional()});B({autoRefresh:L().default(!0),debounceMs:I().int().nonnegative().default(300)});const G8=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Zbe=i8.extend({level:G8}),Qbe=o8.extend({method:U(`logging/setLevel`),params:Zbe}),$be=s8.extend({level:G8,logger:F().optional(),data:R()}),exe=c8.extend({method:U(`notifications/message`),params:$be}),txe=B({hints:z(B({name:F().optional()})).optional(),costPriority:I().min(0).max(1).optional(),speedPriority:I().min(0).max(1).optional(),intelligencePriority:I().min(0).max(1).optional()}),nxe=B({mode:H([`auto`,`required`,`none`]).optional()}),rxe=B({type:U(`tool_result`),toolUseId:F().describe(`The unique identifier for the corresponding tool call.`),content:z(H8).default([]),structuredContent:B({}).loose().optional(),isError:L().optional(),_meta:V(F(),R()).optional()}),ixe=no(`type`,[z8,B8,V8]),K8=no(`type`,[z8,B8,V8,zbe,rxe]),axe=B({role:F8,content:eo([K8,z(K8)]),_meta:V(F(),R()).optional()}),oxe=a8.extend({messages:z(axe),modelPreferences:txe.optional(),systemPrompt:F().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:I().optional(),maxTokens:I().int(),stopSequences:z(F()).optional(),metadata:e8.optional(),tools:z(U8).optional(),toolChoice:nxe.optional()}),sxe=o8.extend({method:U(`sampling/createMessage`),params:oxe}),cxe=l8.extend({model:F(),stopReason:lo(H([`endTurn`,`stopSequence`,`maxTokens`]).or(F())),role:F8,content:ixe}),lxe=l8.extend({model:F(),stopReason:lo(H([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(F())),role:F8,content:eo([K8,z(K8)])}),uxe=B({type:U(`boolean`),title:F().optional(),description:F().optional(),default:L().optional()}),dxe=B({type:U(`string`),title:F().optional(),description:F().optional(),minLength:I().optional(),maxLength:I().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:F().optional()}),fxe=B({type:H([`number`,`integer`]),title:F().optional(),description:F().optional(),minimum:I().optional(),maximum:I().optional(),default:I().optional()}),pxe=B({type:U(`string`),title:F().optional(),description:F().optional(),enum:z(F()),default:F().optional()}),mxe=B({type:U(`string`),title:F().optional(),description:F().optional(),oneOf:z(B({const:F(),title:F()})),default:F().optional()}),hxe=eo([eo([B({type:U(`string`),title:F().optional(),description:F().optional(),enum:z(F()),enumNames:z(F()).optional(),default:F().optional()}),eo([pxe,mxe]),eo([B({type:U(`array`),title:F().optional(),description:F().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({type:U(`string`),enum:z(F())}),default:z(F()).optional()}),B({type:U(`array`),title:F().optional(),description:F().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({anyOf:z(B({const:F(),title:F()}))}),default:z(F()).optional()})])]),uxe,dxe,fxe]),gxe=eo([a8.extend({mode:U(`form`).optional(),message:F(),requestedSchema:B({type:U(`object`),properties:V(F(),hxe),required:z(F()).optional()})}),a8.extend({mode:U(`url`),message:F(),elicitationId:F(),url:F().url()})]),_xe=o8.extend({method:U(`elicitation/create`),params:gxe}),vxe=s8.extend({elicitationId:F()}),yxe=c8.extend({method:U(`notifications/elicitation/complete`),params:vxe}),bxe=l8.extend({action:H([`accept`,`decline`,`cancel`]),content:vo(e=>e===null?void 0:e,V(F(),eo([F(),I(),L(),z(F())])).optional())}),xxe=B({type:U(`ref/resource`),uri:F()}),Sxe=B({type:U(`ref/prompt`),name:F()}),Cxe=i8.extend({ref:eo([Sxe,xxe]),argument:B({name:F(),value:F()}),context:B({arguments:V(F(),F()).optional()}).optional()}),wxe=o8.extend({method:U(`completion/complete`),params:Cxe}),Txe=l8.extend({completion:Qa({values:z(F()).max(100),total:lo(I().int()),hasMore:lo(L())})}),Exe=B({uri:F().startsWith(`file://`),name:F().optional(),_meta:V(F(),R()).optional()}),Dxe=o8.extend({method:U(`roots/list`),params:i8.optional()}),Oxe=l8.extend({roots:z(Exe)}),kxe=c8.extend({method:U(`notifications/roots/list_changed`),params:s8.optional()});eo([v8,lbe,wxe,Qbe,Rbe,Fbe,ybe,xbe,wbe,Obe,Abe,Ybe,Kbe,T8,D8,O8,A8]),eo([m8,y8,fbe,kxe,w8]),eo([p8,cxe,lxe,bxe,Oxe,E8,k8,C8]),eo([v8,sxe,_xe,Dxe,T8,D8,O8,A8]),eo([m8,y8,exe,Mbe,Ebe,Xbe,Ube,w8,yxe]),eo([p8,dbe,Txe,Hbe,Ibe,bbe,Sbe,Tbe,W8,qbe,E8,k8,C8]);var Axe;(function(e){e.Completable=`McpCompletable`})(Axe||={});var jxe=global.Request,q8=class extends jxe{constructor(e,t){typeof e==`object`&&J8 in e&&(e=e[J8]()),t?.body?.getReader!==void 0&&(t.duplex??=`half`),super(e,t)}},Mxe=e=>{let t=[],n=e.rawHeaders;for(let e=0;e<n.length;e+=2){let{[e]:r,[e+1]:i}=n;r.charCodeAt(0)!==58&&t.push([r,i])}return new Headers(t)},Nxe=Symbol(`wrapBodyStream`),Pxe=(e,t,n,r,i)=>{let a={method:e,headers:n,signal:i.signal};if(e===`TRACE`){a.method=`GET`;let e=new q8(t,a);return Object.defineProperty(e,`method`,{get(){return`TRACE`}}),e}if(!(e===`GET`||e===`HEAD`))if(`rawBody`in r&&r.rawBody instanceof Buffer)a.body=new ReadableStream({start(e){e.enqueue(r.rawBody),e.close()}});else if(r[Nxe]){let e;a.body=new ReadableStream({async pull(t){try{e||=Ne.toWeb(r).getReader();let{done:n,value:i}=await e.read();n?t.close():t.enqueue(i)}catch(e){t.error(e)}}})}else a.body=Ne.toWeb(r);return new q8(t,a)},J8=Symbol(`getRequestCache`),Y8=Symbol(`requestCache`),X8=Symbol(`incomingKey`),Z8=Symbol(`urlKey`),Fxe=Symbol(`headersKey`),Q8=Symbol(`abortControllerKey`),$8={get method(){return this[X8].method||`GET`},get url(){return this[Z8]},get headers(){return this[Fxe]||=Mxe(this[X8])},[Symbol(`getAbortController`)](){return this[J8](),this[Q8]},[J8](){return this[Q8]||=new AbortController,this[Y8]||=Pxe(this.method,this[Z8],this.headers,this[X8],this[Q8])}};[`body`,`bodyUsed`,`cache`,`credentials`,`destination`,`integrity`,`mode`,`redirect`,`referrer`,`referrerPolicy`,`signal`,`keepalive`].forEach(e=>{Object.defineProperty($8,e,{get(){return this[J8]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty($8,e,{value:function(){return this[J8]()[e]()}})}),Object.defineProperty($8,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[Y8]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf($8,q8.prototype);var e5=Symbol(`responseCache`),t5=Symbol(`getResponseCache`),n5=Symbol(`cache`),r5=global.Response,i5=class e{#e;#t;[t5](){return delete this[n5],this[e5]||=new r5(this.#e,this.#t)}constructor(t,n){let r;if(this.#e=t,n instanceof e){let e=n[e5];if(e){this.#t=e,this[t5]();return}else this.#t=n.#t,r=new Headers(n.#t.headers)}else this.#t=n;(typeof t==`string`||t?.getReader!==void 0||t instanceof Blob||t instanceof Uint8Array)&&(this[n5]=[n?.status||200,t,r||n?.headers])}get headers(){let e=this[n5];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||{"content-type":`text/plain; charset=UTF-8`})),e[2]):this[t5]().headers}get status(){return this[n5]?.[0]??this[t5]().status}get ok(){let e=this.status;return e>=200&&e<300}};[`body`,`bodyUsed`,`redirected`,`statusText`,`trailers`,`type`,`url`].forEach(e=>{Object.defineProperty(i5.prototype,e,{get(){return this[t5]()[e]}})}),[`arrayBuffer`,`blob`,`clone`,`formData`,`json`,`text`].forEach(e=>{Object.defineProperty(i5.prototype,e,{value:function(){return this[t5]()[e]()}})}),Object.defineProperty(i5.prototype,Symbol.for(`nodejs.util.inspect.custom`),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[e5]},{...t,depth:e==null?null:e-1})}`}}),Object.setPrototypeOf(i5,r5),Object.setPrototypeOf(i5.prototype,r5.prototype),global.crypto===void 0&&(global.crypto=Me),new Le,t1(()=>{}),[`[Requires: Hocuspocus server] Unified validation audit: every content problem — markdown-lint violations AND broken internal links — in one read-only call, grouped by the file to fix.`,``,"- No args → audit every in-scope `.md`/`.mdx` doc; pass `path` to scope to a folder or a single file.","- To CHECK whether links resolve, use this tool: each broken link is reported under the SOURCE doc that contains it, at the offending line. (The `links` tool is the navigation/graph reader — backlinks, forward links, orphans, hubs — not the validation surface.)",``,"Each diagnostic carries a `source` naming the validator ('markdownlint' rule violations; 'links' broken internal links), a `code` (e.g. MD010, dead-link), `message`, a 0-based LSP `range` (for links: line exact, column approximate), and `severity` ('error' | 'warning' — broken links default to warnings; the project's `validation.links` setting can raise them to errors or hide them). Only files with at least one problem are listed, plus `fileCount`/`errorCount`/`warningCount` totals. Output (text and structured) is capped at 10 files × 10 diagnostics per file, with explicit '… and N more' indicators; the counts always reflect the full scan — re-run with `path` scoped to a folder or file to see what was omitted.",``,"Read-only: nothing is modified. Auto-fix fixable lint findings with `lint({ document, fix: true })`; broken links need content edits via `edit`/`write`."].join(`
@@ -806,7 +806,7 @@ caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?
806
806
  `?0:1:D!==` `&&D!==` `&&D!==`
807
807
  `&&(_+=1)}}else d+=C}if(y)return{op:`glob`,pattern:d};if(p){if(_!==null&&_>0){m[m.length]=d,d=``;for(var ee=1;ee<_;ee+=1)m[m.length]=``}return(d!==``||h&&m.length===0)&&(m[m.length]=d),m}return d}).reduce(function(e,t){return t===void 0||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e[e.length]=t,e;var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?(e[e.length]=n[0],e):(n.filter(Boolean).forEach(function(t){e[e.length]=m.test(t)?JSON.parse(t.split(d)[1]):t}),e)},[]):r}}));i((e=>{e.quote=zxe(),e.parse=Bxe()}))(),["**STOP — when the project has `.ok/`, do NOT use native `Read`/`Grep`/`Glob` on in-scope `.md`/`.mdx`; use `exec` (this tool).** Native tools skip the frontmatter, backlinks, unresolved comments, shadow-repo activity, and git history `exec` returns per wiki file. Reserve native tools for source code, non-markdown, and projects without `.ok/`. (Full rule + escape hatch: the `open-knowledge` skill.)",``,`Run a read-only bash-like command against the project content directory. Returns raw stdout plus enriched metadata for every wiki file referenced (frontmatter, backlink/forward-link counts, shadow-repo activity with agent/human attribution).`,``,"`⚠ N unresolved comment(s)` = open human review requests — factor in before editing, and report them.",``,"Allowlist: cat, ls, grep, find, head, tail, wc, sort, uniq, cut. One command or a pipe (|) per call — NOT a shell: `&&`, `;`, redirections, subshells, and writes are rejected. To do several things, make separate exec calls or pass multiple paths to one command (e.g. `ls -A a b c`, `cat a b c`).",``,"cwd: the command runs in the explicit absolute `cwd` you pass, or in the MCP client's only advertised root when there is exactly one. If the client has zero or multiple roots, pass `cwd` explicitly. Paths inside the command resolve relative to that cwd; traversal above it is rejected.",``,"Stdout provenance headers (GNU-style): `ls <dir>/` prepends `<dir>/:`, single-file `cat`/`head`/`tail` prepends `==> <path> <==`, so the subject of the command is visible in raw output. Multi-file `cat a b` emits no header — the `enrichedPaths` array still lists every file. `head`/`tail` used as pipe trimmers (no file arg) defer to the upstream producer.",``,`Examples:`,'- `exec({ command: "cat articles/auth.md" })` — file contents + full enrichment','- `exec({ command: "ls articles/" })` — listing + per-file enrichment (slim)','- `exec({ command: "grep -rn oauth articles/ | head -5" })` — pipe with enrichment on matched files','- `exec({ command: "ls", cwd: "/abs/path/to/other-repo" })` — run in a different project'].join(`
808
808
  `),["Resolve the browser-reachable preview URL for an OpenKnowledge project (optionally for a specific doc). Opening a preview counts as demand: when no OK server is running for the project, this call auto-starts one (same `OK_MCP_AUTOSTART` gate and spawn timeout as the read/write tools) and waits briefly for the preview UI to bind — a cold first call can take a few seconds; calls against a running system answer immediately.",``,"Per-response `previewUrl` fields on read/write tools are ROUTE-ONLY (`/#/<doc>`, no host:port) — they identify which doc to preview, not a URL to open by itself. Call this tool to get the full, openable URL.",``,"This is THE way to open a doc OR a loose file in a browser, and the only way to force a browser when the OK Desktop app is installed (the `ok open` CLI prefers Desktop). Use it when YOUR host opens the URL itself: navigate your in-app / embedded browser to the returned `url`, or — only on a stdio host with no browser tool — `open` it in the system browser. Do not hunt for the URL via `ok ps`/`ok status` or by guessing a port — this tool returns it. Claude Code Desktop opens its in-app Browser pane with `preview_start({url})` then `navigate({url})` to move; a pure stdio CLI with no browser uses `ok open <doc>` to open in the OK Desktop app.",``,"If you are running INSIDE an OpenKnowledge surface — the desktop app’s built-in terminal or its in-app agent panel — the response leads with an `ok open …` steer and returns it as `okOpenCommand`. Run that instead: the user is already looking at the app, so a localhost URL in your reply is noise at best and a dead link at worst. Never paste `url` into your answer in that case.",``,"Returns `{ url: null, baseUrl: null, running: false, autoOpen }` + a recovery hint only when no UI could be reached (auto-start disabled via `OK_MCP_AUTOSTART=0`, no spawn authority in this registration, or the UI did not bind in time) — the hint names the right command for the actual state.",``,"To open a single markdown file that may live OUTSIDE any Open Knowledge project (a loose file, or a doc in a different git worktree), pass `file` with an absolute path: the tool finds the running session whose content directory contains it and returns that session’s URL, then navigate your in-app browser there. `document`/`folder` are for a doc in the current project; `file` is the out-of-project form.",``,`**Parameters:**`,"- `document` (optional) — Extension-less doc path in the current project (e.g. `specs/foo/SPEC`). Omit for the UI root URL.","- `folder` (optional) — Folder path in the current project (e.g. `specs/foo`); returns the `…/#/<folder>/` route. Mutually exclusive with `document`.","- `skill` (optional) — A skill to open in the editor: `{ name, scope? }` (scope `project` default). Returns the `…/#/__skill__/<scope>/<name>` route. Mutually exclusive with `document`/`folder`/`file`.","- `file` (optional) — Absolute path to a single markdown file, including one outside any project. Resolves to the running single-file / worktree session serving it. Mutually exclusive with `document`/`folder`/`skill`; `cwd` is ignored when set.","- `cwd` (optional) — Project root (see `cwd` description below)."].join(`
809
- `),F().optional().describe(`Extension-less doc path to resolve a preview URL for (e.g. "specs/foo/SPEC"). Omit to get the UI root URL.`),F().min(1).optional().describe('Folder path to resolve a folder-route preview URL for (e.g. "specs/foo"); returns the `…/#/<folder>/` route. Mutually exclusive with `document`.'),B({name:F().min(1).regex(JY,`Skill name must be lowercase letters, digits, and hyphens only.`).describe(`Skill name (the bundle-dir identity, wherever the skill lives).`),scope:H(Cl).optional().describe("Skill scope; defaults to `project`.")}).optional().describe("Skill to resolve an editor preview URL for; returns the `…/#/__skill__/<scope>/<name>` route. Mutually exclusive with `document`/`folder`/`file`."),F().optional().describe("Absolute path to a single markdown file to open, including one OUTSIDE any Open Knowledge project. Resolves to the running single-file (or worktree) session whose content directory contains it and returns that session’s `url`. Mutually exclusive with `document` / `folder` / `skill`. When `file` is set, `cwd` is ignored."),F().optional().describe(w3),T3({url:F().nullable().describe("Browser-reachable URL — the UI base joined with the doc route when `document` is given, else the UI root. `null` when no UI is running."),baseUrl:F().nullable().describe("Browser-reachable origin of the running UI (e.g. `http://localhost:5173`). `null` when no UI is running."),running:L().describe(`Whether a UI is running for the project.`),autoOpen:L().describe("User-scoped preview-auto-open preference (`appearance.preview.autoOpen`). When `true`, the agent should route the preview using capability-based routing (in-app browser if available, system browser as fallback). When `false`, the user is managing their own preview view (OK Desktop window, a browser tab they opened, etc.) — the agent must NOT open or refresh any preview UI, and should surface this URL only on direct user ask. Resolved fresh on every call; defaults to `true`."),okOpenCommand:F().nullable().optional().describe("Machine-readable form of the hosted-agent steer: when the calling agent runs inside an OpenKnowledge surface (the desktop app’s built-in terminal, or its in-app agent panel) AND a doc/folder/skill target was given, the exact `ok open …` command to run to bring it up for the user. Run it INSTEAD of navigating `url`, and do not paste `url` into your reply — the user is already in the app it points at. `null`/absent in every other context (navigate `url` per your host instead).")}),B({version:F().describe("40-char commit SHA for this entry — pass to `restore_version({ document, version })`."),timestamp:F().describe(`ISO timestamp of the entry.`),author:F().describe(`Author display name.`),authorEmail:F().describe(`Author email.`),kind:H([`checkpoint`,`wip`,`upstream`]).describe(`Entry kind: checkpoint / wip / upstream.`),message:F().describe(`Commit subject (the checkpoint summary, when one was set).`),contributors:Mve.describe(`Per-contributor records parsed from the commit (writer id, name, docs, summaries).`),checkpoint:R().nullable().describe(`Checkpoint metadata when this entry is a checkpoint, else null.`)}),[`[Requires: Hocuspocus server] List version history for a document, or the activity timeline for a folder.`,`Returns timeline entries from the shadow repo, sorted by timestamp descending.`,"Each entry carries a `version` (40-char commit SHA) you pass straight to `restore_version({ document, version })` — same field name on both sides.",``,"**Parameters (pass EXACTLY ONE of `document` / `folder` / `skill`):**","- `document` — Document name to query history for, typically without extension. A trailing `.md` or `.mdx` is stripped automatically.",'- `folder` — Folder path for the FOLDER timeline: attributed activity over the folder\'s `.ok/` artifacts (templates + frontmatter) — who created / edited / renamed / moved / deleted them, when. `""` = project root.',"- `skill` — Skill NAME to query version history for (the skill folder's attributed versions). PROJECT-scope skills only — global skills are unversioned. Pass an entry's `version` to `restore_version({ skill, version })`.","- `branch` (optional) — Branch name (default: current branch)","- `limit` (optional) — Maximum entries to return (default 50, max 200)","- `offset` (optional) — Number of entries to skip for pagination (default 0)",'- `kind` (optional) — Filter by entry type: "checkpoint", "upstream", or "wip"',"- `author` (optional) — Filter to entries by this author name or email","- `excludeAuthor` (optional) — Exclude entries by this author name or email"].join(`
809
+ `),F().optional().describe(`Extension-less doc path to resolve a preview URL for (e.g. "specs/foo/SPEC"). Omit to get the UI root URL.`),F().min(1).optional().describe('Folder path to resolve a folder-route preview URL for (e.g. "specs/foo"); returns the `…/#/<folder>/` route. Mutually exclusive with `document`.'),B({name:F().min(1).regex(JY,`Skill name must be lowercase letters, digits, and hyphens only.`).describe(`Skill name (the bundle-dir identity, wherever the skill lives).`),scope:H(Cl).optional().describe("Skill scope; defaults to `project`.")}).optional().describe("Skill to resolve an editor preview URL for; returns the `…/#/__skill__/<scope>/<name>` route. Mutually exclusive with `document`/`folder`/`file`."),F().optional().describe("Absolute path to a single markdown file to open, including one OUTSIDE any Open Knowledge project. Resolves to the running single-file (or worktree) session whose content directory contains it and returns that session’s `url`. Mutually exclusive with `document` / `folder` / `skill`. When `file` is set, `cwd` is ignored."),F().optional().describe(w3),T3({url:F().nullable().describe("Browser-reachable URL — the UI base joined with the doc route when `document` is given, else the UI root. `null` when no UI is running."),baseUrl:F().nullable().describe("Browser-reachable origin of the running UI (e.g. `http://localhost:5173`). `null` when no UI is running."),running:L().describe(`Whether a UI is running for the project.`),autoOpen:L().describe("User-scoped preview-auto-open preference (`appearance.preview.autoOpen`). When `true`, the agent should route the preview using capability-based routing (in-app browser if available, system browser as fallback). When `false`, the user is managing their own preview view (OK Desktop window, a browser tab they opened, etc.) — the agent must NOT open or refresh any preview UI, and should surface this URL only on direct user ask. Resolved fresh on every call; defaults to `true`."),okOpenCommand:F().nullable().optional().describe("Machine-readable form of the hosted-agent steer: when the calling agent runs inside an OpenKnowledge surface (the desktop app’s built-in terminal, or its in-app agent panel) AND a doc/folder/skill target was given, the exact `ok open …` command to run to bring it up for the user. Run it INSTEAD of navigating `url`, and do not paste `url` into your reply — the user is already in the app it points at. `null`/absent in every other context (navigate `url` per your host instead).")}),B({version:F().describe("40-char commit SHA for this entry — pass to `restore_version({ document, version })`."),timestamp:F().describe(`ISO timestamp of the entry.`),author:F().describe(`Author display name.`),authorEmail:F().describe(`Author email.`),kind:H([`checkpoint`,`wip`,`upstream`]).describe(`Entry kind: checkpoint / wip / upstream.`),message:F().describe(`Commit subject (the checkpoint summary, when one was set).`),contributors:Nve.describe(`Per-contributor records parsed from the commit (writer id, name, docs, summaries).`),checkpoint:R().nullable().describe(`Checkpoint metadata when this entry is a checkpoint, else null.`)}),[`[Requires: Hocuspocus server] List version history for a document, or the activity timeline for a folder.`,`Returns timeline entries from the shadow repo, sorted by timestamp descending.`,"Each entry carries a `version` (40-char commit SHA) you pass straight to `restore_version({ document, version })` — same field name on both sides.",``,"**Parameters (pass EXACTLY ONE of `document` / `folder` / `skill`):**","- `document` — Document name to query history for, typically without extension. A trailing `.md` or `.mdx` is stripped automatically.",'- `folder` — Folder path for the FOLDER timeline: attributed activity over the folder\'s `.ok/` artifacts (templates + frontmatter) — who created / edited / renamed / moved / deleted them, when. `""` = project root.',"- `skill` — Skill NAME to query version history for (the skill folder's attributed versions). PROJECT-scope skills only — global skills are unversioned. Pass an entry's `version` to `restore_version({ skill, version })`.","- `branch` (optional) — Branch name (default: current branch)","- `limit` (optional) — Maximum entries to return (default 50, max 200)","- `offset` (optional) — Number of entries to skip for pagination (default 0)",'- `kind` (optional) — Filter by entry type: "checkpoint", "upstream", or "wip"',"- `author` (optional) — Filter to entries by this author name or email","- `excludeAuthor` (optional) — Exclude entries by this author name or email"].join(`
810
810
  `),[`[Requires: Hocuspocus server] Import a skill into this project as versioned content.`,``,"Fetches an agentskills.io / skills.sh skill-dir from a `source` and writes it into the vendor-neutral `.agents/skills/<name>/` hub — where it gains history, search, attribution, and cross-harness projection (via `install`) for free. Provenance (source, commit, content hash, publisher) is recorded in `.ok/skills-lock.json`. Scripts are imported as content and are NEVER executed. `add` says where it goes — an import always places the skill somewhere, so `install` afterwards is only for changing WHERE it lives (add/remove/convert/source).",``,`**Parameters:**`,"- `source` — paste the full skills.sh skill-page URL (`https://www.skills.sh/<owner>/<repo>/<skill>`, or `https://www.skills.sh/site/<hostname>/<skill>` for a website catalog), or pass `owner/repo[/subpath]` (GitHub), a git URL, or a local / `file://` path.","- `skill` — Pick ONE skill when the source bundles several.","- `scope` — `project` (default, versioned + shared) or `global` (user-global, unversioned).",``,"On a name collision with an existing skill the import lands under `<name>-imported` (never overwrites). An identical re-import (same content hash) is a no-op."].join(`
811
811
  `),['[Requires: Hocuspocus server] Manage WHERE a skill is available. A skill is ONE real folder (its SOURCE — the skill itself) plus managed copies/symlinks at other locations. `add`/`remove` change the other locations; `mode` flips copies↔symlinks; `source` moves the real folder. There is NO "uninstall everywhere" and no draft state — a skill with no extra locations still lives (and loads) at its source folder; to make a skill stop existing, use `delete`.',``,"Location ids: editor host ids (`claude` | `cursor` | `codex` | `copilot` | `opencode` | `pi`), `agents` (the vendor-neutral `.agents/skills` hub), or a base-relative custom root path containing `/` (e.g. `.team/skills`; home-relative at global scope). The source is validated FIRST — a SKILL.md with git conflict markers, missing/invalid frontmatter, XML tags in name/description, or a reserved `open-knowledge*` name is refused (never fanned into your agent context).",``,`**Parameters:**`,'- `name` — Skill name — the skill\'s identity AND its bundle-dir name, wherever the skill lives (e.g. `.agents/skills/<name>/`). Lowercase letters, digits, hyphens only (≤64 chars; no slashes, dots, spaces, or uppercase). Example: "trip-log".',"- `add` — Locations to ADD the skill to (everything else untouched). Editor ids fan out a copy/symlink; a custom root path places the bundle there. Omitting both `add` and `remove` installs into the project-configured editors.","- `remove` — Locations to REMOVE it from (lossless only: a hand-edited fork is refused, never deleted). Works however the agent gets the skill: removing an editor that reads it through a folder alias (its skills folder symlinked into a shared root) automatically unfollows that folder from the root MINUS this skill — the editor keeps its other skills. The SOURCE cannot be removed — its folder is the skill; move it with `source` or use `delete`.",'- `mode` — `"link"`: a live symlink to the source. `"copy"`: an independent folder, auto-refreshed from the source until hand-edited (a hand-edit forks that copy). Applies ONLY to the locations this call names — the ones in `add`, or the ones in `convert` — and sets no skill-wide default. Omit it on `add` and the new location takes the form the skill already uses.',"- `convert` — Existing locations to change the FORM of, leaving membership alone. Requires `mode`. Pass every location to make them uniform. Lossless both ways; a hand-edited copy is refused rather than overwritten.","- `source` — Move the skill's REAL folder to this location; the old source becomes a symlink to it. Run alone (not with add/remove).","- `scope` — `project` (default, shared via git) or `global` (user-level, every project on this machine).",``,"- `skillFolders` — Folder-level topology instead of one skill (the Settings → Folders surface). Run alone; `name` is not used with it. One action per call:",' - `{ action: "link", scope, root, target }` — merge the skills folder `root` into `target` and replace `root` with a symlink, so its agent reads everything placed in `target`. Same-content entries drop; a DIFFERENT skill in both folders aborts with a conflict list; an interrupted merge is resumable by re-running. `target` is required — nothing is ever assumed.',' - `{ action: "unlink", scope, root, exclude? }` — turn a linked folder back into a real directory holding one per-skill symlink per skill it sees (lossless, reversible). `exclude: ["<skill>"]` leaves named skills out — "this agent should not get that skill": the folder keeps everything else but stops following the root.',' - `{ action: "add-root", scope, root }` — declare a NEW custom skills root (base-relative, e.g. ".team/skills"); it becomes a folder row and an install/link target immediately.',``,"Copies auto-refresh when the source changes — you do NOT need to re-run install after editing a skill. After `delete({skill})` every location is removed with the source."].join(`
812
812
  `),["[Requires: Hocuspocus server] Read the wiki-link graph. `kind` takes one value, or an array for a one-call audit — results merge into a single payload; any per-kind failure lands in an `errors` map.",``,'- `backlinks` / `forward` / `suggest` — operate on one page; require `document`. `suggest` finds prose mentions of the page not yet wrapped in link syntax. Each mention returns an `excerpt` (a normalized, `…`-trimmed snippet for context — NOT an edit-ready literal) plus an `offset`. To wrap one: re-read the doc (`exec("cat …")`), find the real mention text, and `edit` it into a `[[wiki-link]]`.',"- `dead` — missing internal link targets corpus-wide; optional `sourceDocuments` filter (OR semantics).","- `orphans` — disconnected pages; optional `mode`: `incoming` | `outgoing` | `both`.","- `hubs` — most-linked pages; optional `limit` (default 20)."].join(`
@@ -1131,7 +1131,7 @@ let S7=/^[a-z0-9-_]+$/i;function C7(e){let t=typeof e;if(t===`object`){if(Array.
1131
1131
  `)+E7(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=T7(t[c],e,r,i),a+=`
1132
1132
  `}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function XSe(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(C7(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=E7(0,e,``,t,n);return r[r.length-1]===`
1133
1133
  `?r:r+`
1134
- `}function ZSe(e){let{projectDir:t,contentDir:n,sampleCap:r=5}=e,i=[],a=[];try{_(n)}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[`cannot access content directory ${n}: ${e instanceof Error?e.message:String(e)}`]}}let o;try{o=sye({projectDir:t,contentDir:n})}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[e instanceof Error?e.message:String(e)]}}function s(e){let t;try{t=C(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);i.push(`could not read directory ${_e(n,e)||`.`}: ${r}`);return}for(let r of t){let t=N(e,r.name);if(r.isSymbolicLink()){let e;try{e=T(t)}catch(e){let r=e.code;r===`ENOENT`||r===`ELOOP`?i.push(`broken or cyclic symlink: ${_e(n,t)}`):i.push(`cannot resolve symlink ${_e(n,t)}: ${r??`unknown error`}`);continue}let r;try{r=ee(e)}catch{continue}if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}else if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}}return s(n),{totalCount:a.length,sample:a.slice(0,r),contentDir:n,warnings:i}}const QSe=`${J5}-dev`;function $Se(e){return e.startsWith(J5)}function eCe(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command!==`ok-pi-managed-extension`||!Array.isArray(t.args))return!1;let n=t.args[0];return typeof n==`string`&&$Se(n)}function tCe(e){return{command:`ok-pi-managed-extension`,args:[e]}}function nCe(e={}){let t=e.mode===`dev`?QSe:Y5,n={unix:Q5({...e,platformName:`darwin`}),win32:Q5({...e,platformName:`win32`})};return`${t}
1134
+ `}function ZSe(e){let{projectDir:t,contentDir:n,sampleCap:r=5}=e,i=[],a=[];try{_(n)}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[`cannot access content directory ${n}: ${e instanceof Error?e.message:String(e)}`]}}let o;try{o=cye({projectDir:t,contentDir:n})}catch(e){return{totalCount:0,sample:[],contentDir:n,warnings:[e instanceof Error?e.message:String(e)]}}function s(e){let t;try{t=C(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);i.push(`could not read directory ${_e(n,e)||`.`}: ${r}`);return}for(let r of t){let t=N(e,r.name);if(r.isSymbolicLink()){let e;try{e=T(t)}catch(e){let r=e.code;r===`ENOENT`||r===`ELOOP`?i.push(`broken or cyclic symlink: ${_e(n,t)}`):i.push(`cannot resolve symlink ${_e(n,t)}: ${r??`unknown error`}`);continue}let r;try{r=ee(e)}catch{continue}if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}else if(r.isDirectory()){let e=_e(n,t);if(o.isDirExcluded(e))continue;s(t)}else if(r.isFile()){let e=_e(n,t);if(o.isExcluded(e))continue;a.push(e)}}}return s(n),{totalCount:a.length,sample:a.slice(0,r),contentDir:n,warnings:i}}const QSe=`${J5}-dev`;function $Se(e){return e.startsWith(J5)}function eCe(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command!==`ok-pi-managed-extension`||!Array.isArray(t.args))return!1;let n=t.args[0];return typeof n==`string`&&$Se(n)}function tCe(e){return{command:`ok-pi-managed-extension`,args:[e]}}function nCe(e={}){let t=e.mode===`dev`?QSe:Y5,n={unix:Q5({...e,platformName:`darwin`}),win32:Q5({...e,platformName:`win32`})};return`${t}
1135
1135
  /**
1136
1136
  * Open Knowledge bridge for Pi — MANAGED FILE, written by \`ok init\`.
1137
1137
  * Hand edits are overwritten whenever OK re-syncs this project; remove it
@@ -1474,7 +1474,7 @@ export default function okBridge(pi: {
1474
1474
  }
1475
1475
  });
1476
1476
  }
1477
- `}function D7(e){try{return T.native(e)}catch{return e}}function rCe(e,t){let n=_e(D7(t),D7(e));return n.length>0&&!n.startsWith(`..`)&&!M(n)}const iCe=e=>{try{let t=c(`git`,[`rev-parse`,`--show-toplevel`],j3({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function aCe(e,t={}){let n=t.homeDir??O(),r=t.gitTopLevel??iCe,i=ve(e),a;try{a=T(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(Aye(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=pe(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&rCe(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}}function O7(e,t){let n;try{n=_(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.`);k7(e,t)}function oCe(e,t){k7(e,t)}function k7(e,t){let n;try{n=T(t)}catch{n=ve(t)}let r=pe(e);for(;r.length>1&&r!==ye;){let t;try{t=T(r)}catch(e){if(e.code===`ENOENT`){r=pe(r);continue}throw e}let i=_e(n,t);if(i===``||!i.startsWith(`..`)&&!M(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 A7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function sCe(e,t,n){try{if(ee(n).size>10485760)return!1}catch{return!1}let r;try{r=S(n,`utf-8`)}catch{return!1}let i=[],a=vye(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!A7(a))return!1;let o=a[e.topLevelKey];if(!A7(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return A7(s)?A7(s[e.serverName(t)]):!1}function cCe(e,t,n={}){if(!Fl.includes(e.id))return!0;try{return sCe(e,t,e.configPath(t,n.home))}catch{return!1}}function j7(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!cCe(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=kye(`project`,{checkDesktop:!0}),i=pe(r);O7(i,t);let a=g(r)?`overwritten`:`written`;return D(i,{recursive:!0,force:!0}),v(pe(i),{recursive:!0}),m(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 lCe(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=pe(n);return g(n)?(oCe(r,t),D(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function M7(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function N7(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const uCe=[`native`,`index.js`];function P7(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??o(t);try{return n(N(pe(Se(t)),...uCe))}catch(e){M7(e)||N7(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return M7(e)||N7(`workspace addon failed to load`,e),null}}function dCe(){let e=P7();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function fCe(e){let t=e,n=new Set;for(;;){let r;try{r=_(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=w(t)}catch(t){return N7(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=M(i)?i:N(pe(t),i)}}let F7;function pCe(){return F7===void 0&&(F7=dCe()),F7}function mCe(e,t=pCe){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){N7(`resolveSymlinkWritePath threw`,e)}return fCe(e)}function I7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hCe(){let e=P7();return e&&typeof e.parseTomlToJson==`function`?e:null}function gCe(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return N7(`addon loaded but probe failed`,e),!1}}function L7(e){if(!I7(e))throw Error(`TOML root is not a table`);return e}function _Ce(e){return{backend:`native`,parseToObject(t){return L7(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}},removeEntry(t,n){let r=e.removeMcpServer(t,n);return{text:r.text,existed:r.existed}}}}function vCe(){return{backend:`fallback`,parseToObject(e){return L7(GSe(e))}}}function yCe(e=hCe){let t=e();return t&&gCe(t)?_Ce(t):vCe()}let R7=null;function z7(){return R7===null&&(R7=yCe()),R7}const B7=`.ok/`,V7=`**/.ok/*`,H7=`!**/${Tl}/`;function U7(e){let t=[`.ok/`,`.okignore`];for(let n of H5){let r=l7[n];r.projectConfigPath&&t.push(ECe(r.projectConfigPath(e),e))}t.push(`.claude/launch.json`);let n=N(e,...fX);if(g(n))try{let e=gX(S(n,`utf-8`));if(e){for(let[n,r]of Object.entries(e.skills))if(n!==`open-knowledge`)for(let e of r.hosts){let r=kl[e];r&&t.push(`${r}/${n}/`)}}}catch{}return Array.from(new Set(t))}function bCe(e,t){let n=W7(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:G7(n)};let r=K7(e);if(r.kind!==`ok`)return r.result;let i=g(r.path)?S(r.path,`utf-8`):``,a=Y7(i),o=[],s=[];for(let e of t)J7(a,e)?s.push(e):o.push(e);if(o.length===0)return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]};let c=i.length===0||i.endsWith(`
1477
+ `}function D7(e){try{return T.native(e)}catch{return e}}function rCe(e,t){let n=_e(D7(t),D7(e));return n.length>0&&!n.startsWith(`..`)&&!M(n)}const iCe=e=>{try{let t=c(`git`,[`rev-parse`,`--show-toplevel`],j3({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function aCe(e,t={}){let n=t.homeDir??O(),r=t.gitTopLevel??iCe,i=ve(e),a;try{a=T(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(Aye(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=pe(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&rCe(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}}function O7(e,t){let n;try{n=_(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.`);k7(e,t)}function oCe(e,t){k7(e,t)}function k7(e,t){let n;try{n=T(t)}catch{n=ve(t)}let r=pe(e);for(;r.length>1&&r!==ye;){let t;try{t=T(r)}catch(e){if(e.code===`ENOENT`){r=pe(r);continue}throw e}let i=_e(n,t);if(i===``||!i.startsWith(`..`)&&!M(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 A7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function sCe(e,t,n){try{if(ee(n).size>10485760)return!1}catch{return!1}let r;try{r=S(n,`utf-8`)}catch{return!1}let i=[],a=yye(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!A7(a))return!1;let o=a[e.topLevelKey];if(!A7(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return A7(s)?A7(s[e.serverName(t)]):!1}function cCe(e,t,n={}){if(!Fl.includes(e.id))return!0;try{return sCe(e,t,e.configPath(t,n.home))}catch{return!1}}function j7(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!cCe(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=kye(`project`,{checkDesktop:!0}),i=pe(r);O7(i,t);let a=g(r)?`overwritten`:`written`;return D(i,{recursive:!0,force:!0}),v(pe(i),{recursive:!0}),m(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 lCe(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=pe(n);return g(n)?(oCe(r,t),D(r,{recursive:!0,force:!0}),{editorId:e.id,label:e.label,action:`removed`,path:n}):{editorId:e.id,label:e.label,action:`not-present`,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function M7(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function N7(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const uCe=[`native`,`index.js`];function P7(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??o(t);try{return n(N(pe(Se(t)),...uCe))}catch(e){M7(e)||N7(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return M7(e)||N7(`workspace addon failed to load`,e),null}}function dCe(){let e=P7();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function fCe(e){let t=e,n=new Set;for(;;){let r;try{r=_(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=w(t)}catch(t){return N7(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=M(i)?i:N(pe(t),i)}}let F7;function pCe(){return F7===void 0&&(F7=dCe()),F7}function mCe(e,t=pCe){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){N7(`resolveSymlinkWritePath threw`,e)}return fCe(e)}function I7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hCe(){let e=P7();return e&&typeof e.parseTomlToJson==`function`?e:null}function gCe(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return N7(`addon loaded but probe failed`,e),!1}}function L7(e){if(!I7(e))throw Error(`TOML root is not a table`);return e}function _Ce(e){return{backend:`native`,parseToObject(t){return L7(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}},removeEntry(t,n){let r=e.removeMcpServer(t,n);return{text:r.text,existed:r.existed}}}}function vCe(){return{backend:`fallback`,parseToObject(e){return L7(GSe(e))}}}function yCe(e=hCe){let t=e();return t&&gCe(t)?_Ce(t):vCe()}let R7=null;function z7(){return R7===null&&(R7=yCe()),R7}const B7=`.ok/`,V7=`**/.ok/*`,H7=`!**/${Tl}/`;function U7(e){let t=[`.ok/`,`.okignore`];for(let n of H5){let r=l7[n];r.projectConfigPath&&t.push(ECe(r.projectConfigPath(e),e))}t.push(`.claude/launch.json`);let n=N(e,...fX);if(g(n))try{let e=gX(S(n,`utf-8`));if(e){for(let[n,r]of Object.entries(e.skills))if(n!==`open-knowledge`)for(let e of r.hosts){let r=kl[e];r&&t.push(`${r}/${n}/`)}}}catch{}return Array.from(new Set(t))}function bCe(e,t){let n=W7(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:G7(n)};let r=K7(e);if(r.kind!==`ok`)return r.result;let i=g(r.path)?S(r.path,`utf-8`):``,a=Y7(i),o=[],s=[];for(let e of t)J7(a,e)?s.push(e):o.push(e);if(o.length===0)return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]};let c=i.length===0||i.endsWith(`
1478
1478
  `)?``:`
1479
1479
  `,l=`${o.join(`
1480
1480
  `)}\n`;try{ne(r.path,`${i}${c}${l}`,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]}}function xCe(e,t){let n=K7(e);if(n.kind!==`ok`)return n.result;if(!g(n.path))return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let r=t.map(e=>q7(e)),i=new Set;for(let e of r)for(let t of e)i.add(t);i.add(V7),i.add(H7);let a;try{a=S(n.path,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}let o=a.split(`
@@ -1490,7 +1490,7 @@ export default function okBridge(pi: {
1490
1490
  `)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function X7(e){let t=(e.match(/\r\n/g)??[]).length;return t===0?!1:t>=(e.match(/\n/g)??[]).length-t}function Z7(e){try{return ee(e).mode&511}catch{return}}function kCe(e,t){let n=e.charCodeAt(0)===65279,r=n?e.slice(1):e,i=r.includes(`\r
1491
1491
  `)?`\r
1492
1492
  `:`
1493
- `,a=g6(r,t,void 0,{formattingOptions:{...OCe(r),eol:i}});if(a.length===0)return{text:e,changed:!1};let o=`${n?``:``}${_6(r,a)}`;return{text:o,changed:o!==e}}const ACe={allowTrailingComma:!0,disallowComments:!1};function jCe(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function Q7(e){let t=[],n=yye(e,t,ACe);return t.some(t=>!jCe(t,e))||!n||n.type!==`object`?null:n}function $7(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&h6(e)===t&&(n+=1)}return n}function e9(e,t){r$(e,`${JSON.stringify(t,null,2)}\n`)}function MCe(e,t){let n=XSe(t);r$(e,n.endsWith(`
1493
+ `,a=g6(r,t,void 0,{formattingOptions:{...OCe(r),eol:i}});if(a.length===0)return{text:e,changed:!1};let o=`${n?``:``}${_6(r,a)}`;return{text:o,changed:o!==e}}const ACe={allowTrailingComma:!0,disallowComments:!1};function jCe(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function Q7(e){let t=[],n=bye(e,t,ACe);return t.some(t=>!jCe(t,e))||!n||n.type!==`object`?null:n}function $7(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&h6(e)===t&&(n+=1)}return n}function e9(e,t){r$(e,`${JSON.stringify(t,null,2)}\n`)}function MCe(e,t){let n=XSe(t);r$(e,n.endsWith(`
1494
1494
  `)?n:`${n}\n`)}function NCe(e,t){let n=(0,Kt.stringify)(t);r$(e,n.endsWith(`
1495
1495
  `)?n:`${n}\n`)}const t9=10*1024*1024;function n9(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>n9(e,t[n]));if(I7(e)&&I7(t)){let n=Object.keys(e);return n.length===Object.keys(t).length?n.every(n=>Object.hasOwn(t,n)&&n9(e[n],t[n])):!1}return!1}function PCe(e){for(let t of e.split(`
1496
1496
  `)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function r9(e,t,n){return t===void 0?[e,n]:[e,t,n]}function i9(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function a9(e,t,n){let r=e[t];return n===void 0?r:I7(r)?r[n]:void 0}function FCe(e,t,n,r,i){if(!g(e))return e9(e,i9(t,i,n,r)),{kind:`written`};let a;try{a=S(e,`utf-8`)}catch(e){return N7(`json config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(a.trim()===``)return e9(e,i9(t,i,n,r)),{kind:`written`};if(Buffer.byteLength(a,`utf-8`)>t9)return{kind:`declined`,reason:`oversize`};let o=Q7(a);if(!o)return{kind:`declined`,reason:`unparseable`};if($7(o,t)>1)return{kind:`declined`,reason:`duplicate-container`};let s=a9(h6(o),t,i),c=I7(s)?s[n]:void 0,l=c!==void 0;if(l&&n9(c,r))return{kind:`overwritten`};let u=a.charCodeAt(0)===65279,d=u?a.slice(1):a,f=d.includes(`\r
@@ -1513,13 +1513,13 @@ export default function okBridge(pi: {
1513
1513
  `),c;try{c=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!c.existed)return{kind:`not-present`};let l=c.text;s?l.endsWith(`
1514
1514
  `)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
1515
1515
  `).replace(/\n/g,`\r
1516
- `));let u=`${i?``:``}${l}`;return u!==r&&r$(e,u,{mode:Z7(e)}),{kind:`removed`}}function rwe(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}function iwe(e){let{priorCommand:t,priorArgs:n}=y9(e.priorEntry);return{event:`mcp-config-migrate`,scope:e.scope,surface:e.surface,editorId:e.editorId,configPath:e.configPath,priorCommand:t,priorArgs:n}}function y9(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function awe(e,t,n={}){let r=Tye(e,t);if(!g(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(S(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!bve(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??y3)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??Cye())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??se();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function owe(e,t,n={}){let r=n.isAlive??y3,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function swe(e){let t=e.inspect??(t=>awe(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=owe(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function b9(e){if(!g(e))return{value:null,path:e,source:null,doc:null};let t;try{t=S(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,Kt.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return I7(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function cwe(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=Kc({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function lwe(e){let t=e??process.cwd(),n=[],r=[],i=[],a=[],o=o$(`user`,t),s=n$({absPath:o});r.push(...s.diagnostics),!s.valid&&s.sidelinedTo!==void 0&&i.push({from:o,to:s.sidelinedTo}),s.valid&&s.source!==void 0&&n.push(o);let c=(e,t=!1)=>{let i=b9(e);if(i.diagnostic!==void 0&&r.push(i.diagnostic),i.value===null)return{};let o=vl({value:i.value,file:i.path,source:i.source,doc:i.doc});r.push(...o),n.push(e);let s=o.length>0?bl(i.value):i.value;return t&&a.push(...Jc({value:s,file:i.path,source:i.source,doc:i.doc})),s},l=ve(t,`.ok`,`config.yml`),u=c(l,!0),d=c(o$(`project-local`,t)),f=ul(s.value,u,d),p=nSe.safeParse(f);if(!p.success){let e=b9(l),t={code:`SCHEMA_INVALID`,issues:cwe(p.error.issues,e)};throw Error(ll(t))}return{config:p.data,sources:n,diagnostics:r,sidelined:i,ignoredCommittedKeys:a}}function x9(e){return e.replace(/:\d+$/,``)}function S9(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function C9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Rl(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`).filter(e=>e.length>0);if(r.length<5||r[2]!==`blob`)return null;let i,a,o,s;try{i=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]),o=decodeURIComponent(r[3]),s=r.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.length===0||s.some(e=>e.length===0)?null:{host:n,owner:i,repo:a,branch:o,path:s.join(`/`)}}function w9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Rl(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`);if(r.length<5||r[0]!==``||r[3]!==`tree`)return null;let i=r.slice(5);i.length===1&&i[0]===``&&i.pop();let a,o,s,c;try{a=decodeURIComponent(r[1]),o=decodeURIComponent(r[2]),s=decodeURIComponent(r[4]),c=i.map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function uwe(e){let t=C9(e);if(t)return{kind:`doc`,...t};let n=w9(e);return n?{kind:`folder`,...n}:null}async function dwe(e,t){let n,r;try{n=await Te(ve(e)),r=await Te(ve(pe(e)))}catch{return{kind:`not-git`}}if(!T9(n,r))return{kind:`symlink-escape`};let i=N(n,`.git`),a;try{a=ee(i)}catch{return{kind:`not-git`}}if(a.isDirectory()){let e;try{e=await Te(i)}catch{return{kind:`not-git`}}if(!T9(e,n))return{kind:`symlink-escape`}}else if(!a.isFile())return{kind:`not-git`};let o=NX(n);if(o.kind!==`repository`)return{kind:`not-git`};let s=o.repository.readRemoteUrl(`origin`);if(s.kind===`unreadable`)return{kind:`not-git`};if(s.kind===`absent`)return s.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let c=s.url,l=S9(c);if(l===null)return{kind:`non-github`};let u=Rl(l.hostname);if(u===null)return{kind:`non-github`};let d=u===t.host.toLowerCase(),f=l.owner.toLowerCase()===t.owner.toLowerCase(),p=l.name.toLowerCase()===t.repo.toLowerCase();return!d&&f&&p?{kind:`wrong-host`,actualHost:u}:!d||!f||!p?{kind:`wrong-repo`,actualOwner:l.owner,actualRepo:l.name}:{kind:`ok`,gitRemoteUrl:`https://${u}/${l.owner}/${l.name}.git`}}function T9(e,t){if(e===t)return!0;let n=_e(t,e);return n.length>0&&!n.startsWith(`..`)&&!M(n)}const fwe=`# >>> open-knowledge cli >>>`,pwe=`# <<< open-knowledge cli <<<`,mwe=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function hwe(e){return N(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}[...b6.map(e=>y6[e])];function gwe(e){if(!M(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=ve(e);if(t===ye||pe(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function E9(e){let t=gwe(e),n=[];for(let e of b6){let r=y6[e];n.push({path:N(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of Pl)n.push({path:N(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function _we(e,t){let n=[];for(let r of E9(e))if(r.bundleId===t)try{D(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}`)}const vwe=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=s9(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=j7(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function ywe(e,t,n={},r=vwe){let i=[];for(let a of t){let t=l7[a];for(let a of r)i.push(a.write(t,e,n))}return i}function bwe(e,t,n={}){return{integrations:ywe(e,t,n)}}function xwe(e){return n$({absPath:o$(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function D9({home:e=O(),env:t=process.env}={}){let n=xwe(e),{override:r,preferenceList:i}=Fme(t),{locale:a,source:o}=bw({override:r,storedPreference:n,supportedLocales:Ho,preferenceList:i,autoDetectableLocales:ore});return{preference:n,locale:a,source:o,systemLanguages:i}}function O9(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Swe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function k9(e,t){if(typeof e==`string`)return O9(e,t.contentDir);if(Array.isArray(e))return e.map(e=>k9(e,t));if(!Swe(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=k9(i,t);return n}function A9(e,t){let n=S(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
1516
+ `));let u=`${i?``:``}${l}`;return u!==r&&r$(e,u,{mode:Z7(e)}),{kind:`removed`}}function rwe(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}function iwe(e){let{priorCommand:t,priorArgs:n}=y9(e.priorEntry);return{event:`mcp-config-migrate`,scope:e.scope,surface:e.surface,editorId:e.editorId,configPath:e.configPath,priorCommand:t,priorArgs:n}}function y9(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function awe(e,t,n={}){let r=Tye(e,t);if(!g(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(S(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!bve(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??y3)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??wye())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??se();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function owe(e,t,n={}){let r=n.isAlive??y3,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function swe(e){let t=e.inspect??(t=>awe(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=owe(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function b9(e){if(!g(e))return{value:null,path:e,source:null,doc:null};let t;try{t=S(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,Kt.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return I7(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function cwe(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=Kc({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function lwe(e){let t=e??process.cwd(),n=[],r=[],i=[],a=[],o=o$(`user`,t),s=n$({absPath:o});r.push(...s.diagnostics),!s.valid&&s.sidelinedTo!==void 0&&i.push({from:o,to:s.sidelinedTo}),s.valid&&s.source!==void 0&&n.push(o);let c=(e,t=!1)=>{let i=b9(e);if(i.diagnostic!==void 0&&r.push(i.diagnostic),i.value===null)return{};let o=vl({value:i.value,file:i.path,source:i.source,doc:i.doc});r.push(...o),n.push(e);let s=o.length>0?bl(i.value):i.value;return t&&a.push(...Jc({value:s,file:i.path,source:i.source,doc:i.doc})),s},l=ve(t,`.ok`,`config.yml`),u=c(l,!0),d=c(o$(`project-local`,t)),f=ul(s.value,u,d),p=nSe.safeParse(f);if(!p.success){let e=b9(l),t={code:`SCHEMA_INVALID`,issues:cwe(p.error.issues,e)};throw Error(ll(t))}return{config:p.data,sources:n,diagnostics:r,sidelined:i,ignoredCommittedKeys:a}}function x9(e){return e.replace(/:\d+$/,``)}function S9(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:x9(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function C9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Rl(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`).filter(e=>e.length>0);if(r.length<5||r[2]!==`blob`)return null;let i,a,o,s;try{i=decodeURIComponent(r[0]),a=decodeURIComponent(r[1]),o=decodeURIComponent(r[3]),s=r.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.length===0||s.some(e=>e.length===0)?null:{host:n,owner:i,repo:a,branch:o,path:s.join(`/`)}}function w9(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=Rl(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`);if(r.length<5||r[0]!==``||r[3]!==`tree`)return null;let i=r.slice(5);i.length===1&&i[0]===``&&i.pop();let a,o,s,c;try{a=decodeURIComponent(r[1]),o=decodeURIComponent(r[2]),s=decodeURIComponent(r[4]),c=i.map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function uwe(e){let t=C9(e);if(t)return{kind:`doc`,...t};let n=w9(e);return n?{kind:`folder`,...n}:null}async function dwe(e,t){let n,r;try{n=await Te(ve(e)),r=await Te(ve(pe(e)))}catch{return{kind:`not-git`}}if(!T9(n,r))return{kind:`symlink-escape`};let i=N(n,`.git`),a;try{a=ee(i)}catch{return{kind:`not-git`}}if(a.isDirectory()){let e;try{e=await Te(i)}catch{return{kind:`not-git`}}if(!T9(e,n))return{kind:`symlink-escape`}}else if(!a.isFile())return{kind:`not-git`};let o=NX(n);if(o.kind!==`repository`)return{kind:`not-git`};let s=o.repository.readRemoteUrl(`origin`);if(s.kind===`unreadable`)return{kind:`not-git`};if(s.kind===`absent`)return s.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let c=s.url,l=S9(c);if(l===null)return{kind:`non-github`};let u=Rl(l.hostname);if(u===null)return{kind:`non-github`};let d=u===t.host.toLowerCase(),f=l.owner.toLowerCase()===t.owner.toLowerCase(),p=l.name.toLowerCase()===t.repo.toLowerCase();return!d&&f&&p?{kind:`wrong-host`,actualHost:u}:!d||!f||!p?{kind:`wrong-repo`,actualOwner:l.owner,actualRepo:l.name}:{kind:`ok`,gitRemoteUrl:`https://${u}/${l.owner}/${l.name}.git`}}function T9(e,t){if(e===t)return!0;let n=_e(t,e);return n.length>0&&!n.startsWith(`..`)&&!M(n)}const fwe=`# >>> open-knowledge cli >>>`,pwe=`# <<< open-knowledge cli <<<`,mwe=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function hwe(e){return N(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}[...b6.map(e=>y6[e])];function gwe(e){if(!M(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=ve(e);if(t===ye||pe(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function E9(e){let t=gwe(e),n=[];for(let e of b6){let r=y6[e];n.push({path:N(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of Pl)n.push({path:N(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function _we(e,t){let n=[];for(let r of E9(e))if(r.bundleId===t)try{D(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}`)}const vwe=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=s9(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=j7(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function ywe(e,t,n={},r=vwe){let i=[];for(let a of t){let t=l7[a];for(let a of r)i.push(a.write(t,e,n))}return i}function bwe(e,t,n={}){return{integrations:ywe(e,t,n)}}function xwe(e){return n$({absPath:o$(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function D9({home:e=O(),env:t=process.env}={}){let n=xwe(e),{override:r,preferenceList:i}=Fme(t),{locale:a,source:o}=bw({override:r,storedPreference:n,supportedLocales:Ho,preferenceList:i,autoDetectableLocales:ore});return{preference:n,locale:a,source:o,systemLanguages:i}}function O9(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Swe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function k9(e,t){if(typeof e==`string`)return O9(e,t.contentDir);if(Array.isArray(e))return e.map(e=>k9(e,t));if(!Swe(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=k9(i,t);return n}function A9(e,t){let n=S(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
1517
1517
  `),i=n.split(`
1518
1518
  `),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=k9(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}ne(e,r?`${a.join(`
1519
1519
  `)}\n`:a.join(`
1520
1520
  `))}function j9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=k9(JSON.parse(n),t),i=n.endsWith(`
1521
1521
  `)?`
1522
1522
  `:``;ne(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=O9(n,t.contentDir);r!==n&&ne(e,r)}}function M9(e,t){let n=S(e,`utf-8`),r=O9(n,t.contentDir);r!==n&&ne(e,r)}function N9(e){try{return C(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const Cwe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function P9(e){return/\.log\.\d+$/.test(e)}function wwe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||P9(e)}function Twe(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of N9(N(e.stagingDir,n)))wwe(r)?A9(r,t):r.endsWith(`.json`)?j9(r,t):M9(r,t);for(let n of N9(N(e.stagingDir,`state`))){let e=fe(n);n.endsWith(`.jsonl`)?A9(n,t):Cwe.has(e)?j9(n,t):M9(n,t)}}const F9=[`.ok`,`local`,`telemetry`],I9=[`.ok`,`local`,`logs`],L9=[`.ok`,`local`,`loss-capture`],R9=`spans-current.jsonl`,z9=`spans-prev.jsonl`,B9=`server-current.jsonl`,V9=`server-prev.jsonl`,H9=`loss-current.jsonl`,U9=`loss-prev.jsonl`;function Ewe(e){return N(e,...F9,R9)}function Dwe(e){return N(e,...F9,z9)}function Owe(e){return N(e,...I9,B9)}function kwe(e){return N(e,...I9,V9)}function Awe(e){return N(e,...L9,H9)}function jwe(e){return N(e,...L9,U9)}const W9=1e3;async function Mwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function Nwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function Pwe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}function Fwe(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
1523
- `)}\n`:null}catch{return null}}function Iwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],j3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Lwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],j3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function G9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Rwe(){return{nodeVersion:process.version,platform:k(),arch:ie()}}function zwe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!g(e))return{};let t;try{t=(0,Kt.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!K9(t))return{};let n=t.telemetry;if(!K9(n))return{};let r=n.localSink;return K9(r)?r:{}}function J9(e){return typeof e==`boolean`?e:void 0}function Bwe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return Bwe(e.maxBytes)}function Vwe(e){let t=q9(o$(`project`,e)),n=q9(o$(`project-local`,e));return{enabled:J9(n.enabled)??J9(t.enabled)??!0,spansMaxBytes:Y9(n.spans)??Y9(t.spans)??52428800,logsMaxBytes:Y9(n.logs)??Y9(t.logs)??26214400}}function Hwe(e){return Ae(`sha256`).update(e).digest(`hex`)}function Uwe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Wwe(e){let t=S(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X9(e,t){if(!g(e))return!1;try{return v(pe(t),{recursive:!0}),m(e,t),!0}catch{return!1}}function Z9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Gwe=new Set([`.jsonl`]);function Q9(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Gwe.has(e.slice(t))}const Kwe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function qwe(e){if(P9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:Kwe.has(e.slice(t))}function Jwe(e){let t=[];for(let n of Z9(e)){let r=$9(e,n);if(!qwe(r))continue;let{redacted:i,patterns:a,lineCount:o}=bo(S(n,`utf-8`));a.length!==0&&(ne(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return _e(e,t).split(ye).join(`/`)}async function Ywe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??Mwe,a=r.fetchAgentEffects??Nwe,o=r.fetchWatcherRecent??Pwe,s=r.readShadowHead??Iwe,c=r.readCheckpointRefs??Lwe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.58.0-beta.11`),d=r.readDesktopEnv??G9,f=r.readLanguage??D9,p=r.readRuntime??Rwe,h=r.isOtlpPushEnabled??zwe,_=y(N(le(),`ok-bundle-`));try{v(N(_,`telemetry`),{recursive:!0}),v(N(_,`logs`),{recursive:!0}),v(N(_,`state`),{recursive:!0}),X9(Ewe(n),N(_,`telemetry`,R9)),X9(Dwe(n),N(_,`telemetry`,z9)),X9(Owe(n),N(_,`logs`,B9)),X9(kwe(n),N(_,`logs`,V9));for(let t of e.userLogFiles??[])X9(t,N(_,`logs`,fe(t)));let y=N(n,`.ok`,`local`),b=N(y,`server.lock`),x=`not-running`,C=`no server.lock`,w=null;if(g(b)){X9(b,N(_,`state`,`server.lock`));try{let e=S(b,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?w=t.port:C=`lock present but no port`}catch{C=`lock present but unparseable`}}if(w!==null){let e=await i(w);e===null?C=`agent-presence endpoint at :${w} unreachable`:(ne(N(_,`state`,`agent-presence.json`),e),x=`running`,C=``);let t=await a(w);t!==null&&ne(N(_,`state`,`agent-effects.json`),t);let n=await o(w);if(n!==null){let e=Fwe(n);e!==null&&ne(N(_,`state`,`watcher-recent.jsonl`),e)}}let T=s(t);T!==null&&ne(N(_,`state`,`shadow-head.txt`),T);let E=c(t);E!==null&&ne(N(_,`state`,`checkpoint-refs.txt`),E),X9(Awe(n),N(_,`state`,H9)),X9(jwe(n),N(_,`state`,U9)),X9(N(y,`last-spawn-error.log`),N(_,`state`,`last-spawn-error.log`)),X9(N(y,uX),N(_,`state`,uX)),X9(N(y,dX),N(_,`state`,dX));let te=p(),re=d(),ie=f(),ae={ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ie}};ne(N(_,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=x===`running`?`running
1523
+ `)}\n`:null}catch{return null}}function Iwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],j3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Lwe(e){let t=N(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],j3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function G9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Rwe(){return{nodeVersion:process.version,platform:k(),arch:ie()}}function zwe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!g(e))return{};let t;try{t=(0,Kt.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!K9(t))return{};let n=t.telemetry;if(!K9(n))return{};let r=n.localSink;return K9(r)?r:{}}function J9(e){return typeof e==`boolean`?e:void 0}function Bwe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return Bwe(e.maxBytes)}function Vwe(e){let t=q9(o$(`project`,e)),n=q9(o$(`project-local`,e));return{enabled:J9(n.enabled)??J9(t.enabled)??!0,spansMaxBytes:Y9(n.spans)??Y9(t.spans)??52428800,logsMaxBytes:Y9(n.logs)??Y9(t.logs)??26214400}}function Hwe(e){return Ae(`sha256`).update(e).digest(`hex`)}function Uwe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Wwe(e){let t=S(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X9(e,t){if(!g(e))return!1;try{return v(pe(t),{recursive:!0}),m(e,t),!0}catch{return!1}}function Z9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Gwe=new Set([`.jsonl`]);function Q9(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Gwe.has(e.slice(t))}const Kwe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function qwe(e){if(P9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:Kwe.has(e.slice(t))}function Jwe(e){let t=[];for(let n of Z9(e)){let r=$9(e,n);if(!qwe(r))continue;let{redacted:i,patterns:a,lineCount:o}=bo(S(n,`utf-8`));a.length!==0&&(ne(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return _e(e,t).split(ye).join(`/`)}async function Ywe(e){let t=ve(e.contentDir),n=ve(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??Mwe,a=r.fetchAgentEffects??Nwe,o=r.fetchWatcherRecent??Pwe,s=r.readShadowHead??Iwe,c=r.readCheckpointRefs??Lwe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.58.0-beta.13`),d=r.readDesktopEnv??G9,f=r.readLanguage??D9,p=r.readRuntime??Rwe,h=r.isOtlpPushEnabled??zwe,_=y(N(le(),`ok-bundle-`));try{v(N(_,`telemetry`),{recursive:!0}),v(N(_,`logs`),{recursive:!0}),v(N(_,`state`),{recursive:!0}),X9(Ewe(n),N(_,`telemetry`,R9)),X9(Dwe(n),N(_,`telemetry`,z9)),X9(Owe(n),N(_,`logs`,B9)),X9(kwe(n),N(_,`logs`,V9));for(let t of e.userLogFiles??[])X9(t,N(_,`logs`,fe(t)));let y=N(n,`.ok`,`local`),b=N(y,`server.lock`),x=`not-running`,C=`no server.lock`,w=null;if(g(b)){X9(b,N(_,`state`,`server.lock`));try{let e=S(b,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?w=t.port:C=`lock present but no port`}catch{C=`lock present but unparseable`}}if(w!==null){let e=await i(w);e===null?C=`agent-presence endpoint at :${w} unreachable`:(ne(N(_,`state`,`agent-presence.json`),e),x=`running`,C=``);let t=await a(w);t!==null&&ne(N(_,`state`,`agent-effects.json`),t);let n=await o(w);if(n!==null){let e=Fwe(n);e!==null&&ne(N(_,`state`,`watcher-recent.jsonl`),e)}}let T=s(t);T!==null&&ne(N(_,`state`,`shadow-head.txt`),T);let E=c(t);E!==null&&ne(N(_,`state`,`checkpoint-refs.txt`),E),X9(Awe(n),N(_,`state`,H9)),X9(jwe(n),N(_,`state`,U9)),X9(N(y,`last-spawn-error.log`),N(_,`state`,`last-spawn-error.log`)),X9(N(y,uX),N(_,`state`,uX)),X9(N(y,dX),N(_,`state`,dX));let te=p(),re=d(),ie=f(),ae={ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ie}};ne(N(_,`state`,`runtime.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=x===`running`?`running
1524
1524
  `:`not-running (${C})\n`;if(ne(N(_,`state`,`server-status.txt`),oe),e.processDir&&g(e.processDir)){let t=N(_,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let O=e.redact===!0;O&&Twe({stagingDir:_,contentDir:t}),e.note&&ne(N(_,`note.txt`),e.note);let se=null;e.scrubSecrets===!0&&(se=Jwe(_));for(let t of e.extraFiles??[])X9(t.sourcePath,N(_,`extra`,t.zipName??fe(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let k=Vwe(n),ce=Z9(_),le=[],ue=0,A=0;for(let e of ce){let t=$9(_,e),n=ee(e).size,r=Q9(t)?Uwe(e):0;le.push({path:t,bytes:n,lines:r}),ue+=n,t.startsWith(`telemetry/`)&&Q9(t)&&(A+=Wwe(e))}let j={applied:O};se!==null&&(j.secretScrub=se);let de={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:te.nodeVersion,platform:te.platform,arch:te.arch},host:{desktop:re,language:ie},contentDir:{pathSha256:Hwe(t),absolutePath:O?`<CONTENT_DIR>`:t},telemetry:{localSink:k,otlpPushEnabled:h()},redaction:j,serverStatus:x,files:le};ne(N(_,`manifest.json`),`${JSON.stringify(de,null,2)}\n`);let pe=ce.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),me={totalBytes:ue,fileCount:le.length,docNameCount:A,contentDirVisible:pe,redacted:O},M=!1;return{stagingDir:_,manifest:de,summary:me,cleanup:()=>{M||(M=!0,D(_,{recursive:!0,force:!0}))}}}catch(e){throw D(_,{recursive:!0,force:!0}),e}}async function Xwe(e){let{collected:t,outputPath:n}=e,r=pe(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Oye.ZipFile,a=Z9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function Zwe(e,t){let n=N(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,Kt.parse)(S(n,`utf-8`)),r=I7(t)?t.content:void 0,i=I7(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return ve(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return ve(e)}async function Qwe(e,t,n,r){let i=f9(t,e.logger),a=await Ywe({contentDir:Zwe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...qCe(i,e.userLogsDir??N(O(),`.ok`,`logs`)),...m9(e.cachesDir??N(O(),`Library`,`Caches`))],deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{v(pe(e.outputPath),{recursive:!0}),await Xwe({collected:a,outputPath:e.outputPath});let t=a.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:i,files:a.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:a.manifest.createdAt}}}finally{a.cleanup()}}async function $we(e){let{projectDir:t}=e,n=e.readDesktopEnv??G9,r=e.readLanguage??D9;if(e.level===`full`&&t!==void 0)return Qwe(e,t,n,r);let{zipPath:i,summary:a}=await ZCe({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:m9(e.cachesDir??N(O(),`Library`,`Caches`)),logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:i,summary:{level:e.level,systemWide:t===void 0,projectSlug:a.projectSlug,files:a.files,redactions:a.redactions,redactedLineCount:a.redactedLineCount,generatedAt:a.generatedAt}}}export{H5 as ALL_EDITOR_IDS,U5 as EDITOR_LABELS,l7 as EDITOR_TARGETS,rSe as HOSTS_WITH_USER_SKILL_DIR,RCe as LAUNCH_CONFIG_NAME,fwe as PATH_SHIM_BEGIN,mwe as PATH_SHIM_BLOCK_RE,pwe as PATH_SHIM_END,bCe as addOkPathsToGitExclude,O7 as assertProjectPathSafe,Q5 as buildManagedServerEntry,rwe as buildMcpConfigDeclineEvent,iwe as buildMcpConfigMigrateEvent,u9 as classifyExistingMcpEntry,$we as collectReportBundle,Xt as createTokenStore,WCe as defaultBugReportZipPath,Be as detectGh,HCe as detectInstalledEditors,_Se as editorConfigPathDisplay,gSe as editorEntryLocator,G7 as formatTrackedRemediation,CCe as getExcludedOkPaths,U7 as getOkArtifactPaths,X5 as isEntryUpToDate,$5 as isOwnManagedEntry,lwe as loadConfig,Qt as makeLazyProbeTokenStore,d9 as okBugReportsDir,C9 as parseGitHubBlobUrl,uwe as parseGitHubShareUrl,w9 as parseGitHubTreeUrl,S9 as parseGitUrl,hwe as pathInstallMarkerPath,ZSe as previewContent,UCe as probeOwnManagedEditorMcpEntry,W7 as probeTrackedOkPaths,c9 as readExistingMcpEntry,SCe as readSharingMode,wCe as readSkillsShared,bo as redactContent,xCe as removeOkPathsFromGitExclude,$Ce as removeOwnMcpEntry,lCe as removeProjectSkill,_we as removeUserGlobalSkillBundle,aCe as resolveProjectRoot,swe as runStop,TCe as setSkillsShared,y9 as truncatePriorEntry,E9 as userGlobalSkillBundleTargets,dwe as validateLocalFolderForShare,s9 as writeEditorMcpConfig,bwe as writeProjectAiIntegrations,j7 as writeProjectSkill,VCe as writeUserMcpConfigs};
1525
1525
  //# sourceMappingURL=index.mjs.map