@nervekit/desktop 0.40.2 → 0.41.1

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 (234) hide show
  1. package/README.md +5 -2
  2. package/THIRD-PARTY-LICENSES.txt +964 -4
  3. package/dist/bin.js +1 -0
  4. package/dist/{chunk-YJT4NXMV.js → chunk-2ICPO4UM.js} +5 -5
  5. package/dist/{chunk-EX63VKXY.js → chunk-3CZXUKLG.js} +1 -1
  6. package/dist/{chunk-KTGSBL6T.js → chunk-4OCDR4DU.js} +11 -11
  7. package/dist/{chunk-BNVMNV4O.js → chunk-62DQXVPO.js} +2 -2
  8. package/dist/{chunk-K2J2VZXO.js → chunk-6GUJQURI.js} +2 -2
  9. package/dist/{chunk-VBM7TD3X.js → chunk-6IHXVT5H.js} +1 -1
  10. package/dist/{chunk-KBNEZR7T.js → chunk-6ZS7TA6E.js} +2 -2
  11. package/dist/{chunk-O6U226AI.js → chunk-7FSH3ABG.js} +4 -4
  12. package/dist/{chunk-RPLBWENJ.js → chunk-7HGFEQSD.js} +5 -5
  13. package/dist/{chunk-XZYFB566.js → chunk-7RPHIJT3.js} +4 -4
  14. package/dist/{chunk-WRTA5G57.js → chunk-APY4TUR3.js} +188 -1
  15. package/dist/{chunk-YUO5V75X.js → chunk-BACYVEE6.js} +2 -2
  16. package/dist/{chunk-H2G55ZPG.js → chunk-BG2KGLIA.js} +2 -2
  17. package/dist/{chunk-7JQBECUL.js → chunk-BN5YDZUZ.js} +1205 -326
  18. package/dist/chunk-BUD4JHBZ.js +7017 -0
  19. package/dist/{chunk-TSV3PFU2.js → chunk-DDBE2VLT.js} +2 -2
  20. package/dist/{chunk-WJULIJOU.js → chunk-EF7ZZKA3.js} +3 -3
  21. package/dist/{chunk-HOCODVKL.js → chunk-EUT45AKW.js} +16 -16
  22. package/dist/{chunk-C6RO4LP3.js → chunk-FCAIYPDJ.js} +2 -2
  23. package/dist/{chunk-6FSDDGFZ.js → chunk-FZ557YWE.js} +47478 -52993
  24. package/dist/{chunk-VC6TX2Y2.js → chunk-HPINJGBO.js} +5 -5
  25. package/dist/{chunk-ANI6J75M.js → chunk-IRRR3PWN.js} +7 -7
  26. package/dist/{chunk-S62LLS4I.js → chunk-IVBMHEPK.js} +12 -12
  27. package/dist/{chunk-SU2USXTD.js → chunk-JBEWFFOK.js} +1 -1
  28. package/dist/{chunk-3VZR3ZUY.js → chunk-KEXKZKN4.js} +6 -6
  29. package/dist/{chunk-ODS5QROC.js → chunk-KUFIFCB4.js} +1 -1
  30. package/dist/{chunk-L2DHKP5C.js → chunk-L5WGVYXM.js} +2 -2
  31. package/dist/{chunk-WIN7KHMV.js → chunk-LGIIT2NF.js} +12 -12
  32. package/dist/{chunk-2BKMOJYJ.js → chunk-LP4APBBQ.js} +1 -1
  33. package/dist/{chunk-6PACEIUY.js → chunk-MI6L5CEA.js} +2 -2
  34. package/dist/{chunk-HDBDYGJQ.js → chunk-N4OXAS3A.js} +1 -1
  35. package/dist/{chunk-KSSM6LUI.js → chunk-N6BUYKF3.js} +5 -5
  36. package/dist/{chunk-MWIKZIAI.js → chunk-NVVW3MWJ.js} +9 -9
  37. package/dist/{chunk-VTDI5KP7.js → chunk-O5JHHRFN.js} +19 -19
  38. package/dist/{chunk-F3MHINI6.js → chunk-O6FDXE54.js} +16 -16
  39. package/dist/{chunk-E4JNHQGT.js → chunk-OMCM3MHS.js} +7 -7
  40. package/dist/{chunk-PST63OUS.js → chunk-OO2KD2L2.js} +18295 -4318
  41. package/dist/{chunk-7FLZA2BD.js → chunk-P72Y5ZBH.js} +7 -7
  42. package/dist/{chunk-O2652RWY.js → chunk-PVPJAGWR.js} +2 -2
  43. package/dist/{chunk-UDC7NPQJ.js → chunk-Q3C7TQ2M.js} +3 -3
  44. package/dist/{chunk-B4IE2GAM.js → chunk-Q5E4ZL2R.js} +1 -1
  45. package/dist/{chunk-5NN7JAJ2.js → chunk-QFK2SWD2.js} +7 -7
  46. package/dist/{chunk-SHEU5KLD.js → chunk-RJR7DJJK.js} +3 -3
  47. package/dist/{chunk-4H3WR7IT.js → chunk-RL52LSTV.js} +1 -1
  48. package/dist/{chunk-FGZX4Q7W.js → chunk-RTB6CF7F.js} +15 -15
  49. package/dist/{chunk-QBAIDKF6.js → chunk-TQURLRHD.js} +1 -1
  50. package/dist/{chunk-3SSNDIQT.js → chunk-TSAUBRRU.js} +1 -1
  51. package/dist/{chunk-ER2ES2RH.js → chunk-U3TEC52G.js} +1 -1
  52. package/dist/{chunk-XY53EFK3.js → chunk-U5KGV63C.js} +1 -1
  53. package/dist/{chunk-WYPVD3HW.js → chunk-UVRULOOP.js} +10 -10
  54. package/dist/{chunk-4VPX67B7.js → chunk-VOATSLRG.js} +3 -1
  55. package/dist/{chunk-TGKIV3F4.js → chunk-W7LEYYFH.js} +18 -18
  56. package/dist/{chunk-T6NRMNLQ.js → chunk-WC5HHPPM.js} +1 -1
  57. package/dist/{chunk-YQFENES6.js → chunk-WG62RHZ2.js} +3 -3
  58. package/dist/{chunk-XE2E2KBP.js → chunk-WIQEPAUG.js} +10 -10
  59. package/dist/{chunk-DTGL5P2V.js → chunk-XM27UVWN.js} +3 -3
  60. package/dist/{chunk-3JJN36GV.js → chunk-XTUSLUQ7.js} +16 -16
  61. package/dist/{chunk-OAEV22IW.js → chunk-Z6AY5VOZ.js} +6 -6
  62. package/dist/{chunk-FZ5N6WXF.js → chunk-ZGWXLG5X.js} +18 -18
  63. package/dist/{chunk-6TAN6WG6.js → chunk-ZUWBEV2O.js} +1 -1
  64. package/dist/{chunk-OANTMDXI.js → chunk-ZVH6EB7S.js} +1 -1
  65. package/dist/daemon.js +65 -31
  66. package/dist/extension-assets/atlassian/docs/confluence-raw.md +31 -0
  67. package/dist/extension-assets/atlassian/docs/confluence-writing.md +101 -0
  68. package/dist/extension-assets/atlassian/docs/jira-raw.md +16 -0
  69. package/dist/extension-assets/atlassian/docs/jira-workflows.md +77 -0
  70. package/dist/extension-assets/atlassian/docs/project-knowledge.md +25 -0
  71. package/dist/extension-assets/atlassian/docs/storage.md +58 -0
  72. package/dist/extension-assets/atlassian/icon.svg +20 -0
  73. package/dist/extension-assets/diagram/docs/diagrams.md +12 -0
  74. package/dist/extension-assets/imagegen/docs/imagegen.md +17 -0
  75. package/dist/extension-assets/web-search/icon.svg +1 -0
  76. package/dist/git-isolated-reader-helper.js +1 -1
  77. package/dist/html-to-markdown.worker.js +6 -7028
  78. package/dist/main.js +583 -169
  79. package/dist/preload.cjs +45 -2
  80. package/dist/quick-script-docs/runtime/documents.md +54 -0
  81. package/dist/quick-script-docs/runtime/files.md +11 -0
  82. package/dist/quick-script-docs/runtime/images.md +10 -0
  83. package/dist/sandbox-libraries/docx.LICENSE +21 -0
  84. package/dist/sandbox-libraries/docx.min.js +9 -0
  85. package/dist/sandbox-libraries/jszip.LICENSE +651 -0
  86. package/dist/sandbox-libraries/jszip.min.js +13 -0
  87. package/dist/sandbox-libraries/mammoth.LICENSE +22 -0
  88. package/dist/sandbox-libraries/mammoth.browser.min.js +13 -0
  89. package/dist/sandbox-libraries/papaparse.LICENSE +20 -0
  90. package/dist/sandbox-libraries/papaparse.min.js +7 -0
  91. package/dist/sandbox-libraries/pptxgen.bundle.js +96 -0
  92. package/dist/sandbox-libraries/pptxgenjs.LICENSE +21 -0
  93. package/dist/sandbox-libraries/xlsx.LICENSE +201 -0
  94. package/dist/sandbox-libraries/xlsx.full.min.js +24 -0
  95. package/dist/web/assets/{AsyncBashCenterHost-BvXKoCVr.js → AsyncBashCenterHost-D2Sy43Ub.js} +1 -1
  96. package/dist/web/assets/ConversationListItem-DvxCcAYm.js +3 -0
  97. package/dist/web/assets/ConversationsWorkbenchPanel-YeNq9LRn.js +1 -0
  98. package/dist/web/assets/DiscoverCenterHost-B6K-QnBF.js +1 -0
  99. package/dist/web/assets/{FileCenterHost-C_7XZAFZ.js → FileCenterHost-Dlk53K5G.js} +1 -1
  100. package/dist/web/assets/FilesWorkbenchPanel-PeCu12oU.js +12 -0
  101. package/dist/web/assets/{GitDiffCenterHost-Cr7lqGI_.js → GitDiffCenterHost-3_Ea0RyG.js} +1 -1
  102. package/dist/web/assets/{GitWorkbenchPanel-BFbwUgIN.js → GitWorkbenchPanel-CYvCkOAW.js} +1 -1
  103. package/dist/web/assets/{LaunchCenterHost-CIu7bcoZ.js → LaunchCenterHost-CP773N_3.js} +1 -1
  104. package/dist/web/assets/LaunchConfigurationNotice-CtmZ1uIQ.js +1 -0
  105. package/dist/web/assets/{LaunchesWorkbenchPanel-BqzJvsrj.js → LaunchesWorkbenchPanel-DP3yVfkO.js} +1 -1
  106. package/dist/web/assets/LogsCenterHost-BFP0doQf.js +1 -0
  107. package/dist/web/assets/{MermaidCenterHost-DVsZB8nB.js → MermaidCenterHost-Bjl6Dvrq.js} +1 -1
  108. package/dist/web/assets/MobileFilesBody-CDp21MGZ.js +1 -0
  109. package/dist/web/assets/{MobileFilesHost-D843vkDF.js → MobileFilesHost-DlJI_yau.js} +1 -1
  110. package/dist/web/assets/MobileLaunchOutputHost-y3TehLWF.js +1 -0
  111. package/dist/web/assets/MobileLaunchesHost-CBNtDTrs.js +2 -0
  112. package/dist/web/assets/MobileLogsHost-BSb2lydK.js +1 -0
  113. package/dist/web/assets/MobileNoteEditorHost-7yW7hIC2.js +1 -0
  114. package/dist/web/assets/{MobileNotesHost-meLV39Yw.js → MobileNotesHost-CvDHzpAh.js} +1 -1
  115. package/dist/web/assets/{MobileProjectSettingsHost-A49Fdn54.js → MobileProjectSettingsHost-CjtPfyKT.js} +1 -1
  116. package/dist/web/assets/{MobileProjectSettingsPageHost-BXpUqS_N.js → MobileProjectSettingsPageHost-j_7N-B9L.js} +1 -1
  117. package/dist/web/assets/{MobileSettingsHost-DPKPajzI.js → MobileSettingsHost-DXIKNF01.js} +1 -1
  118. package/dist/web/assets/{MobileSettingsPageHost-izNWGN0i.js → MobileSettingsPageHost-CEzo7J9p.js} +1 -1
  119. package/dist/web/assets/MobileSettingsPageScreen-99wMLRsn.js +1 -0
  120. package/dist/web/assets/NotesWorkbenchPanel-DqTwXBBv.js +1 -0
  121. package/dist/web/assets/ProjectSettingsCenterHost-D96cL0uH.js +1 -0
  122. package/dist/web/assets/{PullRequestCenterHost-BYkWxXQe.js → PullRequestCenterHost-DY0yPDK2.js} +1 -1
  123. package/dist/web/assets/PullRequestsWorkbenchPanel-D07LE8vJ.js +1 -0
  124. package/dist/web/assets/{SearchWorkbenchPanel-DaC0smfe.js → SearchWorkbenchPanel-D2_3iXo8.js} +1 -1
  125. package/dist/web/assets/SettingsCenter-BQWc24di.js +1 -0
  126. package/dist/web/assets/SettingsCenterHost-BvgNfeZN.js +1 -0
  127. package/dist/web/assets/{SystemPromptCenterHost-B1hfsfAn.js → SystemPromptCenterHost-BLHkB7lp.js} +1 -1
  128. package/dist/web/assets/activity-notices-C9aphS1s.js +1 -0
  129. package/dist/web/assets/adapters-DNU88KT0.js +1 -0
  130. package/dist/web/assets/agent-profiles.svelte-DgI8wSS2.js +1 -0
  131. package/dist/web/assets/api-CHNbLvvY.js +1 -0
  132. package/dist/web/assets/center-tabs.svelte-CyhCD_6b.js +1 -0
  133. package/dist/web/assets/channel-6wGoOwGx.js +57 -0
  134. package/dist/web/assets/circle-question-mark-C7NgqbLL.js +1 -0
  135. package/dist/web/assets/code-DJR0pnqV.js +7 -0
  136. package/dist/web/assets/{confirm-dialog-Bw_IxcZD.js → confirm-dialog-BDjzMiC4.js} +1 -1
  137. package/dist/web/assets/{conversation-connection-3GxIuhbS.js → conversation-connection-mLNyfV2d.js} +1 -1
  138. package/dist/web/assets/dialog-CkRcLEJT.js +1 -0
  139. package/dist/web/assets/discover-Dh4m7djO.js +4 -0
  140. package/dist/web/assets/dist-DSApqEag.js +1 -0
  141. package/dist/web/assets/file-tabs.svelte-cX3MMyG6.js +2 -0
  142. package/dist/web/assets/filesystem-BbIXrkGB.js +1 -0
  143. package/dist/web/assets/{git-store.svelte-CM5k7yRU.js → git-store.svelte-D3uwRVnj.js} +1 -1
  144. package/dist/web/assets/{git.api-D2CfUXZW.js → git.api-CTu-tG8A.js} +1 -1
  145. package/dist/web/assets/index-BrxjAwg0.js +46 -0
  146. package/dist/web/assets/index-yEOHI1Z7.css +1 -0
  147. package/dist/web/assets/launches-CC4gLnSa.js +5 -0
  148. package/dist/web/assets/{launches.api-BZxyWF8t.js → launches.api-CaotSs6l.js} +1 -1
  149. package/dist/web/assets/launches.svelte-DDA5J-RZ.js +2 -0
  150. package/dist/web/assets/{message-square-CqLxHJuW.js → list-checks-zV9Dp7Cu.js} +1 -1
  151. package/dist/web/assets/{logs.api-Coi8HJuy.js → logs.api-DMmVlkSz.js} +1 -1
  152. package/dist/web/assets/{maintenance-state.svelte-CDO9i4dk.js → maintenance-state.svelte-l9v7Hg3i.js} +2 -2
  153. package/dist/web/assets/notify.svelte-BTEXJZ8P.js +1 -0
  154. package/dist/web/assets/popover-panel-C-weKOk3.js +5 -0
  155. package/dist/web/assets/pr-view-loader.svelte-C0NClMS6.js +1 -0
  156. package/dist/web/assets/progress-CKEsTSOk.js +1 -0
  157. package/dist/web/assets/scratch-notes-state.svelte-B_rY_-9q.js +1 -0
  158. package/dist/web/assets/{scratch-notes.api-Cbvag3bv.js → scratch-notes.api-B2gOOK6Z.js} +1 -1
  159. package/dist/web/assets/search-input-CEr0SmAB.js +1 -0
  160. package/dist/web/assets/settings-2-CWd8Y06n.js +1 -0
  161. package/dist/web/assets/settings-CRmC19nG.js +1 -0
  162. package/dist/web/assets/settings-CXoAzSmm.js +1 -0
  163. package/dist/web/assets/settings-actions.svelte-BB6u_lQ0.js +1 -0
  164. package/dist/web/assets/settings-page-controllers.svelte-al78EDTL.js +29 -0
  165. package/dist/web/assets/sheet-content-DauQ7hPL.js +1 -0
  166. package/dist/web/assets/shell-CYbWnH52.js +4 -0
  167. package/dist/web/assets/shell-layout.svelte-CmEWk428.js +2 -0
  168. package/dist/web/assets/textarea-BEZ65po_.js +1 -0
  169. package/dist/web/assets/views-BumCSQ3W.js +2 -0
  170. package/dist/web/assets/{workbench-connection-gGGv4o8i.js → workbench-connection-CGHdORw3.js} +1 -1
  171. package/dist/web/assets/{workspace-Cc47dGjw.js → workspace-CW738NJG.js} +1 -1
  172. package/dist/web/assets/{workspace-actions.svelte-B3oum_9S.js → workspace-actions.svelte-DL9xv7lJ.js} +1 -1
  173. package/dist/web/assets/workspace-selectors.svelte-BRJvPEBh.js +105 -0
  174. package/dist/web/index.html +142 -83
  175. package/dist/web/sw.js +1 -1
  176. package/dist/worker.js +14 -14
  177. package/package.json +7 -7
  178. package/dist/guides/confluence/SKILL.md +0 -36
  179. package/dist/guides/jira/SKILL.md +0 -34
  180. package/dist/web/assets/ConversationListItem-Caz2KiJH.js +0 -3
  181. package/dist/web/assets/ConversationsWorkbenchPanel-CIfK_e3I.js +0 -1
  182. package/dist/web/assets/DiscoverCenterHost-Ep8EN9iJ.js +0 -1
  183. package/dist/web/assets/FilesWorkbenchPanel-CtXo7ywG.js +0 -12
  184. package/dist/web/assets/LaunchConfigurationNotice-CJjWkMhv.js +0 -1
  185. package/dist/web/assets/LogsCenterHost-BI1fSxFW.js +0 -1
  186. package/dist/web/assets/MobileFilesBody-BJMoaP9I.js +0 -1
  187. package/dist/web/assets/MobileLaunchOutputHost-vpltMcar.js +0 -1
  188. package/dist/web/assets/MobileLaunchesHost-CdDrKASg.js +0 -2
  189. package/dist/web/assets/MobileLogsHost-qK7N-C1y.js +0 -1
  190. package/dist/web/assets/MobileNoteEditorHost-Bg1N8o54.js +0 -1
  191. package/dist/web/assets/MobileSettingsPageScreen-DWMg4fDo.js +0 -1
  192. package/dist/web/assets/NotesWorkbenchPanel-Bf6rySTL.js +0 -1
  193. package/dist/web/assets/ProjectSettingsCenterHost-DHeb274m.js +0 -1
  194. package/dist/web/assets/PullRequestsWorkbenchPanel-ZvGbi1Cr.js +0 -1
  195. package/dist/web/assets/SettingsCenter-C_NLBsi6.js +0 -1
  196. package/dist/web/assets/SettingsCenterHost-jP8MULEj.js +0 -1
  197. package/dist/web/assets/adapters-DxJoo6Za.js +0 -1
  198. package/dist/web/assets/agent-profiles.svelte-D5YHPc90.js +0 -1
  199. package/dist/web/assets/api-eaGLre0q.js +0 -1
  200. package/dist/web/assets/center-tabs.svelte-JJGozG_H.js +0 -1
  201. package/dist/web/assets/channel-B503YLZR.js +0 -57
  202. package/dist/web/assets/chevron-left-DPEFG6UJ.js +0 -1
  203. package/dist/web/assets/circle-alert-Cp2l2jcj.js +0 -5
  204. package/dist/web/assets/clock-Db6f9HtS.js +0 -1
  205. package/dist/web/assets/code-BRQC0Tpn.js +0 -7
  206. package/dist/web/assets/dialog-DU4gXD1J.js +0 -1
  207. package/dist/web/assets/discover-B-aZ504j.js +0 -4
  208. package/dist/web/assets/dist-B_NFPhKV.js +0 -1
  209. package/dist/web/assets/file-tabs.svelte-DKtVVVCq.js +0 -2
  210. package/dist/web/assets/filesystem-ReGivxAC.js +0 -1
  211. package/dist/web/assets/index-DIQuyMVT.css +0 -1
  212. package/dist/web/assets/index-TZ1KAAsX.js +0 -48
  213. package/dist/web/assets/launches-DiAl56ED.js +0 -5
  214. package/dist/web/assets/launches.svelte-BVs1pAhl.js +0 -2
  215. package/dist/web/assets/notebook-pen-lVsLYSe4.js +0 -1
  216. package/dist/web/assets/notify.svelte-BKVBraTJ.js +0 -1
  217. package/dist/web/assets/pencil-BrlypebI.js +0 -1
  218. package/dist/web/assets/pr-view-loader.svelte-DcIwqDJV.js +0 -1
  219. package/dist/web/assets/progress-DBCSpVPn.js +0 -1
  220. package/dist/web/assets/scratch-notes-state.svelte-Br_WiMEp.js +0 -1
  221. package/dist/web/assets/search-input-zU4WCZiz.js +0 -1
  222. package/dist/web/assets/settings-2-8MSBUGAl.js +0 -1
  223. package/dist/web/assets/settings-9LBrw4Nv.js +0 -1
  224. package/dist/web/assets/settings-B7uXsflY.js +0 -1
  225. package/dist/web/assets/settings-actions.svelte-B8psX3cj.js +0 -1
  226. package/dist/web/assets/settings-page-controllers.svelte-D_ydJF8u.js +0 -30
  227. package/dist/web/assets/shell-DB5Db5-E.js +0 -4
  228. package/dist/web/assets/shell-layout.svelte-OoLFwzzJ.js +0 -2
  229. package/dist/web/assets/textarea-CeoFJ0-t.js +0 -1
  230. package/dist/web/assets/views-ByPCKDiZ.js +0 -2
  231. package/dist/web/assets/workspace-selectors.svelte-DLUlSgEE.js +0 -131
  232. /package/dist/{html-to-markdown.worker.js.LEGAL.txt → chunk-BUD4JHBZ.js.LEGAL.txt} +0 -0
  233. /package/dist/{chunk-3VZR3ZUY.js.LEGAL.txt → chunk-KEXKZKN4.js.LEGAL.txt} +0 -0
  234. /package/dist/{chunk-PST63OUS.js.LEGAL.txt → chunk-OO2KD2L2.js.LEGAL.txt} +0 -0
