@nervekit/desktop 0.42.0 → 0.43.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 (255) hide show
  1. package/THIRD-PARTY-LICENSES.txt +210 -16
  2. package/dist/builtin/configure-nerve/SKILL.md +19 -10
  3. package/dist/builtin/configure-nerve/reference/agent-preferences.md +9 -0
  4. package/dist/builtin/configure-nerve/reference/agent-profiles.md +2 -6
  5. package/dist/builtin/configure-nerve/reference/agents-md.md +1 -1
  6. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/artifacts.d.ts +10 -0
  7. package/dist/builtin/configure-nerve/reference/extensions/api/extension-api/text.d.ts +4 -0
  8. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/components.d.ts +2 -0
  9. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/collections/match-terms.d.ts +8 -0
  10. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/callout/callout.svelte.d.ts +1 -1
  11. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/index.d.ts +3 -0
  12. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/log-source.d.ts +43 -0
  13. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/log-view.svelte.d.ts +22 -0
  14. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/log-window.d.ts +77 -0
  15. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/components/composites/log-view/terminal-text.svelte.d.ts +6 -0
  16. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/display/status.d.ts +3 -0
  17. package/dist/builtin/configure-nerve/reference/extensions/api/extension-sdk/components/ui-kit/terminal/ansi.d.ts +4 -0
  18. package/dist/builtin/configure-nerve/{guide/extensions.md → reference/extensions/build.md} +4 -4
  19. package/dist/builtin/configure-nerve/reference/extensions/components.md +2 -1
  20. package/dist/builtin/configure-nerve/reference/extensions/manifest.md +1 -1
  21. package/dist/builtin/configure-nerve/reference/extensions/overview.md +2 -2
  22. package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/lib.mjs +2 -2
  23. package/dist/builtin/configure-nerve/reference/extensions/scripts/nerve-version.json +1 -0
  24. package/dist/builtin/configure-nerve/reference/extensions/sharing.md +2 -2
  25. package/dist/builtin/configure-nerve/reference/extensions/themes.md +1 -1
  26. package/dist/builtin/configure-nerve/reference/permissions.md +2 -2
  27. package/dist/builtin/configure-nerve/reference/prompt-suggestions.md +2 -2
  28. package/dist/builtin/configure-nerve/reference/skills.md +9 -9
  29. package/dist/{chunk-QFK2SWD2.js → chunk-34SYO66C.js} +11 -11
  30. package/dist/{chunk-6ZS7TA6E.js → chunk-35O66NLU.js} +2 -2
  31. package/dist/{chunk-DHIDYKXJ.js → chunk-3LWB5SGT.js} +1781 -1719
  32. package/dist/{chunk-7FSH3ABG.js → chunk-57A5HFXL.js} +4 -4
  33. package/dist/{chunk-EF7ZZKA3.js → chunk-5K7U6UXA.js} +3 -3
  34. package/dist/{chunk-WIQEPAUG.js → chunk-5S5O3V5G.js} +11 -10
  35. package/dist/{chunk-MTHLTFG4.js → chunk-5VLAJMQQ.js} +97 -105
  36. package/dist/{chunk-MI6L5CEA.js → chunk-5WMHGTVL.js} +2 -2
  37. package/dist/{chunk-NVVW3MWJ.js → chunk-6IJORN3N.js} +9 -9
  38. package/dist/{chunk-OMCM3MHS.js → chunk-7GSR2AW5.js} +10 -9
  39. package/dist/{chunk-WG62RHZ2.js → chunk-7MJT6LHU.js} +14 -4
  40. package/dist/{chunk-DDBE2VLT.js → chunk-A3OFIREH.js} +2 -2
  41. package/dist/{chunk-ZGWXLG5X.js → chunk-BNBEFI2M.js} +66 -76
  42. package/dist/{chunk-7RPHIJT3.js → chunk-C7L4BBGD.js} +4 -4
  43. package/dist/{chunk-2ICPO4UM.js → chunk-CZXRZEV4.js} +16 -14
  44. package/dist/{chunk-PVPJAGWR.js → chunk-EOZLBW5E.js} +2 -2
  45. package/dist/{chunk-U5KGV63C.js → chunk-EZJH7ED5.js} +1 -1
  46. package/dist/{chunk-RL52LSTV.js → chunk-F3X2KHP4.js} +1 -1
  47. package/dist/{chunk-Q3C7TQ2M.js → chunk-FNWUCFVO.js} +3 -3
  48. package/dist/chunk-FQVIQOV5.js +163 -0
  49. package/dist/{chunk-LP4APBBQ.js → chunk-FZ7U3GZI.js} +1 -1
  50. package/dist/{chunk-MBMZEIOG.js → chunk-G5SVCJCT.js} +38 -51
  51. package/dist/{chunk-62DQXVPO.js → chunk-HDTS5AS5.js} +26 -7
  52. package/dist/{chunk-WC5HHPPM.js → chunk-HRJJKZGM.js} +1 -1
  53. package/dist/chunk-I7OMW4RJ.js +87 -0
  54. package/dist/{chunk-TQURLRHD.js → chunk-IL67WXRA.js} +1 -1
  55. package/dist/{chunk-QDEH776O.js → chunk-KBBBQCYV.js} +179 -20
  56. package/dist/{chunk-KUFIFCB4.js → chunk-KDGUQYYY.js} +1 -1
  57. package/dist/{chunk-IRRR3PWN.js → chunk-KQD4DYEP.js} +68 -35
  58. package/dist/{chunk-JBEWFFOK.js → chunk-LIIGX2XX.js} +1 -1
  59. package/dist/{chunk-IVBMHEPK.js → chunk-LX33FMTS.js} +23 -36
  60. package/dist/{chunk-HPINJGBO.js → chunk-METH7J6V.js} +13 -12
  61. package/dist/{chunk-N6BUYKF3.js → chunk-MLE6MKPY.js} +7 -7
  62. package/dist/{chunk-3CZXUKLG.js → chunk-MRDORR5Z.js} +8 -1
  63. package/dist/{chunk-6IHXVT5H.js → chunk-NSISYP6D.js} +1 -1
  64. package/dist/{chunk-P72Y5ZBH.js → chunk-O2IYZBX6.js} +15 -26
  65. package/dist/{chunk-TSAUBRRU.js → chunk-P7GPT4XL.js} +1 -1
  66. package/dist/{chunk-F5XCJ6UV.js → chunk-PA37GH3T.js} +33 -58
  67. package/dist/{chunk-BACYVEE6.js → chunk-QC6DSC4D.js} +2 -2
  68. package/dist/{chunk-ZVH6EB7S.js → chunk-QKRWXA5W.js} +1 -1
  69. package/dist/{chunk-D6C32XHS.js → chunk-QQPLW3ZX.js} +17359 -12634
  70. package/dist/chunk-QQPLW3ZX.js.LEGAL.txt +59 -0
  71. package/dist/{chunk-N4OXAS3A.js → chunk-R22FWLXU.js} +1 -1
  72. package/dist/{chunk-7HGFEQSD.js → chunk-R7UJIPJA.js} +5 -5
  73. package/dist/{chunk-NW3DH7IK.js → chunk-RAHBWFWV.js} +8457 -2726
  74. package/dist/{chunk-O5JHHRFN.js → chunk-RMV6IZ2C.js} +32 -116
  75. package/dist/{chunk-Z6AY5VOZ.js → chunk-RQIN5JYO.js} +9 -6
  76. package/dist/{chunk-Q5E4ZL2R.js → chunk-S2UG5HD6.js} +1 -1
  77. package/dist/{chunk-U3TEC52G.js → chunk-S637DPAG.js} +1 -1
  78. package/dist/chunk-S6KM4DOB.js +37 -0
  79. package/dist/{chunk-MPDKZVHT.js → chunk-SVX46YXY.js} +1 -3
  80. package/dist/{chunk-XTUSLUQ7.js → chunk-TLDULBKV.js} +70 -24
  81. package/dist/{chunk-L5WGVYXM.js → chunk-UFE7IMKQ.js} +2 -2
  82. package/dist/{chunk-ZUWBEV2O.js → chunk-UQHUYEFW.js} +1 -1
  83. package/dist/{chunk-XM27UVWN.js → chunk-V7WOX4O7.js} +3 -3
  84. package/dist/{chunk-W7LEYYFH.js → chunk-WJAHXDL4.js} +41 -32
  85. package/dist/{chunk-6GUJQURI.js → chunk-WLTE6OJM.js} +2 -2
  86. package/dist/{chunk-BG2KGLIA.js → chunk-WMZAJ7XA.js} +2 -2
  87. package/dist/chunk-WOLKTL4F.js +32 -0
  88. package/dist/{chunk-H5CAHDII.js → chunk-WQHOXPLV.js} +51929 -50256
  89. package/dist/{chunk-EUT45AKW.js → chunk-YODV42KQ.js} +25 -32
  90. package/dist/{chunk-FCAIYPDJ.js → chunk-ZFFWWZIA.js} +2 -2
  91. package/dist/{chunk-376GN4PB.js → chunk-ZTG7VIGB.js} +173 -79
  92. package/dist/{chunk-O6FDXE54.js → chunk-ZVUAJ7UV.js} +25 -36
  93. package/dist/daemon.js +15 -15
  94. package/dist/ext-frame/base.css +1 -1
  95. package/dist/extension-assets/atlassian/docs/confluence-writing.md +5 -5
  96. package/dist/extension-assets/diagram/bundle.js +3 -0
  97. package/dist/git-isolated-reader-helper.js +1 -1
  98. package/dist/main.js +57 -128
  99. package/dist/quick-script-docs/runtime/artifacts.md +11 -0
  100. package/dist/quick-script-docs/runtime/documents.md +21 -12
  101. package/dist/quick-script-docs/runtime/editing.md +44 -0
  102. package/dist/quick-script-docs/runtime/images.md +1 -1
  103. package/dist/sandbox-libraries/credential-runtime.js +3 -0
  104. package/dist/sandbox-libraries/extension-runtime.js +3 -0
  105. package/dist/web/assets/AsyncBashCenterHost-BlxXoXd6.js +2 -0
  106. package/dist/web/assets/{ConversationListItem-CCaGnyA1.js → ConversationListItem-DfSMoYfe.js} +3 -3
  107. package/dist/web/assets/{ConversationsWorkbenchPanel-DLM3saY5.js → ConversationsWorkbenchPanel-BOIMwRZx.js} +1 -1
  108. package/dist/web/assets/{DiscoverCenterHost-DVNL8uZQ.js → DiscoverCenterHost-Bi6audxE.js} +1 -1
  109. package/dist/web/assets/{ExtensionPageCenterHost-CHKg6c3M.js → ExtensionPageCenterHost-DEg-LHcU.js} +1 -1
  110. package/dist/web/assets/FileCenterComposedHost-CPwzMZI9.js +1 -0
  111. package/dist/web/assets/FilesWorkbenchPanel-DnKQd6QC.js +12 -0
  112. package/dist/web/assets/{GitDiffCenterHost-DmtKqHer.js → GitDiffCenterHost-DtsFPa1z.js} +1 -1
  113. package/dist/web/assets/{GitWorkbenchPanel-BmyMyvL8.js → GitWorkbenchPanel-BfJKdIkE.js} +1 -1
  114. package/dist/web/assets/LaunchCenterHost-C5Bd9ELF.js +1 -0
  115. package/dist/web/assets/LaunchConfigurationNotice-Dp3rBKil.js +1 -0
  116. package/dist/web/assets/LaunchOutputPane-BuCSQcxg.js +2 -0
  117. package/dist/web/assets/LaunchesWorkbenchPanel-CMd3Xcbp.js +1 -0
  118. package/dist/web/assets/{LogsCenterHost-CdqD6zH8.js → LogsCenterHost-Be6EbsrZ.js} +1 -1
  119. package/dist/web/assets/{MermaidCenterHost-BjwJLU-2.js → MermaidCenterHost-BdQ8CGeb.js} +1 -1
  120. package/dist/web/assets/MobileFilesBody-C1q-YRaD.js +1 -0
  121. package/dist/web/assets/MobileFilesHost-DK769osZ.js +1 -0
  122. package/dist/web/assets/MobileLaunchOutputHost-BLDX3-Tn.js +1 -0
  123. package/dist/web/assets/MobileLaunchesHost-Dv2gfOEY.js +2 -0
  124. package/dist/web/assets/{MobileNoteEditorHost-lfAeMVH9.js → MobileNoteEditorHost-ZRzzwCYD.js} +1 -1
  125. package/dist/web/assets/{MobileNotesHost-DOi0goPc.js → MobileNotesHost-COOtVfAp.js} +2 -2
  126. package/dist/web/assets/MobileSettingsHost-BU2lCcG2.js +2 -0
  127. package/dist/web/assets/{MobileSettingsPageHost-CtpUzfVG.js → MobileSettingsPageHost-BC5LOq7Y.js} +1 -1
  128. package/dist/web/assets/{NotesWorkbenchPanel-CsbMYHAw.js → NotesWorkbenchPanel-BiTDbfjj.js} +1 -1
  129. package/dist/web/assets/{PullRequestCenterHost-B22Ua7bA.js → PullRequestCenterHost-DV3V3yxm.js} +1 -1
  130. package/dist/web/assets/{PullRequestsWorkbenchPanel-DOIHvZ6H.js → PullRequestsWorkbenchPanel-Dpvt9W-q.js} +1 -1
  131. package/dist/web/assets/SearchWorkbenchPanel-Bfj8fwPg.js +1 -0
  132. package/dist/web/assets/SettingsCenterHost-sHWZehrB.js +1 -0
  133. package/dist/web/assets/SystemPromptCenterHost-CA9i8UbB.js +2 -0
  134. package/dist/web/assets/{ThemePreviewPicker-B_DTUsui.js → ThemePreviewPicker-PySjP6aS.js} +1 -1
  135. package/dist/web/assets/adapters-fVomUv3-.js +1 -0
  136. package/dist/web/assets/agent-profiles.svelte-CenutfXA.js +1 -0
  137. package/dist/web/assets/appearance.svelte-BKxiMJ3c.js +1 -0
  138. package/dist/web/assets/center-tabs.svelte-i0d5hUO3.js +2 -0
  139. package/dist/web/assets/{channel-CxF1CmEY.js → channel-DB8mSlhP.js} +2 -2
  140. package/dist/web/assets/{client-CVZRorEj.js → client-DHxa8CWS.js} +1 -1
  141. package/dist/web/assets/code-CsVM8hq8.js +7 -0
  142. package/dist/web/assets/conversation-activity-CZJfUGoL.js +1 -0
  143. package/dist/web/assets/conversation-connection-CaV3KY7Z.js +1 -0
  144. package/dist/web/assets/discover-Do0oQbdF.js +4 -0
  145. package/dist/web/assets/{dist-HTsJAisd.js → dist-B887qHIr.js} +1 -1
  146. package/dist/web/assets/{dist-CDM0qUmO.js → dist-Bg8Vm0DE.js} +1 -1
  147. package/dist/web/assets/{dist-BVmTdBxj.js → dist-C2z70795.js} +1 -1
  148. package/dist/web/assets/{dist-EmwCDpCc.js → dist-CcBabmlO.js} +1 -1
  149. package/dist/web/assets/{dist-DkQMSgZ5.js → dist-HSfz5y1D.js} +1 -1
  150. package/dist/web/assets/{dist-DZN4bTV3.js → dist-HUxdivoH.js} +1 -1
  151. package/dist/web/assets/{dist-BWsookwC.js → dist-wvfFRict.js} +1 -1
  152. package/dist/web/assets/{easing-DfoPn4-z.js → easing-B6dSt4eu.js} +1 -1
  153. package/dist/web/assets/empty-CtUlV5QU.js +1 -0
  154. package/dist/web/assets/eraser-B8qFMviR.js +1 -0
  155. package/dist/web/assets/{extension-themes.svelte-BAce41Wm.js → extension-themes.svelte-nXDPOl_E.js} +2 -2
  156. package/dist/web/assets/{file-tabs.svelte-CaZRhyw0.js → file-tabs.svelte-BxCAtif2.js} +2 -2
  157. package/dist/web/assets/files-DcUCbPX1.js +156 -0
  158. package/dist/web/assets/{files-dFQS0tcX.css → files-N9JiAfxr.css} +1 -1
  159. package/dist/web/assets/filesystem-9b72Tdkw.js +1 -0
  160. package/dist/web/assets/floating-toolbar-Cqtfs8M7.js +1 -0
  161. package/dist/web/assets/{git-store.svelte-DkeLA_WZ.js → git-store.svelte-DIVFeLGG.js} +1 -1
  162. package/dist/web/assets/{icon-action-efe9ZEWq.js → icon-action-C9h3TdBz.js} +1 -1
  163. package/dist/web/assets/index-6mIS-NWJ.js +165 -0
  164. package/dist/web/assets/index-D2aeJHnc.css +1 -0
  165. package/dist/web/assets/launches-Dafgn_my.js +5 -0
  166. package/dist/web/assets/launches.api-ZZ-IwIQ_.js +1 -0
  167. package/dist/web/assets/log-view-Dqspnrs0.js +1 -0
  168. package/dist/web/assets/{logs.api-gZ2mVC9q.js → logs.api-BxN21LL0.js} +1 -1
  169. package/dist/web/assets/{maintenance-state.svelte-xMmmI9yr.js → maintenance-state.svelte-BAKtNG-i.js} +2 -2
  170. package/dist/web/assets/menu-icons-tnCN992t.js +1 -0
  171. package/dist/web/assets/{mermaid-ACpEwsfj.js → mermaid-DL5xfcqL.js} +1 -1
  172. package/dist/web/assets/mobile-launch-rows-DR6V5AUH.js +1 -0
  173. package/dist/web/assets/page-tabs.svelte-wduGZwmi.js +4 -0
  174. package/dist/web/assets/panel-BW0llJiU.js +1 -0
  175. package/dist/web/assets/popover-panel-DO5nPkvA.js +4 -0
  176. package/dist/web/assets/pr-view-loader.svelte-RSHgeFYM.js +1 -0
  177. package/dist/web/assets/progress-CRuzrJQt.js +1 -0
  178. package/dist/web/assets/{scratch-notes-state.svelte-rBeSOn4h.js → scratch-notes-state.svelte-BcqgnE6z.js} +1 -1
  179. package/dist/web/assets/{scratch-notes.api-Co80EGtL.js → scratch-notes.api-D9wtv1Mn.js} +1 -1
  180. package/dist/web/assets/settings-CKsESd2i.js +1 -0
  181. package/dist/web/assets/settings-Crny2xGb.js +1 -0
  182. package/dist/web/assets/settings-scope-BiY5kIdC.js +35 -0
  183. package/dist/web/assets/shell-BiZy0tcZ.js +1 -0
  184. package/dist/web/assets/shell-layout.svelte-9B3T60gv.js +2 -0
  185. package/dist/web/assets/{lock-open-BBTCOUg5.js → tag-Bp1l7psd.js} +1 -1
  186. package/dist/web/assets/time-egBWJGDu.js +1 -0
  187. package/dist/web/assets/views-Bl6CiPE0.js +2 -0
  188. package/dist/web/assets/{workbench-connection-Gsy9bIuP.js → workbench-connection-CyMud_mZ.js} +1 -1
  189. package/dist/web/assets/{workspace-CUoFFOwJ.js → workspace-V-yCOfn1.js} +1 -1
  190. package/dist/web/assets/workspace-actions.svelte-D8-Agx2d.js +1 -0
  191. package/dist/web/assets/{workspace-selectors.svelte-D-EQR_-Z.js → workspace-selectors.svelte-DQ1mQdvX.js} +2 -2
  192. package/dist/web/index.html +47 -48
  193. package/dist/web/sw.js +1 -1
  194. package/dist/worker.js +14 -14
  195. package/package.json +7 -7
  196. package/dist/builtin/configure-nerve/guide/collaboration.md +0 -15
  197. package/dist/builtin/configure-nerve/scripts/nerve-version.json +0 -1
  198. package/dist/chunk-D6C32XHS.js.LEGAL.txt +0 -25
  199. package/dist/chunk-RJR7DJJK.js +0 -32
  200. package/dist/chunk-UVRULOOP.js +0 -35
  201. package/dist/quick-script-docs/runtime/files.md +0 -11
  202. package/dist/web/assets/AsyncBashCenterHost-DldW4utc.js +0 -2
  203. package/dist/web/assets/FileCenterComposedHost-kxFWeFmP.js +0 -1
  204. package/dist/web/assets/FilesWorkbenchPanel-BxjUf50f.js +0 -12
  205. package/dist/web/assets/LaunchCenterHost-1xrIDf73.js +0 -1
  206. package/dist/web/assets/LaunchConfigurationNotice-BfRdIOv0.js +0 -1
  207. package/dist/web/assets/LaunchesWorkbenchPanel-BhCyWFHf.js +0 -1
  208. package/dist/web/assets/LogStream-C70iQmUI.css +0 -1
  209. package/dist/web/assets/LogStream-CibF_jgC.js +0 -1
  210. package/dist/web/assets/MobileFilesBody-4bLT2m0j.js +0 -1
  211. package/dist/web/assets/MobileFilesHost-X_0r4Z16.js +0 -1
  212. package/dist/web/assets/MobileLaunchOutputHost-BEchaBtD.js +0 -1
  213. package/dist/web/assets/MobileLaunchesHost-S7Z3DySI.js +0 -2
  214. package/dist/web/assets/MobileSettingsHost-94-sABuO.js +0 -2
  215. package/dist/web/assets/SearchWorkbenchPanel-CKccBrNr.js +0 -1
  216. package/dist/web/assets/SettingsCenterHost-BM-xIy5S.js +0 -1
  217. package/dist/web/assets/SystemPromptCenterHost-VL4DXNId.js +0 -1
  218. package/dist/web/assets/adapters-CbIIxNp9.js +0 -1
  219. package/dist/web/assets/agent-profiles.svelte-8LAIYKmb.js +0 -1
  220. package/dist/web/assets/appearance.svelte-CLR_fMAx.js +0 -1
  221. package/dist/web/assets/center-tabs.svelte-BCriw5Eu.js +0 -1
  222. package/dist/web/assets/code-H_8FkG35.js +0 -7
  223. package/dist/web/assets/conversation-activity-Dl7udunb.js +0 -1
  224. package/dist/web/assets/conversation-connection-B226pY9T.js +0 -1
  225. package/dist/web/assets/discover-DTlfL84I.js +0 -4
  226. package/dist/web/assets/empty-B8eEKvqc.js +0 -1
  227. package/dist/web/assets/file-code-CMYYNL9l.js +0 -1
  228. package/dist/web/assets/files-eAvb-uRC.js +0 -48
  229. package/dist/web/assets/filesystem-CmkTuQNl.js +0 -1
  230. package/dist/web/assets/floating-toolbar-BwJ2tdsN.js +0 -1
  231. package/dist/web/assets/index-CH1Mvlxk.css +0 -1
  232. package/dist/web/assets/index-DNfABG4x.js +0 -172
  233. package/dist/web/assets/launches-ZxeZFPI8.js +0 -5
  234. package/dist/web/assets/launches.api-BEsX6AKZ.js +0 -1
  235. package/dist/web/assets/launches.svelte-QFDoCgug.js +0 -2
  236. package/dist/web/assets/menu-icons-C24r3TCF.js +0 -1
  237. package/dist/web/assets/mobile-launch-rows-Ci7ldwx6.js +0 -1
  238. package/dist/web/assets/page-tabs.svelte-VZp38ac7.js +0 -4
  239. package/dist/web/assets/panel-DEG1zXHj.js +0 -1
  240. package/dist/web/assets/popover-panel-B1cUdhY5.js +0 -5
  241. package/dist/web/assets/pr-view-loader.svelte-CZfxwzwL.js +0 -1
  242. package/dist/web/assets/progress-D2Cb6vK_.js +0 -1
  243. package/dist/web/assets/settings-B_ed0eye.js +0 -1
  244. package/dist/web/assets/settings-Dzj6Az_d.js +0 -1
  245. package/dist/web/assets/settings-scope-BjQBgG9v.js +0 -33
  246. package/dist/web/assets/shell-CbR1KanT.js +0 -1
  247. package/dist/web/assets/shell-layout.svelte-D5u4i1UJ.js +0 -2
  248. package/dist/web/assets/time-DqcZ_PFK.js +0 -1
  249. package/dist/web/assets/views-D4ociG21.js +0 -2
  250. package/dist/web/assets/workspace-actions.svelte-BMp3D2e1.js +0 -1
  251. /package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/create-extension.mjs +0 -0
  252. /package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/install-extension.mjs +0 -0
  253. /package/dist/builtin/configure-nerve/{scripts → reference/extensions/scripts}/upgrade-extension.mjs +0 -0
  254. /package/dist/builtin/configure-nerve/{reference/writing-for-agents.md → writing-for-agents.md} +0 -0
  255. /package/dist/{chunk-H5CAHDII.js.LEGAL.txt → chunk-WQHOXPLV.js.LEGAL.txt} +0 -0
