@schlenkr/ragents 0.1.10 → 0.1.11

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 (743) hide show
  1. package/apps/server/package.json +1 -1
  2. package/apps/server/src/access-projection.ts +4 -4
  3. package/apps/server/src/access-service.ts +3 -3
  4. package/apps/server/src/access-session.ts +19 -19
  5. package/apps/server/src/api/contracts.ts +29 -29
  6. package/apps/server/src/api/core-methods.ts +17 -17
  7. package/apps/server/src/api/delivery.ts +2 -2
  8. package/apps/server/src/api/reference.ts +27 -27
  9. package/apps/server/src/api/rights.ts +18 -18
  10. package/apps/server/src/chat-handler.ts +5 -5
  11. package/apps/server/src/config-definition.ts +37 -10
  12. package/apps/server/src/config-file.ts +49 -49
  13. package/apps/server/src/config.ts +2 -0
  14. package/apps/server/src/data-directory.ts +2 -2
  15. package/apps/server/src/external-access.ts +1 -1
  16. package/apps/server/src/folder-install.ts +1 -1
  17. package/apps/server/src/help-files.ts +1 -1
  18. package/apps/server/src/host-api.json +6 -1
  19. package/apps/server/src/host-api.ts +3 -2
  20. package/apps/server/src/host-record.ts +3 -3
  21. package/apps/server/src/host-resolution-hooks.mjs +4 -4
  22. package/apps/server/src/host-version.ts +17 -17
  23. package/apps/server/src/host-web.ts +5 -5
  24. package/apps/server/src/main.ts +6 -6
  25. package/apps/server/src/missing-environment.ts +6 -6
  26. package/apps/server/src/parent-watch.ts +4 -4
  27. package/apps/server/src/plugin-build/build.ts +31 -31
  28. package/apps/server/src/plugin-build/host-api-names.ts +7 -7
  29. package/apps/server/src/plugin-build/plugin-description.ts +15 -15
  30. package/apps/server/src/plugin-build/typecheck.ts +1 -1
  31. package/apps/server/src/plugin-support/actor-programs/app-project.ts +19 -19
  32. package/apps/server/src/plugin-support/actor-programs/client-compiler.ts +4 -4
  33. package/apps/server/src/plugin-support/actor-programs/client-contracts.ts +11 -11
  34. package/apps/server/src/plugin-support/actor-programs/contract.ts +17 -17
  35. package/apps/server/src/plugin-support/actor-programs/runtime-libraries.ts +1 -1
  36. package/apps/server/src/plugin-support/actor-programs/workflow/index.ts +5 -5
  37. package/apps/server/src/plugin-support/actor-programs/workflow/prompt-reader.ts +2 -2
  38. package/apps/server/src/plugin-support/chat-display-policy.ts +2 -2
  39. package/apps/server/src/plugin-support/front-matter.ts +6 -6
  40. package/apps/server/src/plugin-support/http.ts +2 -2
  41. package/apps/server/src/plugin-support/language-server/contract.ts +8 -8
  42. package/apps/server/src/plugin-support/language-server/plugin.ts +2 -2
  43. package/apps/server/src/plugin-support/language-server/snapshot-method.ts +1 -1
  44. package/apps/server/src/plugin-support/language-server/tools.ts +11 -11
  45. package/apps/server/src/plugin-support/model-aliases.ts +30 -20
  46. package/apps/server/src/plugin-support/model-choice.ts +15 -15
  47. package/apps/server/src/plugin-support/model-completion.ts +44 -23
  48. package/apps/server/src/plugin-support/model-providers.ts +170 -0
  49. package/apps/server/src/plugin-support/model-upstreams.ts +1 -1
  50. package/apps/server/src/plugin-support/native-typescript-child.ts +4 -4
  51. package/apps/server/src/plugin-support/native-typescript-executor.ts +12 -12
  52. package/apps/server/src/plugin-support/plugin-config.ts +3 -3
  53. package/apps/server/src/plugin-support/plugin-folder.ts +2 -2
  54. package/apps/server/src/plugin-support/plugins-root.ts +2 -2
  55. package/apps/server/src/plugin-support/process-sandbox.ts +39 -39
  56. package/apps/server/src/plugin-support/product-model-settings-contract.ts +3 -3
  57. package/apps/server/src/plugin-support/product-model-settings.ts +10 -10
  58. package/apps/server/src/plugin-support/product-relay.ts +9 -9
  59. package/apps/server/src/plugin-support/product-start-options.ts +4 -4
  60. package/apps/server/src/plugin-support/prompt.ts +1 -1
  61. package/apps/server/src/plugin-support/provision.ts +8 -8
  62. package/apps/server/src/plugin-support/run-scripts.ts +17 -17
  63. package/apps/server/src/plugin-support/skills.ts +18 -18
  64. package/apps/server/src/plugin-support/start-entries-contract.ts +17 -17
  65. package/apps/server/src/plugin-support/start-options-contract.ts +5 -5
  66. package/apps/server/src/plugin-support/system-prompts.ts +11 -11
  67. package/apps/server/src/plugin-support/thinking-level.ts +2 -2
  68. package/apps/server/src/plugin-support/tool-availability.ts +2 -2
  69. package/apps/server/src/plugin-support/workspace-ownership.ts +5 -5
  70. package/apps/server/src/plugin-support/workspace-sandbox-host.ts +37 -37
  71. package/apps/server/src/plugin-support/zip.ts +7 -7
  72. package/apps/server/src/profile/bundle-manifest.ts +17 -17
  73. package/apps/server/src/profile/compose.ts +12 -7
  74. package/apps/server/src/profile/plugin-discovery.ts +12 -12
  75. package/apps/server/src/profile/provisioning.ts +5 -5
  76. package/apps/server/src/profile-target.ts +10 -10
  77. package/apps/server/src/protocol.ts +2 -2
  78. package/apps/server/src/provider.ts +61 -56
  79. package/apps/server/src/ragents/actor-chat-history.ts +8 -8
  80. package/apps/server/src/ragents/chat-text-positions.ts +2 -2
  81. package/apps/server/src/ragents/coordinator.ts +2 -2
  82. package/apps/server/src/ragents/engine.ts +23 -23
  83. package/apps/server/src/ragents/global-chat.ts +8 -8
  84. package/apps/server/src/ragents/host-services.ts +6 -3
  85. package/apps/server/src/ragents/journal-chat-events.ts +1 -1
  86. package/apps/server/src/ragents/run-owner.ts +2 -2
  87. package/apps/server/src/ragents/session.ts +49 -49
  88. package/apps/server/src/ragents/typescript-tools.ts +12 -12
  89. package/apps/server/src/ragents/workspace-runtime.ts +28 -28
  90. package/apps/server/src/rpc/dispatcher.ts +19 -19
  91. package/apps/server/src/rpc/http-transport.ts +11 -11
  92. package/apps/server/src/rpc/stdio-transport.ts +3 -3
  93. package/apps/server/src/run-preparation-input.ts +5 -5
  94. package/apps/server/src/run-preparation.ts +24 -24
  95. package/apps/server/src/run-transfer.ts +39 -39
  96. package/apps/server/src/server.ts +48 -48
  97. package/apps/server/src/settings.ts +1 -1
  98. package/apps/server/src/startup.ts +3 -3
  99. package/apps/server/src/title-compactor.ts +9 -9
  100. package/apps/server/src/title-settings.ts +3 -3
  101. package/apps/server/src/web-bundles.ts +2 -2
  102. package/apps/server/src/web-stylesheet.ts +2 -2
  103. package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-BO4wLQtE.js → highlighted-body-KPVGNVTW-BfNSGxjB.js} +1 -1
  104. package/apps/web/dist/assets/main-D6bsKcIK.js +11 -0
  105. package/apps/web/dist/assets/mermaid-HWGCJPDP-DROEqEeg.js +608 -0
  106. package/apps/web/dist/assets/runPanel-Dumuuqry.js +21 -0
  107. package/apps/web/dist/help/guide-access.html +5 -5
  108. package/apps/web/dist/help/guide-access.md +2 -2
  109. package/apps/web/dist/help/guide-clients.html +53 -54
  110. package/apps/web/dist/help/guide-clients.md +50 -51
  111. package/apps/web/dist/help/guide-distributed.html +12 -7
  112. package/apps/web/dist/help/guide-distributed.md +9 -4
  113. package/apps/web/dist/help/guide-functions.html +3 -3
  114. package/apps/web/dist/help/guide-getting-started.html +24 -15
  115. package/apps/web/dist/help/guide-getting-started.md +22 -12
  116. package/apps/web/dist/help/guide-ideas.html +3 -3
  117. package/apps/web/dist/help/guide-plugins.html +5 -4
  118. package/apps/web/dist/help/guide-plugins.md +2 -1
  119. package/apps/web/dist/help/guide-programs.html +3 -3
  120. package/apps/web/dist/help/guide-runtime.html +6 -6
  121. package/apps/web/dist/help/guide-runtime.md +3 -3
  122. package/apps/web/dist/help/guide.html +3 -3
  123. package/apps/web/dist/help/index.html +196 -144
  124. package/apps/web/dist/help/mini-app.css +6 -0
  125. package/apps/web/dist/help/mini-app.js +14 -14
  126. package/apps/web/dist/host-web.json +90 -90
  127. package/apps/web/dist/index.html +3 -3
  128. package/apps/web/dist/run-panel.html +3 -3
  129. package/apps/web/package.json +1 -1
  130. package/apps/web/src/AccessContext.tsx +15 -15
  131. package/apps/web/src/App.tsx +13 -13
  132. package/apps/web/src/DiffCode.tsx +2 -2
  133. package/apps/web/src/HelpDialog.tsx +3 -3
  134. package/apps/web/src/Overview.tsx +13 -13
  135. package/apps/web/src/PluginActivation.ts +1 -1
  136. package/apps/web/src/PluginChat.tsx +15 -15
  137. package/apps/web/src/PluginFailureNotice.tsx +1 -1
  138. package/apps/web/src/PluginRegistry.tsx +44 -44
  139. package/apps/web/src/RunPreparationChat.tsx +11 -11
  140. package/apps/web/src/RunStore.ts +1 -1
  141. package/apps/web/src/SessionList.tsx +14 -14
  142. package/apps/web/src/SettingsModal.tsx +112 -112
  143. package/apps/web/src/StartOptions.tsx +11 -11
  144. package/apps/web/src/StartSelection.tsx +11 -11
  145. package/apps/web/src/StartTiles.tsx +8 -8
  146. package/apps/web/src/SurfaceShortcuts.tsx +3 -3
  147. package/apps/web/src/ThemeSettings.tsx +8 -8
  148. package/apps/web/src/TitleModelSettings.tsx +13 -13
  149. package/apps/web/src/WorkspacePanel.tsx +9 -9
  150. package/apps/web/src/access-session.ts +4 -4
  151. package/apps/web/src/access-token.ts +5 -5
  152. package/apps/web/src/actor-conversation.ts +3 -3
  153. package/apps/web/src/actor-programs/client-ui/DataTable.tsx +8 -8
  154. package/apps/web/src/actor-programs/client-ui/FilePicker.tsx +4 -4
  155. package/apps/web/src/actor-programs/client-ui/FlowDiagram.tsx +13 -13
  156. package/apps/web/src/actor-programs/client-ui/Viewers.tsx +4 -4
  157. package/apps/web/src/actor-programs/client-ui/WorkflowDiagram.tsx +1 -1
  158. package/apps/web/src/actor-programs/client-ui/file-contracts.d.ts +4 -4
  159. package/apps/web/src/actor-programs/client-ui/file-selection.ts +1 -1
  160. package/apps/web/src/actor-programs/client-ui/viewer-contracts.d.ts +3 -3
  161. package/apps/web/src/api.ts +7 -7
  162. package/apps/web/src/chat/StoppedActorNotice.tsx +5 -5
  163. package/apps/web/src/chat/chat-target.ts +3 -3
  164. package/apps/web/src/chat/requests.ts +2 -2
  165. package/apps/web/src/chat/useAttachmentCapabilities.ts +2 -2
  166. package/apps/web/src/chat-view-settings.tsx +5 -6
  167. package/apps/web/src/diff-view.css +1 -1
  168. package/apps/web/src/highlighting.css +1 -1
  169. package/apps/web/src/language-server/language-server-plugin.tsx +30 -30
  170. package/apps/web/src/lib/labels.ts +6 -6
  171. package/apps/web/src/main.tsx +4 -4
  172. package/apps/web/src/offered-machines.ts +2 -2
  173. package/apps/web/src/page-opener.tsx +1 -1
  174. package/apps/web/src/panel/ConnectionsPage.tsx +23 -23
  175. package/apps/web/src/panel/LoginForm.tsx +6 -6
  176. package/apps/web/src/panel/PanelDialogs.tsx +22 -22
  177. package/apps/web/src/panel/PanelHeader.tsx +2 -2
  178. package/apps/web/src/panel/PanelPage.tsx +1 -1
  179. package/apps/web/src/panel/RunLine.tsx +4 -4
  180. package/apps/web/src/panel/RunsPage.tsx +15 -15
  181. package/apps/web/src/panel/StartPage.tsx +26 -26
  182. package/apps/web/src/panel/connection-state.ts +9 -9
  183. package/apps/web/src/panel/contract.ts +28 -28
  184. package/apps/web/src/panel.tsx +1 -1
  185. package/apps/web/src/plugin-bootstrap.ts +5 -5
  186. package/apps/web/src/product/ModelControl.tsx +3 -3
  187. package/apps/web/src/product/ProductModelSettings.tsx +16 -16
  188. package/apps/web/src/product/SystemPromptControl.tsx +11 -11
  189. package/apps/web/src/product/model-settings.ts +2 -2
  190. package/apps/web/src/rpc/client.ts +16 -16
  191. package/apps/web/src/rpc.ts +1 -1
  192. package/apps/web/src/run-overview.ts +1 -1
  193. package/apps/web/src/run-panel/RunPanelApp.tsx +39 -39
  194. package/apps/web/src/run-panel/RunPanelHeader.tsx +6 -6
  195. package/apps/web/src/run-panel/RunPanelMenu.tsx +6 -6
  196. package/apps/web/src/run-panel/RunPanelRail.tsx +4 -4
  197. package/apps/web/src/run-panel/RunPanelWorkspace.tsx +3 -3
  198. package/apps/web/src/run-panel/clipboard.ts +3 -3
  199. package/apps/web/src/run-panel/host-contract.ts +5 -5
  200. package/apps/web/src/run-panel/host.ts +15 -15
  201. package/apps/web/src/run-panel/input-bridge.ts +1 -1
  202. package/apps/web/src/run-panel/run-panel-location.ts +5 -5
  203. package/apps/web/src/run-panel/use-session-list.ts +1 -1
  204. package/apps/web/src/run-panel/workspace-state.ts +3 -3
  205. package/apps/web/src/run-panel.tsx +4 -4
  206. package/apps/web/src/run-preparation.ts +2 -2
  207. package/apps/web/src/run-view.ts +3 -3
  208. package/apps/web/src/settings-contributions.ts +32 -32
  209. package/apps/web/src/theme.ts +9 -9
  210. package/apps/web/src/title-model-settings.ts +6 -6
  211. package/apps/web/src/ui/ListDetail.tsx +9 -9
  212. package/apps/web/src/ui/dialog.tsx +2 -2
  213. package/apps/web/src/ui/modal-controller.ts +3 -3
  214. package/apps/web/src/ui/modal.tsx +2 -2
  215. package/apps/web/src/ui/popover.tsx +1 -1
  216. package/apps/web/src/ui/relative-time.ts +8 -8
  217. package/apps/web/src/ui/startup-notice.tsx +2 -2
  218. package/apps/web/src/ui/state-icon.tsx +1 -1
  219. package/apps/web/src/ui/state-vocabulary.ts +16 -16
  220. package/apps/web/src/ui/stop-button.tsx +2 -2
  221. package/bundles/ragents.activity/ragents-bundle.json +2 -2
  222. package/bundles/ragents.activity/web/classes.json +1 -1
  223. package/bundles/ragents.activity/web/index.js +1 -1
  224. package/bundles/ragents.activity/web/index.js.map +2 -2
  225. package/bundles/ragents.actor-programs/ragents-bundle.json +2 -2
  226. package/bundles/ragents.actor-programs/server/index.js +225 -225
  227. package/bundles/ragents.actor-programs/server/index.js.map +2 -2
  228. package/bundles/ragents.actor-programs/web/classes.json +1 -1
  229. package/bundles/ragents.actor-programs/web/index.js +1 -1
  230. package/bundles/ragents.actor-programs/web/index.js.map +3 -3
  231. package/bundles/ragents.ask/ragents-bundle.json +2 -2
  232. package/bundles/ragents.ask/server/chunks/{chunk-PDJO75SQ.js → chunk-YOV27MAR.js} +2 -2
  233. package/bundles/ragents.ask/server/chunks/chunk-YOV27MAR.js.map +7 -0
  234. package/bundles/ragents.ask/server/exports/server/contract.js +1 -1
  235. package/bundles/ragents.ask/server/index.js +23 -23
  236. package/bundles/ragents.ask/server/index.js.map +2 -2
  237. package/bundles/ragents.ask/web/chunks/{chunk-WFN4374U.js → chunk-D6NNB5DS.js} +1 -1
  238. package/bundles/ragents.ask/web/chunks/chunk-D6NNB5DS.js.map +7 -0
  239. package/bundles/ragents.ask/web/chunks/{chunk-MBRPS477.js → chunk-IQBHK7MV.js} +2 -2
  240. package/bundles/ragents.ask/web/chunks/{chunk-MBRPS477.js.map → chunk-IQBHK7MV.js.map} +3 -3
  241. package/bundles/ragents.ask/web/chunks/chunk-PWFIAMX4.js +2 -0
  242. package/bundles/ragents.ask/web/chunks/chunk-PWFIAMX4.js.map +7 -0
  243. package/bundles/ragents.ask/web/chunks/chunk-QHGKEESD.js +2 -0
  244. package/bundles/ragents.ask/web/chunks/chunk-QHGKEESD.js.map +7 -0
  245. package/bundles/ragents.ask/web/classes.json +1 -1
  246. package/bundles/ragents.ask/web/exports/ask-payload.js +1 -1
  247. package/bundles/ragents.ask/web/exports/web/QuestionCard.js +1 -1
  248. package/bundles/ragents.ask/web/exports/web/api.js +1 -1
  249. package/bundles/ragents.ask/web/index.js +1 -1
  250. package/bundles/ragents.ask/web/index.js.map +2 -2
  251. package/bundles/ragents.browser/executor/index.mjs +35 -35
  252. package/bundles/ragents.browser/executor/index.mjs.map +2 -2
  253. package/bundles/ragents.browser/ragents-bundle.json +2 -2
  254. package/bundles/ragents.browser/server/chunks/{chunk-CWLX4VA5.js → chunk-PYEISBNE.js} +1 -1
  255. package/bundles/ragents.browser/server/chunks/{chunk-CWLX4VA5.js.map → chunk-PYEISBNE.js.map} +1 -1
  256. package/bundles/ragents.browser/server/exports/server/contract.js +1 -1
  257. package/bundles/ragents.browser/server/index.js +31 -31
  258. package/bundles/ragents.browser/server/index.js.map +2 -2
  259. package/bundles/ragents.browser/skills/browser-testing/SKILL.md +30 -30
  260. package/bundles/ragents.documents/prompt.hbs +1 -1
  261. package/bundles/ragents.documents/ragents-bundle.json +2 -2
  262. package/bundles/ragents.documents/server/chunks/{chunk-QIECRZ7C.js → chunk-KMZWOVTI.js} +3 -3
  263. package/bundles/ragents.documents/server/chunks/{chunk-QIECRZ7C.js.map → chunk-KMZWOVTI.js.map} +2 -2
  264. package/bundles/ragents.documents/server/exports/contract.js +1 -1
  265. package/bundles/ragents.documents/server/index.js +26 -26
  266. package/bundles/ragents.documents/server/index.js.map +2 -2
  267. package/bundles/ragents.documents/web/classes.json +1 -1
  268. package/bundles/ragents.documents/web/index.js +1 -1
  269. package/bundles/ragents.documents/web/index.js.map +3 -3
  270. package/bundles/ragents.lsp-fsharp/executor/index.mjs +4 -4
  271. package/bundles/ragents.lsp-fsharp/executor/index.mjs.map +2 -2
  272. package/bundles/ragents.lsp-fsharp/ragents-bundle.json +2 -2
  273. package/bundles/ragents.lsp-fsharp/server/index.js +5 -5
  274. package/bundles/ragents.lsp-fsharp/server/index.js.map +2 -2
  275. package/bundles/ragents.lsp-fsharp/web/index.js +1 -1
  276. package/bundles/ragents.lsp-fsharp/web/index.js.map +2 -2
  277. package/bundles/ragents.lsp-roslyn/executor/index.mjs +3 -3
  278. package/bundles/ragents.lsp-roslyn/executor/index.mjs.map +2 -2
  279. package/bundles/ragents.lsp-roslyn/ragents-bundle.json +2 -2
  280. package/bundles/ragents.lsp-roslyn/server/index.js +17 -17
  281. package/bundles/ragents.lsp-roslyn/server/index.js.map +2 -2
  282. package/bundles/ragents.lsp-roslyn/web/index.js +1 -1
  283. package/bundles/ragents.lsp-roslyn/web/index.js.map +2 -2
  284. package/bundles/ragents.lsp-typescript/executor/index.mjs +2 -2
  285. package/bundles/ragents.lsp-typescript/executor/index.mjs.map +2 -2
  286. package/bundles/ragents.lsp-typescript/ragents-bundle.json +2 -2
  287. package/bundles/ragents.lsp-typescript/server/index.js.map +1 -1
  288. package/bundles/ragents.lsp-typescript/web/index.js +1 -1
  289. package/bundles/ragents.lsp-typescript/web/index.js.map +2 -2
  290. package/bundles/ragents.model-relay/ragents-bundle.json +7 -3
  291. package/bundles/ragents.model-relay/server/index.js +25 -21
  292. package/bundles/ragents.model-relay/server/index.js.map +2 -2
  293. package/bundles/ragents.orchestration/ragents-bundle.json +2 -2
  294. package/bundles/ragents.orchestration/server/index.js +28 -28
  295. package/bundles/ragents.orchestration/server/index.js.map +2 -2
  296. package/bundles/ragents.orchestration/web/chunks/{chunk-OSKPH6SZ.js → chunk-CFMJD5ZI.js} +2 -2
  297. package/bundles/ragents.orchestration/web/chunks/chunk-HOBLI364.js +2 -0
  298. package/bundles/ragents.orchestration/web/chunks/{chunk-OQYCNYXN.js.map → chunk-HOBLI364.js.map} +2 -2
  299. package/bundles/ragents.orchestration/web/chunks/{chunk-ODMMQGX2.js → chunk-UCIMT2R4.js} +2 -2
  300. package/bundles/ragents.orchestration/web/classes.json +1 -1
  301. package/bundles/ragents.orchestration/web/exports/web/program-slot.js +1 -1
  302. package/bundles/ragents.orchestration/web/exports/web/surface-entities.js +1 -1
  303. package/bundles/ragents.orchestration/web/index.js +8 -8
  304. package/bundles/ragents.orchestration/web/index.js.map +2 -2
  305. package/bundles/ragents.overseer/ragents-bundle.json +2 -2
  306. package/bundles/ragents.overseer/server/index.js +98 -98
  307. package/bundles/ragents.overseer/server/index.js.map +2 -2
  308. package/bundles/ragents.overseer/web/classes.json +1 -1
  309. package/bundles/ragents.overseer/web/index.js +1 -1
  310. package/bundles/ragents.overseer/web/index.js.map +2 -2
  311. package/bundles/ragents.processes/ragents-bundle.json +2 -2
  312. package/bundles/ragents.processes/server/index.js +11 -11
  313. package/bundles/ragents.processes/server/index.js.map +2 -2
  314. package/bundles/ragents.processes/web/classes.json +1 -1
  315. package/bundles/ragents.processes/web/index.js +3 -3
  316. package/bundles/ragents.processes/web/index.js.map +2 -2
  317. package/bundles/ragents.product/ragents-bundle.json +2 -2
  318. package/bundles/ragents.product/server/index.js +12 -13
  319. package/bundles/ragents.product/server/index.js.map +2 -2
  320. package/bundles/ragents.product/web/classes.json +1 -1
  321. package/bundles/ragents.product/web/index.js +1 -1
  322. package/bundles/ragents.product/web/index.js.map +2 -2
  323. package/bundles/ragents.profile-distribution/ragents-bundle.json +2 -2
  324. package/bundles/ragents.profile-distribution/server/index.js +31 -31
  325. package/bundles/ragents.profile-distribution/server/index.js.map +2 -2
  326. package/bundles/ragents.reference/ragents-bundle.json +2 -2
  327. package/bundles/ragents.reference/run-scripts/balcony-wizard/RUN.md +19 -19
  328. package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/package.json +2 -2
  329. package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +14 -14
  330. package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/conversation.ts +2 -2
  331. package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/tests/conversation.test.ts +49 -49
  332. package/bundles/ragents.reference/run-scripts/balcony-wizard/package.json +1 -1
  333. package/bundles/ragents.reference/run-scripts/balcony-wizard/src/server.ts +9 -9
  334. package/bundles/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +9 -9
  335. package/bundles/ragents.reference/run-scripts/conversation-circle/RUN.md +7 -7
  336. package/bundles/ragents.reference/run-scripts/conversation-circle/package.json +1 -1
  337. package/bundles/ragents.reference/run-scripts/conversation-circle/src/server.ts +13 -13
  338. package/bundles/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
  339. package/bundles/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +8 -8
  340. package/bundles/ragents.reference/run-scripts/learning-afternoon/RUN.md +16 -16
  341. package/bundles/ragents.reference/run-scripts/learning-afternoon/package.json +1 -1
  342. package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/experiment.md +1 -1
  343. package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/helper.md +3 -3
  344. package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/quiz.md +1 -1
  345. package/bundles/ragents.reference/run-scripts/learning-afternoon/src/server.ts +9 -9
  346. package/bundles/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +39 -39
  347. package/bundles/ragents.reference/run-scripts/moderated-round/RUN.md +7 -7
  348. package/bundles/ragents.reference/run-scripts/moderated-round/package.json +1 -1
  349. package/bundles/ragents.reference/run-scripts/moderated-round/src/server.ts +9 -9
  350. package/bundles/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
  351. package/bundles/ragents.reference/run-scripts/moderated-round/tests/program.test.ts +6 -6
  352. package/bundles/ragents.reference/run-scripts/shared-actor-list/RUN.md +12 -12
  353. package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/package.json +2 -2
  354. package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/contract.ts +3 -3
  355. package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/tests/program.test.ts +4 -4
  356. package/bundles/ragents.reference/run-scripts/shared-actor-list/package.json +1 -1
  357. package/bundles/ragents.reference/run-scripts/shared-actor-list/src/server.ts +11 -11
  358. package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
  359. package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/program.test.ts +13 -13
  360. package/bundles/ragents.reference/run-scripts/word-game/RUN.md +18 -18
  361. package/bundles/ragents.reference/run-scripts/word-game/package.json +2 -2
  362. package/bundles/ragents.reference/run-scripts/word-game/src/client.tsx +1 -1
  363. package/bundles/ragents.reference/run-scripts/word-game/src/contract.ts +2 -2
  364. package/bundles/ragents.reference/run-scripts/word-game/src/server.ts +16 -16
  365. package/bundles/ragents.reference/run-scripts/word-game/tests/program.test.ts +39 -39
  366. package/bundles/ragents.reference/skills/100-shared-actor-list/SKILL.md +5 -5
  367. package/bundles/ragents.reference/skills/110-all-card-slots/SKILL.md +5 -5
  368. package/bundles/ragents.reference/skills/150-editorial-workbench/SKILL.md +5 -5
  369. package/bundles/ragents.reference/skills/160-learning-companion/SKILL.md +5 -5
  370. package/bundles/ragents.reference/skills/170-photo-collection/SKILL.md +5 -5
  371. package/bundles/ragents.reference/skills/180-decision-workbench/SKILL.md +5 -5
  372. package/bundles/ragents.reference/skills/190-review-queue/SKILL.md +5 -5
  373. package/bundles/ragents.reference/skills/20-circle-of-four/SKILL.md +5 -5
  374. package/bundles/ragents.reference/skills/200-typescript-diagnostics/SKILL.md +5 -5
  375. package/bundles/ragents.reference/skills/210-moderator-handover/SKILL.md +5 -5
  376. package/bundles/ragents.reference/skills/220-actor-approval-list/SKILL.md +5 -5
  377. package/bundles/ragents.reference/skills/230-shared-state-views/SKILL.md +5 -5
  378. package/bundles/ragents.reference/skills/240-live-result-list/SKILL.md +5 -5
  379. package/bundles/ragents.reference/skills/250-balcony-wizard/SKILL.md +5 -5
  380. package/bundles/ragents.reference/skills/30-llm-without-runtime-knowledge/SKILL.md +5 -5
  381. package/bundles/ragents.reference/skills/35-actor-input-fifo/SKILL.md +5 -5
  382. package/bundles/ragents.reference/skills/40-subscription-matrix/SKILL.md +5 -5
  383. package/bundles/ragents.reference/skills/50-subscription-removal/SKILL.md +5 -5
  384. package/bundles/ragents.reference/skills/60-stop-in-the-circle/SKILL.md +5 -5
  385. package/bundles/ragents.reference/skills/65-artifact-least-privilege/SKILL.md +5 -5
  386. package/bundles/ragents.reference/skills/70-headless-counter/SKILL.md +5 -5
  387. package/bundles/ragents.reference/skills/75-lsp-demo/SKILL.md +5 -5
  388. package/bundles/ragents.reference/skills/80-actor-text-analysis/SKILL.md +5 -5
  389. package/bundles/ragents.reference/skills/90-actor-notes/SKILL.md +5 -5
  390. package/bundles/ragents.reference/skills/95-hello-world/SKILL.md +5 -5
  391. package/bundles/ragents.reference/skills/decision-brief/SKILL.md +24 -24
  392. package/bundles/ragents.reference/skills/learning-sprint/SKILL.md +24 -24
  393. package/bundles/ragents.reference/web/classes.json +1 -1
  394. package/bundles/ragents.reference/web/index.js +1 -1
  395. package/bundles/ragents.reference/web/index.js.map +2 -2
  396. package/bundles/ragents.todo/ragents-bundle.json +2 -2
  397. package/bundles/ragents.todo/server/index.js +5 -5
  398. package/bundles/ragents.todo/server/index.js.map +2 -2
  399. package/bundles/ragents.todo/web/classes.json +1 -1
  400. package/bundles/ragents.todo/web/index.js +1 -1
  401. package/bundles/ragents.todo/web/index.js.map +2 -2
  402. package/bundles/ragents.transcript/ragents-bundle.json +2 -2
  403. package/bundles/ragents.transcript/server/index.js +11 -11
  404. package/bundles/ragents.transcript/server/index.js.map +2 -2
  405. package/bundles/ragents.watch/ragents-bundle.json +2 -2
  406. package/bundles/ragents.watch/server/index.js +48 -48
  407. package/bundles/ragents.watch/server/index.js.map +2 -2
  408. package/bundles/ragents.workspace/ragents-bundle.json +2 -2
  409. package/bundles/ragents.workspace/server/index.js +81 -81
  410. package/bundles/ragents.workspace/server/index.js.map +2 -2
  411. package/bundles/ragents.workspace/web/classes.json +1 -1
  412. package/bundles/ragents.workspace/web/index.js +1 -1
  413. package/bundles/ragents.workspace/web/index.js.map +2 -2
  414. package/package.json +4 -4
  415. package/packages/agent/dist/core/model-runtime.d.ts +7 -2
  416. package/packages/agent/dist/index.d.ts +1 -1
  417. package/packages/agent/dist/loop/agent-loop.d.ts +2 -2
  418. package/packages/agent/src/core/compaction/utils.ts +1 -1
  419. package/packages/agent/src/core/model-runtime.ts +45 -5
  420. package/packages/agent/src/index.ts +1 -1
  421. package/packages/agent/src/loop/agent-loop.ts +2 -2
  422. package/packages/ai/dist/models.d.ts +1 -0
  423. package/packages/ai/dist/models.generated.d.ts +4544 -983
  424. package/packages/ai/dist/providers/openrouter.models.d.ts +4544 -983
  425. package/packages/ai/src/api/ai-sdk.ts +33 -7
  426. package/packages/ai/src/api-registry.ts +1 -1
  427. package/packages/ai/src/index.ts +2 -2
  428. package/packages/ai/src/models.generated.ts +1 -1
  429. package/packages/ai/src/models.ts +1 -1
  430. package/packages/ai/src/providers/openrouter.models.ts +3723 -550
  431. package/packages/ragents/src/access.ts +12 -12
  432. package/packages/ragents/src/agents/actor-input.ts +33 -33
  433. package/packages/ragents/src/agents/catalog.ts +1 -1
  434. package/packages/ragents/src/agents/delivery.ts +17 -17
  435. package/packages/ragents/src/agents/plugins.ts +1 -1
  436. package/packages/ragents/src/agents/scheduler.ts +7 -7
  437. package/packages/ragents/src/agents/schemas.ts +1 -1
  438. package/packages/ragents/src/agents/tool-orientation.ts +4 -4
  439. package/packages/ragents/src/agents/tools.ts +20 -20
  440. package/packages/ragents/src/agents/toolset.ts +5 -5
  441. package/packages/ragents/src/agents/workspaces.ts +1 -1
  442. package/packages/ragents/src/domain/events.ts +1 -1
  443. package/packages/ragents/src/domain/model.ts +5 -5
  444. package/packages/ragents/src/drivers/agent-runtime.ts +1 -1
  445. package/packages/ragents/src/drivers/agent-turn.ts +4 -4
  446. package/packages/ragents/src/drivers/agent.ts +2 -2
  447. package/packages/ragents/src/drivers/attachments.ts +4 -4
  448. package/packages/ragents/src/http/contracts.ts +14 -14
  449. package/packages/ragents/src/http/methods.ts +6 -6
  450. package/packages/ragents/src/plugin-host.ts +119 -119
  451. package/packages/ragents/src/plugin-types.ts +16 -16
  452. package/packages/ragents/src/rpc/contract.ts +5 -5
  453. package/packages/ragents/src/rpc/contribution.ts +2 -2
  454. package/packages/ragents/src/rpc/peer.ts +11 -11
  455. package/packages/ragents/src/rpc/protocol.ts +2 -2
  456. package/packages/ragents/src/runtime/decisions/turns.ts +1 -1
  457. package/packages/ragents/src/runtime/journal.ts +10 -10
  458. package/packages/ragents/src/runtime/orchestration.ts +8 -8
  459. package/packages/ragents/src/runtime/stop.ts +2 -2
  460. package/packages/ragents/src/script/mediators.ts +35 -35
  461. package/packages/ragents/src/typescript/async-compiler.ts +14 -14
  462. package/packages/ragents/src/typescript/compiler-worker.ts +2 -2
  463. package/packages/ragents/src/typescript/compiler.ts +7 -7
  464. package/packages/ragents/src/typescript/snippet.ts +5 -5
  465. package/packages/workspace-executor/src/bash-launch.ts +13 -13
  466. package/packages/workspace-executor/src/commands.ts +18 -18
  467. package/packages/workspace-executor/src/context.ts +15 -15
  468. package/packages/workspace-executor/src/contributions.ts +35 -35
  469. package/packages/workspace-executor/src/errors.ts +1 -1
  470. package/packages/workspace-executor/src/executor.ts +15 -15
  471. package/packages/workspace-executor/src/files.ts +30 -30
  472. package/packages/workspace-executor/src/language-server/contract.ts +2 -2
  473. package/packages/workspace-executor/src/language-server/diagnostics.ts +4 -4
  474. package/packages/workspace-executor/src/language-server/host.ts +35 -35
  475. package/packages/workspace-executor/src/language-server/json-rpc.ts +4 -4
  476. package/packages/workspace-executor/src/language-server/module.ts +11 -11
  477. package/packages/workspace-executor/src/language-server/roots.ts +3 -3
  478. package/packages/workspace-executor/src/language-server/session.ts +15 -15
  479. package/packages/workspace-executor/src/language-server/workspace-solutions.ts +2 -2
  480. package/packages/workspace-executor/src/managed-process.ts +12 -12
  481. package/packages/workspace-executor/src/module.ts +8 -8
  482. package/packages/workspace-executor/src/modules.ts +3 -3
  483. package/packages/workspace-executor/src/paths.ts +11 -11
  484. package/packages/workspace-executor/src/process-sandbox.ts +3 -3
  485. package/packages/workspace-executor/src/processes/module.ts +3 -3
  486. package/packages/workspace-executor/src/processes/process-table.ts +20 -20
  487. package/packages/workspace-executor/src/processes/scanner.ts +3 -3
  488. package/packages/workspace-executor/src/processes/snapshot.ts +2 -2
  489. package/packages/workspace-executor/src/processes/terminator.ts +13 -13
  490. package/packages/workspace-executor/src/run-folders.ts +3 -3
  491. package/packages/workspace-executor/src/safe-environment.ts +4 -4
  492. package/packages/workspace-executor/src/sandbox-tools.ts +28 -28
  493. package/packages/workspace-executor/src/session-ident.ts +2 -2
  494. package/packages/workspace-executor/src/shell-platform.ts +2 -2
  495. package/packages/workspace-executor/src/tools.ts +5 -5
  496. package/plugins/ragents.activity/web/ActivityHeader.tsx +3 -3
  497. package/plugins/ragents.activity/web/activity.ts +2 -2
  498. package/plugins/ragents.actor-programs/server/access-projections.ts +1 -1
  499. package/plugins/ragents.actor-programs/server/agent-tools.ts +2 -2
  500. package/plugins/ragents.actor-programs/server/capability-resolver.ts +3 -3
  501. package/plugins/ragents.actor-programs/server/controls-template.ts +46 -46
  502. package/plugins/ragents.actor-programs/server/controls-tool.ts +4 -4
  503. package/plugins/ragents.actor-programs/server/limits.ts +3 -3
  504. package/plugins/ragents.actor-programs/server/methods.ts +1 -1
  505. package/plugins/ragents.actor-programs/server/project-diagnostics.ts +8 -8
  506. package/plugins/ragents.actor-programs/server/routes.ts +8 -8
  507. package/plugins/ragents.actor-programs/server/runtime.ts +90 -90
  508. package/plugins/ragents.actor-programs/server/templates.ts +59 -59
  509. package/plugins/ragents.actor-programs/server/test-report.ts +5 -5
  510. package/plugins/ragents.actor-programs/server/tool-contributor.ts +1 -1
  511. package/plugins/ragents.actor-programs/web/ActorViewFrame.tsx +17 -17
  512. package/plugins/ragents.actor-programs/web/AppsPanel.tsx +26 -26
  513. package/plugins/ragents.actor-programs/web/EmbeddedApps.tsx +3 -3
  514. package/plugins/ragents.actor-programs/web/FullscreenHost.tsx +2 -2
  515. package/plugins/ragents.actor-programs/web/FunctionForm.tsx +16 -16
  516. package/plugins/ragents.actor-programs/web/ProgramSource.tsx +5 -5
  517. package/plugins/ragents.actor-programs/web/api.ts +36 -36
  518. package/plugins/ragents.actor-programs/web/bridge.ts +8 -8
  519. package/plugins/ragents.actor-programs/web/chat-state.ts +4 -4
  520. package/plugins/ragents.actor-programs/web/context.ts +1 -1
  521. package/plugins/ragents.actor-programs/web/function-input.ts +6 -6
  522. package/plugins/ragents.actor-programs/web/index.tsx +1 -1
  523. package/plugins/ragents.actor-programs/web/program-state.ts +4 -4
  524. package/plugins/ragents.ask/ask-payload.ts +1 -1
  525. package/plugins/ragents.ask/contract.ts +5 -5
  526. package/plugins/ragents.ask/server/answer-method.ts +1 -1
  527. package/plugins/ragents.ask/server/ask-service.ts +9 -9
  528. package/plugins/ragents.ask/server/ask-tool.ts +10 -10
  529. package/plugins/ragents.ask/server/contract.ts +5 -5
  530. package/plugins/ragents.ask/web/AskActionView.tsx +1 -1
  531. package/plugins/ragents.ask/web/QuestionCard.tsx +22 -22
  532. package/plugins/ragents.ask/web/index.tsx +2 -2
  533. package/plugins/ragents.browser/executor/contract.ts +6 -6
  534. package/plugins/ragents.browser/executor/index.ts +1 -1
  535. package/plugins/ragents.browser/executor/module.ts +6 -6
  536. package/plugins/ragents.browser/executor/pages.ts +32 -32
  537. package/plugins/ragents.browser/executor/playwright.ts +8 -8
  538. package/plugins/ragents.browser/provision.ts +7 -7
  539. package/plugins/ragents.browser/server/browser.ts +14 -14
  540. package/plugins/ragents.browser/server/contract.ts +1 -1
  541. package/plugins/ragents.browser/server/index.ts +1 -1
  542. package/plugins/ragents.browser/server/tools.ts +14 -14
  543. package/plugins/ragents.browser/skills/browser-testing/SKILL.md +30 -30
  544. package/plugins/ragents.documents/contract.ts +2 -2
  545. package/plugins/ragents.documents/prompt.hbs +1 -1
  546. package/plugins/ragents.documents/server/document-write-tool.ts +12 -12
  547. package/plugins/ragents.documents/server/files-route.ts +6 -6
  548. package/plugins/ragents.documents/server/show-document-tool.ts +26 -26
  549. package/plugins/ragents.documents/server/store.ts +1 -1
  550. package/plugins/ragents.documents/web/DocumentViewer.tsx +37 -37
  551. package/plugins/ragents.documents/web/index.tsx +11 -11
  552. package/plugins/ragents.lsp-fsharp/executor.ts +7 -7
  553. package/plugins/ragents.lsp-fsharp/provision.ts +7 -7
  554. package/plugins/ragents.lsp-roslyn/executor.ts +5 -5
  555. package/plugins/ragents.lsp-roslyn/provision.ts +4 -4
  556. package/plugins/ragents.lsp-roslyn/server/index.ts +5 -5
  557. package/plugins/ragents.lsp-roslyn/server/solution-on-start.ts +13 -13
  558. package/plugins/ragents.lsp-typescript/executor.ts +3 -3
  559. package/plugins/ragents.model-relay/server/config.ts +6 -2
  560. package/plugins/ragents.model-relay/server/index.ts +2 -2
  561. package/plugins/ragents.model-relay/server/relay.ts +23 -22
  562. package/plugins/ragents.orchestration/contract.ts +8 -8
  563. package/plugins/ragents.orchestration/server/index.ts +4 -4
  564. package/plugins/ragents.orchestration/server/run-stop-tool.ts +3 -3
  565. package/plugins/ragents.orchestration/server/surface-tool.ts +5 -5
  566. package/plugins/ragents.orchestration/tiled-layout.ts +11 -11
  567. package/plugins/ragents.orchestration/web/ActorChat.tsx +2 -2
  568. package/plugins/ragents.orchestration/web/ActorChatControls.tsx +4 -4
  569. package/plugins/ragents.orchestration/web/ActorChatPreview.tsx +1 -1
  570. package/plugins/ragents.orchestration/web/ActorPopout.tsx +1 -1
  571. package/plugins/ragents.orchestration/web/ActorShortcut.tsx +6 -6
  572. package/plugins/ragents.orchestration/web/ActorSurfaceControls.tsx +15 -15
  573. package/plugins/ragents.orchestration/web/Center.tsx +5 -5
  574. package/plugins/ragents.orchestration/web/DocumentsSection.tsx +2 -2
  575. package/plugins/ragents.orchestration/web/ExecutionsPanel.tsx +15 -15
  576. package/plugins/ragents.orchestration/web/FlowInspector.tsx +103 -103
  577. package/plugins/ragents.orchestration/web/JournalStatus.tsx +11 -11
  578. package/plugins/ragents.orchestration/web/MaterialBody.tsx +2 -2
  579. package/plugins/ragents.orchestration/web/StopRunButton.tsx +6 -6
  580. package/plugins/ragents.orchestration/web/TiledSurface.tsx +9 -9
  581. package/plugins/ragents.orchestration/web/actor-header-settings.ts +5 -5
  582. package/plugins/ragents.orchestration/web/constants.ts +2 -2
  583. package/plugins/ragents.orchestration/web/executions.ts +6 -6
  584. package/plugins/ragents.orchestration/web/format.ts +1 -1
  585. package/plugins/ragents.orchestration/web/index.tsx +2 -2
  586. package/plugins/ragents.orchestration/web/run-panel/AddresseeControl.tsx +7 -7
  587. package/plugins/ragents.orchestration/web/run-panel/AddresseeTree.tsx +8 -8
  588. package/plugins/ragents.orchestration/web/run-panel/RunPanel.tsx +22 -22
  589. package/plugins/ragents.orchestration/web/run-panel/RunPanelSettings.tsx +7 -7
  590. package/plugins/ragents.orchestration/web/run-panel/addressee-tree.ts +13 -13
  591. package/plugins/ragents.orchestration/web/run-panel/run-panel-actors.ts +3 -3
  592. package/plugins/ragents.orchestration/web/run-panel/run-panel-settings.ts +2 -2
  593. package/plugins/ragents.orchestration/web/run-panel/run-panel-startup.ts +3 -3
  594. package/plugins/ragents.orchestration/web/run-panel/run-panel-state.ts +7 -7
  595. package/plugins/ragents.orchestration/web/run-panel/sheet-status.ts +9 -9
  596. package/plugins/ragents.orchestration/web/surface-startup.ts +8 -8
  597. package/plugins/ragents.orchestration/web/surface-view-settings.ts +1 -1
  598. package/plugins/ragents.orchestration/web/tiled-view-settings.ts +1 -1
  599. package/plugins/ragents.overseer/contract.ts +20 -20
  600. package/plugins/ragents.overseer/server/api.ts +6 -6
  601. package/plugins/ragents.overseer/server/coordinator-prompt.ts +10 -10
  602. package/plugins/ragents.overseer/server/coordinator.ts +4 -4
  603. package/plugins/ragents.overseer/server/index.ts +24 -24
  604. package/plugins/ragents.overseer/server/orientation.ts +8 -8
  605. package/plugins/ragents.overseer/server/quick-answer.ts +9 -9
  606. package/plugins/ragents.overseer/server/run-directory.ts +5 -5
  607. package/plugins/ragents.overseer/server/settings.ts +6 -6
  608. package/plugins/ragents.overseer/server/user-location.ts +16 -16
  609. package/plugins/ragents.overseer/web/ModelSettings.tsx +9 -9
  610. package/plugins/ragents.overseer/web/index.tsx +20 -20
  611. package/plugins/ragents.overseer/web/model-settings.ts +1 -1
  612. package/plugins/ragents.overseer/web/quick-answers.ts +2 -2
  613. package/plugins/ragents.processes/contract.ts +5 -5
  614. package/plugins/ragents.processes/server/methods.ts +4 -4
  615. package/plugins/ragents.processes/server/observer.ts +8 -8
  616. package/plugins/ragents.processes/server/run-processes.ts +2 -2
  617. package/plugins/ragents.processes/web/ProcessHeader.tsx +10 -10
  618. package/plugins/ragents.processes/web/processes.ts +10 -10
  619. package/plugins/ragents.product/server/config.ts +1 -1
  620. package/plugins/ragents.product/server/index.ts +4 -4
  621. package/plugins/ragents.product/server/runtime.ts +9 -10
  622. package/plugins/ragents.product/web/index.tsx +1 -1
  623. package/plugins/ragents.profile-distribution/contract.ts +10 -10
  624. package/plugins/ragents.profile-distribution/server/archive.ts +20 -20
  625. package/plugins/ragents.profile-distribution/server/config.ts +2 -2
  626. package/plugins/ragents.profile-distribution/server/index.ts +4 -4
  627. package/plugins/ragents.reference/examples.ts +27 -27
  628. package/plugins/ragents.reference/run-scripts/balcony-wizard/RUN.md +19 -19
  629. package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/package.json +2 -2
  630. package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +14 -14
  631. package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/conversation.ts +2 -2
  632. package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/tests/conversation.test.ts +49 -49
  633. package/plugins/ragents.reference/run-scripts/balcony-wizard/package.json +1 -1
  634. package/plugins/ragents.reference/run-scripts/balcony-wizard/src/server.ts +9 -9
  635. package/plugins/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +9 -9
  636. package/plugins/ragents.reference/run-scripts/conversation-circle/RUN.md +7 -7
  637. package/plugins/ragents.reference/run-scripts/conversation-circle/package.json +1 -1
  638. package/plugins/ragents.reference/run-scripts/conversation-circle/src/server.ts +13 -13
  639. package/plugins/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
  640. package/plugins/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +8 -8
  641. package/plugins/ragents.reference/run-scripts/learning-afternoon/RUN.md +16 -16
  642. package/plugins/ragents.reference/run-scripts/learning-afternoon/package.json +1 -1
  643. package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/experiment.md +1 -1
  644. package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/helper.md +3 -3
  645. package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/quiz.md +1 -1
  646. package/plugins/ragents.reference/run-scripts/learning-afternoon/src/server.ts +9 -9
  647. package/plugins/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +39 -39
  648. package/plugins/ragents.reference/run-scripts/moderated-round/RUN.md +7 -7
  649. package/plugins/ragents.reference/run-scripts/moderated-round/package.json +1 -1
  650. package/plugins/ragents.reference/run-scripts/moderated-round/src/server.ts +9 -9
  651. package/plugins/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
  652. package/plugins/ragents.reference/run-scripts/moderated-round/tests/program.test.ts +6 -6
  653. package/plugins/ragents.reference/run-scripts/shared-actor-list/RUN.md +12 -12
  654. package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/package.json +2 -2
  655. package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/contract.ts +3 -3
  656. package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/tests/program.test.ts +4 -4
  657. package/plugins/ragents.reference/run-scripts/shared-actor-list/package.json +1 -1
  658. package/plugins/ragents.reference/run-scripts/shared-actor-list/src/server.ts +11 -11
  659. package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
  660. package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/program.test.ts +13 -13
  661. package/plugins/ragents.reference/run-scripts/word-game/RUN.md +18 -18
  662. package/plugins/ragents.reference/run-scripts/word-game/package.json +2 -2
  663. package/plugins/ragents.reference/run-scripts/word-game/src/client.tsx +1 -1
  664. package/plugins/ragents.reference/run-scripts/word-game/src/contract.ts +2 -2
  665. package/plugins/ragents.reference/run-scripts/word-game/src/server.ts +16 -16
  666. package/plugins/ragents.reference/run-scripts/word-game/tests/program.test.ts +39 -39
  667. package/plugins/ragents.reference/skills/100-shared-actor-list/SKILL.md +5 -5
  668. package/plugins/ragents.reference/skills/110-all-card-slots/SKILL.md +5 -5
  669. package/plugins/ragents.reference/skills/150-editorial-workbench/SKILL.md +5 -5
  670. package/plugins/ragents.reference/skills/160-learning-companion/SKILL.md +5 -5
  671. package/plugins/ragents.reference/skills/170-photo-collection/SKILL.md +5 -5
  672. package/plugins/ragents.reference/skills/180-decision-workbench/SKILL.md +5 -5
  673. package/plugins/ragents.reference/skills/190-review-queue/SKILL.md +5 -5
  674. package/plugins/ragents.reference/skills/20-circle-of-four/SKILL.md +5 -5
  675. package/plugins/ragents.reference/skills/200-typescript-diagnostics/SKILL.md +5 -5
  676. package/plugins/ragents.reference/skills/210-moderator-handover/SKILL.md +5 -5
  677. package/plugins/ragents.reference/skills/220-actor-approval-list/SKILL.md +5 -5
  678. package/plugins/ragents.reference/skills/230-shared-state-views/SKILL.md +5 -5
  679. package/plugins/ragents.reference/skills/240-live-result-list/SKILL.md +5 -5
  680. package/plugins/ragents.reference/skills/250-balcony-wizard/SKILL.md +5 -5
  681. package/plugins/ragents.reference/skills/30-llm-without-runtime-knowledge/SKILL.md +5 -5
  682. package/plugins/ragents.reference/skills/35-actor-input-fifo/SKILL.md +5 -5
  683. package/plugins/ragents.reference/skills/40-subscription-matrix/SKILL.md +5 -5
  684. package/plugins/ragents.reference/skills/50-subscription-removal/SKILL.md +5 -5
  685. package/plugins/ragents.reference/skills/60-stop-in-the-circle/SKILL.md +5 -5
  686. package/plugins/ragents.reference/skills/65-artifact-least-privilege/SKILL.md +5 -5
  687. package/plugins/ragents.reference/skills/70-headless-counter/SKILL.md +5 -5
  688. package/plugins/ragents.reference/skills/75-lsp-demo/SKILL.md +5 -5
  689. package/plugins/ragents.reference/skills/80-actor-text-analysis/SKILL.md +5 -5
  690. package/plugins/ragents.reference/skills/90-actor-notes/SKILL.md +5 -5
  691. package/plugins/ragents.reference/skills/95-hello-world/SKILL.md +5 -5
  692. package/plugins/ragents.reference/skills/decision-brief/SKILL.md +24 -24
  693. package/plugins/ragents.reference/skills/learning-sprint/SKILL.md +24 -24
  694. package/plugins/ragents.reference/walkthroughs.ts +128 -128
  695. package/plugins/ragents.reference/web/StartGuides.tsx +23 -23
  696. package/plugins/ragents.todo/server/todo-tool.ts +6 -6
  697. package/plugins/ragents.todo/web/TodoSection.tsx +1 -1
  698. package/plugins/ragents.transcript/server/transcript.ts +11 -11
  699. package/plugins/ragents.watch/server/condition.ts +4 -4
  700. package/plugins/ragents.watch/server/functions.ts +27 -27
  701. package/plugins/ragents.watch/server/observation.ts +2 -2
  702. package/plugins/ragents.watch/server/service.ts +14 -14
  703. package/plugins/ragents.workspace/client/transport.ts +1 -1
  704. package/plugins/ragents.workspace/client/workspace-client.ts +54 -54
  705. package/plugins/ragents.workspace/contract.ts +46 -46
  706. package/plugins/ragents.workspace/server/binding.ts +20 -20
  707. package/plugins/ragents.workspace/server/browse-route.ts +8 -8
  708. package/plugins/ragents.workspace/server/clients.ts +42 -42
  709. package/plugins/ragents.workspace/server/config.ts +7 -7
  710. package/plugins/ragents.workspace/server/index.ts +3 -3
  711. package/plugins/ragents.workspace/server/runtime.ts +26 -26
  712. package/plugins/ragents.workspace/server/shell-platform.ts +1 -1
  713. package/plugins/ragents.workspace/web/FileBrowser.tsx +10 -10
  714. package/plugins/ragents.workspace/web/WorkspaceBinding.tsx +24 -24
  715. package/plugins/ragents.workspace/web/index.tsx +1 -1
  716. package/ragents.config.core.ts +1 -1
  717. package/ragents.config.developer.ts +3 -3
  718. package/ragents.config.showcase.ts +2 -2
  719. package/scripts/agent/agent-cli.ts +96 -96
  720. package/scripts/agent/journal.ts +5 -5
  721. package/scripts/agent/turn-control.ts +4 -4
  722. package/scripts/package/build-package.ts +29 -29
  723. package/scripts/package/host-links.mjs +3 -3
  724. package/scripts/package/publish-package.ts +29 -29
  725. package/scripts/package/ragents.mjs +19 -19
  726. package/scripts/plugin/build-builtin-plugins.ts +5 -5
  727. package/scripts/plugin/plugin-cli.ts +14 -14
  728. package/scripts/provision/run-provision.ts +14 -15
  729. package/scripts/remote/connect.ts +46 -46
  730. package/scripts/remote/start.ts +18 -18
  731. package/scripts/workspace-client/run-workspace-client.ts +23 -23
  732. package/apps/web/dist/assets/main-DnnqWHkH.js +0 -11
  733. package/apps/web/dist/assets/mermaid-HWGCJPDP-BLLeth5_.js +0 -568
  734. package/apps/web/dist/assets/runPanel-DPm7s3KM.js +0 -21
  735. package/bundles/ragents.ask/server/chunks/chunk-PDJO75SQ.js.map +0 -7
  736. package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js +0 -2
  737. package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js.map +0 -7
  738. package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js +0 -2
  739. package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js.map +0 -7
  740. package/bundles/ragents.ask/web/chunks/chunk-WFN4374U.js.map +0 -7
  741. package/bundles/ragents.orchestration/web/chunks/chunk-OQYCNYXN.js +0 -2
  742. /package/bundles/ragents.orchestration/web/chunks/{chunk-OSKPH6SZ.js.map → chunk-CFMJD5ZI.js.map} +0 -0
  743. /package/bundles/ragents.orchestration/web/chunks/{chunk-ODMMQGX2.js.map → chunk-UCIMT2R4.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["ragents-host-read:read", "ragents-host-value:react#createContext", "ragents-host-value:react#createElement", "ragents-host-value:react#forwardRef", "ragents-host-value:react#useCallback", "ragents-host-value:react#useContext", "ragents-host-value:react#useEffect", "ragents-host-value:react#useMemo", "ragents-host-value:react#useState", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toKebabCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toLucideIconData.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toCamelCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toPascalCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/mergeClasses.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/defaultAttributes.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconNode.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconForReact.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/hasA11yProp.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/context.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/Icon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/createLucideIcon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/icons/arrow-left.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/icons/x.ts", "ragents-host-value:@ragents/web/ui#Alert", "ragents-host-value:@ragents/web/ui#Badge", "ragents-host-value:@ragents/web/ui#Button", "ragents-host-value:@ragents/web/ui#Dialog", "ragents-host-value:@ragents/web/ui#DialogContent", "ragents-host-value:@ragents/web/ui#DialogTitle", "ragents-host-value:@ragents/web/ui#Empty", "ragents-host-value:@ragents/web/ui#EmptyContent", "ragents-host-value:@ragents/web/ui#EmptyDescription", "ragents-host-value:@ragents/web/ui#EmptyHeader", "ragents-host-value:@ragents/web/ui#EmptyMedia", "ragents-host-value:@ragents/web/ui#EmptyTitle", "ragents-host-value:@ragents/web/ui#Spinner", "ragents-host-value:quassel#Markdown", "ragents-host-value:@ragents/web/lib/format#formatBytes", "ragents-host-value:@ragents/web/SourceCode#SourceCode", "ragents-host-value:react/jsx-runtime#Fragment", "ragents-host-value:react/jsx-runtime#jsx", "ragents-host-value:react/jsx-runtime#jsxs", "../../../plugins/ragents.documents/web/DocumentViewer.tsx", "ragents-host-value:@ragents/web/rpc#rpc", "ragents-host-value:typebox#Type", "ragents-host-value:@ragents/engine/src/rpc/contract#defineOperation", "../../../plugins/ragents.documents/contract.ts", "../../../plugins/ragents.documents/web/api.ts", "ragents-host-value:@ragents/web/run-view#runArtifactContentUrl", "ragents-host-value:@ragents/web/run-view#runViewFrom", "ragents-host-value:@ragents/web/PluginRegistry#pluginRoutePrefixFrom", "../../../plugins/ragents.documents/web/index.tsx"],
4
- "sourcesContent": ["export const read = (specifier, name) => {\n const module = globalThis[\"__ragentsHostModules\"]?.[specifier];\n if (module === undefined) throw new Error(`Der Host stellt ${specifier} nicht bereit`);\n if (!(name in module)) throw new Error(`Der Host stellt ${name} aus ${specifier} nicht bereit; das Bundle ist gegen einen neueren Host gebaut`);\n return module[name];\n};", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createElement\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"forwardRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useCallback\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useMemo\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useState\");\n", "/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string?.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n", "import { toKebabCase } from './toKebabCase';\nimport type { LucideIconData, LucideIconNode } from '../build/types';\n\n/**\n * Converts legacy `(name, iconNode, aliases?)` icon arguments into icon data object format.\n */\nexport function toLucideIconData(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases: string[] = [],\n): LucideIconData {\n if (iconNode == null) {\n throw new Error('[lucide]: iconNode is required when icon name is used');\n }\n\n return {\n name: toKebabCase(iconName),\n size: 24,\n node: iconNode,\n ...(aliases.length > 0 ? { aliases } : {}),\n };\n}\n", "/**\n * Converts string to camel case\n *\n * @param {string} string\n * @returns {string} A camelized string\n */\nexport const toCamelCase = <T extends string>(string: T) => {\n let out = '';\n let upperNext = false;\n\n for (const ch of string) {\n if (ch === '-' || ch === '_' || ch <= ' ') {\n upperNext = out.length > 0;\n continue;\n }\n\n if (out.length === 0) {\n out += ch.toLowerCase();\n } else {\n out += upperNext ? ch.toUpperCase() : ch;\n }\n\n upperNext = false;\n }\n\n return out as string;\n};\n", "import { CamelToPascal } from '../utility-types';\nimport { toCamelCase } from './toCamelCase';\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = toCamelCase(string);\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n", "/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return (\n Boolean(className) &&\n (className as string).trim() !== '' &&\n array.indexOf(className) === index\n );\n })\n .join(' ')\n .trim();\n", "const defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n} as const;\n\nexport default defaultAttributes;\n", "import type { LucideBuildParams, LucideIconData, LucideIconNode, SVGProps } from './types';\nimport defaultAttributes from './defaultAttributes';\nimport { mergeClasses } from '../utils/mergeClasses';\n\nfunction isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Creates a Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconNode(icon: LucideIconData, params: LucideBuildParams = {}): LucideIconNode {\n const attributeNames = params.attributeNames ?? {};\n const getAttributeName = (attributeName: string) =>\n attributeNames[attributeName] ?? attributeName;\n\n const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes['width'];\n const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes['height'];\n const aliasClassNames =\n icon.aliases\n ?.filter((alias: string): alias is string => typeof alias === 'string' && alias.trim() !== '')\n .map((alias: string) => `lucide-${alias}`) ?? [];\n const iconClassNames = [...(icon.name ? [`lucide-${icon.name}`] : []), ...aliasClassNames];\n const classNamesFromClassName = params.className?.split(' ').filter(Boolean) ?? [];\n const className =\n params.includeDefaultClasses === false\n ? mergeClasses(...classNamesFromClassName)\n : mergeClasses('lucide', ...iconClassNames, ...classNamesFromClassName);\n\n const calculatedStrokeWidth = params.absoluteStrokeWidth\n ? (Number(params.strokeWidth ?? defaultAttributes['stroke-width']) *\n Number(icon.size ?? icon.width ?? defaultAttributes['width'])) /\n Number(params.size ?? params.width ?? defaultAttributes['width'])\n : (params.strokeWidth ?? defaultAttributes['stroke-width']);\n\n const attributes = {\n ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {\n attrs[getAttributeName(attrName)] = value;\n return attrs;\n }, {} as SVGProps),\n ...('color' in params &&\n params.color && {\n [getAttributeName('stroke')]: params.color,\n }),\n ...('size' in params &&\n isDefined(params.size) && {\n [getAttributeName('width')]: params.size,\n [getAttributeName('height')]: params.size,\n }),\n ...('width' in params &&\n isDefined(params.width) && {\n [getAttributeName('width')]: params.width,\n }),\n ...('height' in params &&\n isDefined(params.height) && {\n [getAttributeName('height')]: params.height,\n }),\n [getAttributeName('stroke-width')]: calculatedStrokeWidth,\n ...(className && {\n [getAttributeName('class')]: className,\n }),\n [getAttributeName('viewBox')]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,\n ...(params.hasA11yProp === false\n ? {\n [getAttributeName('aria-hidden')]: 'true',\n }\n : {}),\n ...('attributes' in params && params.attributes),\n };\n\n return [\n 'svg',\n attributes,\n icon.node.map((child): LucideIconNode => {\n const [name, attrs, children] = child;\n const nextAttrs = params.nonScalingStroke\n ? { [getAttributeName('vector-effect')]: 'non-scaling-stroke', ...attrs }\n : attrs;\n\n return children ? [name, nextAttrs, children] : [name, nextAttrs];\n }),\n ];\n}\n\nexport default buildLucideIconNode;\n", "import buildLucideIconNode from './buildLucideIconNode';\nimport type { LucideBuildParams, LucideIconData, LucideIconNode } from './types';\n\n/**\n * Creates a React-compatible Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconForReact(\n icon: LucideIconData,\n params: LucideBuildParams = {},\n): LucideIconNode {\n return buildLucideIconNode(icon, {\n ...params,\n attributeNames: {\n ...params.attributeNames,\n class: 'className',\n 'stroke-width': 'strokeWidth',\n 'stroke-linecap': 'strokeLinecap',\n 'stroke-linejoin': 'strokeLinejoin',\n 'vector-effect': 'vectorEffect',\n },\n });\n}\n\nexport default buildLucideIconForReact;\n", "/**\n * Check if a component has an accessibility prop\n *\n * @param {object} props\n * @returns {boolean} Whether the component has an accessibility prop\n */\nexport const hasA11yProp = (props: object) => {\n for (const prop in props) {\n if (prop.startsWith('aria-') || prop === 'role' || prop === 'title') {\n return true;\n }\n }\n\n return false;\n};\n", "'use client';\n\nimport { createContext, createElement, type ReactNode, useContext, useMemo } from 'react';\nimport { LucideProps } from './types';\n\ntype LucideConfig = {\n size: number;\n color: string;\n strokeWidth: number;\n /**\n * @deprecated Use `nonScalingStroke` instead.\n */\n absoluteStrokeWidth: boolean;\n nonScalingStroke: boolean;\n className: string;\n};\n\nconst LucideContext = createContext<LucideProps>({});\n\ntype LucideProviderProps = {\n children: ReactNode;\n} & Partial<LucideConfig>;\n\nexport function LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n}: LucideProviderProps) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className],\n );\n\n return createElement(LucideContext.Provider, { value }, children);\n}\n\nexport const useLucideContext = () => useContext(LucideContext);\n", "'use client';\n\nimport { createElement, forwardRef } from 'react';\nimport { buildLucideIconForReact, hasA11yProp, mergeClasses } from '@lucide/shared';\nimport { LucideIconData, LucideIconNode, LucideProps } from './types';\nimport { useLucideContext } from './context';\n\ntype IconComponentProps = LucideProps &\n (\n | {\n iconNode: LucideIconNode[];\n icon?: never;\n }\n | {\n icon: LucideIconData;\n iconNode?: never;\n }\n );\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {boolean} props.nonScalingStroke - Whether to use non scaling strokes\n * @param {string} props.className - The class name of the icon\n * @param {LucideIconNode[]} props.children - The children of the icon\n * @param {LucideIconNode[]} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color,\n size,\n width,\n height,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className = '',\n children,\n iconNode = [],\n icon = {\n node: iconNode,\n aliases: [],\n size: 24,\n },\n ...rest\n },\n ref,\n ) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n nonScalingStroke: contextNonScalingStroke = false,\n color: contextColor = 'currentColor',\n className: contextClass = '',\n } = useLucideContext() ?? {};\n\n const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);\n\n const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {\n color: color ?? contextColor,\n width: width ?? size ?? contextSize,\n height: height ?? size ?? contextSize,\n strokeWidth: strokeWidth ?? contextStrokeWidth,\n absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,\n nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,\n className: mergeClasses(contextClass, className),\n hasA11yProp: hasAccessibleProp,\n attributes: rest,\n });\n\n return createElement(\n name,\n {\n ref,\n ...svgAttributes,\n },\n [\n ...builtIconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n", "import { createElement, forwardRef } from 'react';\nimport { toLucideIconData, toPascalCase } from '@lucide/shared';\nimport { LucideIcon, LucideIconData, LucideIconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Creates a Lucide icon component from icon data.\n *\n * @param icon Icon data object.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(icon: LucideIconData): LucideIcon;\n\n/**\n * Creates a Lucide icon component from the legacy icon arguments.\n *\n * @param iconName Icon name.\n * @param iconNode Icon node.\n * @param aliases Optional icon aliases.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases?: string[],\n): LucideIcon;\n\nfunction createLucideIcon(\n iconDataOrName: LucideIconData | string,\n iconNode: LucideIconNode[] = [],\n aliases: string[] = [],\n): LucideIcon {\n const iconData =\n typeof iconDataOrName === 'string'\n ? toLucideIconData(iconDataOrName, iconNode, aliases)\n : iconDataOrName;\n\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n icon: iconData,\n className,\n ...props,\n }),\n );\n\n if (iconData.name) {\n Component.displayName = toPascalCase(iconData.name);\n }\n\n return Component;\n}\n\nexport default createLucideIcon;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'arrow-left',\n size: 24,\n node: [\n ['path', { d: 'm12 19-7-7 7-7', key: '1l729n' }],\n ['path', { d: 'M19 12H5', key: 'x3x0zl' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name ArrowLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTIgMTktNy03IDctNyIgLz4KICA8cGF0aCBkPSJNMTkgMTJINSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowLeft = createLucideIcon(__iconData);\n\nexport default ArrowLeft;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'x',\n size: 24,\n node: [\n ['path', { d: 'M18 6 6 18', key: '1bl5f8' }],\n ['path', { d: 'm6 6 12 12', key: 'd8bk6v' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst X = createLucideIcon(__iconData);\n\nexport default X;\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Alert\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Badge\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Button\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Dialog\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Empty\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyDescription\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyHeader\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyMedia\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Spinner\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"quassel\", \"Markdown\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/lib/format\", \"formatBytes\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/SourceCode\", \"SourceCode\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"Fragment\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsx\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsxs\");\n", "import { ArrowLeftIcon, XIcon } from \"lucide-react\";\nimport {\n Badge,\n Button,\n Dialog,\n DialogContent,\n DialogTitle,\n Empty,\n EmptyContent,\n EmptyDescription,\n EmptyHeader,\n EmptyMedia,\n EmptyTitle,\n Spinner,\n} from \"@ragents/web/ui\";\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { Markdown, type Message } from \"quassel\";\nimport { formatBytes } from \"@ragents/web/lib/format\";\nimport { SourceCode } from \"@ragents/web/SourceCode\";\n\nexport type DocumentFormat = \"markdown\" | \"text\" | \"html\" | \"image\" | \"binary\";\n\nconst copyClass = \"grid min-w-0 gap-px\";\nconst titleClass = \"truncate text-[0.82rem] font-semibold\";\nconst metaClass = \"text-[0.68rem] text-muted-foreground tabular-nums\";\nconst sourceClass = \"min-w-0 p-0 text-[12px] whitespace-pre-wrap break-words\";\nconst groupBadgeClass = \"flex size-7 items-center justify-center rounded-[9px] text-[0.62rem] font-bold tracking-[0.02em]\";\n\nexport interface RunDocument {\n id: string;\n title: string;\n format: DocumentFormat;\n content?: string;\n contentUrl?: string;\n createdAt?: string;\n size?: number;\n meta?: string;\n}\n\nexport interface DocumentSection {\n id: string;\n label: string;\n kind: \"ablage\" | \"ergebnisse\" | \"chat\";\n documents: RunDocument[];\n}\n\nconst formatLabels: Record<DocumentFormat, string> = {\n markdown: \"Markdown\",\n text: \"Text\",\n html: \"HTML\",\n image: \"Bild\",\n binary: \"Datei\",\n};\n\nconst formatByExtension: Record<string, DocumentFormat> = {\n \".md\": \"markdown\",\n \".markdown\": \"markdown\",\n \".html\": \"html\",\n \".htm\": \"html\",\n \".png\": \"image\",\n \".jpg\": \"image\",\n \".jpeg\": \"image\",\n \".gif\": \"image\",\n \".svg\": \"image\",\n \".webp\": \"image\",\n \".pdf\": \"binary\",\n \".zip\": \"binary\",\n \".gz\": \"binary\",\n \".tar\": \"binary\",\n \".xlsx\": \"binary\",\n \".docx\": \"binary\",\n \".bin\": \"binary\",\n};\n\nexport const formatFromName = (name: string): DocumentFormat => {\n const dot = name.lastIndexOf(\".\");\n return dot < 0 ? \"text\" : formatByExtension[name.slice(dot).toLowerCase()] ?? \"text\";\n};\n\nexport const formatOf = (mediaType: string): DocumentFormat =>\n mediaType.includes(\"html\")\n ? \"html\"\n : mediaType.includes(\"markdown\")\n ? \"markdown\"\n : mediaType.startsWith(\"image/\")\n ? \"image\"\n : mediaType.startsWith(\"text/\") || mediaType.includes(\"json\") || mediaType.includes(\"xml\")\n ? \"text\"\n : \"binary\";\n\nconst formatTime = (iso: string) => {\n const date = new Date(iso);\n return Number.isNaN(date.getTime())\n ? iso\n : date.toLocaleString(\"de-DE\", { day: \"2-digit\", month: \"2-digit\", hour: \"2-digit\", minute: \"2-digit\" });\n};\n\nexport const documentMessagesFrom = (\n messages: readonly Message[],\n conversations: Readonly<Record<string, readonly Message[]>> = {},\n): Message[] => [...new Map([...Object.values(conversations).flat(), ...messages]\n .filter((message) => message.tool?.name === \"show_document\")\n .map((message) => [message.tool!.id, message])).values()];\n\nexport const documentsFrom = (messages: Message[]): RunDocument[] =>\n messages.flatMap((message) => {\n const tool = message.tool;\n if (tool?.name !== \"show_document\") return [];\n try {\n const args = JSON.parse(tool.arguments) as { title?: unknown; content?: unknown; format?: unknown };\n if (typeof args.title !== \"string\" || typeof args.content !== \"string\") return [];\n const format = args.format === \"text\" || args.format === \"html\" ? args.format : \"markdown\";\n return [{ id: tool.id, title: args.title, content: args.content, format }];\n } catch {\n return [];\n }\n });\n\ntype LoadState = { text: string } | { error: string } | undefined;\n\nconst useDocumentContent = (document: RunDocument | undefined): LoadState => {\n const [cache, setCache] = useState<Record<string, LoadState>>({});\n const textual = document?.format === \"markdown\" || document?.format === \"text\" || document?.format === \"html\";\n const url = document?.content === undefined && textual ? document?.contentUrl : undefined;\n\n useEffect(() => {\n if (!url || cache[url]) return;\n let alive = true;\n void fetch(url, { cache: \"no-store\" })\n .then(async (response) => {\n if (!response.ok) throw new Error(`Status ${response.status}`);\n return response.text();\n })\n .then((text) => alive && setCache((current) => ({ ...current, [url]: { text } })))\n .catch((error: unknown) => alive && setCache((current) => ({\n ...current,\n [url]: { error: error instanceof Error ? error.message : String(error) },\n })));\n return () => {\n alive = false;\n };\n }, [url, cache]);\n\n if (!document) return undefined;\n if (document.content !== undefined) return { text: document.content };\n if (!textual) return { text: \"\" };\n return url ? cache[url] : undefined;\n};\n\ninterface DocumentToolCallProps {\n active: boolean;\n document: RunDocument;\n onOpen: () => void;\n status: \"error\" | \"ready\" | \"running\";\n}\n\nexport function DocumentToolCall({ active, document, onOpen, status }: DocumentToolCallProps) {\n const lineCount = useMemo(\n () => !document.content ? 0 : document.content.split(/\\r\\n|\\r|\\n/).length,\n [document.content],\n );\n const statusLabel = status === \"error\"\n ? \"Fehler\"\n : status === \"running\"\n ? \"Wird ge\u00F6ffnet\"\n : active\n ? \"Ge\u00F6ffnet\"\n : \"\u00D6ffnen\";\n\n return (\n <button\n aria-pressed={active}\n className=\"group/call grid w-[min(100%,620px)] grid-cols-[42px_minmax(0,1fr)_auto] items-center gap-3 rounded-xl border border-border bg-[color-mix(in_srgb,var(--background)_95%,var(--primary))] px-3.5 py-3 text-left shadow-sm transition-[background-color,border-color,box-shadow,transform] duration-100 hover:-translate-y-px hover:border-primary/50 hover:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] hover:shadow-md focus-visible:border-primary/50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/55 aria-pressed:border-primary/50 aria-pressed:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] data-[status=error]:border-destructive/45 max-[620px]:grid-cols-[38px_minmax(0,1fr)_auto] max-[620px]:gap-2.5 max-[620px]:px-2.5 max-[620px]:py-2.5\"\n data-status={status}\n onClick={onOpen}\n type=\"button\"\n >\n <span className=\"flex h-12 w-[42px] items-center justify-center rounded-lg border border-primary/25 bg-primary/12 text-primary group-data-[status=error]/call:text-destructive max-[620px]:h-11 max-[620px]:w-[38px]\">\n <IconDocument size={22} />\n </span>\n <span className=\"flex min-w-0 flex-col gap-0.5\">\n <span className=\"text-[0.62rem] font-semibold tracking-[0.05em] text-primary uppercase\">Dokument</span>\n <strong className=\"truncate text-[0.84rem] leading-[1.35]\" title={document.title}>{document.title}</strong>\n <span className=\"text-[0.7rem] leading-[1.35] text-muted-foreground\">\n {formatLabels[document.format]}, {lineCount.toLocaleString(\"de-DE\")} {lineCount === 1 ? \"Zeile\" : \"Zeilen\"}\n </span>\n </span>\n <span className=\"flex items-center gap-1 text-[0.7rem] font-semibold text-primary group-data-[status=error]/call:text-destructive\">\n <span className=\"max-[620px]:sr-only\">{statusLabel}</span>\n {status === \"running\" ? <Spinner className=\"size-3\" /> : status === \"error\" ? <IconError /> : <IconOpen />}\n </span>\n </button>\n );\n}\n\nfunction DocumentContent({ document, stand }: { document: RunDocument; stand: LoadState }) {\n if (document.format === \"image\" && document.contentUrl) {\n return <img alt={document.title} className=\"block max-w-full rounded-lg border border-border\" src={document.contentUrl} />;\n }\n if (document.format === \"binary\" && document.contentUrl) {\n return (\n <Empty className=\"min-h-30 gap-2 p-7\">\n <EmptyHeader>\n <EmptyMedia><IconDocument /></EmptyMedia>\n <EmptyTitle>Keine Vorschau f\u00FCr dieses Format</EmptyTitle>\n </EmptyHeader>\n <EmptyContent>\n <Button render={<a download={document.title} href={document.contentUrl} />} size=\"sm\" variant=\"outline\">Herunterladen</Button>\n </EmptyContent>\n </Empty>\n );\n }\n if (!stand) {\n return (\n <div className=\"flex items-center justify-center gap-2.5 p-9 text-[0.76rem] text-muted-foreground\">\n <Spinner className=\"size-3\" />\n <span>Wird geladen</span>\n </div>\n );\n }\n if (\"error\" in stand) {\n return (\n <Empty className=\"min-h-30 gap-2 p-7\">\n <EmptyHeader>\n <EmptyMedia><IconError /></EmptyMedia>\n <EmptyTitle>Inhalt nicht lesbar</EmptyTitle>\n <EmptyDescription>{stand.error}</EmptyDescription>\n </EmptyHeader>\n </Empty>\n );\n }\n if (document.format === \"html\") {\n return <iframe className=\"h-full min-h-full w-full border-0 bg-white\" sandbox=\"\" srcDoc={stand.text} title={document.title} />;\n }\n if (document.format === \"text\") {\n return <SourceCode className={sourceClass} content={stand.text} path={document.title} />;\n }\n return <Markdown text={stand.text} />;\n}\n\nfunction DocumentHead({ document }: { document: RunDocument }) {\n const meta = [\n formatLabels[document.format],\n document.size !== undefined ? formatBytes(document.size) : undefined,\n document.createdAt ? formatTime(document.createdAt) : undefined,\n document.meta,\n ].filter(Boolean);\n\n return (\n <>\n <strong className={titleClass} title={document.title}>{document.title}</strong>\n <span className={metaClass}>{meta.join(\" \u00B7 \")}</span>\n </>\n );\n}\n\ninterface DocumentModalProps {\n document: RunDocument;\n onClose: () => void;\n}\n\nexport function DocumentModal({ document, onClose }: DocumentModalProps) {\n const stand = useDocumentContent(document);\n\n return (\n <Dialog open onOpenChange={(open) => { if (!open) onClose(); }}>\n <DialogContent className=\"w-[min(1080px,calc(100%-2*clamp(16px,5vw,72px)))] gap-0 rounded-panel border border-border bg-card p-0 shadow-pop\" scope=\"run\" showCloseButton={false} size=\"full\">\n <header className=\"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-b border-border px-3.5 py-3\">\n <span className=\"flex size-8 items-center justify-center rounded-[10px] bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary\"><IconDocument size={20} /></span>\n <DialogTitle className={copyClass} render={<span />}>\n <DocumentHead document={document} />\n </DialogTitle>\n <Button aria-label=\"Schlie\u00DFen\" className=\"rounded-full\" onClick={onClose} size=\"icon\" title=\"Schlie\u00DFen\" variant=\"outline\">\n <XIcon />\n </Button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-[clamp(18px,4vw,54px)] pt-5 pb-10 text-[13.5px] leading-[1.65]\">\n <DocumentContent document={document} stand={stand} />\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n\ninterface DocumentPanelProps {\n activeId: string | undefined;\n sections: DocumentSection[];\n truncated: boolean;\n onSelect: (id: string | undefined) => void;\n}\n\nexport function DocumentPanel({ activeId, sections, truncated, onSelect }: DocumentPanelProps) {\n const active = sections.flatMap((section) => section.documents).find((document) => document.id === activeId);\n const stand = useDocumentContent(active);\n const [modalOpen, setModalOpen] = useState(false);\n const [collapsed, setCollapsed] = useState<Set<string>>(() => new Set());\n\n const toggle = useCallback((id: string) => {\n setCollapsed((current) => {\n const next = new Set(current);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n }, []);\n\n useEffect(() => {\n if (!active) setModalOpen(false);\n }, [active]);\n\n if (sections.every((section) => section.documents.length === 0)) {\n return (\n <Empty className=\"h-full gap-2 p-7\">\n <EmptyHeader>\n <EmptyMedia><IconDocument /></EmptyMedia>\n <EmptyTitle>Noch keine Dokumente</EmptyTitle>\n <EmptyDescription>Dateien aus der Ablage des Runs, Ergebnisse und im Chat gezeigte Dokumente sammeln sich hier.</EmptyDescription>\n </EmptyHeader>\n </Empty>\n );\n }\n\n if (!active) {\n return (\n <div className=\"flex h-full flex-col gap-3.5 overflow-y-auto px-workspace-inset pt-2.5 pb-4.5 [scrollbar-width:thin]\">\n {sections.filter((section) => section.documents.length > 0).map((section) => {\n const offen = !collapsed.has(section.id);\n return (\n <section key={section.id}>\n <button\n aria-expanded={offen}\n className=\"grid w-full grid-cols-[14px_26px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg px-2 py-2 text-left hover:bg-primary/7\"\n onClick={() => toggle(section.id)}\n type=\"button\"\n >\n <span aria-hidden className={`flex text-muted-foreground transition-transform duration-150${offen ? \" rotate-90\" : \"\"}`}>\n <IconChevron />\n </span>\n {section.kind === \"ablage\" && <span aria-hidden className={`${groupBadgeClass} bg-[color-mix(in_srgb,var(--foreground)_8%,var(--background))] text-[0.85rem] text-foreground`}>#</span>}\n {section.kind === \"ergebnisse\" && <span aria-hidden className={`${groupBadgeClass} bg-[color-mix(in_srgb,var(--primary)_16%,var(--background))] text-primary`}><IconResult /></span>}\n {section.kind === \"chat\" && <span aria-hidden className={`${groupBadgeClass} bg-[color-mix(in_srgb,var(--foreground)_9%,var(--background))] text-muted-foreground`}><IconChat /></span>}\n <span className=\"truncate text-sm font-semibold\" title={section.label}>{section.label}</span>\n <Badge className=\"tabular-nums\" variant=\"secondary\">{section.documents.length}</Badge>\n </button>\n {offen && (\n <div className=\"ml-[23px] border-l border-border-soft pl-2.5\">\n <ul className=\"mt-0.5 list-none\">\n {section.documents.map((document) => (\n <li key={document.id}>\n <button\n className=\"group/entry mt-1.5 grid w-full grid-cols-[24px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg border border-border bg-card px-2.5 py-2.5 text-left transition-colors duration-100 hover:border-primary/55 hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]\"\n onClick={() => onSelect(document.id)}\n type=\"button\"\n >\n <span className=\"flex text-primary\"><IconDocument size={18} /></span>\n <span className=\"grid min-w-0 gap-0.5\">\n <strong className=\"truncate text-[0.79rem] font-semibold\" title={document.title}>{document.title}</strong>\n <small className={metaClass}>\n {[\n formatLabels[document.format],\n document.size !== undefined ? formatBytes(document.size) : undefined,\n document.createdAt ? formatTime(document.createdAt) : undefined,\n document.meta,\n ].filter(Boolean).join(\" \u00B7 \")}\n </small>\n </span>\n <span aria-hidden className=\"flex text-muted-foreground opacity-0 transition-opacity duration-100 group-hover/entry:opacity-100\"><IconOpen /></span>\n </button>\n </li>\n ))}\n </ul>\n </div>\n )}\n </section>\n );\n })}\n {truncated && <p className=\"text-[0.72rem] text-muted-foreground\">Die Ablage enth\u00E4lt mehr Dateien, als hier angezeigt werden.</p>}\n </div>\n );\n }\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n <header className=\"grid shrink-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border-soft px-workspace-inset py-2.5\">\n <Button aria-label=\"Zur\u00FCck zur \u00DCbersicht\" onClick={() => onSelect(undefined)} size=\"icon-sm\" title=\"Zur\u00FCck zur \u00DCbersicht\" variant=\"outline\">\n <ArrowLeftIcon />\n </Button>\n <span className={copyClass}>\n <DocumentHead document={active} />\n </span>\n <Button onClick={() => setModalOpen(true)} size=\"sm\" variant=\"outline\">Gro\u00DF</Button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-workspace-inset py-4 text-[13px] leading-[1.6]\">\n <DocumentContent document={active} stand={stand} />\n </div>\n {modalOpen && <DocumentModal document={active} onClose={() => setModalOpen(false)} />}\n </div>\n );\n}\n\nfunction IconDocument({ size = 28 }: { size?: number }) {\n return (\n <svg aria-hidden fill=\"none\" height={size} stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\" viewBox=\"0 0 24 24\" width={size}>\n <path d=\"M6 3h8l4 4v14H6z\" />\n <path d=\"M14 3v5h4M9 13h6M9 17h4\" />\n </svg>\n );\n}\n\nfunction IconOpen() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\nfunction IconChevron() {\n return (\n <svg aria-hidden fill=\"none\" height=\"12\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" viewBox=\"0 0 24 24\" width=\"12\">\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\nfunction IconChat() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.4A8 8 0 1 1 21 12z\" />\n </svg>\n );\n}\n\nfunction IconResult() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nfunction IconError() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 7v6M12 17h.01\" />\n </svg>\n );\n}\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/rpc\", \"rpc\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"typebox\", \"Type\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/rpc/contract\", \"defineOperation\");\n", "import { Type, type Static } from \"typebox\";\nimport { defineOperation } from \"@ragents/engine/src/rpc/contract\";\n\nexport const documentsApiPrefix = \"/api/plugins/ragents.documents\";\n\nconst fileEntry = Type.Object({\n path: Type.String({ minLength: 1 }),\n size: Type.Integer({ minimum: 0 }),\n modifiedAt: Type.String({ minLength: 1 }),\n}, { additionalProperties: false });\n\nconst filesListing = Type.Object({\n groups: Type.Array(Type.Object({\n directory: Type.String({ minLength: 1 }),\n files: Type.Array(fileEntry),\n }, { additionalProperties: false })),\n loose: Type.Array(fileEntry),\n truncated: Type.Boolean(),\n}, { additionalProperties: false });\n\nexport type RunFileEntry = Static<typeof fileEntry>;\n\nexport type RunFilesListing = Static<typeof filesListing>;\n\nexport const documentsContracts = {\n files: defineOperation({\n id: \"ragents.documents.files\",\n description: \"Die Dateiablage eines Runs als Gruppen und lose Dateien. Recht: runs.read.\",\n rights: [\"runs.read\"],\n input: Type.Object({\n runId: Type.String({ minLength: 1, maxLength: 64, description: \"Kennung des Runs\" }),\n }, { additionalProperties: false }),\n result: filesListing,\n }),\n};\n", "import { rpc } from \"@ragents/web/rpc\";\nimport { documentsContracts, type RunFilesListing } from \"../contract\";\n\nexport const runFileContentUrl = (routePrefix: string, runId: string, filePath: string): string =>\n `${routePrefix}/runs/${encodeURIComponent(runId)}/files/content?path=${encodeURIComponent(filePath)}`;\n\nexport const fetchRunFiles = (runId: string): Promise<RunFilesListing> =>\n rpc.call(documentsContracts.files, { runId });\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runArtifactContentUrl\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runViewFrom\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/PluginRegistry\", \"pluginRoutePrefixFrom\");\n", "import { createContext, useContext, useEffect, useMemo, useState } from \"react\";\nimport type { ToolInfo } from \"quassel/events\";\nimport {\n DocumentPanel,\n DocumentToolCall,\n documentMessagesFrom,\n documentsFrom as documentsFromMessages,\n formatFromName,\n formatOf,\n type RunDocument as Document,\n type DocumentSection,\n} from \"./DocumentViewer\";\nimport { fetchRunFiles, runFileContentUrl } from \"./api\";\nimport type { RunFileEntry, RunFilesListing } from \"../contract\";\nimport { runArtifactContentUrl, runViewFrom, type RunView } from \"@ragents/web/run-view\";\nimport { Alert, Badge } from \"@ragents/web/ui\";\nimport {\n pluginRoutePrefixFrom,\n type SessionContext,\n type SessionProviderProps,\n type ToolPresenterContext,\n type WebPlugin,\n type WebPluginDescriptor,\n type WorkspaceTabContext,\n} from \"@ragents/web/PluginRegistry\";\n\nexport const DOCUMENTS_PLUGIN_ID = \"ragents.documents\";\nexport const DOCUMENTS_TAB_ID = \"ragents.documents.library\";\n\nconst pathArgumentsFrom = (tool: ToolInfo): { title: string; path: string; format?: string } | undefined => {\n if (tool.name !== \"show_document\") return undefined;\n try {\n const args = JSON.parse(tool.arguments) as { title?: unknown; path?: unknown; content?: unknown; format?: unknown };\n if (typeof args.title !== \"string\" || typeof args.path !== \"string\" || typeof args.content === \"string\") return undefined;\n return { title: args.title, path: args.path, ...(typeof args.format === \"string\" ? { format: args.format } : {}) };\n } catch {\n return undefined;\n }\n};\n\nconst pathDocumentFrom = (tool: ToolInfo, routePrefix: string, runId: string): Document | undefined => {\n const args = pathArgumentsFrom(tool);\n if (!args) return undefined;\n const format = args.format === \"markdown\" || args.format === \"text\" || args.format === \"html\"\n ? args.format\n : formatFromName(args.path);\n return { id: tool.id, title: args.title, format, contentUrl: runFileContentUrl(routePrefix, runId, args.path) };\n};\n\nconst chatDocumentFrom = (tool: ToolInfo, routePrefix: string, runId: string): Document | undefined =>\n documentsFromMessages([{\n key: tool.id,\n role: \"tool\",\n text: tool.name,\n tool,\n }])[0] ?? pathDocumentFrom(tool, routePrefix, runId);\n\nconst pathDocumentsFromMessages = (\n messages: SessionContext[\"messages\"],\n routePrefix: string,\n runId: string,\n): Document[] =>\n messages.flatMap((message) => {\n const tool = message.tool;\n if (!tool) return [];\n const document = pathDocumentFrom(tool, routePrefix, runId);\n return document ? [document] : [];\n });\n\ninterface RunFilesState {\n listing: RunFilesListing | undefined;\n error: string | undefined;\n}\n\nconst RunFilesContext = createContext<RunFilesState | undefined>(undefined);\n\nconst useRunFilesContext = (): RunFilesState => {\n const state = useContext(RunFilesContext);\n if (!state) throw new Error(\"Dokumente-Plugin ist nicht aktiv\");\n return state;\n};\n\nconst useRunFiles = (session: SessionContext): RunFilesState => {\n const [listing, setListing] = useState<RunFilesListing>();\n const [error, setError] = useState<string>();\n const runId = session.session.id;\n\n useEffect(() => {\n let alive = true;\n const load = () => void fetchRunFiles(runId)\n .then((value) => {\n if (!alive) return;\n setListing(value);\n setError(undefined);\n })\n .catch((cause: unknown) => alive && setError(cause instanceof Error ? cause.message : String(cause)));\n load();\n if (!session.running) {\n return () => {\n alive = false;\n };\n }\n const timer = setInterval(load, 5000);\n return () => {\n alive = false;\n clearInterval(timer);\n };\n }, [runId, session.running]);\n\n return useMemo(() => ({ listing, error }), [listing, error]);\n};\n\nfunction DocumentsSessionProvider({ children, session }: SessionProviderProps) {\n const state = useRunFiles(session);\n return <RunFilesContext.Provider value={state}>{children}</RunFilesContext.Provider>;\n}\n\nconst resultSection = (runId: string, view: RunView): DocumentSection => {\n const handles = new Map(view.actors.map((actor) => [actor.id, actor.handle]));\n return {\n id: \"ergebnisse\",\n label: \"Ergebnisse\",\n kind: \"ergebnisse\",\n documents: view.artifacts.map((artifact) => {\n const handle = handles.get(artifact.createdBy);\n return {\n id: artifact.id,\n title: artifact.title,\n format: formatOf(artifact.mediaType),\n contentUrl: runArtifactContentUrl(runId, artifact.id),\n createdAt: artifact.createdAt,\n size: artifact.size,\n ...(handle ? { meta: `@${handle}` } : {}),\n };\n }),\n };\n};\n\nconst sectionsFrom = (\n routePrefix: string,\n session: SessionContext,\n listing: RunFilesListing | undefined,\n): { sections: DocumentSection[]; truncated: boolean } => {\n const runId = session.session.id;\n const view = runViewFrom(session.runView);\n const fileDocument = (directory: string | undefined, entry: RunFileEntry): Document => {\n const relative = directory ? `${directory}/${entry.path}` : entry.path;\n return {\n id: `file:${relative}`,\n title: entry.path,\n format: formatFromName(entry.path),\n contentUrl: `${runFileContentUrl(routePrefix, runId, relative)}&v=${encodeURIComponent(entry.modifiedAt)}`,\n createdAt: entry.modifiedAt,\n size: entry.size,\n };\n };\n\n const sections: DocumentSection[] = [\n ...(listing?.groups ?? []).map((group) => ({\n id: `ablage/${group.directory}`,\n label: group.directory,\n kind: \"ablage\" as const,\n documents: group.files.map((entry) => fileDocument(group.directory, entry)),\n })),\n ...(listing && listing.loose.length > 0\n ? [{\n id: \"ablage\",\n label: \"Ablage\",\n kind: \"ablage\" as const,\n documents: listing.loose.map((entry) => fileDocument(undefined, entry)),\n }]\n : []),\n ...(view && view.artifacts.length > 0 ? [resultSection(runId, view)] : []),\n ];\n const documentMessages = documentMessagesFrom(session.messages, session.actorConversations);\n const chat = [\n ...documentsFromMessages(documentMessages),\n ...pathDocumentsFromMessages(documentMessages, routePrefix, session.session.id),\n ];\n if (chat.length > 0) sections.push({ id: \"chat\", label: \"Im Chat gezeigt\", kind: \"chat\", documents: chat });\n return { sections, truncated: listing?.truncated ?? false };\n};\n\nconst contribution = (routePrefix: string) => {\n function DocumentsPanelContribution({ navigation, selection, session }: WorkspaceTabContext) {\n const { listing, error } = useRunFilesContext();\n const { sections, truncated } = useMemo(\n () => sectionsFrom(routePrefix, session, listing),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- session is rebuilt per render; only these parts matter\n [session.messages, session.actorConversations, session.runView, session.session.id, listing],\n );\n return (\n <>\n {error && (\n <Alert className=\"shrink-0 rounded-none border-x-0 border-t-0 border-b-border-soft bg-destructive/8 px-2.5 py-2 text-[0.68rem]\" variant=\"destructive\">\n {error}\n </Alert>\n )}\n <DocumentPanel\n activeId={typeof selection === \"string\" ? selection : undefined}\n sections={sections}\n truncated={truncated}\n onSelect={(id) => navigation.openTab(DOCUMENTS_TAB_ID, id ?? null)}\n />\n </>\n );\n }\n\n function DocumentsBadge({ session }: WorkspaceTabContext) {\n const { listing } = useRunFilesContext();\n const { sections } = useMemo(\n () => sectionsFrom(routePrefix, session, listing),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- session is rebuilt per render; only these parts matter\n [session.messages, session.actorConversations, session.runView, session.session.id, listing],\n );\n const count = sections.reduce((sum, section) => sum + section.documents.length, 0);\n return count > 0 ? <Badge className=\"tabular-nums\" variant=\"secondary\">{count}</Badge> : null;\n }\n\n return { DocumentsPanelContribution, DocumentsBadge };\n};\n\nfunction DocumentInline({ navigation, session, tool, routePrefix }: ToolPresenterContext & { routePrefix: string }) {\n const document = chatDocumentFrom(tool, routePrefix, session.session.id);\n if (!document) return null;\n const status = tool.isError ? \"error\" : tool.result === undefined ? \"running\" : \"ready\";\n return (\n <DocumentToolCall\n active={navigation.activeTabId === DOCUMENTS_TAB_ID && navigation.selectionFor(DOCUMENTS_TAB_ID) === document.id}\n document={document}\n onOpen={() => navigation.openTab(DOCUMENTS_TAB_ID, document.id)}\n status={status}\n />\n );\n}\n\nfunction IconDocument() {\n return (\n <svg aria-hidden fill=\"none\" height=\"15\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.7\" viewBox=\"0 0 24 24\" width=\"15\">\n <path d=\"M6 3h8l4 4v14H6zM14 3v5h4M9 13h6M9 17h4\" />\n </svg>\n );\n}\n\nconst configuredPlugin = (descriptor: WebPluginDescriptor, routePrefix: string): WebPlugin => {\n const { DocumentsPanelContribution, DocumentsBadge } = contribution(routePrefix);\n return {\n ...descriptor,\n needsRunView: true,\n SessionProvider: DocumentsSessionProvider,\n workspaceTabs: [{\n id: DOCUMENTS_TAB_ID,\n label: \"Dokumente\",\n order: 200,\n Icon: IconDocument,\n Panel: DocumentsPanelContribution,\n Badge: DocumentsBadge,\n }],\n toolPresenters: [{\n toolName: \"show_document\",\n Inline: (props) => <DocumentInline {...props} routePrefix={routePrefix} />,\n reveal: (tool, session) => chatDocumentFrom(tool, routePrefix, session.session.id)\n ? { tabId: DOCUMENTS_TAB_ID, selection: tool.id }\n : undefined,\n }],\n entityPresenters: [{\n reveal: (entity) => entity.type === \"artifact\"\n ? { tabId: DOCUMENTS_TAB_ID, selection: entity.id }\n : undefined,\n }],\n };\n};\n\nconst descriptor: WebPluginDescriptor = { id: DOCUMENTS_PLUGIN_ID };\n\nexport const webPlugin: WebPlugin = {\n ...descriptor,\n activate: (config) => configuredPlugin(descriptor, pluginRoutePrefixFrom(descriptor.id, config)),\n};\n"],
5
- "mappings": "AAAO,IAAMA,EAAO,CAACC,EAAWC,IAAS,CACvC,IAAMC,EAAS,WAAW,uBAA0BF,CAAS,EAC7D,GAAIE,IAAW,OAAW,MAAM,IAAI,MAAM,mBAAmBF,CAAS,eAAe,EACrF,GAAI,EAAEC,KAAQC,GAA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ACH,SAAWI,GAAWL,GAAiBC,GAAYK,GAAsBL,GAAW,GAAII,CAAM,CAAC,CACjG",
6
- "names": ["read", "specifier", "name", "module", "react_createContext_default", "read", "react_createElement_default", "read", "react_forwardRef_default", "read", "react_useCallback_default", "read", "react_useContext_default", "read", "react_useEffect_default", "read", "react_useMemo_default", "read", "react_useState_default", "read", "toKebabCase", "string", "toLucideIconData", "iconName", "iconNode", "aliases", "toKebabCase", "toCamelCase", "string", "out", "upperNext", "ch", "toPascalCase", "string", "camelCase", "toCamelCase", "mergeClasses", "classes", "className", "index", "array", "defaultAttributes", "isDefined", "value", "buildLucideIconNode", "icon", "params", "attributeNames", "getAttributeName", "attributeName", "viewBoxWidth", "defaultAttributes", "viewBoxHeight", "aliasClassNames", "alias", "iconClassNames", "classNamesFromClassName", "className", "mergeClasses", "calculatedStrokeWidth", "attrs", "attrName", "child", "name", "children", "nextAttrs", "buildLucideIconForReact", "icon", "params", "buildLucideIconNode", "hasA11yProp", "props", "prop", "LucideContext", "react_createContext_default", "useLucideContext", "react_useContext_default", "LucideContext", "Icon", "react_forwardRef_default", "color", "size", "width", "height", "strokeWidth", "absoluteStrokeWidth", "nonScalingStroke", "className", "children", "iconNode", "icon", "rest", "ref", "contextSize", "contextStrokeWidth", "contextAbsoluteStrokeWidth", "contextNonScalingStroke", "contextColor", "contextClass", "useLucideContext", "hasAccessibleProp", "hasA11yProp", "name", "svgAttributes", "builtIconNode", "buildLucideIconForReact", "mergeClasses", "react_createElement_default", "tag", "attrs", "createLucideIcon", "iconDataOrName", "iconNode", "aliases", "iconData", "toLucideIconData", "Component", "react_forwardRef_default", "className", "props", "ref", "react_createElement_default", "Icon", "toPascalCase", "__iconData", "ArrowLeft", "createLucideIcon", "__iconData", "X", "createLucideIcon", "ui_Alert_default", "read", "ui_Badge_default", "read", "ui_Button_default", "read", "ui_Dialog_default", "read", "ui_DialogContent_default", "read", "ui_DialogTitle_default", "read", "ui_Empty_default", "read", "ui_EmptyContent_default", "read", "ui_EmptyDescription_default", "read", "ui_EmptyHeader_default", "read", "ui_EmptyMedia_default", "read", "ui_EmptyTitle_default", "read", "ui_Spinner_default", "read", "quassel_Markdown_default", "read", "format_formatBytes_default", "read", "SourceCode_SourceCode_default", "read", "jsx_runtime_Fragment_default", "read", "jsx_runtime_jsx_default", "read", "jsx_runtime_jsxs_default", "read", "copyClass", "titleClass", "metaClass", "sourceClass", "groupBadgeClass", "formatLabels", "formatByExtension", "formatFromName", "name", "dot", "formatOf", "mediaType", "formatTime", "iso", "date", "documentMessagesFrom", "messages", "conversations", "message", "documentsFrom", "tool", "args", "format", "useDocumentContent", "document", "cache", "setCache", "react_useState_default", "textual", "url", "react_useEffect_default", "alive", "response", "text", "current", "error", "DocumentToolCall", "active", "onOpen", "status", "lineCount", "react_useMemo_default", "statusLabel", "jsx_runtime_jsxs_default", "jsx_runtime_jsx_default", "IconDocument", "ui_Spinner_default", "IconError", "IconOpen", "DocumentContent", "stand", "ui_Empty_default", "ui_EmptyHeader_default", "ui_EmptyMedia_default", "ui_EmptyTitle_default", "ui_EmptyContent_default", "ui_Button_default", "ui_EmptyDescription_default", "SourceCode_SourceCode_default", "quassel_Markdown_default", "DocumentHead", "meta", "format_formatBytes_default", "jsx_runtime_Fragment_default", "DocumentModal", "onClose", "ui_Dialog_default", "open", "ui_DialogContent_default", "ui_DialogTitle_default", "X", "DocumentPanel", "activeId", "sections", "truncated", "onSelect", "section", "modalOpen", "setModalOpen", "collapsed", "setCollapsed", "toggle", "react_useCallback_default", "id", "next", "ArrowLeft", "offen", "IconChevron", "IconResult", "IconChat", "ui_Badge_default", "size", "rpc_rpc_default", "read", "typebox_Type_default", "read", "contract_defineOperation_default", "read", "fileEntry", "typebox_Type_default", "filesListing", "documentsContracts", "contract_defineOperation_default", "runFileContentUrl", "routePrefix", "runId", "filePath", "fetchRunFiles", "rpc_rpc_default", "documentsContracts", "run_view_runArtifactContentUrl_default", "read", "run_view_runViewFrom_default", "read", "PluginRegistry_pluginRoutePrefixFrom_default", "read", "DOCUMENTS_PLUGIN_ID", "DOCUMENTS_TAB_ID", "pathArgumentsFrom", "tool", "args", "pathDocumentFrom", "routePrefix", "runId", "format", "formatFromName", "runFileContentUrl", "chatDocumentFrom", "documentsFrom", "pathDocumentsFromMessages", "messages", "message", "document", "RunFilesContext", "react_createContext_default", "useRunFilesContext", "state", "react_useContext_default", "useRunFiles", "session", "listing", "setListing", "react_useState_default", "error", "setError", "react_useEffect_default", "alive", "load", "fetchRunFiles", "value", "cause", "timer", "react_useMemo_default", "DocumentsSessionProvider", "children", "jsx_runtime_jsx_default", "resultSection", "view", "handles", "actor", "artifact", "handle", "formatOf", "run_view_runArtifactContentUrl_default", "sectionsFrom", "run_view_runViewFrom_default", "fileDocument", "directory", "entry", "relative", "sections", "group", "documentMessages", "documentMessagesFrom", "chat", "contribution", "DocumentsPanelContribution", "navigation", "selection", "truncated", "jsx_runtime_jsxs_default", "jsx_runtime_Fragment_default", "ui_Alert_default", "DocumentPanel", "id", "DocumentsBadge", "count", "sum", "section", "ui_Badge_default", "DocumentInline", "status", "DocumentToolCall", "IconDocument", "configuredPlugin", "descriptor", "props", "entity", "webPlugin", "config", "PluginRegistry_pluginRoutePrefixFrom_default"]
4
+ "sourcesContent": ["export const read = (specifier, name) => {\n const module = globalThis[\"__ragentsHostModules\"]?.[specifier];\n if (module === undefined) throw new Error(`The host does not provide ${specifier}`);\n if (!(name in module)) throw new Error(`The host does not provide ${name} from ${specifier}; the bundle was built against a newer host`);\n return module[name];\n};", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createElement\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"forwardRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useCallback\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useMemo\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useState\");\n", "/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string?.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n", "import { toKebabCase } from './toKebabCase';\nimport type { LucideIconData, LucideIconNode } from '../build/types';\n\n/**\n * Converts legacy `(name, iconNode, aliases?)` icon arguments into icon data object format.\n */\nexport function toLucideIconData(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases: string[] = [],\n): LucideIconData {\n if (iconNode == null) {\n throw new Error('[lucide]: iconNode is required when icon name is used');\n }\n\n return {\n name: toKebabCase(iconName),\n size: 24,\n node: iconNode,\n ...(aliases.length > 0 ? { aliases } : {}),\n };\n}\n", "/**\n * Converts string to camel case\n *\n * @param {string} string\n * @returns {string} A camelized string\n */\nexport const toCamelCase = <T extends string>(string: T) => {\n let out = '';\n let upperNext = false;\n\n for (const ch of string) {\n if (ch === '-' || ch === '_' || ch <= ' ') {\n upperNext = out.length > 0;\n continue;\n }\n\n if (out.length === 0) {\n out += ch.toLowerCase();\n } else {\n out += upperNext ? ch.toUpperCase() : ch;\n }\n\n upperNext = false;\n }\n\n return out as string;\n};\n", "import { CamelToPascal } from '../utility-types';\nimport { toCamelCase } from './toCamelCase';\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = toCamelCase(string);\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n", "/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return (\n Boolean(className) &&\n (className as string).trim() !== '' &&\n array.indexOf(className) === index\n );\n })\n .join(' ')\n .trim();\n", "const defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n} as const;\n\nexport default defaultAttributes;\n", "import type { LucideBuildParams, LucideIconData, LucideIconNode, SVGProps } from './types';\nimport defaultAttributes from './defaultAttributes';\nimport { mergeClasses } from '../utils/mergeClasses';\n\nfunction isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Creates a Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconNode(icon: LucideIconData, params: LucideBuildParams = {}): LucideIconNode {\n const attributeNames = params.attributeNames ?? {};\n const getAttributeName = (attributeName: string) =>\n attributeNames[attributeName] ?? attributeName;\n\n const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes['width'];\n const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes['height'];\n const aliasClassNames =\n icon.aliases\n ?.filter((alias: string): alias is string => typeof alias === 'string' && alias.trim() !== '')\n .map((alias: string) => `lucide-${alias}`) ?? [];\n const iconClassNames = [...(icon.name ? [`lucide-${icon.name}`] : []), ...aliasClassNames];\n const classNamesFromClassName = params.className?.split(' ').filter(Boolean) ?? [];\n const className =\n params.includeDefaultClasses === false\n ? mergeClasses(...classNamesFromClassName)\n : mergeClasses('lucide', ...iconClassNames, ...classNamesFromClassName);\n\n const calculatedStrokeWidth = params.absoluteStrokeWidth\n ? (Number(params.strokeWidth ?? defaultAttributes['stroke-width']) *\n Number(icon.size ?? icon.width ?? defaultAttributes['width'])) /\n Number(params.size ?? params.width ?? defaultAttributes['width'])\n : (params.strokeWidth ?? defaultAttributes['stroke-width']);\n\n const attributes = {\n ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {\n attrs[getAttributeName(attrName)] = value;\n return attrs;\n }, {} as SVGProps),\n ...('color' in params &&\n params.color && {\n [getAttributeName('stroke')]: params.color,\n }),\n ...('size' in params &&\n isDefined(params.size) && {\n [getAttributeName('width')]: params.size,\n [getAttributeName('height')]: params.size,\n }),\n ...('width' in params &&\n isDefined(params.width) && {\n [getAttributeName('width')]: params.width,\n }),\n ...('height' in params &&\n isDefined(params.height) && {\n [getAttributeName('height')]: params.height,\n }),\n [getAttributeName('stroke-width')]: calculatedStrokeWidth,\n ...(className && {\n [getAttributeName('class')]: className,\n }),\n [getAttributeName('viewBox')]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,\n ...(params.hasA11yProp === false\n ? {\n [getAttributeName('aria-hidden')]: 'true',\n }\n : {}),\n ...('attributes' in params && params.attributes),\n };\n\n return [\n 'svg',\n attributes,\n icon.node.map((child): LucideIconNode => {\n const [name, attrs, children] = child;\n const nextAttrs = params.nonScalingStroke\n ? { [getAttributeName('vector-effect')]: 'non-scaling-stroke', ...attrs }\n : attrs;\n\n return children ? [name, nextAttrs, children] : [name, nextAttrs];\n }),\n ];\n}\n\nexport default buildLucideIconNode;\n", "import buildLucideIconNode from './buildLucideIconNode';\nimport type { LucideBuildParams, LucideIconData, LucideIconNode } from './types';\n\n/**\n * Creates a React-compatible Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconForReact(\n icon: LucideIconData,\n params: LucideBuildParams = {},\n): LucideIconNode {\n return buildLucideIconNode(icon, {\n ...params,\n attributeNames: {\n ...params.attributeNames,\n class: 'className',\n 'stroke-width': 'strokeWidth',\n 'stroke-linecap': 'strokeLinecap',\n 'stroke-linejoin': 'strokeLinejoin',\n 'vector-effect': 'vectorEffect',\n },\n });\n}\n\nexport default buildLucideIconForReact;\n", "/**\n * Check if a component has an accessibility prop\n *\n * @param {object} props\n * @returns {boolean} Whether the component has an accessibility prop\n */\nexport const hasA11yProp = (props: object) => {\n for (const prop in props) {\n if (prop.startsWith('aria-') || prop === 'role' || prop === 'title') {\n return true;\n }\n }\n\n return false;\n};\n", "'use client';\n\nimport { createContext, createElement, type ReactNode, useContext, useMemo } from 'react';\nimport { LucideProps } from './types';\n\ntype LucideConfig = {\n size: number;\n color: string;\n strokeWidth: number;\n /**\n * @deprecated Use `nonScalingStroke` instead.\n */\n absoluteStrokeWidth: boolean;\n nonScalingStroke: boolean;\n className: string;\n};\n\nconst LucideContext = createContext<LucideProps>({});\n\ntype LucideProviderProps = {\n children: ReactNode;\n} & Partial<LucideConfig>;\n\nexport function LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n}: LucideProviderProps) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className],\n );\n\n return createElement(LucideContext.Provider, { value }, children);\n}\n\nexport const useLucideContext = () => useContext(LucideContext);\n", "'use client';\n\nimport { createElement, forwardRef } from 'react';\nimport { buildLucideIconForReact, hasA11yProp, mergeClasses } from '@lucide/shared';\nimport { LucideIconData, LucideIconNode, LucideProps } from './types';\nimport { useLucideContext } from './context';\n\ntype IconComponentProps = LucideProps &\n (\n | {\n iconNode: LucideIconNode[];\n icon?: never;\n }\n | {\n icon: LucideIconData;\n iconNode?: never;\n }\n );\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {boolean} props.nonScalingStroke - Whether to use non scaling strokes\n * @param {string} props.className - The class name of the icon\n * @param {LucideIconNode[]} props.children - The children of the icon\n * @param {LucideIconNode[]} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color,\n size,\n width,\n height,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className = '',\n children,\n iconNode = [],\n icon = {\n node: iconNode,\n aliases: [],\n size: 24,\n },\n ...rest\n },\n ref,\n ) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n nonScalingStroke: contextNonScalingStroke = false,\n color: contextColor = 'currentColor',\n className: contextClass = '',\n } = useLucideContext() ?? {};\n\n const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);\n\n const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {\n color: color ?? contextColor,\n width: width ?? size ?? contextSize,\n height: height ?? size ?? contextSize,\n strokeWidth: strokeWidth ?? contextStrokeWidth,\n absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,\n nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,\n className: mergeClasses(contextClass, className),\n hasA11yProp: hasAccessibleProp,\n attributes: rest,\n });\n\n return createElement(\n name,\n {\n ref,\n ...svgAttributes,\n },\n [\n ...builtIconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n", "import { createElement, forwardRef } from 'react';\nimport { toLucideIconData, toPascalCase } from '@lucide/shared';\nimport { LucideIcon, LucideIconData, LucideIconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Creates a Lucide icon component from icon data.\n *\n * @param icon Icon data object.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(icon: LucideIconData): LucideIcon;\n\n/**\n * Creates a Lucide icon component from the legacy icon arguments.\n *\n * @param iconName Icon name.\n * @param iconNode Icon node.\n * @param aliases Optional icon aliases.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases?: string[],\n): LucideIcon;\n\nfunction createLucideIcon(\n iconDataOrName: LucideIconData | string,\n iconNode: LucideIconNode[] = [],\n aliases: string[] = [],\n): LucideIcon {\n const iconData =\n typeof iconDataOrName === 'string'\n ? toLucideIconData(iconDataOrName, iconNode, aliases)\n : iconDataOrName;\n\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n icon: iconData,\n className,\n ...props,\n }),\n );\n\n if (iconData.name) {\n Component.displayName = toPascalCase(iconData.name);\n }\n\n return Component;\n}\n\nexport default createLucideIcon;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'arrow-left',\n size: 24,\n node: [\n ['path', { d: 'm12 19-7-7 7-7', key: '1l729n' }],\n ['path', { d: 'M19 12H5', key: 'x3x0zl' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name ArrowLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTIgMTktNy03IDctNyIgLz4KICA8cGF0aCBkPSJNMTkgMTJINSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowLeft = createLucideIcon(__iconData);\n\nexport default ArrowLeft;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'x',\n size: 24,\n node: [\n ['path', { d: 'M18 6 6 18', key: '1bl5f8' }],\n ['path', { d: 'm6 6 12 12', key: 'd8bk6v' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst X = createLucideIcon(__iconData);\n\nexport default X;\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Alert\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Badge\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Button\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Dialog\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Empty\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyDescription\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyHeader\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyMedia\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Spinner\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"quassel\", \"Markdown\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/lib/format\", \"formatBytes\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/SourceCode\", \"SourceCode\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"Fragment\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsx\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsxs\");\n", "import { ArrowLeftIcon, XIcon } from \"lucide-react\";\nimport {\n Badge,\n Button,\n Dialog,\n DialogContent,\n DialogTitle,\n Empty,\n EmptyContent,\n EmptyDescription,\n EmptyHeader,\n EmptyMedia,\n EmptyTitle,\n Spinner,\n} from \"@ragents/web/ui\";\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { Markdown, type Message } from \"quassel\";\nimport { formatBytes } from \"@ragents/web/lib/format\";\nimport { SourceCode } from \"@ragents/web/SourceCode\";\n\nexport type DocumentFormat = \"markdown\" | \"text\" | \"html\" | \"image\" | \"binary\";\n\nconst copyClass = \"grid min-w-0 gap-px\";\nconst titleClass = \"truncate text-[0.82rem] font-semibold\";\nconst metaClass = \"text-[0.68rem] text-muted-foreground tabular-nums\";\nconst sourceClass = \"min-w-0 p-0 text-[12px] whitespace-pre-wrap break-words\";\nconst groupBadgeClass = \"flex size-7 items-center justify-center rounded-[9px] text-[0.62rem] font-bold tracking-[0.02em]\";\n\nexport interface RunDocument {\n id: string;\n title: string;\n format: DocumentFormat;\n content?: string;\n contentUrl?: string;\n createdAt?: string;\n size?: number;\n meta?: string;\n}\n\nexport interface DocumentSection {\n id: string;\n label: string;\n kind: \"store\" | \"results\" | \"chat\";\n documents: RunDocument[];\n}\n\nconst formatLabels: Record<DocumentFormat, string> = {\n markdown: \"Markdown\",\n text: \"Text\",\n html: \"HTML\",\n image: \"Image\",\n binary: \"File\",\n};\n\nconst formatByExtension: Record<string, DocumentFormat> = {\n \".md\": \"markdown\",\n \".markdown\": \"markdown\",\n \".html\": \"html\",\n \".htm\": \"html\",\n \".png\": \"image\",\n \".jpg\": \"image\",\n \".jpeg\": \"image\",\n \".gif\": \"image\",\n \".svg\": \"image\",\n \".webp\": \"image\",\n \".pdf\": \"binary\",\n \".zip\": \"binary\",\n \".gz\": \"binary\",\n \".tar\": \"binary\",\n \".xlsx\": \"binary\",\n \".docx\": \"binary\",\n \".bin\": \"binary\",\n};\n\nexport const formatFromName = (name: string): DocumentFormat => {\n const dot = name.lastIndexOf(\".\");\n return dot < 0 ? \"text\" : formatByExtension[name.slice(dot).toLowerCase()] ?? \"text\";\n};\n\nexport const formatOf = (mediaType: string): DocumentFormat =>\n mediaType.includes(\"html\")\n ? \"html\"\n : mediaType.includes(\"markdown\")\n ? \"markdown\"\n : mediaType.startsWith(\"image/\")\n ? \"image\"\n : mediaType.startsWith(\"text/\") || mediaType.includes(\"json\") || mediaType.includes(\"xml\")\n ? \"text\"\n : \"binary\";\n\nconst formatTime = (iso: string) => {\n const date = new Date(iso);\n return Number.isNaN(date.getTime())\n ? iso\n : date.toLocaleString(\"en-US\", { day: \"2-digit\", month: \"2-digit\", hour: \"2-digit\", minute: \"2-digit\" });\n};\n\nexport const documentMessagesFrom = (\n messages: readonly Message[],\n conversations: Readonly<Record<string, readonly Message[]>> = {},\n): Message[] => [...new Map([...Object.values(conversations).flat(), ...messages]\n .filter((message) => message.tool?.name === \"show_document\")\n .map((message) => [message.tool!.id, message])).values()];\n\nexport const documentsFrom = (messages: Message[]): RunDocument[] =>\n messages.flatMap((message) => {\n const tool = message.tool;\n if (tool?.name !== \"show_document\") return [];\n try {\n const args = JSON.parse(tool.arguments) as { title?: unknown; content?: unknown; format?: unknown };\n if (typeof args.title !== \"string\" || typeof args.content !== \"string\") return [];\n const format = args.format === \"text\" || args.format === \"html\" ? args.format : \"markdown\";\n return [{ id: tool.id, title: args.title, content: args.content, format }];\n } catch {\n return [];\n }\n });\n\ntype LoadState = { text: string } | { error: string } | undefined;\n\nconst useDocumentContent = (document: RunDocument | undefined): LoadState => {\n const [cache, setCache] = useState<Record<string, LoadState>>({});\n const textual = document?.format === \"markdown\" || document?.format === \"text\" || document?.format === \"html\";\n const url = document?.content === undefined && textual ? document?.contentUrl : undefined;\n\n useEffect(() => {\n if (!url || cache[url]) return;\n let alive = true;\n void fetch(url, { cache: \"no-store\" })\n .then(async (response) => {\n if (!response.ok) throw new Error(`Status ${response.status}`);\n return response.text();\n })\n .then((text) => alive && setCache((current) => ({ ...current, [url]: { text } })))\n .catch((error: unknown) => alive && setCache((current) => ({\n ...current,\n [url]: { error: error instanceof Error ? error.message : String(error) },\n })));\n return () => {\n alive = false;\n };\n }, [url, cache]);\n\n if (!document) return undefined;\n if (document.content !== undefined) return { text: document.content };\n if (!textual) return { text: \"\" };\n return url ? cache[url] : undefined;\n};\n\ninterface DocumentToolCallProps {\n active: boolean;\n document: RunDocument;\n onOpen: () => void;\n status: \"error\" | \"ready\" | \"running\";\n}\n\nexport function DocumentToolCall({ active, document, onOpen, status }: DocumentToolCallProps) {\n const lineCount = useMemo(\n () => !document.content ? 0 : document.content.split(/\\r\\n|\\r|\\n/).length,\n [document.content],\n );\n const statusLabel = status === \"error\"\n ? \"Error\"\n : status === \"running\"\n ? \"Opening\"\n : active\n ? \"Opened\"\n : \"Open\";\n\n return (\n <button\n aria-pressed={active}\n className=\"group/call grid w-[min(100%,620px)] grid-cols-[42px_minmax(0,1fr)_auto] items-center gap-3 rounded-xl border border-border bg-[color-mix(in_srgb,var(--background)_95%,var(--primary))] px-3.5 py-3 text-left shadow-sm transition-[background-color,border-color,box-shadow,transform] duration-100 hover:-translate-y-px hover:border-primary/50 hover:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] hover:shadow-md focus-visible:border-primary/50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/55 aria-pressed:border-primary/50 aria-pressed:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] data-[status=error]:border-destructive/45 max-[620px]:grid-cols-[38px_minmax(0,1fr)_auto] max-[620px]:gap-2.5 max-[620px]:px-2.5 max-[620px]:py-2.5\"\n data-status={status}\n onClick={onOpen}\n type=\"button\"\n >\n <span className=\"flex h-12 w-[42px] items-center justify-center rounded-lg border border-primary/25 bg-primary/12 text-primary group-data-[status=error]/call:text-destructive max-[620px]:h-11 max-[620px]:w-[38px]\">\n <IconDocument size={22} />\n </span>\n <span className=\"flex min-w-0 flex-col gap-0.5\">\n <span className=\"text-[0.62rem] font-semibold tracking-[0.05em] text-primary uppercase\">Document</span>\n <strong className=\"truncate text-[0.84rem] leading-[1.35]\" title={document.title}>{document.title}</strong>\n <span className=\"text-[0.7rem] leading-[1.35] text-muted-foreground\">\n {formatLabels[document.format]}, {lineCount.toLocaleString(\"en-US\")} {lineCount === 1 ? \"line\" : \"lines\"}\n </span>\n </span>\n <span className=\"flex items-center gap-1 text-[0.7rem] font-semibold text-primary group-data-[status=error]/call:text-destructive\">\n <span className=\"max-[620px]:sr-only\">{statusLabel}</span>\n {status === \"running\" ? <Spinner className=\"size-3\" /> : status === \"error\" ? <IconError /> : <IconOpen />}\n </span>\n </button>\n );\n}\n\nfunction DocumentContent({ document, loaded }: { document: RunDocument; loaded: LoadState }) {\n if (document.format === \"image\" && document.contentUrl) {\n return <img alt={document.title} className=\"block max-w-full rounded-lg border border-border\" src={document.contentUrl} />;\n }\n if (document.format === \"binary\" && document.contentUrl) {\n return (\n <Empty className=\"min-h-30 gap-2 p-7\">\n <EmptyHeader>\n <EmptyMedia><IconDocument /></EmptyMedia>\n <EmptyTitle>No preview for this format</EmptyTitle>\n </EmptyHeader>\n <EmptyContent>\n <Button render={<a download={document.title} href={document.contentUrl} />} size=\"sm\" variant=\"outline\">Download</Button>\n </EmptyContent>\n </Empty>\n );\n }\n if (!loaded) {\n return (\n <div className=\"flex items-center justify-center gap-2.5 p-9 text-[0.76rem] text-muted-foreground\">\n <Spinner className=\"size-3\" />\n <span>Loading</span>\n </div>\n );\n }\n if (\"error\" in loaded) {\n return (\n <Empty className=\"min-h-30 gap-2 p-7\">\n <EmptyHeader>\n <EmptyMedia><IconError /></EmptyMedia>\n <EmptyTitle>Content not readable</EmptyTitle>\n <EmptyDescription>{loaded.error}</EmptyDescription>\n </EmptyHeader>\n </Empty>\n );\n }\n if (document.format === \"html\") {\n return <iframe className=\"h-full min-h-full w-full border-0 bg-white\" sandbox=\"\" srcDoc={loaded.text} title={document.title} />;\n }\n if (document.format === \"text\") {\n return <SourceCode className={sourceClass} content={loaded.text} path={document.title} />;\n }\n return <Markdown text={loaded.text} />;\n}\n\nfunction DocumentHead({ document }: { document: RunDocument }) {\n const meta = [\n formatLabels[document.format],\n document.size !== undefined ? formatBytes(document.size) : undefined,\n document.createdAt ? formatTime(document.createdAt) : undefined,\n document.meta,\n ].filter(Boolean);\n\n return (\n <>\n <strong className={titleClass} title={document.title}>{document.title}</strong>\n <span className={metaClass}>{meta.join(\" \u00B7 \")}</span>\n </>\n );\n}\n\ninterface DocumentModalProps {\n document: RunDocument;\n onClose: () => void;\n}\n\nexport function DocumentModal({ document, onClose }: DocumentModalProps) {\n const loaded = useDocumentContent(document);\n\n return (\n <Dialog open onOpenChange={(open) => { if (!open) onClose(); }}>\n <DialogContent className=\"w-[min(1080px,calc(100%-2*clamp(16px,5vw,72px)))] gap-0 rounded-panel border border-border bg-card p-0 shadow-pop\" scope=\"run\" showCloseButton={false} size=\"full\">\n <header className=\"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-b border-border px-3.5 py-3\">\n <span className=\"flex size-8 items-center justify-center rounded-[10px] bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary\"><IconDocument size={20} /></span>\n <DialogTitle className={copyClass} render={<span />}>\n <DocumentHead document={document} />\n </DialogTitle>\n <Button aria-label=\"Close\" className=\"rounded-full\" onClick={onClose} size=\"icon\" title=\"Close\" variant=\"outline\">\n <XIcon />\n </Button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-[clamp(18px,4vw,54px)] pt-5 pb-10 text-[13.5px] leading-[1.65]\">\n <DocumentContent document={document} loaded={loaded} />\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n\ninterface DocumentPanelProps {\n activeId: string | undefined;\n sections: DocumentSection[];\n truncated: boolean;\n onSelect: (id: string | undefined) => void;\n}\n\nexport function DocumentPanel({ activeId, sections, truncated, onSelect }: DocumentPanelProps) {\n const active = sections.flatMap((section) => section.documents).find((document) => document.id === activeId);\n const loaded = useDocumentContent(active);\n const [modalOpen, setModalOpen] = useState(false);\n const [collapsed, setCollapsed] = useState<Set<string>>(() => new Set());\n\n const toggle = useCallback((id: string) => {\n setCollapsed((current) => {\n const next = new Set(current);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n }, []);\n\n useEffect(() => {\n if (!active) setModalOpen(false);\n }, [active]);\n\n if (sections.every((section) => section.documents.length === 0)) {\n return (\n <Empty className=\"h-full gap-2 p-7\">\n <EmptyHeader>\n <EmptyMedia><IconDocument /></EmptyMedia>\n <EmptyTitle>No documents yet</EmptyTitle>\n <EmptyDescription>Files from the run's store, results, and documents shown in chat collect here.</EmptyDescription>\n </EmptyHeader>\n </Empty>\n );\n }\n\n if (!active) {\n return (\n <div className=\"flex h-full flex-col gap-3.5 overflow-y-auto px-workspace-inset pt-2.5 pb-4.5 [scrollbar-width:thin]\">\n {sections.filter((section) => section.documents.length > 0).map((section) => {\n const open = !collapsed.has(section.id);\n return (\n <section key={section.id}>\n <button\n aria-expanded={open}\n className=\"grid w-full grid-cols-[14px_26px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg px-2 py-2 text-left hover:bg-primary/7\"\n onClick={() => toggle(section.id)}\n type=\"button\"\n >\n <span aria-hidden className={`flex text-muted-foreground transition-transform duration-150${open ? \" rotate-90\" : \"\"}`}>\n <IconChevron />\n </span>\n {section.kind === \"store\" && <span aria-hidden className={`${groupBadgeClass} bg-[color-mix(in_srgb,var(--foreground)_8%,var(--background))] text-[0.85rem] text-foreground`}>#</span>}\n {section.kind === \"results\" && <span aria-hidden className={`${groupBadgeClass} bg-[color-mix(in_srgb,var(--primary)_16%,var(--background))] text-primary`}><IconResult /></span>}\n {section.kind === \"chat\" && <span aria-hidden className={`${groupBadgeClass} bg-[color-mix(in_srgb,var(--foreground)_9%,var(--background))] text-muted-foreground`}><IconChat /></span>}\n <span className=\"truncate text-sm font-semibold\" title={section.label}>{section.label}</span>\n <Badge className=\"tabular-nums\" variant=\"secondary\">{section.documents.length}</Badge>\n </button>\n {open && (\n <div className=\"ml-[23px] border-l border-border-soft pl-2.5\">\n <ul className=\"mt-0.5 list-none\">\n {section.documents.map((document) => (\n <li key={document.id}>\n <button\n className=\"group/entry mt-1.5 grid w-full grid-cols-[24px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg border border-border bg-card px-2.5 py-2.5 text-left transition-colors duration-100 hover:border-primary/55 hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]\"\n onClick={() => onSelect(document.id)}\n type=\"button\"\n >\n <span className=\"flex text-primary\"><IconDocument size={18} /></span>\n <span className=\"grid min-w-0 gap-0.5\">\n <strong className=\"truncate text-[0.79rem] font-semibold\" title={document.title}>{document.title}</strong>\n <small className={metaClass}>\n {[\n formatLabels[document.format],\n document.size !== undefined ? formatBytes(document.size) : undefined,\n document.createdAt ? formatTime(document.createdAt) : undefined,\n document.meta,\n ].filter(Boolean).join(\" \u00B7 \")}\n </small>\n </span>\n <span aria-hidden className=\"flex text-muted-foreground opacity-0 transition-opacity duration-100 group-hover/entry:opacity-100\"><IconOpen /></span>\n </button>\n </li>\n ))}\n </ul>\n </div>\n )}\n </section>\n );\n })}\n {truncated && <p className=\"text-[0.72rem] text-muted-foreground\">The store contains more files than are shown here.</p>}\n </div>\n );\n }\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n <header className=\"grid shrink-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border-soft px-workspace-inset py-2.5\">\n <Button aria-label=\"Back to overview\" onClick={() => onSelect(undefined)} size=\"icon-sm\" title=\"Back to overview\" variant=\"outline\">\n <ArrowLeftIcon />\n </Button>\n <span className={copyClass}>\n <DocumentHead document={active} />\n </span>\n <Button onClick={() => setModalOpen(true)} size=\"sm\" variant=\"outline\">Large</Button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-workspace-inset py-4 text-[13px] leading-[1.6]\">\n <DocumentContent document={active} loaded={loaded} />\n </div>\n {modalOpen && <DocumentModal document={active} onClose={() => setModalOpen(false)} />}\n </div>\n );\n}\n\nfunction IconDocument({ size = 28 }: { size?: number }) {\n return (\n <svg aria-hidden fill=\"none\" height={size} stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\" viewBox=\"0 0 24 24\" width={size}>\n <path d=\"M6 3h8l4 4v14H6z\" />\n <path d=\"M14 3v5h4M9 13h6M9 17h4\" />\n </svg>\n );\n}\n\nfunction IconOpen() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\nfunction IconChevron() {\n return (\n <svg aria-hidden fill=\"none\" height=\"12\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" viewBox=\"0 0 24 24\" width=\"12\">\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\nfunction IconChat() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.4A8 8 0 1 1 21 12z\" />\n </svg>\n );\n}\n\nfunction IconResult() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nfunction IconError() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 7v6M12 17h.01\" />\n </svg>\n );\n}\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/rpc\", \"rpc\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"typebox\", \"Type\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/rpc/contract\", \"defineOperation\");\n", "import { Type, type Static } from \"typebox\";\nimport { defineOperation } from \"@ragents/engine/src/rpc/contract\";\n\nexport const documentsApiPrefix = \"/api/plugins/ragents.documents\";\n\nconst fileEntry = Type.Object({\n path: Type.String({ minLength: 1 }),\n size: Type.Integer({ minimum: 0 }),\n modifiedAt: Type.String({ minLength: 1 }),\n}, { additionalProperties: false });\n\nconst filesListing = Type.Object({\n groups: Type.Array(Type.Object({\n directory: Type.String({ minLength: 1 }),\n files: Type.Array(fileEntry),\n }, { additionalProperties: false })),\n loose: Type.Array(fileEntry),\n truncated: Type.Boolean(),\n}, { additionalProperties: false });\n\nexport type RunFileEntry = Static<typeof fileEntry>;\n\nexport type RunFilesListing = Static<typeof filesListing>;\n\nexport const documentsContracts = {\n files: defineOperation({\n id: \"ragents.documents.files\",\n description: \"A run's file store as groups and loose files. Right: runs.read.\",\n rights: [\"runs.read\"],\n input: Type.Object({\n runId: Type.String({ minLength: 1, maxLength: 64, description: \"Run id\" }),\n }, { additionalProperties: false }),\n result: filesListing,\n }),\n};\n", "import { rpc } from \"@ragents/web/rpc\";\nimport { documentsContracts, type RunFilesListing } from \"../contract\";\n\nexport const runFileContentUrl = (routePrefix: string, runId: string, filePath: string): string =>\n `${routePrefix}/runs/${encodeURIComponent(runId)}/files/content?path=${encodeURIComponent(filePath)}`;\n\nexport const fetchRunFiles = (runId: string): Promise<RunFilesListing> =>\n rpc.call(documentsContracts.files, { runId });\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runArtifactContentUrl\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runViewFrom\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/PluginRegistry\", \"pluginRoutePrefixFrom\");\n", "import { createContext, useContext, useEffect, useMemo, useState } from \"react\";\nimport type { ToolInfo } from \"quassel/events\";\nimport {\n DocumentPanel,\n DocumentToolCall,\n documentMessagesFrom,\n documentsFrom as documentsFromMessages,\n formatFromName,\n formatOf,\n type RunDocument as Document,\n type DocumentSection,\n} from \"./DocumentViewer\";\nimport { fetchRunFiles, runFileContentUrl } from \"./api\";\nimport type { RunFileEntry, RunFilesListing } from \"../contract\";\nimport { runArtifactContentUrl, runViewFrom, type RunView } from \"@ragents/web/run-view\";\nimport { Alert, Badge } from \"@ragents/web/ui\";\nimport {\n pluginRoutePrefixFrom,\n type SessionContext,\n type SessionProviderProps,\n type ToolPresenterContext,\n type WebPlugin,\n type WebPluginDescriptor,\n type WorkspaceTabContext,\n} from \"@ragents/web/PluginRegistry\";\n\nexport const DOCUMENTS_PLUGIN_ID = \"ragents.documents\";\nexport const DOCUMENTS_TAB_ID = \"ragents.documents.library\";\n\nconst pathArgumentsFrom = (tool: ToolInfo): { title: string; path: string; format?: string } | undefined => {\n if (tool.name !== \"show_document\") return undefined;\n try {\n const args = JSON.parse(tool.arguments) as { title?: unknown; path?: unknown; content?: unknown; format?: unknown };\n if (typeof args.title !== \"string\" || typeof args.path !== \"string\" || typeof args.content === \"string\") return undefined;\n return { title: args.title, path: args.path, ...(typeof args.format === \"string\" ? { format: args.format } : {}) };\n } catch {\n return undefined;\n }\n};\n\nconst pathDocumentFrom = (tool: ToolInfo, routePrefix: string, runId: string): Document | undefined => {\n const args = pathArgumentsFrom(tool);\n if (!args) return undefined;\n const format = args.format === \"markdown\" || args.format === \"text\" || args.format === \"html\"\n ? args.format\n : formatFromName(args.path);\n return { id: tool.id, title: args.title, format, contentUrl: runFileContentUrl(routePrefix, runId, args.path) };\n};\n\nconst chatDocumentFrom = (tool: ToolInfo, routePrefix: string, runId: string): Document | undefined =>\n documentsFromMessages([{\n key: tool.id,\n role: \"tool\",\n text: tool.name,\n tool,\n }])[0] ?? pathDocumentFrom(tool, routePrefix, runId);\n\nconst pathDocumentsFromMessages = (\n messages: SessionContext[\"messages\"],\n routePrefix: string,\n runId: string,\n): Document[] =>\n messages.flatMap((message) => {\n const tool = message.tool;\n if (!tool) return [];\n const document = pathDocumentFrom(tool, routePrefix, runId);\n return document ? [document] : [];\n });\n\ninterface RunFilesState {\n listing: RunFilesListing | undefined;\n error: string | undefined;\n}\n\nconst RunFilesContext = createContext<RunFilesState | undefined>(undefined);\n\nconst useRunFilesContext = (): RunFilesState => {\n const state = useContext(RunFilesContext);\n if (!state) throw new Error(\"Documents plugin is not active\");\n return state;\n};\n\nconst useRunFiles = (session: SessionContext): RunFilesState => {\n const [listing, setListing] = useState<RunFilesListing>();\n const [error, setError] = useState<string>();\n const runId = session.session.id;\n\n useEffect(() => {\n let alive = true;\n const load = () => void fetchRunFiles(runId)\n .then((value) => {\n if (!alive) return;\n setListing(value);\n setError(undefined);\n })\n .catch((cause: unknown) => alive && setError(cause instanceof Error ? cause.message : String(cause)));\n load();\n if (!session.running) {\n return () => {\n alive = false;\n };\n }\n const timer = setInterval(load, 5000);\n return () => {\n alive = false;\n clearInterval(timer);\n };\n }, [runId, session.running]);\n\n return useMemo(() => ({ listing, error }), [listing, error]);\n};\n\nfunction DocumentsSessionProvider({ children, session }: SessionProviderProps) {\n const state = useRunFiles(session);\n return <RunFilesContext.Provider value={state}>{children}</RunFilesContext.Provider>;\n}\n\nconst resultSection = (runId: string, view: RunView): DocumentSection => {\n const handles = new Map(view.actors.map((actor) => [actor.id, actor.handle]));\n return {\n id: \"results\",\n label: \"Results\",\n kind: \"results\",\n documents: view.artifacts.map((artifact) => {\n const handle = handles.get(artifact.createdBy);\n return {\n id: artifact.id,\n title: artifact.title,\n format: formatOf(artifact.mediaType),\n contentUrl: runArtifactContentUrl(runId, artifact.id),\n createdAt: artifact.createdAt,\n size: artifact.size,\n ...(handle ? { meta: `@${handle}` } : {}),\n };\n }),\n };\n};\n\nconst sectionsFrom = (\n routePrefix: string,\n session: SessionContext,\n listing: RunFilesListing | undefined,\n): { sections: DocumentSection[]; truncated: boolean } => {\n const runId = session.session.id;\n const view = runViewFrom(session.runView);\n const fileDocument = (directory: string | undefined, entry: RunFileEntry): Document => {\n const relative = directory ? `${directory}/${entry.path}` : entry.path;\n return {\n id: `file:${relative}`,\n title: entry.path,\n format: formatFromName(entry.path),\n contentUrl: `${runFileContentUrl(routePrefix, runId, relative)}&v=${encodeURIComponent(entry.modifiedAt)}`,\n createdAt: entry.modifiedAt,\n size: entry.size,\n };\n };\n\n const sections: DocumentSection[] = [\n ...(listing?.groups ?? []).map((group) => ({\n id: `store/${group.directory}`,\n label: group.directory,\n kind: \"store\" as const,\n documents: group.files.map((entry) => fileDocument(group.directory, entry)),\n })),\n ...(listing && listing.loose.length > 0\n ? [{\n id: \"store\",\n label: \"Store\",\n kind: \"store\" as const,\n documents: listing.loose.map((entry) => fileDocument(undefined, entry)),\n }]\n : []),\n ...(view && view.artifacts.length > 0 ? [resultSection(runId, view)] : []),\n ];\n const documentMessages = documentMessagesFrom(session.messages, session.actorConversations);\n const chat = [\n ...documentsFromMessages(documentMessages),\n ...pathDocumentsFromMessages(documentMessages, routePrefix, session.session.id),\n ];\n if (chat.length > 0) sections.push({ id: \"chat\", label: \"Shown in chat\", kind: \"chat\", documents: chat });\n return { sections, truncated: listing?.truncated ?? false };\n};\n\nconst contribution = (routePrefix: string) => {\n function DocumentsPanelContribution({ navigation, selection, session }: WorkspaceTabContext) {\n const { listing, error } = useRunFilesContext();\n const { sections, truncated } = useMemo(\n () => sectionsFrom(routePrefix, session, listing),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- session is rebuilt per render; only these parts matter\n [session.messages, session.actorConversations, session.runView, session.session.id, listing],\n );\n return (\n <>\n {error && (\n <Alert className=\"shrink-0 rounded-none border-x-0 border-t-0 border-b-border-soft bg-destructive/8 px-2.5 py-2 text-[0.68rem]\" variant=\"destructive\">\n {error}\n </Alert>\n )}\n <DocumentPanel\n activeId={typeof selection === \"string\" ? selection : undefined}\n sections={sections}\n truncated={truncated}\n onSelect={(id) => navigation.openTab(DOCUMENTS_TAB_ID, id ?? null)}\n />\n </>\n );\n }\n\n function DocumentsBadge({ session }: WorkspaceTabContext) {\n const { listing } = useRunFilesContext();\n const { sections } = useMemo(\n () => sectionsFrom(routePrefix, session, listing),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- session is rebuilt per render; only these parts matter\n [session.messages, session.actorConversations, session.runView, session.session.id, listing],\n );\n const count = sections.reduce((sum, section) => sum + section.documents.length, 0);\n return count > 0 ? <Badge className=\"tabular-nums\" variant=\"secondary\">{count}</Badge> : null;\n }\n\n return { DocumentsPanelContribution, DocumentsBadge };\n};\n\nfunction DocumentInline({ navigation, session, tool, routePrefix }: ToolPresenterContext & { routePrefix: string }) {\n const document = chatDocumentFrom(tool, routePrefix, session.session.id);\n if (!document) return null;\n const status = tool.isError ? \"error\" : tool.result === undefined ? \"running\" : \"ready\";\n return (\n <DocumentToolCall\n active={navigation.activeTabId === DOCUMENTS_TAB_ID && navigation.selectionFor(DOCUMENTS_TAB_ID) === document.id}\n document={document}\n onOpen={() => navigation.openTab(DOCUMENTS_TAB_ID, document.id)}\n status={status}\n />\n );\n}\n\nfunction IconDocument() {\n return (\n <svg aria-hidden fill=\"none\" height=\"15\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.7\" viewBox=\"0 0 24 24\" width=\"15\">\n <path d=\"M6 3h8l4 4v14H6zM14 3v5h4M9 13h6M9 17h4\" />\n </svg>\n );\n}\n\nconst configuredPlugin = (descriptor: WebPluginDescriptor, routePrefix: string): WebPlugin => {\n const { DocumentsPanelContribution, DocumentsBadge } = contribution(routePrefix);\n return {\n ...descriptor,\n needsRunView: true,\n SessionProvider: DocumentsSessionProvider,\n workspaceTabs: [{\n id: DOCUMENTS_TAB_ID,\n label: \"Documents\",\n order: 200,\n Icon: IconDocument,\n Panel: DocumentsPanelContribution,\n Badge: DocumentsBadge,\n }],\n toolPresenters: [{\n toolName: \"show_document\",\n Inline: (props) => <DocumentInline {...props} routePrefix={routePrefix} />,\n reveal: (tool, session) => chatDocumentFrom(tool, routePrefix, session.session.id)\n ? { tabId: DOCUMENTS_TAB_ID, selection: tool.id }\n : undefined,\n }],\n entityPresenters: [{\n reveal: (entity) => entity.type === \"artifact\"\n ? { tabId: DOCUMENTS_TAB_ID, selection: entity.id }\n : undefined,\n }],\n };\n};\n\nconst descriptor: WebPluginDescriptor = { id: DOCUMENTS_PLUGIN_ID };\n\nexport const webPlugin: WebPlugin = {\n ...descriptor,\n activate: (config) => configuredPlugin(descriptor, pluginRoutePrefixFrom(descriptor.id, config)),\n};\n"],
5
+ "mappings": "AAAO,IAAMA,EAAO,CAACC,EAAWC,IAAS,CACvC,IAAMC,EAAS,WAAW,uBAA0BF,CAAS,EAC7D,GAAIE,IAAW,OAAW,MAAM,IAAI,MAAM,6BAA6BF,CAAS,EAAE,EAClF,GAAI,EAAEC,KAAQC,GAAS,MAAM,IAAI,MAAM,6BAA6BD,CAAI,SAASD,CAAS,6CAA6C,EACvI,OAAOE,EAAOD,CAAI,CACpB,ECJA,IAAOE,EAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EAAQC,EAAK,QAAS,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,aAAa,ECA1C,IAAOC,EAAQC,EAAK,QAAS,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,WAAW,ECAxC,IAAOC,EAAQC,EAAK,QAAS,SAAS,ECAtC,IAAOC,EAAQC,EAAK,QAAS,UAAU,ECKhC,IAAMC,GAAeC,GAC1BA,GAAQ,QAAQ,qBAAsB,OAAO,EAAE,YAAA,ECD1C,SAASC,GACdC,EACAC,EACAC,EAAoB,CAAA,EACJ,CAChB,GAAID,GAAY,KACd,MAAM,IAAI,MAAM,uDAAuD,EAGzE,MAAO,CACL,KAAME,GAAYH,CAAQ,EAC1B,KAAM,GACN,KAAMC,EACN,GAAIC,EAAQ,OAAS,EAAI,CAAE,QAAAA,CAAA,EAAY,CAAA,CAAC,CAE5C,CCfO,IAAME,GAAiCC,GAAc,CAC1D,I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MAAOjB,EACP,MAAOS,CACT,CAAC,EACD,eAAgB,CAAC,CACf,SAAU,gBACV,OAASW,GAAUzC,EAACmC,GAAA,CAAgB,GAAGM,EAAO,YAAa1E,EAAa,EACxE,OAAQ,CAACH,EAAMoB,IAAYZ,GAAiBR,EAAMG,EAAaiB,EAAQ,QAAQ,EAAE,EAC7E,CAAE,MAAOtB,EAAkB,UAAWE,EAAK,EAAG,EAC9C,MACN,CAAC,EACD,iBAAkB,CAAC,CACjB,OAAS8E,GAAWA,EAAO,OAAS,WAChC,CAAE,MAAOhF,EAAkB,UAAWgF,EAAO,EAAG,EAChD,MACN,CAAC,CACH,CACF,EAEMF,GAAkC,CAAE,GAAI/E,EAAoB,EAErDkF,GAAuB,CAClC,GAAGH,GACH,SAAWI,GAAWL,GAAiBC,GAAYK,GAAsBL,GAAW,GAAII,CAAM,CAAC,CACjG",
6
+ "names": ["read", "specifier", "name", "module", "react_createContext_default", "read", "react_createElement_default", "read", "react_forwardRef_default", "read", "react_useCallback_default", "read", "react_useContext_default", "read", "react_useEffect_default", "read", "react_useMemo_default", "read", "react_useState_default", "read", "toKebabCase", "string", "toLucideIconData", "iconName", "iconNode", "aliases", "toKebabCase", "toCamelCase", "string", "out", "upperNext", "ch", "toPascalCase", "string", "camelCase", "toCamelCase", "mergeClasses", "classes", "className", "index", "array", "defaultAttributes", "isDefined", "value", "buildLucideIconNode", "icon", "params", "attributeNames", "getAttributeName", "attributeName", "viewBoxWidth", "defaultAttributes", "viewBoxHeight", "aliasClassNames", "alias", "iconClassNames", "classNamesFromClassName", "className", "mergeClasses", "calculatedStrokeWidth", "attrs", "attrName", "child", "name", "children", "nextAttrs", "buildLucideIconForReact", "icon", "params", "buildLucideIconNode", "hasA11yProp", "props", "prop", "LucideContext", "react_createContext_default", "useLucideContext", "react_useContext_default", "LucideContext", "Icon", "react_forwardRef_default", "color", "size", "width", "height", "strokeWidth", "absoluteStrokeWidth", "nonScalingStroke", "className", "children", "iconNode", "icon", "rest", "ref", "contextSize", "contextStrokeWidth", "contextAbsoluteStrokeWidth", "contextNonScalingStroke", "contextColor", "contextClass", "useLucideContext", "hasAccessibleProp", "hasA11yProp", "name", "svgAttributes", "builtIconNode", "buildLucideIconForReact", "mergeClasses", "react_createElement_default", "tag", "attrs", "createLucideIcon", "iconDataOrName", "iconNode", "aliases", "iconData", "toLucideIconData", "Component", "react_forwardRef_default", "className", "props", "ref", "react_createElement_default", "Icon", "toPascalCase", "__iconData", "ArrowLeft", "createLucideIcon", "__iconData", "X", "createLucideIcon", "ui_Alert_default", "read", "ui_Badge_default", "read", "ui_Button_default", "read", "ui_Dialog_default", "read", "ui_DialogContent_default", "read", "ui_DialogTitle_default", "read", "ui_Empty_default", "read", "ui_EmptyContent_default", "read", "ui_EmptyDescription_default", "read", "ui_EmptyHeader_default", "read", "ui_EmptyMedia_default", "read", "ui_EmptyTitle_default", "read", "ui_Spinner_default", "read", "quassel_Markdown_default", "read", "format_formatBytes_default", "read", "SourceCode_SourceCode_default", "read", "jsx_runtime_Fragment_default", "read", "jsx_runtime_jsx_default", "read", "jsx_runtime_jsxs_default", "read", "copyClass", "titleClass", "metaClass", "sourceClass", "groupBadgeClass", "formatLabels", "formatByExtension", "formatFromName", "name", "dot", "formatOf", "mediaType", "formatTime", "iso", "date", "documentMessagesFrom", "messages", "conversations", "message", "documentsFrom", "tool", "args", "format", "useDocumentContent", "document", "cache", "setCache", "react_useState_default", "textual", "url", "react_useEffect_default", "alive", "response", "text", "current", "error", "DocumentToolCall", "active", "onOpen", "status", "lineCount", "react_useMemo_default", "statusLabel", "jsx_runtime_jsxs_default", "jsx_runtime_jsx_default", "IconDocument", "ui_Spinner_default", "IconError", "IconOpen", "DocumentContent", "loaded", "ui_Empty_default", "ui_EmptyHeader_default", "ui_EmptyMedia_default", "ui_EmptyTitle_default", "ui_EmptyContent_default", "ui_Button_default", "ui_EmptyDescription_default", "SourceCode_SourceCode_default", "quassel_Markdown_default", "DocumentHead", "meta", "format_formatBytes_default", "jsx_runtime_Fragment_default", "DocumentModal", "onClose", "ui_Dialog_default", "open", "ui_DialogContent_default", "ui_DialogTitle_default", "X", "DocumentPanel", "activeId", "sections", "truncated", "onSelect", "section", "modalOpen", "setModalOpen", "collapsed", "setCollapsed", "toggle", "react_useCallback_default", "id", "next", "ArrowLeft", "IconChevron", "IconResult", "IconChat", "ui_Badge_default", "size", "rpc_rpc_default", "read", "typebox_Type_default", "read", "contract_defineOperation_default", "read", "fileEntry", "typebox_Type_default", "filesListing", "documentsContracts", "contract_defineOperation_default", "runFileContentUrl", "routePrefix", "runId", "filePath", "fetchRunFiles", "rpc_rpc_default", "documentsContracts", "run_view_runArtifactContentUrl_default", "read", "run_view_runViewFrom_default", "read", "PluginRegistry_pluginRoutePrefixFrom_default", "read", "DOCUMENTS_PLUGIN_ID", "DOCUMENTS_TAB_ID", "pathArgumentsFrom", "tool", "args", "pathDocumentFrom", "routePrefix", "runId", "format", "formatFromName", "runFileContentUrl", "chatDocumentFrom", "documentsFrom", "pathDocumentsFromMessages", "messages", "message", "document", "RunFilesContext", "react_createContext_default", "useRunFilesContext", "state", "react_useContext_default", "useRunFiles", "session", "listing", "setListing", "react_useState_default", "error", "setError", "react_useEffect_default", "alive", "load", "fetchRunFiles", "value", "cause", "timer", "react_useMemo_default", "DocumentsSessionProvider", "children", "jsx_runtime_jsx_default", "resultSection", "view", "handles", "actor", "artifact", "handle", "formatOf", "run_view_runArtifactContentUrl_default", "sectionsFrom", "run_view_runViewFrom_default", "fileDocument", "directory", "entry", "relative", "sections", "group", "documentMessages", "documentMessagesFrom", "chat", "contribution", "DocumentsPanelContribution", "navigation", "selection", "truncated", "jsx_runtime_jsxs_default", "jsx_runtime_Fragment_default", "ui_Alert_default", "DocumentPanel", "id", "DocumentsBadge", "count", "sum", "section", "ui_Badge_default", "DocumentInline", "status", "DocumentToolCall", "IconDocument", "configuredPlugin", "descriptor", "props", "entity", "webPlugin", "config", "PluginRegistry_pluginRoutePrefixFrom_default"]
7
7
  }
@@ -27,7 +27,7 @@ var serverPath = (toolsDirectory) => {
27
27
  if (configured) return configured;
28
28
  const provisioned = path.join(toolsDirectory, ...FSHARP_SERVER_FILE.split("/"));
29
29
  if (existsSync(provisioned)) return provisioned;
30
- throw new Error(`fsautocomplete gibt es auf diesem Rechner nicht: weder ${FSHARP_SERVER_VARIABLE} gesetzt noch ${provisioned} vorhanden. Ein Arbeitsplatz holt es mit pnpm provision --workspace, ein Server \xFCber pnpm provision <profil>; ${FSHARP_SERVER_VARIABLE} \xFCbersteuert beides`);
30
+ throw new Error(`fsautocomplete does not exist on this machine: neither is ${FSHARP_SERVER_VARIABLE} set nor does ${provisioned} exist. A workspace fetches it with pnpm provision --workspace, a server via pnpm provision <profile>; ${FSHARP_SERVER_VARIABLE} overrides both`);
31
31
  };
32
32
  var contentOf = (params) => params?.content ?? "";
33
33
  var executor = (machine) => ({
@@ -48,13 +48,13 @@ var executor = (machine) => ({
48
48
  }),
49
49
  open: async (session, root, timeoutMs) => {
50
50
  const projects = root.toLowerCase().endsWith(".sln") ? (await solutionProjects(root)).filter((project) => project.toLowerCase().endsWith(".fsproj")) : [root];
51
- if (projects.length === 0) throw new Error(`${path.basename(root)} enth\xE4lt keine F#-Projekte`);
52
- const finished = session.waitForNotification(timeoutMs, "Projekte geladen", (method, params) => method === "fsharp/notifyWorkspace" && contentOf(params).includes('"workspaceLoad"') && contentOf(params).includes('"finished"'));
51
+ if (projects.length === 0) throw new Error(`${path.basename(root)} contains no F# projects`);
52
+ const finished = session.waitForNotification(timeoutMs, "projects loaded", (method, params) => method === "fsharp/notifyWorkspace" && contentOf(params).includes('"workspaceLoad"') && contentOf(params).includes('"finished"'));
53
53
  await session.request("fsharp/workspaceLoad", {
54
54
  textDocuments: projects.map((project) => ({ uri: pathToFileURL(project).href }))
55
55
  });
56
56
  await finished;
57
- return `${projects.length} F#-Projekt${projects.length === 1 ? "" : "e"} aus ${path.basename(root)} geladen`;
57
+ return `Loaded ${projects.length} F# project${projects.length === 1 ? "" : "s"} from ${path.basename(root)}`;
58
58
  }
59
59
  }]
60
60
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../plugins/ragents.lsp-fsharp/executor.ts"],
4
- "sourcesContent": ["import { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { LanguageServerDescription, WorkspaceExecutorContribution } from \"@ragents/workspace-executor\";\n\nexport const FSHARP_SERVER_VARIABLE = \"FSHARP_LANGUAGE_SERVER\";\nexport const FSHARP_SERVER_FILE = \"fsautocomplete/fsautocomplete.dll\";\n\nconst languages = { \".fs\": \"fsharp\", \".fsi\": \"fsharp\", \".fsx\": \"fsharp\" } as const;\n\nexport const fsharpLanguageServer: LanguageServerDescription = {\n id: \"fsharp\",\n label: \"FSAC\",\n languages,\n rootDescription: \"the .sln file (or a single .fsproj)\",\n};\n\nconst PROJECT_LINE = /^Project\\(\"\\{[^}]+\\}\"\\)\\s*=\\s*\"[^\"]*\",\\s*\"([^\"]+)\"/gm;\n\n/** Die Projekte einer .sln, aufgel\u00F6st neben ihr; Ordnereintr\u00E4ge der Solution z\u00E4hlen nicht. */\nexport const solutionProjects = async (solutionFile: string): Promise<string[]> => {\n const text = await readFile(solutionFile, \"utf8\");\n const directory = path.dirname(solutionFile);\n return [...text.matchAll(PROJECT_LINE)]\n .map((match) => match[1].replaceAll(\"\\\\\", \"/\"))\n .filter((relative) => /\\.[a-z]+proj$/i.test(relative))\n .map((relative) => path.resolve(directory, relative));\n};\n\nconst dotnetCommand = (server: string, args: readonly string[]): { command: string; args: string[] } =>\n server.toLowerCase().endsWith(\".dll\")\n ? { command: \"dotnet\", args: [server, ...args] }\n : { command: server, args: [...args] };\n\nconst serverPath = (toolsDirectory: string): string => {\n const configured = process.env[FSHARP_SERVER_VARIABLE];\n if (configured) return configured;\n const provisioned = path.join(toolsDirectory, ...FSHARP_SERVER_FILE.split(\"/\"));\n if (existsSync(provisioned)) return provisioned;\n throw new Error(\"fsautocomplete gibt es auf diesem Rechner nicht: weder \"\n + `${FSHARP_SERVER_VARIABLE} gesetzt noch ${provisioned} vorhanden. Ein Arbeitsplatz holt es mit `\n + `pnpm provision --workspace, ein Server \u00FCber pnpm provision <profil>; ${FSHARP_SERVER_VARIABLE} \u00FCbersteuert beides`);\n};\n\nconst contentOf = (params: unknown): string => (params as { content?: string } | undefined)?.content ?? \"\";\n\nexport const executor: WorkspaceExecutorContribution = (machine) => ({\n languageServers: [{\n ...fsharpLanguageServer,\n resolveRoot: (workspaceRoot, root) => machine.resolveRootFile(workspaceRoot, root, [\".sln\", \".fsproj\"]),\n rootDirectory: (root) => path.dirname(root),\n launch: async (context, root) => ({\n label: \"FSAC\",\n ...dotnetCommand(serverPath(machine.toolsDirectory), [\"--state-directory\", path.join(context.logDirectory, \"fsautocomplete\")]),\n cwd: path.dirname(root),\n env: context.env,\n uid: context.uid,\n gid: context.gid,\n rootUri: pathToFileURL(path.dirname(root)).href,\n initializationOptions: { AutomaticWorkspaceInit: false },\n languages,\n }),\n open: async (session, root, timeoutMs) => {\n const projects = root.toLowerCase().endsWith(\".sln\")\n ? (await solutionProjects(root)).filter((project) => project.toLowerCase().endsWith(\".fsproj\"))\n : [root];\n if (projects.length === 0) throw new Error(`${path.basename(root)} enth\u00E4lt keine F#-Projekte`);\n const finished = session.waitForNotification(timeoutMs, \"Projekte geladen\", (method, params) =>\n method === \"fsharp/notifyWorkspace\"\n && contentOf(params).includes(\"\\\"workspaceLoad\\\"\")\n && contentOf(params).includes(\"\\\"finished\\\"\"));\n await session.request(\"fsharp/workspaceLoad\", {\n textDocuments: projects.map((project) => ({ uri: pathToFileURL(project).href })),\n });\n await finished;\n return `${projects.length} F#-Projekt${projects.length === 1 ? \"\" : \"e\"} aus ${path.basename(root)} geladen`;\n },\n }],\n});\n"],
5
- "mappings": ";;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,OAA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{ existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { LanguageServerDescription, WorkspaceExecutorContribution } from \"@ragents/workspace-executor\";\n\nexport const FSHARP_SERVER_VARIABLE = \"FSHARP_LANGUAGE_SERVER\";\nexport const FSHARP_SERVER_FILE = \"fsautocomplete/fsautocomplete.dll\";\n\nconst languages = { \".fs\": \"fsharp\", \".fsi\": \"fsharp\", \".fsx\": \"fsharp\" } as const;\n\nexport const fsharpLanguageServer: LanguageServerDescription = {\n id: \"fsharp\",\n label: \"FSAC\",\n languages,\n rootDescription: \"the .sln file (or a single .fsproj)\",\n};\n\nconst PROJECT_LINE = /^Project\\(\"\\{[^}]+\\}\"\\)\\s*=\\s*\"[^\"]*\",\\s*\"([^\"]+)\"/gm;\n\n/** The projects of a .sln, resolved next to it; solution folder entries do not count. */\nexport const solutionProjects = async (solutionFile: string): Promise<string[]> => {\n const text = await readFile(solutionFile, \"utf8\");\n const directory = path.dirname(solutionFile);\n return [...text.matchAll(PROJECT_LINE)]\n .map((match) => match[1].replaceAll(\"\\\\\", \"/\"))\n .filter((relative) => /\\.[a-z]+proj$/i.test(relative))\n .map((relative) => path.resolve(directory, relative));\n};\n\nconst dotnetCommand = (server: string, args: readonly string[]): { command: string; args: string[] } =>\n server.toLowerCase().endsWith(\".dll\")\n ? { command: \"dotnet\", args: [server, ...args] }\n : { command: server, args: [...args] };\n\nconst serverPath = (toolsDirectory: string): string => {\n const configured = process.env[FSHARP_SERVER_VARIABLE];\n if (configured) return configured;\n const provisioned = path.join(toolsDirectory, ...FSHARP_SERVER_FILE.split(\"/\"));\n if (existsSync(provisioned)) return provisioned;\n throw new Error(\"fsautocomplete does not exist on this machine: neither is \"\n + `${FSHARP_SERVER_VARIABLE} set nor does ${provisioned} exist. A workspace fetches it with `\n + `pnpm provision --workspace, a server via pnpm provision <profile>; ${FSHARP_SERVER_VARIABLE} overrides both`);\n};\n\nconst contentOf = (params: unknown): string => (params as { content?: string } | undefined)?.content ?? \"\";\n\nexport const executor: WorkspaceExecutorContribution = (machine) => ({\n languageServers: [{\n ...fsharpLanguageServer,\n resolveRoot: (workspaceRoot, root) => machine.resolveRootFile(workspaceRoot, root, [\".sln\", \".fsproj\"]),\n rootDirectory: (root) => path.dirname(root),\n launch: async (context, root) => ({\n label: \"FSAC\",\n ...dotnetCommand(serverPath(machine.toolsDirectory), [\"--state-directory\", path.join(context.logDirectory, \"fsautocomplete\")]),\n cwd: path.dirname(root),\n env: context.env,\n uid: context.uid,\n gid: context.gid,\n rootUri: pathToFileURL(path.dirname(root)).href,\n initializationOptions: { AutomaticWorkspaceInit: false },\n languages,\n }),\n open: async (session, root, timeoutMs) => {\n const projects = root.toLowerCase().endsWith(\".sln\")\n ? (await solutionProjects(root)).filter((project) => project.toLowerCase().endsWith(\".fsproj\"))\n : [root];\n if (projects.length === 0) throw new Error(`${path.basename(root)} contains no F# projects`);\n const finished = session.waitForNotification(timeoutMs, \"projects loaded\", (method, params) =>\n method === \"fsharp/notifyWorkspace\"\n && contentOf(params).includes(\"\\\"workspaceLoad\\\"\")\n && contentOf(params).includes(\"\\\"finished\\\"\"));\n await session.request(\"fsharp/workspaceLoad\", {\n textDocuments: projects.map((project) => ({ uri: pathToFileURL(project).href })),\n });\n await finished;\n return `Loaded ${projects.length} F# project${projects.length === 1 ? \"\" : \"s\"} from ${path.basename(root)}`;\n },\n }],\n});\n"],
5
+ "mappings": ";;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAGvB,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAElC,IAAM,YAAY,EAAE,OAAO,UAAU,QAAQ,UAAU,QAAQ,SAAS;AAEjE,IAAM,uBAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,OAAO;AAAA,EACP;AAAA,EACA,iBAAiB;AACnB;AAEA,IAAM,eAAe;AAGd,IAAM,m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AAAA,MAC7H,KAAK,KAAK,QAAQ,IAAI;AAAA,MACtB,KAAK,QAAQ;AAAA,MACb,KAAK,QAAQ;AAAA,MACb,KAAK,QAAQ;AAAA,MACb,SAAS,cAAc,KAAK,QAAQ,IAAI,CAAC,EAAE;AAAA,MAC3C,uBAAuB,EAAE,wBAAwB,MAAM;AAAA,MACvD;AAAA,IACF;AAAA,IACA,MAAM,OAAO,SAAS,MAAM,cAAc;AACxC,YAAM,WAAW,KAAK,YAAY,EAAE,SAAS,MAAM,KAC9C,MAAM,iBAAiB,IAAI,GAAG,OAAO,CAAC,YAAY,QAAQ,YAAY,EAAE,SAAS,SAAS,CAAC,IAC5F,CAAC,IAAI;AACT,UAAI,SAAS,WAAW,EAAG,OAAM,IAAI,MAAM,GAAG,KAAK,SAAS,IAAI,CAAC,0BAA0B;AAC3F,YAAM,WAAW,QAAQ,oBAAoB,WAAW,mBAAmB,CAAC,QAAQ,WAClF,WAAW,4BACR,UAAU,MAAM,EAAE,SAAS,iBAAmB,KAC9C,UAAU,MAAM,EAAE,SAAS,YAAc,CAAC;AAC/C,YAAM,QAAQ,QAAQ,wBAAwB;AAAA,QAC5C,eAAe,SAAS,IAAI,CAAC,aAAa,EAAE,KAAK,cAAc,OAAO,EAAE,KAAK,EAAE;AAAA,MACjF,CAAC;AACD,YAAM;AACN,aAAO,UAAU,SAAS,MAAM,cAAc,SAAS,WAAW,IAAI,KAAK,GAAG,SAAS,KAAK,SAAS,IAAI,CAAC;AAAA,IAC5G;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -28,8 +28,8 @@
28
28
  ]