@@ -3,20 +3,20 @@ const require = __nerveCreateRequire(import.meta.url);
3
3
  import {
4
4
  applyOpenRouterReportedCost,
5
5
  isOpenRouterModel
6
- } from "./chunk-HDBDYGJQ.js";
6
+ } from "./chunk-N4OXAS3A.js";
7
7
  import {
8
8
  buildCopilotDynamicHeaders,
9
9
  hasCopilotVisionInput
10
- } from "./chunk-QBAIDKF6.js";
10
+ } from "./chunk-TQURLRHD.js";
11
11
  import {
12
12
  clampOpenAIPromptCacheKey
13
- } from "./chunk-ODS5QROC.js";
13
+ } from "./chunk-KUFIFCB4.js";
14
14
  import {
15
15
  OpenAI
16
16
  } from "./chunk-NW3DH7IK.js";
17
17
  import {
18
18
  shortHash
19
- } from "./chunk-2BKMOJYJ.js";
19
+ } from "./chunk-LP4APBBQ.js";
20
20
  import {
21
21
  appendGrammarToolInputJsonDelta,
22
22
  buildBaseOptions,
@@ -30,46 +30,46 @@ import {
30
30
  resolveSamplingParams,
31
31
  thinkingBudgetForLevel,
32
32
  transformMessages
33
- } from "./chunk-OAEV22IW.js";
33
+ } from "./chunk-Z6AY5VOZ.js";
34
34
  import {
35
35
  sanitizeSurrogates
36
- } from "./chunk-3SSNDIQT.js";
36
+ } from "./chunk-TSAUBRRU.js";
37
37
  import {
38
38
  retryProviderRequest
39
- } from "./chunk-EX63VKXY.js";
39
+ } from "./chunk-3CZXUKLG.js";
40
40
  import {
41
41
  formatProviderError,
42
42
  normalizeProviderError
43
- } from "./chunk-O2652RWY.js";
43
+ } from "./chunk-PVPJAGWR.js";
44
44
  import {
45
45
  headersToRecord
46
- } from "./chunk-VBM7TD3X.js";
46
+ } from "./chunk-6IHXVT5H.js";
47
47
  import {
48
48
  getProviderEnvValue
49
- } from "./chunk-SU2USXTD.js";
49
+ } from "./chunk-JBEWFFOK.js";
50
50
  import {
51
51
  ToolCallArgumentsStream
52
- } from "./chunk-H2G55ZPG.js";
52
+ } from "./chunk-BG2KGLIA.js";
53
53
  import {
54
54
  calculateCost,
55
55
  clampThinkingLevel,
56
56
  getDeclaredTools,
57
57
  resolveTranscript,
58
58
  resolveTranscriptTools
59
- } from "./chunk-TGKIV3F4.js";
59
+ } from "./chunk-W7LEYYFH.js";
60
60
  import {
61
61
  AssistantMessageEventStream
62
- } from "./chunk-TSV3PFU2.js";
62
+ } from "./chunk-DDBE2VLT.js";
63
63
  import {
64
64
  getIdentityHeaders
65
- } from "./chunk-UDC7NPQJ.js";
65
+ } from "./chunk-Q3C7TQ2M.js";
66
66
  import {
67
67
  getSystemMessageText,
68
68
  renderSystemMessageUpdate
69
- } from "./chunk-XY53EFK3.js";
69
+ } from "./chunk-U5KGV63C.js";
70
70
  import "./chunk-CWESUMYQ.js";