package/dist/main.js CHANGED
@@ -14,11 +14,15 @@ import {
14
14
  CREDENTIAL_ROTATION_HEADER,
15
15
  DAEMON_LEASE_CONFLICT_CODE,
16
16
  LOCAL_TOKEN_COOKIE_NAME,
17
+ appendLogLine,
17
18
  parseProjectRelativePath,
19
+ performanceLogFilename,
18
20
  readCurrentSettingsForBootstrap,
19
21
  resolveApplicationConfiguration,
20
- version
21
- } from "./chunk-H5CAHDII.js";
22
+ serializeCrashError,
23
+ version,
24
+ writeCrashReportSync
25
+ } from "./chunk-WQHOXPLV.js";
22
26
  import "./chunk-KKPRPUSK.js";
23
27
  import "./chunk-RGDXDX7B.js";
24
28
  import "./chunk-OQC3F6JA.js";
@@ -30,8 +34,9 @@ import "./chunk-JYWXPSUY.js";
30
34
  import {
31
35
  MIGRATION_METADATA,
32
36
  MIN_DAEMON_MAX_OLD_SPACE_MB,
37
+ SerialQueue,
38
+ atomicWriteFile,
33
39
  createId,
34
- daemonCrashReportSchema,
35
40
  daemonFileSchema,
36
41
  defaultSettings,
37
42
  homeAdmissionFailureKind,
@@ -41,21 +46,22 @@ import {
41
46
  resolveDataDir,
42
47
  serverHealthSchema,
43
48
  settingsSchema,
49
+ sleep,
44
50
  storagePaths
45
- } from "./chunk-DHIDYKXJ.js";
46
- import "./chunk-62DQXVPO.js";
47
- import "./chunk-RJR7DJJK.js";
48
- import "./chunk-RL52LSTV.js";
49
- import "./chunk-ZVH6EB7S.js";
50
- import "./chunk-FCAIYPDJ.js";
51
+ } from "./chunk-3LWB5SGT.js";
52
+ import "./chunk-HDTS5AS5.js";
53
+ import "./chunk-WOLKTL4F.js";
54
+ import "./chunk-F3X2KHP4.js";
55
+ import "./chunk-QKRWXA5W.js";
56
+ import "./chunk-ZFFWWZIA.js";
51
57
  import "./chunk-54GJIXAU.js";
