@inkeep/open-knowledge 0.89.3 → 0.89.4-beta.0

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 (147) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +32 -7
  2. package/dist/{cli-Bf6e9G0A.mjs → cli-DAKo1Dp3.mjs} +6 -6
  3. package/dist/cli.mjs +1 -1
  4. package/dist/constants-BFHqrsor.mjs +1 -0
  5. package/dist/{constants-ok-dir-DZ25OS9-.mjs → constants-ok-dir-BmRrWVQT.mjs} +4 -6
  6. package/dist/{dist-DSmo1Lcl.mjs → dist-CIYAWEYF.mjs} +2 -2
  7. package/dist/{dist-DOYC-8cO.mjs → dist-k81QnN99.mjs} +1 -1
  8. package/dist/{fs-find-project-root-BYV07wjn.mjs → fs-find-project-root-pgJRBsWv.mjs} +1 -1
  9. package/dist/{git-credential-get-BOA4DNNp.mjs → git-credential-get-DMBGntCK.mjs} +1 -1
  10. package/dist/git-credential-helper-CdXg2HRo.mjs +1 -0
  11. package/dist/index.mjs +6 -8
  12. package/dist/init-Cbj53Eeg.mjs +1 -0
  13. package/dist/{init-BHis7IEp.mjs → init-Ck7IdPUt.mjs} +2 -2
  14. package/dist/{launch-json-removal-CEoXmepW.mjs → launch-json-removal-U2KFm9Sc.mjs} +1 -1
  15. package/dist/{lib-CGyiYSWt.mjs → lib-CMODqczN.mjs} +1 -1
  16. package/dist/loader-CQUqdd74.mjs +1 -0
  17. package/dist/{loader-DhBnMAVG.mjs → loader-Dnyz7fM9.mjs} +1 -1
  18. package/dist/{md-manager-BGnqyqi1-CG3Frety.mjs → md-manager-BGnqyqi1-CmUAdK_J.mjs} +1 -1
  19. package/dist/{open-browser-3b35E3nN.mjs → open-browser-CozXyn3C.mjs} +1 -1
  20. package/dist/parse-worker.mjs +1 -1
  21. package/dist/{preview-Da5wwkk4.mjs → preview-DIbjm9qq.mjs} +1 -1
  22. package/dist/preview-Dp4YDD7T.mjs +1 -0
  23. package/dist/public/assets/{AccountSection-aaMIL68D.js → AccountSection-O_yo52Dy.js} +1 -1
  24. package/dist/public/assets/{ActivityModeContent-CuUOJGgq.js → ActivityModeContent-cPL1LX-b.js} +1 -1
  25. package/dist/public/assets/{AddPropertiesButton-BJYmaE99.js → AddPropertiesButton-CG9_LIkJ.js} +2 -2
  26. package/dist/public/assets/{AgentConnectionsSection-BGriqiir.js → AgentConnectionsSection-DL5G9vDr.js} +1 -1
  27. package/dist/public/assets/{AgentDiffPane-Ba6aNszF.js → AgentDiffPane-CADFHRsv.js} +1 -1
  28. package/dist/public/assets/{AttachmentsSection-Xhn1aeK_.js → AttachmentsSection-pECr6aIV.js} +1 -1
  29. package/dist/public/assets/{AuthModal-CJedoV6p.js → AuthModal-BqAFZ5VD.js} +1 -1
  30. package/dist/public/assets/{CodeMirrorPropInput-a1LFw6FZ.js → CodeMirrorPropInput-C4TY1f7B.js} +1 -1
  31. package/dist/public/assets/{ContentRulesSection-lUj-DE7_.js → ContentRulesSection-sxmESH2w.js} +1 -1
  32. package/dist/public/assets/{DiffViewBoundary-hs_VDrka.js → DiffViewBoundary-BCb7uBFd.js} +1 -1
  33. package/dist/public/assets/{DocumentContext-DIp5TpNB.js → DocumentContext-BvOjiWsQ.js} +1 -1
  34. package/dist/public/assets/{EditorModeToggle-BuEaXfYw.js → EditorModeToggle-C6xwRU0E.js} +1 -1
  35. package/dist/public/assets/{ExcalidrawDocEditor-BqH0zVuf.js → ExcalidrawDocEditor-Bn6D3KS6.js} +1 -1
  36. package/dist/public/assets/FeedbackForm-WurwG1D6.js +1 -0
  37. package/dist/public/assets/{GraphPanel-CA7VLMPM.js → GraphPanel-epDsGADf.js} +1 -1
  38. package/dist/public/assets/{ImportSkillDialog-CvTG8qjH.js → ImportSkillDialog-U1diThTm.js} +1 -1
  39. package/dist/public/assets/{LinkPreviewsSection-Cu8i9_Yb.js → LinkPreviewsSection-BbwR_Xhc.js} +1 -1
  40. package/dist/public/assets/{LintConfigEditor-BBSt3nn4.js → LintConfigEditor-By8IWEC2.js} +1 -1
  41. package/dist/public/assets/{LintingSection-C2IjwsT9.js → LintingSection-EkiEd6XH.js} +1 -1
  42. package/dist/public/assets/{ManagedArtifactProperties-CG64Kpwk.js → ManagedArtifactProperties-CFbF1QRE.js} +1 -1
  43. package/dist/public/assets/ManagedArtifactProperties-sONecdUw.js +1 -0
  44. package/dist/public/assets/{Mermaid-B1Zb1GVX.js → Mermaid-B8e_9k_P.js} +1 -1
  45. package/dist/public/assets/{MermaidDocEditor-D5lKV6eK.js → MermaidDocEditor-CjUeUynW.js} +1 -1
  46. package/dist/public/assets/{NetworkAccessSection-biBXOoQH.js → NetworkAccessSection-BTq7VLG5.js} +1 -1
  47. package/dist/public/assets/{ProjectTemplatesSection-DnNyoDmD.js → ProjectTemplatesSection-D7kiwJKw.js} +1 -1
  48. package/dist/public/assets/{PropertyDisplayRow-5egq279g.js → PropertyDisplayRow-DoRxhXZY.js} +1 -1
  49. package/dist/public/assets/{PublishToGitHubDialog-CBeA-CHQ.js → PublishToGitHubDialog-DRKtn3mD.js} +1 -1
  50. package/dist/public/assets/{RegisteredAgentIcon-DtQ0KEVm.js → RegisteredAgentIcon-C69y42WU.js} +1 -1
  51. package/dist/public/assets/{SchemaConfigEditor-b-vDL1EB.js → SchemaConfigEditor-DZ2bS2r5.js} +1 -1
  52. package/dist/public/assets/{SearchSection--W2XP758.js → SearchSection-BocBPH7s.js} +1 -1
  53. package/dist/public/assets/{SessionsHost-DH8nJ9Dv.js → SessionsHost-Qg62Qwqh.js} +2 -2
  54. package/dist/public/assets/{SettingsDialogBody-CqUE14jQ.js → SettingsDialogBody-D5hV_-H4.js} +2 -2
  55. package/dist/public/assets/{ShareReceiveMissDialog-D3I-4BeS.js → ShareReceiveMissDialog-DITSL55U.js} +1 -1
  56. package/dist/public/assets/{SkillCostValue-DvhkGtxl.js → SkillCostValue-CCZx4nsd.js} +1 -1
  57. package/dist/public/assets/{SkillForkDialog-DRFCczwZ.js → SkillForkDialog-3Q4qiLGp.js} +1 -1
  58. package/dist/public/assets/{SkillInstallMenu-yZ2LF3xI.js → SkillInstallMenu-CgZ6TUtX.js} +1 -1
  59. package/dist/public/assets/{SkillOriginInline-CtCMa2BK.js → SkillOriginInline-XucbICfa.js} +1 -1
  60. package/dist/public/assets/{SkillPluginBundleDialog-3QRGH28G.js → SkillPluginBundleDialog-9gvF1DrZ.js} +1 -1
  61. package/dist/public/assets/{SkillToolbarControls-5lGh9ATh.js → SkillToolbarControls-LOhvM0Vh.js} +1 -1
  62. package/dist/public/assets/{SkillsManagerSection-CfotG9eR.js → SkillsManagerSection-BKfHEWsE.js} +1 -1
  63. package/dist/public/assets/{SlidesToolbarControls-DsTwYCvs.js → SlidesToolbarControls-DpiGxpX4.js} +1 -1
  64. package/dist/public/assets/{SourceEditor-DMtiXknW.js → SourceEditor-BM7alMKz.js} +1 -1
  65. package/dist/public/assets/{SpellingSettings-DS0iCc6q.js → SpellingSettings-BNqk7ZoO.js} +1 -1
  66. package/dist/public/assets/{SyncSection-CiWtQPcq.js → SyncSection-D6SWg41E.js} +1 -1
  67. package/dist/public/assets/{SyncStatusBadge-Dkd99XYk.js → SyncStatusBadge-DwT-TrQS.js} +1 -1
  68. package/dist/public/assets/{TemplateRow-CH88SaaS.js → TemplateRow-CsngmzEI.js} +1 -1
  69. package/dist/public/assets/{TerminalLaunchContext-DknxkMP_.js → TerminalLaunchContext-Ce2ozRHg.js} +1 -1
  70. package/dist/public/assets/{TerminalPanel-CzYCOqZx.js → TerminalPanel-CZqgzugj.js} +1 -1
  71. package/dist/public/assets/{TerminalSection-ilXTvB-p.js → TerminalSection-CMJ2IWFq.js} +1 -1
  72. package/dist/public/assets/{TerminalWindowApp-FXRWRY1A.js → TerminalWindowApp-llj2SU1r.js} +1 -1
  73. package/dist/public/assets/{TextDocEditor-D01i9I6q.js → TextDocEditor-C-XNuWo_.js} +1 -1
  74. package/dist/public/assets/{ThemePluginSection-C3QmAxSy.js → ThemePluginSection-B0rRHWvg.js} +1 -1
  75. package/dist/public/assets/{ThreadView-Bk-dtTmC.js → ThreadView-BSQ0MMDw.js} +1 -1
  76. package/dist/public/assets/{TimelineDiffPane-Cvm1nFqo.js → TimelineDiffPane-1Ja5O3Q5.js} +1 -1
  77. package/dist/public/assets/{agent-connections-Bk1le3Hp.js → agent-connections-CAbRKNnv.js} +1 -1
  78. package/dist/public/assets/{agent-registry-DAlpnuPI.js → agent-registry-0mqN6WP3.js} +1 -1
  79. package/dist/public/assets/{bridge-C3zpQGKh.js → bridge-CW0Ocq0O.js} +1 -1
  80. package/dist/public/assets/{catalog-BIFRvQrT.js → catalog-DuBdYGMO.js} +1 -1
  81. package/dist/public/assets/{client-version-BDv2lO55.js → client-version-DQw-TZ5F.js} +1 -1
  82. package/dist/public/assets/{comment-chips-BeLq5aeI.js → comment-chips-CqCNIMjK.js} +1 -1
  83. package/dist/public/assets/{config-provider-ELrfYFIj.js → config-provider-BGDDkwi7.js} +1 -1
  84. package/dist/public/assets/config-schema-esKYrT5l.js +1 -0
  85. package/dist/public/assets/{css-color-to-hex-B2zwblEY.js → css-color-to-hex-CKYM0Miq.js} +1 -1
  86. package/dist/public/assets/{doc-undo-manager-BLdCVMND.js → doc-undo-manager-D320rwaw.js} +1 -1
  87. package/dist/public/assets/{field-controls-hRoeLiNf.js → field-controls-DWd_HhuV.js} +1 -1
  88. package/dist/public/assets/field-controls-i_QRV-wP.js +1 -0
  89. package/dist/public/assets/{ime-composition-CGhNlGxT.js → ime-composition-4cqEjrpI.js} +1 -1
  90. package/dist/public/assets/{index-CH3jrX2i.js → index-DSP8p9bh.js} +7 -7
  91. package/dist/public/assets/{lint-config-client-Cwihn-uv.js → lint-config-client-71dtnA5U.js} +1 -1
  92. package/dist/public/assets/{lint-plugins-o3jR6nZZ.js → lint-plugins-Cg1aq0h8.js} +1 -1
  93. package/dist/public/assets/{markdown-lint-BHJCn8aG.js → markdown-lint-BcOsnI7e.js} +1 -1
  94. package/dist/public/assets/{markdownlint-rule-browser-BljNWP0X.js → markdownlint-rule-browser-BS2foSnD.js} +1 -1
  95. package/dist/public/assets/{pending-receive-nav-store-Cr0wnEzu.js → pending-receive-nav-store-CjsYVdhG.js} +1 -1
  96. package/dist/public/assets/{preferred-session-events-B58vR4cJ.js → preferred-session-events-DFdQa1Ey.js} +1 -1
  97. package/dist/public/assets/{progress-KRn1njNU.js → progress-Daj1dWiJ.js} +1 -1
  98. package/dist/public/assets/{saved-themes-client-BESiCu3n.js → saved-themes-client-aA6J01_B.js} +1 -1
  99. package/dist/public/assets/{schema-section-CufFaxte.js → schema-section-5T_80p75.js} +1 -1
  100. package/dist/public/assets/{schemas-api-6ufosDur.js → schemas-api-C0HskKob.js} +4 -6
  101. package/dist/public/assets/{selection-context-BtEbSuOb.js → selection-context-Cuwfdopq.js} +1 -1
  102. package/dist/public/assets/{skills-api-BW6egGED.js → skills-api-MxDmjydw.js} +1 -1
  103. package/dist/public/assets/{src-9bey79v9.js → src-CAA1FVoz.js} +1 -1
  104. package/dist/public/assets/storage-scope-BJsd6z-F.js +1 -0
  105. package/dist/public/assets/{tag-pill-input-BaWWdgLz.js → tag-pill-input-C6vxVbIh.js} +1 -1
  106. package/dist/public/assets/{telemetry-impl-CjtcgCWv.js → telemetry-impl-LA-vQlId.js} +1 -1
  107. package/dist/public/assets/{telemetry-startup-CxMt1a_t.js → telemetry-startup-WUeATH0W.js} +1 -1
  108. package/dist/public/assets/{terminal-launch-events-CzHSWWOd.js → terminal-launch-events-BSiTJFYa.js} +1 -1
  109. package/dist/public/assets/{theme-token-colors-BHO3FRsE.js → theme-token-colors-BjJGm37d.js} +1 -1
  110. package/dist/public/assets/{typing-burst-detector-DTXVCBzI.js → typing-burst-detector-Wolqh09v.js} +1 -1
  111. package/dist/public/assets/{use-activity-panel-2O69eqtu.js → use-activity-panel-a8YARhmb.js} +1 -1
  112. package/dist/public/assets/{use-apply-config-color-theme-Dp4XXsd0.js → use-apply-config-color-theme-4QTd28x5.js} +1 -1
  113. package/dist/public/assets/{use-conflicts-BjdOWvm-.js → use-conflicts-DxlfkTJB.js} +1 -1
  114. package/dist/public/assets/{use-live-xterm-theme-BeWdaIDt.js → use-live-xterm-theme-AQjmiA_8.js} +1 -1
  115. package/dist/public/assets/{use-open-skill-CjwGsoNJ.js → use-open-skill-D9PDpWe0.js} +1 -1
  116. package/dist/public/assets/{use-semantic-search-status-H3Lc3w3y.js → use-semantic-search-status-ndZxS3vx.js} +1 -1
  117. package/dist/public/assets/{use-skill-origin-CevMDiz2.js → use-skill-origin-NWSdADZr.js} +1 -1
  118. package/dist/public/assets/{use-skill-targets-Bm-1Jayt.js → use-skill-targets-UEhNy--n.js} +1 -1
  119. package/dist/public/assets/{use-skills-BWN24_tx.js → use-skills-DAulZHaI.js} +1 -1
  120. package/dist/public/assets/{use-terminal-enabled-BnY2gtTd.js → use-terminal-enabled-Dc8lWV60.js} +1 -1
  121. package/dist/public/assets/{use-timeline-entry-diff-DHYJY17K.js → use-timeline-entry-diff-7xIXFItS.js} +1 -1
  122. package/dist/public/assets/{use-workspace-gZ0GtHN-.js → use-workspace-Cnu149Vc.js} +1 -1
  123. package/dist/public/index.html +49 -49
  124. package/dist/{registry-probes-ttAcqvMn.mjs → registry-probes-BBpzaE65.mjs} +1 -1
  125. package/dist/{removal-file-path-DCi38kLe.mjs → removal-file-path-CuS8lv9y.mjs} +1 -1
  126. package/dist/{repair-launch-json-DYtehqCc.mjs → repair-launch-json-Cd7MGZwo.mjs} +1 -1
  127. package/dist/{repair-mcp-configs-DAUG33I0.mjs → repair-mcp-configs-D50j0NhQ.mjs} +1 -1
  128. package/dist/src-3IaANAHe.mjs +1 -0
  129. package/dist/{src-CBqKR0gW.mjs → src-CeaYzyFh.mjs} +1 -1
  130. package/dist/start-CZxUk5Zk.mjs +1 -0
  131. package/dist/{start-DVgvzUkv.mjs → start-D6IfSsxL.mjs} +3 -3
  132. package/dist/{token-store-Bmb3_0hU.mjs → token-store-BMV8xJ7T.mjs} +1 -1
  133. package/dist/wrapper-CraXNOsD.mjs +6 -0
  134. package/package.json +4 -4
  135. package/dist/constants-DiHz1wtZ.mjs +0 -1
  136. package/dist/git-credential-helper-DY8W25nc.mjs +0 -1
  137. package/dist/init-CUfGAoM0.mjs +0 -1
  138. package/dist/loader-C4uEtEIO.mjs +0 -1
  139. package/dist/preview-P04WQ1nF.mjs +0 -1
  140. package/dist/public/assets/FeedbackForm-BXDwqZJU.js +0 -1
  141. package/dist/public/assets/ManagedArtifactProperties-x7fya-9W.js +0 -1
  142. package/dist/public/assets/config-schema-CmT2Ao7f.js +0 -1
  143. package/dist/public/assets/field-controls-ZSTvXteZ.js +0 -1
  144. package/dist/public/assets/storage-scope-CM5DIkjP.js +0 -1
  145. package/dist/src-D_2C7rbj.mjs +0 -1
  146. package/dist/start-B5QKZYaA.mjs +0 -1
  147. package/dist/wrapper-BF8oRx3G.mjs +0 -6