71
71
 
72
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js
72
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js
73
73
  function hasHeader(headers, name) {
74
74
  if (!headers)
75
75
  return false;
@@ -2,12 +2,12 @@ import { createRequire as __nerveCreateRequire } from "node:module";
2
2
  const require = __nerveCreateRequire(import.meta.url);
3
3
  import {
4
4
  clampThinkingLevel
5
- } from "./chunk-TGKIV3F4.js";
5
+ } from "./chunk-W7LEYYFH.js";
6
6
  import {
7
7
  getSystemMessageText
8
- } from "./chunk-XY53EFK3.js";
8
+ } from "./chunk-U5KGV63C.js";
9
9
 
10
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js
10
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js
11
11
  var UnsupportedStrictJsonSchemaError = class extends Error {
12
12
  };
13
13
  var UNSUPPORTED_STRICT_SCHEMA_KEYS = [
@@ -239,7 +239,7 @@ function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) {
239
239
  return properties;
240
240
  }
241
241
 
242
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js
242
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js
243
243
  var CHARS_PER_TOKEN = 3.5;
244
244
  var ESTIMATED_IMAGE_CHARS = 4800;
245
245
  function calculateContextTokens(usage) {
@@ -324,7 +324,7 @@ function estimateToolsTokens(tools) {
324
324
  return estimateTextTokens(safeJsonStringify(tools));
325
325
  }
326
326
 
327
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js
327
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js
328
328
  var CONTEXT_SAFETY_TOKENS = 4096;
329
329
  var CONTEXT_SAFETY_RATIO = 0.15;
330
330
  var MIN_OUTPUT_WITH_RATIO_MARGIN = 32768;
@@ -399,7 +399,7 @@ function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLeve
399
399
  return { maxTokens, thinkingBudget };
400
400
  }