52
- import "./chunk-MTHLTFG4.js";
53
- import "./chunk-JBEWFFOK.js";
54
- import "./chunk-BG2KGLIA.js";
55
- import "./chunk-W7LEYYFH.js";
56
- import "./chunk-DDBE2VLT.js";
57
- import "./chunk-Q3C7TQ2M.js";
58
- import "./chunk-U5KGV63C.js";
58
+ import "./chunk-5VLAJMQQ.js";
59
+ import "./chunk-LIIGX2XX.js";
60
+ import "./chunk-WMZAJ7XA.js";
61
+ import "./chunk-WJAHXDL4.js";
62
+ import "./chunk-A3OFIREH.js";
63
+ import "./chunk-FNWUCFVO.js";
64
+ import "./chunk-EZJH7ED5.js";
59
65
  import "./chunk-CWESUMYQ.js";
60
66
 
61
67
  // packages/desktop-shell/dist/main.js
@@ -328,7 +334,7 @@ function createDesktopConfigurationController(options) {
328
334
  }
329
335
 
330
336
  // packages/desktop-shell/dist/daemon/composition.js
331
- import { join as join6 } from "node:path";
337
+ import { join as join5 } from "node:path";
332
338
 
333
339
  // packages/desktop-shell/dist/daemon/profile.js
334
340
  import { homedir } from "node:os";
@@ -1332,12 +1338,11 @@ function monitorExistingDaemon(existing, paths, readinessTimeoutMs, ports) {
1332
1338
  }
1333
1339
 
1334
1340
  // packages/desktop-shell/dist/daemon/adapters/remote-credential-store.js