@@ -1,5 +1,5 @@
1
1
  import{i as e,t}from"./rolldown-runtime-tZXQYakl.mjs";const n={stable:{appId:`com.inkeep.open-knowledge`,productName:`OpenKnowledge`,packageName:`@inkeep/open-knowledge-desktop`,linuxExecutableName:`openknowledge`,protocolScheme:`openknowledge`,linuxPackageNames:{deb:`openknowledge`,rpm:`openknowledge`},retiredLinuxPackageNames:{deb:[],rpm:[`OpenKnowledge`]},cliCommandNames:[`ok`,`open-knowledge`],mcpServerName:`open-knowledge`,mcpChainTag:``,npmDistTag:`latest`,userHomeDirName:`.ok`,keyringService:`open-knowledge`},beta:{appId:`com.inkeep.open-knowledge.beta`,productName:`OpenKnowledge Beta`,packageName:`openknowledge-beta-desktop`,linuxExecutableName:`openknowledge-beta`,protocolScheme:`openknowledge-beta`,linuxPackageNames:{deb:`openknowledge-beta`,rpm:`openknowledge-beta`},retiredLinuxPackageNames:{deb:[`openknowledge-beta-desktop`],rpm:[`openknowledge-beta-desktop`]},cliCommandNames:[`ok-beta`,`open-knowledge-beta`],mcpServerName:`open-knowledge-beta`,mcpChainTag:`-beta`,npmDistTag:`beta`,userHomeDirName:`.ok-beta`,keyringService:`open-knowledge-beta`},dev:{appId:`com.inkeep.open-knowledge.dev`,productName:`OpenKnowledge Dev`,packageName:`openknowledge-dev-desktop`,linuxExecutableName:`openknowledge-dev`,protocolScheme:`openknowledge-dev`,linuxPackageNames:{deb:`openknowledge-dev`,rpm:`openknowledge-dev`},retiredLinuxPackageNames:{deb:[],rpm:[]},cliCommandNames:[`ok-dev`,`open-knowledge-dev`],mcpServerName:`open-knowledge-dev`,mcpChainTag:`-dev`,npmDistTag:`latest`,userHomeDirName:`.ok-dev`,keyringService:`open-knowledge-dev`}},r=[`stable`,`beta`];function i(e){return`${e.productName}.exe`}function a(e){return[e.packageName.replaceAll(`/`,``),e.productName]}const o=n.stable.productName,s=`OK_CHANNEL`;function c(e){return Object.hasOwn(n,e)}function l(e){return e.OK_CHANNEL?.trim().toLowerCase()||void 0}function u(e=globalThis.process?.env??{}){return l(e)===`dev`}function d(e){l(e)===void 0&&(e[s]=`dev`)}function f(e){return e===`stable`?`${o} (Stable)`:c(e)?n[e].productName:`${o} (${e})`}function p(e){return(e.split(/[\\/]/).pop()??``).replace(/\.exe$/i,``)}function m(e=globalThis.process?.env??{},t=globalThis.process?.execPath??``){let i=l(e);if(i){if(c(i))return i;throw Error(`Unsupported ${s}=${JSON.stringify(i)}. Expected ${Object.keys(n).join(` or `)}.`)}let a=p(t);for(let e of r){if(e===`stable`)continue;let t=n[e];if(a===t.linuxExecutableName||a===t.productName||a.startsWith(`${t.productName} `))return e}return`stable`}function h(){return n[m()]}function g(){return h().mcpServerName}function _(){return h().cliCommandNames[0]}const v=`node <checkout>/packages/cli/dist/cli.mjs`;function y(e){return e.toUpperCase()===s}function b(e){return Object.entries(e).some(([e,t])=>y(e)&&t?.trim().toLowerCase()===`dev`)}function x(e){let t=b(e),n={};for(let[r,i]of Object.entries(e))i===void 0||t&&y(r)||(n[r]=i);return n}const S=[[`auth`,`login`],[`auth`,`pat`],[`auth`,`token`],[`auth`,`signout`],[`clone`],[`start`]];var C=class e{#e;#t;#n;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n}static resolve(t={}){let n=t.env??globalThis.process?.env??{},[i,...a]=t.host?.cliArgs??[],o=m(n),c=r.includes(o),l=i!==void 0,u=o!==`stable`&&(l||c);return new e(l?[i,...a]:[`open-knowledge`],{...t.host?.cliEnv,...u?{[s]:o}:{}},o===`dev`&&!l)}refusalFor(e){if(this.#n)return S.some(t=>t.every((t,n)=>e[n]===t))?`This dev build has no built CLI, so it will not sign in, sign out, store a token, clone a project or start a project server through the installed OpenKnowledge (Stable) CLI. Run pnpm build in the checkout, then restart this dev build.`:void 0}runnerInvocation(e){let t=this.refusalFor(e);return t===void 0?{cliArgs:[...this.#e,...e],cliEnv:{...this.#t}}:{refused:t}}spawn(e,t){let n=this.refusalFor(e);if(n!==void 0)return{refused:n};let[r,...i]=this.#e,a=x(t);for(let[e,t]of Object.entries(this.#t))t===void 0?delete a[e]:a[e]=t;return{command:r,args:[...i,...e],env:a}}stdioServer(e){this.#r(e);let[t,...n]=this.#e;return{command:t,args:[...n,...e],env:w(this.#t)}}shellCommand(e,t){return this.#r(e),[...Object.entries(w(this.#t)).map(([e,n])=>`${e}=${t(n)}`),...[...this.#e,...e].map(t)].join(` `)}#r(e){let t=this.refusalFor(e);if(t!==void 0)throw Error(t)}};function w(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function T(e,...t){return[`~`,e.userHomeDirName,...t].join(`/`)}var E=t((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),D=t((e=>{var t=E();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),ee=t((e=>{var t=E(),n=D();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)(t!==`!!`||n!==`tag:yaml.org,2002:`)&&(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(`
2
- `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),O=t((e=>{var t=E(),n=D();function r(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function i(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}}e.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),te=t((e=>{function t(e,n,r,i){if(i&&typeof i==`object`){if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}}return e.call(n,r,i)}e.applyReviver=t})),k=t((e=>{var t=E();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),A=t((e=>{var t=te(),n=E(),r=k();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),j=t((e=>{var t=O(),n=D(),r=E(),i=A(),a=k(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let a;for(let e of i){if(e===this)break;e.anchor===this.source&&(a=e)}return a}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let c=n.get(o);if(c||=(a.toJS(o,null,t),n.get(o)),c?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=s(r,o,n)),c.count*c.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return c.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),M=t((e=>{var t=E(),n=A(),r=k();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),N=t((e=>{var t=j(),n=E(),r=M();function i(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function a(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??(f.anchor=c(e)),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=a})),P=t((e=>{var t=N(),n=E(),r=A();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),F=t((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
2
+ `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),O=t((e=>{var t=E(),n=D();function r(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function i(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}}e.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),te=t((e=>{function t(e,n,r,i){if(i&&typeof i==`object`){if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}}return e.call(n,r,i)}e.applyReviver=t})),k=t((e=>{var t=E();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),A=t((e=>{var t=te(),n=E(),r=k();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),j=t((e=>{var t=O(),n=D(),r=E(),i=A(),a=k(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let o;for(let e of i){if(e===this)break;e.anchor===this.source&&(o=e)}if(o&&t){let{anchors:e,doc:n,maxAliasCount:r}=t,i=e.get(o);if(i||=(a.toJS(o,null,t),e.get(o)),i?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(r>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=s(n,o,e)),i.count*i.aliasCount>r))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return o}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),M=t((e=>{var t=E(),n=A(),r=k();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),N=t((e=>{var t=j(),n=E(),r=M();function i(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function a(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??(f.anchor=c(e)),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=a})),P=t((e=>{var t=N(),n=E(),r=A();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),F=t((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
3
3
  `)?n(r,t):r.includes(`
4
4
  `)?`
5
5
  `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),ne=t((e=>{let t=`block`,n=`quoted`;function r(e,r,a=`flow`,{indentAtStart:o,lineWidth:s=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!s||s<0)return e;s<c&&(c=0);let d=Math.max(1+c,1+s-r.length);if(e.length<=d)return e;let f=[],p={},m=s-r.length;typeof o==`number`&&(o>s-Math.max(2,c)?f.push(0):m=s-o);let h,g,_=!1,v=-1,y=-1,b=-1;a===t&&(v=i(e,v,r.length),v!==-1&&(m=v+d));for(let o;o=e[v+=1];){if(a===n&&o===`\\`){switch(y=v,e[v+1]){case`x`:v+=3;break;case`u`:v+=5;break;case`U`:v+=9;break;default:v+=1}b=v}if(o===`
@@ -61,11 +61,9 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
61
61
  `+l[e][0].slice(d);m[m.length-1]!==`
62
62
  `&&(m+=`
63
63
  `);break;default:m+=`
64
- `}let _=o+s.length+n.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}function r({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function i(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}e.resolveBlockScalar=n})),Ae=t((e=>{var t=M(),n=Q();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;default:return o(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,r,o);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}function i(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),o(e)}function a(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),o(e.slice(1,-1)).replace(/''/g,`'`)}function o(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
65
- `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
66
- `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
67
- `?i+=a:a=`
68
- `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function s(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
64
+ `}let _=o+s.length+n.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}function r({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function i(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}e.resolveBlockScalar=n})),Ae=t((e=>{var t=M(),n=Q();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;default:return o(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,r,o);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}function i(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),o(e)}function a(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),o(e.slice(1,-1)).replace(/''/g,`'`)}function o(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
65
+ `?a+=o:o=`
66
+ `:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function s(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
69
67
  `){if(i===`
70
68
  `){let{fold:t,offset:i}=c(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=l[i];if(a)n+=a;else if(i===`
71
69
  `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
@@ -1,4 +1,4 @@
1
- import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-tZXQYakl.mjs";import{A as o,C as s,F as c,L as l,O as u,T as d,a as f,b as p,c as m,d as h,g,h as _,i as v,k as y,l as b,n as x,r as S,s as C,t as w,u as T,x as E,y as D}from"./constants-ok-dir-DZ25OS9-.mjs";import{$ as O,$a as k,$c as A,$d as j,$i as M,$l as N,$n as P,$o as ee,$r as te,$s as F,$t as I,$u as ne,A as re,Aa as ie,Ac as ae,Ad as oe,Ai as se,Al as ce,An as le,Ao as ue,Ar as de,As as fe,At as pe,Au as me,B as he,Ba as ge,Bc as _e,Bd as ve,Bi as ye,Bl as be,Bn as xe,Bo as Se,Br as Ce,Bs as we,Bt as Te,Bu as Ee,Ca as De,Cd as Oe,Ci as ke,Cl as Ae,Cn as je,Co as Me,Cr as Ne,Cs as Pe,Ct as Fe,Cu as Ie,D as Le,Dc as Re,Dd as ze,Di as Be,Dl as Ve,Dn as He,Do as Ue,Dr as We,Ds as Ge,Dt as Ke,Du as qe,E as Je,Ea as Ye,Ec as Xe,Ed as L,Ei as Ze,El as Qe,En as $e,Eo as et,Er as tt,Es as nt,Et as rt,Eu as it,Fa as at,Fc as ot,Fd as st,Fi as ct,Fl as lt,Fn as ut,Fo as dt,Fr as ft,Fs as pt,Ft as mt,Fu as ht,Ga as gt,Gd as _t,Gi as vt,Gl as yt,Gn as bt,Go as xt,Gr as St,Gs as Ct,Gt as wt,Gu as Tt,H as Et,Ha as Dt,Hc as Ot,Hd as kt,Hi as At,Hn as jt,Ho as Mt,Hr as Nt,Hs as Pt,Ht as Ft,Hu as It,Ia as Lt,Ic as Rt,Id as R,Ii as zt,Il as Bt,In as Vt,Io as Ht,Ir as Ut,Is as Wt,It as Gt,Iu as Kt,J as qt,Ja as Jt,Jc as Yt,Jd as Xt,Ji as Zt,Jl as Qt,Jn as $t,Jo as en,Jr as tn,Js as nn,Jt as rn,Ju as an,K as on,Ka as sn,Kc as cn,Kd as ln,Ki as un,Kl as dn,Kn as fn,Ko as pn,Kr as mn,Ks as hn,Kt as gn,Ku as _n,L as vn,La as yn,Lc as bn,Ld as xn,Li as Sn,Ln as Cn,Lo as wn,Lr as Tn,Ls as En,Lt as Dn,Lu as On,M as kn,Ma as An,Mc as jn,Md as z,Mi as Mn,Ml as Nn,Mn as Pn,Mo as Fn,Mr as In,Ms as Ln,Mt as Rn,Mu as zn,Na as Bn,Nc as Vn,Nd as B,Ni as Hn,Nl as Un,Nn as Wn,No as Gn,Nr as Kn,Ns as qn,Nt as Jn,Nu as Yn,O as Xn,Oc as Zn,Od as Qn,Oi as $n,Ol as er,On as tr,Oo as nr,Or as rr,Os as ir,Ot as ar,Ou as or,P as sr,Pa as cr,Pc as lr,Pd as ur,Pi as dr,Pl as fr,Pn as pr,Po as mr,Pr as hr,Ps as gr,Pt as _r,Pu as vr,Q as yr,Qa as br,Qc as xr,Qd as Sr,Qi as Cr,Ql as wr,Qn as Tr,Qo as Er,Qr as Dr,Qs as Or,Qt as kr,Qu as Ar,R as jr,Rc as Mr,Rd as Nr,Ri as Pr,Rn as Fr,Ro as Ir,Rr as Lr,Rs as Rr,Rt as zr,Ru as Br,Sa as Vr,Sd as Hr,Si as Ur,Sl as Wr,Sn as Gr,So as Kr,Sr as qr,Ss as Jr,St as Yr,Su as Xr,T as Zr,Ta as Qr,Tc as $r,Td as ei,Ti as ti,Tl as ni,Tn as ri,To as ii,Tr as ai,Ts as oi,Tt as si,Tu as ci,Ua as li,Uc as ui,Ud as di,Ui as fi,Ul as eee,Un as pi,Uo as mi,Ur as tee,Us as hi,Ut as gi,Uu as nee,V as _i,Va as vi,Vc as ree,Vi as iee,Vl as aee,Vn as oee,Vo as see,Vr as cee,Vs as lee,Vt as uee,Vu as yi,Wa as bi,Wc as dee,Wd as xi,Wi as fee,Wl as Si,Wn as pee,Wo as mee,Wr as hee,Ws as gee,Wt as _ee,Wu as Ci,Xa as wi,Xd as Ti,Xi as vee,Xl as Ei,Xn as Di,Xo as yee,Xr as bee,Xs as xee,Xt as Oi,Xu as See,Y as Cee,Ya as ki,Yc as wee,Yi as Tee,Yl as Ai,Yn as ji,Yo as Eee,Yr as Dee,Ys as Oee,Yt as Mi,Yu as Ni,Za as Pi,Zc as kee,Zi as Aee,Zl as Fi,Zn as jee,Zo as Mee,Zr as Nee,Zs as Pee,Zt as Ii,Zu as Fee,_ as Iee,_a as Li,_c as Ri,_d as zi,_i as Lee,_l as Ree,_n as zee,_o as Bi,_r as Bee,_s as Vee,_t as Vi,_u as Hee,a as Uee,aa as Wee,ac as Gee,ad as Kee,ai as qee,al as Jee,an as Yee,ao as Xee,ar as Zee,as as Qee,at as $ee,au as Hi,b as Ui,ba as ete,bc as tte,bd as Wi,bi as nte,bl as rte,bn as ite,bo as ate,br as Gi,bs as ote,bt as ste,bu as Ki,c as cte,ca as qi,cc as lte,cd as ute,cf as dte,ci as Ji,cl as fte,cn as pte,co as mte,cr as hte,cs as gte,ct as Yi,cu as Xi,d as Zi,dc as _te,dd as vte,df as Qi,di as yte,dn as bte,do as $i,dr as xte,ds as Ste,dt as ea,du as Cte,ea as wte,ec as Tte,ed as Ete,ei as Dte,el as Ote,en as kte,eo as ta,er as na,es as Ate,et as jte,eu as Mte,fa as Nte,fd as Pte,fi as Fte,fn as Ite,fo as Lte,fr as Rte,fs as zte,ft as ra,fu as ia,g as Bte,ga as Vte,gc as Hte,gd as Ute,gi as Wte,gl as Gte,gn as Kte,go as qte,gr as Jte,gs as Yte,gt as aa,gu as Xte,h as Zte,ha as oa,hc as Qte,hi as $te,hn as ene,ho as tne,hr as nne,hs as rne,ht as ine,hu as sa,ia as ane,ic as one,id as sne,ii as cne,il as ca,in as lne,io as la,ir as une,is as dne,it as ua,iu as fne,j as da,ja as pne,jc as fa,jd as mne,ji as hne,jl as gne,jn as _ne,jo as vne,jr as yne,js as bne,jt as xne,ju as pa,ka as Sne,kc as ma,kd as V,ki as Cne,kl as wne,kn as Tne,ko as Ene,kr as Dne,ks as One,kt as ha,ku as ga,la as kne,lc as Ane,ld as jne,li as Mne,ll as Nne,ln as _a,lo as Pne,lr as Fne,ls as Ine,lt as va,lu as ya,m as ba,ma as Lne,mc as Rne,md as zne,mi as Bne,ml as Vne,mn as Hne,mo as Une,mr as Wne,ms as xa,mt as Gne,mu as Kne,n as Sa,na as qne,nc as Jne,nd as Yne,nf as Ca,ni as Xne,nl as Zne,nn as Qne,no as $ne,nr as ere,ns as tre,nt as nre,nu as rre,o as ire,oa as are,oc as ore,od as sre,of as cre,oi as lre,ol as wa,on as ure,oo as dre,or as fre,os as pre,ot as Ta,ou as mre,pa as hre,pc as Ea,pi as gre,pl as Da,pn as _re,po as vre,pr as yre,ps as Oa,pt as ka,pu as Aa,qa as bre,qc as xre,qd as Sre,qi as Cre,ql as ja,qn as Ma,qo as Na,qr as wre,qs as Pa,qt as Tre,qu as Fa,ra as Ere,rc as Dre,rd as Ore,ri as kre,rl as Ia,rn as Are,ro as jre,rr as La,rs as Mre,rt as Nre,ru as Ra,s as za,sa as Ba,sc as Va,sd as Pre,sf as Fre,si as Ha,sl as Ua,sn as Ire,so as Wa,sr as Ga,ss as Lre,st as Ka,su as qa,t as Ja,ta as Rre,tc as zre,td as Bre,tf as Ya,ti as Vre,tl as Xa,tn as Hre,to as Ure,tr as Wre,ts as Za,tu as Gre,ua as Kre,uc as qre,uf as Jre,ui as Yre,un as Xre,uo as Zre,ur as Qre,us as $re,ut as Qa,uu as $a,v as eie,va as tie,vc as eo,vd as to,vi as nie,vl as rie,vn as iie,vo as aie,vr as oie,vs as sie,vt as no,vu as cie,w as lie,wa as ro,wc as io,wd as ao,wi as oo,wl as uie,wn as so,wo as co,wr as lo,ws as die,wt as uo,wu as fie,x as pie,xa as mie,xc as hie,xd as fo,xi as gie,xl as _ie,xn as vie,xo as yie,xr as po,xs as bie,xt as mo,xu as ho,y as xie,ya as go,yc as Sie,yi as Cie,yl as wie,yn as Tie,yo as Eie,yr as Die,ys as _o,yt as vo,yu as yo,za as bo,zc as xo,zd as Oie,zi as kie,zn as Aie,zo as jie,zr as Mie,zs as Nie,zt as Pie,zu as Fie}from"./md-manager-BGnqyqi1-CG3Frety.mjs";import{$ as Iie,Ht as So,Ut as Co,V as Lie,Zt as Rie,gn as zie,mn as Bie,sn as Vie}from"./memoizer-D67BaNBw.mjs";import{c as wo,d as To,h as Hie,i as Eo,l as Do,n as Oo,o as ko,p as Ao,t as jo}from"./esm-B3YyV3nD.mjs";import{t as Uie}from"./wrapper-BF8oRx3G.mjs";import{t as Mo}from"./chunk-DXB73IDG-DFy9txNR.mjs";import{n as No,r as Po,t as Fo}from"./chunk-OJDRYQWQ-JGMWNwO9.mjs";import{n as Io,t as Lo}from"./chunk-5QMZ5MUS-BuB3i_B5.mjs";import{r as Wie,t as Ro}from"./chunk-24IMIIXA-Dj5K6qOb.mjs";import{t as zo}from"./chunk-B74TABJS-DAm9lxFL.mjs";import{a as Bo,c as Vo,d as Gie,f as Ho,h as Kie,i as Uo,l as Wo,m as Go,n as Ko,o as qo,p as Jo,r as Yo,s as Xo,t as Zo,u as Qo}from"./chunk-GFQRA5P5-ZJVBMLyZ.mjs";import{t as $o}from"./chunk-44UOCSGV-CeGMLWmo.mjs";import{n as es,r as ts,t as ns}from"./chunk-R6VWJ2ZL-DJY9gweS.mjs";import{r as rs}from"./chunk-CWQS3NFK-BbpS-dVt.mjs";import{t as qie}from"./libesm-DRoEqbAC.mjs";import{A as is,B as as,C as os,D as ss,E as Jie,F as Yie,H as Xie,I as Zie,L as cs,M as ls,N as us,O as ds,P as fs,S as Qie,T as $ie,V as eae,_ as tae,a as ps,b as ms,c as hs,d as gs,f as _s,g as nae,h as rae,i as vs,j as ys,k as bs,l as xs,m as iae,n as aae,o as Ss,p as Cs,r as ws,s as Ts,t as oae,u as Es,v as Ds,w as Os,x as ks,y as As,z as js}from"./chunk-BGSUD5R5-Do2r1ZFF.mjs";import{n as Ms}from"./chunk-3THT3N7L-DVKHLRUO.mjs";import{n as sae,t as cae}from"./chunk-A5O5YHGN-BRMz0iFo.mjs";import{t as lae}from"./yazl-BBz29IQN.mjs";import{_ as uae,a as Ns,c as Ps,d as dae,g as fae,i as pae,l as mae,n as Fs,o as Is,r as hae,t as gae,u as Ls,v as _ae,y as Rs}from"./fs-find-project-root-BYV07wjn.mjs";import{createRequire as zs}from"node:module";import{URLSearchParams as vae,fileURLToPath as Bs,pathToFileURL as Vs}from"node:url";import*as Hs from"node:path";import{basename as Us,delimiter as Ws,dirname as H,extname as Gs,isAbsolute as Ks,join as U,normalize as qs,parse as yae,posix as Js,relative as W,resolve as G,sep as Ys,win32 as Xs}from"node:path";import*as Zs from"node:fs";import{accessSync as bae,appendFileSync as xae,chmodSync as Qs,closeSync as $s,constants as ec,cpSync as Sae,createReadStream as tc,createWriteStream as Cae,existsSync as K,fchmodSync as wae,fstatSync as nc,linkSync as Tae,lstatSync as rc,mkdirSync as ic,mkdtempSync as ac,openSync as oc,opendirSync as Eae,readFile as Dae,readFileSync as q,readSync as sc,readdirSync as cc,readlinkSync as Oae,realpathSync as lc,renameSync as uc,rmSync as dc,rmdirSync as fc,statSync as pc,symlinkSync as kae,unlinkSync as mc,utimesSync as Aae,watch as jae,writeFileSync as hc,writeSync as gc}from"node:fs";import{arch as _c,availableParallelism as Mae,homedir as vc,hostname as yc,platform as bc,tmpdir as xc,uptime as Nae,userInfo as Pae}from"node:os";import{Worker as Fae}from"node:worker_threads";import{readdirSync as Iae,statSync as Lae}from"fs";import{spawn as Rae}from"child_process";import{EventEmitter as zae}from"node:events";import{access as Sc,appendFile as Bae,chmod as Vae,constants as Hae,glob as Uae,lstat as Cc,mkdir as wc,open as Wae,readFile as Tc,readdir as Ec,readlink as Gae,realpath as Dc,rename as Kae,rm as qae,stat as Oc,writeFile as kc}from"node:fs/promises";import{Readable as Ac,Transform as Jae,Writable as Yae}from"node:stream";import{join as jc,resolve as Xae}from"path";import Zae from"crypto";import{Readable as Mc}from"stream";import*as Qae from"zlib";import{monitorEventLoopDelay as $ae,performance as eoe}from"node:perf_hooks";import toe,{createHash as Nc,randomUUID as Pc,webcrypto as Fc}from"node:crypto";import{createBrotliDecompress as noe,createGunzip as roe,createInflate as ioe}from"node:zlib";import{AsyncLocalStorage as aoe}from"node:async_hooks";import{pipeline as Ic}from"node:stream/promises";import{execFile as Lc,execFileSync as Rc,spawn as zc,spawnSync as Bc}from"node:child_process";import{setImmediate as ooe,setTimeout as Vc}from"node:timers/promises";import{promisify as Hc,stripVTControlCharacters as soe}from"node:util";import{createInterface as coe}from"node:readline";import{lookup as loe}from"node:dns";import{request as uoe}from"node:http";import*as doe from"node:querystring";import foe from"node:tls";import{DatabaseSync as Uc}from"node:sqlite";import{Http2ServerRequest as Wc,constants as poe}from"node:http2";import{lookup as moe}from"node:dns/promises";import{request as hoe}from"node:https";import{Http2ServerRequest as Gc,constants as goe}from"http2";const _oe=2,Kc={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`},voe={desktop:!0,browser:!0,"embedded:cursor":!0,"embedded:codex":!0,"embedded:claude-desktop":!0},yoe={mcp:!0,"desktop-main":!0,cli:!0};function boe(e){return Object.hasOwn(voe,e)}function xoe(e){if(!(e===void 0||e.length===0||Object.hasOwn(yoe,e)))return boe(e)?e:`unknown`}function Soe({kind:e,runtimeVersion:t}){return{[Kc.protocol]:`2`,[Kc.runtime]:t,[Kc.kind]:e}}const Coe=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),woe=/^={2,}/,Toe=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/;function Eoe(e,t){return Toe.test(e.slice(t,t+512))}function Doe(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>512?!1:Toe.exec(e.slice(n,t+1))?.[0].length===t+1-n}const Ooe=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,koe=/^!(?=\[)/,Aoe=/^\[\^/,joe=/^\]\[[^\]]*\]/,Moe=/^\[\[[^\][|]*\|/,Noe=/^#[^\][|]*(?=\]\])/,Poe=/^\]\([^)]*\)/,Foe=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,Ioe=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,Loe=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/;function Roe(e,t){let n=e.indexOf(`
1
+ import{a as e,i as t,n,o as r,r as i,t as a}from"./rolldown-runtime-tZXQYakl.mjs";import{A as o,C as s,F as c,L as l,O as u,T as d,a as f,b as p,c as m,d as h,g,h as _,i as v,k as y,l as b,n as x,r as S,s as C,t as w,u as T,x as E,y as D}from"./constants-ok-dir-BmRrWVQT.mjs";import{$ as O,$a as k,$c as A,$d as j,$i as M,$l as N,$n as P,$o as ee,$r as te,$s as F,$t as I,$u as ne,A as re,Aa as ie,Ac as ae,Ad as oe,Ai as se,Al as ce,An as le,Ao as ue,Ar as de,As as fe,At as pe,Au as me,B as he,Ba as ge,Bc as _e,Bd as ve,Bi as ye,Bl as be,Bn as xe,Bo as Se,Br as Ce,Bs as we,Bt as Te,Bu as Ee,Ca as De,Cd as Oe,Ci as ke,Cl as Ae,Cn as je,Co as Me,Cr as Ne,Cs as Pe,Ct as Fe,Cu as Ie,D as Le,Dc as Re,Dd as ze,Di as Be,Dl as Ve,Dn as He,Do as Ue,Dr as We,Ds as Ge,Dt as Ke,Du as qe,E as Je,Ea as Ye,Ec as Xe,Ed as L,Ei as Ze,El as Qe,En as $e,Eo as et,Er as tt,Es as nt,Et as rt,Eu as it,Fa as at,Fc as ot,Fd as st,Fi as ct,Fl as lt,Fn as ut,Fo as dt,Fr as ft,Fs as pt,Ft as mt,Fu as ht,Ga as gt,Gd as _t,Gi as vt,Gl as yt,Gn as bt,Go as xt,Gr as St,Gs as Ct,Gt as wt,Gu as Tt,H as Et,Ha as Dt,Hc as Ot,Hd as kt,Hi as At,Hn as jt,Ho as Mt,Hr as Nt,Hs as Pt,Ht as Ft,Hu as It,Ia as Lt,Ic as Rt,Id as R,Ii as zt,Il as Bt,In as Vt,Io as Ht,Ir as Ut,Is as Wt,It as Gt,Iu as Kt,J as qt,Ja as Jt,Jc as Yt,Jd as Xt,Ji as Zt,Jl as Qt,Jn as $t,Jo as en,Jr as tn,Js as nn,Jt as rn,Ju as an,K as on,Ka as sn,Kc as cn,Kd as ln,Ki as un,Kl as dn,Kn as fn,Ko as pn,Kr as mn,Ks as hn,Kt as gn,Ku as _n,L as vn,La as yn,Lc as bn,Ld as xn,Li as Sn,Ln as Cn,Lo as wn,Lr as Tn,Ls as En,Lt as Dn,Lu as On,M as kn,Ma as An,Mc as jn,Md as z,Mi as Mn,Ml as Nn,Mn as Pn,Mo as Fn,Mr as In,Ms as Ln,Mt as Rn,Mu as zn,Na as Bn,Nc as Vn,Nd as B,Ni as Hn,Nl as Un,Nn as Wn,No as Gn,Nr as Kn,Ns as qn,Nt as Jn,Nu as Yn,O as Xn,Oc as Zn,Od as Qn,Oi as $n,Ol as er,On as tr,Oo as nr,Or as rr,Os as ir,Ot as ar,Ou as or,P as sr,Pa as cr,Pc as lr,Pd as ur,Pi as dr,Pl as fr,Pn as pr,Po as mr,Pr as hr,Ps as gr,Pt as _r,Pu as vr,Q as yr,Qa as br,Qc as xr,Qd as Sr,Qi as Cr,Ql as wr,Qn as Tr,Qo as Er,Qr as Dr,Qs as Or,Qt as kr,Qu as Ar,R as jr,Rc as Mr,Rd as Nr,Ri as Pr,Rn as Fr,Ro as Ir,Rr as Lr,Rs as Rr,Rt as zr,Ru as Br,Sa as Vr,Sd as Hr,Si as Ur,Sl as Wr,Sn as Gr,So as Kr,Sr as qr,Ss as Jr,St as Yr,Su as Xr,T as Zr,Ta as Qr,Tc as $r,Td as ei,Ti as ti,Tl as ni,Tn as ri,To as ii,Tr as ai,Ts as oi,Tt as si,Tu as ci,Ua as li,Uc as ui,Ud as di,Ui as fi,Ul as eee,Un as pi,Uo as mi,Ur as tee,Us as hi,Ut as gi,Uu as nee,V as _i,Va as vi,Vc as ree,Vi as iee,Vl as aee,Vn as oee,Vo as see,Vr as cee,Vs as lee,Vt as uee,Vu as yi,Wa as bi,Wc as dee,Wd as xi,Wi as fee,Wl as Si,Wn as pee,Wo as mee,Wr as hee,Ws as gee,Wt as _ee,Wu as Ci,Xa as wi,Xd as Ti,Xi as vee,Xl as Ei,Xn as Di,Xo as yee,Xr as bee,Xs as xee,Xt as Oi,Xu as See,Y as Cee,Ya as ki,Yc as wee,Yi as Tee,Yl as Ai,Yn as ji,Yo as Eee,Yr as Dee,Ys as Oee,Yt as Mi,Yu as Ni,Za as Pi,Zc as kee,Zi as Aee,Zl as Fi,Zn as jee,Zo as Mee,Zr as Nee,Zs as Pee,Zt as Ii,Zu as Fee,_ as Iee,_a as Li,_c as Ri,_d as zi,_i as Lee,_l as Ree,_n as zee,_o as Bi,_r as Bee,_s as Vee,_t as Vi,_u as Hee,a as Uee,aa as Wee,ac as Gee,ad as Kee,ai as qee,al as Jee,an as Yee,ao as Xee,ar as Zee,as as Qee,at as $ee,au as Hi,b as Ui,ba as ete,bc as tte,bd as Wi,bi as nte,bl as rte,bn as ite,bo as ate,br as Gi,bs as ote,bt as ste,bu as Ki,c as cte,ca as qi,cc as lte,cd as ute,cf as dte,ci as Ji,cl as fte,cn as pte,co as mte,cr as hte,cs as gte,ct as Yi,cu as Xi,d as Zi,dc as _te,dd as vte,df as Qi,di as yte,dn as bte,do as $i,dr as xte,ds as Ste,dt as ea,du as Cte,ea as wte,ec as Tte,ed as Ete,ei as Dte,el as Ote,en as kte,eo as ta,er as na,es as Ate,et as jte,eu as Mte,fa as Nte,fd as Pte,fi as Fte,fn as Ite,fo as Lte,fr as Rte,fs as zte,ft as ra,fu as ia,g as Bte,ga as Vte,gc as Hte,gd as Ute,gi as Wte,gl as Gte,gn as Kte,go as qte,gr as Jte,gs as Yte,gt as aa,gu as Xte,h as Zte,ha as oa,hc as Qte,hi as $te,hn as ene,ho as tne,hr as nne,hs as rne,ht as ine,hu as sa,ia as ane,ic as one,id as sne,ii as cne,il as ca,in as lne,io as la,ir as une,is as dne,it as ua,iu as fne,j as da,ja as pne,jc as fa,jd as mne,ji as hne,jl as gne,jn as _ne,jo as vne,jr as yne,js as bne,jt as xne,ju as pa,ka as Sne,kc as ma,kd as V,ki as Cne,kl as wne,kn as Tne,ko as Ene,kr as Dne,ks as One,kt as ha,ku as ga,la as kne,lc as Ane,ld as jne,li as Mne,ll as Nne,ln as _a,lo as Pne,lr as Fne,ls as Ine,lt as va,lu as ya,m as ba,ma as Lne,mc as Rne,md as zne,mi as Bne,ml as Vne,mn as Hne,mo as Une,mr as Wne,ms as xa,mt as Gne,mu as Kne,n as Sa,na as qne,nc as Jne,nd as Yne,nf as Ca,ni as Xne,nl as Zne,nn as Qne,no as $ne,nr as ere,ns as tre,nt as nre,nu as rre,o as ire,oa as are,oc as ore,od as sre,of as cre,oi as lre,ol as wa,on as ure,oo as dre,or as fre,os as pre,ot as Ta,ou as mre,pa as hre,pc as Ea,pi as gre,pl as Da,pn as _re,po as vre,pr as yre,ps as Oa,pt as ka,pu as Aa,qa as bre,qc as xre,qd as Sre,qi as Cre,ql as ja,qn as Ma,qo as Na,qr as wre,qs as Pa,qt as Tre,qu as Fa,ra as Ere,rc as Dre,rd as Ore,ri as kre,rl as Ia,rn as Are,ro as jre,rr as La,rs as Mre,rt as Nre,ru as Ra,s as za,sa as Ba,sc as Va,sd as Pre,sf as Fre,si as Ha,sl as Ua,sn as Ire,so as Wa,sr as Ga,ss as Lre,st as Ka,su as qa,t as Ja,ta as Rre,tc as zre,td as Bre,tf as Ya,ti as Vre,tl as Xa,tn as Hre,to as Ure,tr as Wre,ts as Za,tu as Gre,ua as Kre,uc as qre,uf as Jre,ui as Yre,un as Xre,uo as Zre,ur as Qre,us as $re,ut as Qa,uu as $a,v as eie,va as tie,vc as eo,vd as to,vi as nie,vl as rie,vn as iie,vo as aie,vr as oie,vs as sie,vt as no,vu as cie,w as lie,wa as ro,wc as io,wd as ao,wi as oo,wl as uie,wn as so,wo as co,wr as lo,ws as die,wt as uo,wu as fie,x as pie,xa as mie,xc as hie,xd as fo,xi as gie,xl as _ie,xn as vie,xo as yie,xr as po,xs as bie,xt as mo,xu as ho,y as xie,ya as go,yc as Sie,yi as Cie,yl as wie,yn as Tie,yo as Eie,yr as Die,ys as _o,yt as vo,yu as yo,za as bo,zc as xo,zd as Oie,zi as kie,zn as Aie,zo as jie,zr as Mie,zs as Nie,zt as Pie,zu as Fie}from"./md-manager-BGnqyqi1-CmUAdK_J.mjs";import{$ as Iie,Ht as So,Ut as Co,V as Lie,Zt as Rie,gn as zie,mn as Bie,sn as Vie}from"./memoizer-D67BaNBw.mjs";import{c as wo,d as To,h as Hie,i as Eo,l as Do,n as Oo,o as ko,p as Ao,t as jo}from"./esm-B3YyV3nD.mjs";import{t as Uie}from"./wrapper-CraXNOsD.mjs";import{t as Mo}from"./chunk-DXB73IDG-DFy9txNR.mjs";import{n as No,r as Po,t as Fo}from"./chunk-OJDRYQWQ-JGMWNwO9.mjs";import{n as Io,t as Lo}from"./chunk-5QMZ5MUS-BuB3i_B5.mjs";import{r as Wie,t as Ro}from"./chunk-24IMIIXA-Dj5K6qOb.mjs";import{t as zo}from"./chunk-B74TABJS-DAm9lxFL.mjs";import{a as Bo,c as Vo,d as Gie,f as Ho,h as Kie,i as Uo,l as Wo,m as Go,n as Ko,o as qo,p as Jo,r as Yo,s as Xo,t as Zo,u as Qo}from"./chunk-GFQRA5P5-ZJVBMLyZ.mjs";import{t as $o}from"./chunk-44UOCSGV-CeGMLWmo.mjs";import{n as es,r as ts,t as ns}from"./chunk-R6VWJ2ZL-DJY9gweS.mjs";import{r as rs}from"./chunk-CWQS3NFK-BbpS-dVt.mjs";import{t as qie}from"./libesm-DRoEqbAC.mjs";import{A as is,B as as,C as os,D as ss,E as Jie,F as Yie,H as Xie,I as Zie,L as cs,M as ls,N as us,O as ds,P as fs,S as Qie,T as $ie,V as eae,_ as tae,a as ps,b as ms,c as hs,d as gs,f as _s,g as nae,h as rae,i as vs,j as ys,k as bs,l as xs,m as iae,n as aae,o as Ss,p as Cs,r as ws,s as Ts,t as oae,u as Es,v as Ds,w as Os,x as ks,y as As,z as js}from"./chunk-BGSUD5R5-Do2r1ZFF.mjs";import{n as Ms}from"./chunk-3THT3N7L-DVKHLRUO.mjs";import{n as sae,t as cae}from"./chunk-A5O5YHGN-BRMz0iFo.mjs";import{t as lae}from"./yazl-BBz29IQN.mjs";import{_ as uae,a as Ns,c as Ps,d as dae,g as fae,i as pae,l as mae,n as Fs,o as Is,r as hae,t as gae,u as Ls,v as _ae,y as Rs}from"./fs-find-project-root-pgJRBsWv.mjs";import{createRequire as zs}from"node:module";import{URLSearchParams as vae,fileURLToPath as Bs,pathToFileURL as Vs}from"node:url";import*as Hs from"node:path";import{basename as Us,delimiter as Ws,dirname as H,extname as Gs,isAbsolute as Ks,join as U,normalize as qs,parse as yae,posix as Js,relative as W,resolve as G,sep as Ys,win32 as Xs}from"node:path";import*as Zs from"node:fs";import{accessSync as bae,appendFileSync as xae,chmodSync as Qs,closeSync as $s,constants as ec,cpSync as Sae,createReadStream as tc,createWriteStream as Cae,existsSync as K,fchmodSync as wae,fstatSync as nc,linkSync as Tae,lstatSync as rc,mkdirSync as ic,mkdtempSync as ac,openSync as oc,opendirSync as Eae,readFile as Dae,readFileSync as q,readSync as sc,readdirSync as cc,readlinkSync as Oae,realpathSync as lc,renameSync as uc,rmSync as dc,rmdirSync as fc,statSync as pc,symlinkSync as kae,unlinkSync as mc,utimesSync as Aae,watch as jae,writeFileSync as hc,writeSync as gc}from"node:fs";import{arch as _c,availableParallelism as Mae,homedir as vc,hostname as yc,platform as bc,tmpdir as xc,uptime as Nae,userInfo as Pae}from"node:os";import{Worker as Fae}from"node:worker_threads";import{readdirSync as Iae,statSync as Lae}from"fs";import{spawn as Rae}from"child_process";import{EventEmitter as zae}from"node:events";import{access as Sc,appendFile as Bae,chmod as Vae,constants as Hae,glob as Uae,lstat as Cc,mkdir as wc,open as Wae,readFile as Tc,readdir as Ec,readlink as Gae,realpath as Dc,rename as Kae,rm as qae,stat as Oc,writeFile as kc}from"node:fs/promises";import{Readable as Ac,Transform as Jae,Writable as Yae}from"node:stream";import{join as jc,resolve as Xae}from"path";import Zae from"crypto";import{Readable as Mc}from"stream";import*as Qae from"zlib";import{monitorEventLoopDelay as $ae,performance as eoe}from"node:perf_hooks";import toe,{createHash as Nc,randomUUID as Pc,webcrypto as Fc}from"node:crypto";import{createBrotliDecompress as noe,createGunzip as roe,createInflate as ioe}from"node:zlib";import{AsyncLocalStorage as aoe}from"node:async_hooks";import{pipeline as Ic}from"node:stream/promises";import{execFile as Lc,execFileSync as Rc,spawn as zc,spawnSync as Bc}from"node:child_process";import{setImmediate as ooe,setTimeout as Vc}from"node:timers/promises";import{promisify as Hc,stripVTControlCharacters as soe}from"node:util";import{createInterface as coe}from"node:readline";import{lookup as loe}from"node:dns";import{request as uoe}from"node:http";import*as doe from"node:querystring";import foe from"node:tls";import{DatabaseSync as Uc}from"node:sqlite";import{Http2ServerRequest as Wc,constants as poe}from"node:http2";import{lookup as moe}from"node:dns/promises";import{request as hoe}from"node:https";import{Http2ServerRequest as Gc,constants as goe}from"http2";const _oe=2,Kc={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`},voe={desktop:!0,browser:!0,"embedded:cursor":!0,"embedded:codex":!0,"embedded:claude-desktop":!0},yoe={mcp:!0,"desktop-main":!0,cli:!0};function boe(e){return Object.hasOwn(voe,e)}function xoe(e){if(!(e===void 0||e.length===0||Object.hasOwn(yoe,e)))return boe(e)?e:`unknown`}function Soe({kind:e,runtimeVersion:t}){return{[Kc.protocol]:`2`,[Kc.runtime]:t,[Kc.kind]:e}}const Coe=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),woe=/^={2,}/,Toe=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/;function Eoe(e,t){return Toe.test(e.slice(t,t+512))}function Doe(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>512?!1:Toe.exec(e.slice(n,t+1))?.[0].length===t+1-n}const Ooe=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,koe=/^!(?=\[)/,Aoe=/^\[\^/,joe=/^\]\[[^\]]*\]/,Moe=/^\[\[[^\][|]*\|/,Noe=/^#[^\][|]*(?=\]\])/,Poe=/^\]\([^)]*\)/,Foe=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,Ioe=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,Loe=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/;function Roe(e,t){let n=e.indexOf(`
2
2
  `,t),r=n===-1?e.length:n;if(r>t&&e[r-1]===`\r`&&--r,r-t>1024)return 0;let i=e.slice(t,r);return i.length===0||!Ioe.test(i)&&!Loe.test(i)?0:i.length}const zoe=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/y;function qc(e,t){if(e[t]!==`&`)return null;let n=t,r=``;for(;;){zoe.lastIndex=n;let t=zoe.exec(e)?.[0];if(t===void 0)break;let i=rre(t);if(i===null)break;r+=i,n+=t.length}return n===t?null:{length:n-t,rendered:r}}function Jc(e){return e===` `||e===` `||e===`
3
3
  `||e===`\r`||e===`\f`||e===`\v`}function Boe(e,t){for(let n=t-1;n>=0;--n){let t=e[n];if(t===`
4
4
  `)return!0;if(t!==` `&&t!==` `)return!1}return!0}function Yc(e,t){let n=e[t];if(n===void 0)return 0;if(Boe(e,t)){let n=Roe(e,t);if(n>0)return n}if(n===`|`)return 1;if(n===`<`){let n=Ooe.exec(e.slice(t,t+512))?.[0].length;return n===void 0?+!!Eoe(e,t):n}if(n===`>`&&Doe(e,t))return 1;if(n===`=`){let n=woe.exec(e.slice(t,t+3))?.[0].length;if(n!==void 0)return n}if(n===`!`)return+!!koe.test(e.slice(t,t+2));if(Coe.has(n))return 1;if(n===`[`){let n=e.slice(t,t+512),r=Moe.exec(n)?.[0].length;return r===void 0?Aoe.test(n)?2:1:r}if(n===`#`){let n=Noe.exec(e.slice(t,t+512))?.[0].length;if(n!==void 0)return n}if(n===`]`){if(e[t+1]===`]`)return 2;let n=e.slice(t,t+512),r=Poe.exec(n)?.[0].length;if(r!==void 0)return r;let i=joe.exec(n)?.[0].length;return i===void 0?1:i}return Boe(e,t)?Foe.exec(e.slice(t,t+32))?.[0].length??0:0}function Voe(e,t,{syntaxIn:n}){let r=[];if(t.length===0)return r;let i=n===`haystack`;for(let n=0;n<e.length;n+=1){let a=e[n];if(a===void 0||Jc(a)||i&&a!==t[0]&&(Yc(e,n)>0||qc(e,n)!==null))continue;let o=n,s=0;for(;o<e.length&&s<t.length;){let n=e[o],r=t[s];if(n===r){o+=1,s+=1;continue}if(Jc(r)){s+=1;continue}if(Jc(n)){o+=1;continue}let a=i?Yc(e,o):Yc(t,s);if(a>0){i?o+=a:s+=a;continue}let c=i?qc(e,o):qc(t,s);if(c!==null){let n=i?t:e,r=i?s:o,a=!0;for(let e of c.rendered)if(!Jc(e)){for(;r<n.length&&Jc(n[r]);)r+=1;if(n[r]!==e){a=!1;break}r+=1}if(!a)break;i?(o+=c.length,s=r):(s+=c.length,o=r);continue}break}for(;s<t.length&&Jc(t[s]);)s+=1;s===t.length&&r.push({start:n,end:o})}return r}function Xc(e,t,n,r){let i=``,a=Math.max(0,t),o=Math.min(e.length,n);for(;a<o;){let t=e[a];if(Jc(t)){a+=1;continue}if(r){let t=Yc(e,a);if(t>0){a+=t;continue}let n=qc(e,a);if(n!==null){for(let e of n.rendered)Jc(e)||(i+=e);a+=n.length;continue}}i+=t,a+=1}return i}function Hoe(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function Uoe(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}function Woe(e,t,n,{syntaxIn:r,syntaxInContext:i=!1}){let a=n.prefix??``,o=n.suffix??``,s=r===`haystack`,c=0;if(a.length>0){let n=a.length*8+64;c+=Hoe(Xc(a,0,a.length,i),Xc(e,t.start-n,t.start,s))}if(o.length>0){let n=o.length*8+64;c+=Uoe(Xc(o,0,o.length,i),Xc(e,t.end,t.end+n,s))}return c}function Goe(e,{syntaxInContext:t=!1}={}){let n=Xc(e.prefix??``,0,1/0,t).length+Xc(e.suffix??``,0,1/0,t).length;return Math.min(8,n)}function Koe(e){return Math.max(e*4,e+64)}function Zc(e,t){let n=e.length,r=t.length,i=0;for(;i<n&&i<r&&e[i]===t[i];)i++;let a=n,o=r;for(;a>i&&o>i&&e[a-1]===t[o-1];)a--,o--;return o<=i?null:{from:i,to:o}}const Qc=`epoch`,qoe=524288,$c={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},el=[`incoming`,`outgoing`,`both`];function Joe(e){return el.includes(e)}Oo();const tl=`last-spawn-error.log`,nl={logsCurrent:`server-current.jsonl`,logsPrevious:`server-prev.jsonl`,spansCurrent:`spans-current.jsonl`,spansPrevious:`spans-prev.jsonl`,spawnError:tl},Yoe=`=== spawn attempt `,Xoe=`acp-launch-failures.log`;function Zoe(e){return e===void 0?`a`:e>=262144?`w`:`a`}function Qoe(e,t){return`\n${Yoe}${e.toISOString()} pid=${t} ===\n`}function $oe(e){let t=e.lastIndexOf(Yoe);if(t===-1)return e;let n=e.indexOf(`
@@ -1156,7 +1156,7 @@ ${uet(e).join(`
1156
1156
  `:``)+i)}const lot=2e3,uot=new class{writes=new WeakMap;record(e,t,n){let r=this.writes.get(e)??new Map;for(let[e,t]of r)dot(t,n)||r.delete(e);r.set(t,n),this.writes.set(e,r)}hasRecentPeer(e,t,n){let r=this.writes.get(e);if(r===void 0)return!1;for(let[e,i]of r){let a=n-i;if(Math.abs(a)>=2e3){r.delete(e);continue}if(e!==t)return!0}return!1}};function dot(e,t){return e!==void 0&&Math.abs(t-e)<lot}function fot(e,t,n,r){if(t!==`replace`)return;let i=uot.hasRecentPeer(e,n,r),a=dot(Zat(e),r);if(!(!i&&!a))throw new JK(fQ(e.name))}function mQ(e){return e.bridgeLossReporter?{reporter:e.bridgeLossReporter,writerId:e.agentId}:void 0}function hQ(e,t,n){let r=Yat(e);r&&vQ(e.getText(`source`).toString(),t,n)!==void 0&&r.preDrain({kind:`agent-write`,writeKind:n})}function gQ(e,t,n,r,i,a,o){if(fZ(e))throw new WJ({file:fQ(e.name)});return vU(`agent.applyAgentMarkdownWrite`,{attributes:{"doc.name":e.name,"agent.write_position":n,"agent.markdown.bytes":t.length}},()=>{let s=pot(e,t,n,r,i,a,o);return s!==void 0&&yU({"agent.content_divergent":!0,"agent.intended_bytes":s.intendedBytes,"agent.actual_bytes":s.actualBytes,"agent.byte_delta":s.byteDelta,"agent.divergence_type":s.divergenceType}),s})}function _Q(e){return e.getXmlFragment(`default`).toArray().map(e=>e.toString())}function vQ(e,t,n){let{frontmatter:r,body:i}=an(e),{frontmatter:a,body:o}=n===`append`||n===`prepend`?Dq(t):an(t);if((n===`append`||n===`prepend`)&&o===``)return;let s,c;switch(n){case`replace`:s=a||r,c=o;break;case`patch`:s=a||r,c=o;break;case`prepend`:s=r,c=i.length>0?`${o.replace(/\n+$/,``)}\n\n${i.replace(/^\n+/,``)}`:o;break;case`append`:s=r,c=i.length>0?`${i.replace(/\n+$/,``)}\n\n${o.replace(/^\n+/,``)}`:o}return{existingFm:r,finalFm:s,newContent:Fa(s,c)}}function pot(e,t,n,r,i,a,o){try{let s=e.getText(`source`).toString(),c=vQ(s,t,n);if(c===void 0)return;let{existingFm:l,finalFm:u,newContent:d}=c,f=a&&LJ(sot.context.origin)?{report:t=>a.reporter(e.name,t,a.writerId,`agent-write-intake`),baselineFullMd:s}:void 0,p=!1;if(u!==l){let t=Ci(Ni(u));if(t.map===null)throw new hZ({file:fQ(e.name),parseError:t.parseError??`unknown YAML parse error`});p=!0}else if(u===``&&an(d).frontmatter!==``)throw new hZ({file:fQ(e.name),parseError:"the payload's leading `---` fence pair would land at byte 0, where the composed document re-reads it as the frontmatter region instead of body",refusalClass:`byte-0-promotion`,hint:"Start the payload with a blank line so the fence pair cannot open the document, or use `***` / `___` for the thematic break."});fot(e,n,o,Date.now()),p&&_Z(`mcp-write`),n===`replace`?jq(e,d,r,i,f):Aq(e,d,`agent`,r,i,f);let m=e.getText(`source`).toString();o!==void 0&&m!==s&&uot.record(e,o,Date.now());let h=bit(m,d,n);return dQ.debug({docName:e.name,position:n,markdownBytes:t.length,divergent:h!==void 0},`[agent-write] applied agent markdown write`),h}catch(r){throw!(r instanceof hZ)&&!(r instanceof JK)&&dQ.error({err:r,docName:e.name,position:n,markdownLen:t.length},`[applyAgentMarkdownWrite] failed for '${e.name}'`),r}}function mot(e,t,n,r){let i=e.dc.document;if(fZ(i))throw new WJ({file:fQ(i.name)});return vU(`agent.applyAgentUndo`,{attributes:{"doc.name":e.dc.document.name,"agent.undo_scope":t}},()=>{let i=hot(e,t,n,r);return yU({"agent.undo_effective":i}),i})}function hot(e,t,n,r){let{dc:i,um:a,undoOrigin:o}=e,s=i.document,c=t===`last`?1:t===`count`?Math.min(Math.max(0,r??0),a.undoStack.length):a.undoStack.length;c===1&&a.undoStack.length>0&&Yat(s)?.preDrain({kind:`agent-undo`,stackItem:a.undoStack[a.undoStack.length-1]});let l=!1,u=e.bridgeLossReporter,d=u&&LJ(o.context.origin)?{report:t=>u(e.docName,t,e.agentId),baselineFullMd:s.getText(`source`).toString()}:void 0;return s.transact(()=>{for(let e=0;e<c&&a.undoStack.length>0;e++)a.undo(),l=!0;l&&q7e(s,n,d)},o),dQ.debug({docName:e.docName,agentId:e.agentId,scope:t,framesToPop:c,undone:l},`[agent-session] applied agent undo`),l}function got(e,t,n,r,i){let a={origin:`agent-write`,paired:!0,session_id:e};t!==void 0&&(a.agent_type=t),n!==void 0&&(a.principal=n),r!==void 0&&(a.display_name=r),i!==void 0&&(a.color_seed=i),Object.freeze(a);let o={source:`local`,skipStoreHooks:!1,context:a};return Object.freeze(o),o}function _ot(e,t){let n={origin:`agent-undo`,paired:!0,session_id:e};t!==void 0&&(n.agent_type=t),Object.freeze(n);let r={source:`local`,skipStoreHooks:!1,context:n};return Object.freeze(r),r}const vot=256,yot=5e3;var yQ=class extends Error{limit;constructor(e){super(`Maximum agent session count reached (${e})`),this.name=`AgentSessionCapacityError`,this.limit=e}};let bot=null;function xot(){return bot||=gU().createCounter(`ok.sessions.evictions_total`,{description:`Agent sessions evicted (LRU-idle) under capacity pressure to admit a new session. Sustained growth alongside ok.sessions.active pinned at ok.sessions.limit means the working set exceeds the cap.`,unit:`{sessions}`}),bot}var Sot=class{sessions=new Map;pendingSessions=new Map;activeOperations=new Map;hocuspocus;maxSessions;minEvictableIdleMs;bridgeLossReporter;assertDocumentScope;awaitWriteAdmission;evictions=0;constructor(e,t={}){this.hocuspocus=e,this.maxSessions=t.maxSessions??256,this.minEvictableIdleMs=t.minEvictableIdleMs??5e3,this.bridgeLossReporter=t.bridgeLossReporter,this.assertDocumentScope=t.assertDocumentScope,this.awaitWriteAdmission=t.awaitWriteAdmission}attachBridgeLossReporter(e){this.bridgeLossReporter=e}get liveSessionCount(){return this.sessions.size}get sessionLimit(){return this.maxSessions}get evictionCount(){return this.evictions}touchSession(e,t){t.lastUsedAt=Date.now(),this.sessions.delete(e),this.sessions.set(e,t)}sessionKey(e,t){return`${e}\0${t}`}*sessionsForConnection(e){let t=`\0${e}`;for(let[e,n]of this.sessions)e.endsWith(t)&&(yield n)}getLiveSession(e,t){this.assertDocumentScope?.(e);let n=this.sessionKey(e,t),r=this.sessions.get(n);return r&&this.touchSession(n,r),r}async withSessions(e){let t=[],n=async(e,n=pH,r)=>{let i=this.sessionKey(e,n),a=this.activeOperations.get(i)??{count:0};a.count+=1,this.activeOperations.set(i,a);let o=()=>{--a.count,a.count===0&&this.activeOperations.delete(i)};try{let i=await this.getSession(e,n,r);return t.push(o),i}catch(e){throw o(),e}};try{return await e(n)}finally{for(let e of t)e()}}async getSession(e,t=pH,n){if($H(e)||eU(e))throw Error(`Cannot create agent session for reserved doc: ${e}`);if(this.assertDocumentScope?.(e),this.awaitWriteAdmission){let t=Date.now();await this.awaitWriteAdmission()||dQ.warn({docName:e,waitedMs:Date.now()-t},`[agent-session] git batch still in progress after the admission wait; admitting the write`)}let r=this.sessionKey(e,t),i=this.sessions.get(r);if(i)return this.touchSession(r,i),i;let a=this.pendingSessions.get(r);if(a)return dQ.debug({docName:e,agentId:t},`[agent-session] joining in-flight session creation`),a;for(;this.sessions.size+this.pendingSessions.size>=this.maxSessions;)if(await this.evictLruIdleSession()===null)throw dQ.warn({docName:e,agentId:t,limit:this.maxSessions},`[agent-session] session capacity reached, refusing new session`),new yQ(this.maxSessions);let o=this._createSession(e,t,n);this.pendingSessions.set(r,o);try{let e=await o;return this.sessions.set(r,e),e}finally{this.pendingSessions.delete(r)}}async _createSession(e,t,n){let r=n?.clientName,i=t.startsWith(`agent-`)?t.slice(6):t,a=got(i,r,n?.principalId,n?.displayName,n?.colorSeed),o=_ot(i,r),s={session_id:i,...r===void 0?{}:{agent_type:r},...n?.clientName===void 0?{}:{client_name:n.clientName},...n?.principalId===void 0?{}:{principalId:n.principalId}},c=await this.hocuspocus.openDirectConnection(e,s);dQ.debug({docName:e,agentId:t,sessionId:i,agentType:r},`[agent-session] DirectConnection opened`);let l=new $ke([c.document.getText(`source`),c.document.getMap(`agent-flash`)],{trackedOrigins:new Set([a]),captureTimeout:500,captureTransaction:e=>e.origin!==o,ignoreRemoteMapChanges:!0}),u=({stackItem:e})=>{e.meta.set(`time`,Date.now())};return l.on(`stack-item-added`,u),l.on(`stack-item-updated`,u),dQ.info({docName:e,agentId:t,sessionId:i},`[agent-session] Created session for: ${e} / ${t}`),{dc:c,origin:a,undoOrigin:o,um:l,agentId:t,docName:e,lastUsedAt:Date.now(),bridgeLossReporter:this.bridgeLossReporter}}async evictLruIdleSession(){for(let[e,t]of this.sessions){if(this.activeOperations.has(e))continue;let n=Date.now()-t.lastUsedAt;return n<this.minEvictableIdleMs?null:(this.sessions.delete(e),await this.cleanupSession(e,t,{docName:t.docName,agentId:t.agentId,evicted:!0}),this.evictions++,b$e(),xot().add(1),dQ.info({docName:t.docName,agentId:t.agentId,idleMs:n},`[agent-session] Evicted LRU idle session under capacity pressure`),e)}return null}hasSession(e,t=pH){return this.sessions.has(this.sessionKey(e,t))}async cleanupSession(e,t,n){dQ.debug({docName:t.docName,agentId:t.agentId,...n},`[agent-session] closing session`);try{try{t.um.destroy()}catch(e){dQ.error({err:e,...n},`[agent-session] um.destroy() failed`)}try{await t.dc.disconnect()}catch(e){dQ.error({err:e,...n},`[agent-session] dc.disconnect() failed`)}}finally{this.sessions.delete(e)}}async closeSession(e,t=pH){let n=this.sessionKey(e,t),r=this.sessions.get(n);r&&(await this.cleanupSession(n,r,{docName:e,agentId:t}),dQ.info({docName:e,agentId:t},`[agent-session] Closed session for: ${e} / ${t}`))}async closeAllForAgent(e){let t=`\0${e}`,n=[...this.pendingSessions.keys()].filter(e=>e.endsWith(t));n.length>0&&await Promise.allSettled(n.map(e=>this.pendingSessions.get(e)));let r=[...this.sessions.keys()].filter(e=>e.endsWith(t));dQ.debug({agentId:e,pendingSettled:n.length,closing:r.length},`[agent-session] closing all sessions for agent`);for(let t of r){let n=this.sessions.get(t);n&&await this.cleanupSession(t,n,{agentId:e,key:t})}}async closeAllForDoc(e){let t=`${e}\0`,n=[...this.sessions.keys()].filter(e=>e.startsWith(t));dQ.debug({docName:e,closing:n.length},`[agent-session] closing all sessions for doc`);for(let t of n){let n=this.sessions.get(t);n&&await this.cleanupSession(t,n,{docName:e,key:t})}}async closeAll(e){if(e){await this.closeAllForDoc(e);return}let t=[...this.sessions.keys()];dQ.debug({closing:t.length},`[agent-session] closing all sessions`);for(let e of t){let t=this.sessions.get(e);t&&await this.cleanupSession(e,t,{key:e})}}};const Cot=Hc(Dae);function bQ(e){return U(Rs(e),Iee)}async function xQ(e,t){let n=bQ(e);await AU(H(n),{recursive:!0});try{return await yl(`${n}.lock`,t)}catch(e){if(e.code===`LOCK_TIMEOUT`)return t();throw e}}const wot={warn:(e,t)=>J(`skills`).warn(e,t)};async function SQ(e,t=wot){let n=bQ(e),r;try{r=await Cot(n,`utf-8`)}catch(e){if(e.code===`ENOENT`)return null;throw e}let i=(0,rl.parseDocument)(r);if(i.errors.length>0)return t.warn({event:`skill-state.yaml-parse-error`,path:n,errors:i.errors.map(e=>e.message)},`skill-state.yml parse failed; treating as fresh install`),null;let a=Ui.safeParse(i.toJSON());if(!a.success){let e=a.error.issues.find(e=>e.path.length===1&&e.path[0]===`schema`);return e?t.warn({event:`skill-state.invalid-schema-version`,path:n,issue:e.message},`skill-state.yml has unknown schema version; treating as fresh install`):t.warn({event:`skill-state.schema-violation`,path:n,issues:a.error.issues.map(e=>({path:e.path,message:e.message}))},`skill-state.yml failed schema validation; treating as fresh install`),null}return a.data}async function CQ(e,t){let n=Ui.safeParse(t);if(!n.success)throw Error(`Refusing to write invalid skill-state: ${n.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`; `)}`);let r=bQ(e);await AU(H(r),{recursive:!0});let i=(0,rl.parseDocument)(``);i.contents=i.createNode(n.data);let a=i.toString();await Is(r,a,{fs:UU})}async function wQ(e,t,n){let r=await SQ(e,n);return r===null?null:r.targets[t]?.version??null}async function Tot(e,t,n){let r=await SQ(e,n);return r===null?null:r.targets[t]?.recordedAt??null}async function TQ(e,t,n,r,i){if(!xie.test(n))throw Error(`Refusing to write invalid version string: ${n}`);await xQ(e,async()=>{let a=await SQ(e,i)??da(),o=new Date().toISOString(),s=a.targets[t],c=r===void 0?s?.surface??void 0:r,l=c===void 0?{version:n,recordedAt:o}:{version:n,recordedAt:o,surface:c};await CQ(e,{...a,targets:{...a.targets,[t]:l}})})}async function Eot(e,t,n){let r=(await SQ(e,n))?.bundles?.[t];return typeof r?.enabled==`boolean`?r.enabled:null}async function Dot(e,t,n,r){await xQ(e,async()=>{let i=await SQ(e,r)??da();await CQ(e,{...i,bundles:{...i.bundles,[t]:{enabled:n,decidedAt:new Date().toISOString()}}})})}async function Oot(e,t){let n=await SQ(e,t).catch(()=>null);return new Set(n?.installsReported??[])}async function kot(e,t,n){t.length!==0&&await xQ(e,async()=>{let r=await SQ(e,n)??da(),i=new Set([...r.installsReported??[],...t]);await CQ(e,{...r,installsReported:[...i].sort()})})}async function Aot(e,t,n){t.length!==0&&await xQ(e,async()=>{let r=await SQ(e,n);if(!r?.installsReported?.length)return;let i=new Set(t),a=r.installsReported.filter(e=>!i.has(e));a.length!==r.installsReported.length&&await CQ(e,{...r,installsReported:a})})}async function EQ(){let e=new URL(`../package.json`,import.meta.url),t=await Cot(Bs(e),`utf-8`),n=JSON.parse(t);if(typeof n.version!=`string`||n.version.length===0)throw Error(`@inkeep/open-knowledge-server/package.json missing version field`);return n.version}async function jot(e,t){let[n,r]=await Promise.all([EQ(),Mot(e,t)]);return{currentVersion:n,targets:r}}async function Mot(e,t=wot){let n=null;try{n=await SQ(e,t)}catch(r){t.warn({event:`skill-state.read-error`,path:bQ(e),err:r},`non-ENOENT error reading skill-state.yml; treating as absent`),n=null}let r=eie.map(e=>{let t=n?.targets[e];return t?[e,{version:t.version,recordedAt:t.recordedAt}]:[e,null]});return Object.fromEntries(r)}const Not=J(`agent-registry-apply`);function Pot(e){return{probes:Ore(e),detection:ne}}const Fot=()=>({action:`skipped-unsupported`,errorId:`no-writer`});async function Iot(e,t){try{return await e()}catch(e){return Not.warn({err:e},`host snapshot failed; claiming nothing`),Pot(t)}}async function Lot(e,t){let n=await Iot(t.snapshot,t.env),r=Bre({probes:n.probes,detection:n.detection}),i=Kee(e.map(e=>({satisfierId:e?.satisfierId,desired:e?.desired})),r),a=await sne(i,t.execute??Fot),{decisionHome:o}=t,s=Rot(a),c=s===`installed`?!0:s===`removed`&&t.userSkillPresentAnywhere!==void 0&&!t.userSkillPresentAnywhere(o)?!1:null;return c!==null&&await Dot(o,hH.discovery,c).catch(e=>{Not.warn({err:e},`user-skill decision not recorded`)}),{report:a,snapshot:await Iot(t.snapshot,t.env)}}function Rot(e){let t=e.actions.filter(e=>e.piece===`skill`&&e.scope===`user`);return t.some(e=>e.action===`written`||e.action===`overwritten`)?`installed`:t.some(e=>e.action===`removed`)?`removed`:null}const zot=RegExp(`[\\r\\n\\v\\f\\u0085\\u2028\\u2029]`,`g`);function DQ(e){if(e===void 0)return{kind:`absent`};if(typeof e!=`string`)return{kind:`invalid`};if(e.length===0||e.trim().length===0)return{kind:`absent`};let t=e.replace(zot,` `);return t.length<=80?{kind:`value`,value:t}:{kind:`value`,value:t.slice(0,79)+`…`,truncatedFrom:e.length}}function OQ(e,t){let n=DQ(e.summary);if(n.kind===`invalid`)return{kind:`invalid-summary`};let r=kQe(e),i=t?.()??null;return r.rawAgentId!==void 0&&r.suppliedWriterId!==void 0?{kind:`agent`,writerId:r.suppliedWriterId,displayName:r.displayName,colorSeed:r.colorSeed??r.rawAgentId,clientName:r.clientName,clientVersion:r.clientVersion,label:r.label,actor:{principalId:i?.id,agentType:fH(r.clientName),clientName:r.clientName,clientVersion:r.clientVersion,label:r.label},summary:n}:i?{kind:`principal`,writerId:i.id,displayName:i.display_name,colorSeed:i.id,actor:{principalId:i.id},summary:n}:{kind:`anonymous`,summary:n}}const Bot=new Set([`GET`,`HEAD`,`OPTIONS`]);function Vot(e){return Bot.has(e??`GET`)}function Hot(e){return e===`null`||e.toLowerCase().startsWith(`file:`)}function Uot(e){if(e===`file://`)return!0;try{let{hostname:t}=new URL(e);return t===`localhost`||t===`::1`||t===`[::1]`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}catch{return!1}}function kQ(e){return e?!!(e===`::1`||e.startsWith(`::ffff:127.`)||e.startsWith(`127.`)):!1}function Wot(e){if(!e)return!1;if(e.startsWith(`[`)){let t=e.indexOf(`]`);if(t<0)return!1;let n=e.slice(1,t),r=e.slice(t+1);return r!==``&&!/^:\d+$/.test(r)?!1:n===`::1`}let t=e.lastIndexOf(`:`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):null;return r!==null&&!/^\d+$/.test(r)?!1:!!(n===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))}function AQ(e){return e.replace(/:(443|80)$/,``).toLowerCase()}function Got(e,t){return e!==void 0&&AQ(e)===t}const Kot=[`x-forwarded-for`,`x-forwarded-proto`,`x-forwarded-host`,`forwarded`,`x-real-ip`,`x-client-ip`,`x-cluster-client-ip`,`cf-connecting-ip`,`fastly-client-ip`,`true-client-ip`];function jQ(e){return Kot.some(t=>e.headers[t]!==void 0)}const MQ=`Add this host to server.bind or set server.externalUrl to it, then restart. Loopback (localhost/127.0.0.1/[::1]) is always admitted.`;var qot=class extends Error{};const Jot=new Set([`0.0.0.0`,`::`,`localhost`,`::1`,`[::1]`]);function Yot(e){let t=e.trim().toLowerCase();return t.startsWith(`[`)&&t.endsWith(`]`)?t.slice(1,-1):t}function NQ(e){let t=e.serverRuntime,n=t===void 0?[]:t.bind.map(Yot).filter(e=>!Jot.has(e)&&!e.startsWith(`127.`)),r;if(t?.externalUrl!==void 0){let e=new URL(t.externalUrl);r={host:AQ(e.host),protocol:e.protocol}}let i=t?.allowExternal===!0;return{allowExternal:i,bindLiterals:n,externalOrigin:r,tolerateForwardedHeaders:i&&r!==void 0}}function PQ(e,t){return kQ(e)?!0:t.allowExternal&&e!==void 0}function Xot(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);return t<0?null:e.slice(1,t).toLowerCase()}let t=e.lastIndexOf(`:`);return(t>=0?e.slice(0,t):e).toLowerCase()}function FQ(e,t){if(Wot(e))return!0;if(e===void 0)return!1;if(t.bindLiterals.length>0){let n=Xot(e);if(n!==null&&t.bindLiterals.includes(n))return!0}return t.externalOrigin!==void 0&&Got(e,t.externalOrigin.host)}function IQ(e,t){if(Uot(e))return!0;let n;try{n=new URL(e)}catch{return!1}if(n.protocol!==`http:`&&n.protocol!==`https:`)return!1;if(t.externalOrigin!==void 0&&n.protocol===t.externalOrigin.protocol&&AQ(n.host)===t.externalOrigin.host)return!0;if(t.bindLiterals.length>0){let e=Yot(n.hostname);if(t.bindLiterals.includes(e))return!0}return!1}function Zot(e,t,n){if(e===void 0)return{admitted:!0,corsGrant:!0};let r=Hot(e);return!IQ(e,n)||r&&!Vot(t)?{admitted:!1,detail:r?`Requests from a null origin, and writes from a file: origin, are refused. Send the request from a loopback page, the OpenKnowledge app, or a client that sends no Origin header.`:void 0}:{admitted:!0,corsGrant:!r}}function LQ(e,t){return!t.tolerateForwardedHeaders&&jQ(e)}let Qot=!1;function RQ(e,t){Qot||(Qot=!0,e.warn({handler:t},`[ingress] refused a request carrying a forwarding header (X-Forwarded-For etc.) — without external-exposure consent, every surface except the /healthz + /readyz probes refuses proxied requests (APIs 403, /collab upgrades dropped). To front this server with a proxy, set server.externalUrl to the public origin in .ok/config.yml (or OK_EXTERNAL_URL) AND consent with server.allowExternal: true in .ok/local/config.yml (or OK_ALLOW_EXTERNAL=1) — the keys live in different files because consent is per-machine and never travels. allowExternal consents to exposure on a server with NO authentication — restrict access at the edge. Removing server.externalUrl does not lift this refusal (it fires on the header, not the URL) and would un-admit that Host/Origin everywhere else. Warned once per process; every refusal is still logged at warn level (HTTP refusals additionally as api.error, counted in ok.api.error.count).`))}const $ot=new WeakMap;function est(e,t){let n=e.socket?.remoteAddress,r={requestId:t.requestId,peerClass:n===void 0?`unknown`:kQ(n)?`loopback`:`external`,clientSurface:t.clientSurface,actor:void 0};return $ot.set(e,r),r}function tst(e){return $ot.get(e)}const zQ=J(`local-op-security`),nst=GD,rst=[/^file:\/\//i,/^javascript:/i,/^ext::/i,/^data:/i,/^vbscript:/i];function BQ(e){return!e||typeof e!=`string`||rst.some(t=>t.test(e))?!1:nst.some(t=>t.test(e))}function VQ(e){return e===`~`?vc():e.startsWith(`~/`)?U(vc(),e.slice(2)):e}function ist(e,t){let n=H(e);for(;n!==t&&n!==H(n);){let e;try{e=rc(n)}catch(e){let t=JW(e);return zQ.warn({path:n,code:t??`unknown`},`ancestorChainHasSymlink: lstat failed on ${n} (${t??`unknown`}); treating as symlink (fail-closed)`),!0}if(e.isSymbolicLink())return zQ.warn({path:n},`ancestorChainHasSymlink: symlink detected at ${n}`),!0;n=H(n)}return!1}function ast(e,t){if(!e||typeof e!=`string`||e.includes(`\0`))return!1;let n;try{n=lc(t)}catch(e){let n=JW(e);return zQ.warn({path:t,code:n??`unknown`},`realpath failed on home dir ${t} (${n??`unknown`}); rejecting all paths`),!1}let r=G(VQ(e)),i=[],a=r;for(;;){let e=null;try{e=rc(a)}catch(e){let t=JW(e);if(t!==`ENOENT`)return zQ.warn({path:a,code:t??`unknown`},`lstat error at ${a} (${t??`unknown`}); rejecting`),!1}if(e!==null){let r;try{r=lc(a)}catch(n){let i=JW(n);if(e.isSymbolicLink())return zQ.warn({path:a,code:i??`unknown`},`realpath failed on symlink leaf at ${a} (${i??`unknown`}); rejecting`),!1;if(i===`EPERM`||i===`EACCES`){if(ist(a,t))return zQ.warn({path:a},`EPERM accept-branch refused at ${a}: symlinked ancestor in chain; rejecting`),!1;zQ.warn({path:a,code:i??`unknown`},`realpath denied on non-symlink leaf at ${a} (${i??`unknown`}); trusting lexical path (TCC-class)`),r=a}else return zQ.warn({path:a,code:i??`unknown`},`realpath failed on non-symlink leaf at ${a} (${i??`unknown`}); rejecting`),!1}let o=i.length===0?r:U(r,...i),s=W(n,o);return s===``||!s.startsWith(`..`)&&!Ks(s)}let r=H(a);if(r===a)return!1;i.unshift(Us(a)),a=r}}function HQ(e){return ast(e,vc())}function ost(e){let t=e.socket.remoteAddress;return t===`127.0.0.1`||t===`::1`||t===`::ffff:127.0.0.1`}function sst(e,t){let n=e.headers.origin;if(!n)return!0;try{let e=new URL(n),{hostname:r}=e;if(r===`127.0.0.1`||r===`localhost`||r===`[::1]`||r===`::1`)return!0;if(t===void 0)return!1;if(t.externalOrigin!==void 0&&e.protocol===t.externalOrigin.protocol&&cst(e.host)===t.externalOrigin.host)return!0;if(e.protocol!==`http:`&&e.protocol!==`https:`)return!1;let i=r.startsWith(`[`)?r.slice(1,-1):r;return t.bindLiterals.includes(i.toLowerCase())}catch{return!1}}function cst(e){return e.replace(/:(443|80)$/,``).toLowerCase()}function lst(e,t,n){let r=n.policy??NQ({});return!ost(e)&&!PQ(e.socket.remoteAddress,r)?(Z(t,403,`urn:ok:error:loopback-required`,`Local-op endpoints require a loopback connection.`,{handler:n.handler}),!1):sst(e,r)?!0:(Z(t,403,`urn:ok:error:invalid-origin`,`Origin header is not a permitted loopback origin.`,{handler:n.handler}),!1)}function ust(){let e=new Set;return{tryAcquire(t){return!e.has(t)&&(e.add(t),!0)},release(t){e.delete(t)}}}const dst=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);function fst(e){dst.push(e)}const pst=$c.cursor,mst=$c.codex,hst=$c[`claude-desktop`],gst={app:null,signals_fired:[]};function _st(e){if(!e)return{...gst};let t=[],n=e.ua,r=e.referer,i=!!n&&pst.test(n),a=!!r&&r.includes(`?strategy=C_iframe`);if(i&&t.push(`cursor_ua_regex`),a&&t.push(`cursor_referer_strategy_iframe`),i||a)return{app:`cursor`,signals_fired:t};let o=!!n&&mst.test(n);if(o&&t.push(`codex_ua_regex`),o)return{app:`codex`,signals_fired:t};let s=!!n&&hst.test(n);return s&&t.push(`claude_ua_regex`),s?{app:`claude`,signals_fired:t}:{...gst}}const vst=new Set([`/api/agent-write`,`/api/agent-write-md`,`/api/agent-patch`,`/api/agent-undo`,`/api/agent-write-batch`,`/api/comments`,`/api/comment`,`/api/client-logs`,`/api/frontmatter-patch`,`/api/save-version`,`/api/rollback`,`/api/lint/fix`,`/api/folder-config`,`/api/template`,`/api/agent-integrations/apply`]);function UQ(e,t={}){let{dynamic:n}=t,r=new Set(t.mutating??[]),i=t.mutatingPrefixes??[],a=Object.keys(e);if(n!==void 0&&!n.prefix.endsWith(`/`))throw Error(`dynamic.prefix '${n.prefix}' must end in '/' — a bare prefix mounts a wildcard that also swallows unrelated siblings ('/api/local-op' matches '/api/local-op-status')`);for(let e of i){if(!e.endsWith(`/`))throw Error(`mutatingPrefixes entry '${e}' must end in '/' — a bare prefix also matches unrelated siblings ('/api/local-op' matches '/api/local-op-status')`);if(e!==n?.prefix&&!a.some(t=>t.startsWith(e)))throw Error(`mutatingPrefixes entry '${e}' covers no registered route and is not the dynamic leg's prefix — a typo here leaves its family on the read posture`)}let o=new Map(Object.entries(e)),s={resolve(e){let t=o.get(e);return t?{template:e,dispatch:(e,n)=>t(e,n)}:n!==void 0&&e.startsWith(n.prefix)?{template:n.template,dispatch:n.dispatch(e.slice(n.prefix.length))}:null},isMutating:e=>r.has(e)||i.some(t=>e.startsWith(t))};return{paths:n===void 0?a:[...a.filter(e=>!e.startsWith(n.prefix)),`${n.prefix}*`],table:s}}let WQ=null;pU(()=>{WQ=null});function yst(){return WQ||=gU().createHistogram(`http.server.request.duration`,{description:`HTTP server request duration in seconds`,unit:`s`}),WQ}function bst(e){let{log:t,ephemeral:n,table:r}=e,i=e.policy??NQ({}),a=e=>FQ(e,i);return async(o,s)=>{let c=o.url?.split(`?`)[0];if(!c)return!1;let l=r.resolve(c);if(!l)return!1;let u=e=>{let t=o.headers[e];if(t!==void 0)return Array.isArray(t)?t.join(`, `):t};fst({ts:Date.now(),url:c,method:o.method??``,ua:u(`user-agent`),origin:u(`origin`),referer:u(`referer`),host:u(`host`),remote:o.socket?.remoteAddress,secChUa:u(`sec-ch-ua`),secChUaMobile:u(`sec-ch-ua-mobile`),secChUaPlatform:u(`sec-ch-ua-platform`),secFetchSite:u(`sec-fetch-site`),secFetchDest:u(`sec-fetch-dest`),secFetchMode:u(`sec-fetch-mode`),secFetchUser:u(`sec-fetch-user`)});let d=o.method??`GET`,f=l.template,p=xoe(u(Kc.kind)),m=c.startsWith(`/api/`)?U8e(o):void 0;if(est(o,{requestId:m,clientSurface:p}),m!==void 0&&(G8e(o,m),typeof s.setHeader==`function`&&s.setHeader(HK,m),typeof s.once==`function`)){let e=Date.now(),n=!1,r=()=>{n||(n=!0,t.info({event:`api.access`,requestId:m,method:d,route:f,status:s.statusCode,durationMs:Date.now()-e,...p===void 0?{}:{clientSurface:p},...s.writableFinished?{}:{aborted:!0}},`${d} ${f} ${s.statusCode}`))};s.once(`finish`,r),s.once(`close`,r)}if(c.startsWith(`/api/`)){typeof s.setHeader==`function`&&s.setHeader(`Cache-Control`,`no-store`);let e=o.headers.origin,t=Zot(e,d,i);if(!t.admitted)return Z(s,403,`urn:ok:error:invalid-origin`,`Origin not allowed.`,{handler:`api-origin-gate`,detail:t.detail}),!0;if(typeof s.setHeader==`function`&&(e!==void 0&&s.setHeader(`Vary`,`Origin`),t.corsGrant&&(e!==void 0&&s.setHeader(`Access-Control-Allow-Origin`,e),s.setHeader(`Access-Control-Allow-Methods`,`GET, POST, PUT, DELETE, OPTIONS`),s.setHeader(`Access-Control-Allow-Headers`,`Content-Type, Authorization, traceparent, tracestate, baggage, ${HK}, ${Kc.protocol}, ${Kc.runtime}, ${Kc.kind}`),s.setHeader(`Access-Control-Expose-Headers`,HK))),o.method===`OPTIONS`)return s.writeHead(204),s.end(),!0}if(r.isMutating(c)){if(n&&l.dispatch!==void 0&&(d===`POST`||d===`PUT`||d===`DELETE`)&&!vst.has(c))return Z(s,403,`urn:ok:error:single-file-mode`,`Single-file previews cannot manage project files.`,{handler:`api-preview-content-scope`}),!0;let e=o.socket?.remoteAddress;if(e!==void 0&&!PQ(e,i))return Z(s,403,`urn:ok:error:loopback-required`,`Loopback required.`,{handler:`api-mutating-gate`}),!0;if(!a(o.headers.host))return Z(s,403,`urn:ok:error:host-not-allowed`,`Host header not allowed.`,{handler:`api-mutating-gate`,detail:MQ}),!0}if(c.startsWith(`/api/`)){let e=n?`api-ephemeral-gate`:`api-read-gate`,t=o.socket?.remoteAddress;if(t!==void 0&&!PQ(t,i))return Z(s,403,`urn:ok:error:loopback-required`,`Loopback required.`,{handler:e}),!0;if(!a(o.headers.host))return Z(s,403,`urn:ok:error:host-not-allowed`,`Host header not allowed.`,{handler:e,detail:MQ}),!0}if(!c.startsWith(`/api/`))return!1;let h=ko.extract(To.active(),o.headers),g=hU(),_=Date.now();return await To.with(h,()=>g.startActiveSpan(`HTTP ${d} ${f}`,{kind:Hie.SERVER,attributes:{[Cb]:d,[Tb]:f,[Ob]:c,[kb]:`http`,[Ab]:o.headers[`user-agent`]??``,"ok.request.id":m,"ok.client.surface":p}},async t=>{try{let n=l.dispatch;n===void 0?Z(s,404,`urn:ok:error:not-found`,`API endpoint not found.`,{handler:`api-dispatch`,detail:`No handler for ${d} ${c}`}):r.isMutating(c)&&e.dispatchMutation!==void 0?await e.dispatchMutation(()=>n(o,s),c):await n(o,s);let i=s.statusCode;t.setAttribute(wb,i),i>=500&&t.setStatus({code:Ao.ERROR,message:`status ${i}`})}catch(e){throw t.recordException(e),t.setStatus({code:Ao.ERROR,message:e instanceof Error?e.message:String(e)}),!s.headersSent&&!s.writableEnded&&!s.destroyed&&Z(s,500,`urn:ok:error:internal-server-error`,`Internal server error.`,{handler:f,cause:e}),t.setAttribute(wb,s.statusCode),e}finally{t.end();let e=(Date.now()-_)/1e3;yst().record(e,{[Cb]:d,[Tb]:f,[wb]:s.statusCode})}})),!0}}function GQ(e,t){return async(n,r,...i)=>{try{await e(n,r,...i)}catch(e){if(e instanceof $a||e instanceof Error&&e.name===`BridgeMergeContentLossError`)throw e;Z(r,500,`urn:ok:error:internal-server-error`,t.title??`Internal server error.`,{handler:t.handler,cause:e})}}}function xst(e,t){return KQ(e,{maxBytes:t,timeoutMs:3e4})}function Sst(e){let t=e?.split(`;`,1)[0]?.trim().toLowerCase();return t===void 0?!1:t===`application/json`||/^application\/[a-z0-9!#$&^_.+-]+\+json$/.test(t)}function Cst(e){return e.headers[`transfer-encoding`]!==void 0||Number(e.headers[`content-length`]??0)>0}async function KQ(e,t){if(Cst(e)&&!Sst(e.headers[`content-type`]))throw new qQ;let n=[],r=0,i=AbortSignal.timeout(t.timeoutMs),a=()=>e.destroy(new XQ(t.timeoutMs));i.addEventListener(`abort`,a,{once:!0});try{for await(let i of e){if(r+=i.length,r>t.maxBytes)throw new YQ(t.maxBytes);n.push(i)}return Buffer.concat(n)}finally{i.removeEventListener(`abort`,a)}}var qQ=class extends Error{constructor(){super(`Request body is not labeled as JSON`),this.name=`UnsupportedMediaTypeError`}};function JQ(e,t){Z(e,415,`urn:ok:error:unsupported-media-type`,`Request body must be JSON.`,{handler:t,detail:`Send the request body as JSON with the header Content-Type: application/json.`})}var YQ=class extends Error{maxBytes;constructor(e){super(e===void 0?`Request body exceeded cap`:`Request body exceeded ${wst(e)} cap`),this.name=`PayloadTooLargeError`,this.maxBytes=e}},XQ=class extends Error{timeoutMs;constructor(e){super(e===void 0?`Request body read exceeded timeout`:`Request body read exceeded ${e}ms timeout`),this.name=`RequestBodyTimeoutError`,this.timeoutMs=e}};function wst(e){return e>=1048576?`${(e/1048576).toFixed(0)} MB`:e>=1024?`${(e/1024).toFixed(0)} KB`:`${e} B`}function ZQ(e,t,n,r={}){let i=e.safeParse(t);if(i.success)return{ok:!0,value:i.data};let a=i.error.issues.some(e=>e.code===`custom`&&e.params?.contentControlAdmission===!0),o=i.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`; `),s=a?`${o} Offsets count the full submitted field after caller composition, including any frontmatter.`:o;return Z(n,400,`urn:ok:error:invalid-request`,`Request body is invalid.`,{handler:r.handler,detail:s,...a?{extensions:{contentControlAdmission:!0}}:{}}),{ok:!1}}function QQ(e,t,n={}){return async(r,i)=>{if(n.method!==void 0&&r.method!==n.method){Z(i,405,`urn:ok:error:method-not-allowed`,`Method not allowed.`,{handler:n.handler,extraHeaders:{Allow:n.method}});return}if(n.preBodyGate!==void 0&&!n.preBodyGate(r,i)){!i.headersSent&&!i.writableEnded&&!i.destroyed&&Z(i,500,`urn:ok:error:internal-server-error`,`Internal server error.`,{handler:n.handler,cause:Error(`preBodyGate returned false without writing a response`)});return}if(n.skipBodyParse){let a=ZQ(e,{},i,n);if(!a.ok)return;await t(r,i,a.value);return}let a;try{a=await xst(r,n.maxBodyBytes??1048576)}catch(e){if(e instanceof qQ){JQ(i,n.handler);return}if(e instanceof YQ){Z(i,413,`urn:ok:error:payload-too-large`,`Payload too large.`,{handler:n.handler,cause:e});return}if(e instanceof XQ){Z(i,408,`urn:ok:error:request-timeout`,`Request body read timed out.`,{handler:n.handler,cause:e});return}Z(i,500,`urn:ok:error:internal-server-error`,`Failed to read request body.`,{handler:n.handler,cause:e});return}let o;try{o=a.length===0?{}:JSON.parse(a.toString(`utf8`))}catch(e){Z(i,400,`urn:ok:error:invalid-request`,`Request body is not valid JSON.`,{handler:n.handler,cause:e});return}let s=ZQ(e,o,i,n);s.ok&&await t(r,i,s.value)}}const $Q=()=>J(`http`);function Q(e,t,n,r,i={}){if(e.headersSent||e.writableEnded||e.destroyed){$Q().error({event:`api.success.double-write`,status:t,handler:i.handler},`successResponse called after headers already sent — suppressed`),GK().add(1,{type:`urn:ok:error:internal-server-error`,...i.handler?{handler:i.handler}:{}});return}let a=n.safeParse(r);if(!a.success){$Q().error({event:`api.success.malformed-body`,issues:a.error.issues,bodyKeys:typeof r==`object`&&r?Object.keys(r):null,handler:i.handler,originalStatus:t},`successResponse produced an invalid body for the supplied schema — emitting fallback`),Z(e,500,`urn:ok:error:internal-server-error`,`Internal server error.`,{handler:i.handler});return}let o;try{o=JSON.stringify(a.data)}catch(n){$Q().error({event:`api.success.unserializable-body`,bodyKeys:typeof a.data==`object`&&a.data!==null?Object.keys(a.data):null,handler:i.handler,originalStatus:t,err:n},`successResponse parsed body is not JSON-serializable — emitting fallback`),Z(e,500,`urn:ok:error:internal-server-error`,`Internal server error.`,{handler:i.handler});return}e.writeHead(t,{...i.extraHeaders,"Content-Type":`application/json`,"X-Content-Type-Options":`nosniff`}),e.end(o)}function Tst(e){let{log:t,checkLocalOpSecurity:n,getPrincipal:r,homeDirOverride:i,projectDir:a,agentIntegrations:o}=e;return UQ({"/api/agent-integrations/apply":QQ(Qne,GQ(async(e,n,s)=>{let c=OQ(s,r);if(c.kind===`invalid-summary`){Z(n,400,`urn:ok:error:invalid-request`,`Summary must be a string.`,{handler:`agent-integrations-apply`});return}let l=ost(e)?`local-web`:`remote-web`,{report:u,snapshot:d}=await Lot(s.intents,{execute:o?.execute,env:l,snapshot:()=>Eq({env:l,resolve:o?.probe}),decisionHome:i??vc(),...o?.userSkillPresentAnywhere===void 0?{}:{userSkillPresentAnywhere:o.userSkillPresentAnywhere},projectDir:a});t.info({actor:c.kind,applied:u.actions.length,failed:u.actions.filter(e=>e.errorId!==void 0).length,conflicts:u.conflicts.map(e=>e.kind)},`[agent-integrations] batch applied`),Q(n,200,Are,{...u,snapshot:d},{handler:`agent-integrations-apply`})},{handler:`agent-integrations-apply`,title:`Failed to apply AI tool connections.`}),{handler:`agent-integrations-apply`,method:`POST`,preBodyGate:(e,t)=>n(e,t,{handler:`agent-integrations-apply`})})},{mutating:[`/api/agent-integrations/apply`]})}let Est=0;const Dst=Object.freeze({source:`local`,skipStoreHooks:!0,context:Object.freeze({origin:`effect-capture`,paired:!1})});function e$(e,t,n,r,i){let a=e.doc;if(!a)return()=>{};let o=++Est,s=a.getMap(`agent-effects`),c=u=>{if(u.transaction.origin!==n)return;e.unobserve(c),a.off(`destroy`,l);let d=`${t}:${o}`,f={sessionId:t,timestamp:Date.now(),delta:u.delta,agent_type:i??`agent`,color_seed:r??t};try{a.transact(()=>{if(s.set(d,f),s.size>50){let e=[...s.entries()].sort((e,t)=>e[1].timestamp-t[1].timestamp);for(let[t]of e.slice(0,s.size-50))s.delete(t)}},Dst)}catch(e){let n=e instanceof Error?e.message:String(e);if(console.warn(JSON.stringify({event:`effect-diff-capture-failed`,sessionId:t,reason:n})),l0e(),process.env.NODE_ENV!==`production`)throw e}},l=()=>{e.unobserve(c)};return e.observe(c),a.once(`destroy`,l),()=>{e.unobserve(c),a.off(`destroy`,l)}}let t$=new Map;function n$(e,t,n,r,i,a,o,s){let c=t$.get(t);if(c||(c={writerId:t,displayName:n,colorSeed:r??n,docs:new Set,subjectOverride:i,actor:a,summaries:[],previousPaths:[]},t$.set(t,c)),c.docs.add(e),i!==void 0&&(c.subjectOverride=i),a!==void 0){let e=c.actor??{};a.principalId!==void 0&&(e.principalId=a.principalId),a.agentType!==void 0&&(e.agentType=a.agentType),a.clientName!==void 0&&(e.clientName=a.clientName),a.clientVersion!==void 0&&(e.clientVersion=a.clientVersion),a.label!==void 0&&(e.label=a.label),c.actor=e}if(typeof o==`string`&&o.length>0&&c.summaries.push(o),s&&s.length>0)for(let e of s)c.previousPaths.push(e)}function Ost(e){let t=e instanceof Set?e:new Set(e);if(t.size!==0)for(let[e,n]of t$){for(let e of t)n.docs.delete(e);n.docs.size===0&&t$.delete(e)}}function kst(){let e=t$;return t$=new Map,e}function Ast(e){for(let[t,n]of e){let e=t$.get(t);e||(e={writerId:t,displayName:n.displayName,colorSeed:n.colorSeed,docs:new Set,actor:n.actor,summaries:[],previousPaths:[]},t$.set(t,e));for(let t of n.docs)e.docs.add(t);n.summaries.length>0&&(e.summaries=[...n.summaries,...e.summaries]),n.previousPaths.length>0&&(e.previousPaths=[...n.previousPaths,...e.previousPaths])}}function jst(e){if(e.size===0)return``;let t=[``];for(let n of e.values()){let e={v:1,id:n.writerId,name:n.displayName,colorSeed:n.colorSeed,docs:[...n.docs]};n.summaries.length>0&&(e.summaries=[...n.summaries]),t.push(`ok-contributors: ${JSON.stringify(e)}`)}return t.join(`
1157
1157
  `)}function Mst(e,t){let n=t$.get(e);n||(n={writerId:e,displayName:t.displayName,colorSeed:t.colorSeed,docs:new Set,actor:t.actor,summaries:[],previousPaths:[]},t$.set(e,n));for(let e of t.docs)n.docs.add(e);t.summaries.length>0&&(n.summaries=[...t.summaries,...n.summaries]),t.previousPaths.length>0&&(n.previousPaths=[...t.previousPaths,...n.previousPaths])}function r$(){return t$.size}function Nst(e){return t$.has(e)}const i$={source:`local`,skipStoreHooks:!0,context:{origin:`file-watcher`,paired:!0}};function a$(e,t,n,r,i,a,o){Aq(e,t,`file-watcher`,n&&r?{resolveEmbed:n,resolveSize:i,sourcePath:r}:void 0,o,a)}const Pst=J(`external-change-attribution`),o$=new Map;function Fst(e){for(let[t,n]of o$)n.expiresAtMs<=e&&o$.delete(t)}function Ist(e,t,n=Date.now(),r=3e4){if(Fst(n),o$.size>=256&&!o$.has(e)){let e=o$.keys().next();e.done||o$.delete(e.value)}o$.set(e,{...t,expiresAtMs:n+r})}function Lst(e,t=Date.now()){let n=o$.get(e);if(!n)return;if(o$.delete(e),n.expiresAtMs<=t){Pst.debug({docName:e},`external-change claim expired before its write arrived`);return}let{expiresAtMs:r,...i}=n;return i}function Rst(e){o$.delete(e)}function s$(e){let t=process.env.OK_TELEMETRY_VERBOSE===`1`;return e instanceof $a?e.toLog({verbose:t}):e instanceof ya?Kt(e.violation,{verbose:t}):e instanceof Error?e.message:String(e)}function c$(e,t,n,r,i,a,o,s){if($H(n)||eU(n)||nU(n)||rU(n)||iU(n))return;let c=t.documents.get(n);if(!c)return;let l=c.getText(`source`).toString(),u=l===r,d=an(l).frontmatter,{frontmatter:f}=an(r),p=o&&LJ(i$.context.origin)?{report:e=>o(n,e,EJ.id,`file-watcher-intake`),baselineFullMd:l}:void 0;try{c.transact(()=>{a$(c,r,i,n,a,p,s)},i$)}catch(t){try{e.setReconciledBase(n,c.getText(`source`).toString())}catch(e){J(`reconcile`).error({err:e,originalError:s$(t),docName:n},`Unable to persist the reconciled base after an external-change failure`)}throw t}if(d!==f&&_Z(`file-watcher`),!u){let e=Lst(n)??{writerId:EJ.id,displayName:EJ.name,colorSeed:EJ.id};n$(n,e.writerId,e.displayName,e.colorSeed,Tye(n))}e.setReconciledBase(n,r)}function zst(e,t,n,r,i,a,o){if(sU(n))return`not-frozen`;let s=t.documents.get(n);if(!s)return`not-frozen`;let c=s.getMap(`lifecycle`),l=c.get(`status`);if(!VJ(l))return`not-frozen`;let u=s.getText(`source`).toString()!==r;try{c$(e,t,n,r,i,a,o)}catch(e){return J(`reconcile`).error({err:s$(e),docName:n,status:l},`[reconcile] could not revive ${n}: it stays ${l} and keeps refusing stores until the server reloads it`),`failed`}return c.delete(`status`),c.delete(`newPath`),e.endRenameCarry(n),J(`reconcile`).info({docName:n,status:l,replacedInMemoryContent:u},`[reconcile] revived ${n}: its name is occupied on disk again, so the ${l} freeze no longer applies`),`revived`}function Bst(e,t,n,r,i){return async(a,o)=>{try{c$(e,t,a,o,n,r,i),J(`file-watcher`).info({docName:a},`applied external change`)}catch(e){if(e instanceof ya||e instanceof $a)throw e;D1e(),J(`file-watcher`).error({docName:a,err:e},`Failed to apply external change for ${a}`)}}}const l$=`stale-external-write`;function u$(e,t,n,r){let i=e.getStaleExternalWrite(n)?.retainedContent;if(i!==void 0&&i!==e.getReconciledBase(n))return;e.clearStaleExternalWrite(n),r?.dissolveReconcile(n,l$);let a=t?.getMap(`lifecycle`);a?.get(`reason`)===l$&&(a.delete(`status`),a.delete(`reason`),a.delete(`detectedAt`))}function d$(e,t,n){t.kind===`refused`&&t.reason===`check-failed`&&(QQe(),J(`reconcile`).warn({docName:e,site:n,failure:t.failure},`[reconcile] ${n} ${e} merge output failed the fidelity check (${t.failure.check})`))}function f$(e,t,n){let r=qJ(t);e$e(r.duplicated),J(`reconcile`).info({docName:e,site:n,...r},`[reconcile] ${n} ${e} kept both versions of ${r.duplicated} block(s), restored ${r.restoredDeletedHere} block(s) deleted here and ${r.restoredDeletedOutside} block(s) deleted outside`)}function p$(e,t,n){t$e(),J(`reconcile`).warn({docName:e,site:n,reason:t},`[reconcile] ${n} ${e} could not be merged (${t}); the live version stays and the other version was saved to history`)}function Vst(e){switch(e){case`conflict-markers`:return`refused-conflict-markers`;case`no-base`:return`refused-no-base`;case`too-large`:case`check-failed`:return`refused-too-large`;default:throw Error(`unhandled reconcile refusal reason: ${String(e)}`)}}function m$(e,t,n,r,i,a){let o=e.getReconciledBase(n),s=e.getStaleExternalWrite(n),c=(r,a)=>{let s=e.recordStaleExternalWrite(n,r,a);i&&i.raise({kind:`reconcile`,file:i.fileOf(n),reason:l$,detectedAt:s.detectedAt,stages:{base:o??r,ours:s.retainedContent??(t===void 0?o??r:v$(t)),theirs:s.diskContent}})};return s?.retainedContent!==void 0&&s.retainedContent!==o?(c(r,a??s.retainedContent),!0):o===r?(u$(e,t,n,i),!1):e.staleExternalWriteMatches(n,r)?(c(r,a??s?.retainedContent),!0):e.isDisplacedVersion(n,r)?(J(`reconcile`).warn({docName:n,diskBytes:r.length},`[reconcile] refused stale external write for ${n}; disk restores a version this server already displaced`),c(r,a),!0):(u$(e,t,n,i),!1)}const Hst='Re-read the document (e.g. `exec("cat <path>")`)';function h$(e){return e===1?`1 block`:`${e} blocks`}function Ust(e){let t=[];e.duplicated>0&&t.push(`An out-of-band edit changed ${h$(e.duplicated)} also edited here, so both versions were kept: the version here first, the out-of-band version directly under it.`),e.restoredDeletedHere>0&&t.push(`The deletion here of ${h$(e.restoredDeletedHere)} was undone because the out-of-band edit changed ${e.restoredDeletedHere===1?`it`:`them`}: the out-of-band version was restored.`),e.restoredDeletedOutside>0&&t.push(`The out-of-band deletion of ${h$(e.restoredDeletedOutside)} edited here was undone: the version here was kept.`),t.push(`Your write landed; do not retry it.`);let n=[...e.duplicated>0?[`remove the duplicate`]:[],...e.restoredDeletedHere>0?[`delete the restored block again`]:[]];return t.push(n.length>0?`${Hst} and, if your task calls for it, ${n.join(` or `)} with an ordinary edit.`:`${Hst} before continuing.`),t.join(` `)}function Wst(e){let t=e.mergeOutcome;switch(t){case`merged`:return'An out-of-band edit was three-way merged into this document before your edit was applied on top; the merge may have interleaved content blocks. Re-read it (e.g. `exec("cat <path>")`) and review the combined result carefully before continuing.';case`both-kept`:return Ust(e.keptBlocks??{duplicated:1,restoredDeletedHere:0,restoredDeletedOutside:0});case`kept-live`:return'An out-of-band edit to this file could not be merged safely, so the version here was kept and the out-of-band version was saved to the history of this document. Your write landed; do not retry it. Re-read the document (e.g. `exec("cat <path>")`) before continuing.';case`clean`:case void 0:return'An out-of-band edit was reconciled into this document before your edit was applied on top; the document now reflects that edit plus yours. Re-read it (e.g. `exec("cat <path>")`) to see the combined result before continuing.';default:throw Error(`unhandled merge outcome: ${String(t)}`)}}function g$(e){if(!e.reconciled)return;let t=e.mergeOutcome===`both-kept`||e.mergeOutcome===`kept-live`;return{kind:`disk-edit-reconciled`,intendedBytes:e.baseBytes,actualBytes:e.diskBytes,byteDelta:e.diskBytes-e.baseBytes,...e.mergeOutcome?{mergeOutcome:e.mergeOutcome}:{},...e.keptBlocks===void 0?{}:{duplicatedBlocks:e.keptBlocks.duplicated,restoredDeletedHere:e.keptBlocks.restoredDeletedHere,restoredDeletedOutside:e.keptBlocks.restoredDeletedOutside},...t?{nextStep:`re-read`}:{},hint:Wst(e)}}const _$={reconciled:!1,baseBytes:0,diskBytes:0};function v$(e){let t=e.getText(`source`).toString(),{frontmatter:n,body:r}=an(t);return Fa(n,r)}async function y$(e,t,n,r,i,a,o,s){if($H(n)||eU(n)||nU(n)||rU(n)||iU(n))return _$;let c=t.documents.get(n);if(c&&fZ(c)&&c.getMap(`lifecycle`).get(`reason`)!==l$)return _$;let l=e.getReconciledBase(n);if(l===void 0)return _$;let u,d;try{if(u=jG(n,r),!K(u))return _$;d=lc(u)}catch{return _$}if(yK(u,d,r))return J(`reconcile`).warn({docName:n,canonical:d,contentDir:r},`[reconcile] symlink-escape on disk read for ${n}; skipping reconcile`),_$;let f;try{f=q(d,`utf-8`)}catch(e){let t=e?.code;return t!==`ENOENT`&&J(`reconcile`).warn({docName:n,canonical:d,code:t},`[reconcile] disk read failed for ${n} (${t??`unknown`}); skipping reconcile`),_$}let p=ga(f);if(f===l)return u$(e,c,n,o),_$;let m=e.inFlightFlushCount(n);if(m>0){if(e.hasInFlightFlush(n,p))return O1e(),J(`reconcile`).debug({docName:n,diskBytes:f.length,pendingFlushes:m},`[reconcile] disk matches own in-flight flush for ${n}; skipping reconcile`),_$;k1e(),J(`reconcile`).warn({docName:n,diskBytes:f.length,pendingFlushes:m},`[reconcile] disk matches none of ${m} in-flight flush snapshot(s) for ${n}; falling through to merge`)}if(!c||m$(e,c,n,f,o)||p===ga(l))return _$;let h=v$(c),g=eY({docName:n,base:l,ours:h,theirs:f});J(`reconcile`).info({docName:n,result:g.kind,baseBytes:l.length,diskBytes:f.length},`[reconcile] before-agent-write ${n} result=${g.kind}`);let _=(e,t)=>({reconciled:!0,baseBytes:Buffer.byteLength(l,`utf8`),diskBytes:Buffer.byteLength(f,`utf8`),mergeOutcome:e,...t===void 0?{}:{keptBlocks:t}});switch(g.kind){case`noop`:return _$;case`refused`:return d$(n,g,`agent-write`),(g.reason===`check-failed`||g.reason===`too-large`)&&await s.keptLive(n,{side:`theirs`,bytes:f},g.reason)?(e.setReconciledBase(n,f),p$(n,g.reason,`agent-write`),_(`kept-live`)):(o.raise({kind:`reconcile`,file:o.fileOf(n),reason:Vst(g.reason),stages:{base:l,ours:h,theirs:f}}),_$);case`clean`:case`merged`:case`both-kept`:{let r=g.kind===`clean`?f:g.newContent;if(g.kind!==`clean`&&g.dedupSkipped&&(ZQe(),J(`reconcile`).warn({docName:n},`[reconcile] ${n} insert-group dedup skipped (LCS cell cap); union emitted with possible same-block duplication`)),c$(e,t,n,r,i,void 0,a),g.kind!==`clean`&&e.setReconciledBase(n,f),g.kind!==`both-kept`)return _(g.kind);let o=qJ(g.kept);return s.bothKept(n,{ours:h,theirs:f},g.kept),f$(n,g.kept,`agent-write`),_(`both-kept`,o)}}}const b$=J(`mermaid-validator`);let Gst=null;function Kst(e){let t=[],n=e.split(`
1158
1158
  `),r=e=>e.endsWith(`\r`)?e.slice(0,-1):e,i=0;for(;i<n.length;){let e=r(n[i]??``),a=e.match(/^ {0,3}(`{3,}|~{3,})[ \t]*([^\s`]*)/);if(!a){i++;continue}let o=a[1]??``,s=o[0]??"`";if(s==="`"&&e.slice(e.indexOf(o)+o.length).includes("`")){i++;continue}let c=a[2]??``,l=RegExp(`^ {0,3}\\${s}{${o.length},}[ \t]*$`),u=[],d=i+1;for(;d<n.length&&!l.test(r(n[d]??``));)u.push(n[d]??``),d++;if(c===`mermaid`){let e=u.join(`
1159
- `),n=(u.find(e=>e.trim().length>0)?.trim()??``).slice(0,200);t.push({firstLine:n,body:e})}i=d+1}return t}async function qst(){let{Window:e}=await import(`./lib-CGyiYSWt.mjs`),t=new e({url:`http://localhost/`}),n={window:t,document:t.document,navigator:t.navigator,location:t.location,DOMParser:t.DOMParser,Element:t.Element,Node:t.Node,SVGElement:t.SVGElement,HTMLElement:t.HTMLElement,MutationObserver:t.MutationObserver},r=new Map;try{for(let[e,t]of Object.entries(n))r.set(e,Object.getOwnPropertyDescriptor(globalThis,e)),Object.defineProperty(globalThis,e,{value:t,configurable:!0,writable:!0});let e=(await import(`./mermaid.core-NW5-Y1wO.mjs`)).default;return e.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0}),await e.parse(`graph LR
1159
+ `),n=(u.find(e=>e.trim().length>0)?.trim()??``).slice(0,200);t.push({firstLine:n,body:e})}i=d+1}return t}async function qst(){let{Window:e}=await import(`./lib-CMODqczN.mjs`),t=new e({url:`http://localhost/`}),n={window:t,document:t.document,navigator:t.navigator,location:t.location,DOMParser:t.DOMParser,Element:t.Element,Node:t.Node,SVGElement:t.SVGElement,HTMLElement:t.HTMLElement,MutationObserver:t.MutationObserver},r=new Map;try{for(let[e,t]of Object.entries(n))r.set(e,Object.getOwnPropertyDescriptor(globalThis,e)),Object.defineProperty(globalThis,e,{value:t,configurable:!0,writable:!0});let e=(await import(`./mermaid.core-NW5-Y1wO.mjs`)).default;return e.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0}),await e.parse(`graph LR
1160
1160
  A-->B`),e}finally{for(let[e,t]of r)t?Object.defineProperty(globalThis,e,t):delete globalThis[e]}}function Jst(e){return Gst??=qst().catch(t=>(b$.warn({err:t,"doc.name":e},`mermaid validator unavailable — render validation disabled for this process`),null)),Gst}function Yst(e){let t=e.match(/Parse error on line (\d+)/);if(!t?.[1])return;let n=Number(t[1]);return Number.isSafeInteger(n)&&n>0?n:void 0}async function Xst(e,t){try{if(!e.includes(`mermaid`))return;let{body:n}=It(e),r=Kst(n);if(r.length===0)return;let i=performance.now(),a=await Jst(t);if(a===null)return;let o=performance.now(),s=[],c=0;for(let e=0;e<r.length&&s.length<10&&!(c>=20);e++){if(performance.now()-o>2e3){b$.debug({"doc.name":t,skippedFrom:e+1,fences:r.length},`mermaid validation budget exceeded — remaining fences skipped`);break}let n=r[e];if(n!==void 0){if(n.body.length>1e5||n.body.split(`
1161
1161
  `).length>2e3){b$.debug({"doc.name":t,fenceIndex:e+1},`mermaid fence over validation caps — skipped`);continue}try{c++,await a.parse(n.body)}catch(r){if(r instanceof TypeError){b$.debug({err:r,"doc.name":t,fenceIndex:e+1},`mermaid validation skipped fence — environment failure`);continue}let i=r instanceof Error?r.message:String(r),a=i.slice(0,500),o=Yst(i);s.push({kind:`mermaid-parse-error`,fenceIndex:e+1,fenceFirstLine:n.firstLine,message:a,...o===void 0?{}:{line:o}})}}}let l=Math.round(performance.now()-i);if(s.length===0){l>250&&b$.debug({"doc.name":t,durationMs:l,fences:r.length},`mermaid validation slow (no warnings)`);return}return b$.debug({"doc.name":t,count:s.length,durationMs:l},`mermaid render warnings emitted`),s}catch(e){b$.warn({err:e,"doc.name":t},`mermaid validation errored unexpectedly — skipped`);return}}const x$=J(`rename-log`);let Zst=null;function S$(){return Zst||=gU().createUpDownCounter(`rename.log_entries_total`,{description:`Live rename-log entry count after each append / GC pass`}),Zst}let Qst=null;function $st(){return Qst||=gU().createCounter(`rename.log_gc_dropped_total`,{description:`Cumulative count of rename-log entries dropped by reachability GC`}),Qst}const ect=5242880,tct=4096;function nct(){return{byTo:new Map,byFrom:new Map}}function C$(e){return G(e,`renames.jsonl`)}function rct(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.v!==1||typeof t.from!=`string`||t.from.length===0||typeof t.to!=`string`||t.to.length===0||t.from===t.to||typeof t.at!=`string`||t.at.length===0||typeof t.commitSha!=`string`||t.commitSha!==``&&!/^[0-9a-f]{40}$/.test(t.commitSha)||typeof t.branch!=`string`||t.branch.length===0||typeof t.groupId!=`string`||t.groupId.length===0||t.kind!==`file`&&t.kind!==`folder`||t.actor===null||typeof t.actor!=`object`)return null;let n=t.actor;if(typeof n.writerId!=`string`||n.writerId.length===0||typeof n.displayName!=`string`)return null;let r;if(t.anchors!==void 0){if(!Array.isArray(t.anchors)||!t.anchors.every(e=>typeof e==`string`&&/^[0-9a-f]{40}$/.test(e)))return null;r=t.anchors}return{v:1,from:t.from,to:t.to,at:t.at,commitSha:t.commitSha,branch:t.branch,groupId:t.groupId,kind:t.kind,actor:{writerId:n.writerId,displayName:n.displayName},...r!==void 0&&r.length>0?{anchors:r}:{}}}function ict(e,t){let n=e.byFrom.get(t.from);if(!n)return;let r=n.filter(e=>e!==t);r.length===0?e.byFrom.delete(t.from):e.byFrom.set(t.from,r)}function act(e,t){e.byTo.delete(t.to),ict(e,t)}function w$(e,t){let n=e.byTo.get(t.to);n&&ict(e,n),e.byTo.set(t.to,t);let r=e.byFrom.get(t.from);r?r.push(t):e.byFrom.set(t.from,[t])}function oct(e){let t=nct(),n=C$(e);if(!K(n))return t;let r;try{r=q(n,`utf-8`)}catch(e){return x$.warn({path:n,err:e},`[rename-log] WARN: failed to read ${n}, treating as empty`),t}if(r.length===0)return t;let i=r.split(`
1162
1162
  `),a=i[i.length-1];a!==``&&x$.warn({bytes:a.length},`[rename-log] WARN: trailing line missing newline (${a.length} bytes); dropped`);let o=i.slice(0,-1);for(let e=0;e<o.length;e++){let n=o[e];if(n.length===0)continue;let r;try{r=JSON.parse(n)}catch(t){let r=n.slice(0,80),i=t.message;x$.warn({line:e+1,errMsg:i},`[rename-log] WARN: corrupt entry at line ${e+1} skipped (${i}): ${r}${n.length>80?`…`:``}`);continue}let i=rct(r);if(!i){x$.warn({line:e+1},`[rename-log] WARN: corrupt entry at line ${e+1} skipped`);continue}w$(t,i)}return t.byTo.size>0&&S$().add(t.byTo.size),t}function sct(e){return Buffer.byteLength(`${JSON.stringify(e)}\n`,`utf-8`)}function cct(e){let t=e.anchors;if(!t||t.length===0)return e;let n=e.commitSha===``?{...e,commitSha:`0`.repeat(40)}:e;if(sct(n)<=4096)return e;let r=sct({...n,anchors:[]}),i=[];for(let e of t){let t=Buffer.byteLength(JSON.stringify(e),`utf-8`)+ +(i.length>0);if(r+t>4096)break;r+=t,i.push(e)}x$.warn({to:e.to,kept:i.length,dropped:t.length-i.length},`[rename-log] the entry for ${e.to} keeps ${i.length} of ${t.length} writer anchors to fit the ${tct}-byte line limit`);let{anchors:a,...o}=e;return i.length>0?{...o,anchors:i}:o}function lct(e,t,n,r){let i=rct(t);if(!i)throw Error(`[rename-log] refusing to append malformed entry`);let a=cct(i),o=`${JSON.stringify(a)}\n`;if(Buffer.byteLength(o,`utf-8`)>4096)throw Error(`[rename-log] entry exceeds max line size (${tct} bytes)`);let s=C$(e),c=!1;if(K(s))try{let e=pc(s).size;e>5242880&&(c=!0,x$.warn({size:e,cap:ect},`[rename-log] WARN: file size ${e} exceeds hard cap ${ect}; forcing GC sweep`))}catch{}MU(s,o,{flag:`a`}),w$(n,a),S$().add(1),c&&r&&uct(r,n)}const T$=new Set;function uct(e,t){queueMicrotask(()=>{P$(e,t).catch(e=>{x$.warn({err:e},`[rename-log] WARN: hard-cap forced GC failed`)})})}let E$=null;function dct(e,t){E$={shadowDir:e,index:t}}function D$(e){if(E$&&E$.shadowDir===e)return E$.index;let t=oct(e);return E$={shadowDir:e,index:t},t}function fct(e){let t=[];for(let n of e.byTo.values())t.push(JSON.stringify(n));return t.length>0?`${t.join(`
@@ -1 +1 @@
1
- import{Cc as e,Et as t,Ot as n,Pc as r,S as i,X as a,_c as o,no as s,v as c}from"./md-manager-BGnqyqi1-CG3Frety.mjs";import{$ as l,$a as u,$i as d,$n as f,$r as p,$t as m,A as h,Aa as g,Ai as _,An as v,Ao as y,Ar as b,At as x,B as S,Ba as C,Bi as w,Bn as T,Bo as E,Br as D,Bt as O,C as k,Ca as A,Ci as j,Cn as M,Co as N,Cr as P,Cs as F,Ct as I,D as L,Da as R,Di as z,Dn as B,Do as V,Dr as H,Dt as U,E as W,Ea as G,Ei as K,En as q,Eo as J,Er as Y,Et as X,F as Z,Fa as Q,Fi as $,Fn as ee,Fo as te,Fr as ne,Ft as re,G as ie,Ga as ae,Gi as oe,Gn as se,Go as ce,Gr as le,Gs as ue,Gt as de,H as fe,Ha as pe,Hi as me,Hn as he,Ho as ge,Hr as _e,Ht as ve,I as ye,Ia as be,Ii as xe,In as Se,Io as Ce,Ir as we,It as Te,J as Ee,Ja as De,Ji as Oe,Jn as ke,Jo as Ae,Jr as je,Jt as Me,K as Ne,Ka as Pe,Ki as Fe,Kn as Ie,Ko as Le,Kr as Re,Ks as ze,Kt as Be,L as Ve,La as He,Li as Ue,Ln as We,Lo as Ge,Lr as Ke,Lt as qe,M as Je,Ma as Ye,Mi as Xe,Mn as Ze,Mo as Qe,Mr as $e,Mt as et,N as tt,Na as nt,Ni as rt,Nn as it,No as at,Nr as ot,Nt as st,O as ct,Oa as lt,Oi as ut,On as dt,Oo as ft,Or as pt,Ot as mt,P as ht,Pa as gt,Pi as _t,Pn as vt,Po as yt,Pr as bt,Pt as xt,Q as St,Qa as Ct,Qi as wt,Qn as Tt,Qr as Et,Qt as Dt,R as Ot,Ra as kt,Ri as At,Rn as jt,Ro as Mt,Rr as Nt,Rt as Pt,S as Ft,Sa as It,Si as Lt,Sn as Rt,So as zt,Sr as Bt,Ss as Vt,St as Ht,T as Ut,Ta as Wt,Ti as Gt,Tn as Kt,To as qt,Tr as Jt,Ts as Yt,Tt as Xt,U as Zt,Ua as Qt,Ui as $t,Un as en,Uo as tn,Ur as nn,Ut as rn,V as an,Va as on,Vi as sn,Vn as cn,Vo as ln,Vr as un,Vt as dn,W as fn,Wa as pn,Wi as mn,Wn as hn,Wo as gn,Wr as _n,Ws as vn,Wt as yn,X as bn,Xa as xn,Xi as Sn,Xn as Cn,Xo as wn,Xr as Tn,Xt as En,Y as Dn,Ya as On,Yi as kn,Yn as An,Yo as jn,Yr as Mn,Yt as Nn,Z as Pn,Za as Fn,Zi as In,Zn as Ln,Zr as Rn,Zt as zn,_ as Bn,_a as Vn,_i as Hn,_n as Un,_o as Wn,_r as Gn,_s as Kn,_t as qn,a as Jn,aa as Yn,ai as Xn,an as Zn,ao as Qn,ar as $n,at as er,b as tr,ba as nr,bi as rr,bn as ir,bo as ar,br as or,bs as sr,bt as cr,c as lr,ca as ur,ci as dr,cn as fr,co as pr,cr as mr,ct as hr,d as gr,da as _r,di as vr,dn as yr,do as br,dr as xr,dt as Sr,ea as Cr,ei as wr,en as Tr,eo as Er,er as Dr,et as Or,f as kr,fa as Ar,fi as jr,fn as Mr,fo as Nr,fr as Pr,fs as Fr,ft as Ir,g as Lr,ga as Rr,gi as zr,gn as Br,go as Vr,gr as Hr,gt as Ur,h as Wr,ha as Gr,hi as Kr,hn as qr,ho as Jr,hr as Yr,ht as Xr,i as Zr,ia as Qr,ii as $r,in as ei,io as ti,ir as ni,it as ri,j as ii,ja as ai,ji as oi,jn as si,jo as ci,jr as li,jt as ui,k as di,ka as fi,ki as pi,kn as mi,ko as hi,kr as gi,kt as _i,l as vi,la as yi,li as bi,ln as xi,lo as Si,lr as Ci,lt as wi,m as Ti,ma as Ei,mi as Di,mn as Oi,mo as ki,mr as Ai,mt as ji,n as Mi,na as Ni,ni as Pi,nn as Fi,no as Ii,nr as Li,nt as Ri,o as zi,oa as Bi,oi as Vi,on as Hi,oo as Ui,or as Wi,ot as Gi,p as Ki,pa as qi,pi as Ji,pn as Yi,po as Xi,pr as Zi,ps as Qi,pt as $i,q as ea,qa as ta,qi as na,qn as ra,qo as ia,qr as aa,qs as oa,qt as sa,r as ca,ra as la,ri as ua,rn as da,ro as fa,rr as pa,rt as ma,s as ha,sa as ga,si as _a,sn as va,so as ya,sr as ba,st as xa,t as Sa,ta as Ca,ti as wa,tn as Ta,to as Ea,tr as Da,tt as Oa,u as ka,ua as Aa,ui as ja,un as Ma,uo as Na,ur as Pa,ut as Fa,v as Ia,va as La,vi as Ra,vn as za,vo as Ba,vr as Va,vs as Ha,vt as Ua,w as Wa,wa as Ga,wi as Ka,wn as qa,wo as Ja,wr as Ya,ws as Xa,wt as Za,x as Qa,xa as $a,xi as eo,xn as to,xo as no,xr as ro,xs as io,xt as ao,y as oo,ya as so,yi as co,yn as lo,yo as uo,yr as fo,ys as po,yt as mo,z as ho,za as go,zi as _o,zn as vo,zo as yo,zr as bo,zt as xo}from"./dist-DSmo1Lcl.mjs";import{f as So,h as Co,m as wo,n as To,p as Eo,t as Do}from"./fs-find-project-root-BYV07wjn.mjs";export{Sa as AGENT_ID_MAX_LEN,Mi as AGENT_ID_RE,ca as AGENT_WRITE_ORIGIN,s as AUDIT_EMPTY_SCOPE_WARNING,Zr as AcpPermissionStore,Jn as AcpRegistry,zi as AcpThreadManager,ha as AgentFocusBroadcaster,lr as AgentPresenceBroadcaster,vi as AgentSessionCapacityError,ka as AgentSessionManager,gr as AutoStartDisabledError,kr as BUNDLE_IDS,Ki as BUNDLE_SCOPE,Ti as BUNDLE_SKILL_NAME,Wr as BacklinkIndex,Lr as CC1Broadcaster,e as CC1_CONTRACT_VERSION,Bn as CONCURRENT_REPLACE_WINDOW_MS,Ia as CONFIG_FILENAME,oo as CONFLICT_MARKER_RE,tr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Qa as ConfigSchema,Ft as ConflictAuthority,k as DEFAULT_CHECKPOINT_RETENTION,Wa as DEFAULT_EMBEDDINGS_DIMENSIONS,Ut as DEFAULT_PACK_ID,W as DocumentDurabilityState,L as DocumentDurabilityStateError,ct as EMBEDDINGS_API_KEY_ENV,di as EPHEMERAL_PROJECT_DIR_PREFIX,h as EmbeddingsSecretStoreError,ii as ExposureConsentError,Je as FEATURED_AGENT_IDS,tt as FILE_SYSTEM_WRITER,ht as FILE_WATCHER_ORIGIN,Z as FileEmbeddingsBackend,ye as FilesystemRootProjectError,Ve as GIT_PREFLIGHT_FAIL_SPAN_NAME,Ot as GIT_UPSTREAM_WRITER,Fr as GitDirAccessError,ho as GitNotAvailableError,S as GitProbeTimeoutError,an as GitTooOldError,fe as HOCUSPOCUS_AUTH_REJECTION_REASONS,Zt as HocuspocusAuthRejection,fn as HocuspocusAuthTokenSchema,ie as HomeProjectRootError,Ne as INSTALLED_AGENTS_SCHEMES,ea as JSON_SCHEMA_DIALECT_2020_12,ze as LINEAGE_EPOCH_KEY,Ee as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Dn as LOCK_FILE_ACCESS_REMEDY,bn as MANAGED_RENAME_ORIGIN,Pn as MAX_ACP_THREADS,St as MAX_AGENT_SESSIONS,l as MCP_CONNECTION_ID_HEADER,o as MCP_SERVER_NAME,Or as MIN_EVICTABLE_IDLE_MS,Oa as MIN_GIT_VERSION,Qi as MalformedGitPointerError,Ri as McpLogger,ma as MissingOkConfigError,ri as OBSERVER_SYNC_ORIGIN,er as OK_OKIGNORE_TEMPLATE,Gi as ONBOARDING_BUNDLE_IDS,vn as ORPHAN_MODES,oa as PROTOCOL_VERSION,Kn as PinoLogger,xa as ProcessLockCollisionError,hr as ProcessLockFileError,wi as ProjectGitInitError,Fa as ROLLBACK_ORIGIN,Sr as ROOT_GITIGNORE_TEMPLATE,Ir as RUNTIME_VERSION,$i as SERVICE_WRITER,ji as SKILL_INSTALL_EVENTS_FILENAME,c as SKILL_STATE_TARGETS,Xr as STARTER_FOLDER_FRONTMATTER_FILENAME,Ur as STARTER_PACKS,qn as STARTER_PACK_IDS,Ua as STATE_MANIFEST_FILENAME,mo as STATE_SCHEMA_VERSION,cr as SYMLINK_MERGE_MIN_GIT_LABEL,ao as SYMLINK_MERGE_MIN_GIT_VERSION,r as SYSTEM_DOC_NAME,Ht as SeedPrerequisiteError,I as SeedRootDirError,Za as ServerAuthorityCollisionError,Xt as ServerAuthorityRegistryError,X as ServerLockCollisionError,U as SingleFileNotAFileError,mt as SingleFileNotFoundError,_i as SingleFileNotMarkdownError,x as SingleFileProjectOverrideError,ui as StateManifestError,i as TEST_LOOP_CORE_MARKER,et as TEST_LOOP_SERVER_MARKER,st as TagIndex,xt as USER_GLOBAL_BUNDLE_IDS,re as UnsafeIncomingSymlinkError,Te as __getShowAllWalkStatsForTesting,qe as __resetShowAllWalkStatsForTesting,Pt as acpThreadStoreRoots,xo as acpThreadsDir,O as acquireProcessLock,dn as acquireServerLock,ve as applyAgentMarkdownWrite,rn as applyExternalChange,yn as applySeed,de as assertCheckoutSymlinksSafe,Be as assertCompatibleStateManifest,sa as assertGitAvailable,Me as assertIncomingSymlinksSafe,Nn as assertMergeNameResolvesTo,En as assertNeverDiskEvent,zn as assertRepoCheckoutSymlinksSafe,Dt as assertSafeProjectRoot,m as assessLockHolder,Tr as attachAcpThreadSocket,Ta as attachCollabClientCounter,Fi as attachIdleShutdown,da as auditScopeNotFoundTitle,ei as bindConflictAuthority,Zn as bootServer,Hi as buildAndOpenSkill,va as buildConfigYmlContent,fr as buildExecResult,xi as buildIngressPolicy,Ma as buildOkMcpStdioCommand,yr as buildSkillZip,Mr as buildStarterFolderFrontmatterYaml,Yi as buildWipTree,Oi as bundleSkillMdPath,qr as canonicalProjectKey,Br as canonicalizeForCompare,Un as classifyEvents,za as classifyFsPath,lo as classifyLockHolder,ir as clearAllEmbeddingsKeys,to as coercePackId,Rt as collectServerHostSnapshot,t as colorFromSeed,M as commitUpstreamImport,qa as commitWip,Kt as commitWipFromTree,q as compareSemver,B as composeEffectiveLinterConfig,dt as composeFrontmatterSchemasConfig,mi as containsConflictMarkers,v as contentHash,si as contributorCount,Ze as countShadowObjects,it as countStaleAgentWipRefs,vt as countWipRefs,ee as createApiExtension,Se as createAssetServeMiddleware,We as createCollaborationHost,jt as createContentFilter,vo as createContentFilterAsync,T as createEmbeddingsSecretStore,cn as createEphemeralProjectDir,he as createExternalChangeHandler,So as createFileLogger,en as createLiveDerivedIndexExtension,hn as createMcpHttpHandler,se as createOsProbe,Ie as createPersistenceExtension,ra as createProbeFailureReporter,ke as createServer,An as createServerObserverExtension,Cn as createServerProbeResolver,Ln as createStreamingErrorWriter,Ha as createTestLogger,Tt as describeStoredEmbeddingsKey,f as detectClaudeDesktopPresence,Dr as detectGit,Da as detectProjectShape,Li as detectUserSkillHosts,pa as discoverLockDirs,ni as discoverMarkdownlintConfig,$n as emitPreflightFailureSpan,Wi as encodeDocName,ba as encodeFolderRoute,mr as encodeSkillRoute,Ci as ensureProjectGit,Pa as errorResponse,xr as evictStaleTrackerEntries,Pr as extractHeadings,Zi as extractOkBinaryPath,Ai as extractWikiLinksFromMarkdown,Yr as fallbackPaths,Hr as findEnclosingGitRoot,Do as findEnclosingProjectRoot,Gn as findNativeMarkdownlintFile,Eo as flushFileLogger,Va as formatAuditBrokenLinkSuppressionLine,fo as formatAuthRejectionWire,or as formatContributorsFrom,ro as formatPackRationale,Bt as gcCheckpointRefs,P as getCurrentMcpLogger,Ya as getIngressContext,Jt as getLocalDir,wo as getLogFilePath,po as getLogger,Co as getLogsDir,Y as getMachineId,H as getMeter,pt as getMetrics,gi as getTracer,b as handleCollabSocketError,li as handleSpawnCursor,$e as hasForwardingHeaders,ot as hasGcLogLatch,n as iconFromClientName,bt as incrementCollabSocketFilteredError,ne as incrementServerObserverFire,we as initContent,Ke as initShadowRepo,Nt as initTelemetry,bo as initToleranceTelemetryWriter,D as installJsonSchemaDialect,un as installPrettyZodErrors,sr as installTestLoggers,_e as installUserSkill,nn as isAllowedApiOrigin,_n as isAllowedWorkspaceHostHeader,le as isConfigDoc,Re as isDefunctProcess,aa as isDocInConflict,je as isFilesystemRoot,Mn as isHocuspocusAuthRejectionReason,Tn as isHomeDir,Rn as isHostAdmitted,Et as isKnownPackId,p as isLinkIndexExcludedDoc,wr as isLockFromThisMachine,wa as isLockProcessRunning,Pi as isLoopbackAddress,ua as isManagedArtifactDoc,$r as isMintedThreadId,Xn as isOriginAdmitted,ue as isOrphanMode,Vi as isPairedWriteOrigin,_a as isPathWithinDir,dr as isPeerAdmitted,bi as isProcessAlive,To as isProjectRoot,ja as isReservedForUserTree,vr as isSelfWrite,jr as isSkillInstallReportEnvOptOut,Ji as isSystemDoc,Di as isToleranceTelemetryEnabled,Kr as isValidLockPid,zr as lastKnownHash,Hn as listRescueCheckpoints,Ra as listStarterPacks,co as loadCustomAgents,rr as loadPrincipal,eo as lockAdvertisesUi,Lt as lockBaseUrl,j as lockFilePath,io as loggerFactory,Ka as loginShapedUserinfoUser,Vt as logsCurrentPath,F as logsPreviousPath,Gt as machineIdFilePath,K as makeLazyEmbeddingsKeyStore,z as markServerLockDraining,ut as missingOkConfigMessage,pi as mountMcpAndApi,_ as normalizeFsPath,oi as observeReadiness,Xe as packageVersionMajorMinor,rt as parseAuthRejectionWire,_t as parseGitVersion,$ as parseHocuspocusAuthToken,xe as parseKeepaliveConnectionId,Ue as parseProcessStartToken,At as pathToDocName,_o as planSeed,w as prepareProjectLogsDir,sn as prepareSingleFileOpen,me as prepareSpawnProjectLogsDir,$t as processCommand,mn as processStartToken,oe as processUsage,Fe as readAgentBrowserTools,na as readAllTargets,Oe as readBootStartedAtMs,kn as readBundleDecision,Sn as readDeclaredGitHubHosts,In as readOriginCredentialHost,wt as readOriginGitHubRepo,d as readOwnNativeRules,Cr as readProcessLock,Ca as readProcessLockDetailed,Ni as readProcessStart,la as readProcessState,Qr as readProjectHeadState,Yn as readProjectLocalSemanticConfig,Bi as readServerLock,ga as readServerPackageVersion,ur as readSkillInstallStateSnapshot,yi as readStateManifest,Aa as readTargetRecordedAt,_r as readTargetVersion,Ar as reconcile,qi as recordContributor,Ei as recordSkillInstallEvent,Gr as recordsLockOwner,Rr as redactShareSubprocessStderr,Vn as registerAllTools,La as registerNativeProcessStartReader,so as registerWrite,nr as releaseProcessLock,$a as releaseServerLock,It as removeLastKnownHash,A as removeLockIfUnchanged,Ga as removeProjectSkillGitignoreBlock,Wt as reportSkillInstall,G as resetMetrics,R as resolveAuditScope,lt as resolveBuiltinSkillHosts,a as resolveBundleEnabled,fi as resolveBundledSkillDir,g as resolveContentDir,ai as resolveCursorBinaryDefault,Ye as resolveCursorSpawnInvocation,nt as resolveEffectiveLinterConfig,gt as resolveEmbeddingsCredential,Q as resolveGitHubAccountFromUrl,be as resolveGitHubAuthHost,He as resolveLockDir,kt as resolveNativeConfigForDoc,go as resolveNativeMarkdownlintConfig,C as resolvePack,on as resolvePackageVersion,pe as resolveSkillInstallReportSettings,Qt as resolveUiInfo,pn as restoreContributors,ae as rewriteMarkdownLinksForDocumentRename,Pe as rewriteWikiLinksForDocumentRename,ta as runAuthReposSubprocess,De as runAuthStatusSubprocess,On as runCloneSubprocess,xn as runDeviceFlowSubprocess,Fn as runWithMcpLogger,Ct as safeContentPath,u as safeSubdir,Er as safetyCheckpoint,Ea as sameGitHubLogin,Ii as sanitizeClientName,fa as saveInMemoryCheckpoint,ti as saveVersion,Qn as scanLockProcesses,Ui as seedBasenameIndex,ya as seedEphemeralProjectDir,pr as serializeError,Si as setActiveSpanAttributes,Na as setupServerObservers,br as shadowGit,Nr as shutdownTelemetry,Xa as spansCurrentPath,Yt as spansPreviousPath,Xi as spawnDetached,ki as splitMarkdownBlocks,Jr as startWatcher,Vr as strategiesFor,Wn as streamedChunkOf,Ba as streamingProblemEvent,uo as swapContributors,ar as teardownToleranceTelemetryWriter,no as toBroadcasterKey,zt as toProcessLockMetadata,N as tracedAppendFileSync,Ja as tracedLinkSync,qt as tracedMkdir,J as tracedMkdirSync,V as tracedRename,ft as tracedRenameSync,hi as tracedRmSync,y as tracedRmdirSync,ci as tracedUnlinkSync,Qe as tracedWriteFile,at as tracedWriteFileSync,yt as trustSystemCertificates,te as updateLastKnownHash,Ce as updateProcessLockPort,Ge as updateServerLockPort,Mt as validateAgentId,yo as validateCloneInputs,E as validateSkillZip,ln as waitForServerLockDrain,ge as withHiddenWindowsConsole,tn as withSpan,gn as withSpanSync,ce as writeBundleDecision,Le as writeMarkdownlintRule,ia as writeRootGitignoreForNewRepo,Ae as writeStateManifest,jn as writeTargetVersion,wn as writeTracker};
1
+ import{Cc as e,Et as t,Ot as n,Pc as r,S as i,X as a,_c as o,no as s,v as c}from"./md-manager-BGnqyqi1-CmUAdK_J.mjs";import{$ as l,$a as u,$i as d,$n as f,$r as p,$t as m,A as h,Aa as g,Ai as _,An as v,Ao as y,Ar as b,At as x,B as S,Ba as C,Bi as w,Bn as T,Bo as E,Br as D,Bt as O,C as k,Ca as A,Ci as j,Cn as M,Co as N,Cr as P,Cs as F,Ct as I,D as L,Da as R,Di as z,Dn as B,Do as V,Dr as H,Dt as U,E as W,Ea as G,Ei as K,En as q,Eo as J,Er as Y,Et as X,F as Z,Fa as Q,Fi as $,Fn as ee,Fo as te,Fr as ne,Ft as re,G as ie,Ga as ae,Gi as oe,Gn as se,Go as ce,Gr as le,Gs as ue,Gt as de,H as fe,Ha as pe,Hi as me,Hn as he,Ho as ge,Hr as _e,Ht as ve,I as ye,Ia as be,Ii as xe,In as Se,Io as Ce,Ir as we,It as Te,J as Ee,Ja as De,Ji as Oe,Jn as ke,Jo as Ae,Jr as je,Jt as Me,K as Ne,Ka as Pe,Ki as Fe,Kn as Ie,Ko as Le,Kr as Re,Ks as ze,Kt as Be,L as Ve,La as He,Li as Ue,Ln as We,Lo as Ge,Lr as Ke,Lt as qe,M as Je,Ma as Ye,Mi as Xe,Mn as Ze,Mo as Qe,Mr as $e,Mt as et,N as tt,Na as nt,Ni as rt,Nn as it,No as at,Nr as ot,Nt as st,O as ct,Oa as lt,Oi as ut,On as dt,Oo as ft,Or as pt,Ot as mt,P as ht,Pa as gt,Pi as _t,Pn as vt,Po as yt,Pr as bt,Pt as xt,Q as St,Qa as Ct,Qi as wt,Qn as Tt,Qr as Et,Qt as Dt,R as Ot,Ra as kt,Ri as At,Rn as jt,Ro as Mt,Rr as Nt,Rt as Pt,S as Ft,Sa as It,Si as Lt,Sn as Rt,So as zt,Sr as Bt,Ss as Vt,St as Ht,T as Ut,Ta as Wt,Ti as Gt,Tn as Kt,To as qt,Tr as Jt,Ts as Yt,Tt as Xt,U as Zt,Ua as Qt,Ui as $t,Un as en,Uo as tn,Ur as nn,Ut as rn,V as an,Va as on,Vi as sn,Vn as cn,Vo as ln,Vr as un,Vt as dn,W as fn,Wa as pn,Wi as mn,Wn as hn,Wo as gn,Wr as _n,Ws as vn,Wt as yn,X as bn,Xa as xn,Xi as Sn,Xn as Cn,Xo as wn,Xr as Tn,Xt as En,Y as Dn,Ya as On,Yi as kn,Yn as An,Yo as jn,Yr as Mn,Yt as Nn,Z as Pn,Za as Fn,Zi as In,Zn as Ln,Zr as Rn,Zt as zn,_ as Bn,_a as Vn,_i as Hn,_n as Un,_o as Wn,_r as Gn,_s as Kn,_t as qn,a as Jn,aa as Yn,ai as Xn,an as Zn,ao as Qn,ar as $n,at as er,b as tr,ba as nr,bi as rr,bn as ir,bo as ar,br as or,bs as sr,bt as cr,c as lr,ca as ur,ci as dr,cn as fr,co as pr,cr as mr,ct as hr,d as gr,da as _r,di as vr,dn as yr,do as br,dr as xr,dt as Sr,ea as Cr,ei as wr,en as Tr,eo as Er,er as Dr,et as Or,f as kr,fa as Ar,fi as jr,fn as Mr,fo as Nr,fr as Pr,fs as Fr,ft as Ir,g as Lr,ga as Rr,gi as zr,gn as Br,go as Vr,gr as Hr,gt as Ur,h as Wr,ha as Gr,hi as Kr,hn as qr,ho as Jr,hr as Yr,ht as Xr,i as Zr,ia as Qr,ii as $r,in as ei,io as ti,ir as ni,it as ri,j as ii,ja as ai,ji as oi,jn as si,jo as ci,jr as li,jt as ui,k as di,ka as fi,ki as pi,kn as mi,ko as hi,kr as gi,kt as _i,l as vi,la as yi,li as bi,ln as xi,lo as Si,lr as Ci,lt as wi,m as Ti,ma as Ei,mi as Di,mn as Oi,mo as ki,mr as Ai,mt as ji,n as Mi,na as Ni,ni as Pi,nn as Fi,no as Ii,nr as Li,nt as Ri,o as zi,oa as Bi,oi as Vi,on as Hi,oo as Ui,or as Wi,ot as Gi,p as Ki,pa as qi,pi as Ji,pn as Yi,po as Xi,pr as Zi,ps as Qi,pt as $i,q as ea,qa as ta,qi as na,qn as ra,qo as ia,qr as aa,qs as oa,qt as sa,r as ca,ra as la,ri as ua,rn as da,ro as fa,rr as pa,rt as ma,s as ha,sa as ga,si as _a,sn as va,so as ya,sr as ba,st as xa,t as Sa,ta as Ca,ti as wa,tn as Ta,to as Ea,tr as Da,tt as Oa,u as ka,ua as Aa,ui as ja,un as Ma,uo as Na,ur as Pa,ut as Fa,v as Ia,va as La,vi as Ra,vn as za,vo as Ba,vr as Va,vs as Ha,vt as Ua,w as Wa,wa as Ga,wi as Ka,wn as qa,wo as Ja,wr as Ya,ws as Xa,wt as Za,x as Qa,xa as $a,xi as eo,xn as to,xo as no,xr as ro,xs as io,xt as ao,y as oo,ya as so,yi as co,yn as lo,yo as uo,yr as fo,ys as po,yt as mo,z as ho,za as go,zi as _o,zn as vo,zo as yo,zr as bo,zt as xo}from"./dist-CIYAWEYF.mjs";import{f as So,h as Co,m as wo,n as To,p as Eo,t as Do}from"./fs-find-project-root-pgJRBsWv.mjs";export{Sa as AGENT_ID_MAX_LEN,Mi as AGENT_ID_RE,ca as AGENT_WRITE_ORIGIN,s as AUDIT_EMPTY_SCOPE_WARNING,Zr as AcpPermissionStore,Jn as AcpRegistry,zi as AcpThreadManager,ha as AgentFocusBroadcaster,lr as AgentPresenceBroadcaster,vi as AgentSessionCapacityError,ka as AgentSessionManager,gr as AutoStartDisabledError,kr as BUNDLE_IDS,Ki as BUNDLE_SCOPE,Ti as BUNDLE_SKILL_NAME,Wr as BacklinkIndex,Lr as CC1Broadcaster,e as CC1_CONTRACT_VERSION,Bn as CONCURRENT_REPLACE_WINDOW_MS,Ia as CONFIG_FILENAME,oo as CONFLICT_MARKER_RE,tr as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Qa as ConfigSchema,Ft as ConflictAuthority,k as DEFAULT_CHECKPOINT_RETENTION,Wa as DEFAULT_EMBEDDINGS_DIMENSIONS,Ut as DEFAULT_PACK_ID,W as DocumentDurabilityState,L as DocumentDurabilityStateError,ct as EMBEDDINGS_API_KEY_ENV,di as EPHEMERAL_PROJECT_DIR_PREFIX,h as EmbeddingsSecretStoreError,ii as ExposureConsentError,Je as FEATURED_AGENT_IDS,tt as FILE_SYSTEM_WRITER,ht as FILE_WATCHER_ORIGIN,Z as FileEmbeddingsBackend,ye as FilesystemRootProjectError,Ve as GIT_PREFLIGHT_FAIL_SPAN_NAME,Ot as GIT_UPSTREAM_WRITER,Fr as GitDirAccessError,ho as GitNotAvailableError,S as GitProbeTimeoutError,an as GitTooOldError,fe as HOCUSPOCUS_AUTH_REJECTION_REASONS,Zt as HocuspocusAuthRejection,fn as HocuspocusAuthTokenSchema,ie as HomeProjectRootError,Ne as INSTALLED_AGENTS_SCHEMES,ea as JSON_SCHEMA_DIALECT_2020_12,ze as LINEAGE_EPOCH_KEY,Ee as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Dn as LOCK_FILE_ACCESS_REMEDY,bn as MANAGED_RENAME_ORIGIN,Pn as MAX_ACP_THREADS,St as MAX_AGENT_SESSIONS,l as MCP_CONNECTION_ID_HEADER,o as MCP_SERVER_NAME,Or as MIN_EVICTABLE_IDLE_MS,Oa as MIN_GIT_VERSION,Qi as MalformedGitPointerError,Ri as McpLogger,ma as MissingOkConfigError,ri as OBSERVER_SYNC_ORIGIN,er as OK_OKIGNORE_TEMPLATE,Gi as ONBOARDING_BUNDLE_IDS,vn as ORPHAN_MODES,oa as PROTOCOL_VERSION,Kn as PinoLogger,xa as ProcessLockCollisionError,hr as ProcessLockFileError,wi as ProjectGitInitError,Fa as ROLLBACK_ORIGIN,Sr as ROOT_GITIGNORE_TEMPLATE,Ir as RUNTIME_VERSION,$i as SERVICE_WRITER,ji as SKILL_INSTALL_EVENTS_FILENAME,c as SKILL_STATE_TARGETS,Xr as STARTER_FOLDER_FRONTMATTER_FILENAME,Ur as STARTER_PACKS,qn as STARTER_PACK_IDS,Ua as STATE_MANIFEST_FILENAME,mo as STATE_SCHEMA_VERSION,cr as SYMLINK_MERGE_MIN_GIT_LABEL,ao as SYMLINK_MERGE_MIN_GIT_VERSION,r as SYSTEM_DOC_NAME,Ht as SeedPrerequisiteError,I as SeedRootDirError,Za as ServerAuthorityCollisionError,Xt as ServerAuthorityRegistryError,X as ServerLockCollisionError,U as SingleFileNotAFileError,mt as SingleFileNotFoundError,_i as SingleFileNotMarkdownError,x as SingleFileProjectOverrideError,ui as StateManifestError,i as TEST_LOOP_CORE_MARKER,et as TEST_LOOP_SERVER_MARKER,st as TagIndex,xt as USER_GLOBAL_BUNDLE_IDS,re as UnsafeIncomingSymlinkError,Te as __getShowAllWalkStatsForTesting,qe as __resetShowAllWalkStatsForTesting,Pt as acpThreadStoreRoots,xo as acpThreadsDir,O as acquireProcessLock,dn as acquireServerLock,ve as applyAgentMarkdownWrite,rn as applyExternalChange,yn as applySeed,de as assertCheckoutSymlinksSafe,Be as assertCompatibleStateManifest,sa as assertGitAvailable,Me as assertIncomingSymlinksSafe,Nn as assertMergeNameResolvesTo,En as assertNeverDiskEvent,zn as assertRepoCheckoutSymlinksSafe,Dt as assertSafeProjectRoot,m as assessLockHolder,Tr as attachAcpThreadSocket,Ta as attachCollabClientCounter,Fi as attachIdleShutdown,da as auditScopeNotFoundTitle,ei as bindConflictAuthority,Zn as bootServer,Hi as buildAndOpenSkill,va as buildConfigYmlContent,fr as buildExecResult,xi as buildIngressPolicy,Ma as buildOkMcpStdioCommand,yr as buildSkillZip,Mr as buildStarterFolderFrontmatterYaml,Yi as buildWipTree,Oi as bundleSkillMdPath,qr as canonicalProjectKey,Br as canonicalizeForCompare,Un as classifyEvents,za as classifyFsPath,lo as classifyLockHolder,ir as clearAllEmbeddingsKeys,to as coercePackId,Rt as collectServerHostSnapshot,t as colorFromSeed,M as commitUpstreamImport,qa as commitWip,Kt as commitWipFromTree,q as compareSemver,B as composeEffectiveLinterConfig,dt as composeFrontmatterSchemasConfig,mi as containsConflictMarkers,v as contentHash,si as contributorCount,Ze as countShadowObjects,it as countStaleAgentWipRefs,vt as countWipRefs,ee as createApiExtension,Se as createAssetServeMiddleware,We as createCollaborationHost,jt as createContentFilter,vo as createContentFilterAsync,T as createEmbeddingsSecretStore,cn as createEphemeralProjectDir,he as createExternalChangeHandler,So as createFileLogger,en as createLiveDerivedIndexExtension,hn as createMcpHttpHandler,se as createOsProbe,Ie as createPersistenceExtension,ra as createProbeFailureReporter,ke as createServer,An as createServerObserverExtension,Cn as createServerProbeResolver,Ln as createStreamingErrorWriter,Ha as createTestLogger,Tt as describeStoredEmbeddingsKey,f as detectClaudeDesktopPresence,Dr as detectGit,Da as detectProjectShape,Li as detectUserSkillHosts,pa as discoverLockDirs,ni as discoverMarkdownlintConfig,$n as emitPreflightFailureSpan,Wi as encodeDocName,ba as encodeFolderRoute,mr as encodeSkillRoute,Ci as ensureProjectGit,Pa as errorResponse,xr as evictStaleTrackerEntries,Pr as extractHeadings,Zi as extractOkBinaryPath,Ai as extractWikiLinksFromMarkdown,Yr as fallbackPaths,Hr as findEnclosingGitRoot,Do as findEnclosingProjectRoot,Gn as findNativeMarkdownlintFile,Eo as flushFileLogger,Va as formatAuditBrokenLinkSuppressionLine,fo as formatAuthRejectionWire,or as formatContributorsFrom,ro as formatPackRationale,Bt as gcCheckpointRefs,P as getCurrentMcpLogger,Ya as getIngressContext,Jt as getLocalDir,wo as getLogFilePath,po as getLogger,Co as getLogsDir,Y as getMachineId,H as getMeter,pt as getMetrics,gi as getTracer,b as handleCollabSocketError,li as handleSpawnCursor,$e as hasForwardingHeaders,ot as hasGcLogLatch,n as iconFromClientName,bt as incrementCollabSocketFilteredError,ne as incrementServerObserverFire,we as initContent,Ke as initShadowRepo,Nt as initTelemetry,bo as initToleranceTelemetryWriter,D as installJsonSchemaDialect,un as installPrettyZodErrors,sr as installTestLoggers,_e as installUserSkill,nn as isAllowedApiOrigin,_n as isAllowedWorkspaceHostHeader,le as isConfigDoc,Re as isDefunctProcess,aa as isDocInConflict,je as isFilesystemRoot,Mn as isHocuspocusAuthRejectionReason,Tn as isHomeDir,Rn as isHostAdmitted,Et as isKnownPackId,p as isLinkIndexExcludedDoc,wr as isLockFromThisMachine,wa as isLockProcessRunning,Pi as isLoopbackAddress,ua as isManagedArtifactDoc,$r as isMintedThreadId,Xn as isOriginAdmitted,ue as isOrphanMode,Vi as isPairedWriteOrigin,_a as isPathWithinDir,dr as isPeerAdmitted,bi as isProcessAlive,To as isProjectRoot,ja as isReservedForUserTree,vr as isSelfWrite,jr as isSkillInstallReportEnvOptOut,Ji as isSystemDoc,Di as isToleranceTelemetryEnabled,Kr as isValidLockPid,zr as lastKnownHash,Hn as listRescueCheckpoints,Ra as listStarterPacks,co as loadCustomAgents,rr as loadPrincipal,eo as lockAdvertisesUi,Lt as lockBaseUrl,j as lockFilePath,io as loggerFactory,Ka as loginShapedUserinfoUser,Vt as logsCurrentPath,F as logsPreviousPath,Gt as machineIdFilePath,K as makeLazyEmbeddingsKeyStore,z as markServerLockDraining,ut as missingOkConfigMessage,pi as mountMcpAndApi,_ as normalizeFsPath,oi as observeReadiness,Xe as packageVersionMajorMinor,rt as parseAuthRejectionWire,_t as parseGitVersion,$ as parseHocuspocusAuthToken,xe as parseKeepaliveConnectionId,Ue as parseProcessStartToken,At as pathToDocName,_o as planSeed,w as prepareProjectLogsDir,sn as prepareSingleFileOpen,me as prepareSpawnProjectLogsDir,$t as processCommand,mn as processStartToken,oe as processUsage,Fe as readAgentBrowserTools,na as readAllTargets,Oe as readBootStartedAtMs,kn as readBundleDecision,Sn as readDeclaredGitHubHosts,In as readOriginCredentialHost,wt as readOriginGitHubRepo,d as readOwnNativeRules,Cr as readProcessLock,Ca as readProcessLockDetailed,Ni as readProcessStart,la as readProcessState,Qr as readProjectHeadState,Yn as readProjectLocalSemanticConfig,Bi as readServerLock,ga as readServerPackageVersion,ur as readSkillInstallStateSnapshot,yi as readStateManifest,Aa as readTargetRecordedAt,_r as readTargetVersion,Ar as reconcile,qi as recordContributor,Ei as recordSkillInstallEvent,Gr as recordsLockOwner,Rr as redactShareSubprocessStderr,Vn as registerAllTools,La as registerNativeProcessStartReader,so as registerWrite,nr as releaseProcessLock,$a as releaseServerLock,It as removeLastKnownHash,A as removeLockIfUnchanged,Ga as removeProjectSkillGitignoreBlock,Wt as reportSkillInstall,G as resetMetrics,R as resolveAuditScope,lt as resolveBuiltinSkillHosts,a as resolveBundleEnabled,fi as resolveBundledSkillDir,g as resolveContentDir,ai as resolveCursorBinaryDefault,Ye as resolveCursorSpawnInvocation,nt as resolveEffectiveLinterConfig,gt as resolveEmbeddingsCredential,Q as resolveGitHubAccountFromUrl,be as resolveGitHubAuthHost,He as resolveLockDir,kt as resolveNativeConfigForDoc,go as resolveNativeMarkdownlintConfig,C as resolvePack,on as resolvePackageVersion,pe as resolveSkillInstallReportSettings,Qt as resolveUiInfo,pn as restoreContributors,ae as rewriteMarkdownLinksForDocumentRename,Pe as rewriteWikiLinksForDocumentRename,ta as runAuthReposSubprocess,De as runAuthStatusSubprocess,On as runCloneSubprocess,xn as runDeviceFlowSubprocess,Fn as runWithMcpLogger,Ct as safeContentPath,u as safeSubdir,Er as safetyCheckpoint,Ea as sameGitHubLogin,Ii as sanitizeClientName,fa as saveInMemoryCheckpoint,ti as saveVersion,Qn as scanLockProcesses,Ui as seedBasenameIndex,ya as seedEphemeralProjectDir,pr as serializeError,Si as setActiveSpanAttributes,Na as setupServerObservers,br as shadowGit,Nr as shutdownTelemetry,Xa as spansCurrentPath,Yt as spansPreviousPath,Xi as spawnDetached,ki as splitMarkdownBlocks,Jr as startWatcher,Vr as strategiesFor,Wn as streamedChunkOf,Ba as streamingProblemEvent,uo as swapContributors,ar as teardownToleranceTelemetryWriter,no as toBroadcasterKey,zt as toProcessLockMetadata,N as tracedAppendFileSync,Ja as tracedLinkSync,qt as tracedMkdir,J as tracedMkdirSync,V as tracedRename,ft as tracedRenameSync,hi as tracedRmSync,y as tracedRmdirSync,ci as tracedUnlinkSync,Qe as tracedWriteFile,at as tracedWriteFileSync,yt as trustSystemCertificates,te as updateLastKnownHash,Ce as updateProcessLockPort,Ge as updateServerLockPort,Mt as validateAgentId,yo as validateCloneInputs,E as validateSkillZip,ln as waitForServerLockDrain,ge as withHiddenWindowsConsole,tn as withSpan,gn as withSpanSync,ce as writeBundleDecision,Le as writeMarkdownlintRule,ia as writeRootGitignoreForNewRepo,Ae as writeStateManifest,jn as writeTargetVersion,wn as writeTracker};
@@ -1,4 +1,4 @@
1
- import{a as e,k as t}from"./constants-ok-dir-DZ25OS9-.mjs";import{createRequire as n}from"node:module";import{basename as r,dirname as i,join as a,resolve as o}from"node:path";import{mkdirSync as s,readdirSync as c,renameSync as l,statSync as u,unlinkSync as d,writeFileSync as f}from"node:fs";import{homedir as p}from"node:os";import{readdir as m,rename as h,stat as g,unlink as _,writeFile as v}from"node:fs/promises";import{randomUUID as y}from"node:crypto";function b(e=p()){return a(e,t().userHomeDirName)}var x=Object.create,S=Object.defineProperty,C=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,T=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),O=(e,t)=>{let n={};for(var r in e)S(n,r,{get:e[r],enumerable:!0});return t||S(n,Symbol.toStringTag,{value:`Module`}),n},k=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=w(t),a=0,o=i.length,s;a<o;a++)s=i[a],!E.call(e,s)&&s!==n&&S(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=C(t,s))||r.enumerable});return e},A=(e,t,n)=>(n=e==null?{}:x(T(e)),k(t||!e||!e.__esModule||!E.call(e,`default`)?S(n,`default`,{value:e,enumerable:!0}):n,e)),j=n(import.meta.url),M=D(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
1
+ import{a as e,k as t}from"./constants-ok-dir-BmRrWVQT.mjs";import{createRequire as n}from"node:module";import{basename as r,dirname as i,join as a,resolve as o}from"node:path";import{mkdirSync as s,readdirSync as c,renameSync as l,statSync as u,unlinkSync as d,writeFileSync as f}from"node:fs";import{homedir as p}from"node:os";import{readdir as m,rename as h,stat as g,unlink as _,writeFile as v}from"node:fs/promises";import{randomUUID as y}from"node:crypto";function b(e=p()){return a(e,t().userHomeDirName)}var x=Object.create,S=Object.defineProperty,C=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,T=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),O=(e,t)=>{let n={};for(var r in e)S(n,r,{get:e[r],enumerable:!0});return t||S(n,Symbol.toStringTag,{value:`Module`}),n},k=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=w(t),a=0,o=i.length,s;a<o;a++)s=i[a],!E.call(e,s)&&s!==n&&S(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=C(t,s))||r.enumerable});return e},A=(e,t,n)=>(n=e==null?{}:x(T(e)),k(t||!e||!e.__esModule||!E.call(e,`default`)?S(n,`default`,{value:e,enumerable:!0}):n,e)),j=n(import.meta.url),M=D(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
2
2
  causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
3
3
  caused by: `+i(o,t)):a},a=e=>i(e,new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,new Set)}})),N=D(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),P=D(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=M(),{pinoErrProto:a,pinoErrorSymbols:o}=N(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),F=D(((e,t)=>{t.exports=s;let{isErrorLike:n}=M(),{pinoErrProto:r,pinoErrorSymbols:i}=N(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),I=D(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=Object.create({},{id:{enumerable:!0,writable:!0,value:``},method:{enumerable:!0,writable:!0,value:``},url:{enumerable:!0,writable:!0,value:``},query:{enumerable:!0,writable:!0,value:``},params:{enumerable:!0,writable:!0,value:``},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:``},remotePort:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),L=D(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),R=D(((e,t)=>{let n=P(),r=F(),i=I(),a=L();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),z=D(((e,t)=>{function n(e,t){return t}t.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=n;let t=Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let r=t.slice(2),i=[];for(let e of r)e&&i.push(e.getFileName());return i}})),ee=D(((e,t)=>{function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=n(e[r]);return t}if(typeof e==`object`){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),B=D(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),k=Symbol.for(`pino.serializers`),A=Symbol.for(`pino.formatters`),j=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:k,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:A,hooksSym:j,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D}})),V=D(((e,t)=>{let n=ee(),{redactFmtSym:r,wildcardFirstSym:i}=B(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},{}),d={[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})},f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),H=D(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),te=D(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),U=D(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))throw typeof t!=`number`&&typeof t!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),ne=D(((e,t)=>{let n=j(`fs`),r=j(`events`),i=j(`util`).inherits,a=j(`path`),o=U(),s=j(`assert`),c=Buffer.allocUnsafe(0),l=`buffer`,u=`utf8`,[d,f]=(process.versions.node||`0.0`).split(`.`).map(Number),p=d>=22&&f>=7;function m(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(n,r){if(n){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount(`error`)>0&&t.emit(`error`,n)}):t.emit(`error`,n);return}let i=t._reopening;t.fd=r,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit(`ready`)):t.emit(`ready`),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():i&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,o=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(a.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,o))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(a.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,o,r)}):n.open(e,i,o,r)}function h(e){if(!(this instanceof h))return new h(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:s,periodicFlush:d,sync:f,append:p=!0,mkdir:v,retryEAGAIN:x,fsync:k,contentMode:A,mode:j}=e||{};t||=r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=a||0,this.maxWrite=s||16384,this._periodicFlush=d||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=k||!1,this.append=p||!1,this.mode=j,this.retryEAGAIN=x||(()=>!0),this.mkdir=v||!1;let M,N;if(A===l)this._writingBuf=c,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,M=()=>n.writeSync(this.fd,this._writingBuf),N=()=>n.write(this.fd,this._writingBuf,this.release);else if(A===void 0||A===u)this._writingBuf=``,this.write=y,this.flush=S,this.flushSync=w,this._actualWrite=E,M=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),N=()=>Buffer.isBuffer(this._writingBuf)?n.write(this.fd,this._writingBuf,this.release):n.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${u}" and "${l}", but passed ${A}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)m(t,this);else throw Error(`SonicBoom supports only file descriptors and files`);if(this.minLength>=this.maxWrite)throw Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(e,t)=>{if(e){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&this.retryEAGAIN(e,this._writingBuf.length,this._len-this._writingBuf.length)){if(this.sync)try{o(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(N,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=g(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){N();return}try{do{let e=M(),t=g(this._writingBuf,this._len,e);this._len=t.len,this._writingBuf=t.writingBuf}while(this._writingBuf.length)}catch(e){this.release(e);return}}this._fsync&&n.fsyncSync(this.fd);let i=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):i>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,O(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(_,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function g(e,t,n){return typeof e==`string`&&(e=Buffer.from(e)),t=Math.max(t-n,0),e=e.subarray(n),{writingBuf:e,len:t}}function _(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(h,r);function v(e,t){return e.length===0?c:e.length===1?e[0]:Buffer.concat(e,t)}function y(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);e=``+e;let t=Buffer.byteLength(e),n=this._len+t,r=this._bufs;return this.maxLength&&n>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(r.length===0||Buffer.byteLength(r[r.length-1])+t>this.maxWrite?r.push(e):r[r.length-1]+=e,this._len=n,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function b(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);let t=this._len+e.length,n=this._bufs,r=this._lens;return this.maxLength&&t>this.maxLength?(this.emit(`drop`,e),this._len<this._hwm):(n.length===0||r[r.length-1]+e.length>this.maxWrite?(n.push([e]),r.push(e.length)):(n[n.length-1].push(e),r[r.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function x(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function S(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&x.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite())}function C(e){if(e!=null&&typeof e!=`function`)throw Error(`flush cb must be a function`);if(this.destroyed){let t=Error(`SonicBoom destroyed`);if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&x.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}h.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw Error(`Unable to reopen a file descriptor, you must pass a file to SonicBoom`);if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once(`ready`,()=>{t!==this.fd&&n.close(t,e=>{if(e)return this.emit(`error`,e)})}),m(this.file,this)},h.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():O(this)))};function w(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let e=``;for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=g(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;o(100)}}try{n.fsyncSync(this.fd)}catch{}}function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=c);let e=c;for(;this._bufs.length||e.length;){e.length<=0&&(e=v(this._bufs[0],this._lens[0]));try{let t=n.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;o(100)}}}h.prototype.destroy=function(){this.destroyed||O(this)};function E(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||``,this.sync)try{e(null,Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else n.write(this.fd,this._writingBuf,e)}function D(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:v(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else p&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function O(e){if(e.fd===-1){e.once(`ready`,O.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],s(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{n.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?n.close(e.fd,r):r()}function r(t){if(t){e.emit(`error`,t);return}e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`)}}h.SonicBoom=h,h.default=h,t.exports=h})),W=D(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),re=D(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},repository:{type:`git`,url:`git+https://github.com/mcollina/thread-stream.git`},keywords:[`worker`,`thread`,`threads`,`stream`],author:`Matteo Collina <hello@matteocollina.com>`,license:`MIT`,bugs:{url:`https://github.com/mcollina/thread-stream/issues`},homepage:`https://github.com/mcollina/thread-stream#readme`}})),ie=D(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{if(e===`ok`){a(null,`ok`);return}s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),ae=D(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),oe=D(((e,t)=>{let{version:n}=re(),{EventEmitter:r}=j(`events`),{Worker:i}=j(`worker_threads`),{join:a}=j(`path`),{pathToFileURL:o}=j(`url`),{wait:s}=ie(),{WRITE_INDEX:c,READ_INDEX:l,SEQ_INDEX:u}=ae(),d=j(`buffer`),f=j(`assert`),p=Symbol(`kImpl`),m=d.constants.MAX_STRING_LENGTH;function h(){}function g(e,t){Atomics.add(e[p].state,u,1),t(),Atomics.add(e[p].state,u,1),Atomics.notify(e[p].state,u)}function _(e){g(e,()=>{Atomics.store(e[p].state,l,0),Atomics.store(e[p].state,c,0)})}var v=class{constructor(e){this._value=e}deref(){return this._value}},y=class{register(){}unregister(){}};let b=process.env.NODE_V8_COVERAGE?y:global.FinalizationRegistry||y,x=process.env.NODE_V8_COVERAGE?v:global.WeakRef||v,S=new b(e=>{e.exited||e.terminate()});function C(e,t){let{filename:r,workerData:s}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||a(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:o(r).href,dataBuf:e[p].dataBuf,stateBuf:e[p].stateBuf,workerData:{$context:{threadStreamVersion:n},...s}}});return l.stream=new v(e),l.on(`message`,E),l.on(`exit`,D),S.register(e,l),l}function w(e){f(!e[p].sync),e[p].needDrain&&(e[p].needDrain=!1,e.emit(`drain`))}function T(e){for(;;){let t=Atomics.load(e[p].state,c),n=e[p].data.length-t;if(n>0){if(e[p].bufLen===0){e[p].flushing=!1,e[p].ending?L(e):e[p].needDrain&&process.nextTick(w,e);return}I(e,n,h);continue}if(n===0){if(t===0&&e[p].bufLen===0)return;A(e,()=>{e.destroyed||(_(e),T(e))});return}F(e,Error(`overwritten`));return}}function E(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(e?.code!=null)switch(e.code){case`READY`:this.stream=new x(t),A(t,()=>{t[p].ready=!0,t.emit(`ready`)});break;case`ERROR`:F(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){F(t,Error(`this should not happen: `+e.code));break}let n=t[p].flushCallbacks.get(e.id);n&&(t[p].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:F(t,Error(`this should not happen: `+e.code))}}function D(e){let t=this.stream.deref();t!==void 0&&(S.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,D),F(t,e===0?null:Error(`the worker thread exited`)))}var O=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[p]={},this[p].stateBuf=new SharedArrayBuffer(128),this[p].state=new Int32Array(this[p].stateBuf),this[p].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[p].data=Buffer.from(this[p].dataBuf),this[p].sync=e.sync||!1,this[p].ending=!1,this[p].ended=!1,this[p].needDrain=!1,this[p].destroyed=!1,this[p].flushing=!1,this[p].ready=!1,this[p].finished=!1,this[p].errored=null,this[p].closed=!1,this[p].buf=[],this[p].bufHead=0,this[p].bufLen=0,this[p].flushCallbacks=new Map,this[p].nextFlushId=0,this.worker=C(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[p].destroyed)return P(this,Error(`the worker has exited`)),!1;if(this[p].ending)return P(this,Error(`the worker is ending`)),!1;if(this[p].flushing&&this[p].bufLen+t.length>=m)try{R(this),this[p].flushing=!0}catch(e){return F(this,e),!1}if(this[p].buf.push(t),this[p].bufLen+=t.length,this[p].sync)try{return R(this),!0}catch(e){return F(this,e),!1}return this[p].flushing||(this[p].flushing=!0,setImmediate(T,this)),this[p].needDrain=this[p].data.length-this[p].bufLen-Atomics.load(this[p].state,c)<=0,!this[p].needDrain}end(){this[p].destroyed||(this[p].ending=!0,L(this))}flush(e){e=typeof e==`function`?e:h,k(this,t=>{if(t){process.nextTick(e,t);return}M(this,e)})}flushSync(){this[p].destroyed||(R(this),z(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[p].ready}get destroyed(){return this[p].destroyed}get closed(){return this[p].closed}get writable(){return!this[p].destroyed&&!this[p].ending}get writableEnded(){return this[p].ending}get writableFinished(){return this[p].finished}get writableNeedDrain(){return this[p].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[p].errored}};function k(e,t){if(e[p].destroyed){process.nextTick(t,Error(`the worker has exited`));return}if(!e[p].sync&&(e[p].flushing||e[p].bufLen>0)){setImmediate(k,e,t);return}A(e,t)}function A(e,t){let n=Atomics.load(e[p].state,c);s(e[p].state,l,n,1/0,(n,r)=>{if(n){F(e,n),t(n);return}if(r!==`ok`){A(e,t);return}t()})}function M(e,t){if(e[p].destroyed){process.nextTick(t,Error(`the worker has exited`));return}if(!e[p].ready){let n=()=>{i(),M(e,t)},r=()=>{i(),process.nextTick(t,Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[p].nextFlushId;e[p].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[p].flushCallbacks.delete(n),F(e,r),process.nextTick(t,r)}}function N(e,t){let n=e[p].flushCallbacks;if(n.size===0)return;let r=t||Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function P(e,t){setImmediate(()=>{e.emit(`error`,t)})}function F(e,t){e[p].destroyed||(e[p].destroyed=!0,N(e,t),t&&(e[p].errored=t,P(e,t)),e.worker.exited?setImmediate(()=>{e[p].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[p].closed=!0,e.emit(`close`)}))}function I(e,t,n){let r=Atomics.load(e[p].state,c),i=t;for(;i>0&&e[p].bufLen!==0;){let t=e[p].bufHead,n=e[p].buf[t];if(n.length<=i){n.copy(e[p].data,r),r+=n.length,i-=n.length,e[p].bufLen-=n.length,e[p].bufHead=t+1,e[p].bufHead===e[p].buf.length?(e[p].buf.length=0,e[p].bufHead=0):e[p].bufHead>=1024&&e[p].bufHead*2>=e[p].buf.length&&(e[p].buf.splice(0,e[p].bufHead),e[p].bufHead=0);continue}n.copy(e[p].data,r,0,i),e[p].buf[t]=n.subarray(i),e[p].bufLen-=i,r+=i,i=0}return g(e,()=>{Atomics.store(e[p].state,c,r)}),n(),!0}function L(e){if(!(e[p].ended||!e[p].ending||e[p].flushing)){e[p].ended=!0;try{e.flushSync();let t=Atomics.load(e[p].state,l);g(e,()=>{Atomics.store(e[p].state,c,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[p].state,l,t,1e3),t=Atomics.load(e[p].state,l),t===-2){F(e,Error(`end() failed`));return}if(++n===10){F(e,Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[p].finished=!0,e.emit(`finish`)})}catch(t){F(e,t)}}}function R(e){let t=()=>{e[p].ending?L(e):e[p].needDrain&&process.nextTick(w,e)};for(e[p].flushing=!1;e[p].bufLen!==0;){let n=Atomics.load(e[p].state,c),r=e[p].data.length-n;if(r===0){z(e),_(e);continue}if(r<0)throw Error(`overwritten`);I(e,r,t)}}function z(e){if(e[p].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[p].state,c),n=0;for(;;){let r=Atomics.load(e[p].state,l);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[p].state,l,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=O})),se=D(((e,t)=>{let{createRequire:n}=j(`module`),{existsSync:r}=j(`node:fs`),i=z(),{join:a,isAbsolute:o,sep:s}=j(`node:path`),{fileURLToPath:c}=j(`node:url`),l=U(),u=W(),d=oe();function f(e){u.register(e,v),u.registerBeforeExit(e,y),e.on(`close`,function(){u.unregister(e)})}function p(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function m(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&h(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++);continue}if((i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&h(i.slice(i.indexOf(`=`)+1))){r=!0;continue}n.push(i)}return r?n.join(` `):e}function h(e){let t=g(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=c(n)}catch{return!1}return o(n)&&!r(n)}function g(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function _(e,t,n,r,i){if(!n.execArgv&&p()&&j.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=m(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let a=new d({filename:e,workerData:t,workerOpts:n,sync:r});a.on(`ready`,o),a.on(`close`,function(){process.removeListener(`exit`,s)}),process.on(`exit`,s);function o(){process.removeListener(`exit`,s),a.unref(),n.autoEnd!==!1&&f(a)}function s(){a.closed||(a.flushSync(),l(100),a.end())}return a}function v(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function y(e){e.flushSync()}function b(e){let{pipeline:t,targets:r,levels:c,dedupe:l,worker:u={},caller:d=i(),sync:f=!1}=e,p={...e.options},m=typeof d==`string`?[d]:d,h=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),g=e.target;if(g&&r)throw Error(`only one of target or targets can be specified`);r?(g=h[`pino-worker`]||a(__dirname,`worker.js`),p.targets=r.filter(e=>e.target).map(e=>({...e,target:y(e.target)})),p.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:y(t.target)})))):t&&(g=h[`pino-worker`]||a(__dirname,`worker.js`),p.pipelines=[t.map(e=>({...e,target:y(e.target)}))]),c&&(p.levels=c),l&&(p.dedupe=l),p.pinoWillSendConfig=!0;let v=r||t?`pino.transport`:g;return _(y(g),p,u,f,v);function y(e){if(e=h[e]||e,o(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return a(__dirname,`..`,`file.js`);let t;for(let r of m)try{let i=r===`node:repl`?process.cwd()+s:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=b})),G=D(((e,t)=>{let n=j(`node:diagnostics_channel`),r=te(),{mapHttpRequest:i,mapHttpResponse:a}=R(),o=ne(),s=W(),{lsCacheSym:c,chindingsSym:l,writeSym:u,serializersSym:d,formatOptsSym:f,endSym:p,stringifiersSym:m,stringifySym:h,stringifySafeSym:g,wildcardFirstSym:_,nestedKeySym:v,formattersSym:y,messageKeySym:b,errorKeySym:x,nestedKeyStrSym:S,msgPrefixSym:C}=B(),{isMainThread:w}=j(`worker_threads`),T=se(),[E]=process.versions.node.split(`.`).map(e=>Number(e)),D=n.tracingChannel(`pino_asJson`),O=E>=25?e=>JSON.stringify(e):M;function k(){}function A(e,t){if(!t)return n;return function(...r){t.call(this,r,n,e)};function n(t,...n){if(typeof t==`object`){let o=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=a(t)));let s;o===null&&n.length===0?s=[null]:(o=n.shift(),s=n),typeof this[C]==`string`&&o!=null&&(o=this[C]+o),this[u](t,r(o,s,this[f]),e)}else{let i=t===void 0?n.shift():t;typeof this[C]==`string`&&i!=null&&(i=this[C]+i),this[u](null,r(i,n,this[f]),e)}}}function M(e){let t=``,n=0,r=!1,i=255,a=e.length;if(a>100)return JSON.stringify(e);for(var o=0;o<a&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(n,o)+`\\`,n=o,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):`"`+t+`"`}function N(e,t,n,r){if(D.hasSubscribers===!1)return P.call(this,e,t,n,r);let i={instance:this,arguments};return D.traceSync(P,i,this,e,t,n,r)}function P(e,t,n,r){let i=this[h],a=this[g],o=this[m],s=this[p],u=this[l],f=this[d],C=this[y],w=this[b],T=this[x],E=this[c][n]+r;E+=u;let D;C.log&&(e=C.log(e));let k=o[_],A=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){f[t]?D=f[t](D):t===T&&f.err&&(D=f.err(D));let e=o[t]||k;switch(typeof D){case`undefined`:case`function`:continue;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D));break;case`string`:D=(e||O)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=O(t);A+=`,`+n+`:`+D}let j=``;if(t!==void 0){D=f[w]?f[w](t):t;let e=o[w]||k;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),j=`,"`+w+`":`+D;break;case`string`:D=(e||O)(D),j=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),j=`,"`+w+`":`+D}}return this[v]&&A?E+this[S]+A.slice(1)+`}`+j+s:E+A+j+s}function F(e,t){let n,r=e[l],i=e[h],a=e[g],o=e[m],s=o[_],c=e[d],u=e[y].bindings;t=u(t);for(let e in t)if(n=t[e],((e.length<5||e!==`level`&&e!==`serializers`&&e!==`formatters`&&e!==`customLevels`)&&t.hasOwnProperty(e)&&n!==void 0)===!0){if(n=c[e]?c[e](n):n,n=(o[e]||s||i)(n,a),n===void 0)continue;r+=`,"`+e+`":`+n}return r}function I(e){return e.write!==e.constructor.prototype.write}function L(e){let t=new o(e);return t.on(`error`,n),!e.sync&&w&&(s.register(t,z),t.on(`close`,function(){s.unregister(t)})),t;function n(e){if(e.code===`EPIPE`){t.write=k,t.end=k,t.flushSync=k,t.destroy=k;return}t.removeListener(`error`,n),t.emit(`error`,e)}}function z(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}function ee(e){return function(t,n,r={},i){if(typeof r==`string`)i=L({dest:r}),r={};else if(typeof i==`string`){if(r&&r.transport)throw Error(`only one of option.transport or stream can be specified`);i=L({dest:i})}else if(r instanceof o||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof o||r.transport.writable||r.transport._writableState)throw Error(`option.transport do not allow stream, please pass to option directly. e.g. pino(transport)`);if(r.transport.targets&&r.transport.targets.length&&r.formatters&&typeof r.formatters.level==`function`)throw Error(`option.transport.targets do not allow custom level formatters`);let e;r.customLevels&&(e=r.useOnlyCustomLevels?r.customLevels:Object.assign({},r.levels,r.customLevels)),i=T({caller:n,...r.transport,levels:e})}if(r=Object.assign({},e,r),r.serializers=Object.assign({},e.serializers,r.serializers),r.formatters=Object.assign({},e.formatters,r.formatters),r.prettyPrint)throw Error(`prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)`);let{enabled:a,onChild:s}=r;return a===!1&&(r.level=`silent`),s||(r.onChild=k),i||=I(process.stdout)?process.stdout:L({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function V(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[g])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function H(e,t,n){return{level:e,bindings:t,log:n}}function U(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}t.exports={noop:k,buildSafeSonicBoom:L,asChindings:F,asJson:N,genLog:A,createArgsNormalizer:ee,stringify:V,buildFormatters:H,normalizeDestFileDescriptor:U}})),K=D(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),ce=D(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=B(),{noop:l,genLog:u}=G(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=K(),p={fatal:e=>{let t=u(d.fatal,e);return function(...e){let n=this[a];if(t.call(this,...e),typeof n.flushSync==`function`)try{n.flushSync()}catch{}}},error:e=>u(d.error,e),warn:e=>u(d.warn,e),info:e=>u(d.info,e),debug:e=>u(d.debug,e),trace:e=>u(d.trace,e)},m=Object.keys(d).reduce((e,t)=>(e[d[t]]=t,e),{}),h=Object.keys(m).reduce((e,t)=>(e[t]=`{"level":`+Number(t),e),{});function g(e){let t=e[o].level,{labels:r}=e.levels,i={};for(let e in r){let n=t(r[e],Number(e));i[e]=JSON.stringify(n).slice(0,-1)}return e[n]=i,e}function _(e,t){if(t)return!1;switch(e){case`fatal`:case`error`:case`warn`:case`info`:case`debug`:case`trace`:return!0;default:return!1}}function v(e){let{labels:t,values:n}=this.levels;if(typeof e==`number`){if(t[e]===void 0)throw Error(`unknown level value`+e);e=t[e]}if(n[e]===void 0)throw Error(`unknown level `+e);let a=this[r],o=this[r]=n[e],d=this[i],f=this[c],m=this[s].logMethod;for(let e in n){if(f(n[e],o)===!1){this[e]=l;continue}this[e]=_(e,d)?p[e](m):u(n[e],m)}this.emit(`level-change`,e,o,t[a],a,this)}function y(e){let{levels:t,levelVal:n}=this;return t&&t.labels?t.labels[n]:``}function b(e){let{values:t}=this.levels,n=t[e];return n!==void 0&&this[c](n,this[r])}function x(e,t,n){return e===f.DESC?t<=n:t>=n}function S(e){return typeof e==`string`?x.bind(null,e):e}function C(e=null,t=!1){let n=e?Object.keys(e).reduce((t,n)=>(t[e[n]]=n,t),{}):null;return{labels:Object.assign(Object.create(Object.prototype,{Infinity:{value:`silent`}}),t?null:m,n),values:Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:d,e)}}function w(e,t,n){if(typeof e==`number`){if(![].concat(Object.keys(t||{}).map(e=>t[e]),n?[]:Object.keys(m).map(e=>+e),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}if(!(e in Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),n?null:d,t)))throw Error(`default level:${e} must be included in custom levels`)}function T(e,t){let{labels:n,values:r}=e;for(let e in t){if(e in r)throw Error(`levels cannot be overridden`);if(t[e]in n)throw Error(`pre-existing level values cannot be used for new levels`)}}function E(e){if(typeof e!=`function`&&!(typeof e==`string`&&Object.values(f).includes(e)))throw Error(`Levels comparison should be one of "ASC", "DESC" or "function" type`)}t.exports={initialLsCache:h,genLsCache:g,levelMethods:p,getLevel:y,setLevel:v,isLevelEnabled:b,mappings:C,assertNoLevelCollisions:T,assertDefaultLevelFound:w,genLevelComparison:S,assertLevelComparison:E}})),le=D(((e,t)=>{t.exports={version:`10.3.1`}})),ue=D(((e,t)=>{let{EventEmitter:n}=j(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:a,getLevelSym:o,chindingsSym:s,mixinSym:c,asJsonSym:l,writeSym:u,mixinMergeStrategySym:d,timeSym:f,timeSliceIndexSym:p,streamSym:m,serializersSym:h,formattersSym:g,errorKeySym:_,messageKeySym:v,useOnlyCustomLevelsSym:y,needsMetadataGsym:b,redactFmtSym:x,stringifySym:S,formatOptsSym:C,stringifiersSym:w,msgPrefixSym:T,hooksSym:E}=B(),{getLevel:D,setLevel:O,isLevelEnabled:k,mappings:A,initialLsCache:M,genLsCache:N,assertNoLevelCollisions:P}=ce(),{asChindings:F,asJson:I,buildFormatters:L,stringify:R,noop:z}=G(),{version:ee}=le(),H=V(),te={constructor:class{},child:ne,bindings:W,setBindings:re,flush:oe,isLevelEnabled:k,version:ee,get level(){return this[o]()},set level(e){this[a](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[T]},get[Symbol.toStringTag](){return`Pino`},[r]:M,[u]:ae,[l]:I,[o]:D,[a]:O};Object.setPrototypeOf(te,n.prototype),t.exports=function(){return Object.create(te)};let U=e=>e;function ne(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[h],r=this[g],i=Object.create(this);if(t==null)return i[g].bindings!==U&&(i[g]=L(r.level,U,r.log)),i[s]=F(i,e),this.onChild!==z&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[h]=Object.create(null);for(let e in n)i[h][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var o=0;o<e.length;o++){let t=e[o];i[h][t]=n[t]}for(let e in t.serializers)i[h][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var c=0;c<r.length;c++){let e=r[c];i[h][e]=t.serializers[e]}}else i[h]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[g]=L(e||r.level,n||U,a||r.log)}else i[g]=L(r.level,U,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(P(this.levels,t.customLevels),i.levels=A(t.customLevels,i[y]),N(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=H(i.redact,R),n={stringify:e[x]};i[S]=R,i[w]=e,i[C]=n}if(typeof t.msgPrefix==`string`&&(i[T]=(this[T]||``)+t.msgPrefix),i[s]=F(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[a](e)}return this.onChild(i),i}function W(){let e=`{${this[s].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function re(e){let t=F(this,e);this[s]=t}function ie(e,t){return Object.assign(t,e)}function ae(e,t,n){let r=this[f](),i=this[c],a=this[_],o=this[v],s=this[d]||ie,u,h=this[E].streamWrite;e==null?u={}:e instanceof Error?(u={[a]:e},t===void 0&&(t=e.message)):(u=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(u=s(u,i(u,n,this)));let g=this[l](u,t,n,r),y=this[m];y[b]===!0&&(y.lastLevel=n,y.lastObj=u,y.lastMsg=t,y.lastTime=r.slice(this[p]),y.lastLogger=this),y.write(h?h(g):g)}function oe(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[m];typeof t.flush==`function`?t.flush(e||z):e&&e()}})),de=D(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0||t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0||r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}})),q=D(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=K(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[e]=t.levels[e]});let u={write:d,add:m,remove:h,emit:f,flushSync:p,end:g,minLevel:0,lastId:0,streams:[],clone:_,[n]:!0,streamLevels:a};return Array.isArray(e)?e.forEach(m,u):m.call(u,e),e=null,u;function d(e){let r,i=this.lastLevel,{streams:a}=this,o=0,u;for(let d=s(a.length,t.dedupe);l(d,a.length,t.dedupe);d=c(d,t.dedupe))if(r=a[d],r.level<=i){if(o!==0&&o!==r.level)break;if(u=r.stream,u[n]){let{lastTime:e,lastMsg:t,lastObj:n,lastLogger:r}=this;u.lastLevel=i,u.lastTime=e,u.lastMsg=t,u.lastObj=n,u.lastLogger=r}u.write(e),t.dedupe&&(o=r.level)}else if(!t.dedupe)break}function f(...e){for(let{stream:t}of this.streams)typeof t.emit==`function`&&t.emit(...e)}function p(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync()}function m(e){if(!e)return u;let t=typeof e.write==`function`||e.stream,n=e.write?e:e.stream;if(!t)throw Error(`stream object needs to implement either StreamEntry or DestinationStream interface`);let{streams:r,streamLevels:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[e.level]:typeof e.level==`number`?e.level:i;let c={stream:n,level:s,levelVal:void 0,id:++u.lastId};return r.unshift(c),r.sort(o),this.minLevel=r[0].level,u}function h(e){let{streams:t}=this,n=t.findIndex(t=>t.id===e);return n>=0&&(t.splice(n,1),t.sort(o),this.minLevel=t.length>0?t[0].level:-1),u}function g(){for(let{stream:e}of this.streams)typeof e.flushSync==`function`&&e.flushSync(),e.end()}function _(e){let t=Array(this.streams.length);for(let n=0;n<t.length;n++)t[n]={level:e,stream:this.streams[n].stream};return{write:d,add:m,remove:h,minLevel:e,streams:t,clone:_,emit:f,flushSync:p,[n]:!0}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),fe=D(((e,t)=>{let n=j(`node:os`),r=R(),i=z(),a=V(),o=H(),s=ue(),c=B(),{configure:l}=de(),{assertDefaultLevelFound:u,mappings:d,genLsCache:f,genLevelComparison:p,assertLevelComparison:m}=ce(),{DEFAULT_LEVELS:h,SORTING_ORDER:g}=K(),{createArgsNormalizer:_,asChindings:v,buildSafeSonicBoom:y,buildFormatters:b,stringify:x,normalizeDestFileDescriptor:S,noop:C}=G(),{version:w}=le(),{chindingsSym:T,redactFmtSym:E,serializersSym:D,timeSym:O,timeSliceIndexSym:k,streamSym:A,stringifySym:M,stringifySafeSym:N,stringifiersSym:P,setLevelSym:F,endSym:I,formatOptsSym:L,messageKeySym:ee,errorKeySym:te,nestedKeySym:U,mixinSym:ne,levelCompSym:W,useOnlyCustomLevelsSym:re,formattersSym:ie,hooksSym:ae,nestedKeyStrSym:oe,mixinMergeStrategySym:fe,msgPrefixSym:J}=c,{epochTime:Y,nullTime:pe}=o,{pid:X}=process,me=n.hostname(),Z=r.err,he=_({level:`info`,levelComparison:g.ASC,levels:h,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:X,hostname:me},serializers:Object.assign(Object.create(null),{err:Z}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Y,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),Q=Object.assign(Object.create(null),r);function ge(...e){let t={},{opts:n,stream:r}=he(t,i(),...e);n.level&&typeof n.level==`string`&&h[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:o,crlf:c,serializers:g,timestamp:_,messageKey:y,errorKey:S,nestedKey:w,base:j,name:R,level:z,customLevels:B,levelComparison:V,mixin:H,mixinMergeStrategy:se,useOnlyCustomLevels:G,formatters:K,hooks:ce,depthLimit:le,edgeLimit:ue,onChild:de,msgPrefix:q}=n,X=l({maximumDepth:le,maximumBreadth:ue}),me=b(K.level,K.bindings,K.log),Z=x.bind({[N]:X}),Q=o?a(o,Z):{},ge=o?{stringify:Q[E]}:{stringify:Z},_e=`}`+(c?`\r
4
4
  `:`
@@ -1,2 +1,2 @@
1
- import{_ as e}from"./constants-ok-dir-DZ25OS9-.mjs";async function t({getTokenStore:e,log:t}){try{let r,i=await e({onKeychainRead:e=>{r=e},onBackendSelected:e=>{e.backend===`file`&&e.reason&&t?.warn({backend:`file`,reason:e.reason},`[auth] token storage fallback`)}});return await n(process.stdin,process.stdout,i,{log:t,getDiag:()=>r})}catch(e){return t?.error({err:e},`[auth] git-credential get: unexpected error`),1}}async function n(t,n,a,o){let s=r(await i(t)),c=s.host??``,l=e=>e.replace(/[\r\n]/g,``);if(!c)return o?.log?.warn({outcome:`no-host`,backend:a.backend},`[auth] git-credential get`),1;if(s.protocol!==void 0&&s.protocol!==`https`)return o?.log?.warn({host:c,protocol:s.protocol,outcome:`insecure-protocol`,backend:a.backend},`[auth] git-credential get`),1;let u=e(c,s.protocol),d=process.env.OK_GH_TOKEN,f=process.env.OK_GH_TOKEN_HOST;if(d&&f&&e(f)===u)return o?.log?.debug({host:c,outcome:`gh-env-token`,backend:a.backend,relayLogin:process.env.OK_GH_TOKEN_LOGIN},`[auth] git-credential get`),n.write(`username=x-access-token\npassword=${l(d)}\n`),0;let p=await a.get(u)??(u===c?null:await a.get(c)),m=o?.getDiag?.(),h=p==null?m?.kind??`absent`:`found`;if(o?.log){let e={host:c,outcome:h,backend:a.backend,...m?.error?{keychainError:m.error}:{}};h===`found`?o.log.debug(e,`[auth] git-credential get`):o.log.warn(e,`[auth] git-credential get`)}return p==null?1:(n.write(`username=${l(p.login)}\npassword=${l(p.token)}\n`),0)}function r(e){let t={};for(let n of e.split(`
1
+ import{_ as e}from"./constants-ok-dir-BmRrWVQT.mjs";async function t({getTokenStore:e,log:t}){try{let r,i=await e({onKeychainRead:e=>{r=e},onBackendSelected:e=>{e.backend===`file`&&e.reason&&t?.warn({backend:`file`,reason:e.reason},`[auth] token storage fallback`)}});return await n(process.stdin,process.stdout,i,{log:t,getDiag:()=>r})}catch(e){return t?.error({err:e},`[auth] git-credential get: unexpected error`),1}}async function n(t,n,a,o){let s=r(await i(t)),c=s.host??``,l=e=>e.replace(/[\r\n]/g,``);if(!c)return o?.log?.warn({outcome:`no-host`,backend:a.backend},`[auth] git-credential get`),1;if(s.protocol!==void 0&&s.protocol!==`https`)return o?.log?.warn({host:c,protocol:s.protocol,outcome:`insecure-protocol`,backend:a.backend},`[auth] git-credential get`),1;let u=e(c,s.protocol),d=process.env.OK_GH_TOKEN,f=process.env.OK_GH_TOKEN_HOST;if(d&&f&&e(f)===u)return o?.log?.debug({host:c,outcome:`gh-env-token`,backend:a.backend,relayLogin:process.env.OK_GH_TOKEN_LOGIN},`[auth] git-credential get`),n.write(`username=x-access-token\npassword=${l(d)}\n`),0;let p=await a.get(u)??(u===c?null:await a.get(c)),m=o?.getDiag?.(),h=p==null?m?.kind??`absent`:`found`;if(o?.log){let e={host:c,outcome:h,backend:a.backend,...m?.error?{keychainError:m.error}:{}};h===`found`?o.log.debug(e,`[auth] git-credential get`):o.log.warn(e,`[auth] git-credential get`)}return p==null?1:(n.write(`username=${l(p.login)}\npassword=${l(p.token)}\n`),0)}function r(e){let t={};for(let n of e.split(`
2
2
  `)){let e=n.trim();if(e===``)continue;let r=e.indexOf(`=`);r!==-1&&(t[e.slice(0,r)]=e.slice(r+1))}return t}function i(e){return new Promise((t,n)=>{let r=[];e.on(`data`,e=>r.push(e)),e.on(`end`,()=>t(Buffer.concat(r).toString(`utf-8`))),e.on(`error`,n)})}export{t};
@@ -0,0 +1 @@
1
+ import{p as e}from"./fs-find-project-root-pgJRBsWv.mjs";import{r as t,s as n}from"./token-store-BMV8xJ7T.mjs";import{t as r}from"./git-credential-get-DMBGntCK.mjs";async function i(){let i=n({command:`auth`,cwd:process.cwd()}),a=await r({getTokenStore:e=>t(void 0,e),log:i});return await e(i),a}export{i as runGitCredentialGet};