401
401
 
402
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js
402
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js
403
403
  var NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)";
404
404
  var NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)";
405
405
  var ERROR_TOOL_IMAGE_PLACEHOLDER = "(image attached after the tool results)";
@@ -2,37 +2,37 @@ import { createRequire as __nerveCreateRequire } from "node:module";
2
2
  const require = __nerveCreateRequire(import.meta.url);
3
3
  import {
4
4
  resolveHttpProxyUrlForTarget
5
- } from "./chunk-KBNEZR7T.js";
5
+ } from "./chunk-6ZS7TA6E.js";
6
6
  import {
7
7
  combineAbortSignals
8
- } from "./chunk-6TAN6WG6.js";
8
+ } from "./chunk-ZUWBEV2O.js";
9
9
  import {
10
10
  convertResponsesMessages,
11
11
  convertResponsesTools,
12
12
  getResponsesToolSupport,
13
13
  processResponsesStream
14
- } from "./chunk-ANI6J75M.js";
14
+ } from "./chunk-IRRR3PWN.js";
15
15
  import {
16
16
  registerSessionResourceCleanup
17
- } from "./chunk-OANTMDXI.js";
17
+ } from "./chunk-ZVH6EB7S.js";
18
18
  import {
19
19
  clampOpenAIPromptCacheKey
20
- } from "./chunk-ODS5QROC.js";
21
- import "./chunk-2BKMOJYJ.js";
20
+ } from "./chunk-KUFIFCB4.js";
21
+ import "./chunk-LP4APBBQ.js";
22
22
  import {
23
23
  buildBaseOptions,
24
24
  createGrammarToolInputProperties
25
- } from "./chunk-OAEV22IW.js";
26
- import "./chunk-3SSNDIQT.js";
25
+ } from "./chunk-Z6AY5VOZ.js";
26
+ import "./chunk-TSAUBRRU.js";
27
27
  import {
28
28
  formatProviderError,
29
29
  normalizeProviderError
30
- } from "./chunk-O2652RWY.js";
30
+ } from "./chunk-PVPJAGWR.js";
31
31
  import {
32
32
  headersToRecord
33
- } from "./chunk-VBM7TD3X.js";
34
- import "./chunk-SU2USXTD.js";
35
- import "./chunk-H2G55ZPG.js";
33
+ } from "./chunk-6IHXVT5H.js";
34
+ import "./chunk-JBEWFFOK.js";
35
+ import "./chunk-BG2KGLIA.js";
36
36
  import {
37
37
  clampThinkingLevel,
38
38
  getDeclaredTools,
@@ -40,22 +40,22 @@ import {
40
40
  normalizeContext,
41
41
  resolveTranscript,
42
42
  resolveTranscriptTools
43
- } from "./chunk-TGKIV3F4.js";
43
+ } from "./chunk-W7LEYYFH.js";
44
44
  import {
45
45
  AssistantMessageEventStream,
46
46
  appendAssistantMessageDiagnostic,
47
47
  createAssistantMessageDiagnostic,
48
48
  formatThrownValue
49
- } from "./chunk-TSV3PFU2.js";
49
+ } from "./chunk-DDBE2VLT.js";
50
50
  import {
51
51
  getIdentityHeaders
52
- } from "./chunk-UDC7NPQJ.js";
52
+ } from "./chunk-Q3C7TQ2M.js";
53
53
  import {
54
54
  getSystemMessageText
55
- } from "./chunk-XY53EFK3.js";
55
+ } from "./chunk-U5KGV63C.js";
56
56
  import "./chunk-CWESUMYQ.js";