1335
- import { mkdir as mkdir2, readFile, rename, writeFile } from "node:fs/promises";
1336
- import { dirname as dirname2 } from "node:path";
1341
+ import { readFile } from "node:fs/promises";
1337
1342
  function createRemoteCredentialStore(options) {
1338
1343
  const { filePath, cipher, logger } = options;
1339
1344
  const memory = /* @__PURE__ */ new Map();
1340
- let writeChain = Promise.resolve();
1345
+ const writes = new SerialQueue();
1341
1346
  async function readFileEntries() {
1342
1347
  try {
1343
1348
  const parsed = JSON.parse(await readFile(filePath, "utf8"));
@@ -1347,16 +1352,14 @@ function createRemoteCredentialStore(options) {
1347
1352
  }
1348
1353
  }
1349
1354
  function persist(update) {
1350
- const next = writeChain.then(async () => {
1355
+ return writes.run(async () => {
1351
1356
  const entries = await readFileEntries();
1352
1357
  update(entries);
1353
- await mkdir2(dirname2(filePath), { recursive: true });
1354
- const temp = `${filePath}.${process.pid}.tmp`;
1355
- await writeFile(temp, JSON.stringify(entries), { mode: 384 });
1356
- await rename(temp, filePath);
1358
+ await atomicWriteFile(filePath, JSON.stringify(entries), {
1359
+ mode: 384,
1360
+ durability: "directory"
1361
+ });
1357
1362
  });
1358
- writeChain = next.catch(() => void 0);
1359
- return next;
1360
1363
  }
1361
1364
  return {
1362
1365
  async load(origin) {
@@ -1403,70 +1406,6 @@ import { access } from "node:fs/promises";
1403
1406
  import { hostname } from "node:os";
1404
1407
  import { fileURLToPath } from "node:url";
1405
1408
 
1406
- // packages/desktop-shell/dist/crash-reports.js
1407
- import { mkdirSync, writeFileSync } from "node:fs";
1408
- import { join as join4 } from "node:path";
1409
- function writeCrashReportSync(dataDir, input) {
1410
- try {
1411
- const ts = (/* @__PURE__ */ new Date()).toISOString();
1412
- const report = daemonCrashReportSchema.parse({
1413
- id: createId("crash"),
1414
- ts,
1415
- dataDir,
1416
- runtime: {
1417
- node: process.version,
1418
- platform: process.platform,
1419
- arch: process.arch
1420
- },
1421
- ...input
1422
- });
1423
- const dir = join4(dataDir, "crashes");
1424
- mkdirSync(dir, { recursive: true, mode: 448 });
1425
- const safeTs = ts.replace(/[:.]/g, "-");
1426
- const path = join4(dir, `${safeTs}-${report.id}.json`);
1427
- writeFileSync(path, `${JSON.stringify(report, null, 2)}
1428
- `, {
1429
- encoding: "utf8",
1430
- mode: 384
1431
- });
1432
- return path;
1433
- } catch (error) {
1434
- console.error("[nerve] failed to write crash report", error);
1435
- return void 0;
1436
- }
1437
- }
1438
- function serializeCrashError(error) {
1439
- if (error instanceof Error) {
1440
- return { name: error.name, message: error.message, stack: error.stack };
1441
- }
1442
- if (typeof error === "string")
1443
- return { message: error };
1444
- if (error && typeof error === "object") {
1445
- const pretty = safeStringify2(error);
1446
- return {
1447
- name: typeof error.name === "string" ? error.name : void 0,
1448
- message: typeof error.message === "string" ? error.message : pretty.split("\n", 1)[0],
1449
- stack: typeof error.stack === "string" ? error.stack : pretty
1450
- };
1451
- }
1452
- return { message: String(error) };
1453
- }
1454
- function safeStringify2(value) {
1455
- try {
1456
- const seen = /* @__PURE__ */ new WeakSet();
1457
- return JSON.stringify(value, (_key, val) => {
1458
- if (val && typeof val === "object") {
1459
- if (seen.has(val))
1460
- return "[Circular]";
1461
- seen.add(val);
1462
- }
1463
- return val;
1464
- }, 2);
1465
- } catch {
1466
- return String(value);
1467
- }
1468
- }
1469
-
1470
1409
  // packages/desktop-shell/dist/daemon/adapters/daemon-access.js
1471
1410
  var REQUEST_TIMEOUT_MS = 1e4;
1472
1411
  function createDaemonAccessClient(request = fetch) {
@@ -1629,7 +1568,7 @@ import { spawn } from "node:child_process";
1629
1568
 
1630
1569
  // packages/desktop-shell/dist/daemon/adapters/diagnostic-report.js
1631
1570
  import { readdir, stat } from "node:fs/promises";
1632
- import { join as join5 } from "node:path";
1571
+ import { join as join4 } from "node:path";
1633
1572
  async function captureDiagnosticReport(child, dataDir) {
1634
1573
  const startedAt = Date.now();
1635
1574
  if (process.platform === "win32")
@@ -1641,7 +1580,7 @@ async function captureDiagnosticReport(child, dataDir) {
1641
1580
  elapsedMs: 0,
1642
1581
  error: "Daemon PID is unavailable"
1643
1582
  };
1644
- const directory = join5(dataDir, "crashes");
1583
+ const directory = join4(dataDir, "crashes");
1645
1584
  const before = new Set(await readdir(directory).catch(() => []));
1646
1585
  if (!child.kill("SIGUSR2"))
1647
1586
  return {
@@ -1652,12 +1591,12 @@ async function captureDiagnosticReport(child, dataDir) {
1652
1591
  const pidMarker = `.${pid}.`;
1653
1592
  let candidate;
1654
1593
  while (Date.now() - startedAt < DAEMON_DIAGNOSTIC_TIMEOUT_MS) {
1655
- await new Promise((resolve3) => setTimeout(resolve3, DAEMON_DIAGNOSTIC_POLL_INTERVAL_MS));
1594
+ await sleep(DAEMON_DIAGNOSTIC_POLL_INTERVAL_MS);
1656
1595
  const names = await readdir(directory).catch(() => []);
1657
1596
  const name = names.find((value) => !before.has(value) && value.startsWith("report.") && value.includes(pidMarker) && value.endsWith(".json"));
1658
1597
  if (!name)
1659
1598
  continue;
1660
- const path = join5(directory, name);
1599
+ const path = join4(directory, name);
1661
1600
  const info = await stat(path).catch(() => void 0);
1662
1601
  if (!info?.isFile())
1663
1602
  continue;
@@ -1759,7 +1698,7 @@ function createNodeDaemonPorts(credentials) {
1759
1698
  },
1760
1699
  scheduler: {
1761
1700
  now: () => Date.now(),
1762
- delay: (ms) => new Promise((resolveDelay) => setTimeout(resolveDelay, ms)),
1701
+ delay: (ms) => sleep(ms),
1763
1702
  every: (ms, callback) => {
1764
1703
  const timer = setInterval(callback, ms);
1765
1704
  timer.unref?.();
@@ -1802,7 +1741,7 @@ function ensureDaemon(options = {}) {
1802
1741
  const credentials = createRemoteCredentialStore({
1803
1742
  // Electron profile data, not NERVE_HOME: the credential belongs to this
1804
1743
  // desktop install, not to the daemon's data directory.
1805
- filePath: join6(app.getPath("userData"), "remote-credentials.json"),
1744
+ filePath: join5(app.getPath("userData"), "remote-credentials.json"),
1806
1745
  cipher: {
1807
1746
  isAvailable: () => safeStorage.isEncryptionAvailable(),
1808
1747
  encrypt: (plain) => safeStorage.encryptString(plain),
@@ -1960,7 +1899,7 @@ function registerDirectoryDialogIpc() {
1960
1899
 
1961
1900
  // packages/desktop-shell/dist/ipc/project-entry-path.js
1962
1901
  import { realpath } from "node:fs/promises";
1963
- import { basename, dirname as dirname3, isAbsolute as isAbsolute2, join as join7, posix, relative, sep, win32 } from "node:path";
1902
+ import { basename, dirname as dirname2, isAbsolute as isAbsolute2, join as join6, posix, relative, sep, win32 } from "node:path";
1964
1903
  function parseProjectEntryTarget(input) {
1965
1904
  if (!input || typeof input !== "object")
1966
1905
  throw new Error("Project entry target is required.");
@@ -1990,7 +1929,7 @@ function resolveProjectEntryPath(root, segments, platform = process.platform) {
1990
1929
  async function resolveContainedProjectEntryPath(root, segments, options) {
1991
1930
  const target = resolveProjectEntryPath(root, segments);
1992
1931
  const realRoot = await realpath(root);
1993
- const real = options.followLeaf ? await realpath(target) : join7(await realpath(dirname3(target)), basename(target));
1932
+ const real = options.followLeaf ? await realpath(target) : join6(await realpath(dirname2(target)), basename(target));
1994
1933
  const fromRoot = relative(realRoot, real);
1995
1934
  if (fromRoot === ".." || fromRoot.startsWith(`..${sep}`) || isAbsolute2(fromRoot))
1996
1935
  throw new Error("Project entry path escapes the project root.");
@@ -2225,29 +2164,19 @@ function registerDesktopIpc(options) {
2225
2164
  }
2226
2165
 
2227
2166
  // packages/desktop-shell/dist/performance/performance-monitor.js
2228
- import { appendFile as appendFile2, mkdir as mkdir3 } from "node:fs/promises";
2229
- import { dirname as dirname4, join as join8 } from "node:path";
2167
+ import { join as join7 } from "node:path";
2230
2168
  var SAMPLE_INTERVAL_MS = 1e4;
2231
- async function appendJsonLine(path, line) {
2232
- await mkdir3(dirname4(path), { recursive: true });
2233
- await appendFile2(path, line, "utf8");
2234
- }
2235
- var SAFE_SESSION_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
2236
- function performanceLogFilename(sessionId, source, now, pid) {
2237
- const safeSessionId = SAFE_SESSION_ID.test(sessionId ?? "") ? sessionId : `${now.toISOString().replace(/[-:.]/g, "")}-${source}-${Math.max(0, Math.trunc(pid))}`;
2238
- return `performance-${safeSessionId}.jsonl`;
2239
- }
2240
2169
  function kilobytesToBytes(value) {
2241
2170
  return value === void 0 ? void 0 : value * 1024;
2242
2171
  }
2243
2172
  function installDesktopPerformanceMonitor(options) {
2244
2173
  if (!options.enabled)
2245
2174
  return { stop: () => void 0 };
2246
- const append = options.append ?? appendJsonLine;
2175
+ const append = options.append ?? appendLogLine;
2247
2176
  const now = options.now ?? (() => /* @__PURE__ */ new Date());
2248
2177
  const createInterval = options.setInterval ?? setInterval;
2249
2178
  const destroyInterval = options.clearInterval ?? clearInterval;
2250
- const path = join8(options.dataDir, "logs", performanceLogFilename(options.sessionId, "desktop", now(), options.pid ?? process.pid));
2179
+ const path = join7(options.dataDir, "logs", performanceLogFilename(options.sessionId, "desktop", now(), options.pid ?? process.pid));
2251
2180
  let stopped = false;
2252
2181
  let writing = false;
2253
2182
  let warned = false;
@@ -2450,7 +2379,7 @@ function headerValue(headers, name) {
2450
2379
 
2451
2380
  // packages/desktop-shell/dist/window/preload-paths.js
2452
2381
  import { existsSync } from "node:fs";
2453
- import { dirname as dirname5, join as join9 } from "node:path";
2382
+ import { dirname as dirname3, join as join8 } from "node:path";
2454
2383
  import { fileURLToPath as fileURLToPath2 } from "node:url";
2455
2384
 
2456
2385
  // packages/desktop-shell/dist/window/desktop-asset-names.js
@@ -2467,9 +2396,9 @@ function trayIconAssetSegments(platform, shouldUseDarkColors) {
2467
2396
 
2468
2397
  // packages/desktop-shell/dist/window/preload-paths.js
2469
2398
  function resolvePackageRoot() {
2470
- let directory = dirname5(fileURLToPath2(import.meta.url));
2471
- while (!existsSync(join9(directory, "package.json"))) {
2472
- const parent = dirname5(directory);
2399
+ let directory = dirname3(fileURLToPath2(import.meta.url));
2400
+ while (!existsSync(join8(directory, "package.json"))) {
2401
+ const parent = dirname3(directory);
2473
2402
  if (parent === directory)
2474
2403
  throw new Error("Could not locate the desktop package root.");
2475
2404
  directory = parent;
@@ -2477,7 +2406,7 @@ function resolvePackageRoot() {
2477
2406
  return directory;
2478
2407
  }
2479
2408
  function resolvePreloadPath() {
2480
- return join9(resolvePackageRoot(), "dist", "preload.cjs");
2409
+ return join8(resolvePackageRoot(), "dist", "preload.cjs");
2481
2410
  }
2482
2411
  function resolveAppIconPath() {
2483
2412
  return resolveDesktopAssetPath(...appIconAssetSegments(process.platform));
@@ -2486,7 +2415,7 @@ function resolveTrayIconPath() {
2486
2415
  return resolveDesktopAssetPath(...trayIconAssetSegments(process.platform, nativeTheme.shouldUseDarkColors));
2487
2416
  }
2488
2417
  function resolveDesktopAssetPath(...segments) {
2489
- return join9(resolvePackageRoot(), ...segments);
2418
+ return join8(resolvePackageRoot(), ...segments);
2490
2419
  }
2491
2420
 
2492
2421
  // packages/desktop-shell/dist/window/gpu-process.js
@@ -2612,8 +2541,8 @@ function createTrayIcon() {
2612
2541
  }
2613
2542
 
2614
2543
  // packages/desktop-shell/dist/window/window-appearance.js
2615
- import { mkdirSync as mkdirSync2, readFileSync, writeFileSync as writeFileSync2 } from "node:fs";
2616
- import { dirname as dirname6, join as join10 } from "node:path";
2544
+ import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
2545
+ import { dirname as dirname4, join as join9 } from "node:path";
2617
2546
  var WINDOW_APPEARANCE_FILE = "window-appearance.json";
2618
2547
  var DEFAULT_WINDOW_APPEARANCE = {
2619
2548
  background: "#272521",
@@ -2632,13 +2561,13 @@ function parseWindowAppearance(value) {
2632
2561
  return { background: background.toLowerCase(), dark };
2633
2562
  }
2634
2563
  function windowAppearanceFilePath(userDataDir) {
2635
- return join10(userDataDir, WINDOW_APPEARANCE_FILE);
2564
+ return join9(userDataDir, WINDOW_APPEARANCE_FILE);
2636
2565
  }
2637
2566
  var nodeFiles = {
2638
2567
  read: (path) => readFileSync(path, "utf8"),
2639
2568
  write: (path, contents) => {
2640
- mkdirSync2(dirname6(path), { recursive: true });
2641
- writeFileSync2(path, contents);
2569
+ mkdirSync(dirname4(path), { recursive: true });
2570
+ writeFileSync(path, contents);
2642
2571
  }
2643
2572
  };
2644
2573
  function readWindowAppearance(path, files = nodeFiles) {
@@ -3025,8 +2954,8 @@ function openExternally(rawUrl) {
3025
2954
  }
3026
2955
 
3027
2956
  // packages/desktop-shell/dist/app/desktop-runtime.js
3028
- import { appendFile as appendFile3, mkdir as mkdir4 } from "node:fs/promises";
3029
- import { dirname as dirname7, join as join11 } from "node:path";
2957
+ import { appendFile as appendFile2, mkdir as mkdir2 } from "node:fs/promises";
2958
+ import { dirname as dirname5, join as join10 } from "node:path";
3030
2959
 
3031
2960
  // packages/desktop-shell/dist/app/runtime-recovery.js
3032
2961
  async function startRunRuntime(start) {
@@ -3931,9 +3860,9 @@ var DesktopRuntime = class {
3931
3860
  if (desktopOptions2.mode === "remote")
3932
3861
  return;
3933
3862
  try {
3934
- const path = join11(desktopDataDir2, "logs", "startup.jsonl");
3935
- await mkdir4(dirname7(path), { recursive: true });
3936
- await appendFile3(path, `${JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...record })}
3863
+ const path = join10(desktopDataDir2, "logs", "startup.jsonl");
3864
+ await mkdir2(dirname5(path), { recursive: true });
3865
+ await appendFile2(path, `${JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...record })}
3937
3866
  `, "utf8");
3938
3867
  } catch {
3939
3868
  }
@@ -0,0 +1,11 @@
1
+ # Artifacts and handles
2
+
3
+ Artifacts are this conversation's own files: script results, downloads (`web.fetch` files arrive as `artifact:web-N.ext`) and generated documents. They live in `$NERVE_HOME/data/conversations/<id>/quick-script/`, are shared by all scripts of the conversation and kept across runs. Each result prints `Artifacts: … in <folder>`, so the Read/Edit tools can open `<folder>/<name>` directly. Artifacts need no permission.
4
+
5
+ `artifacts.*` takes a name or an `artifact:<name>` handle. Names: 1-128 letters (any language), digits, spaces, `.`, `_`, `-`; no folders, no leading dot. A missing artifact lists the existing ones. Workspace files go through `files.*`, checked like the read, write and edit tools.
6
+
7
+ A **handle** is `artifact:<name>` or a workspace path. Methods that take any file (`image(…)`, attachments, page `attachments`) accept both, also across runs.
8
+
9
+ Limits: `artifacts.read`/`artifacts.write` and `files.read`/`files.write` {{limit:files.read}}; attachment upload/download and binary `request()` responses {{limit:attachments}} (streamed between disk and the network, never held in memory or the sandbox).
10
+
11
+ `artifacts.edit({ name, edits })` takes the edits of `files.edit`: `sdk.docs("files/editing")`. Office documents and spreadsheets: `sdk.docs("libraries/documents")`. Image transforms: `sdk.docs("image/chain")`.
@@ -1,13 +1,13 @@
1
1
  # Office documents and spreadsheets
2
2
 
3
- Libraries load when the script mentions them. QuickJS has no JIT, so keep data to tens of thousands of rows. Files go through handles: `sdk.docs("files/handles")`.
3
+ Libraries load when the script mentions them. QuickJS has no JIT, so keep data to tens of thousands of rows. Workspace files go through `files.*`, generated ones through `artifacts.*` (`sdk.docs("artifacts/handles")`).
4
4
 
5
5
  ## Excel and CSV
6
6
 
7
- `XLSX` (SheetJS CE 0.20) and `Papa` (Papa Parse 5). Read bytes with `{ type: "array" }`; write with `XLSX.write(wb, { type: "array", bookType: "xlsx" })` straight into `files.write`.
7
+ `XLSX` (SheetJS CE 0.20) and `Papa` (Papa Parse 5). Read bytes with `{ type: "array" }`; write with `XLSX.write(wb, { type: "array", bookType: "xlsx" })` straight into `artifacts.write`.
8
8
 
9
9
  ```ts
10
- const wb = XLSX.read(await files.read("./budget.xlsx", { as: "bytes" }), {
10
+ const wb = XLSX.read(await files.read({ path: "budget.xlsx", as: "bytes" }), {
11
11
  type: "array",
12
12
  });
13
13
  const rows = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
@@ -16,11 +16,14 @@ const rows = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
16
16
  ```ts
17
17
  const book = XLSX.utils.book_new();
18
18
  XLSX.utils.book_append_sheet(book, XLSX.utils.json_to_sheet(rows), "Sprint");
19
- const xlsx = await files.write(
20
- "sprint.xlsx",
21
- XLSX.write(book, { type: "array", bookType: "xlsx" }),
22
- );
23
- const csv = await files.write("sprint.csv", Papa.unparse(rows));
19
+ const xlsx = await artifacts.write({
20
+ name: "sprint.xlsx",
21
+ data: XLSX.write(book, { type: "array", bookType: "xlsx" }),
22
+ });
23
+ const csv = await artifacts.write({
24
+ name: "sprint.csv",
25
+ data: Papa.unparse(rows),
26
+ });
24
27
  // The handles go to any SDK method that takes a file.
25
28
  console.log(xlsx, csv);
26
29
  ```
@@ -33,8 +36,11 @@ Write with `docx`, read with `mammoth`. Pack with `"uint8array"` (never `toBuffe
33
36
  const doc = new docx.Document({
34
37
  sections: [{ children: [new docx.Paragraph("Hello")] }],
35
38
  });
36
- await files.write("hello.docx", await docx.Packer.pack(doc, "uint8array"));
37
- const bytes = await files.read("artifact:hello.docx", { as: "bytes" });
39
+ await artifacts.write({
40
+ name: "hello.docx",
41
+ data: await docx.Packer.pack(doc, "uint8array"),
42
+ });
43
+ const bytes = await artifacts.read({ name: "hello.docx", as: "bytes" });
38
44
  const text = (await mammoth.extractRawText(bytes)).value; // or convertToMarkdown(bytes)
39
45
  ```
40
46
 
@@ -47,8 +53,11 @@ const deck = new PptxGenJS();
47
53
  const slide = deck.addSlide();
48
54
  slide.addText("Q3 review", { x: 1, y: 1, w: 6, h: 1, fontSize: 32 });
49
55
  slide.addNotes("Say hi");
50
- await files.write("deck.pptx", await deck.write({ outputType: "uint8array" }));
56
+ await artifacts.write({
57
+ name: "deck.pptx",
58
+ data: await deck.write({ outputType: "uint8array" }),
59
+ });
51
60
  const { slides } = await pptxText(
52
- await files.read("artifact:deck.pptx", { as: "bytes" }),
61
+ await artifacts.read({ name: "deck.pptx", as: "bytes" }),
53
62
  ); // { index, text, notes }[]
54
63
  ```
@@ -0,0 +1,44 @@
1
+ # Editing files
2
+
3
+ `files.edit` changes workspace files; `artifacts.edit({ name, edits, dryRun? })` takes the same edits for one artifact. Format and test afterwards with bash.
4
+
5
+ ```js
6
+ files.edit({
7
+ glob: "src/**/*.ts", // or path; an edit may name its own
8
+ edits: [
9
+ { pattern: /\bfetchUser\b/g, replacement: "loadUser", count: 6 },
10
+ { oldText: "console.log(", newText: "logger.debug(", all: true },
11
+ {
12
+ path: "src/config.ts",
13
+ from: "// legacy start",
14
+ through: "// legacy end\n",
15
+ },
16
+ ],
17
+ });
18
+ ```
19
+
20
+ | Edit | Effect | Must match |
21
+ | ------------------------------------------------- | ------------------------------------------------------ | ------------------------------- |
22
+ | `{ oldText, newText }` | Replaces the exact text | once |
23
+ | `{ oldText, newText, all: true, count? }` | Replaces every occurrence | at least once, or `count` times |
24
+ | `{ pattern, replacement, count? }` | Regex; `$1`, `$<name>` as in `String.replace` | once; with a `g` flag as above |
25
+ | `{ from, through, newText? }` | Replaces from `from` through the next `through` | `from` once |
26
+ | `{ from, upTo, newText? }` | Replaces from `from` up to the next `upTo`, keeping it | `from` once |
27
+ | `{ insertBefore, text }`, `{ insertAfter, text }` | Inserts next to the anchor | anchor once |
28
+
29
+ - **Order.** A file's edits apply in list order, each to the result of the previous one. (The Edit tool matches every edit against the original text.)
30
+ - **All or nothing.** Every edit is checked before anything is written; a mismatch fails the call with the edit's index and file, and nothing changes. A `glob` edit skips files without a match but must match at least once in total (or `count` times).
31
+ - **Range edits** delete the range when `newText` is omitted.
32
+ - **Result.** It prints as one line per file, for the first 20 files: lines added and removed, and each edit's matches (`src/api.ts +3 -3: [0] 2, [1] 1`). `result.files` has all of them. `result.diff` is the unified diff, cut at {{limit:edit.diff}} with the rest in `diffFile`. The run's result also states each edit's total matches.
33
+ - **Dry run.** `dryRun: true` checks everything, writes nothing, and prints the diff after the per-file lines.
34
+ - **Limits.** 500 files and {{limit:edit.bytes}} per call; binary files are refused; line endings and a BOM are kept.
35
+
36
+ For logic the edits cannot express, `transform` maps each file's text to its new text, with the same all-or-nothing write. Return `undefined` to leave a file unchanged.
37
+
38
+ ```js
39
+ files.edit({
40
+ glob: "src/**/*.ts",
41
+ transform: (text, path) =>
42
+ text.replace(/TODO\((\w+)\)/g, (_, who) => `TODO(@${who.toLowerCase()})`),
43
+ });
44
+ ```
@@ -1,6 +1,6 @@
1
1
  # Image transforms
2
2
 
3
- `image(handle)` is a chain; bytes stay on the host. Steps build operations (crop runs before resize); `info()` and `save(name)` execute. Handles: `sdk.docs("files/handles")`.
3
+ `image(handle)` is a chain; bytes stay on the host. Steps build operations (crop runs before resize); `info()` and `save(name)` execute. Handles: `sdk.docs("artifacts/handles")`.
4
4
 
5
5
  ```ts
6
6
  const small = await image("./shot.png")
@@ -67,6 +67,9 @@
67
67
  return definition;
68
68
  }
69
69
 
70
+ // ../extension-api/dist/artifacts.js
71
+ var MAX_STREAMED_FILE_BYTES = 100 * 1024 * 1024;
72
+
70
73
  // src/extension-host/sandbox-runtime/wire.ts
71
74
  var g = globalThis;
72
75
  if (typeof g.TextEncoder === "undefined") {
@@ -64,6 +64,9 @@
64
64
  return definition2;
65
65
  }
66
66
 
67
+ // ../extension-api/dist/artifacts.js
68
+ var MAX_STREAMED_FILE_BYTES = 100 * 1024 * 1024;
69
+
67
70
  // ../extension-api/dist/definition.js
68
71
  function isMethodTool(tool) {
69
72
  return "method" in tool;
@@ -0,0 +1,2 @@
1
+ import"./x-B_E8Qayx.js";import{$ as e,Et as t,F as n,H as r,Nt as i,P as a,R as o,Tt as s,U as c,V as l,at as u,bt as d,dt as f,ft as p,gt as m,mt as h,ot as g,pt as _,r as v,tt as y,ut as b,vt as x}from"./index-client-CuxgedVJ.js";import{n as S,t as C}from"./log-view-Dqspnrs0.js";import{a as w}from"./workbench-startup-state.svelte-DiVhozSn.js";import{o as T}from"./notify.svelte-C5jq6bji.js";import{s as E}from"./conversation-connection-CaV3KY7Z.js";import{t as D}from"./workspace-state.svelte-y_9D2lEr.js";import{t as O}from"./square-BZ2jl-M0.js";import{a as k,i as A,o as j,r as M}from"./floating-toolbar-Cqtfs8M7.js";import{F as N,L as P}from"./index-6mIS-NWJ.js";function F(e,t){if(!e)return;let n=Date.parse(e.startedAt),r=e.status===`running`?t:e.finishedAt?Date.parse(e.finishedAt):NaN;return!Number.isFinite(n)||!Number.isFinite(r)||r<n?`Unknown duration`:`${Math.floor((r-n)/1e3)}s`}var I=c(`<span> </span>`),L=c(`<!> <!> <!>`,1),R=c(`<!> <!>`,1),z=c(`<section class="relative h-full min-h-0 bg-background" aria-label="Background command output"><!></section>`);function B(r,a){t(a,!0);let c=v(a,`active`,3,!0),m=v(a,`stopping`,3,!1);var h=z(),g=b(h);{let t=t=>{j(t,{label:`Command controls`,children:(t,r)=>{var i=R(),s=f(i);k(s,{children:(t,r)=>{{let r=d(()=>a.bash?.workingDirectory);M(t,{get title(){return e(r)},children:(e,t)=>{var r=L(),i=f(r),s=e=>{N(e,{get status(){return a.bash.status}})};n(i,e=>{a.bash&&e(s)});var c=_(i,2),d=e=>{var t=I(),n=p(t,!0);u(()=>o(n,a.elapsed)),l(e,t)};n(c,e=>{a.elapsed&&e(d)});var m=_(c,2),h=e=>{var t=I(),n=p(t);u(()=>o(n,`exit ${a.bash.exitCode??``}`)),l(e,t)};n(m,e=>{a.bash?.exitCode!=null&&e(h)}),l(e,r)},$$slots:{default:!0}})}},$$slots:{default:!0}});var c=_(s,2),h=e=>{k(e,{children:(e,t)=>{A(e,{label:`Stop command`,get icon(){return O},tone:`destructive`,get disabled(){return m()},get onclick(){return a.onStop}})},$$slots:{default:!0}})};n(c,e=>{a.bash?.status===`running`&&e(h)}),l(t,i)},$$slots:{default:!0}})},r=d(()=>`async-bash:${a.bashId}`),i=d(()=>a.bash?.command??a.command);S(g,{get logs(){return a.logs},get active(){return c()},get scopeKey(){return e(r)},ariaLabel:`Command output`,get command(){return e(i)},topEnd:t,$$slots:{topEnd:!0}})}i(h),l(r,h),s()}var V=65536;function H(e){let t=e.initialBash,n=async(n,r)=>{let i=await e.request({offset:n,limit:r});return t=i.bash,e.onBash?.(i.bash),i.page};return{async tail(e){let t=await n(void 0,V),r=G(K(t.text,t.offset),t.offset).slice(-e);return W(r,t.nextOffset,String(U(r,t.nextOffset)))},async before(e,t){let r=Number(e);if(r<=0)return{lines:[],before:null,after:e};let i=Math.max(0,r-V),a=await n(i,r-i);return W(G(K(a.text,a.offset).filter(e=>e.end<=r),a.offset).slice(-t),r,e)},async after(e,t){let r=Number(e),i=await n(r,V),a=K(i.text,i.offset),o=a.slice(0,t),s=o.at(-1),c=a.length===1&&s?.terminated===!1&&i.nextOffset-i.offset>=65536;s&&c&&(s.terminated=!0);let l=a.length>t?s.end:U(o,i.nextOffset);return{...W(o,r,String(l)),more:l>r&&(a.length>t||i.nextOffset<i.totalBytes)}},live:()=>t?.status===`running`}}function U(e,t){let n=e.at(-1);return n&&!n.terminated?n.start:t}function W(e,t,n){let r=e[0]?.start??t;return{lines:e.map(e=>({key:String(e.start),text:q(e.text)})),before:r>0?String(r):null,after:n}}function G(e,t){return t>0&&e.length>1?e.slice(1):[...e]}function K(e,t){let n=new TextEncoder,r=e.split(`
2
+ `),i=[],a=t;return r.forEach((e,t)=>{let o=t<r.length-1;if(!o&&e===``)return;let s=a+n.encode(e).length+ +!!o;i.push({start:a,end:s,text:e,terminated:o}),a=s}),i}function q(e){let t=e.endsWith(`\r`)?e.slice(0,-1):e,n=t.lastIndexOf(`\r`);return n===-1?t:t.slice(n+1)}function J(i,o){t(o,!0);let c=d(()=>D.activeCenterTab?.kind===`async-bash`?D.activeCenterTab:void 0),u=d(()=>e(c)?.id),p=d(()=>e(c)?.conversationId),_=x(void 0),v=x(void 0),b=x(!1),S=x(h(Date.now())),O=d(()=>F(e(_),e(S))),k=d(()=>e(_)?.status===`running`),A=0;g(()=>{let t=e(u),n=e(p),r=y(()=>t?P.commands[t]:void 0);if(m(_,r,!0),m(b,!1),!t||!n){m(v,void 0);return}A=y(()=>P.refreshVersions[t]??0);let i=!0,a=C(H({request:e=>E(`asyncBash.logs`,{conversationId:n,bashId:t,...e}),initialBash:r,onBash:e=>{i&&(m(_,e,!0),P.commands[t]=e)}}));return m(v,a),()=>{i=!1,a.dispose()}}),g(()=>{let t=e(u),n=e(v);if(!t||!n)return;let r=P.refreshVersions[t]??0;r!==A&&(A=r,y(()=>void n.reload()))}),g(()=>{if(!e(k))return;m(S,Date.now(),!0);let t=setInterval(()=>m(S,Date.now(),!0),1e3);return()=>clearInterval(t)});async function j(){let t=e(c),n=e(v);if(t&&n&&!e(b)){m(b,!0);try{await E(`asyncBash.cancel`,{bashId:t.id}),n.refresh()}catch(t){e(v)===n&&T.error(`Could not stop command`,{description:t instanceof Error?t.message:String(t)})}finally{e(v)===n&&m(b,!1)}}}var M=r(),N=f(M),I=t=>{var n=r(),i=f(n);a(i,()=>e(v),t=>{B(t,{get bashId(){return e(c).id},get bash(){return e(_)},get command(){return e(c).command},get logs(){return e(v)},get active(){return w.progressiveActive},get elapsed(){return e(O)},get stopping(){return e(b)},onStop:()=>void j()})}),l(t,n)};n(N,t=>{e(c)&&e(v)&&t(I)}),l(i,M),s()}export{J as default};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./x-B_E8Qayx.js";import{$ as t,Et as n,F as r,H as i,K as a,M as o,N as s,Nt as c,R as l,S as u,Tt as d,U as f,V as p,a as m,at as h,bt as g,dt as _,ft as v,i as y,k as b,pt as x,r as S,ut as C,v as w,x as T}from"./index-client-CuxgedVJ.js";import{t as E}from"./image-DK8kwfuZ.js";import{d as D,u as O}from"./channel-CxF1CmEY.js";import{z as k}from"./center-tabs.svelte-BCriw5Eu.js";import{t as A}from"./git-pull-request-D4m3cMGB.js";import{t as j}from"./circle-dot-ChSwVw2A.js";import{t as M}from"./hash-DGLDrXlR.js";import{A as N,D as ee,T as P,j as F,w as I}from"./workspace-selectors.svelte-D-EQR_-Z.js";import{n as L}from"./time-DqcZ_PFK.js";import{Mt as R}from"./popper-layer-force-mount-GBgxKlXg.js";import{m as z}from"./panel-DEG1zXHj.js";import{t as B}from"./item-surface-CEVisA-a.js";import{i as V,t as H}from"./conversation-activity-Dl7udunb.js";var U=new Set([`$$slots`,`$$events`,`$$legacy`]);function W(t,n){let r=y(n,U),i=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M8 12h8`}],[`path`,{d:`M12 8v8`}]];e(t,m({name:`circle-plus`},()=>r,{get iconNode(){return i}}))}var G=new Set([`$$slots`,`$$events`,`$$legacy`]);function K(t,n){let r=y(n,G),i=[[`circle`,{cx:`5`,cy:`6`,r:`3`}],[`path`,{d:`M5 9v12`}],[`path`,{d:`m15 9-3-3 3-3`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v3`}],[`path`,{d:`M19 15v6`}],[`path`,{d:`M22 18h-6`}]];e(t,m({name:`git-pull-request-create-arrow`},()=>r,{get iconNode(){return i}}))}function q(e,t){let n=[F(t)?.toLowerCase()??``];return e.conversation.completedAt&&n.push(`done`),e.conversation.pinned&&n.push(`pinned`),[`needs-user`,`error`,`aborted`,`result-ready`].includes(t.indicator)&&n.push(`needs`,`attention`),t.indicator===`error`&&n.push(`error`),t.indicator===`result-ready`&&n.push(`ready`,`review`),n}function J(e,t){let n=e.toLowerCase(),r=n.indexOf(t);if(r>=0)return{score:r===0||/[\s\-_/.(]/.test(n[r-1]??``)?55:45,indexes:Array.from({length:t.length},(e,t)=>r+t)};if(t.length<3)return;let i=e=>e===0||/[\s\-_/.(]/.test(n[e-1]??``),a,o=-1/0;for(let e=n.indexOf(t[0]??``);e>=0;e=n.indexOf(t[0]??``,e+1)){let r=[e],s=i(e)?4:0;for(let e of t.slice(1)){let t=r[r.length-1]??0,a=n[t+1]===e?t+1:-1;if(a>=0)s+=3;else{let r=n.indexOf(e,t+1),o=-1;for(let t=r;t>=0;t=n.indexOf(e,t+1))if(i(t)){o=t;break}a=o>=0?o:r,a>=0&&i(a)&&(s+=4)}if(a<0){s=-1/0;break}r.push(a)}let c=(r[r.length-1]??0)-e;c>t.length*6||(s-=c/4,s>o&&(o=s,a=r))}if(!a)return;let s=a,c=Math.min(35,10+o);return c>=15?{score:c,indexes:s}:void 0}function Y(e,t,n={}){let r=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!r.length)return[];let i=[];for(let t of e){let e=q(t,n.activityById?.[t.conversation.id]??H),a=O(t.conversation.title),o=D(t.conversation.title).some(e=>e.type===`image`),s=new Set,c=0,l,u=0;for(let i of r){let r=[J(a,i),n.matchField?.(t,i)];o&&(i===`image`||i===`screenshot`)&&r.push({score:60}),i.length>=2&&e.some(e=>e.startsWith(i))&&r.push({score:60});let d=r.filter(e=>!!e).sort((e,t)=>t.score-e.score)[0];if(!d){c=0;break}c+=d.score,d.referenceKey&&d.score>u&&(l=d.referenceKey,u=d.score);for(let e of d.indexes??[])s.add(e)}c&&i.push({row:t,score:c,titleIndexes:[...s].sort((e,t)=>e-t),referenceKey:l})}i.sort((e,t)=>t.score-e.score||k(e.row.conversation,t.row.conversation));let a=(i[0]?.score??0)*.35;return i.filter(e=>e.score>=a)}function X(e,t,n=0){let r=new Set(t),i=[];for(let t=0;t<e.length;t++){let a=r.has(n+t),o=i[i.length-1];o?.hit===a?o.text+=e[t]:i.push({text:e[t]??``,hit:a})}return i}function te(e,t){let n=0;return D(e).map(e=>{if(e.type===`image`)return n+=O(``).length,e;let r=X(e.text,t,n);return n+=e.text.length,{type:`text`,runs:r}})}var ne=f(`<span class="flex h-4 w-3.5 shrink-0 items-center justify-center"><!></span>`),re=f(`<span class="shrink-0 text-caption tabular-nums text-muted-foreground"> </span>`),ie=f(`<span role="img" aria-label="Image" title="Image" class="inline-flex align-[-2px] text-muted-foreground"><!></span>`),ae=f(`<mark class="rounded-xs bg-primary-strong text-foreground"> </mark>`),oe=f(`<span> </span>`),se=f(`<span><!> <span class="truncate"> </span></span>`),ce=f(`<span class="shrink-0"> </span>`),le=f(`<span class="flex min-w-0 items-center gap-2.5"><!> <!></span>`),ue=f(`<span class="flex min-w-0 items-center gap-2.5 text-caption text-muted-foreground"><!> <!></span>`);function Z(e,f){n(f,!0);let m=S(f,`details`,19,()=>[]),y=S(f,`repoLabels`,19,()=>new Map),D=S(f,`isActive`,3,!1),k=S(f,`isOpen`,3,!1),F=S(f,`faded`,3,!1),U=S(f,`highlight`,19,()=>[]),G=g(()=>f.activity??(f.conversation.completedAt?{...H,indicator:`completed`}:H)),q=g(()=>ee(f.conversation.references,f.matchedReference));function J(e){return e.kind===`pull_request`?e.relationship===`created`?K:A:e.kind===`issue`?e.relationship===`created`?W:j:M}let Y=g(()=>N(t(G))),X=g(()=>f.conversation.lastUserMessageAt??f.conversation.createdAt),Z=g(()=>new Date(t(X)).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})),de=g(()=>L(t(X))),Q=g(()=>O(f.conversation.title)),$=g(()=>[t(Q),...f.conversation.references.map(I),t(G).statusText??t(G).label??`Idle`,...m(),`${f.conversation.childCount} sub-agents`,t(Z),f.conversation.id].join(`
2
- `)),fe=g(()=>te(f.conversation.title,U()));{let n=g(()=>R(`mx-1 my-0.5 flex-col rounded-md px-2.5 py-2`,!D()&&`hover:bg-hover`));B(e,{tone:`row`,hover:`none`,get selected(){return D()},get menuItems(){return f.menuItems},get onMenuOpenChange(){return f.onMenuOpenChange},get class(){return t(n)},onclick:()=>f.onOpenConversation?.(f.conversation.id),children:(e,n)=>{{let n=e=>{var n=ne(),r=C(n);V(r,{get activity(){return t(G)},variant:`rail`,get isOpen(){return k()}}),c(n),p(e,n)},d=e=>{var n=re(),r=v(n,!0);h(()=>{w(n,`title`,t(Z)),l(r,t(de))}),p(e,n)},m=e=>{var n=i(),u=_(n);o(u,17,()=>t(fe),s,(e,n)=>{var u=i(),d=_(u),f=e=>{var t=ie(),n=C(t);E(n,{class:`size-3`,"aria-hidden":`true`}),c(t),p(e,t)},m=e=>{var c=i(),u=_(c);o(u,17,()=>t(n).runs,s,(e,n)=>{var o=i(),s=_(o),c=e=>{var r=ae(),i=v(r,!0);h(()=>l(i,t(n).text)),p(e,r)},u=e=>{var r=a();h(()=>l(r,t(n).text)),p(e,r)};r(s,e=>{t(n).hit?e(c):e(u,-1)}),p(e,o)}),p(e,c)};r(d,e=>{t(n).type===`image`?e(f):e(m,-1)}),p(e,u)}),p(e,n)},S=e=>{var n=i(),a=_(n),s=e=>{var n=ue(),i=C(n),a=e=>{var n=oe(),r=v(n,!0);h(e=>{T(n,1,e),l(r,t(Y))},[()=>u(R(`flex shrink-0 items-center gap-1`,t(G).tone===`warning`&&`text-warning`,t(G).tone===`destructive`&&t(G).indicator!==`aborted`&&`text-destructive`,t(G).tone===`success`&&`text-success`,t(G).tone===`info`&&`text-info`))]),p(e,n)};r(i,e=>{t(Y)&&e(a)});var s=x(i,2),d=e=>{var n=le(),i=C(n);o(i,17,()=>t(q).shown,e=>e.resourceKey,(e,n)=>{let r=g(()=>J(t(n)));var i=se(),a=C(i);b(a,()=>t(r),(e,t)=>{t(e,{class:`size-3 shrink-0`,"aria-hidden":`true`})});var o=x(a,2),s=v(o,!0);c(i),h((e,t,n)=>{w(i,`title`,e),T(i,1,t),l(s,n)},[()=>I(t(n)),()=>u(R(`inline-flex min-w-0 items-center gap-1 rounded-sm`,t(n).resourceKey===f.matchedReference&&`bg-primary-strong px-0.5 text-foreground`)),()=>P(t(n),y(),f.currentRepository)]),p(e,i)});var a=x(i,2),s=e=>{var n=ce(),r=v(n);h(e=>{w(n,`title`,e),l(r,`+${t(q).overflow??``}`)},[()=>f.conversation.references.map(I).join(`
3
- `)]),p(e,n)};r(a,e=>{t(q).overflow>0&&e(s)}),c(n),p(e,n)};r(s,e=>{t(q).shown.length&&e(d)}),c(n),p(e,n)};r(a,e=>{(t(Y)||t(q).shown.length)&&e(s)}),p(e,n)},O=g(()=>R(!(F()&&!D())&&`text-foreground`));z(e,{get label(){return t(Q)},labelLines:2,get dataId(){return f.conversation.id},get title(){return t($)},get ariaLabel(){return t($)},flush:!0,hoverable:!1,class:`py-0`,get active(){return D()},get labelClass(){return t(O)},onclick:e=>{e.stopPropagation(),f.onOpenConversation?.(f.conversation.id)},leading:n,titleTrailing:d,labelContent:m,meta:S,$$slots:{leading:!0,titleTrailing:!0,labelContent:!0,meta:!0}})}},$$slots:{default:!0}})}d()}export{Y as n,Z as t};
1
+ import{n as e}from"./x-B_E8Qayx.js";import{$ as t,Et as n,F as r,H as i,K as a,M as o,N as s,Nt as c,R as l,S as u,Tt as d,U as f,V as p,a as m,at as h,bt as g,dt as _,ft as v,i as y,k as b,pt as x,r as S,ut as C,v as w,x as T}from"./index-client-CuxgedVJ.js";import{t as E}from"./image-DK8kwfuZ.js";import{d as D,f as O}from"./channel-DB8mSlhP.js";import{z as k}from"./center-tabs.svelte-i0d5hUO3.js";import{t as A}from"./git-pull-request-D4m3cMGB.js";import{t as j}from"./circle-dot-ChSwVw2A.js";import{t as M}from"./hash-DGLDrXlR.js";import{A as N,D as ee,T as P,j as F,w as I}from"./workspace-selectors.svelte-DQ1mQdvX.js";import{r as L}from"./time-egBWJGDu.js";import{Mt as R}from"./popper-layer-force-mount-GBgxKlXg.js";import{m as z}from"./panel-BW0llJiU.js";import{t as B}from"./item-surface-CEVisA-a.js";import{i as V,t as H}from"./conversation-activity-CZJfUGoL.js";var U=new Set([`$$slots`,`$$events`,`$$legacy`]);function W(t,n){let r=y(n,U),i=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M8 12h8`}],[`path`,{d:`M12 8v8`}]];e(t,m({name:`circle-plus`},()=>r,{get iconNode(){return i}}))}var G=new Set([`$$slots`,`$$events`,`$$legacy`]);function K(t,n){let r=y(n,G),i=[[`circle`,{cx:`5`,cy:`6`,r:`3`}],[`path`,{d:`M5 9v12`}],[`path`,{d:`m15 9-3-3 3-3`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v3`}],[`path`,{d:`M19 15v6`}],[`path`,{d:`M22 18h-6`}]];e(t,m({name:`git-pull-request-create-arrow`},()=>r,{get iconNode(){return i}}))}function q(e,t){let n=[F(t)?.toLowerCase()??``];return e.conversation.completedAt&&n.push(`done`),e.conversation.pinned&&n.push(`pinned`),[`needs-user`,`error`,`aborted`,`result-ready`].includes(t.indicator)&&n.push(`needs`,`attention`),t.indicator===`error`&&n.push(`error`),t.indicator===`result-ready`&&n.push(`ready`,`review`),n}function J(e,t){let n=e.toLowerCase(),r=n.indexOf(t);if(r>=0)return{score:r===0||/[\s\-_/.(]/.test(n[r-1]??``)?55:45,indexes:Array.from({length:t.length},(e,t)=>r+t)};if(t.length<3)return;let i=e=>e===0||/[\s\-_/.(]/.test(n[e-1]??``),a,o=-1/0;for(let e=n.indexOf(t[0]??``);e>=0;e=n.indexOf(t[0]??``,e+1)){let r=[e],s=i(e)?4:0;for(let e of t.slice(1)){let t=r[r.length-1]??0,a=n[t+1]===e?t+1:-1;if(a>=0)s+=3;else{let r=n.indexOf(e,t+1),o=-1;for(let t=r;t>=0;t=n.indexOf(e,t+1))if(i(t)){o=t;break}a=o>=0?o:r,a>=0&&i(a)&&(s+=4)}if(a<0){s=-1/0;break}r.push(a)}let c=(r[r.length-1]??0)-e;c>t.length*6||(s-=c/4,s>o&&(o=s,a=r))}if(!a)return;let s=a,c=Math.min(35,10+o);return c>=15?{score:c,indexes:s}:void 0}function Y(e,t,n={}){let r=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!r.length)return[];let i=[];for(let t of e){let e=q(t,n.activityById?.[t.conversation.id]??H),a=D(t.conversation.title),o=O(t.conversation.title).some(e=>e.type===`image`),s=new Set,c=0,l,u=0;for(let i of r){let r=[J(a,i),n.matchField?.(t,i)];o&&(i===`image`||i===`screenshot`)&&r.push({score:60}),i.length>=2&&e.some(e=>e.startsWith(i))&&r.push({score:60});let d=r.filter(e=>!!e).sort((e,t)=>t.score-e.score)[0];if(!d){c=0;break}c+=d.score,d.referenceKey&&d.score>u&&(l=d.referenceKey,u=d.score);for(let e of d.indexes??[])s.add(e)}c&&i.push({row:t,score:c,titleIndexes:[...s].sort((e,t)=>e-t),referenceKey:l})}i.sort((e,t)=>t.score-e.score||k(e.row.conversation,t.row.conversation));let a=(i[0]?.score??0)*.35;return i.filter(e=>e.score>=a)}function X(e,t,n=0){let r=new Set(t),i=[];for(let t=0;t<e.length;t++){let a=r.has(n+t),o=i[i.length-1];o?.hit===a?o.text+=e[t]:i.push({text:e[t]??``,hit:a})}return i}function te(e,t){let n=0;return O(e).map(e=>{if(e.type===`image`)return n+=D(``).length,e;let r=X(e.text,t,n);return n+=e.text.length,{type:`text`,runs:r}})}var ne=f(`<span class="flex h-4 w-3.5 shrink-0 items-center justify-center"><!></span>`),re=f(`<span class="shrink-0 text-caption tabular-nums text-muted-foreground"> </span>`),ie=f(`<span role="img" aria-label="Image" title="Image" class="inline-flex align-[-2px] text-muted-foreground"><!></span>`),ae=f(`<mark class="rounded-xs bg-primary-strong text-foreground"> </mark>`),oe=f(`<span> </span>`),se=f(`<span><!> <span class="truncate"> </span></span>`),ce=f(`<span class="shrink-0"> </span>`),le=f(`<span class="flex min-w-0 items-center gap-2.5"><!> <!></span>`),ue=f(`<span class="flex min-w-0 items-center gap-2.5 text-caption text-muted-foreground"><!> <!></span>`);function Z(e,f){n(f,!0);let m=S(f,`details`,19,()=>[]),y=S(f,`repoLabels`,19,()=>new Map),O=S(f,`isActive`,3,!1),k=S(f,`isOpen`,3,!1),F=S(f,`faded`,3,!1),U=S(f,`highlight`,19,()=>[]),G=g(()=>f.activity??(f.conversation.completedAt?{...H,indicator:`completed`}:H)),q=g(()=>ee(f.conversation.references,f.matchedReference));function J(e){return e.kind===`pull_request`?e.relationship===`created`?K:A:e.kind===`issue`?e.relationship===`created`?W:j:M}let Y=g(()=>N(t(G))),X=g(()=>f.conversation.lastUserMessageAt??f.conversation.createdAt),Z=g(()=>new Date(t(X)).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})),de=g(()=>L(t(X))),Q=g(()=>D(f.conversation.title)),$=g(()=>[t(Q),...f.conversation.references.map(I),t(G).statusText??t(G).label??`Idle`,...m(),`${f.conversation.childCount} sub-agents`,t(Z),f.conversation.id].join(`
2
+ `)),fe=g(()=>te(f.conversation.title,U()));{let n=g(()=>R(`mx-1 my-0.5 flex-col rounded-md px-2.5 py-2`,!O()&&`hover:bg-hover`));B(e,{tone:`row`,hover:`none`,get selected(){return O()},get menuItems(){return f.menuItems},get onMenuOpenChange(){return f.onMenuOpenChange},get class(){return t(n)},onclick:()=>f.onOpenConversation?.(f.conversation.id),children:(e,n)=>{{let n=e=>{var n=ne(),r=C(n);V(r,{get activity(){return t(G)},variant:`rail`,get isOpen(){return k()}}),c(n),p(e,n)},d=e=>{var n=re(),r=v(n,!0);h(()=>{w(n,`title`,t(Z)),l(r,t(de))}),p(e,n)},m=e=>{var n=i(),u=_(n);o(u,17,()=>t(fe),s,(e,n)=>{var u=i(),d=_(u),f=e=>{var t=ie(),n=C(t);E(n,{class:`size-3`,"aria-hidden":`true`}),c(t),p(e,t)},m=e=>{var c=i(),u=_(c);o(u,17,()=>t(n).runs,s,(e,n)=>{var o=i(),s=_(o),c=e=>{var r=ae(),i=v(r,!0);h(()=>l(i,t(n).text)),p(e,r)},u=e=>{var r=a();h(()=>l(r,t(n).text)),p(e,r)};r(s,e=>{t(n).hit?e(c):e(u,-1)}),p(e,o)}),p(e,c)};r(d,e=>{t(n).type===`image`?e(f):e(m,-1)}),p(e,u)}),p(e,n)},S=e=>{var n=i(),a=_(n),s=e=>{var n=ue(),i=C(n),a=e=>{var n=oe(),r=v(n,!0);h(e=>{T(n,1,e),l(r,t(Y))},[()=>u(R(`flex shrink-0 items-center gap-1`,t(G).tone===`warning`&&`text-warning`,t(G).tone===`destructive`&&t(G).indicator!==`aborted`&&`text-destructive`,t(G).tone===`success`&&`text-success`,t(G).tone===`info`&&`text-info`))]),p(e,n)};r(i,e=>{t(Y)&&e(a)});var s=x(i,2),d=e=>{var n=le(),i=C(n);o(i,17,()=>t(q).shown,e=>e.resourceKey,(e,n)=>{let r=g(()=>J(t(n)));var i=se(),a=C(i);b(a,()=>t(r),(e,t)=>{t(e,{class:`size-3 shrink-0`,"aria-hidden":`true`})});var o=x(a,2),s=v(o,!0);c(i),h((e,t,n)=>{w(i,`title`,e),T(i,1,t),l(s,n)},[()=>I(t(n)),()=>u(R(`inline-flex min-w-0 items-center gap-1 rounded-sm`,t(n).resourceKey===f.matchedReference&&`bg-primary-strong px-0.5 text-foreground`)),()=>P(t(n),y(),f.currentRepository)]),p(e,i)});var a=x(i,2),s=e=>{var n=ce(),r=v(n);h(e=>{w(n,`title`,e),l(r,`+${t(q).overflow??``}`)},[()=>f.conversation.references.map(I).join(`
3
+ `)]),p(e,n)};r(a,e=>{t(q).overflow>0&&e(s)}),c(n),p(e,n)};r(s,e=>{t(q).shown.length&&e(d)}),c(n),p(e,n)};r(a,e=>{(t(Y)||t(q).shown.length)&&e(s)}),p(e,n)},D=g(()=>R(!(F()&&!O())&&`text-foreground`));z(e,{get label(){return t(Q)},labelLines:2,get dataId(){return f.conversation.id},get title(){return t($)},get ariaLabel(){return t($)},flush:!0,hoverable:!1,class:`py-0`,get active(){return O()},get labelClass(){return t(D)},onclick:e=>{e.stopPropagation(),f.onOpenConversation?.(f.conversation.id)},leading:n,titleTrailing:d,labelContent:m,meta:S,$$slots:{leading:!0,titleTrailing:!0,labelContent:!0,meta:!0}})}},$$slots:{default:!0}})}d()}export{Y as n,Z as t};