29
29
  }
30
30
  },
31
- "stand": "4c213b3b9447a430f9afc54ea8fb3ec22a9073b9d7422332c982c5f5cb5259b9",
32
- "sourceStand": "d40d7a5d009b8d477f3118b677b049107a8df49b26ad27c54ef059067164fb5a",
31
+ "stand": "a39dafc264c6703d9481f358b21e5bf3997dc5d2dc7fe0d969d4905d49c7a1f8",
32
+ "sourceStand": "a4beef96d87388d745faf6ed3ad74fc0aa0d5ec1b98c93bae2e2d7cdde2f8694",
33
33
  "server": "server/index.js",
34
34
  "web": {
35
35
  "entry": "web/index.js",
@@ -56,7 +56,7 @@ var toolPrefix = (names, majors) => {
56
56
  const usable = offered.filter((entry) => majors.includes(entry.major)).sort((left, right) => right.major - left.major);
57
57
  const chosen = usable[0];
58
58
  if (!chosen) {
59
- throw new Error(`${PACKAGE} ${FSAUTOCOMPLETE_VERSION} bringt nur ${[...new Set(offered.map((entry) => `net${entry.major}.0`))].join(", ")} mit; installiert sind die .NET-Laufzeiten ${majors.join(", ")}`);
59
+ throw new Error(`${PACKAGE} ${FSAUTOCOMPLETE_VERSION} only ships ${[...new Set(offered.map((entry) => `net${entry.major}.0`))].join(", ")}; the installed .NET runtimes are ${majors.join(", ")}`);
60
60
  }
61
61
  return chosen.prefix;
62
62
  };
@@ -66,7 +66,7 @@ var createFsharpProvision = (download = downloadArchive, runtimes = dotnetRuntim
66
66
  if (await runtimes() === void 0) return provisionGap("dotnet", DOTNET_INSTRUCTION, false);
67
67
  const installed = await stat(serverFile(target)).catch(() => void 0);
68
68
  if (installed?.isFile() && await readProvisionStamp(target) === FSAUTOCOMPLETE_VERSION) return provisionReady;
69
- return provisionGap("fsautocomplete", `fsautocomplete ${FSAUTOCOMPLETE_VERSION} fehlt unter ${serverFile(target)}`, true);
69
+ return provisionGap("fsautocomplete", `fsautocomplete ${FSAUTOCOMPLETE_VERSION} is missing at ${serverFile(target)}`, true);
70
70
  };
71
71
  return {
72
72
  check,
@@ -76,15 +76,15 @@ var createFsharpProvision = (download = downloadArchive, runtimes = dotnetRuntim
76
76
  if (!state.installable) throw new Error(state.instruction);
77
77
  const majors = await runtimes();
78
78
  if (!majors) throw new Error(DOTNET_INSTRUCTION);
79
- log(`fsautocomplete ${FSAUTOCOMPLETE_VERSION} laden`);
79
+ log(`Downloading fsautocomplete ${FSAUTOCOMPLETE_VERSION}`);
80
80
  const archive = await download(fsautocompleteArchiveUrl);
81
81
  const prefix = toolPrefix(readZipNames(archive), majors);
82
82
  const files = await unpackArchive(archive, prefix, target, "fsautocomplete");
83
83
  if (!(await stat(serverFile(target)).catch(() => void 0))?.isFile()) {
84
- throw new Error(`Das Paket ${PACKAGE} ${FSAUTOCOMPLETE_VERSION} enth\xE4lt ${prefix}fsautocomplete.dll nicht`);
84
+ throw new Error(`The package ${PACKAGE} ${FSAUTOCOMPLETE_VERSION} does not contain ${prefix}fsautocomplete.dll`);
85
85
  }
86
86
  await writeProvisionStamp(target, FSAUTOCOMPLETE_VERSION);
87
- log(`${files} Dateien aus ${prefix} nach ${path2.join(target, "fsautocomplete")}`);
87
+ log(`${files} files from ${prefix} to ${path2.join(target, "fsautocomplete")}`);
88
88
  }
89
89
  };
90
90
  };