57
57
 
58
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js
58
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js
59
59
  var MAX_UUID_V7_TIMESTAMP = 281474976710655;
60
60
  var MAX_SEQUENCE = (1n << 41n) - 1n;
61
61
  var lastOrdinaryTimestamp = -1;
@@ -91,7 +91,7 @@ function uuidv7(timestampMs) {
91
91
  return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
92
92
  }
93
93
 
94
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js
94
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js
95
95
  var DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
96
96
  var JWT_CLAIM_PATH = "https://api.openai.com/auth";
97
97
  var DEFAULT_MAX_RETRIES = 0;
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __nerveCreateRequire } from "node:module";
2
2
  const require = __nerveCreateRequire(import.meta.url);
3
3
 
4
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js
4
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js
5
5
  function combineAbortSignals(signals) {
6
6
  const activeSignals = signals.filter((signal) => signal !== void 0);
7
7
  if (activeSignals.length === 0) {
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __nerveCreateRequire } from "node:module";
2
2
  const require = __nerveCreateRequire(import.meta.url);
3
3
 
4
- // node_modules/.pnpm/@earendil-works+pi-ai@1.5.1_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_e7d72008f907c45a36788e380ed24019/node_modules/@earendil-works/pi-ai/dist/session-resources.js
4
+ // node_modules/.pnpm/@earendil-works+pi-ai@1.5.2_@aws-sdk+credential-provider-node@3.972.83_@smithy+signatur_b842a8cec34a633ed5f728049ae89b72/node_modules/@earendil-works/pi-ai/dist/session-resources.js
5
5
  var sessionResourceCleanups = /* @__PURE__ */ new Set();
6
6
  function registerSessionResourceCleanup(cleanup) {
7
7
  sessionResourceCleanups.add(cleanup);
package/dist/daemon.js CHANGED
@@ -67,7 +67,7 @@ import {
67
67
  writeCrashReportSync,
68
68
  writeDevicesFile,
69
69
  writeNodeDiagnosticReport
70
- } from "./chunk-PST63OUS.js";
70
+ } from "./chunk-OO2KD2L2.js";
71
71
  import {
72
72
  firstEnvValue,
73
73
  isLoopbackHost,
@@ -77,12 +77,13 @@ import {
77
77
  mergeNoProxy,
78
78
  mergeNoProxySources
79
79
  } from "./chunk-QF5GNBAB.js";
80
+ import "./chunk-BUD4JHBZ.js";
80
81
  import "./chunk-RLN3MFAK.js";
81
82
  import {
82
83
  discardFailedItems,
83
84
  readMigrationFailureReport,
84
85
  rollbackFailedMigration
85
- } from "./chunk-7JQBECUL.js";
86
+ } from "./chunk-BN5YDZUZ.js";
86
87
  import {
87
88
  MIGRATION_ROLLED_BACK,
88
89
  MissingAssetError,
@@ -101,22 +102,22 @@ import {
101
102
  storagePaths,
102
103
  transferConversationEvent,
103
104
  transferredConversationEventSchema
104
- } from "./chunk-6FSDDGFZ.js";
105
- import "./chunk-BNVMNV4O.js";
106
- import "./chunk-SHEU5KLD.js";
107
- import "./chunk-4H3WR7IT.js";
108
- import "./chunk-OANTMDXI.js";
109
- import "./chunk-C6RO4LP3.js";
105
+ } from "./chunk-FZ557YWE.js";
106
+ import "./chunk-62DQXVPO.js";
107
+ import "./chunk-RJR7DJJK.js";
108
+ import "./chunk-RL52LSTV.js";
109
+ import "./chunk-ZVH6EB7S.js";
110
+ import "./chunk-FCAIYPDJ.js";
110
111
  import {
111
112
  configureManagedProcessRuntime,
112
113
  initializeManagedProcessHost
113
- } from "./chunk-WRTA5G57.js";
114
- import "./chunk-SU2USXTD.js";
115
- import "./chunk-H2G55ZPG.js";
116
- import "./chunk-TGKIV3F4.js";
117
- import "./chunk-TSV3PFU2.js";
118
- import "./chunk-UDC7NPQJ.js";
119
- import "./chunk-XY53EFK3.js";
114
+ } from "./chunk-APY4TUR3.js";
115
+ import "./chunk-JBEWFFOK.js";
116
+ import "./chunk-BG2KGLIA.js";
117
+ import "./chunk-W7LEYYFH.js";
118
+ import "./chunk-DDBE2VLT.js";
119
+ import "./chunk-Q3C7TQ2M.js";
120
+ import "./chunk-U5KGV63C.js";
120
121
  import {
121
122
  __toESM
122
123
  } from "./chunk-CWESUMYQ.js";
