@inkeep/open-knowledge 0.49.0-beta.29 → 0.49.0-beta.30

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 (126) hide show
  1. package/dist/{acp-harness-probe-DNUhLiYw.mjs → acp-harness-probe--eIjL9AH.mjs} +2 -2
  2. package/dist/cli.mjs +7 -7
  3. package/dist/constants-BwmZ_5lz.mjs +2 -0
  4. package/dist/{git-handle-r3d7s3VF.mjs → git-handle-B9WUn7B2.mjs} +2 -2
  5. package/dist/git-handle-BfyNyc1q.mjs +1 -0
  6. package/dist/index.d.mts +1 -1
  7. package/dist/index.mjs +2 -2
  8. package/dist/{init-D1zZSW1w.mjs → init-Cx0oWkD6.mjs} +3 -3
  9. package/dist/init-JfzGOZon.mjs +1 -0
  10. package/dist/{launch-json-removal-83o3EGTO.mjs → launch-json-removal-Ba9mSJ0i.mjs} +2 -2
  11. package/dist/{loader-DRfEZJJx.mjs → loader-CccmPmff.mjs} +2 -2
  12. package/dist/loader-DFYM0Jg0.mjs +1 -0
  13. package/dist/md-manager-DGG55-uN.mjs +2 -0
  14. package/dist/{open-browser-iTSXc4_G.mjs → open-browser-DbwQzgWv.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/preview-BFvi1jmt.mjs +1 -0
  17. package/dist/{preview-DynmdTIr.mjs → preview-CLJqxTUA.mjs} +2 -2
  18. package/dist/public/assets/{ActivityModeContent-BFBUhXcI.js → ActivityModeContent-1k-_29O6.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-DmgRhD8e.js → AgentDiffPane-BsJSJx8k.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-GZjGixuH.js → AgentThreadClientBinder-DyYa23FU.js} +1 -1
  21. package/dist/public/assets/{ChangedOutsideBadge-DEnLfcgW.js → ChangedOutsideBadge-UG-5qnZ7.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-9fhI0VAh.js → CodeMirrorPropInput-BOnhZTte.js} +1 -1
  23. package/dist/public/assets/{DocumentContext-nOyI-2M0.js → DocumentContext-Brk92mXi.js} +1 -1
  24. package/dist/public/assets/{EditorModeToggle-EYwVSG70.js → EditorModeToggle-B_WCSPGO.js} +1 -1
  25. package/dist/public/assets/{EnableSyncConfirmDialog-FrOsl5aY.js → EnableSyncConfirmDialog-fiXab4Hi.js} +1 -1
  26. package/dist/public/assets/FeedbackForm-CkcqJObJ.js +1 -0
  27. package/dist/public/assets/{GraphPanel-DQgAv5_k.js → GraphPanel-BkA0Xfbw.js} +1 -1
  28. package/dist/public/assets/{ImportSkillDialog-CinhDL2g.js → ImportSkillDialog-CVQDp1Ez.js} +1 -1
  29. package/dist/public/assets/{LintConfigEditor-4QoUjlwb.js → LintConfigEditor-r6UdK5re.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-CWz_KZLF.js +1 -0
  31. package/dist/public/assets/{ManagedArtifactProperties-BuTvoOYp.js → ManagedArtifactProperties-DqdA6GcC.js} +1 -1
  32. package/dist/public/assets/{McpConsentDialogBody-BhdzxOuS.js → McpConsentDialogBody-RhlGlcPk.js} +1 -1
  33. package/dist/public/assets/{MermaidDocEditor-DPGHm2Yf.js → MermaidDocEditor-D8abmvPq.js} +1 -1
  34. package/dist/public/assets/{ReportBugDialogBody-CvNxkq80.js → ReportBugDialogBody-Bb0PSa81.js} +1 -1
  35. package/dist/public/assets/{SchemaConfigEditor-BBs-2qkk.js → SchemaConfigEditor-1Ojq7_aU.js} +1 -1
  36. package/dist/public/assets/{SessionsHost-unW7heC4.js → SessionsHost-Bcka7ZAE.js} +2 -2
  37. package/dist/public/assets/{SettingsDialogBody-tqarK912.js → SettingsDialogBody-NzrQlJQV.js} +1 -1
  38. package/dist/public/assets/{ShareBranchSwitchDialog-CAU-Xs7K.js → ShareBranchSwitchDialog-FgmsGusp.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveDialog-rO_ziJDn.js → ShareReceiveDialog-dZLosf9J.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveMissDialog-CFLSBeL-.js → ShareReceiveMissDialog-B5AfklUu.js} +1 -1
  41. package/dist/public/assets/{SkillEditBanner-B1IKLW6K.js → SkillEditBanner-funTy9cp.js} +1 -1
  42. package/dist/public/assets/{SkillOriginInline-E7JFoq0I.js → SkillOriginInline-CE6c4i4l.js} +1 -1
  43. package/dist/public/assets/{SkillToolbarControls-y2FNhFQy.js → SkillToolbarControls-BjWlSp7g.js} +1 -1
  44. package/dist/public/assets/{SlidesToolbarControls-BQi6RLi_.js → SlidesToolbarControls-y3TwnqaB.js} +1 -1
  45. package/dist/public/assets/{SourceEditor-Cp6BtgMs.js → SourceEditor-DeG1k6Rs.js} +1 -1
  46. package/dist/public/assets/{TerminalPanel-BAOlww8F.js → TerminalPanel-D445dAZA.js} +1 -1
  47. package/dist/public/assets/{TerminalWindowApp-BP796BPz.js → TerminalWindowApp-Cz4doNg5.js} +1 -1
  48. package/dist/public/assets/{TextDocEditor-Cso3mcp-.js → TextDocEditor-Kk7fK1SL.js} +1 -1
  49. package/dist/public/assets/{ThreadView-DeyKw79l.js → ThreadView-Ck5UpvyQ.js} +1 -1
  50. package/dist/public/assets/{TimelineDiffPane-e_19duLF.js → TimelineDiffPane-Ch6rmVCh.js} +1 -1
  51. package/dist/public/assets/{agent-diff-store-CIXjntcw.js → agent-diff-store-B55EzhRR.js} +1 -1
  52. package/dist/public/assets/{agent-visibility-D5jwzmFA.js → agent-visibility--uXyC9KS.js} +1 -1
  53. package/dist/public/assets/{auth-state-cache-Cx_tsdYE.js → auth-state-cache-CV_cGcqw.js} +1 -1
  54. package/dist/public/assets/{client-version-CyKndMN4.js → client-version-BpRixZEq.js} +1 -1
  55. package/dist/public/assets/{comment-chips-DTSyL-J1.js → comment-chips-Djykav9w.js} +1 -1
  56. package/dist/public/assets/{config-context-Dqp-CwnJ.js → config-context-CMWmbZyv.js} +1 -1
  57. package/dist/public/assets/{config-provider-CA7jSjm6.js → config-provider-B80413xD.js} +1 -1
  58. package/dist/public/assets/{dist-CQI6-1xM2.js → dist-BuKdGB692.js} +110 -110
  59. package/dist/public/assets/{doc-paths-D1ML_anF.js → doc-paths-T83QLQIx.js} +1 -1
  60. package/dist/public/assets/{documents-events-CU1SZlDl.js → documents-events-DBv-J5VQ.js} +1 -1
  61. package/dist/public/assets/{file-tree-adapter-NC64LhE5.js → file-tree-adapter-CDHU85fT.js} +1 -1
  62. package/dist/public/assets/{file-tree-utils-CBnjZ8_a.js → file-tree-utils-Cbiz4Wc7.js} +1 -1
  63. package/dist/public/assets/{folder-config-api-9eU9a8Vx.js → folder-config-api-DQcMmUEs.js} +1 -1
  64. package/dist/public/assets/{follow-file-w7JbrzZs.js → follow-file-B6PaWJsI.js} +1 -1
  65. package/dist/public/assets/i18n-Df-BuNLK.js +1 -0
  66. package/dist/public/assets/{index-D3Eciye1.js → index-DSwPh1b9.js} +7 -7
  67. package/dist/public/assets/{lint-config-client-jktoVBJd.js → lint-config-client-B7KklQe-.js} +1 -1
  68. package/dist/public/assets/{markdownlint-rule-browser-CQrGdMTS.js → markdownlint-rule-browser-Cvgs2cjW.js} +1 -1
  69. package/dist/public/assets/{navigation-targets-D-iDEja4.js → navigation-targets-12lTMZIy.js} +1 -1
  70. package/dist/public/assets/{open-managed-artifact-tab-DZXqJ_0k.js → open-managed-artifact-tab-DfIVoXWL.js} +1 -1
  71. package/dist/public/assets/{pending-receive-nav-store-Bejjl_ZT.js → pending-receive-nav-store-BJYz-MUr.js} +1 -1
  72. package/dist/public/assets/{prop-types-DyYLLIQb.js → prop-types-DC1gRW0n.js} +1 -1
  73. package/dist/public/assets/{receive-store-Czac8zm1.js → receive-store-CJUan9z-.js} +1 -1
  74. package/dist/public/assets/{selection-context-Ct27KvHm.js → selection-context-DA_H5nWg.js} +1 -1
  75. package/dist/public/assets/{skill-actions-BryscMLS.js → skill-actions-YYrx8Tsf.js} +1 -1
  76. package/dist/public/assets/{skill-scope-78Suy4sY.js → skill-scope-BOgPGzck.js} +1 -1
  77. package/dist/public/assets/{skills-api-Dx4VSQB1.js → skills-api-lvPwT3q0.js} +1 -1
  78. package/dist/public/assets/{src-BpRmnvw-.js → src-JsIa0Xdq.js} +1 -1
  79. package/dist/public/assets/{tag-pill-input-Co95yrR6.js → tag-pill-input-Bv5lnzYG.js} +1 -1
  80. package/dist/public/assets/{target-navigation-intent-B3yXl8AI.js → target-navigation-intent-5n1nYpe3.js} +1 -1
  81. package/dist/public/assets/{terminal-launch-events-rvma4jZd.js → terminal-launch-events-D4k7Q31A.js} +1 -1
  82. package/dist/public/assets/{terminal-telemetry-DV5mcRVf.js → terminal-telemetry-Dlhg3_YU.js} +1 -1
  83. package/dist/public/assets/{typing-burst-detector-Biw0Buk7.js → typing-burst-detector-CVrd2tXF.js} +1 -1
  84. package/dist/public/assets/{uninstall-CVh8r8q2.js → uninstall-DgoYcLUW.js} +1 -1
  85. package/dist/public/assets/{use-activity-panel-Pw2Xigrl.js → use-activity-panel-D5uaqJ0Y.js} +1 -1
  86. package/dist/public/assets/{use-collab-url-CxpQAoZ0.js → use-collab-url-jPWG1pTs.js} +1 -1
  87. package/dist/public/assets/{use-live-xterm-theme-CcaaVudK.js → use-live-xterm-theme-p8PRfH3t.js} +1 -1
  88. package/dist/public/assets/{use-open-skill-DhFbugcf.js → use-open-skill-C8WGw_AK.js} +1 -1
  89. package/dist/public/assets/{use-settings-route-DMLcMwjw.js → use-settings-route-DysSmmOj.js} +1 -1
  90. package/dist/public/assets/{use-skill-directory-Bb59gISE.js → use-skill-directory-CgStTCia.js} +1 -1
  91. package/dist/public/assets/{use-skill-origin-DWkOs5ts.js → use-skill-origin-DUoPfVG-.js} +1 -1
  92. package/dist/public/assets/{use-skills-Cl0nsUBm.js → use-skills-BGHgHIoo.js} +1 -1
  93. package/dist/public/assets/{use-terminal-enabled-D05DXcuw.js → use-terminal-enabled-CkijE0r8.js} +1 -1
  94. package/dist/public/assets/{use-timeline-entry-diff-C8Tw_gvv.js → use-timeline-entry-diff-dWI7KFZJ.js} +1 -1
  95. package/dist/public/assets/{use-workspace-C2xbCdck.js → use-workspace-Cy6Mr0y4.js} +1 -1
  96. package/dist/public/index.html +44 -44
  97. package/dist/public/uninstall.html +3 -3
  98. package/dist/{repair-launch-json-Dd_YKC4a.mjs → repair-launch-json-D6NrTm1x.mjs} +2 -2
  99. package/dist/{repair-mcp-configs-B4VLRlOf.mjs → repair-mcp-configs-0KZ9L08H.mjs} +2 -2
  100. package/dist/{repair-skills-BmfcPXjd.mjs → repair-skills-BcGG4d-I.mjs} +2 -2
  101. package/dist/repair-skills-C72fFad5.mjs +1 -0
  102. package/dist/server-lock-C5RpbiEy.mjs +1 -0
  103. package/dist/{server-lock-aXnDVUI8.mjs → server-lock-DQ_whZyH.mjs} +2 -2
  104. package/dist/{skill-teardown-CjZ8Zkmo.mjs → skill-teardown-Dxmwr6sh.mjs} +2 -2
  105. package/dist/{src-DN-gWXIq.mjs → src-BJQUcb05.mjs} +2 -2
  106. package/dist/{src-B_Esv3oA.mjs → src-BRePB9-J.mjs} +1 -1
  107. package/dist/src-C5FROFj0.mjs +1 -0
  108. package/dist/{src-TKCctdpc.mjs → src-Cb3i1kcm.mjs} +5 -5
  109. package/dist/{src-DfRHrkSZ.mjs → src-_HKC1FMw.mjs} +4 -4
  110. package/dist/start-D7cn52M0.mjs +1 -0
  111. package/dist/{start-CO8ycP7q.mjs → start-Zc3ZdtMq.mjs} +3 -3
  112. package/dist/{write-project-skill-D38t_B_r.mjs → write-project-skill-BE5macnV.mjs} +2 -2
  113. package/package.json +5 -5
  114. package/dist/constants-C2XDlcS1.mjs +0 -2
  115. package/dist/git-handle-DBSzQutT.mjs +0 -1
  116. package/dist/init-ClZSDo6l.mjs +0 -1
  117. package/dist/loader-s1KEG5BC.mjs +0 -1
  118. package/dist/md-manager-BbSzMHHE.mjs +0 -2
  119. package/dist/preview-CvAKccSM.mjs +0 -1
  120. package/dist/public/assets/FeedbackForm-CMxe5Ck2.js +0 -1
  121. package/dist/public/assets/ManagedArtifactProperties-CJlBCe1z.js +0 -1
  122. package/dist/public/assets/i18n-CYjCal_m.js +0 -1
  123. package/dist/repair-skills-CrwlZDaN.mjs +0 -1
  124. package/dist/server-lock-U8YDpJpq.mjs +0 -1
  125. package/dist/src-CI4mQeWa.mjs +0 -1
  126. package/dist/start-B2E2Vu3j.mjs +0 -1
package/dist/index.d.mts CHANGED
@@ -4036,7 +4036,6 @@ declare const ConfigSchema: ZodObject<{
4036
4036
  system: "system";
4037
4037
  }>>;
4038
4038
  language: ZodOptional<ZodEnum<{
4039
- id: "id";
4040
4039
  system: "system";
4041
4040
  en: "en";
4042
4041
  "zh-Hans": "zh-Hans";
@@ -4047,6 +4046,7 @@ declare const ConfigSchema: ZodObject<{
4047
4046
  fr: "fr";
4048
4047
  bn: "bn";
4049
4048
  "pt-BR": "pt-BR";
4049
+ id: "id";
4050
4050
  ur: "ur";
4051
4051
  }>>;
4052
4052
  colorThemeLight: ZodOptional<ZodEnum<{
package/dist/index.mjs CHANGED
@@ -410,7 +410,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
410
410
  `,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&amp;`).replace(o,`&lt;`).replace(s,`&gt;`).replace(c,`&para;<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
411
411
  `),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
412
412
  `],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
413
- `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a}))(),1);new oY.default;const sY=z({path:R(So([P(),F()])),message:P(),issueCode:P()});Co(`code`,[z({code:H(`SCHEMA_INVALID`),issues:R(sY)}),z({code:H(`WRITE_ERROR`),detail:P()})]),Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});const cY=new oY.default;cY.Match_Threshold=.5;const lY=`last-server-exit.json`,uY=`last-server-crash.json`,dY=[`.ok`,`local`,`installed-skills.json`],fY=V(gl),pY=bo({hosts:R(P()),scope:fY,scripts:I(),installedAt:Fa(),projection:V([`symlink`,`copy`]).optional(),contentHash:P().optional()}),mY=bo({schema:H(1),skills:B(P(),pY).default({})});function hY(e){let t;try{t=JSON.parse(e)}catch{return null}let n=mY.safeParse(t);return n.success?n.data:null}const gY=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),_Y=globalThis;_Y[gY]===void 0&&(_Y[gY]=Zr());const vY=_Y[gY],yY=bo({version:P().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(vY,{description:`Recorded skill version for this target.`}),recordedAt:Fa().register(vY,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:V([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(vY,{description:`Install-source surface that recorded this entry.`}).optional()}),bY=bo({enabled:I().register(vY,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Fa().register(vY,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});bo({schema:H(1).register(vY,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:bo({"claude-cowork":yY.optional(),"cli-hosts":yY.optional()}).register(vY,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:B(P(),bY).register(vY,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:R(P()).register(vY,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});const xY=bo({name:P(),description:P(),files:bo({skillMd:P(),scripts:R(P()),references:R(P())})}),SY=bo({pluginProvider:P().optional(),plugin:P().optional(),marketplace:P().optional(),version:P().optional(),gitCommitSha:P().optional(),scope:P().optional(),projectPath:P().optional()}),CY=bo({commands:I(),hooks:I(),mcp:I()}),wY=bo({...xY.shape,sourceHarness:P(),sourceHarnesses:R(P()),home:P(),provenance:SY,inert:CY,outsideProject:I().optional()}),TY=bo({schema:H(1),name:P(),version:P(),description:P().optional(),author:bo({name:P()}).optional(),skills:R(P()),hostCompatibility:R(P()).optional(),capabilities:bo({scripts:P(),network:P(),inert:R(P())}).optional(),provenance:bo({source:P(),ref:P(),contentHash:P()}).optional()});z({skills:R(wY),packs:R(TY)}).loose(),z({results:R(z({id:P().min(1),name:P().min(1),source:P().min(1),description:P(),installs:F().int().nonnegative().nullable(),publisher:P().nullable()}).loose()),backend:V([`skills.sh`,`github-fallback`]),degraded:I()}).loose(),z({title:P(),description:P(),image:P().nullable(),skillsUrl:P().nullable(),sourceKind:V([`github`,`site`]),sourceUrl:P()}).loose(),z({skills:R(z({name:P(),description:P().nullable()}).loose())}).loose(),z({kind:V([`local`,`import`,`none`]),scope:V(gl).optional(),name:P().optional(),dir:P().optional(),source:P().optional(),ref:P().optional(),via:V([`source`,`publisher`]).optional()}).loose();const EY=z({relPath:P(),content:P().nullable()}).loose(),DY=z({provider:P(),plugin:P(),version:P().optional(),marketplace:P().optional(),repositoryUrl:P().optional()}).loose(),OY=z({provider:P(),plugin:P(),version:P().optional(),description:P().optional(),repositoryUrl:P().optional(),bundledSkills:R(P()),capabilities:z({commands:I(),hooks:I(),mcp:I(),agents:I()}),setupSupported:I()}).loose();z({name:P(),description:P().nullable(),skillMd:P(),files:R(EY),plugin:DY.optional(),pluginBundle:OY.optional()}).loose(),Hc();var kY=class{kind;projectRoot;projectSubPath;gitPath;gitDir;cachedCommonDir;constructor(e,t,n,r,i){this.kind=e,this.projectRoot=t,this.projectSubPath=n,this.gitPath=r,this.gitDir=i}readCommonDir(){if(this.cachedCommonDir!==void 0)return{kind:`resolved`,path:this.cachedCommonDir};let e=this.gitDir;try{let t=S(M(this.gitDir,`commondir`),`utf-8`).trim();t.length>0&&(e=j(t)?t:ye(this.gitDir,t))}catch(e){if(!IY(e))return{kind:`unreadable`,cause:e}}return this.cachedCommonDir=e,{kind:`resolved`,path:e}}readHead(){let e;try{e=S(M(this.gitDir,`HEAD`),`utf-8`).trim()}catch(e){return IY(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}let t=/^ref:[ \t]*(refs\/heads\/(.+))$/.exec(e);return t?.[2]?{kind:`branch`,branch:t[2],ref:t[1]}:zY(e)?{kind:`detached`,oid:e}:{kind:`malformed`,raw:e}}readRemoteUrl(e){let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n;try{n=S(M(t.path,`config`),`utf-8`)}catch(e){return IY(e)?{kind:`absent`,reason:`config-missing`}:{kind:`unreadable`,cause:e}}let r=NY(n,e);return r===null?{kind:`absent`,reason:`remote-missing`}:{kind:`configured`,url:r}}readRef(e){if(!LY(e))return{kind:`invalid`};let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n=ye(t.path,e),r=ve(t.path,n);if(r.startsWith(`..`)||j(r))return{kind:`invalid`};try{let e=S(n,`utf-8`).trim(),t=RY(e);return t===null?{kind:`malformed`,raw:e}:{kind:`present`,storage:`loose`,value:t}}catch(e){if(!IY(e))return{kind:`unreadable`,cause:e}}let i;try{i=S(M(t.path,`packed-refs`),`utf-8`)}catch(e){return IY(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}for(let t of i.split(/\r?\n/)){let n=t.trim();if(n.length===0||n.startsWith(`#`)||n.startsWith(`^`))continue;let r=n.split(/\s+/);if(r.length===2&&r[1]===e)return zY(r[0])?{kind:`present`,storage:`packed`,value:{kind:`oid`,oid:r[0]}}:{kind:`malformed`,raw:n}}return{kind:`absent`}}};function AY(e){return MY(ye(e),``)}function jY(e){let t=ye(e),n=ye(se());if(t===n)return{kind:`absent`};let r=MY(t,``);if(r.kind!==`absent`)return r;let i=t;for(let e=0;e<64;e++){if(i===n)return{kind:`absent`};let e=me(i);if(e===i||e===n)return{kind:`absent`};let r=MY(e,ve(e,t));if(r.kind!==`absent`)return r;i=e}return{kind:`absent`}}function MY(e,t){let n=M(e,`.git`),r;try{r=ee(n)}catch(e){return IY(e)?{kind:`absent`}:{kind:`inaccessible`,gitPath:n,cause:e}}if(r.isDirectory())return{kind:`repository`,repository:new kY(`directory`,e,t,n,n)};if(!r.isFile())return{kind:`absent`};let i;try{i=S(n,`utf-8`).trim()}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:``,cause:e}}let a=/^gitdir:[ \t]*(.+)$/.exec(i);if(!a)return{kind:`malformed-pointer`,gitPath:n,target:``};let o=a[1].trim(),s=j(o)?o:ye(e,o);try{if(!ee(s).isDirectory())return{kind:`malformed-pointer`,gitPath:n,target:s}}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:s,cause:e}}return{kind:`repository`,repository:new kY(`linked`,e,t,n,s)}}function NY(e,t){let n=!1;for(let r of e.split(/\r?\n/)){let e=PY(r);if(e.length===0)continue;if(e.startsWith(`[`)){n=/^\[\s*remote\s+["'](.+)["']\s*\]$/.exec(e)?.[1]===t;continue}if(!n)continue;let i=/^url\s*=\s*(.*)$/.exec(e);if(!i)continue;let a=FY(i[1]);if(a.length>0)return a}return null}function PY(e){let t=e.search(/[;#]/);return(t===-1?e:e.slice(0,t)).trim()}function FY(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function IY(e){let t=e?.code;return t===`ENOENT`||t===`ENOTDIR`}function LY(e){return e.startsWith(`refs/`)&&!e.includes(`\0`)&&!e.includes(`\\`)&&!e.includes(`..`)&&!e.includes(`//`)&&!e.endsWith(`/`)}function RY(e){if(e.length===0)return null;let t=/^ref:[ \t]*(refs\/.+)$/.exec(e);return t?LY(t[1])?{kind:`symbolic`,target:t[1]}:null:zY(e)?{kind:`oid`,oid:e}:null}function zY(e){return/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(e)}const BY={initialize:`initialize`,authenticate:`authenticate`,providers_list:`providers/list`,providers_set:`providers/set`,providers_disable:`providers/disable`,session_new:`session/new`,session_load:`session/load`,session_set_mode:`session/set_mode`,session_set_config_option:`session/set_config_option`,session_prompt:`session/prompt`,session_cancel:`session/cancel`,mcp_message:`mcp/message`,session_list:`session/list`,session_delete:`session/delete`,session_fork:`session/fork`,session_resume:`session/resume`,session_close:`session/close`,logout:`logout`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,nes_accept:`nes/accept`,nes_reject:`nes/reject`,nes_close:`nes/close`,document_did_open:`document/didOpen`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_save:`document/didSave`,document_did_focus:`document/didFocus`},VY={session_request_permission:`session/request_permission`,session_update:`session/update`,fs_write_text_file:`fs/write_text_file`,fs_read_text_file:`fs/read_text_file`,terminal_create:`terminal/create`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`,terminal_kill:`terminal/kill`,mcp_connect:`mcp/connect`,mcp_message:`mcp/message`,mcp_disconnect:`mcp/disconnect`,elicitation_create:`elicitation/create`,elicitation_complete:`elicitation/complete`},HY={cancel_request:`$/cancel_request`},UY=Symbol(`skippedItem`);function $(e,t){return e.catch(t)}function WY(e,t){let n=e.catch(t);return L().transform((e,t)=>e===void 0?(t.addIssue({code:`custom`,message:`Required value is missing`}),rn):n.parse(e))}function GY(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return;let n=e[t];return typeof n==`string`?n:void 0}function KY(e,t,n){return e.superRefine((e,r)=>{let i=GY(e,t);i!==void 0&&n.includes(i)&&r.addIssue({code:`custom`,path:[t],message:`${t} ${JSON.stringify(i)} is reserved by a known variant, but the value does not match that variant's schema`})})}function qY(e,t,n){return L().transform((r,i)=>{let a=e.safeParse(r);if(!a.success){for(let e of a.error.issues)i.addIssue({...e,input:r});return rn}let o=a.data,s=GY(r,t);if(s!==void 0&&!n.includes(s)){let e=r;for(let[t,n]of Object.entries(e))t!==`__proto__`&&(Object.hasOwn(o,t)||(o[t]=n))}return o})}function JY(e){return R(e.catch(UY)).transform(e=>e.filter(e=>e!==UY))}const YY=So([F(),P()]).nullable(),XY=P(),ZY=z({sessionId:XY,path:P(),content:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),QY=z({sessionId:XY,path:P(),line:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),limit:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$Y=P(),eX=So([H(`read`),H(`edit`),H(`delete`),H(`move`),H(`search`),H(`execute`),H(`think`),H(`fetch`),H(`switch_mode`),H(`other`)]),tX=So([H(`pending`),H(`in_progress`),H(`completed`),H(`failed`)]),nX=z({audience:$(JY(So([H(`assistant`),H(`user`)])).nullish(),()=>void 0),lastModified:$(P().nullish(),()=>void 0),priority:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),rX=z({annotations:$(nX.nullish(),()=>void 0),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),iX=z({annotations:$(nX.nullish(),()=>void 0),data:P(),mimeType:P(),uri:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),aX=z({annotations:$(nX.nullish(),()=>void 0),data:P(),mimeType:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),oX=z({annotations:$(nX.nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),mimeType:$(P().nullish(),()=>void 0),name:P(),size:$(F().nullish(),()=>void 0),title:$(P().nullish(),()=>void 0),uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sX=So([z({mimeType:$(P().nullish(),()=>void 0),text:P(),uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),z({blob:P(),mimeType:$(P().nullish(),()=>void 0),uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)})]),cX=z({annotations:$(nX.nullish(),()=>void 0),resource:sX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),lX=So([rX.and(z({type:H(`text`)})),iX.and(z({type:H(`image`)})),aX.and(z({type:H(`audio`)})),oX.and(z({type:H(`resource_link`)})),cX.and(z({type:H(`resource`)}))]),uX=z({content:lX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),dX=z({path:P(),oldText:$(P().nullish(),()=>void 0),newText:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),fX=P(),pX=z({terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),mX=So([uX.and(z({type:H(`content`)})),dX.and(z({type:H(`diff`)})),pX.and(z({type:H(`terminal`)}))]),hX=z({path:P(),line:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),gX=z({toolCallId:$Y,kind:$(eX.nullish(),()=>void 0),status:$(tX.nullish(),()=>void 0),title:$(P().nullish(),()=>void 0),content:$(JY(mX).nullish(),()=>void 0),locations:$(JY(hX).nullish(),()=>void 0),rawInput:$(L().optional(),()=>void 0),rawOutput:$(L().optional(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),_X=P(),vX=So([H(`allow_once`),H(`allow_always`),H(`reject_once`),H(`reject_always`)]),yX=z({sessionId:XY,toolCall:gX,options:R(z({optionId:_X,name:P(),kind:vX,_meta:$(B(P(),L()).nullish(),()=>void 0)})),_meta:$(B(P(),L()).nullish(),()=>void 0)}),bX=z({name:P(),value:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),xX=z({sessionId:XY,command:P(),args:$(JY(P()).optional(),()=>[]),env:$(JY(bX).optional(),()=>[]),cwd:$(P().nullish(),()=>void 0),outputByteLimit:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),SX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),CX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),wX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),TX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),EX=z({sessionId:XY,toolCallId:$($Y.nullish(),()=>void 0)}),DX=z({requestId:YY}),OX=H(`object`),kX=So([H(`email`),H(`uri`),H(`date`),H(`date-time`)]),AX=z({const:P(),title:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),jX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minLength:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),maxLength:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),pattern:P().nullish(),format:kX.nullish(),default:$(P().nullish(),()=>void 0),enum:R(P()).nullish(),oneOf:R(AX).nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),MX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minimum:F().nullish(),maximum:F().nullish(),default:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),NX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minimum:F().nullish(),maximum:F().nullish(),default:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),PX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),default:$(I().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),FX=z({enum:R(P()),_meta:$(B(P(),L()).nullish(),()=>void 0)}),IX=z({anyOf:R(AX),_meta:$(B(P(),L()).nullish(),()=>void 0)}),LX=qY(So([FX.and(z({type:H(`string`)})),KY(z({type:P()}),`type`,[`string`]),IX]),`type`,[`string`]),RX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minItems:F().nullish(),maxItems:F().nullish(),items:LX,default:$(JY(P()).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),zX=qY(So([jX.and(z({type:H(`string`)})),MX.and(z({type:H(`number`)})),NX.and(z({type:H(`integer`)})),PX.and(z({type:H(`boolean`)})),RX.and(z({type:H(`array`)})),KY(z({type:P()}),`type`,[`array`,`boolean`,`integer`,`number`,`string`])]),`type`,[`array`,`boolean`,`integer`,`number`,`string`]),BX=z({type:$(OX.optional().default(`object`),()=>`object`),title:$(P().nullish(),()=>void 0),properties:B(P(),zX).optional().default({}),required:R(P()).nullish(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),VX=wo(So([EX,DX]),z({requestedSchema:BX})),HX=P(),UX=wo(So([EX,DX]),z({elicitationId:HX,url:po()})),WX=qY(wo(So([VX.and(z({mode:H(`form`)})),UX.and(z({mode:H(`url`)})),KY(wo(So([EX,DX]),z({mode:P()})),`mode`,[`form`,`url`])]),z({message:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)})),`mode`,[`form`,`url`]),GX=P(),KX=z({serverId:GX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),qX=P(),JX=z({connectionId:qX,method:P(),params:B(P(),L()).nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),YX=z({connectionId:qX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),XX=L();z({id:YY,method:P(),params:So([ZY,QY,yX,xX,SX,CX,wX,TX,WX,KX,JX,YX,XX]).nullish()});const ZX=_o().gte(0).lte(65535),QX=z({image:$(I().optional().default(!1),()=>!1),audio:$(I().optional().default(!1),()=>!1),embeddedContext:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$X=z({http:$(I().optional().default(!1),()=>!1),sse:$(I().optional().default(!1),()=>!1),acp:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),eZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),tZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),nZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),rZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),iZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),aZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),oZ=z({list:$(eZ.nullish(),()=>void 0),delete:$(tZ.nullish(),()=>void 0),additionalDirectories:$(nZ.nullish(),()=>void 0),fork:$(rZ.nullish(),()=>void 0),resume:$(iZ.nullish(),()=>void 0),close:$(aZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sZ=z({logout:$(z({_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),cZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),lZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),uZ=z({syncKind:So([H(`full`),H(`incremental`)]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),dZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),fZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),pZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),mZ=z({document:$(z({didOpen:$(lZ.nullish(),()=>void 0),didChange:$(uZ.nullish(),()=>void 0),didClose:$(dZ.nullish(),()=>void 0),didSave:$(fZ.nullish(),()=>void 0),didFocus:$(pZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),hZ=z({maxCount:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),gZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),_Z=z({maxCount:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),vZ=z({maxCount:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),yZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),bZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),xZ=z({recentFiles:$(hZ.nullish(),()=>void 0),relatedSnippets:$(gZ.nullish(),()=>void 0),editHistory:$(_Z.nullish(),()=>void 0),userActions:$(vZ.nullish(),()=>void 0),openFiles:$(yZ.nullish(),()=>void 0),diagnostics:$(bZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),SZ=z({events:$(mZ.nullish(),()=>void 0),context:$(xZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),CZ=So([H(`utf-16`),H(`utf-32`),H(`utf-8`)]),wZ=z({loadSession:$(I().optional().default(!1),()=>!1),promptCapabilities:$(QX.optional().default({image:!1,audio:!1,embeddedContext:!1}),()=>({image:!1,audio:!1,embeddedContext:!1})),mcpCapabilities:$($X.optional().default({http:!1,sse:!1,acp:!1}),()=>({http:!1,sse:!1,acp:!1})),sessionCapabilities:$(oZ.optional().default({}),()=>({})),auth:$(sZ.optional().default({}),()=>({})),providers:$(cZ.nullish(),()=>void 0),nes:$(SZ.nullish(),()=>void 0),positionEncoding:$(CZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),TZ=P(),EZ=z({name:P(),label:$(P().nullish(),()=>void 0),secret:$(I().optional().default(!0),()=>!0),optional:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),DZ=z({id:TZ,name:P(),description:$(P().nullish(),()=>void 0),vars:WY(JY(EZ),()=>[]),link:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),OZ=z({id:TZ,name:P(),description:$(P().nullish(),()=>void 0),args:$(JY(P()).optional(),()=>[]),env:$(B(P(),P()).optional(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),kZ=z({id:TZ,name:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),AZ=So([DZ.and(z({type:H(`env_var`)})),OZ.and(z({type:H(`terminal`)})),kZ]),jZ=z({name:P(),title:$(P().nullish(),()=>void 0),version:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),MZ=z({protocolVersion:ZX,agentCapabilities:$(wZ.optional().default({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}}),()=>({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}})),authMethods:$(JY(AZ).optional().default([]),()=>[]),agentInfo:$(jZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),NZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),PZ=P(),FZ=So([H(`anthropic`),H(`openai`),H(`azure`),H(`vertex`),H(`bedrock`),P()]),IZ=z({apiType:FZ,baseUrl:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),LZ=z({providers:R(z({providerId:PZ,supported:WY(JY(FZ),()=>[]),required:I(),current:IZ.nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)})),_meta:$(B(P(),L()).nullish(),()=>void 0)}),RZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),zZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),BZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),VZ=P(),HZ=z({currentModeId:VZ,availableModes:WY(JY(z({id:VZ,name:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),UZ=P(),WZ=So([H(`mode`),H(`model`),H(`model_config`),H(`thought_level`),P()]),GZ=P(),KZ=z({value:GZ,name:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),qZ=z({group:P(),name:P(),options:WY(JY(KZ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),JZ=z({currentValue:GZ,options:So([R(KZ),R(qZ)])}),YZ=z({currentValue:I()}),XZ=wo(So([JZ.and(z({type:H(`select`)})),YZ.and(z({type:H(`boolean`)}))]),z({id:UZ,name:P(),description:$(P().nullish(),()=>void 0),category:$(WZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),ZZ=z({sessionId:XY,modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),QZ=z({modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$Z=z({sessions:WY(JY(z({sessionId:XY,cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),title:$(P().nullish(),()=>void 0),updatedAt:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),()=>[]),nextCursor:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),eQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),tQ=z({sessionId:XY,modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),nQ=z({modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),rQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),iQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),aQ=z({configOptions:WY(JY(XZ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),oQ=z({stopReason:So([H(`end_turn`),H(`max_tokens`),H(`max_turn_requests`),H(`refusal`),H(`cancelled`)]),usage:$(z({totalTokens:F(),inputTokens:F(),outputTokens:F(),thoughtTokens:$(F().nullish(),()=>void 0),cachedReadTokens:$(F().nullish(),()=>void 0),cachedWriteTokens:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),cQ=P(),lQ=z({line:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),character:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),_meta:$(B(P(),L()).nullish(),()=>void 0)}),uQ=z({start:lQ,end:lQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),dQ=z({range:uQ,newText:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),fQ=z({id:cQ,uri:P(),edits:R(dQ),cursorPosition:$(lQ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),pQ=z({id:cQ,uri:P(),position:lQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),mQ=z({id:cQ,uri:P(),position:lQ,newName:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),hQ=z({id:cQ,uri:P(),search:P(),replace:P(),isRegex:I().nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),gQ=z({suggestions:R(So([fQ.and(z({kind:H(`edit`)})),pQ.and(z({kind:H(`jump`)})),mQ.and(z({kind:H(`rename`)})),hQ.and(z({kind:H(`searchAndReplace`)}))])),_meta:$(B(P(),L()).nullish(),()=>void 0)}),_Q=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),vQ=L(),yQ=L(),bQ=z({code:So([H(-32700),H(-32600),H(-32601),H(-32602),H(-32603),H(-32800),H(-32e3),H(-32002),_o().min(-2147483648,{error:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{error:`Invalid value: Expected int32 to be <= 2147483647`})]),message:P(),data:$(L().optional(),()=>void 0)});So([z({id:YY,result:So([MZ,NZ,LZ,RZ,zZ,BZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,gQ,_Q,vQ,yQ])}),z({id:YY,error:bQ})]);const xQ=z({content:lX,messageId:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),SQ=z({toolCallId:$Y,title:P(),kind:$(eX.optional(),()=>void 0),status:$(tX.optional(),()=>void 0),content:$(JY(mX).optional(),()=>[]),locations:$(JY(hX).optional(),()=>[]),rawInput:$(L().optional(),()=>void 0),rawOutput:$(L().optional(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),CQ=So([H(`high`),H(`medium`),H(`low`)]),wQ=So([H(`pending`),H(`in_progress`),H(`completed`)]),TQ=z({content:P(),priority:CQ,status:wQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),EQ=z({entries:WY(JY(TQ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),DQ=P(),Ode=z({planId:DQ,entries:WY(JY(TQ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),kde=z({planId:DQ,uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Ade=z({planId:DQ,content:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),jde=z({plan:So([Ode.and(z({type:H(`items`)})),kde.and(z({type:H(`file`)})),Ade.and(z({type:H(`markdown`)}))]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Mde=z({planId:DQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),Nde=z({hint:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Pde=z({availableCommands:WY(JY(z({name:P(),description:P(),input:$(Nde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Fde=z({currentModeId:VZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),Ide=z({configOptions:WY(JY(XZ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Lde=z({title:$(P().nullish(),()=>void 0),updatedAt:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Rde=z({amount:F(),currency:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),zde=z({used:F(),size:F(),cost:$(Rde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),OQ=z({sessionId:XY,update:So([xQ.and(z({sessionUpdate:H(`user_message_chunk`)})),xQ.and(z({sessionUpdate:H(`agent_message_chunk`)})),xQ.and(z({sessionUpdate:H(`agent_thought_chunk`)})),SQ.and(z({sessionUpdate:H(`tool_call`)})),gX.and(z({sessionUpdate:H(`tool_call_update`)})),EQ.and(z({sessionUpdate:H(`plan`)})),jde.and(z({sessionUpdate:H(`plan_update`)})),Mde.and(z({sessionUpdate:H(`plan_removed`)})),Pde.and(z({sessionUpdate:H(`available_commands_update`)})),Fde.and(z({sessionUpdate:H(`current_mode_update`)})),Ide.and(z({sessionUpdate:H(`config_option_update`)})),Lde.and(z({sessionUpdate:H(`session_info_update`)})),zde.and(z({sessionUpdate:H(`usage_update`)}))]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),kQ=z({elicitationId:HX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),AQ=z({connectionId:qX,method:P(),params:$(B(P(),L()).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),jQ=L();z({method:P(),params:So([OQ,kQ,AQ,jQ]).nullish()});const Bde=z({readTextFile:$(I().optional().default(!1),()=>!1),writeTextFile:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Vde=z({configOptions:$(z({boolean:$(z({_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Hde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Ude=z({terminal:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Wde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Gde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Kde=z({form:$(Wde.nullish(),()=>void 0),url:$(Gde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),qde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Jde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Yde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Xde=z({jump:$(qde.nullish(),()=>void 0),rename:$(Jde.nullish(),()=>void 0),searchAndReplace:$(Yde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),MQ=z({protocolVersion:ZX,clientCapabilities:$(z({fs:$(Bde.optional().default({readTextFile:!1,writeTextFile:!1}),()=>({readTextFile:!1,writeTextFile:!1})),terminal:$(I().optional().default(!1),()=>!1),session:$(Vde.nullish(),()=>void 0),plan:$(Hde.nullish(),()=>void 0),auth:$(Ude.optional().default({terminal:!1}),()=>({terminal:!1})),elicitation:$(Kde.nullish(),()=>void 0),nes:$(Xde.nullish(),()=>void 0),positionEncodings:$(JY(CZ).optional(),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}).optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}),()=>({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}})),clientInfo:$(jZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),NQ=z({methodId:TZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),PQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),FQ=z({providerId:PZ,apiType:FZ,baseUrl:P(),headers:B(P(),P()).optional(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),IQ=z({providerId:PZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),LQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),RQ=z({name:P(),value:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Zde=z({name:P(),url:P(),headers:R(RQ),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Qde=z({name:P(),url:P(),headers:R(RQ),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$de=z({name:P(),serverId:GX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),efe=z({name:P(),command:P(),args:R(P()),env:R(bX),_meta:$(B(P(),L()).nullish(),()=>void 0)}),zQ=So([Zde.and(z({type:H(`http`)})),Qde.and(z({type:H(`sse`)})),$de.and(z({type:H(`acp`)})),efe]),BQ=z({cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),mcpServers:WY(JY(zQ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),VQ=z({mcpServers:WY(JY(zQ),()=>[]),cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),HQ=z({cwd:P().nullish(),cursor:P().nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),UQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),WQ=z({sessionId:XY,cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),mcpServers:$(JY(zQ).optional(),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),GQ=z({sessionId:XY,cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),mcpServers:$(JY(zQ).optional(),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),KQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),qQ=z({sessionId:XY,modeId:VZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),JQ=wo(So([z({value:I(),type:H(`boolean`)}),z({value:GZ})]),z({sessionId:XY,configId:UZ,_meta:$(B(P(),L()).nullish(),()=>void 0)})),YQ=z({sessionId:XY,prompt:R(lX),_meta:$(B(P(),L()).nullish(),()=>void 0)}),tfe=z({uri:P(),name:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),nfe=z({name:P(),owner:P(),remoteUrl:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),XQ=z({workspaceUri:$(P().nullish(),()=>void 0),workspaceFolders:R(tfe).nullish(),repository:$(nfe.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),rfe=So([H(`automatic`),H(`diagnostic`),H(`manual`)]),ife=z({uri:P(),languageId:P(),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),afe=z({startLine:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),endLine:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ofe=z({uri:P(),excerpts:R(afe),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sfe=z({uri:P(),diff:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),cfe=z({action:P(),uri:P(),position:lQ,timestampMs:F(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),lfe=z({uri:P(),languageId:P(),visibleRange:$(uQ.nullish(),()=>void 0),lastFocusedMs:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ufe=So([H(`error`),H(`warning`),H(`information`),H(`hint`)]),dfe=z({uri:P(),range:uQ,severity:ufe,message:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ffe=z({recentFiles:R(ife).nullish(),relatedSnippets:R(ofe).nullish(),editHistory:R(sfe).nullish(),userActions:R(cfe).nullish(),openFiles:R(lfe).nullish(),diagnostics:R(dfe).nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ZQ=z({sessionId:XY,uri:P(),version:F(),position:lQ,selection:uQ.nullish(),triggerKind:rfe,context:ffe.nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),QQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)});z({id:YY,method:P(),params:So([MQ,NQ,PQ,FQ,IQ,LQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,JX,XX]).nullish()});const pfe=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),mfe=z({content:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),hfe=z({optionId:_X,_meta:$(B(P(),L()).nullish(),()=>void 0)}),gfe=z({outcome:So([z({outcome:H(`cancelled`)}),hfe.and(z({outcome:H(`selected`)}))]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),_fe=z({terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),vfe=z({exitCode:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),yfe=z({output:P(),truncated:I(),exitStatus:$(vfe.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),bfe=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),xfe=z({exitCode:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Sfe=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Cfe=So([P(),F(),F(),I(),R(P())]),$Q=z({content:B(P(),Cfe).nullish()});So([z({id:YY,result:So([pfe,mfe,gfe,_fe,yfe,bfe,xfe,Sfe,qY(wo(So([$Q.and(z({action:H(`accept`)})),z({action:H(`decline`)}),z({action:H(`cancel`)}),KY(z({action:P()}),`action`,[`accept`,`cancel`,`decline`])]),z({_meta:$(B(P(),L()).nullish(),()=>void 0)})),`action`,[`accept`,`cancel`,`decline`]),z({connectionId:qX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),yQ,vQ])}),z({id:YY,error:bQ})]);const e$=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),t$=z({sessionId:XY,uri:P(),languageId:P(),version:F(),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),wfe=z({range:uQ.nullish(),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),n$=z({sessionId:XY,uri:P(),version:F(),contentChanges:WY(JY(wfe),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),r$=z({sessionId:XY,uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),i$=z({sessionId:XY,uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),a$=z({sessionId:XY,uri:P(),version:F(),position:lQ,visibleRange:uQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),o$=z({sessionId:XY,id:cQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),s$=z({sessionId:XY,id:cQ,reason:$(So([H(`rejected`),H(`ignored`),H(`replaced`),H(`cancelled`)]).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)});z({method:P(),params:So([e$,t$,n$,r$,i$,a$,o$,s$,AQ,jQ]).nullish()}),z({requestId:YY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),VX.and(z({mode:H(`form`)})).and(z({message:P()})),UX.and(z({mode:H(`url`)})).and(z({message:P()})),So([EX,DX]).and(z({message:P()})),jX.and(z({type:H(`string`)})),MX.and(z({type:H(`number`)})),NX.and(z({type:H(`integer`)})),PX.and(z({type:H(`boolean`)})),RX.and(z({type:H(`array`)})),FX.and(z({type:H(`string`)})),$Q.and(z({action:H(`accept`)})),z({action:H(`decline`)}),z({action:H(`cancel`)});function c$(e){return e??{}}BY.initialize,BY.authenticate,BY.logout,BY.providers_list,BY.providers_set,BY.providers_disable,BY.session_new,BY.session_load,BY.session_list,BY.session_delete,BY.session_fork,BY.session_resume,BY.session_close,BY.session_set_mode,BY.session_set_config_option,BY.session_prompt,BY.session_cancel,BY.nes_start,BY.nes_suggest,BY.nes_accept,BY.nes_reject,BY.nes_close,BY.document_did_open,BY.document_did_change,BY.document_did_close,BY.document_did_save,BY.document_did_focus,VY.session_request_permission,VY.session_update,VY.fs_write_text_file,VY.fs_read_text_file,VY.terminal_create,VY.terminal_output,VY.terminal_release,VY.terminal_wait_for_exit,VY.terminal_kill,VY.elicitation_create,VY.elicitation_complete,HY.cancel_request;function l$(e,t,n){return{method:e,params:t,mapResponse:n}}function u$(e,t){return{method:e,params:t}}function d$(e){let t={};for(let n of Object.values(e))t[n.method]=n;return t}const Tfe={initialize:l$(BY.initialize,MQ),newSession:l$(BY.session_new,BQ),loadSession:l$(BY.session_load,VQ,c$),unstable_forkSession:l$(BY.session_fork,WQ),listSessions:l$(BY.session_list,HQ),deleteSession:l$(BY.session_delete,UQ,c$),resumeSession:l$(BY.session_resume,GQ),closeSession:l$(BY.session_close,KQ,c$),setSessionMode:l$(BY.session_set_mode,qQ,c$),setSessionConfigOption:l$(BY.session_set_config_option,JQ),authenticate:l$(BY.authenticate,NQ,c$),unstable_listProviders:l$(BY.providers_list,PQ),unstable_setProvider:l$(BY.providers_set,FQ,c$),unstable_disableProvider:l$(BY.providers_disable,IQ,c$),logout:l$(BY.logout,LQ,c$),prompt:l$(BY.session_prompt,YQ),unstable_startNes:l$(BY.nes_start,XQ),unstable_suggestNes:l$(BY.nes_suggest,ZQ),unstable_closeNes:l$(BY.nes_close,QQ,c$)},Efe={cancel:u$(BY.session_cancel,e$),unstable_didOpenDocument:u$(BY.document_did_open,t$),unstable_didChangeDocument:u$(BY.document_did_change,n$),unstable_didCloseDocument:u$(BY.document_did_close,r$),unstable_didSaveDocument:u$(BY.document_did_save,i$),unstable_didFocusDocument:u$(BY.document_did_focus,a$),unstable_acceptNes:u$(BY.nes_accept,o$),unstable_rejectNes:u$(BY.nes_reject,s$)},Dfe={requestPermission:l$(VY.session_request_permission,yX),writeTextFile:l$(VY.fs_write_text_file,ZY,c$),readTextFile:l$(VY.fs_read_text_file,QY),createTerminal:l$(VY.terminal_create,xX),terminalOutput:l$(VY.terminal_output,SX),releaseTerminal:l$(VY.terminal_release,CX,c$),waitForTerminalExit:l$(VY.terminal_wait_for_exit,wX),killTerminal:l$(VY.terminal_kill,TX,c$),unstable_createElicitation:l$(VY.elicitation_create,WX)},Ofe={sessionUpdate:u$(VY.session_update,OQ),unstable_completeElicitation:u$(VY.elicitation_complete,kQ)};d$(Tfe),d$(Efe),d$(Dfe),d$(Ofe),new Set([BY.initialize,BY.authenticate,BY.providers_list,BY.providers_set,BY.providers_disable,BY.session_new,BY.session_load,BY.session_set_mode,BY.session_set_config_option,BY.session_prompt,BY.session_list,BY.session_delete,BY.session_fork,BY.session_resume,BY.session_close,BY.logout,BY.nes_start,BY.nes_suggest,BY.nes_close]),new Set([BY.session_cancel,BY.nes_accept,BY.nes_reject,BY.document_did_open,BY.document_did_change,BY.document_did_close,BY.document_did_save,BY.document_did_focus]),new Set([VY.session_request_permission,VY.fs_write_text_file,VY.fs_read_text_file,VY.terminal_create,VY.terminal_output,VY.terminal_release,VY.terminal_wait_for_exit,VY.terminal_kill,VY.elicitation_create]),new Set([VY.session_update,VY.elicitation_complete]),new VB({extensions:_w,deriveStructuralFreshness:!0}),ev(_w);function kfe(e,t,n,r){return e.success?{code:`UNKNOWN`,message:`unexpected success in error path`}:{code:`SCHEMA_INVALID`,issues:e.error.issues.map(e=>{let i=e.path.map(e=>typeof e==`symbol`?String(e):e),a=sl({file:r,source:n,doc:t,path:i});return{path:i,message:e.message,issueCode:e.code,...a===void 0?{}:{source:a}}})}}function f$(e,t,n){let r=`${e}.invalid-${t.replace(/[:.]/g,`-`)}`;try{return E(e,r),r}catch(t){n(`[config] Could not sideline invalid config file ${e} → ${r}: ${t instanceof Error?t.message:String(t)}. File left in place; using schema defaults.`);return}}function Afe(e){let{absPath:t,sideline:n=!0,timestamp:r=new Date().toISOString()}=e,i=e.warn??(e=>console.warn(e)),a=Ts.parse({});if(!g(t))return{valid:!0,value:a,source:void 0,diagnostics:[]};let o;try{o=S(t,`utf-8`)}catch(e){let n=e instanceof Error?e.message:String(e);i(`[config] Could not read ${t}: ${n}. Using schema defaults.`);let r={code:`UNREADABLE`,detail:n};return{valid:!1,value:a,error:r,diagnostics:[{...r}]}}let s=(0,Zt.parseDocument)(o);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);i(`[config] ${t} contains invalid YAML (${e}). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let o=n?f$(t,r,i):void 0,c={code:`YAML_PARSE`,detail:e};return{valid:!1,value:a,error:c,diagnostics:[{...c}],...o===void 0?{}:{sidelinedTo:o}}}let c=s.toJSON()??{},l=fl({value:c,file:t,source:o,doc:s}),u=l.length>0?ml(c):c,d=Ts.safeParse(u);if(!d.success){let e=kfe(d,s,o,t);i(`[config] ${t} fails schema validation (${d.error.issues.length} issue(s)). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let c=n?f$(t,r,i):void 0;return{valid:!1,value:a,error:e,diagnostics:[...l,...el(e)&&e.code===`SCHEMA_INVALID`?[{...e}]:[]],...c===void 0?{}:{sidelinedTo:c}}}return{valid:!0,value:d.data,source:t,diagnostics:l}}function jfe(e){try{let t=me(e),n=`${pe(e)}.tmp.`,r=Date.now()-3e4;for(let e of C(t)){if(!e.startsWith(n))continue;let i=M(t,e);try{ee(i).mtimeMs<r&&te(i)}catch{}}}catch{}}function p$(e,t,n={}){jfe(e);let r=`${e}.tmp.${crypto.randomUUID()}`;try{ne(r,t,{encoding:`utf-8`,mode:n.mode??420}),E(r,e)}catch(e){try{te(r)}catch{}throw e}}var Mfe=class extends Error{code=`LOCK_TIMEOUT`;lockPath;timeoutMs;constructor(e,t){super(`Could not acquire file lock at ${e} within ${t}ms`),this.name=`FileLockTimeoutError`,this.lockPath=e,this.timeoutMs=t}};function Nfe(e){let t=Date.now()+e;for(;Date.now()<t;);}function m$(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r;for(;;){let s;try{s=b(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=ee(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{te(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new Mfe(e,r);Nfe(i);continue}try{return t()}finally{try{p(s)}catch{}try{te(e)}catch{}}}}const h$=`config.yml`;function g$(e,t,n){if(e===`user`)return ye(n??se(),`.ok`,`global.yml`);let r=j(t)?t:ye(t);return e===`project-local`?ye(r,`.ok`,jl,h$):ye(r,`.ok`,h$)}var _$=i(((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}else return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
413
+ `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a}))(),1);new oY.default;const sY=z({path:R(So([P(),F()])),message:P(),issueCode:P()});Co(`code`,[z({code:H(`SCHEMA_INVALID`),issues:R(sY)}),z({code:H(`WRITE_ERROR`),detail:P()})]),Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});const cY=new oY.default;cY.Match_Threshold=.5;const lY=`last-server-exit.json`,uY=`last-server-crash.json`,dY=[`.ok`,`local`,`installed-skills.json`],fY=V(gl),pY=bo({hosts:R(P()),scope:fY,scripts:I(),installedAt:Fa(),projection:V([`symlink`,`copy`]).optional(),contentHash:P().optional()}),mY=bo({schema:H(1),skills:B(P(),pY).default({})});function hY(e){let t;try{t=JSON.parse(e)}catch{return null}let n=mY.safeParse(t);return n.success?n.data:null}(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();const gY=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),_Y=globalThis;_Y[gY]===void 0&&(_Y[gY]=Zr());const vY=_Y[gY],yY=bo({version:P().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(vY,{description:`Recorded skill version for this target.`}),recordedAt:Fa().register(vY,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:V([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(vY,{description:`Install-source surface that recorded this entry.`}).optional()}),bY=bo({enabled:I().register(vY,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:Fa().register(vY,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});bo({schema:H(1).register(vY,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:bo({"claude-cowork":yY.optional(),"cli-hosts":yY.optional()}).register(vY,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:B(P(),bY).register(vY,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:R(P()).register(vY,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});const xY=bo({name:P(),description:P(),files:bo({skillMd:P(),scripts:R(P()),references:R(P())})}),SY=bo({pluginProvider:P().optional(),plugin:P().optional(),marketplace:P().optional(),version:P().optional(),gitCommitSha:P().optional(),scope:P().optional(),projectPath:P().optional()}),CY=bo({commands:I(),hooks:I(),mcp:I()}),wY=bo({...xY.shape,sourceHarness:P(),sourceHarnesses:R(P()),home:P(),provenance:SY,inert:CY,outsideProject:I().optional()}),TY=bo({schema:H(1),name:P(),version:P(),description:P().optional(),author:bo({name:P()}).optional(),skills:R(P()),hostCompatibility:R(P()).optional(),capabilities:bo({scripts:P(),network:P(),inert:R(P())}).optional(),provenance:bo({source:P(),ref:P(),contentHash:P()}).optional()});z({skills:R(wY),packs:R(TY)}).loose(),z({results:R(z({id:P().min(1),name:P().min(1),source:P().min(1),description:P(),installs:F().int().nonnegative().nullable(),publisher:P().nullable()}).loose()),backend:V([`skills.sh`,`github-fallback`]),degraded:I()}).loose(),z({title:P(),description:P(),image:P().nullable(),skillsUrl:P().nullable(),sourceKind:V([`github`,`site`]),sourceUrl:P()}).loose(),z({skills:R(z({name:P(),description:P().nullable()}).loose())}).loose(),z({kind:V([`local`,`import`,`none`]),scope:V(gl).optional(),name:P().optional(),dir:P().optional(),source:P().optional(),ref:P().optional(),via:V([`source`,`publisher`]).optional()}).loose();const EY=z({relPath:P(),content:P().nullable()}).loose(),DY=z({provider:P(),plugin:P(),version:P().optional(),marketplace:P().optional(),repositoryUrl:P().optional()}).loose(),OY=z({provider:P(),plugin:P(),version:P().optional(),description:P().optional(),repositoryUrl:P().optional(),bundledSkills:R(P()),capabilities:z({commands:I(),hooks:I(),mcp:I(),agents:I()}),setupSupported:I()}).loose();z({name:P(),description:P().nullable(),skillMd:P(),files:R(EY),plugin:DY.optional(),pluginBundle:OY.optional()}).loose(),Hc();var kY=class{kind;projectRoot;projectSubPath;gitPath;gitDir;cachedCommonDir;constructor(e,t,n,r,i){this.kind=e,this.projectRoot=t,this.projectSubPath=n,this.gitPath=r,this.gitDir=i}readCommonDir(){if(this.cachedCommonDir!==void 0)return{kind:`resolved`,path:this.cachedCommonDir};let e=this.gitDir;try{let t=S(M(this.gitDir,`commondir`),`utf-8`).trim();t.length>0&&(e=j(t)?t:ye(this.gitDir,t))}catch(e){if(!IY(e))return{kind:`unreadable`,cause:e}}return this.cachedCommonDir=e,{kind:`resolved`,path:e}}readHead(){let e;try{e=S(M(this.gitDir,`HEAD`),`utf-8`).trim()}catch(e){return IY(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}let t=/^ref:[ \t]*(refs\/heads\/(.+))$/.exec(e);return t?.[2]?{kind:`branch`,branch:t[2],ref:t[1]}:zY(e)?{kind:`detached`,oid:e}:{kind:`malformed`,raw:e}}readRemoteUrl(e){let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n;try{n=S(M(t.path,`config`),`utf-8`)}catch(e){return IY(e)?{kind:`absent`,reason:`config-missing`}:{kind:`unreadable`,cause:e}}let r=NY(n,e);return r===null?{kind:`absent`,reason:`remote-missing`}:{kind:`configured`,url:r}}readRef(e){if(!LY(e))return{kind:`invalid`};let t=this.readCommonDir();if(t.kind===`unreadable`)return t;let n=ye(t.path,e),r=ve(t.path,n);if(r.startsWith(`..`)||j(r))return{kind:`invalid`};try{let e=S(n,`utf-8`).trim(),t=RY(e);return t===null?{kind:`malformed`,raw:e}:{kind:`present`,storage:`loose`,value:t}}catch(e){if(!IY(e))return{kind:`unreadable`,cause:e}}let i;try{i=S(M(t.path,`packed-refs`),`utf-8`)}catch(e){return IY(e)?{kind:`absent`}:{kind:`unreadable`,cause:e}}for(let t of i.split(/\r?\n/)){let n=t.trim();if(n.length===0||n.startsWith(`#`)||n.startsWith(`^`))continue;let r=n.split(/\s+/);if(r.length===2&&r[1]===e)return zY(r[0])?{kind:`present`,storage:`packed`,value:{kind:`oid`,oid:r[0]}}:{kind:`malformed`,raw:n}}return{kind:`absent`}}};function AY(e){return MY(ye(e),``)}function jY(e){let t=ye(e),n=ye(se());if(t===n)return{kind:`absent`};let r=MY(t,``);if(r.kind!==`absent`)return r;let i=t;for(let e=0;e<64;e++){if(i===n)return{kind:`absent`};let e=me(i);if(e===i||e===n)return{kind:`absent`};let r=MY(e,ve(e,t));if(r.kind!==`absent`)return r;i=e}return{kind:`absent`}}function MY(e,t){let n=M(e,`.git`),r;try{r=ee(n)}catch(e){return IY(e)?{kind:`absent`}:{kind:`inaccessible`,gitPath:n,cause:e}}if(r.isDirectory())return{kind:`repository`,repository:new kY(`directory`,e,t,n,n)};if(!r.isFile())return{kind:`absent`};let i;try{i=S(n,`utf-8`).trim()}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:``,cause:e}}let a=/^gitdir:[ \t]*(.+)$/.exec(i);if(!a)return{kind:`malformed-pointer`,gitPath:n,target:``};let o=a[1].trim(),s=j(o)?o:ye(e,o);try{if(!ee(s).isDirectory())return{kind:`malformed-pointer`,gitPath:n,target:s}}catch(e){return{kind:`malformed-pointer`,gitPath:n,target:s,cause:e}}return{kind:`repository`,repository:new kY(`linked`,e,t,n,s)}}function NY(e,t){let n=!1;for(let r of e.split(/\r?\n/)){let e=PY(r);if(e.length===0)continue;if(e.startsWith(`[`)){n=/^\[\s*remote\s+["'](.+)["']\s*\]$/.exec(e)?.[1]===t;continue}if(!n)continue;let i=/^url\s*=\s*(.*)$/.exec(e);if(!i)continue;let a=FY(i[1]);if(a.length>0)return a}return null}function PY(e){let t=e.search(/[;#]/);return(t===-1?e:e.slice(0,t)).trim()}function FY(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function IY(e){let t=e?.code;return t===`ENOENT`||t===`ENOTDIR`}function LY(e){return e.startsWith(`refs/`)&&!e.includes(`\0`)&&!e.includes(`\\`)&&!e.includes(`..`)&&!e.includes(`//`)&&!e.endsWith(`/`)}function RY(e){if(e.length===0)return null;let t=/^ref:[ \t]*(refs\/.+)$/.exec(e);return t?LY(t[1])?{kind:`symbolic`,target:t[1]}:null:zY(e)?{kind:`oid`,oid:e}:null}function zY(e){return/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(e)}const BY={initialize:`initialize`,authenticate:`authenticate`,providers_list:`providers/list`,providers_set:`providers/set`,providers_disable:`providers/disable`,session_new:`session/new`,session_load:`session/load`,session_set_mode:`session/set_mode`,session_set_config_option:`session/set_config_option`,session_prompt:`session/prompt`,session_cancel:`session/cancel`,mcp_message:`mcp/message`,session_list:`session/list`,session_delete:`session/delete`,session_fork:`session/fork`,session_resume:`session/resume`,session_close:`session/close`,logout:`logout`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,nes_accept:`nes/accept`,nes_reject:`nes/reject`,nes_close:`nes/close`,document_did_open:`document/didOpen`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_save:`document/didSave`,document_did_focus:`document/didFocus`},VY={session_request_permission:`session/request_permission`,session_update:`session/update`,fs_write_text_file:`fs/write_text_file`,fs_read_text_file:`fs/read_text_file`,terminal_create:`terminal/create`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`,terminal_kill:`terminal/kill`,mcp_connect:`mcp/connect`,mcp_message:`mcp/message`,mcp_disconnect:`mcp/disconnect`,elicitation_create:`elicitation/create`,elicitation_complete:`elicitation/complete`},HY={cancel_request:`$/cancel_request`},UY=Symbol(`skippedItem`);function $(e,t){return e.catch(t)}function WY(e,t){let n=e.catch(t);return L().transform((e,t)=>e===void 0?(t.addIssue({code:`custom`,message:`Required value is missing`}),rn):n.parse(e))}function GY(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return;let n=e[t];return typeof n==`string`?n:void 0}function KY(e,t,n){return e.superRefine((e,r)=>{let i=GY(e,t);i!==void 0&&n.includes(i)&&r.addIssue({code:`custom`,path:[t],message:`${t} ${JSON.stringify(i)} is reserved by a known variant, but the value does not match that variant's schema`})})}function qY(e,t,n){return L().transform((r,i)=>{let a=e.safeParse(r);if(!a.success){for(let e of a.error.issues)i.addIssue({...e,input:r});return rn}let o=a.data,s=GY(r,t);if(s!==void 0&&!n.includes(s)){let e=r;for(let[t,n]of Object.entries(e))t!==`__proto__`&&(Object.hasOwn(o,t)||(o[t]=n))}return o})}function JY(e){return R(e.catch(UY)).transform(e=>e.filter(e=>e!==UY))}const YY=So([F(),P()]).nullable(),XY=P(),ZY=z({sessionId:XY,path:P(),content:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),QY=z({sessionId:XY,path:P(),line:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),limit:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$Y=P(),eX=So([H(`read`),H(`edit`),H(`delete`),H(`move`),H(`search`),H(`execute`),H(`think`),H(`fetch`),H(`switch_mode`),H(`other`)]),tX=So([H(`pending`),H(`in_progress`),H(`completed`),H(`failed`)]),nX=z({audience:$(JY(So([H(`assistant`),H(`user`)])).nullish(),()=>void 0),lastModified:$(P().nullish(),()=>void 0),priority:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),rX=z({annotations:$(nX.nullish(),()=>void 0),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),iX=z({annotations:$(nX.nullish(),()=>void 0),data:P(),mimeType:P(),uri:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),aX=z({annotations:$(nX.nullish(),()=>void 0),data:P(),mimeType:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),oX=z({annotations:$(nX.nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),mimeType:$(P().nullish(),()=>void 0),name:P(),size:$(F().nullish(),()=>void 0),title:$(P().nullish(),()=>void 0),uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sX=So([z({mimeType:$(P().nullish(),()=>void 0),text:P(),uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),z({blob:P(),mimeType:$(P().nullish(),()=>void 0),uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)})]),cX=z({annotations:$(nX.nullish(),()=>void 0),resource:sX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),lX=So([rX.and(z({type:H(`text`)})),iX.and(z({type:H(`image`)})),aX.and(z({type:H(`audio`)})),oX.and(z({type:H(`resource_link`)})),cX.and(z({type:H(`resource`)}))]),uX=z({content:lX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),dX=z({path:P(),oldText:$(P().nullish(),()=>void 0),newText:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),fX=P(),pX=z({terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),mX=So([uX.and(z({type:H(`content`)})),dX.and(z({type:H(`diff`)})),pX.and(z({type:H(`terminal`)}))]),hX=z({path:P(),line:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),gX=z({toolCallId:$Y,kind:$(eX.nullish(),()=>void 0),status:$(tX.nullish(),()=>void 0),title:$(P().nullish(),()=>void 0),content:$(JY(mX).nullish(),()=>void 0),locations:$(JY(hX).nullish(),()=>void 0),rawInput:$(L().optional(),()=>void 0),rawOutput:$(L().optional(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),_X=P(),vX=So([H(`allow_once`),H(`allow_always`),H(`reject_once`),H(`reject_always`)]),yX=z({sessionId:XY,toolCall:gX,options:R(z({optionId:_X,name:P(),kind:vX,_meta:$(B(P(),L()).nullish(),()=>void 0)})),_meta:$(B(P(),L()).nullish(),()=>void 0)}),bX=z({name:P(),value:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),xX=z({sessionId:XY,command:P(),args:$(JY(P()).optional(),()=>[]),env:$(JY(bX).optional(),()=>[]),cwd:$(P().nullish(),()=>void 0),outputByteLimit:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),SX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),CX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),wX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),TX=z({sessionId:XY,terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),EX=z({sessionId:XY,toolCallId:$($Y.nullish(),()=>void 0)}),DX=z({requestId:YY}),OX=H(`object`),kX=So([H(`email`),H(`uri`),H(`date`),H(`date-time`)]),AX=z({const:P(),title:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),jX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minLength:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),maxLength:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),pattern:P().nullish(),format:kX.nullish(),default:$(P().nullish(),()=>void 0),enum:R(P()).nullish(),oneOf:R(AX).nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),MX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minimum:F().nullish(),maximum:F().nullish(),default:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),NX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minimum:F().nullish(),maximum:F().nullish(),default:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),PX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),default:$(I().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),FX=z({enum:R(P()),_meta:$(B(P(),L()).nullish(),()=>void 0)}),IX=z({anyOf:R(AX),_meta:$(B(P(),L()).nullish(),()=>void 0)}),LX=qY(So([FX.and(z({type:H(`string`)})),KY(z({type:P()}),`type`,[`string`]),IX]),`type`,[`string`]),RX=z({title:$(P().nullish(),()=>void 0),description:$(P().nullish(),()=>void 0),minItems:F().nullish(),maxItems:F().nullish(),items:LX,default:$(JY(P()).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),zX=qY(So([jX.and(z({type:H(`string`)})),MX.and(z({type:H(`number`)})),NX.and(z({type:H(`integer`)})),PX.and(z({type:H(`boolean`)})),RX.and(z({type:H(`array`)})),KY(z({type:P()}),`type`,[`array`,`boolean`,`integer`,`number`,`string`])]),`type`,[`array`,`boolean`,`integer`,`number`,`string`]),BX=z({type:$(OX.optional().default(`object`),()=>`object`),title:$(P().nullish(),()=>void 0),properties:B(P(),zX).optional().default({}),required:R(P()).nullish(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),VX=wo(So([EX,DX]),z({requestedSchema:BX})),HX=P(),UX=wo(So([EX,DX]),z({elicitationId:HX,url:po()})),WX=qY(wo(So([VX.and(z({mode:H(`form`)})),UX.and(z({mode:H(`url`)})),KY(wo(So([EX,DX]),z({mode:P()})),`mode`,[`form`,`url`])]),z({message:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)})),`mode`,[`form`,`url`]),GX=P(),KX=z({serverId:GX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),qX=P(),JX=z({connectionId:qX,method:P(),params:B(P(),L()).nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),YX=z({connectionId:qX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),XX=L();z({id:YY,method:P(),params:So([ZY,QY,yX,xX,SX,CX,wX,TX,WX,KX,JX,YX,XX]).nullish()});const ZX=_o().gte(0).lte(65535),QX=z({image:$(I().optional().default(!1),()=>!1),audio:$(I().optional().default(!1),()=>!1),embeddedContext:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$X=z({http:$(I().optional().default(!1),()=>!1),sse:$(I().optional().default(!1),()=>!1),acp:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),eZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),tZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),nZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),rZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),iZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),aZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),oZ=z({list:$(eZ.nullish(),()=>void 0),delete:$(tZ.nullish(),()=>void 0),additionalDirectories:$(nZ.nullish(),()=>void 0),fork:$(rZ.nullish(),()=>void 0),resume:$(iZ.nullish(),()=>void 0),close:$(aZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sZ=z({logout:$(z({_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),cZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),lZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),uZ=z({syncKind:So([H(`full`),H(`incremental`)]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),dZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),fZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),pZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),mZ=z({document:$(z({didOpen:$(lZ.nullish(),()=>void 0),didChange:$(uZ.nullish(),()=>void 0),didClose:$(dZ.nullish(),()=>void 0),didSave:$(fZ.nullish(),()=>void 0),didFocus:$(pZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),hZ=z({maxCount:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),gZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),_Z=z({maxCount:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),vZ=z({maxCount:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),yZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),bZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),xZ=z({recentFiles:$(hZ.nullish(),()=>void 0),relatedSnippets:$(gZ.nullish(),()=>void 0),editHistory:$(_Z.nullish(),()=>void 0),userActions:$(vZ.nullish(),()=>void 0),openFiles:$(yZ.nullish(),()=>void 0),diagnostics:$(bZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),SZ=z({events:$(mZ.nullish(),()=>void 0),context:$(xZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),CZ=So([H(`utf-16`),H(`utf-32`),H(`utf-8`)]),wZ=z({loadSession:$(I().optional().default(!1),()=>!1),promptCapabilities:$(QX.optional().default({image:!1,audio:!1,embeddedContext:!1}),()=>({image:!1,audio:!1,embeddedContext:!1})),mcpCapabilities:$($X.optional().default({http:!1,sse:!1,acp:!1}),()=>({http:!1,sse:!1,acp:!1})),sessionCapabilities:$(oZ.optional().default({}),()=>({})),auth:$(sZ.optional().default({}),()=>({})),providers:$(cZ.nullish(),()=>void 0),nes:$(SZ.nullish(),()=>void 0),positionEncoding:$(CZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),TZ=P(),EZ=z({name:P(),label:$(P().nullish(),()=>void 0),secret:$(I().optional().default(!0),()=>!0),optional:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),DZ=z({id:TZ,name:P(),description:$(P().nullish(),()=>void 0),vars:WY(JY(EZ),()=>[]),link:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),OZ=z({id:TZ,name:P(),description:$(P().nullish(),()=>void 0),args:$(JY(P()).optional(),()=>[]),env:$(B(P(),P()).optional(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),kZ=z({id:TZ,name:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),AZ=So([DZ.and(z({type:H(`env_var`)})),OZ.and(z({type:H(`terminal`)})),kZ]),jZ=z({name:P(),title:$(P().nullish(),()=>void 0),version:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),MZ=z({protocolVersion:ZX,agentCapabilities:$(wZ.optional().default({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}}),()=>({loadSession:!1,promptCapabilities:{image:!1,audio:!1,embeddedContext:!1},mcpCapabilities:{http:!1,sse:!1,acp:!1},sessionCapabilities:{},auth:{}})),authMethods:$(JY(AZ).optional().default([]),()=>[]),agentInfo:$(jZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),NZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),PZ=P(),FZ=So([H(`anthropic`),H(`openai`),H(`azure`),H(`vertex`),H(`bedrock`),P()]),IZ=z({apiType:FZ,baseUrl:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),LZ=z({providers:R(z({providerId:PZ,supported:WY(JY(FZ),()=>[]),required:I(),current:IZ.nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)})),_meta:$(B(P(),L()).nullish(),()=>void 0)}),RZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),zZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),BZ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),VZ=P(),HZ=z({currentModeId:VZ,availableModes:WY(JY(z({id:VZ,name:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),UZ=P(),WZ=So([H(`mode`),H(`model`),H(`model_config`),H(`thought_level`),P()]),GZ=P(),KZ=z({value:GZ,name:P(),description:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),qZ=z({group:P(),name:P(),options:WY(JY(KZ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),JZ=z({currentValue:GZ,options:So([R(KZ),R(qZ)])}),YZ=z({currentValue:I()}),XZ=wo(So([JZ.and(z({type:H(`select`)})),YZ.and(z({type:H(`boolean`)}))]),z({id:UZ,name:P(),description:$(P().nullish(),()=>void 0),category:$(WZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),ZZ=z({sessionId:XY,modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),QZ=z({modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$Z=z({sessions:WY(JY(z({sessionId:XY,cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),title:$(P().nullish(),()=>void 0),updatedAt:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),()=>[]),nextCursor:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),eQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),tQ=z({sessionId:XY,modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),nQ=z({modes:$(HZ.nullish(),()=>void 0),configOptions:$(JY(XZ).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),rQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),iQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),aQ=z({configOptions:WY(JY(XZ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),oQ=z({stopReason:So([H(`end_turn`),H(`max_tokens`),H(`max_turn_requests`),H(`refusal`),H(`cancelled`)]),usage:$(z({totalTokens:F(),inputTokens:F(),outputTokens:F(),thoughtTokens:$(F().nullish(),()=>void 0),cachedReadTokens:$(F().nullish(),()=>void 0),cachedWriteTokens:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),cQ=P(),lQ=z({line:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),character:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),_meta:$(B(P(),L()).nullish(),()=>void 0)}),uQ=z({start:lQ,end:lQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),dQ=z({range:uQ,newText:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),fQ=z({id:cQ,uri:P(),edits:R(dQ),cursorPosition:$(lQ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),pQ=z({id:cQ,uri:P(),position:lQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),mQ=z({id:cQ,uri:P(),position:lQ,newName:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),hQ=z({id:cQ,uri:P(),search:P(),replace:P(),isRegex:I().nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),gQ=z({suggestions:R(So([fQ.and(z({kind:H(`edit`)})),pQ.and(z({kind:H(`jump`)})),mQ.and(z({kind:H(`rename`)})),hQ.and(z({kind:H(`searchAndReplace`)}))])),_meta:$(B(P(),L()).nullish(),()=>void 0)}),_Q=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),vQ=L(),yQ=L(),bQ=z({code:So([H(-32700),H(-32600),H(-32601),H(-32602),H(-32603),H(-32800),H(-32e3),H(-32002),_o().min(-2147483648,{error:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{error:`Invalid value: Expected int32 to be <= 2147483647`})]),message:P(),data:$(L().optional(),()=>void 0)});So([z({id:YY,result:So([MZ,NZ,LZ,RZ,zZ,BZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,gQ,_Q,vQ,yQ])}),z({id:YY,error:bQ})]);const xQ=z({content:lX,messageId:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),SQ=z({toolCallId:$Y,title:P(),kind:$(eX.optional(),()=>void 0),status:$(tX.optional(),()=>void 0),content:$(JY(mX).optional(),()=>[]),locations:$(JY(hX).optional(),()=>[]),rawInput:$(L().optional(),()=>void 0),rawOutput:$(L().optional(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),CQ=So([H(`high`),H(`medium`),H(`low`)]),wQ=So([H(`pending`),H(`in_progress`),H(`completed`)]),TQ=z({content:P(),priority:CQ,status:wQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),EQ=z({entries:WY(JY(TQ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),DQ=P(),Ode=z({planId:DQ,entries:WY(JY(TQ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),kde=z({planId:DQ,uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Ade=z({planId:DQ,content:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),jde=z({plan:So([Ode.and(z({type:H(`items`)})),kde.and(z({type:H(`file`)})),Ade.and(z({type:H(`markdown`)}))]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Mde=z({planId:DQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),Nde=z({hint:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Pde=z({availableCommands:WY(JY(z({name:P(),description:P(),input:$(Nde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)})),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Fde=z({currentModeId:VZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),Ide=z({configOptions:WY(JY(XZ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Lde=z({title:$(P().nullish(),()=>void 0),updatedAt:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Rde=z({amount:F(),currency:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),zde=z({used:F(),size:F(),cost:$(Rde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),OQ=z({sessionId:XY,update:So([xQ.and(z({sessionUpdate:H(`user_message_chunk`)})),xQ.and(z({sessionUpdate:H(`agent_message_chunk`)})),xQ.and(z({sessionUpdate:H(`agent_thought_chunk`)})),SQ.and(z({sessionUpdate:H(`tool_call`)})),gX.and(z({sessionUpdate:H(`tool_call_update`)})),EQ.and(z({sessionUpdate:H(`plan`)})),jde.and(z({sessionUpdate:H(`plan_update`)})),Mde.and(z({sessionUpdate:H(`plan_removed`)})),Pde.and(z({sessionUpdate:H(`available_commands_update`)})),Fde.and(z({sessionUpdate:H(`current_mode_update`)})),Ide.and(z({sessionUpdate:H(`config_option_update`)})),Lde.and(z({sessionUpdate:H(`session_info_update`)})),zde.and(z({sessionUpdate:H(`usage_update`)}))]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),kQ=z({elicitationId:HX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),AQ=z({connectionId:qX,method:P(),params:$(B(P(),L()).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),jQ=L();z({method:P(),params:So([OQ,kQ,AQ,jQ]).nullish()});const Bde=z({readTextFile:$(I().optional().default(!1),()=>!1),writeTextFile:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Vde=z({configOptions:$(z({boolean:$(z({_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Hde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Ude=z({terminal:$(I().optional().default(!1),()=>!1),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Wde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Gde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Kde=z({form:$(Wde.nullish(),()=>void 0),url:$(Gde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),qde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Jde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Yde=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Xde=z({jump:$(qde.nullish(),()=>void 0),rename:$(Jde.nullish(),()=>void 0),searchAndReplace:$(Yde.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),MQ=z({protocolVersion:ZX,clientCapabilities:$(z({fs:$(Bde.optional().default({readTextFile:!1,writeTextFile:!1}),()=>({readTextFile:!1,writeTextFile:!1})),terminal:$(I().optional().default(!1),()=>!1),session:$(Vde.nullish(),()=>void 0),plan:$(Hde.nullish(),()=>void 0),auth:$(Ude.optional().default({terminal:!1}),()=>({terminal:!1})),elicitation:$(Kde.nullish(),()=>void 0),nes:$(Xde.nullish(),()=>void 0),positionEncodings:$(JY(CZ).optional(),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}).optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}}),()=>({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1,auth:{terminal:!1}})),clientInfo:$(jZ.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),NQ=z({methodId:TZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),PQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),FQ=z({providerId:PZ,apiType:FZ,baseUrl:P(),headers:B(P(),P()).optional(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),IQ=z({providerId:PZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),LQ=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),RQ=z({name:P(),value:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Zde=z({name:P(),url:P(),headers:R(RQ),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Qde=z({name:P(),url:P(),headers:R(RQ),_meta:$(B(P(),L()).nullish(),()=>void 0)}),$de=z({name:P(),serverId:GX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),efe=z({name:P(),command:P(),args:R(P()),env:R(bX),_meta:$(B(P(),L()).nullish(),()=>void 0)}),zQ=So([Zde.and(z({type:H(`http`)})),Qde.and(z({type:H(`sse`)})),$de.and(z({type:H(`acp`)})),efe]),BQ=z({cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),mcpServers:WY(JY(zQ),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),VQ=z({mcpServers:WY(JY(zQ),()=>[]),cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),HQ=z({cwd:P().nullish(),cursor:P().nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),UQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),WQ=z({sessionId:XY,cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),mcpServers:$(JY(zQ).optional(),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),GQ=z({sessionId:XY,cwd:P(),additionalDirectories:$(JY(P()).optional(),()=>[]),mcpServers:$(JY(zQ).optional(),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),KQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),qQ=z({sessionId:XY,modeId:VZ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),JQ=wo(So([z({value:I(),type:H(`boolean`)}),z({value:GZ})]),z({sessionId:XY,configId:UZ,_meta:$(B(P(),L()).nullish(),()=>void 0)})),YQ=z({sessionId:XY,prompt:R(lX),_meta:$(B(P(),L()).nullish(),()=>void 0)}),tfe=z({uri:P(),name:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),nfe=z({name:P(),owner:P(),remoteUrl:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),XQ=z({workspaceUri:$(P().nullish(),()=>void 0),workspaceFolders:R(tfe).nullish(),repository:$(nfe.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),rfe=So([H(`automatic`),H(`diagnostic`),H(`manual`)]),ife=z({uri:P(),languageId:P(),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),afe=z({startLine:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),endLine:_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ofe=z({uri:P(),excerpts:R(afe),_meta:$(B(P(),L()).nullish(),()=>void 0)}),sfe=z({uri:P(),diff:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),cfe=z({action:P(),uri:P(),position:lQ,timestampMs:F(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),lfe=z({uri:P(),languageId:P(),visibleRange:$(uQ.nullish(),()=>void 0),lastFocusedMs:$(F().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ufe=So([H(`error`),H(`warning`),H(`information`),H(`hint`)]),dfe=z({uri:P(),range:uQ,severity:ufe,message:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ffe=z({recentFiles:R(ife).nullish(),relatedSnippets:R(ofe).nullish(),editHistory:R(sfe).nullish(),userActions:R(cfe).nullish(),openFiles:R(lfe).nullish(),diagnostics:R(dfe).nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),ZQ=z({sessionId:XY,uri:P(),version:F(),position:lQ,selection:uQ.nullish(),triggerKind:rfe,context:ffe.nullish(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),QQ=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)});z({id:YY,method:P(),params:So([MQ,NQ,PQ,FQ,IQ,LQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,JX,XX]).nullish()});const pfe=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),mfe=z({content:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),hfe=z({optionId:_X,_meta:$(B(P(),L()).nullish(),()=>void 0)}),gfe=z({outcome:So([z({outcome:H(`cancelled`)}),hfe.and(z({outcome:H(`selected`)}))]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),_fe=z({terminalId:fX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),vfe=z({exitCode:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),yfe=z({output:P(),truncated:I(),exitStatus:$(vfe.nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),bfe=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),xfe=z({exitCode:$(_o().gte(0).max(4294967295,{error:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),()=>void 0),signal:$(P().nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)}),Sfe=z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),Cfe=So([P(),F(),F(),I(),R(P())]),$Q=z({content:B(P(),Cfe).nullish()});So([z({id:YY,result:So([pfe,mfe,gfe,_fe,yfe,bfe,xfe,Sfe,qY(wo(So([$Q.and(z({action:H(`accept`)})),z({action:H(`decline`)}),z({action:H(`cancel`)}),KY(z({action:P()}),`action`,[`accept`,`cancel`,`decline`])]),z({_meta:$(B(P(),L()).nullish(),()=>void 0)})),`action`,[`accept`,`cancel`,`decline`]),z({connectionId:qX,_meta:$(B(P(),L()).nullish(),()=>void 0)}),z({_meta:$(B(P(),L()).nullish(),()=>void 0)}),yQ,vQ])}),z({id:YY,error:bQ})]);const e$=z({sessionId:XY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),t$=z({sessionId:XY,uri:P(),languageId:P(),version:F(),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),wfe=z({range:uQ.nullish(),text:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),n$=z({sessionId:XY,uri:P(),version:F(),contentChanges:WY(JY(wfe),()=>[]),_meta:$(B(P(),L()).nullish(),()=>void 0)}),r$=z({sessionId:XY,uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),i$=z({sessionId:XY,uri:P(),_meta:$(B(P(),L()).nullish(),()=>void 0)}),a$=z({sessionId:XY,uri:P(),version:F(),position:lQ,visibleRange:uQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),o$=z({sessionId:XY,id:cQ,_meta:$(B(P(),L()).nullish(),()=>void 0)}),s$=z({sessionId:XY,id:cQ,reason:$(So([H(`rejected`),H(`ignored`),H(`replaced`),H(`cancelled`)]).nullish(),()=>void 0),_meta:$(B(P(),L()).nullish(),()=>void 0)});z({method:P(),params:So([e$,t$,n$,r$,i$,a$,o$,s$,AQ,jQ]).nullish()}),z({requestId:YY,_meta:$(B(P(),L()).nullish(),()=>void 0)}),VX.and(z({mode:H(`form`)})).and(z({message:P()})),UX.and(z({mode:H(`url`)})).and(z({message:P()})),So([EX,DX]).and(z({message:P()})),jX.and(z({type:H(`string`)})),MX.and(z({type:H(`number`)})),NX.and(z({type:H(`integer`)})),PX.and(z({type:H(`boolean`)})),RX.and(z({type:H(`array`)})),FX.and(z({type:H(`string`)})),$Q.and(z({action:H(`accept`)})),z({action:H(`decline`)}),z({action:H(`cancel`)});function c$(e){return e??{}}BY.initialize,BY.authenticate,BY.logout,BY.providers_list,BY.providers_set,BY.providers_disable,BY.session_new,BY.session_load,BY.session_list,BY.session_delete,BY.session_fork,BY.session_resume,BY.session_close,BY.session_set_mode,BY.session_set_config_option,BY.session_prompt,BY.session_cancel,BY.nes_start,BY.nes_suggest,BY.nes_accept,BY.nes_reject,BY.nes_close,BY.document_did_open,BY.document_did_change,BY.document_did_close,BY.document_did_save,BY.document_did_focus,VY.session_request_permission,VY.session_update,VY.fs_write_text_file,VY.fs_read_text_file,VY.terminal_create,VY.terminal_output,VY.terminal_release,VY.terminal_wait_for_exit,VY.terminal_kill,VY.elicitation_create,VY.elicitation_complete,HY.cancel_request;function l$(e,t,n){return{method:e,params:t,mapResponse:n}}function u$(e,t){return{method:e,params:t}}function d$(e){let t={};for(let n of Object.values(e))t[n.method]=n;return t}const Tfe={initialize:l$(BY.initialize,MQ),newSession:l$(BY.session_new,BQ),loadSession:l$(BY.session_load,VQ,c$),unstable_forkSession:l$(BY.session_fork,WQ),listSessions:l$(BY.session_list,HQ),deleteSession:l$(BY.session_delete,UQ,c$),resumeSession:l$(BY.session_resume,GQ),closeSession:l$(BY.session_close,KQ,c$),setSessionMode:l$(BY.session_set_mode,qQ,c$),setSessionConfigOption:l$(BY.session_set_config_option,JQ),authenticate:l$(BY.authenticate,NQ,c$),unstable_listProviders:l$(BY.providers_list,PQ),unstable_setProvider:l$(BY.providers_set,FQ,c$),unstable_disableProvider:l$(BY.providers_disable,IQ,c$),logout:l$(BY.logout,LQ,c$),prompt:l$(BY.session_prompt,YQ),unstable_startNes:l$(BY.nes_start,XQ),unstable_suggestNes:l$(BY.nes_suggest,ZQ),unstable_closeNes:l$(BY.nes_close,QQ,c$)},Efe={cancel:u$(BY.session_cancel,e$),unstable_didOpenDocument:u$(BY.document_did_open,t$),unstable_didChangeDocument:u$(BY.document_did_change,n$),unstable_didCloseDocument:u$(BY.document_did_close,r$),unstable_didSaveDocument:u$(BY.document_did_save,i$),unstable_didFocusDocument:u$(BY.document_did_focus,a$),unstable_acceptNes:u$(BY.nes_accept,o$),unstable_rejectNes:u$(BY.nes_reject,s$)},Dfe={requestPermission:l$(VY.session_request_permission,yX),writeTextFile:l$(VY.fs_write_text_file,ZY,c$),readTextFile:l$(VY.fs_read_text_file,QY),createTerminal:l$(VY.terminal_create,xX),terminalOutput:l$(VY.terminal_output,SX),releaseTerminal:l$(VY.terminal_release,CX,c$),waitForTerminalExit:l$(VY.terminal_wait_for_exit,wX),killTerminal:l$(VY.terminal_kill,TX,c$),unstable_createElicitation:l$(VY.elicitation_create,WX)},Ofe={sessionUpdate:u$(VY.session_update,OQ),unstable_completeElicitation:u$(VY.elicitation_complete,kQ)};d$(Tfe),d$(Efe),d$(Dfe),d$(Ofe),new Set([BY.initialize,BY.authenticate,BY.providers_list,BY.providers_set,BY.providers_disable,BY.session_new,BY.session_load,BY.session_set_mode,BY.session_set_config_option,BY.session_prompt,BY.session_list,BY.session_delete,BY.session_fork,BY.session_resume,BY.session_close,BY.logout,BY.nes_start,BY.nes_suggest,BY.nes_close]),new Set([BY.session_cancel,BY.nes_accept,BY.nes_reject,BY.document_did_open,BY.document_did_change,BY.document_did_close,BY.document_did_save,BY.document_did_focus]),new Set([VY.session_request_permission,VY.fs_write_text_file,VY.fs_read_text_file,VY.terminal_create,VY.terminal_output,VY.terminal_release,VY.terminal_wait_for_exit,VY.terminal_kill,VY.elicitation_create]),new Set([VY.session_update,VY.elicitation_complete]),new VB({extensions:_w,deriveStructuralFreshness:!0}),ev(_w);function kfe(e,t,n,r){return e.success?{code:`UNKNOWN`,message:`unexpected success in error path`}:{code:`SCHEMA_INVALID`,issues:e.error.issues.map(e=>{let i=e.path.map(e=>typeof e==`symbol`?String(e):e),a=sl({file:r,source:n,doc:t,path:i});return{path:i,message:e.message,issueCode:e.code,...a===void 0?{}:{source:a}}})}}function f$(e,t,n){let r=`${e}.invalid-${t.replace(/[:.]/g,`-`)}`;try{return E(e,r),r}catch(t){n(`[config] Could not sideline invalid config file ${e} → ${r}: ${t instanceof Error?t.message:String(t)}. File left in place; using schema defaults.`);return}}function Afe(e){let{absPath:t,sideline:n=!0,timestamp:r=new Date().toISOString()}=e,i=e.warn??(e=>console.warn(e)),a=Ts.parse({});if(!g(t))return{valid:!0,value:a,source:void 0,diagnostics:[]};let o;try{o=S(t,`utf-8`)}catch(e){let n=e instanceof Error?e.message:String(e);i(`[config] Could not read ${t}: ${n}. Using schema defaults.`);let r={code:`UNREADABLE`,detail:n};return{valid:!1,value:a,error:r,diagnostics:[{...r}]}}let s=(0,Zt.parseDocument)(o);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);i(`[config] ${t} contains invalid YAML (${e}). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let o=n?f$(t,r,i):void 0,c={code:`YAML_PARSE`,detail:e};return{valid:!1,value:a,error:c,diagnostics:[{...c}],...o===void 0?{}:{sidelinedTo:o}}}let c=s.toJSON()??{},l=fl({value:c,file:t,source:o,doc:s}),u=l.length>0?ml(c):c,d=Ts.safeParse(u);if(!d.success){let e=kfe(d,s,o,t);i(`[config] ${t} fails schema validation (${d.error.issues.length} issue(s)). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let c=n?f$(t,r,i):void 0;return{valid:!1,value:a,error:e,diagnostics:[...l,...el(e)&&e.code===`SCHEMA_INVALID`?[{...e}]:[]],...c===void 0?{}:{sidelinedTo:c}}}return{valid:!0,value:d.data,source:t,diagnostics:l}}function jfe(e){try{let t=me(e),n=`${pe(e)}.tmp.`,r=Date.now()-3e4;for(let e of C(t)){if(!e.startsWith(n))continue;let i=M(t,e);try{ee(i).mtimeMs<r&&te(i)}catch{}}}catch{}}function p$(e,t,n={}){jfe(e);let r=`${e}.tmp.${crypto.randomUUID()}`;try{ne(r,t,{encoding:`utf-8`,mode:n.mode??420}),E(r,e)}catch(e){try{te(r)}catch{}throw e}}var Mfe=class extends Error{code=`LOCK_TIMEOUT`;lockPath;timeoutMs;constructor(e,t){super(`Could not acquire file lock at ${e} within ${t}ms`),this.name=`FileLockTimeoutError`,this.lockPath=e,this.timeoutMs=t}};function Nfe(e){let t=Date.now()+e;for(;Date.now()<t;);}function m$(e,t,n={}){let r=n.timeoutMs??5e3,i=n.retryIntervalMs??25,a=r*2,o=Date.now()+r;for(;;){let s;try{s=b(e,`wx`,384)}catch(t){if(t.code!==`EEXIST`)throw t;let s;try{let t=ee(e);s=Date.now()-t.mtimeMs}catch{continue}let c=!1;if(s>a){n.onWarn?.(`cleared stale file lock`,{lockPath:e,ageMs:s,staleThresholdMs:a});try{te(e),c=!0}catch{}}if(c)continue;if(Date.now()>=o)throw new Mfe(e,r);Nfe(i);continue}try{return t()}finally{try{p(s)}catch{}try{te(e)}catch{}}}}const h$=`config.yml`;function g$(e,t,n){if(e===`user`)return ye(n??se(),`.ok`,`global.yml`);let r=j(t)?t:ye(t);return e===`project-local`?ye(r,`.ok`,jl,h$):ye(r,`.ok`,h$)}var _$=i(((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}else return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
414
414
  causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
415
415
  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)}else return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,new Set)}})),v$=i(((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}}})),Pfe=i(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=_$(),{pinoErrProto:a,pinoErrorSymbols:o}=v$(),{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}})),Ffe=i(((e,t)=>{t.exports=s;let{isErrorLike:n}=_$(),{pinoErrProto:r,pinoErrorSymbols:i}=v$(),{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}})),Ife=i(((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)}}})),Lfe=i(((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)}}})),y$=i(((e,t)=>{let n=Pfe(),r=Ffe(),i=Ife(),a=Lfe();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))}}}})),b$=i(((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}})),Rfe=i(((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 d.includes(`*`)?u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s):s?a(e,d):i(e,d,typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n)}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)&&(t.has(r)||t.has(`*`)?i[r]=n(e[r],t.get(r)||t.get(`*`)):i[r]=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})),x$=i(((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`),ee=Symbol(`pino.wildcardFirst`),te=Symbol.for(`pino.serializers`),ne=Symbol.for(`pino.formatters`),re=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:te,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:ee,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:ne,hooksSym:re,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D}})),S$=i(((e,t)=>{let n=Rfe(),{redactFmtSym:r,wildcardFirstSym:i}=x$(),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})),zfe=i(((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=s+(process.hrtime.bigint()-c),t=e/o,n=e%o,r=Number(t*1000n+n/1000000n),i=new Date(r);return`,"time":"${i.getUTCFullYear()}-${(i.getUTCMonth()+1).toString().padStart(2,`0`)}-${i.getUTCDate().toString().padStart(2,`0`)}T${i.getUTCHours().toString().padStart(2,`0`)}:${i.getUTCMinutes().toString().padStart(2,`0`)}:${i.getUTCSeconds().toString().padStart(2,`0`)}.${n.toString().padStart(9,`0`)}Z"`}}})),Bfe=i(((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--;break}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),C$=i(((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}})),w$=i(((e,n)=>{let r=t(`fs`),i=t(`events`),a=t(`util`).inherits,o=t(`path`),s=C$(),c=t(`assert`),l=Buffer.allocUnsafe(0),u=`buffer`,d=`utf8`,[f,p]=(process.versions.node||`0.0`).split(`.`).map(Number),m=f>=22&&p>=7;function h(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function n(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`,a=t.mode;if(t.sync)try{t.mkdir&&r.mkdirSync(o.dirname(e),{recursive:!0}),n(null,r.openSync(e,i,a))}catch(e){throw n(e),e}else t.mkdir?r.mkdir(o.dirname(e),{recursive:!0},t=>{if(t)return n(t);r.open(e,i,a,n)}):r.open(e,i,a,n)}function g(e){if(!(this instanceof g))return new g(e);let{fd:t,dest:n,minLength:i,maxLength:a,maxWrite:o,periodicFlush:c,sync:f,append:p=!0,mkdir:m,retryEAGAIN:y,fsync:S,contentMode:ne,mode:re}=e||{};t||=n,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=o||16384,this._periodicFlush=c||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=S||!1,this.append=p||!1,this.mode=re,this.retryEAGAIN=y||(()=>!0),this.mkdir=m||!1;let ie,ae;if(ne===u)this._writingBuf=l,this.write=x,this.flush=w,this.flushSync=E,this._actualWrite=ee,ie=()=>r.writeSync(this.fd,this._writingBuf),ae=()=>r.write(this.fd,this._writingBuf,this.release);else if(ne===void 0||ne===d)this._writingBuf=``,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,ie=()=>Buffer.isBuffer(this._writingBuf)?r.writeSync(this.fd,this._writingBuf):r.writeSync(this.fd,this._writingBuf,`utf8`),ae=()=>Buffer.isBuffer(this._writingBuf)?r.write(this.fd,this._writingBuf,this.release):r.write(this.fd,this._writingBuf,`utf8`,this.release);else throw Error(`SonicBoom supports "${d}" and "${u}", but passed ${ne}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)h(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{s(100),this.release(void 0,0)}catch(e){this.release(e)}else setTimeout(ae,100);else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let n=_(this._writingBuf,this._len,t);if(this._len=n.len,this._writingBuf=n.writingBuf,this._writingBuf.length){if(!this.sync){ae();return}try{do{let e=ie(),t=_(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&&r.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,te(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(v,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 _(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 v(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}a(g,i);function y(e,t){return e.length===0?l:e.length===1?e[0]:Buffer.concat(e,t)}function b(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 x(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 S(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{r.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,n)},n=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,n)}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&&S.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite())}function w(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&&S.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}g.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&&r.close(t,e=>{if(e)return this.emit(`error`,e)})}),h(this.file,this)},g.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():te(this)))};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=``);let e=``;for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?r.writeSync(this.fd,e):r.writeSync(this.fd,e,`utf8`),n=_(e,this._len,t);e=n.writingBuf,this._len=n.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;s(100)}}try{r.fsyncSync(this.fd)}catch{}}function E(){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=l);let e=l;for(;this._bufs.length||e.length;){e.length<=0&&(e=y(this._bufs[0],this._lens[0]));try{let t=r.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;s(100)}}}g.prototype.destroy=function(){this.destroyed||te(this)};function D(){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)?r.writeSync(this.fd,this._writingBuf):r.writeSync(this.fd,this._writingBuf,`utf8`))}catch(t){e(t)}else r.write(this.fd,this._writingBuf,e)}function ee(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:y(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,r.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else m&&(this._writingBuf=Buffer.from(this._writingBuf)),r.write(this.fd,this._writingBuf,e)}function te(e){if(e.fd===-1){e.once(`ready`,te.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],c(typeof e.fd==`number`,`sonic.fd must be a number, got ${typeof e.fd}`);try{r.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?r.close(e.fd,n):n()}function n(t){if(t){e.emit(`error`,t);return}e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`)}}g.SonicBoom=g,g.default=g,n.exports=g})),T$=i(((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}})),Vfe=i(((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`}})),Hfe=i(((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}})),Ufe=i(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),Wfe=i(((e,n)=>{let{version:r}=Vfe(),{EventEmitter:i}=t(`events`),{Worker:a}=t(`worker_threads`),{join:o}=t(`path`),{pathToFileURL:s}=t(`url`),{wait:c}=Hfe(),{WRITE_INDEX:l,READ_INDEX:u,SEQ_INDEX:d}=Ufe(),f=t(`buffer`),p=t(`assert`),m=Symbol(`kImpl`),h=f.constants.MAX_STRING_LENGTH;function g(){}function _(e,t){Atomics.add(e[m].state,d,1),t(),Atomics.add(e[m].state,d,1),Atomics.notify(e[m].state,d)}function v(e){_(e,()=>{Atomics.store(e[m].state,u,0),Atomics.store(e[m].state,l,0)})}var y=class{constructor(e){this._value=e}deref(){return this._value}},b=class{register(){}unregister(){}};let x=process.env.NODE_V8_COVERAGE?b:global.FinalizationRegistry||b,S=process.env.NODE_V8_COVERAGE?y:global.WeakRef||y,C=new x(e=>{e.exited||e.terminate()});function w(e,t){let{filename:n,workerData:i}=t,c=new a((`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||o(__dirname,`lib`,`worker.js`),{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:n.indexOf(`file://`)===0?n:s(n).href,dataBuf:e[m].dataBuf,stateBuf:e[m].stateBuf,workerData:{$context:{threadStreamVersion:r},...i}}});return c.stream=new y(e),c.on(`message`,D),c.on(`exit`,ee),C.register(e,c),c}function T(e){p(!e[m].sync),e[m].needDrain&&(e[m].needDrain=!1,e.emit(`drain`))}function E(e){for(;;){let t=Atomics.load(e[m].state,l),n=e[m].data.length-t;if(n>0){if(e[m].bufLen===0){e[m].flushing=!1,e[m].ending?O(e):e[m].needDrain&&process.nextTick(T,e);return}ce(e,n,g);continue}if(n===0){if(t===0&&e[m].bufLen===0)return;re(e,()=>{e.destroyed||(v(e),E(e))});return}se(e,Error(`overwritten`));return}}function D(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 S(t),re(t,()=>{t[m].ready=!0,t.emit(`ready`)});break;case`ERROR`:se(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`){se(t,Error(`this should not happen: `+e.code));break}let n=t[m].flushCallbacks.get(e.id);n&&(t[m].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:se(t,Error(`this should not happen: `+e.code))}}function ee(e){let t=this.stream.deref();t!==void 0&&(C.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,ee),se(t,e===0?null:Error(`the worker thread exited`)))}var te=class extends i{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[m]={},this[m].stateBuf=new SharedArrayBuffer(128),this[m].state=new Int32Array(this[m].stateBuf),this[m].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[m].data=Buffer.from(this[m].dataBuf),this[m].sync=e.sync||!1,this[m].ending=!1,this[m].ended=!1,this[m].needDrain=!1,this[m].destroyed=!1,this[m].flushing=!1,this[m].ready=!1,this[m].finished=!1,this[m].errored=null,this[m].closed=!1,this[m].buf=[],this[m].bufHead=0,this[m].bufLen=0,this[m].flushCallbacks=new Map,this[m].nextFlushId=0,this.worker=w(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[m].destroyed)return oe(this,Error(`the worker has exited`)),!1;if(this[m].ending)return oe(this,Error(`the worker is ending`)),!1;if(this[m].flushing&&this[m].bufLen+t.length>=h)try{le(this),this[m].flushing=!0}catch(e){return se(this,e),!1}if(this[m].buf.push(t),this[m].bufLen+=t.length,this[m].sync)try{return le(this),!0}catch(e){return se(this,e),!1}return this[m].flushing||(this[m].flushing=!0,setImmediate(E,this)),this[m].needDrain=this[m].data.length-this[m].bufLen-Atomics.load(this[m].state,l)<=0,!this[m].needDrain}end(){this[m].destroyed||(this[m].ending=!0,O(this))}flush(e){e=typeof e==`function`?e:g,ne(this,t=>{if(t){process.nextTick(e,t);return}ie(this,e)})}flushSync(){this[m].destroyed||(le(this),ue(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[m].ready}get destroyed(){return this[m].destroyed}get closed(){return this[m].closed}get writable(){return!this[m].destroyed&&!this[m].ending}get writableEnded(){return this[m].ending}get writableFinished(){return this[m].finished}get writableNeedDrain(){return this[m].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[m].errored}};function ne(e,t){if(e[m].destroyed){process.nextTick(t,Error(`the worker has exited`));return}if(!e[m].sync&&(e[m].flushing||e[m].bufLen>0)){setImmediate(ne,e,t);return}re(e,t)}function re(e,t){let n=Atomics.load(e[m].state,l);c(e[m].state,u,n,1/0,(n,r)=>{if(n){se(e,n),t(n);return}if(r!==`ok`){re(e,t);return}t()})}function ie(e,t){if(e[m].destroyed){process.nextTick(t,Error(`the worker has exited`));return}if(!e[m].ready){let n=()=>{i(),ie(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[m].nextFlushId;e[m].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[m].flushCallbacks.delete(n),se(e,r),process.nextTick(t,r)}}function ae(e,t){let n=e[m].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 oe(e,t){setImmediate(()=>{e.emit(`error`,t)})}function se(e,t){e[m].destroyed||(e[m].destroyed=!0,ae(e,t),t&&(e[m].errored=t,oe(e,t)),e.worker.exited?setImmediate(()=>{e[m].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[m].closed=!0,e.emit(`close`)}))}function ce(e,t,n){let r=Atomics.load(e[m].state,l),i=t;for(;i>0&&e[m].bufLen!==0;){let t=e[m].bufHead,n=e[m].buf[t];if(n.length<=i){n.copy(e[m].data,r),r+=n.length,i-=n.length,e[m].bufLen-=n.length,e[m].bufHead=t+1,e[m].bufHead===e[m].buf.length?(e[m].buf.length=0,e[m].bufHead=0):e[m].bufHead>=1024&&e[m].bufHead*2>=e[m].buf.length&&(e[m].buf.splice(0,e[m].bufHead),e[m].bufHead=0);continue}n.copy(e[m].data,r,0,i),e[m].buf[t]=n.subarray(i),e[m].bufLen-=i,r+=i,i=0}return _(e,()=>{Atomics.store(e[m].state,l,r)}),n(),!0}function O(e){if(!(e[m].ended||!e[m].ending||e[m].flushing)){e[m].ended=!0;try{e.flushSync();let t=Atomics.load(e[m].state,u);_(e,()=>{Atomics.store(e[m].state,l,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[m].state,u,t,1e3),t=Atomics.load(e[m].state,u),t===-2){se(e,Error(`end() failed`));return}if(++n===10){se(e,Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[m].finished=!0,e.emit(`finish`)})}catch(t){se(e,t)}}}function le(e){let t=()=>{e[m].ending?O(e):e[m].needDrain&&process.nextTick(T,e)};for(e[m].flushing=!1;e[m].bufLen!==0;){let n=Atomics.load(e[m].state,l),r=e[m].data.length-n;if(r===0){ue(e),v(e);continue}else if(r<0)throw Error(`overwritten`);ce(e,r,t)}}function ue(e){if(e[m].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[m].state,l),n=0;for(;;){let r=Atomics.load(e[m].state,u);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[m].state,u,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}n.exports=te})),E$=i(((e,n)=>{let{createRequire:r}=t(`module`),{existsSync:i}=t(`node:fs`),a=b$(),{join:o,isAbsolute:s,sep:c}=t(`node:path`),{fileURLToPath:l}=t(`node:url`),u=C$(),d=T$(),f=Wfe();function p(e){d.register(e,y),d.registerBeforeExit(e,b),e.on(`close`,function(){d.unregister(e)})}function m(){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 h(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&&g(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++);continue}if((i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&g(i.slice(i.indexOf(`=`)+1))){r=!0;continue}n.push(i)}return r?n.join(` `):e}function g(e){let t=_(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=l(n)}catch{return!1}return s(n)&&!i(n)}function _(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function v(e,n,r,i,a){if(!r.execArgv&&m()&&t.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let e=h(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:e}})}r={...r,name:a};let o=new f({filename:e,workerData:n,workerOpts:r,sync:i});o.on(`ready`,s),o.on(`close`,function(){process.removeListener(`exit`,c)}),process.on(`exit`,c);function s(){process.removeListener(`exit`,c),o.unref(),r.autoEnd!==!1&&p(o)}function c(){o.closed||(o.flushSync(),u(100),o.end())}return o}function y(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function b(e){e.flushSync()}function x(e){let{pipeline:t,targets:n,levels:i,dedupe:l,worker:u={},caller:d=a(),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&&n)throw Error(`only one of target or targets can be specified`);n?(g=h[`pino-worker`]||o(__dirname,`worker.js`),p.targets=n.filter(e=>e.target).map(e=>({...e,target:y(e.target)})),p.pipelines=n.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:y(t.target)})))):t&&(g=h[`pino-worker`]||o(__dirname,`worker.js`),p.pipelines=[t.map(e=>({...e,target:y(e.target)}))]),i&&(p.levels=i),l&&(p.dedupe=l),p.pinoWillSendConfig=!0;let _=n||t?`pino.transport`:g;return v(y(g),p,u,f,_);function y(e){if(e=h[e]||e,s(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return o(__dirname,`..`,`file.js`);let t;for(let n of m)try{t=r(n===`node:repl`?process.cwd()+c:n).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}n.exports=x})),D$=i(((e,n)=>{let r=t(`node:diagnostics_channel`),i=Bfe(),{mapHttpRequest:a,mapHttpResponse:o}=y$(),s=w$(),c=T$(),{lsCacheSym:l,chindingsSym:u,writeSym:d,serializersSym:f,formatOptsSym:p,endSym:m,stringifiersSym:h,stringifySym:g,stringifySafeSym:_,wildcardFirstSym:v,nestedKeySym:y,formattersSym:b,messageKeySym:x,errorKeySym:S,nestedKeyStrSym:C,msgPrefixSym:w}=x$(),{isMainThread:T}=t(`worker_threads`),E=E$(),[D]=process.versions.node.split(`.`).map(e=>Number(e)),ee=r.tracingChannel(`pino_asJson`),te=D>=25?e=>JSON.stringify(e):ie;function ne(){}function re(e,t){if(!t)return n;return function(...r){t.call(this,r,n,e)};function n(t,...n){if(typeof t==`object`){let r=t;t!==null&&(t.method&&t.headers&&t.socket?t=a(t):typeof t.setHeader==`function`&&(t=o(t)));let s;r===null&&n.length===0?s=[null]:(r=n.shift(),s=n),typeof this[w]==`string`&&r!=null&&(r=this[w]+r),this[d](t,i(r,s,this[p]),e)}else{let r=t===void 0?n.shift():t;typeof this[w]==`string`&&r!=null&&(r=this[w]+r),this[d](null,i(r,n,this[p]),e)}}}function ie(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 ae(e,t,n,r){if(ee.hasSubscribers===!1)return oe.call(this,e,t,n,r);let i={instance:this,arguments};return ee.traceSync(oe,i,this,e,t,n,r)}function oe(e,t,n,r){let i=this[g],a=this[_],o=this[h],s=this[m],c=this[u],d=this[f],p=this[b],w=this[x],T=this[S],E=this[l][n]+r;E+=c;let D;p.log&&(e=p.log(e));let ee=o[v],ne=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){d[t]?D=d[t](D):t===T&&d.err&&(D=d.err(D));let e=o[t]||ee;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||te)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=te(t);ne+=`,`+n+`:`+D}let re=``;if(t!==void 0){D=d[w]?d[w](t):t;let e=o[w]||ee;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),re=`,"`+w+`":`+D;break;case`string`:D=(e||te)(D),re=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),re=`,"`+w+`":`+D}}return this[y]&&ne?E+this[C]+ne.slice(1)+`}`+re+s:E+ne+re+s}function se(e,t){let n,r=e[u],i=e[g],a=e[_],o=e[h],s=o[v],c=e[f],l=e[b].bindings;t=l(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 ce(e){return e.write!==e.constructor.prototype.write}function O(e){let t=new s(e);return t.on(`error`,n),!e.sync&&T&&(c.register(t,le),t.on(`close`,function(){c.unregister(t)})),t;function n(e){if(e.code===`EPIPE`){t.write=ne,t.end=ne,t.flushSync=ne,t.destroy=ne;return}t.removeListener(`error`,n),t.emit(`error`,e)}}function le(e,t){e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):e.flushSync())}function ue(e){return function(t,n,r={},i){if(typeof r==`string`)i=O({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=O({dest:i})}else if(r instanceof s||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof s||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=E({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:o}=r;return a===!1&&(r.level=`silent`),o||(r.onChild=ne),i||=ce(process.stdout)?process.stdout:O({fd:process.stdout.fd||1}),{opts:r,stream:i}}}function de(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[_])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function k(e,t,n){return{level:e,bindings:t,log:n}}function A(e){let t=Number(e);return typeof e==`string`&&Number.isFinite(t)?t:e===void 0?1:e}n.exports={noop:ne,buildSafeSonicBoom:O,asChindings:se,asJson:ae,genLog:re,createArgsNormalizer:ue,stringify:de,buildFormatters:k,normalizeDestFileDescriptor:A}})),O$=i(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),k$=i(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=x$(),{noop:l,genLog:u}=D$(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=O$(),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}})),A$=i(((e,t)=>{t.exports={version:`10.3.1`}})),Gfe=i(((e,n)=>{let{EventEmitter:r}=t(`node:events`),{lsCacheSym:i,levelValSym:a,setLevelSym:o,getLevelSym:s,chindingsSym:c,mixinSym:l,asJsonSym:u,writeSym:d,mixinMergeStrategySym:f,timeSym:p,timeSliceIndexSym:m,streamSym:h,serializersSym:g,formattersSym:_,errorKeySym:v,messageKeySym:y,useOnlyCustomLevelsSym:b,needsMetadataGsym:x,redactFmtSym:S,stringifySym:C,formatOptsSym:w,stringifiersSym:T,msgPrefixSym:E,hooksSym:D}=x$(),{getLevel:ee,setLevel:te,isLevelEnabled:ne,mappings:re,initialLsCache:ie,genLsCache:ae,assertNoLevelCollisions:oe}=k$(),{asChindings:se,asJson:ce,buildFormatters:O,stringify:le,noop:ue}=D$(),{version:de}=A$(),k=S$(),A={constructor:class{},child:pe,bindings:me,setBindings:he,flush:ge,isLevelEnabled:ne,version:de,get level(){return this[s]()},set level(e){this[o](e)},get levelVal(){return this[a]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[E]},get[Symbol.toStringTag](){return`Pino`},[i]:ie,[d]:M,[u]:ce,[s]:ee,[o]:te};Object.setPrototypeOf(A,r.prototype),n.exports=function(){return Object.create(A)};let fe=e=>e;function pe(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[g],r=this[_],i=Object.create(this);if(t==null)return i[_].bindings!==fe&&(i[_]=O(r.level,fe,r.log)),i[c]=se(i,e),this.onChild!==ue&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[g]=Object.create(null);for(let e in n)i[g][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var a=0;a<e.length;a++){let t=e[a];i[g][t]=n[t]}for(let e in t.serializers)i[g][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var s=0;s<r.length;s++){let e=r[s];i[g][e]=t.serializers[e]}}else i[g]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[_]=O(e||r.level,n||fe,a||r.log)}else i[_]=O(r.level,fe,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(oe(this.levels,t.customLevels),i.levels=re(t.customLevels,i[b]),ae(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=k(i.redact,le),n={stringify:e[S]};i[C]=le,i[T]=e,i[w]=n}if(typeof t.msgPrefix==`string`&&(i[E]=(this[E]||``)+t.msgPrefix),i[c]=se(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[o](e)}return this.onChild(i),i}function me(){let e=`{${this[c].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function he(e){let t=se(this,e);this[c]=t}function j(e,t){return Object.assign(t,e)}function M(e,t,n){let r=this[p](),i=this[l],a=this[v],o=this[y],s=this[f]||j,c,d=this[D].streamWrite;e==null?c={}:e instanceof Error?(c={[a]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(c=s(c,i(c,n,this)));let g=this[u](c,t,n,r),_=this[h];_[x]===!0&&(_.lastLevel=n,_.lastObj=c,_.lastMsg=t,_.lastTime=r.slice(this[m]),_.lastLogger=this),_.write(d?d(g):g)}function ge(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[h];typeof t.flush==`function`?t.flush(e||ue):e&&e()}})),Kfe=i(((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?!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?!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}})),qfe=i(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=O$(),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})),Jfe=i(((e,n)=>{let r=t(`node:os`),i=y$(),a=b$(),o=S$(),s=zfe(),c=Gfe(),l=x$(),{configure:u}=Kfe(),{assertDefaultLevelFound:d,mappings:f,genLsCache:p,genLevelComparison:m,assertLevelComparison:h}=k$(),{DEFAULT_LEVELS:g,SORTING_ORDER:_}=O$(),{createArgsNormalizer:v,asChindings:y,buildSafeSonicBoom:b,buildFormatters:x,stringify:S,normalizeDestFileDescriptor:C,noop:w}=D$(),{version:T}=A$(),{chindingsSym:E,redactFmtSym:D,serializersSym:ee,timeSym:te,timeSliceIndexSym:ne,streamSym:re,stringifySym:ie,stringifySafeSym:ae,stringifiersSym:oe,setLevelSym:se,endSym:ce,formatOptsSym:O,messageKeySym:le,errorKeySym:ue,nestedKeySym:de,mixinSym:k,levelCompSym:A,useOnlyCustomLevelsSym:fe,formattersSym:pe,hooksSym:me,nestedKeyStrSym:he,mixinMergeStrategySym:j,msgPrefixSym:M}=l,{epochTime:ge,nullTime:_e}=s,{pid:ve}=process,ye=r.hostname(),be=i.err,xe=v({level:`info`,levelComparison:_.ASC,levels:g,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:ve,hostname:ye},serializers:Object.assign(Object.create(null),{err:be}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:ge,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),Se=Object.assign(Object.create(null),i);function Ce(...e){let t={},{opts:n,stream:r}=xe(t,a(),...e);n.level&&typeof n.level==`string`&&g[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:i,crlf:s,serializers:l,timestamp:_,messageKey:v,errorKey:b,nestedKey:C,base:T,name:ve,level:ye,customLevels:be,levelComparison:Se,mixin:Ce,mixinMergeStrategy:we,useOnlyCustomLevels:Te,formatters:Ee,hooks:De,depthLimit:Oe,edgeLimit:ke,onChild:Ae,msgPrefix:je}=n,Me=u({maximumDepth:Oe,maximumBreadth:ke}),Ne=x(Ee.level,Ee.bindings,Ee.log),Pe=S.bind({[ae]:Me}),Fe=i?o(i,Pe):{},Ie=i?{stringify:Fe[D]}:{stringify:Pe},Le=`}`+(s?`\r
416
416
  `:`
@@ -1516,6 +1516,6 @@ export default function okBridge(pi: {
1516
1516
  `))}function j9(e,t){let n=S(e,`utf-8`);if(n.trim().length!==0)try{let r=k9(JSON.parse(n),t),i=n.endsWith(`
1517
1517
  `)?`
1518
1518
  `:``;ne(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=O9(n,t.contentDir);r!==n&&ne(e,r)}}function M9(e,t){let n=S(e,`utf-8`),r=O9(n,t.contentDir);r!==n&&ne(e,r)}function N9(e){try{return C(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>M(e,t.name))}catch{return[]}}const fSe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function P9(e){return/\.log\.\d+$/.test(e)}function pSe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||P9(e)}function mSe(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of N9(M(e.stagingDir,n)))pSe(r)?A9(r,t):r.endsWith(`.json`)?j9(r,t):M9(r,t);for(let n of N9(M(e.stagingDir,`state`))){let e=pe(n);n.endsWith(`.jsonl`)?A9(n,t):fSe.has(e)?j9(n,t):M9(n,t)}}const F9=[`.ok`,`local`,`telemetry`],I9=[`.ok`,`local`,`logs`],L9=[`.ok`,`local`,`loss-capture`],R9=`spans-current.jsonl`,z9=`spans-prev.jsonl`,B9=`server-current.jsonl`,V9=`server-prev.jsonl`,H9=`loss-current.jsonl`,U9=`loss-prev.jsonl`;function hSe(e){return M(e,...F9,R9)}function gSe(e){return M(e,...F9,z9)}function _Se(e){return M(e,...I9,B9)}function vSe(e){return M(e,...I9,V9)}function ySe(e){return M(e,...L9,H9)}function bSe(e){return M(e,...L9,U9)}const W9=1e3;async function xSe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function SSe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}async function CSe(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(W9)});return t.ok?await t.text():null}catch{return null}}function wSe(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
1519
- `)}\n`:null}catch{return null}}function TSe(e){let t=M(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],B3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function ESe(e){let t=M(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],B3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function G9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function DSe(){return{nodeVersion:process.version,platform:O(),arch:ie()}}function OSe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!g(e))return{};let t;try{t=(0,Zt.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!K9(t))return{};let n=t.telemetry;if(!K9(n))return{};let r=n.localSink;return K9(r)?r:{}}function J9(e){return typeof e==`boolean`?e:void 0}function kSe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return kSe(e.maxBytes)}function ASe(e){let t=q9(g$(`project`,e)),n=q9(g$(`project-local`,e));return{enabled:J9(n.enabled)??J9(t.enabled)??!0,spansMaxBytes:Y9(n.spans)??Y9(t.spans)??52428800,logsMaxBytes:Y9(n.logs)??Y9(t.logs)??26214400}}function jSe(e){return je(`sha256`).update(e).digest(`hex`)}function MSe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function NSe(e){let t=S(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X9(e,t){if(!g(e))return!1;try{return v(me(t),{recursive:!0}),m(e,t),!0}catch{return!1}}function Z9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=M(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const PSe=new Set([`.jsonl`]);function Q9(e){let t=e.lastIndexOf(`.`);return t===-1?!1:PSe.has(e.slice(t))}const FSe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function ISe(e){if(P9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:FSe.has(e.slice(t))}function LSe(e){let t=[];for(let n of Z9(e)){let r=$9(e,n);if(!ISe(r))continue;let{redacted:i,patterns:a,lineCount:o}=zo(S(n,`utf-8`));a.length!==0&&(ne(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return ve(e,t).split(be).join(`/`)}async function RSe(e){let t=ye(e.contentDir),n=ye(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??xSe,a=r.fetchAgentEffects??SSe,o=r.fetchWatcherRecent??CSe,s=r.readShadowHead??TSe,c=r.readCheckpointRefs??ESe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.49.0-beta.29`),d=r.readDesktopEnv??G9,f=r.readRuntime??DSe,p=r.isOtlpPushEnabled??OSe,h=y(M(ue(),`ok-bundle-`));try{v(M(h,`telemetry`),{recursive:!0}),v(M(h,`logs`),{recursive:!0}),v(M(h,`state`),{recursive:!0}),X9(hSe(n),M(h,`telemetry`,R9)),X9(gSe(n),M(h,`telemetry`,z9)),X9(_Se(n),M(h,`logs`,B9)),X9(vSe(n),M(h,`logs`,V9));for(let t of e.userLogFiles??[])X9(t,M(h,`logs`,pe(t)));let _=M(n,`.ok`,`local`),y=M(_,`server.lock`),b=`not-running`,x=`no server.lock`,C=null;if(g(y)){X9(y,M(h,`state`,`server.lock`));try{let e=S(y,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?C=t.port:x=`lock present but no port`}catch{x=`lock present but unparseable`}}if(C!==null){let e=await i(C);e===null?x=`agent-presence endpoint at :${C} unreachable`:(ne(M(h,`state`,`agent-presence.json`),e),b=`running`,x=``);let t=await a(C);t!==null&&ne(M(h,`state`,`agent-effects.json`),t);let n=await o(C);if(n!==null){let e=wSe(n);e!==null&&ne(M(h,`state`,`watcher-recent.jsonl`),e)}}let w=s(t);w!==null&&ne(M(h,`state`,`shadow-head.txt`),w);let T=c(t);T!==null&&ne(M(h,`state`,`checkpoint-refs.txt`),T),X9(ySe(n),M(h,`state`,H9)),X9(bSe(n),M(h,`state`,U9)),X9(M(_,`last-spawn-error.log`),M(h,`state`,`last-spawn-error.log`)),X9(M(_,lY),M(h,`state`,lY)),X9(M(_,uY),M(h,`state`,uY));let E=f(),te=d(),re={ok:{version:u(),nodeVersion:E.nodeVersion,platform:E.platform,arch:E.arch},host:{desktop:te}};ne(M(h,`state`,`runtime.json`),`${JSON.stringify(re,null,2)}\n`);let ie=b===`running`?`running
1519
+ `)}\n`:null}catch{return null}}function TSe(e){let t=M(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`log`,`--oneline`,`-50`],B3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function ESe(e){let t=M(e,`.git`,`ok`);if(!g(t))return null;let n=u(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],B3({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function G9(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function DSe(){return{nodeVersion:process.version,platform:O(),arch:ie()}}function OSe(){return process.env.OTEL_SDK_DISABLED===`false`}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q9(e){if(!g(e))return{};let t;try{t=(0,Zt.parse)(S(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!K9(t))return{};let n=t.telemetry;if(!K9(n))return{};let r=n.localSink;return K9(r)?r:{}}function J9(e){return typeof e==`boolean`?e:void 0}function kSe(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y9(e){if(K9(e))return kSe(e.maxBytes)}function ASe(e){let t=q9(g$(`project`,e)),n=q9(g$(`project-local`,e));return{enabled:J9(n.enabled)??J9(t.enabled)??!0,spansMaxBytes:Y9(n.spans)??Y9(t.spans)??52428800,logsMaxBytes:Y9(n.logs)??Y9(t.logs)??26214400}}function jSe(e){return je(`sha256`).update(e).digest(`hex`)}function MSe(e){let t=S(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function NSe(e){let t=S(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X9(e,t){if(!g(e))return!1;try{return v(me(t),{recursive:!0}),m(e,t),!0}catch{return!1}}function Z9(e){let t=[],n=e=>{let r=C(e,{withFileTypes:!0});for(let i of r){let r=M(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const PSe=new Set([`.jsonl`]);function Q9(e){let t=e.lastIndexOf(`.`);return t===-1?!1:PSe.has(e.slice(t))}const FSe=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function ISe(e){if(P9(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:FSe.has(e.slice(t))}function LSe(e){let t=[];for(let n of Z9(e)){let r=$9(e,n);if(!ISe(r))continue;let{redacted:i,patterns:a,lineCount:o}=zo(S(n,`utf-8`));a.length!==0&&(ne(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function $9(e,t){return ve(e,t).split(be).join(`/`)}async function RSe(e){let t=ye(e.contentDir),n=ye(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??xSe,a=r.fetchAgentEffects??SSe,o=r.fetchWatcherRecent??CSe,s=r.readShadowHead??TSe,c=r.readCheckpointRefs??ESe,l=r.now??(()=>new Date),u=r.okVersion??(()=>`0.49.0-beta.30`),d=r.readDesktopEnv??G9,f=r.readRuntime??DSe,p=r.isOtlpPushEnabled??OSe,h=y(M(ue(),`ok-bundle-`));try{v(M(h,`telemetry`),{recursive:!0}),v(M(h,`logs`),{recursive:!0}),v(M(h,`state`),{recursive:!0}),X9(hSe(n),M(h,`telemetry`,R9)),X9(gSe(n),M(h,`telemetry`,z9)),X9(_Se(n),M(h,`logs`,B9)),X9(vSe(n),M(h,`logs`,V9));for(let t of e.userLogFiles??[])X9(t,M(h,`logs`,pe(t)));let _=M(n,`.ok`,`local`),y=M(_,`server.lock`),b=`not-running`,x=`no server.lock`,C=null;if(g(y)){X9(y,M(h,`state`,`server.lock`));try{let e=S(y,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?C=t.port:x=`lock present but no port`}catch{x=`lock present but unparseable`}}if(C!==null){let e=await i(C);e===null?x=`agent-presence endpoint at :${C} unreachable`:(ne(M(h,`state`,`agent-presence.json`),e),b=`running`,x=``);let t=await a(C);t!==null&&ne(M(h,`state`,`agent-effects.json`),t);let n=await o(C);if(n!==null){let e=wSe(n);e!==null&&ne(M(h,`state`,`watcher-recent.jsonl`),e)}}let w=s(t);w!==null&&ne(M(h,`state`,`shadow-head.txt`),w);let T=c(t);T!==null&&ne(M(h,`state`,`checkpoint-refs.txt`),T),X9(ySe(n),M(h,`state`,H9)),X9(bSe(n),M(h,`state`,U9)),X9(M(_,`last-spawn-error.log`),M(h,`state`,`last-spawn-error.log`)),X9(M(_,lY),M(h,`state`,lY)),X9(M(_,uY),M(h,`state`,uY));let E=f(),te=d(),re={ok:{version:u(),nodeVersion:E.nodeVersion,platform:E.platform,arch:E.arch},host:{desktop:te}};ne(M(h,`state`,`runtime.json`),`${JSON.stringify(re,null,2)}\n`);let ie=b===`running`?`running
1520
1520
  `:`not-running (${x})\n`;if(ne(M(h,`state`,`server-status.txt`),ie),e.processDir&&g(e.processDir)){let t=M(h,`process`);v(t,{recursive:!0}),m(e.processDir,t,{recursive:!0})}let ae=e.redact===!0;ae&&mSe({stagingDir:h,contentDir:t}),e.note&&ne(M(h,`note.txt`),e.note);let oe=null;e.scrubSecrets===!0&&(oe=LSe(h));for(let t of e.extraFiles??[])X9(t.sourcePath,M(h,`extra`,t.zipName??pe(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let se=ASe(n),ce=Z9(h),O=[],le=0,ue=0;for(let e of ce){let t=$9(h,e),n=ee(e).size,r=Q9(t)?MSe(e):0;O.push({path:t,bytes:n,lines:r}),le+=n,t.startsWith(`telemetry/`)&&Q9(t)&&(ue+=NSe(e))}let de={applied:ae};oe!==null&&(de.secretScrub=oe);let k={schemaVersion:2,createdAt:l().toISOString(),ok:{version:u(),nodeVersion:E.nodeVersion,platform:E.platform,arch:E.arch},host:{desktop:te},contentDir:{pathSha256:jSe(t),absolutePath:ae?`<CONTENT_DIR>`:t},telemetry:{localSink:se,otlpPushEnabled:p()},redaction:de,serverStatus:b,files:O};ne(M(h,`manifest.json`),`${JSON.stringify(k,null,2)}\n`);let A=ce.some(e=>{try{return S(e,`utf-8`).includes(t)}catch{return!1}}),fe={totalBytes:le,fileCount:O.length,docNameCount:ue,contentDirVisible:A,redacted:ae},me=!1;return{stagingDir:h,manifest:k,summary:fe,cleanup:()=>{me||(me=!0,D(h,{recursive:!0,force:!0}))}}}catch(e){throw D(h,{recursive:!0,force:!0}),e}}async function zSe(e){let{collected:t,outputPath:n}=e,r=me(n);if(!g(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new S_e.ZipFile,a=Z9(t.stagingDir);for(let e of a){let n=$9(t.stagingDir,e);i.addFile(e,n)}i.end();let o=h(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function BSe(e,t){let n=M(e,`.ok`,`config.yml`);if(g(n))try{let t=(0,Zt.parse)(S(n,`utf-8`)),r=R7(t)?t.content:void 0,i=R7(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return ye(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return ye(e)}async function VSe(e,t,n){let r=m9(t,e.logger),i=await RSe({contentDir:BSe(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:Lxe(r,e.userLogsDir??M(se(),`.ok`,`logs`)),deps:{readDesktopEnv:n,logger:e.logger}});try{v(me(e.outputPath),{recursive:!0}),await zSe({collected:i,outputPath:e.outputPath});let t=i.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:r,files:i.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:i.manifest.createdAt}}}finally{i.cleanup()}}async function HSe(e){let{projectDir:t}=e,n=e.readDesktopEnv??G9;if(e.level===`full`&&t!==void 0)return VSe(e,t,n);let{zipPath:r,summary:i}=await Bxe({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n()});return{zipPath:r,summary:{level:e.level,systemWide:t===void 0,projectSlug:i.projectSlug,files:i.files,redactions:i.redactions,redactedLineCount:i.redactedLineCount,generatedAt:i.generatedAt}}}export{U5 as ALL_EDITOR_IDS,W5 as EDITOR_LABELS,d7 as EDITOR_TARGETS,G5 as HOSTS_WITH_USER_SKILL_DIR,Oxe as LAUNCH_CONFIG_NAME,nSe as PATH_SHIM_BEGIN,iSe as PATH_SHIM_BLOCK_RE,rSe as PATH_SHIM_END,uxe as addOkPathsToGitExclude,A7 as assertProjectPathSafe,e7 as buildManagedServerEntry,Kxe as buildMcpConfigDeclineEvent,qxe as buildMcpConfigMigrateEvent,f9 as classifyExistingMcpEntry,HSe as collectReportBundle,tn as createTokenStore,Pxe as defaultBugReportZipPath,Ve as detectGh,Mxe as detectInstalledEditors,sbe as editorConfigPathDisplay,obe as editorEntryLocator,q7 as formatTrackedRemediation,pxe as getExcludedOkPaths,G7 as getOkArtifactPaths,Q5 as isEntryUpToDate,t7 as isOwnManagedEntry,$xe as loadConfig,dee as makeLazyProbeTokenStore,p9 as okBugReportsDir,w9 as parseGitHubBlobUrl,eSe as parseGitHubShareUrl,T9 as parseGitHubTreeUrl,C9 as parseGitUrl,aSe as pathInstallMarkerPath,Vbe as previewContent,Nxe as probeOwnManagedEditorMcpEntry,K7 as probeTrackedOkPaths,u9 as readExistingMcpEntry,fxe as readSharingMode,mxe as readSkillsShared,zo as redactContent,dxe as removeOkPathsFromGitExclude,Hxe as removeOwnMcpEntry,$be as removeProjectSkill,sSe as removeUserGlobalSkillBundle,Ybe as resolveProjectRoot,Xxe as runStop,hxe as setSkillsShared,b9 as truncatePriorEntry,D9 as userGlobalSkillBundleTargets,tSe as validateLocalFolderForShare,l9 as writeEditorMcpConfig,uSe as writeProjectAiIntegrations,N7 as writeProjectSkill,jxe as writeUserMcpConfigs};
1521
1521
  //# sourceMappingURL=index.mjs.map