@@ -127,10 +128,10 @@ import { createServer as createHttpsServer } from "node:https";
127
128
  import { networkInterfaces } from "node:os";
128
129
  import { dirname, join as join2 } from "node:path";
129
130
 
130
- // node_modules/.pnpm/@hono+node-server@2.1.5_hono@4.13.16/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
131
+ // node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.16/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
131
132
  var X_ALREADY_SENT = "x-hono-already-sent";
132
133
 
133
- // node_modules/.pnpm/@hono+node-server@2.1.5_hono@4.13.16/node_modules/@hono/node-server/dist/index.mjs
134
+ // node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.16/node_modules/@hono/node-server/dist/index.mjs
134
135
  import { STATUS_CODES, ServerResponse, createServer } from "node:http";
135
136
  import { Http2ServerRequest, constants } from "node:http2";
136
137
  import { Readable } from "node:stream";
@@ -156,7 +157,7 @@ var defineWebSocketHelper = (handler) => {
156
157
  });
157
158
  };
158
159
 
159
- // node_modules/.pnpm/@hono+node-server@2.1.5_hono@4.13.16/node_modules/@hono/node-server/dist/index.mjs
160
+ // node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.16/node_modules/@hono/node-server/dist/index.mjs
160
161
  var RequestError = class extends Error {
161
162
  constructor(message, options) {
162
163
  super(message, options);
@@ -314,16 +315,27 @@ var newHeadersFromIncoming = (incoming) => globalThis.Headers === GlobalHeaders
314
315
  var reValidRequestUrl = /^\/[!#$&-;=?-\[\]_a-z~]*$/;
315
316
  var reDotSegment = /\/\.\.?(?:[/?#]|$)/;
316
317
  var reValidHost = /^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/;
318
+ var validateRequestTarget = (target) => {
319
+ const backslash = target.indexOf("\\");
320
+ if (backslash !== -1) {
321
+ const query = target.indexOf("?");
322
+ if (query === -1 || backslash < query) throw new RequestError("Backslash in request path");
323
+ }
324
+ };
317
325
  var buildUrl = (scheme, host, incomingUrl) => {
318
326
  const url = `${scheme}://${host}${incomingUrl}`;
319
327
  if (!reValidHost.test(host)) {
328
+ validateRequestTarget(incomingUrl);
320
329
  const urlObj = new URL(url);
321
330
  if (urlObj.hostname.length !== host.length && urlObj.hostname !== (host.includes(":") ? host.replace(/:\d+$/, "") : host).toLowerCase()) throw new RequestError("Invalid host header");
322
331
  return urlObj.href;
323
332
  } else if (incomingUrl.length === 0) return url + "/";
324
333
  else {
325
334
  if (incomingUrl.charCodeAt(0) !== 47) throw new RequestError("Invalid URL");
326
- if (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl)) return new URL(url).href;
335
+ if (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl)) {
336
+ validateRequestTarget(incomingUrl);
337
+ return new URL(url).href;
338
+ }
327
339
  return url;
328
340
  }
329
341
  };
@@ -679,6 +691,7 @@ Object.defineProperty(requestPrototype, "signal", { get() {
679
691
  "cache",
680
692
  "credentials",
681
693
  "destination",
694
+ "duplex",
682
695
  "integrity",
683
696
  "mode",
684
697
  "redirect",
@@ -736,6 +749,7 @@ var newRequest = (incoming, defaultHostname) => {
736
749
  if (incomingUrl[0] !== "/" && (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
737
750
  if (incoming instanceof Http2ServerRequest) throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
738
751
  try {
752
+ validateRequestTarget(incomingUrl);
739
753
  req[urlKey] = new URL(incomingUrl).href;
740
754
  } catch (e) {
741
755
  throw new RequestError("Invalid absolute URL", { cause: e });
@@ -899,6 +913,11 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
899
913
  reader.cancel(error).catch(() => {
900
914
  });
901
915
  };
916
+ const stream = writable.stream;
917
+ if (writable.destroyed || stream?.closed || stream?.destroyed) {
918
+ cancel();
919
+ return reader.closed;
920
+ }
902
921
  writable.on("close", cancel);
903
922
  writable.on("error", cancel);
904
923
  (currentReadPromise ?? reader.read()).then(flow, handleStreamError);
@@ -916,7 +935,7 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
916
935
  try {
917
936
  if (done) writable.end();
918
937
  else if (!writable.write(value)) writable.once("drain", onDrain);
919
- else return reader.read().then(flow, handleStreamError);
938
+ else reader.read().then(flow, handleStreamError);
920
939
  } catch (e) {
921
940
  handleStreamError(e);
922
941
  }
@@ -924,7 +943,11 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
924
943
  }
925
944
  function writeFromReadableStream(stream, writable) {
926
945
  if (stream.locked) throw new TypeError("ReadableStream is locked.");
927
- else if (writable.destroyed) return;
946
+ else if (writable.destroyed) {
947
+ stream.cancel().catch(() => {
948
+ });
949
+ return;
950
+ }
928
951
  return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
929
952
  }
930
953
  var buildOutgoingHttpHeaders = (headers, defaultContentType2) => {
@@ -1116,10 +1139,7 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
1116
1139
  let maxReadCount = 2;
1117
1140
  for (let i = 0; i < maxReadCount; i++) {
1118
1141
  currentReadPromise ||= reader.read();
1119
- const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
1120
- console.error(e);
1121
- done = true;
1122
- });
1142
+ const chunk = await readWithoutBlocking(currentReadPromise);
1123
1143
  if (!chunk) {
1124
1144
  if (i === 1) {
1125
1145
  await new Promise((resolve) => setTimeout(resolve));
@@ -1272,6 +1292,7 @@ var appendResponseHeaders = (headers, responseHeaders) => {
1272
1292
  });
1273
1293
  };
1274
1294
  var rejectUpgradeRequest = (socket, status, responseHeaders) => {
1295
+ if (socket.destroyed) return;
1275
1296
  const responseLines = ["Connection: close", "Content-Length: 0"];
1276
1297
  appendResponseHeaders(responseLines, responseHeaders);
1277
1298
  socket.end(`HTTP/1.1 ${status.toString()} ${STATUS_CODES[status] ?? ""}\r
@@ -1281,7 +1302,12 @@ ${responseLines.join("\r\n")}\r
1281
1302
  };
1282
1303
  var createUpgradeRequest = (request) => {
1283
1304
  const protocol = request.socket.encrypted ? "https" : "http";
1284
- const url = new URL(request.url ?? "/", `${protocol}://${request.headers.host ?? "localhost"}`);
1305
+ const incomingUrl = request.url ?? "/";
1306
+ let url;
1307
+ if (incomingUrl[0] !== "/" && (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
1308
+ validateRequestTarget(incomingUrl);
1309
+ url = new URL(incomingUrl).href;
1310
+ } else url = buildUrl(protocol, request.headers.host ?? "localhost", incomingUrl);
1285
1311
  const headers = new Headers();
1286
1312
  for (const key in request.headers) {
1287
1313
  const value = request.headers[key];
@@ -1318,6 +1344,11 @@ var setupWebSocket = (options) => {
1318
1344
  };
1319
1345
  server.on("upgrade", async (request, socket, head) => {
1320
1346
  if (request.headers.upgrade?.toLowerCase() !== "websocket") return;
1347
+ const ignoreSocketError = () => {
1348
+ };
1349
+ const reclaimWaiterOnClose = () => rejectWaiter(request);
1350
+ socket.on("error", ignoreSocketError);
1351
+ socket.once("close", reclaimWaiterOnClose);
1321
1352
  const env = {
1322
1353
  incoming: request,
1323
1354
  outgoing: void 0,
@@ -1332,8 +1363,12 @@ var setupWebSocket = (options) => {
1332
1363
  status = response.status;
1333
1364
  responseHeaders = response.headers;
1334
1365
  }
1335
- } catch {
1336
- if (server.listenerCount("upgrade") === 1) rejectUpgradeRequest(socket, 500);
1366
+ } catch (error) {
1367
+ if (server.listenerCount("upgrade") === 1) rejectUpgradeRequest(socket, error instanceof RequestError ? 400 : 500);
1368
+ return;
1369
+ }
1370
+ if (socket.destroyed) {
1371
+ rejectWaiter(request);
1337
1372
  return;
1338
1373
  }
1339
1374
  const waiter = waiterMap.get(request);
@@ -1345,12 +1380,11 @@ var setupWebSocket = (options) => {
1345
1380
  const addResponseHeaders = (headers) => {
1346
1381
  appendResponseHeaders(headers, responseHeaders);
1347
1382
  };
1348
- const reclaimWaiterOnClose = () => rejectWaiter(request);
1349
- socket.once("close", reclaimWaiterOnClose);
1350
1383
  wss.on("headers", addResponseHeaders);
1351
1384
  try {
1352
1385
  wss.handleUpgrade(request, socket, head, (ws) => {
1353
1386
  socket.off("close", reclaimWaiterOnClose);
1387
+ socket.off("error", ignoreSocketError);
1354
1388
  wss.emit("connection", ws, request);
1355
1389
  });
1356
1390
  } finally {
@@ -3576,7 +3610,7 @@ function createConversationProtocolSession(ws, state, onDispose) {
3576
3610
  agentBrowserSkills: platform.agentBrowserSkills.skills
3577
3611
  });
3578
3612
  },
3579
- "tool.list": () => ({ tools: allToolDescriptors }),
3613
+ "tool.list": () => ({ tools: allToolDescriptors() }),
3580
3614
  "completion.slash.list": () => ({ items: slashCommandCompletionItems })
3581
3615
  };
3582
3616
  const session = new ProtocolServerSession({
@@ -0,0 +1,31 @@
1
+ # Confluence requests for what has no method
2
+
3
+ `confluence.request(method, path, body?, query?)`: the path is the full REST path (`/wiki/api/v2/…` or `/wiki/rest/api/…`); `query` is `{ name: value | value[] }`, the 4th argument. Bodies: `{ representation: "storage", value: storageXhtml }`.
4
+
5
+ Typed methods cover pages, comments (footer and inline), labels and attachments; use raw only for the rest:
6
+
7
+ | Task | Request |
8
+ | -------------------- | -------------------------------------------------------------------------------------------------------------------- |
9
+ | Page restrictions | `GET /wiki/rest/api/content/{id}/restriction/byOperation` |
10
+ | Rename an attachment | `PUT /wiki/rest/api/content/{attachmentId}` `{ id, type: "attachment", title: newName, version: { number: n + 1 } }` |
11
+ | Page versions | `GET /wiki/api/v2/pages/{id}/versions` |
12
+
13
+ ## Restrictions recipe
14
+
15
+ Operations are `read` and `update`; users are addressed by `accountId` (find it with `atlassian.users.search` or from a comment `author`).
16
+
17
+ ```ts
18
+ const id = "123";
19
+ const base = `/wiki/rest/api/content/${id}/restriction/byOperation`;
20
+ const current = await confluence.request("GET", base); // who is restricted now
21
+ await confluence.request("PUT", `${base}/update/user`, undefined, {
22
+ accountId: "…",
23
+ }); // add a user
24
+ await confluence.request("DELETE", `${base}/update/user`, undefined, {
25
+ accountId: "…",
26
+ }); // remove a user
27
+ await confluence.request("PUT", `${base}/read/byGroupId/${groupId}`); // add a group
28
+ await confluence.request("DELETE", `${base}/update`); // clear_operation: lift every `update` restriction
29
+ ```
30
+
31
+ A restricted operation with no subjects left is unrestricted again.
@@ -0,0 +1,101 @@
1
+ # Writing Confluence pages people can read
2
+
3
+ A page body is RichText (`sdk.docs("storage/builders")`): Markdown for prose, `storage.*` builders for structure, arrays to combine. Write with `confluence.pages.create/update`. Every write is linted.
4
+
5
+ ## Editing an existing page
6
+
7
+ `const page = await confluence.pages.get({ id, body: "storage" })` (the default Markdown body is a read-only view), then pass `version: page.version` to `pages.update`.
8
+
9
+ | Change | How |
10
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
11
+ | Append / prepend | `body: [page.body, "## New\n\ntext"]` |
12
+ | Rewrite one section | `body: storage.replaceSection(page.body, "Risks", "- new risk")` |
13
+ | Larger or surgical edits | `const d = await confluence.pages.download({ id })`, edit `d.file` with the Edit tool or `files.edit`, then `pages.update({ id, version: d.version, bodyFile: d.file })` |
14
+
15
+ `body` and `bodyFile` are exclusive. Rewrites that drop macros, layouts, images or mentions throw unless `allowRemoving: true`; add-on macros (drawio, gliffy, ...) survive only if their storage stays in the body. Never rebuild a page from the Markdown view; use an array, not `page.body + "..."`.
16
+
17
+ ## Plan first
18
+
19
+ Outline first: one-line purpose, 3-7 sections, what goes in tables, Jira macros, diagrams. Gather data (and count empty lists) before assembling the parts array.
20
+
21
+ ## Structure
22
+
23
+ - The page title is a separate field. Sections start at `#` (H1), subsections at `##`/`###`; never skip a level and do not repeat the title as a first heading.
24
+ - Open with a 2-4 line overview (or one `info` panel) on what the page is and its status, without an "Overview" heading.
25
+ - Only long pages (about 600+ words or 6+ sections) get `storage.toc()` right after the overview; short pages get none.
26
+ - Short paragraphs (1-3 sentences). Put raw output, reference material and long tails in `storage.expand`; code in `storage.code` with a language.
27
+ - Pluralise in code ("1 issue", "3 issues"), never "issue(s)". Keep inline items (dates, lozenges, links) in one `storage.p([...])` array: `storage.p(["Due ", storage.date(d), " ", storage.status("Open")])`.
28
+
29
+ ## Tables
30
+
31
+ Use a table (Markdown for plain text cells, `storage.table` for lozenges, links, widths or merged cells) for lists with several attributes. Narrow columns for key, type, status and date, wide for text. Set `columns: [{ key, title, width }]` yourself (px; content width 760, `layout: "wide"` 960) or let the linter compute them; a `SCRUM-123` key needs about 100 px. Show statuses with `storage.status`.
32
+
33
+ ## Panels
34
+
35
+ | Type | Colour | Use for |
36
+ | ----------------------- | ------ | ----------------------------------- |
37
+ | `info` | blue | context, the page overview |
38
+ | `success` (alias `tip`) | green | good news: done, on track |
39
+ | `warning` | yellow | risks, things to watch |
40
+ | `error` | red | blocking problems and failures only |
41
+ | `note` | purple | side remarks, definitions |
42
+
43
+ No neutral information in `warning`/`error`; none directly under a same-titled heading, stacked, or holding long content. An overview panel plus a few others is plenty.
44
+
45
+ ## Jira content
46
+
47
+ For a list of issues use one `storage.jiraIssues(jql, { columns })` macro (`["key","summary","status","assignee"]`) instead of a `storage.jiraIssue` per row or a heading per issue. Use `storage.jiraIssue(key)` inline for a single reference. A macro whose JQL matches nothing renders a bare header row: count first (reuse search results) and write a sentence ("No open blockers.") for sections that may be empty.
48
+
49
+ ## Images and diagrams
50
+
51
+ Attach PNG or JPEG files via `attachments` (GIF/WebP are converted to PNG, SVG is rejected), then reference them with `storage.image(filename)`; the linter sets the width from the real size, capped at 760 px, so aim for about 760 px natural width. Add `alt`/`caption` when the image carries information. An image scaled below 80% (a 1100 px diagram shown at 760) gets a warning because its text turns small: shrink or simplify the source instead (diagrams: `sdk.docs("diagram/render")`). Use `storage.layout` sparingly (two columns, never nested).
52
+
53
+ ## The linter
54
+
55
+ `pages.create/update` return `fixes` (applied) and `warnings` (not applied); the result footer prints both. Fix the cause of warnings with `pages.update`.
56
+
57
+ - **Rejected before any request:** malformed XML, with line and element (`Closing tag </div> at line 2 does not match <p>`). Plain strings are Markdown or literal text; use `storage.escape` only inside `storage.raw`.
58
+ - **Fixed automatically:** headings promoted so the top level is H1; a leading H1 equal to the title removed; a TOC for long pages (`toc: false` opts out); computed column widths and image widths; loose inline content under a panel, expand, layout cell or the page root wrapped in `<p>`; Jira list macros given `data-layout="default"` (760 px).
59
+ - **Warnings:** an explicit column width too narrow for its longest word (`Column "Key" is 90px; "SCRUM-4" needs about 100px`: widen it or drop the width); images scaled below 80%; skipped heading levels; SVG/WebP images; images of unknown size; a panel repeating the heading above it; a heading that only repeats an embedded issue key; empty sections; a body referencing an attachment that is neither passed in `attachments` nor already on the page (existing attachments keep their real size).
60
+
61
+ ## Worked example
62
+
63
+ ```ts
64
+ const issues = await jira.issues.search({
65
+ jql: 'project = APP AND fixVersion = "2.1" ORDER BY status',
66
+ fields: ["summary", "status", "assignee"],
67
+ });
68
+ const open = issues.filter((i) => i.statusCategory !== "Done");
69
+ const flow = await diagram.render({
70
+ type: "mermaid",
71
+ source: "flowchart TB\n A[Freeze] --> B[QA] --> C[Release]",
72
+ name: "release-flow.png",
73
+ });
74
+ const body = [
75
+ storage.panel(
76
+ "info",
77
+ `${issues.length} issues in 2.1; ${open.length} still open.`,
78
+ ),
79
+ storage.toc(),
80
+ "# Release flow",
81
+ storage.image("release-flow.png", { alt: "Release flow" }),
82
+ "# Open work",
83
+ open.length
84
+ ? storage.jiraIssues(
85
+ 'project = APP AND fixVersion = "2.1" AND statusCategory != Done',
86
+ {
87
+ columns: ["type", "key", "summary", "status", "assignee"],
88
+ },
89
+ )
90
+ : "Nothing is open.",
91
+ "# Risks",
92
+ storage.panel("warning", "QA environment is shared until Friday."),
93
+ ];
94
+ const page = await confluence.pages.create({
95
+ space: "ENG",
96
+ title: "Release 2.1 status",
97
+ body,
98
+ attachments: [flow],
99
+ });
100
+ return { url: page.url, warnings: page.warnings };
101
+ ```
@@ -0,0 +1,16 @@
1
+ # Jira requests for what has no method
2
+
3
+ `jira.request(method, path, body?, query?)`: the path is the full REST path (`/rest/api/3/…` or `/rest/agile/1.0/…`); `query` is `{ name: value | value[] }`, the 4th argument, not part of the path (GET: `jira.request("GET", "/rest/api/3/issue/APP-1/changelog", undefined, { maxResults: 20 })`). Rich-text bodies are ADF: build them with `await jira.adf.fromMarkdown(md)`.
4
+
5
+ Typed methods cover issues, comments, worklogs, links, attachments, sprints and ranking; use raw requests only for the rest:
6
+
7
+ | Task | Request |
8
+ | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | Changelog | `GET /rest/api/3/issue/{key}/changelog` |
10
+ | Editable fields of an issue | `GET /rest/api/3/issue/{key}/editmeta` |
11
+ | Remote links | `GET` / `POST` `/rest/api/3/issue/{key}/remotelink`, `DELETE …/remotelink/{linkId}` |
12
+ | Priorities / resolutions / link types | `GET /rest/api/3/priority`, `/rest/api/3/resolution`, `/rest/api/3/issueLinkType` |
13
+ | Find boards | `GET /rest/agile/1.0/board` with query `{ name, projectKeyOrId, type: "scrum" \| "kanban", startAt, maxResults }`; boards of one project: `projects.get({ include: ["boards"] })` |
14
+ | Board by id / its configuration | `GET /rest/agile/1.0/board/{boardId}`; `GET …/board/{boardId}/configuration` (columns, status mapping, estimation field, filter) |
15
+ | Board backlog | `GET /rest/agile/1.0/board/{boardId}/backlog` |
16
+ | Comment visibility | `PUT /rest/api/3/issue/{key}/comment/{id}` `{ body: adf, visibility: { type: "role", value: "Administrators" } }` |