@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
@@ -7,18 +7,22 @@ import { Protocol } from "@ragents/host/protocol.js";
7
7
 
8
8
  // server/config.ts
9
9
  import { configuredModelAliases } from "@ragents/host/plugin-support/model-aliases.js";
10
+ import { configuredModelProviders } from "@ragents/host/plugin-support/model-providers.js";
10
11
  var relayAliases = (aliases) => {
11
- if (aliases.length === 0) throw new Error("ragents.model-relay needs MODEL_ALIASES in the host section, a list of { alias, model, thinking?, compaction }");
12
+ if (aliases.length === 0) throw new Error("ragents.model-relay needs MODEL_ALIASES in the host section, a list of { alias, model, thinking?, thinkingLevels?, compaction }");
12
13
  return aliases;
13
14
  };
14
15
  var modelRelayConfig = Object.freeze({
15
- aliases: () => relayAliases(configuredModelAliases())
16
+ aliases: () => relayAliases(configuredModelAliases()),
17
+ /** The profile's own providers (MODEL_PROVIDERS in the host section) next to those of the product. */
18
+ upstreams: (product) => [...product, ...configuredModelProviders()]
16
19
  });
17
20
 
18
21
  // server/relay.ts
19
22
  import { Readable } from "node:stream";
20
23
  import { pipeline } from "node:stream/promises";
21
24
  import { PayloadTooLargeError, readBody, writeJson } from "@ragents/host/plugin-support/http.js";
25
+ import { validatedAliasModel } from "@ragents/host/plugin-support/model-aliases.js";
22
26
  var RELAY_PATH_PREFIX = "/relay/v1";
23
27
  var RELAY_RIGHT = "models.use";
24
28
  var MAX_REQUEST_BYTES = 64 * 1024 * 1024;
@@ -27,25 +31,25 @@ var DROPPED_HEADERS = /* @__PURE__ */ new Set(["host", "authorization", "cookie"
27
31
  var resolveAliases = (aliases, upstreams) => aliases.map((entry) => {
28
32
  const upstream = upstreams.find((candidate) => candidate.id === entry.upstream);
29
33
  if (!upstream) {
30
- const available = upstreams.map((candidate) => candidate.id).join(", ") || "keiner";
31
- throw new Error(`MODEL_ALIASES: der Anbieter ${entry.upstream} hinter ${entry.alias} ist auf diesem Server nicht konfiguriert (verf\xFCgbar: ${available})`);
34
+ const available = upstreams.map((candidate) => candidate.id).join(", ") || "none";
35
+ throw new Error(`MODEL_ALIASES: the provider ${entry.upstream} behind ${entry.alias} is not configured on this server (available: ${available})`);
32
36
  }
33
37
  const model = upstream.models.find((candidate) => candidate.id === entry.model);
34
- if (!model) throw new Error(`MODEL_ALIASES: das Modell ${entry.model} hinter ${entry.alias} fehlt im Katalog von ${entry.upstream}`);
35
- return { alias: entry.alias, upstream, model, compaction: entry.compaction };
38
+ if (!model) throw new Error(`MODEL_ALIASES: the model ${entry.model} behind ${entry.alias} is missing from the catalog of ${entry.upstream}`);
39
+ return { alias: entry.alias, upstream, model, offered: validatedAliasModel(entry, model) };
36
40
  });
37
41
  var catalogEntryOf = (resolved) => ({
38
42
  id: resolved.alias,
39
43
  object: "model",
40
44
  owned_by: "relay",
41
45
  catalog: {
42
- reasoning: resolved.model.reasoning,
43
- ...resolved.model.thinkingLevelMap ? { thinkingLevelMap: resolved.model.thinkingLevelMap } : {},
44
- input: [...resolved.model.input],
45
- contextWindow: resolved.model.contextWindow,
46
- maxTokens: resolved.model.maxTokens,
47
- compaction: resolved.compaction,
48
- ...resolved.model.compat ? { compat: resolved.model.compat } : {}
46
+ reasoning: resolved.offered.reasoning,
47
+ ...resolved.offered.thinkingLevelMap ? { thinkingLevelMap: resolved.offered.thinkingLevelMap } : {},
48
+ input: [...resolved.offered.input],
49
+ contextWindow: resolved.offered.contextWindow,
50
+ maxTokens: resolved.offered.maxTokens,
51
+ compaction: resolved.offered.compaction,
52
+ ...resolved.offered.compat ? { compat: resolved.offered.compat } : {}
49
53
  }
50
54
  });
51
55
  var responseRewriter = (alias) => {
@@ -125,7 +129,7 @@ var createRelayRoutes = (options) => {
125
129
  matches: (request, url) => request.method === "POST" && url.pathname === completionsPath,
126
130
  requiredRights: [RELAY_RIGHT],
127
131
  handle: async ({ request, response, access }) => {
128
- const user = access.user?.id ?? "anonym";
132
+ const user = access.user?.id ?? "anonymous";
129
133
  let text;
130
134
  try {
131
135
  text = await readBody(request, MAX_REQUEST_BYTES);
@@ -141,17 +145,17 @@ var createRelayRoutes = (options) => {
141
145
  parsed = void 0;
142
146
  }
143
147
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
144
- writeJson(response, 400, openAiError("Der Anfragek\xF6rper ist kein JSON-Objekt", "invalid_request_error"));
148
+ writeJson(response, 400, openAiError("The request body is not a JSON object", "invalid_request_error"));
145
149
  return;
146
150
  }
147
151
  const alias = parsed.model;
148
152
  if (typeof alias !== "string" || !alias) {
149
- writeJson(response, 400, openAiError("Die Anfrage nennt kein Modell", "invalid_request_error"));
153
+ writeJson(response, 400, openAiError("The request names no model", "invalid_request_error"));
150
154
  return;
151
155
  }
152
156
  const resolved = options.aliases().find((candidate) => candidate.alias === alias);
153
157
  if (!resolved) {
154
- writeJson(response, 404, openAiError(`Das Modell ${alias} ist auf diesem Relay unbekannt`, "invalid_request_error"));
158
+ writeJson(response, 404, openAiError(`The model ${alias} is unknown on this relay`, "invalid_request_error"));
155
159
  return;
156
160
  }
157
161
  const controller = new AbortController();
@@ -168,8 +172,8 @@ var createRelayRoutes = (options) => {
168
172
  } catch (error) {
169
173
  if (controller.signal.aborted) return;
170
174
  const reason = error instanceof Error ? error.message : String(error);
171
- options.log(`${user} ${alias} -> ${resolved.upstream.id}/${resolved.model.id}: nicht erreichbar (${reason})`);
172
- writeJson(response, 502, openAiError(`Der Anbieter hinter ${alias} ist nicht erreichbar`, "server_error"));
175
+ options.log(`${user} ${alias} -> ${resolved.upstream.id}/${resolved.model.id}: unreachable (${reason})`);
176
+ writeJson(response, 502, openAiError(`The provider behind ${alias} is unreachable`, "server_error"));
173
177
  return;
174
178
  }
175
179
  response.writeHead(upstream.status, {
@@ -208,14 +212,14 @@ var modelRelayPlugin = {
208
212
  register: (host) => {
209
213
  const upstreams = host.service(modelUpstreamsToken);
210
214
  let resolved;
211
- const aliases = () => resolved ??= resolveAliases(modelRelayConfig.aliases(), upstreams());
215
+ const aliases = () => resolved ??= resolveAliases(modelRelayConfig.aliases(), modelRelayConfig.upstreams(upstreams()));
212
216
  const log = new Protocol(host.storage.root("relay.log"));
213
217
  host.lifecycle({
214
218
  id: "ragents.model-relay",
215
219
  initialize: () => {
216
220
  const list = aliases();
217
221
  log.write(`=== Start: ${list.map((entry) => `${entry.alias}=${entry.upstream.id}/${entry.model.id}`).join(", ")} ===`);
218
- console.log(`Modell-Relay: ${list.length} Aliasse unter /relay/v1 (${list.map((entry) => entry.alias).join(", ")})`);
222
+ console.log(`Model relay: ${list.length} aliases under /relay/v1 (${list.map((entry) => entry.alias).join(", ")})`);
219
223
  },
220
224
  shutdown: () => log.close()
221
225
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../plugins/ragents.model-relay/server/index.ts", "../../../plugins/ragents.model-relay/server/config.ts", "../../../plugins/ragents.model-relay/server/relay.ts"],
4
- "sourcesContent": ["import type { RAgentsPlugin } from \"@ragents/engine\";\nimport { modelUpstreamsToken } from \"@ragents/host/plugin-support/model-upstreams.js\";\nimport type { PluginModule } from \"@ragents/host/plugin-support/plugin-module.js\";\nimport { Protocol } from \"@ragents/host/protocol.js\";\nimport { modelRelayConfig } from \"./config.js\";\nimport { createRelayRoutes, resolveAliases, type ResolvedAlias } from \"./relay.js\";\n\nconst modelRelayPlugin: RAgentsPlugin = {\n manifest: { id: \"ragents.model-relay\" },\n register: (host) => {\n const upstreams = host.service(modelUpstreamsToken);\n let resolved: readonly ResolvedAlias[] | undefined;\n const aliases = (): readonly ResolvedAlias[] => resolved ??= resolveAliases(modelRelayConfig.aliases(), upstreams());\n const log = new Protocol(host.storage.root(\"relay.log\"));\n host.lifecycle({\n id: \"ragents.model-relay\",\n initialize: () => {\n const list = aliases();\n log.write(`=== Start: ${list.map((entry) => `${entry.alias}=${entry.upstream.id}/${entry.model.id}`).join(\", \")} ===`);\n console.log(`Modell-Relay: ${list.length} Aliasse unter /relay/v1 (${list.map((entry) => entry.alias).join(\", \")})`);\n },\n shutdown: () => log.close(),\n });\n host.http(...createRelayRoutes({ aliases, log: (line) => log.write(line) }));\n },\n};\n\nexport const plugin: PluginModule = {\n create: () => modelRelayPlugin,\n};\n", "import { configuredModelAliases, type ModelAlias } from \"@ragents/host/plugin-support/model-aliases.js\";\n\n/** Das Relay bietet die Aliasse des Profils an (MODEL_ALIASES im Abschnitt host), dieselben wie f\u00FCr die eigenen Runs. */\nexport const relayAliases = (aliases: readonly ModelAlias[]): readonly ModelAlias[] => {\n if (aliases.length === 0) throw new Error(\"ragents.model-relay needs MODEL_ALIASES in the host section, a list of { alias, model, thinking?, compaction }\");\n return aliases;\n};\n\nexport const modelRelayConfig = Object.freeze({\n aliases: () => relayAliases(configuredModelAliases()),\n});\n", "import type { IncomingMessage } from \"node:http\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport type { ReadableStream } from \"node:stream/web\";\nimport type { HttpRouteContribution } from \"@ragents/engine\";\nimport { PayloadTooLargeError, readBody, writeJson } from \"@ragents/host/plugin-support/http.js\";\nimport type { ModelAlias } from \"@ragents/host/plugin-support/model-aliases.js\";\nimport type { ModelUpstream } from \"@ragents/host/plugin-support/model-upstreams.js\";\n\nexport const RELAY_PATH_PREFIX = \"/relay/v1\";\nexport const RELAY_RIGHT = \"models.use\";\n\nconst MAX_REQUEST_BYTES = 64 * 1024 * 1024;\nconst MAX_SCAN_BYTES = 8 * 1024 * 1024;\nconst DROPPED_HEADERS = new Set([\"host\", \"authorization\", \"cookie\", \"content-length\", \"connection\", \"transfer-encoding\", \"accept-encoding\", \"expect\"]);\n\nexport interface ResolvedAlias {\n readonly alias: string;\n readonly upstream: ModelUpstream;\n readonly model: ModelUpstream[\"models\"][number];\n readonly compaction: ModelAlias[\"compaction\"];\n}\n\n/** Jeder Alias muss auf einen konfigurierten Anbieter und ein Modell aus dessen Katalog zeigen. */\nexport const resolveAliases = (aliases: readonly ModelAlias[], upstreams: readonly ModelUpstream[]): readonly ResolvedAlias[] =>\n aliases.map((entry) => {\n const upstream = upstreams.find((candidate) => candidate.id === entry.upstream);\n if (!upstream) {\n const available = upstreams.map((candidate) => candidate.id).join(\", \") || \"keiner\";\n throw new Error(`MODEL_ALIASES: der Anbieter ${entry.upstream} hinter ${entry.alias} ist auf diesem Server nicht konfiguriert (verf\u00FCgbar: ${available})`);\n }\n const model = upstream.models.find((candidate) => candidate.id === entry.model);\n if (!model) throw new Error(`MODEL_ALIASES: das Modell ${entry.model} hinter ${entry.alias} fehlt im Katalog von ${entry.upstream}`);\n return { alias: entry.alias, upstream, model, compaction: entry.compaction };\n });\n\n/** Der Katalogeintrag nennt nur, was der Verbraucher f\u00FCr Draht und Kompaktierung braucht; Name, Anbieter und Kosten bleiben beim Server. */\nexport const catalogEntryOf = (resolved: ResolvedAlias) => ({\n id: resolved.alias,\n object: \"model\" as const,\n owned_by: \"relay\",\n catalog: {\n reasoning: resolved.model.reasoning,\n ...(resolved.model.thinkingLevelMap ? { thinkingLevelMap: resolved.model.thinkingLevelMap } : {}),\n input: [...resolved.model.input],\n contextWindow: resolved.model.contextWindow,\n maxTokens: resolved.model.maxTokens,\n compaction: resolved.compaction,\n ...(resolved.model.compat ? { compat: resolved.model.compat } : {}),\n },\n});\n\ninterface Usage {\n readonly prompt: number | undefined;\n readonly completion: number | undefined;\n}\n\n/** Ersetzt im durchgereichten Strom den echten Modellnamen durch den Alias, entfernt den Anbieter und merkt sich den letzten usage-Block. */\nconst responseRewriter = (alias: string) => {\n const decoder = new TextDecoder();\n let pending = \"\";\n let usage: Usage | undefined;\n let overflow = false;\n const rewrite = (text: string): string => {\n let parsed: unknown;\n try { parsed = JSON.parse(text); }\n catch { return text; }\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) return text;\n const body = parsed as { model?: unknown; provider?: unknown; usage?: { prompt_tokens?: unknown; completion_tokens?: unknown } };\n if (body.usage && typeof body.usage === \"object\") {\n const number = (value: unknown) => typeof value === \"number\" ? value : undefined;\n usage = { prompt: number(body.usage.prompt_tokens), completion: number(body.usage.completion_tokens) };\n }\n if (typeof body.model !== \"string\" && body.provider === undefined) return text;\n const rest = Object.fromEntries(Object.entries(body).filter(([key]) => key !== \"provider\"));\n return JSON.stringify(typeof body.model === \"string\" ? { ...rest, model: alias } : rest);\n };\n const line = (text: string): string => text.startsWith(\"data: \") ? `data: ${rewrite(text.slice(6))}` : text;\n return {\n feed: (chunk: Buffer): string => {\n const text = decoder.decode(chunk, { stream: true });\n if (overflow) return text;\n pending += text;\n const lines = pending.split(\"\\n\");\n pending = lines.pop() ?? \"\";\n const forwarded = lines.map((entry) => `${line(entry)}\\n`).join(\"\");\n if (pending.length <= MAX_SCAN_BYTES) return forwarded;\n overflow = true;\n const remainder = pending;\n pending = \"\";\n return `${forwarded}${remainder}`;\n },\n finish: (): string => {\n const rest = overflow || !pending.trim() ? pending : pending.startsWith(\"data: \") ? line(pending) : rewrite(pending);\n pending = \"\";\n return rest;\n },\n usage: (): Usage | undefined => usage,\n };\n};\n\nconst openAiError = (message: string, type: string) => ({ error: { message, type } });\n\nconst forwardedHeaders = (request: IncomingMessage, apiKey: string): Record<string, string> => {\n const headers: Record<string, string> = {};\n for (const [name, value] of Object.entries(request.headers)) {\n if (DROPPED_HEADERS.has(name) || value === undefined) continue;\n headers[name] = Array.isArray(value) ? value.join(\", \") : value;\n }\n headers[\"content-type\"] = \"application/json\";\n headers.authorization = `Bearer ${apiKey}`;\n return headers;\n};\n\nexport interface RelayRouteOptions {\n aliases: () => readonly ResolvedAlias[];\n log: (line: string) => void;\n fetch?: typeof fetch;\n}\n\nconst modelsPath = `${RELAY_PATH_PREFIX}/models`;\nconst completionsPath = `${RELAY_PATH_PREFIX}/chat/completions`;\n\nexport const createRelayRoutes = (options: RelayRouteOptions): HttpRouteContribution[] => {\n const fetchImpl = options.fetch ?? fetch;\n return [\n {\n id: \"ragents.model-relay.models\",\n isApiPath: (pathname) => pathname.startsWith(`${RELAY_PATH_PREFIX}/`),\n matches: (request, url) => request.method === \"GET\" && url.pathname === modelsPath,\n requiredRights: [RELAY_RIGHT],\n handle: ({ response }) => {\n writeJson(response, 200, { object: \"list\", data: options.aliases().map(catalogEntryOf) });\n },\n },\n {\n id: \"ragents.model-relay.completions\",\n isApiPath: (pathname) => pathname.startsWith(`${RELAY_PATH_PREFIX}/`),\n matches: (request, url) => request.method === \"POST\" && url.pathname === completionsPath,\n requiredRights: [RELAY_RIGHT],\n handle: async ({ request, response, access }) => {\n const user = access.user?.id ?? \"anonym\";\n let text: string;\n try {\n text = await readBody(request, MAX_REQUEST_BYTES);\n } catch (error) {\n if (!(error instanceof PayloadTooLargeError)) throw error;\n writeJson(response, 413, openAiError(error.message, \"invalid_request_error\"));\n return;\n }\n let parsed: unknown;\n try { parsed = JSON.parse(text); }\n catch { parsed = undefined; }\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n writeJson(response, 400, openAiError(\"Der Anfragek\u00F6rper ist kein JSON-Objekt\", \"invalid_request_error\"));\n return;\n }\n const alias = (parsed as { model?: unknown }).model;\n if (typeof alias !== \"string\" || !alias) {\n writeJson(response, 400, openAiError(\"Die Anfrage nennt kein Modell\", \"invalid_request_error\"));\n return;\n }\n const resolved = options.aliases().find((candidate) => candidate.alias === alias);\n if (!resolved) {\n writeJson(response, 404, openAiError(`Das Modell ${alias} ist auf diesem Relay unbekannt`, \"invalid_request_error\"));\n return;\n }\n const controller = new AbortController();\n response.once(\"close\", () => controller.abort());\n const target = `${resolved.upstream.baseUrl}/chat/completions`;\n let upstream: Response;\n try {\n upstream = await fetchImpl(target, {\n method: \"POST\",\n headers: forwardedHeaders(request, resolved.upstream.apiKey),\n body: JSON.stringify({ ...parsed, model: resolved.model.id }),\n signal: controller.signal,\n });\n } catch (error) {\n if (controller.signal.aborted) return;\n const reason = error instanceof Error ? error.message : String(error);\n options.log(`${user} ${alias} -> ${resolved.upstream.id}/${resolved.model.id}: nicht erreichbar (${reason})`);\n writeJson(response, 502, openAiError(`Der Anbieter hinter ${alias} ist nicht erreichbar`, \"server_error\"));\n return;\n }\n response.writeHead(upstream.status, {\n \"Content-Type\": upstream.headers.get(\"content-type\") ?? \"application/octet-stream\",\n \"Cache-Control\": \"no-store\",\n });\n const rewriter = responseRewriter(alias);\n if (upstream.body) {\n const source = Readable.fromWeb(upstream.body as ReadableStream<Uint8Array>);\n try {\n await pipeline(source, async function* (chunks: AsyncIterable<Buffer>) {\n for await (const chunk of chunks) {\n const forwarded = rewriter.feed(chunk);\n if (forwarded) yield forwarded;\n }\n const rest = rewriter.finish();\n if (rest) yield rest;\n }, response);\n } catch (error) {\n if (!controller.signal.aborted) throw error;\n }\n } else {\n response.end();\n }\n const usage = rewriter.usage();\n const tokens = usage ? ` tokens in=${usage.prompt ?? \"?\"} out=${usage.completion ?? \"?\"}` : \"\";\n options.log(`${user} ${alias} -> ${resolved.upstream.id}/${resolved.model.id}: ${upstream.status}${tokens}`);\n },\n },\n ];\n};\n"],
5
- "mappings": ";;;;AACA,SAAS,2BAA2B;AAEpC,SAAS,gBAAgB;;;ACHzB,SAAS,8BAA+C;AAGjD,IAAM,eAAe,CAAC,YAA0D;AACrF,MAAI,QAAQ,WAAW,EAAG,OAAM,IAAI,MAAM,gHAAgH;AAC1J,SAAO;AACT;AAEO,IAAM,mBAAmB,OAAO,OAAO;AAAA,EAC5C,SAAS,MAAM,aAAa,uBAAuB,CAAC;AACtD,CAAC;;;ACTD,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAGzB,SAAS,sBAAsB,UAAU,iBAAiB;AAInD,IAAM,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,GAAG,KAAK;AAC5F,gBAAQ,IAAI,GAAG,IAAI,IAAI,KAAK,OAAO,SAAS,SAAS,EAAE,IAAI,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE;AAAA,MAC7G;AAAA,IACF;AAAA,EACF;AACF;;;AF9MA,IAAM,mBAAkC;AAAA,EACtC,UAAU,EAAE,IAAI,sBAAsB;AAAA,EACtC,UAAU,CAAC,SAAS;AAClB,UAAM,YAAY,KAAK,QAAQ,mBAAmB;AAClD,QAAI;AACJ,UAAM,UAAU,MAAgC,aAAa,eAAe,iBAAiB,QAAQ,GAAG,UAAU,CAAC;AACnH,UAAM,MAAM,IAAI,SAAS,KAAK,QAAQ,KAAK,WAAW,CAAC;AACvD,SAAK,UAAU;AAAA,MACb,IAAI;AAAA,MACJ,YAAY,MAAM;AAChB,cAAM,OAAO,QAAQ;AACrB,YAAI,MAAM,cAAc,KAAK,IAAI,CAAC,UAAU,GAAG,MAAM,KAAK,IAAI,MAAM,SAAS,EAAE,IAAI,MAAM,MAAM,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC,MAAM;AACrH,gBAAQ,IAAI,iBAAiB,KAAK,MAAM,6BAA6B,KAAK,IAAI,CAAC,UAAU,MAAM,KAAK,EAAE,KAAK,IAAI,CAAC,GAAG;AAAA,MACrH;AAAA,MACA,UAAU,MAAM,IAAI,MAAM;AAAA,IAC5B,CAAC;AACD,SAAK,KAAK,GAAG,kBAAkB,EAAE,SAAS,KAAK,CAAC,SAAS,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC;AAAA,EAC7E;AACF;AAEO,IAAM,SAAuB;AAAA,EAClC,QAAQ,MAAM;AAChB;",
4
+ "sourcesContent": ["import type { RAgentsPlugin } from \"@ragents/engine\";\nimport { modelUpstreamsToken } from \"@ragents/host/plugin-support/model-upstreams.js\";\nimport type { PluginModule } from \"@ragents/host/plugin-support/plugin-module.js\";\nimport { Protocol } from \"@ragents/host/protocol.js\";\nimport { modelRelayConfig } from \"./config.js\";\nimport { createRelayRoutes, resolveAliases, type ResolvedAlias } from \"./relay.js\";\n\nconst modelRelayPlugin: RAgentsPlugin = {\n manifest: { id: \"ragents.model-relay\" },\n register: (host) => {\n const upstreams = host.service(modelUpstreamsToken);\n let resolved: readonly ResolvedAlias[] | undefined;\n const aliases = (): readonly ResolvedAlias[] => resolved ??= resolveAliases(modelRelayConfig.aliases(), modelRelayConfig.upstreams(upstreams()));\n const log = new Protocol(host.storage.root(\"relay.log\"));\n host.lifecycle({\n id: \"ragents.model-relay\",\n initialize: () => {\n const list = aliases();\n log.write(`=== Start: ${list.map((entry) => `${entry.alias}=${entry.upstream.id}/${entry.model.id}`).join(\", \")} ===`);\n console.log(`Model relay: ${list.length} aliases under /relay/v1 (${list.map((entry) => entry.alias).join(\", \")})`);\n },\n shutdown: () => log.close(),\n });\n host.http(...createRelayRoutes({ aliases, log: (line) => log.write(line) }));\n },\n};\n\nexport const plugin: PluginModule = {\n create: () => modelRelayPlugin,\n};\n", "import { configuredModelAliases, type ModelAlias } from \"@ragents/host/plugin-support/model-aliases.js\";\nimport { configuredModelProviders } from \"@ragents/host/plugin-support/model-providers.js\";\nimport type { ModelUpstream } from \"@ragents/host/plugin-support/model-upstreams.js\";\n\n/** The relay offers the profile's aliases (MODEL_ALIASES in the host section), the same as for its own runs. */\nexport const relayAliases = (aliases: readonly ModelAlias[]): readonly ModelAlias[] => {\n if (aliases.length === 0) throw new Error(\"ragents.model-relay needs MODEL_ALIASES in the host section, a list of { alias, model, thinking?, thinkingLevels?, compaction }\");\n return aliases;\n};\n\nexport const modelRelayConfig = Object.freeze({\n aliases: () => relayAliases(configuredModelAliases()),\n /** The profile's own providers (MODEL_PROVIDERS in the host section) next to those of the product. */\n upstreams: (product: readonly ModelUpstream[]): readonly ModelUpstream[] => [...product, ...configuredModelProviders()],\n});\n", "import type { IncomingMessage } from \"node:http\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport type { ReadableStream } from \"node:stream/web\";\nimport type { HttpRouteContribution } from \"@ragents/engine\";\nimport { PayloadTooLargeError, readBody, writeJson } from \"@ragents/host/plugin-support/http.js\";\nimport { validatedAliasModel, type ModelAlias } from \"@ragents/host/plugin-support/model-aliases.js\";\nimport type { ModelUpstream } from \"@ragents/host/plugin-support/model-upstreams.js\";\n\nexport const RELAY_PATH_PREFIX = \"/relay/v1\";\nexport const RELAY_RIGHT = \"models.use\";\n\nconst MAX_REQUEST_BYTES = 64 * 1024 * 1024;\nconst MAX_SCAN_BYTES = 8 * 1024 * 1024;\nconst DROPPED_HEADERS = new Set([\"host\", \"authorization\", \"cookie\", \"content-length\", \"connection\", \"transfer-encoding\", \"accept-encoding\", \"expect\"]);\n\nexport interface ResolvedAlias {\n readonly alias: string;\n readonly upstream: ModelUpstream;\n readonly model: ModelUpstream[\"models\"][number];\n /** The model as the alias offers it: with its thinking levels and compaction values. */\n readonly offered: ModelUpstream[\"models\"][number];\n}\n\n/** Every alias must point to a configured provider and a model from its catalog that its thinking levels and compaction values fit. */\nexport const resolveAliases = (aliases: readonly ModelAlias[], upstreams: readonly ModelUpstream[]): readonly ResolvedAlias[] =>\n aliases.map((entry) => {\n const upstream = upstreams.find((candidate) => candidate.id === entry.upstream);\n if (!upstream) {\n const available = upstreams.map((candidate) => candidate.id).join(\", \") || \"none\";\n throw new Error(`MODEL_ALIASES: the provider ${entry.upstream} behind ${entry.alias} is not configured on this server (available: ${available})`);\n }\n const model = upstream.models.find((candidate) => candidate.id === entry.model);\n if (!model) throw new Error(`MODEL_ALIASES: the model ${entry.model} behind ${entry.alias} is missing from the catalog of ${entry.upstream}`);\n return { alias: entry.alias, upstream, model, offered: validatedAliasModel(entry, model) };\n });\n\n/** The catalog entry names only what the consumer needs for the wire and compaction; name, provider and costs stay with the server. */\nexport const catalogEntryOf = (resolved: ResolvedAlias) => ({\n id: resolved.alias,\n object: \"model\" as const,\n owned_by: \"relay\",\n catalog: {\n reasoning: resolved.offered.reasoning,\n ...(resolved.offered.thinkingLevelMap ? { thinkingLevelMap: resolved.offered.thinkingLevelMap } : {}),\n input: [...resolved.offered.input],\n contextWindow: resolved.offered.contextWindow,\n maxTokens: resolved.offered.maxTokens,\n compaction: resolved.offered.compaction,\n ...(resolved.offered.compat ? { compat: resolved.offered.compat } : {}),\n },\n});\n\ninterface Usage {\n readonly prompt: number | undefined;\n readonly completion: number | undefined;\n}\n\n/** Replaces the real model name with the alias in the forwarded stream, removes the provider and remembers the last usage block. */\nconst responseRewriter = (alias: string) => {\n const decoder = new TextDecoder();\n let pending = \"\";\n let usage: Usage | undefined;\n let overflow = false;\n const rewrite = (text: string): string => {\n let parsed: unknown;\n try { parsed = JSON.parse(text); }\n catch { return text; }\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) return text;\n const body = parsed as { model?: unknown; provider?: unknown; usage?: { prompt_tokens?: unknown; completion_tokens?: unknown } };\n if (body.usage && typeof body.usage === \"object\") {\n const number = (value: unknown) => typeof value === \"number\" ? value : undefined;\n usage = { prompt: number(body.usage.prompt_tokens), completion: number(body.usage.completion_tokens) };\n }\n if (typeof body.model !== \"string\" && body.provider === undefined) return text;\n const rest = Object.fromEntries(Object.entries(body).filter(([key]) => key !== \"provider\"));\n return JSON.stringify(typeof body.model === \"string\" ? { ...rest, model: alias } : rest);\n };\n const line = (text: string): string => text.startsWith(\"data: \") ? `data: ${rewrite(text.slice(6))}` : text;\n return {\n feed: (chunk: Buffer): string => {\n const text = decoder.decode(chunk, { stream: true });\n if (overflow) return text;\n pending += text;\n const lines = pending.split(\"\\n\");\n pending = lines.pop() ?? \"\";\n const forwarded = lines.map((entry) => `${line(entry)}\\n`).join(\"\");\n if (pending.length <= MAX_SCAN_BYTES) return forwarded;\n overflow = true;\n const remainder = pending;\n pending = \"\";\n return `${forwarded}${remainder}`;\n },\n finish: (): string => {\n const rest = overflow || !pending.trim() ? pending : pending.startsWith(\"data: \") ? line(pending) : rewrite(pending);\n pending = \"\";\n return rest;\n },\n usage: (): Usage | undefined => usage,\n };\n};\n\nconst openAiError = (message: string, type: string) => ({ error: { message, type } });\n\nconst forwardedHeaders = (request: IncomingMessage, apiKey: string): Record<string, string> => {\n const headers: Record<string, string> = {};\n for (const [name, value] of Object.entries(request.headers)) {\n if (DROPPED_HEADERS.has(name) || value === undefined) continue;\n headers[name] = Array.isArray(value) ? value.join(\", \") : value;\n }\n headers[\"content-type\"] = \"application/json\";\n headers.authorization = `Bearer ${apiKey}`;\n return headers;\n};\n\nexport interface RelayRouteOptions {\n aliases: () => readonly ResolvedAlias[];\n log: (line: string) => void;\n fetch?: typeof fetch;\n}\n\nconst modelsPath = `${RELAY_PATH_PREFIX}/models`;\nconst completionsPath = `${RELAY_PATH_PREFIX}/chat/completions`;\n\nexport const createRelayRoutes = (options: RelayRouteOptions): HttpRouteContribution[] => {\n const fetchImpl = options.fetch ?? fetch;\n return [\n {\n id: \"ragents.model-relay.models\",\n isApiPath: (pathname) => pathname.startsWith(`${RELAY_PATH_PREFIX}/`),\n matches: (request, url) => request.method === \"GET\" && url.pathname === modelsPath,\n requiredRights: [RELAY_RIGHT],\n handle: ({ response }) => {\n writeJson(response, 200, { object: \"list\", data: options.aliases().map(catalogEntryOf) });\n },\n },\n {\n id: \"ragents.model-relay.completions\",\n isApiPath: (pathname) => pathname.startsWith(`${RELAY_PATH_PREFIX}/`),\n matches: (request, url) => request.method === \"POST\" && url.pathname === completionsPath,\n requiredRights: [RELAY_RIGHT],\n handle: async ({ request, response, access }) => {\n const user = access.user?.id ?? \"anonymous\";\n let text: string;\n try {\n text = await readBody(request, MAX_REQUEST_BYTES);\n } catch (error) {\n if (!(error instanceof PayloadTooLargeError)) throw error;\n writeJson(response, 413, openAiError(error.message, \"invalid_request_error\"));\n return;\n }\n let parsed: unknown;\n try { parsed = JSON.parse(text); }\n catch { parsed = undefined; }\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n writeJson(response, 400, openAiError(\"The request body is not a JSON object\", \"invalid_request_error\"));\n return;\n }\n const alias = (parsed as { model?: unknown }).model;\n if (typeof alias !== \"string\" || !alias) {\n writeJson(response, 400, openAiError(\"The request names no model\", \"invalid_request_error\"));\n return;\n }\n const resolved = options.aliases().find((candidate) => candidate.alias === alias);\n if (!resolved) {\n writeJson(response, 404, openAiError(`The model ${alias} is unknown on this relay`, \"invalid_request_error\"));\n return;\n }\n const controller = new AbortController();\n response.once(\"close\", () => controller.abort());\n const target = `${resolved.upstream.baseUrl}/chat/completions`;\n let upstream: Response;\n try {\n upstream = await fetchImpl(target, {\n method: \"POST\",\n headers: forwardedHeaders(request, resolved.upstream.apiKey),\n body: JSON.stringify({ ...parsed, model: resolved.model.id }),\n signal: controller.signal,\n });\n } catch (error) {\n if (controller.signal.aborted) return;\n const reason = error instanceof Error ? error.message : String(error);\n options.log(`${user} ${alias} -> ${resolved.upstream.id}/${resolved.model.id}: unreachable (${reason})`);\n writeJson(response, 502, openAiError(`The provider behind ${alias} is unreachable`, \"server_error\"));\n return;\n }\n response.writeHead(upstream.status, {\n \"Content-Type\": upstream.headers.get(\"content-type\") ?? \"application/octet-stream\",\n \"Cache-Control\": \"no-store\",\n });\n const rewriter = responseRewriter(alias);\n if (upstream.body) {\n const source = Readable.fromWeb(upstream.body as ReadableStream<Uint8Array>);\n try {\n await pipeline(source, async function* (chunks: AsyncIterable<Buffer>) {\n for await (const chunk of chunks) {\n const forwarded = rewriter.feed(chunk);\n if (forwarded) yield forwarded;\n }\n const rest = rewriter.finish();\n if (rest) yield rest;\n }, response);\n } catch (error) {\n if (!controller.signal.aborted) throw error;\n }\n } else {\n response.end();\n }\n const usage = rewriter.usage();\n const tokens = usage ? ` tokens in=${usage.prompt ?? \"?\"} out=${usage.completion ?? \"?\"}` : \"\";\n options.log(`${user} ${alias} -> ${resolved.upstream.id}/${resolved.model.id}: ${upstream.status}${tokens}`);\n },\n },\n ];\n};\n"],
5
+ "mappings": ";;;;AACA,SAAS,2BAA2B;AAEpC,SAAS,gBAAgB;;;ACH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AI,CAAC,UAAU,MAAM,KAAK,EAAE,KAAK,IAAI,CAAC,GAAG;AAAA,MACpH;AAAA,MACA,UAAU,MAAM,IAAI,MAAM;AAAA,IAC5B,CAAC;AACD,SAAK,KAAK,GAAG,kBAAkB,EAAE,SAAS,KAAK,CAAC,SAAS,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC;AAAA,EAC7E;AACF;AAEO,IAAM,SAAuB;AAAA,EAClC,QAAQ,MAAM;AAChB;",
6
6
  "names": []
7
7
  }
@@ -171,8 +171,8 @@
171
171
  ]
172
172
  }
173
173
  },
174
- "stand": "48bc275b47b4228a8f135c017d0c139819f6abe10dc37cfe077de6874314642b",
175
- "sourceStand": "310b306e3eb56d1c97a357a44831b5907c722df27448c29f017f32eb9804ab6e",
174
+ "stand": "cdcaea3317795b44966101ef70caba8115eb84b021af7dc8ffd933d7e8f7293c",
175
+ "sourceStand": "07b42ebea0b4257732442a1899a54b9fec7d2c4daeb7450f76049823618fe0a3",
176
176
  "server": "server/index.js",
177
177
  "web": {
178
178
  "entry": "web/index.js",
@@ -33,28 +33,28 @@ var MAX_SURFACE_TILES = 64;
33
33
  var surfaceTileNodeOf = (input) => {
34
34
  const entities = /* @__PURE__ */ new Set();
35
35
  const parse = (value, where, depth) => {
36
- if (depth > MAX_SURFACE_TILE_DEPTH) throw new Error(`${where}: h\xF6chstens ${MAX_SURFACE_TILE_DEPTH} verschachtelte Teilungen sind erlaubt`);
37
- if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`${where} muss eine Kachel oder Teilung sein`);
36
+ if (depth > MAX_SURFACE_TILE_DEPTH) throw new Error(`${where}: at most ${MAX_SURFACE_TILE_DEPTH} nested splits are allowed`);
37
+ if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`${where} must be a tile or a split`);
38
38
  const node = value;
39
39
  if (Object.hasOwn(node, "entity")) {
40
- if (Object.keys(node).some((key2) => key2 !== "entity" && key2 !== "chatInput")) throw new Error(`${where}: eine Kachel tr\xE4gt nur entity und chatInput; eine Teilung direction, weights und children`);
41
- if (typeof node.entity !== "string") throw new Error(`${where}.entity muss @handle oder app:<name>/<view> sein`);
40
+ if (Object.keys(node).some((key2) => key2 !== "entity" && key2 !== "chatInput")) throw new Error(`${where}: a tile carries only entity and chatInput; a split direction, weights and children`);
41
+ if (typeof node.entity !== "string") throw new Error(`${where}.entity must be @handle or app:<name>/<view>`);
42
42
  const entity = surfaceEntityOf(node.entity);
43
43
  const key = surfaceEntityKey(entity);
44
44
  if (node.chatInput !== void 0 && (entity.kind !== "actor" || typeof node.chatInput !== "boolean")) {
45
- throw new Error(`${where}.chatInput ist nur f\xFCr Actors als Wahrheitswert erlaubt`);
45
+ throw new Error(`${where}.chatInput is only allowed for actors, as a boolean`);
46
46
  }
47
- if (entities.has(key)) throw new Error(`${where}: ${key} ist mehr als einmal als Kachel platziert`);
47
+ if (entities.has(key)) throw new Error(`${where}: ${key} is placed as a tile more than once`);
48
48
  entities.add(key);
49
- if (entities.size > MAX_SURFACE_TILES) throw new Error(`H\xF6chstens ${MAX_SURFACE_TILES} Kacheln sind erlaubt`);
49
+ if (entities.size > MAX_SURFACE_TILES) throw new Error(`At most ${MAX_SURFACE_TILES} tiles are allowed`);
50
50
  return node.chatInput === void 0 ? { entity: key } : { entity: key, chatInput: node.chatInput };
51
51
  }
52
- if (Object.keys(node).some((key) => !["direction", "weights", "children"].includes(key))) throw new Error(`${where}: eine Teilung tr\xE4gt nur direction, weights und children`);
53
- if (node.direction !== "horizontal" && node.direction !== "vertical") throw new Error(`${where}.direction muss horizontal oder vertical sein`);
52
+ if (Object.keys(node).some((key) => !["direction", "weights", "children"].includes(key))) throw new Error(`${where}: a split carries only direction, weights and children`);
53
+ if (node.direction !== "horizontal" && node.direction !== "vertical") throw new Error(`${where}.direction must be horizontal or vertical`);
54
54
  if (!Array.isArray(node.weights) || node.weights.length !== 2 || node.weights.some((weight) => typeof weight !== "number" || !Number.isFinite(weight) || weight <= 0)) {
55
- throw new Error(`${where}.weights muss genau zwei endliche positive Zahlen enthalten`);
55
+ throw new Error(`${where}.weights must contain exactly two finite positive numbers`);
56
56
  }
57
- if (!Array.isArray(node.children) || node.children.length !== 2) throw new Error(`${where}.children muss genau zwei Kacheln oder Teilungen enthalten`);
57
+ if (!Array.isArray(node.children) || node.children.length !== 2) throw new Error(`${where}.children must contain exactly two tiles or splits`);
58
58
  return {
59
59
  direction: node.direction,
60
60
  weights: [node.weights[0], node.weights[1]],
@@ -76,26 +76,26 @@ var surfaceEntityOf = (text) => {
76
76
  const trimmed = text.trim();
77
77
  if (trimmed.startsWith("@")) {
78
78
  const handle = handleKey(trimmed);
79
- if (!handle || /\s/.test(handle)) throw new Error(`Entit\xE4t ${JSON.stringify(text)}: nach dem @ fehlt ein Handle`);
79
+ if (!handle || /\s/.test(handle)) throw new Error(`Entity ${JSON.stringify(text)}: a handle is missing after the @`);
80
80
  return { kind: "actor", handle };
81
81
  }
82
82
  const match = /^app:(.+)$/s.exec(trimmed);
83
83
  if (!match) {
84
- throw new Error(`Entit\xE4t ${JSON.stringify(text)}: erwartet @handle oder app:<id>`);
84
+ throw new Error(`Entity ${JSON.stringify(text)}: expected @handle or app:<id>`);
85
85
  }
86
86
  const id = match[1].trim();
87
- if (!id) throw new Error(`Entit\xE4t ${JSON.stringify(text)}: die ID nach dem Doppelpunkt ist leer`);
87
+ if (!id) throw new Error(`Entity ${JSON.stringify(text)}: the ID after the colon is empty`);
88
88
  return { kind: "app", id };
89
89
  };
90
90
  var surfaceEntityKey = (entity) => entity.kind === "actor" ? `@${entity.handle}` : `app:${entity.id}`;
91
91
  var LEGACY_KEYS = ["nodes", "shapes", "lines", "mode"];
92
92
  var surfaceLayoutOf = (value) => {
93
- if (!isRecord(value)) throw new Error("Die Anordnung muss ein Objekt mit root sein");
93
+ if (!isRecord(value)) throw new Error("The arrangement must be an object with root");
94
94
  const legacy = LEGACY_KEYS.filter((key) => key in value);
95
95
  if (legacy.length > 0) {
96
- throw new Error(`Die Programmanordnung stammt aus der entfernten freien Fl\xE4che (${legacy.join(", ")}); canvas_layout_replace mit root setzt sie als Kachelaufteilung neu`);
96
+ throw new Error(`The program arrangement comes from the removed free surface (${legacy.join(", ")}); canvas_layout_replace with root sets it anew as a tile layout`);
97
97
  }
98
- if (!("root" in value)) throw new Error("root fehlt; erwartet wird eine Kachel, eine Teilung oder null");
98
+ if (!("root" in value)) throw new Error("root is missing; expected a tile, a split or null");
99
99
  return { root: value.root === null ? null : surfaceTileNodeOf(value.root) };
100
100
  };
101
101
 
@@ -108,7 +108,7 @@ var surfaceToolMetadata = {
108
108
  };
109
109
  var canDesignSurface = defineToolAvailability({
110
110
  availability: "conditional",
111
- availabilityDetail: "Nur f\xFCr Agenten und TypeScript-Actors mit der Capability plugin.state.write.",
111
+ availabilityDetail: "Only for agents and TypeScript actors with the capability plugin.state.write.",
112
112
  requiredCapabilities: ["plugin.state.write"]
113
113
  }, (actor) => actor.kind !== "human" && holdsUsable(actor, "plugin.state.write"));
114
114
  var tileSchema = Type.Cyclic({
@@ -138,15 +138,15 @@ var parsedLayout = (input) => {
138
138
  var isStopped = (actor) => actor.kind !== "human" && actor.lifecycle.kind === "stopped";
139
139
  var surfaceActorOf = (view, reference, where) => {
140
140
  const entity = surfaceEntityOf(reference);
141
- if (entity.kind !== "actor") throw invalid(`${where}: ${reference} ist kein Actor`);
141
+ if (entity.kind !== "actor") throw invalid(`${where}: ${reference} is not an actor`);
142
142
  const handle = entity.handle;
143
143
  const found = actorByHandle(view.actors, handle);
144
144
  if (!found) {
145
145
  const known = view.actors.filter((actor) => actor.kind !== "human").map((actor) => `@${actor.handle}`);
146
- throw invalid(`${where}: @${handle} ist kein Actor dieses Runs. Vorhanden: ${known.join(", ") || "keine"}`);
146
+ throw invalid(`${where}: @${handle} is not an actor of this run. Present: ${known.join(", ") || "none"}`);
147
147
  }
148
148
  if (found.kind === "human") {
149
- throw invalid(`${where}: @${handle} ist der Mensch im Chat; der Chat liegt fest links neben der Fl\xE4che`);
149
+ throw invalid(`${where}: @${handle} is the human in the chat; the chat is fixed to the left of the surface`);
150
150
  }
151
151
  return found;
152
152
  };
@@ -166,7 +166,7 @@ var resolveAppReferences = (view, layout) => {
166
166
  try {
167
167
  return `app:${resolveActorView(programs, entity.id).view.id}`;
168
168
  } catch (error) {
169
- throw invalid(`${where}: ${reference}: ${error instanceof Error ? error.message : String(error)} Fl\xE4chenentit\xE4ten erhalten das Pr\xE4fix app:.`);
169
+ throw invalid(`${where}: ${reference}: ${error instanceof Error ? error.message : String(error)} Surface entities get the prefix app:.`);
170
170
  }
171
171
  };
172
172
  return parsedLayout({ root: layout.root ? mapSurfaceTileEntities(layout.root, (entity) => resolve(entity, "root")) : null });
@@ -206,14 +206,14 @@ import { defineRunFunction as defineRunFunction2, defineToolAvailability as defi
206
206
  import { toolDescriptorFrom as toolDescriptorFrom2 } from "@ragents/host/plugin-support/agent-tool.js";
207
207
  var available = defineToolAvailability2({
208
208
  availability: "conditional",
209
- availabilityDetail: "F\xFCr den Primary-Actor mit execution.stopOwned im eigenen Run.",
209
+ availabilityDetail: "For the primary actor with execution.stopOwned in its own run.",
210
210
  requiredCapabilities: ["execution.stopOwned"]
211
211
  }, (actor, view) => actor.kind !== "human" && actor.id === view.primaryActorId && holdsUsable2(actor, "execution.stopOwned"));
212
212
  var createRunStopContributor = (stop, onError) => {
213
213
  const definition = defineRunFunction2({
214
214
  name: "run_stop",
215
- label: "Run stoppen",
216
- description: "Leitet den vollst\xE4ndigen Stopp des eigenen Runs ein: laufende Turns, Werkzeuge, Unteragenten und Plugin-Dienste. Gespr\xE4ch und Dateien bleiben erhalten. Bricht auch den eigenen Turn ab; die Annahme ist keine Best\xE4tigung abgeschlossener Bereinigung. Bei Benutzerwunsch nach vollst\xE4ndigem Abbruch sofort verwenden, keine Abbruchnachricht an besch\xE4ftigte Agenten senden.",
215
+ label: "Stop run",
216
+ description: "Initiates the complete stop of your own run: running turns, tools, subagents and plugin services. Conversation and files are kept. Also cancels your own turn; acceptance is not a confirmation of completed cleanup. Use immediately when the user wants a complete cancellation; do not send a cancel message to busy agents.",
217
217
  schema: Type2.Object({}, { additionalProperties: false }),
218
218
  resultSchema: Type2.Object({ requested: Type2.Literal(true) }, { additionalProperties: false }),
219
219
  available,
@@ -238,12 +238,12 @@ var orchestrationPlugin = {
238
238
  host.functions(createSurfaceToolContributor());
239
239
  host.functions(createRunStopContributor(
240
240
  (runId) => host.service(runManagementToken)().stop(runId),
241
- (error) => console.error("Run-Stopp durch den Koordinator fehlgeschlagen", error)
241
+ (error) => console.error("Run stop by the coordinator failed", error)
242
242
  ));
243
243
  host.operations({
244
244
  id: "actor_input",
245
- label: "Actor-Input einreihen",
246
- description: "Reiht f\xFCr einen Actor einen normalen Texteingang unter der gebundenen Identit\xE4t ein - als Agent oder, aus einer App-Aktion, als Besitzer des Runs. Best\xE4tigt nur das Einreihen. TypeScript-Actors verstehen ausschlie\xDFlich ihr programmiertes Eingabeprotokoll, keine freien Auftr\xE4ge.",
245
+ label: "Enqueue actor input",
246
+ description: "Enqueues a normal text input for an actor under the bound identity - as an agent or, from an app action, as the owner of the run. Only confirms the enqueueing. TypeScript actors understand only their programmed input protocol, no free-form tasks.",
247
247
  schema: actorInputSchema,
248
248
  resultSchema: eventResultSchemaOf("actor.input.enqueued"),
249
249
  operator: "direct",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../plugins/ragents.orchestration/server/index.ts", "../../../plugins/ragents.orchestration/server/surface-tool.ts", "../../../plugins/ragents.orchestration/contract.ts", "../../../plugins/ragents.orchestration/tiled-layout.ts", "../../../plugins/ragents.orchestration/server/run-stop-tool.ts"],
4
- "sourcesContent": ["import {\n actorInputSchema,\n agentTools,\n enqueueActorInput,\n eventResultSchemaOf,\n ScriptDriver,\n type ActorInputRequest,\n type RAgentsPlugin,\n} from \"@ragents/engine\";\nimport { runtimeProviderToken } from \"@ragents/host/ragents/host-services.js\";\nimport { pluginAsset } from \"@ragents/host/plugin-support/plugin-folder.js\";\nimport type { PluginModule } from \"@ragents/host/plugin-support/plugin-module.js\";\nimport { boundToTools, handlebarsPrompt } from \"@ragents/host/plugin-support/prompt.js\";\nimport { createSurfaceToolContributor } from \"./surface-tool.js\";\nimport { createRunStopContributor } from \"./run-stop-tool.js\";\nimport { runManagementToken } from \"@ragents/host/ragents/global-chat.js\";\n\nconst orchestrationPlugin: RAgentsPlugin = {\n manifest: { id: \"ragents.orchestration\" },\n register: (host) => {\n host.functions(createSurfaceToolContributor());\n host.functions(createRunStopContributor(\n (runId) => host.service(runManagementToken)().stop(runId),\n (error) => console.error(\"Run-Stopp durch den Koordinator fehlgeschlagen\", error),\n ));\n host.operations({\n id: \"actor_input\",\n label: \"Actor-Input einreihen\",\n description: \"Reiht f\u00FCr einen Actor einen normalen Texteingang unter der gebundenen Identit\u00E4t ein - \"\n + \"als Agent oder, aus einer App-Aktion, als Besitzer des Runs. Best\u00E4tigt nur das Einreihen. TypeScript-Actors verstehen ausschlie\u00DFlich ihr programmiertes Eingabeprotokoll, keine freien Auftr\u00E4ge.\",\n schema: actorInputSchema,\n resultSchema: eventResultSchemaOf(\"actor.input.enqueued\"),\n operator: \"direct\",\n execute: (context, input) =>\n enqueueActorInput(host.service(runtimeProviderToken)(), {\n actorId: context.principal.actorId,\n commandId: context.invocationId,\n ...(context.principal.kind === \"agent\" && context.principal.turnId\n ? { turnId: context.principal.turnId }\n : {}),\n correlationId: context.invocationId,\n causationId: context.invocationId,\n }, context.runId, input as ActorInputRequest),\n });\n host.script({\n id: \"typescript\",\n create: (context) => ({\n driver: new ScriptDriver({ runtime: context.runtime }),\n }),\n });\n host.prompts(\n handlebarsPrompt(\"ragents.orchestration.prompt\", 600, pluginAsset(\"ragents.orchestration\", \"orchestration.hbs\")),\n boundToTools(\n handlebarsPrompt(\"ragents.orchestration.surface\", 650, pluginAsset(\"ragents.orchestration\", \"surface.hbs\")),\n \"canvas_layout_replace\",\n ),\n );\n },\n};\n\nexport const plugin: PluginModule = { create: () => orchestrationPlugin };\n", "import { Type } from \"typebox\";\nimport {\n DomainError,\n actorByHandle,\n defineRunFunction,\n defineToolAvailability,\n holdsUsable,\n type RunFunction,\n type RunView,\n type ToolContributor,\n} from \"@ragents/engine\";\nimport { toolDescriptorFrom } from \"@ragents/host/plugin-support/agent-tool.js\";\nimport { ACTOR_PROGRAMS_STATE_ID, resolveActorView, type ActorProgramState } from \"@ragents/host/plugin-support/actor-programs/contract.js\";\nimport {\n ORCHESTRATION_PLUGIN_ID,\n surfaceEntityOf,\n surfaceLayoutOf,\n type SurfaceLayout,\n} from \"../contract.js\";\nimport { surfaceTileEntities, mapSurfaceTileEntities } from \"../tiled-layout.js\";\n\nexport const surfaceToolMetadata = {\n name: \"canvas_layout_replace\",\n label: \"Replace Surface Layout\",\n description: \"Arrange actors and mini-apps as tiles on the viewport-filling work surface, using a binary tree of weighted splits.\",\n longDescription: \"root is the whole arrangement and replaces the stored one. A tile is {entity:'@helper'} or \"\n + \"{entity:'app:@workspace/main'}; a split is {direction:'horizontal',weights:[1,1],children:[tile,tile]}. \"\n + \"horizontal means left/right, vertical means top/bottom, and weights give the ratio of the two children. \"\n + \"App left, chat right at 50:50: {root:{direction:'horizontal',weights:[1,1],children:[\"\n + \"{entity:'app:@workspace/main'},{entity:'@helper'}]}}. One tile above two tiles at 2:1: \"\n + \"{root:{direction:'vertical',weights:[2,1],children:[{entity:'@lead'},\"\n + \"{direction:'horizontal',weights:[1,1],children:[{entity:'@first'},{entity:'@second'}]}]}}. \"\n + \"root:null clears the surface. Dividers are draggable, so do not resend a layout to fight a personal arrangement. \"\n + \"Participants you do not place stay reachable through the run header.\",\n} as const;\n\nexport const canDesignSurface = defineToolAvailability({\n availability: \"conditional\",\n availabilityDetail: \"Nur f\u00FCr Agenten und TypeScript-Actors mit der Capability plugin.state.write.\",\n requiredCapabilities: [\"plugin.state.write\"],\n}, (actor) => actor.kind !== \"human\" && holdsUsable(actor, \"plugin.state.write\"));\n\nconst tileSchema = Type.Cyclic({\n SurfaceTile: Type.Union([\n Type.Object({\n entity: Type.String({ minLength: 1, description: \"Actor @handle or activated mini-app app:@handle/view-key or app:program-name/view-key; the server resolves the view ID\" }),\n chatInput: Type.Optional(Type.Boolean({ description: \"Actor tiles only: false hides the chat composer in the tile; default true. Does not change permissions or the inspector\" })),\n }, { additionalProperties: false }),\n Type.Object({\n direction: Type.Union([Type.Literal(\"horizontal\"), Type.Literal(\"vertical\")]),\n weights: Type.Tuple([Type.Number({ exclusiveMinimum: 0 }), Type.Number({ exclusiveMinimum: 0 })]),\n children: Type.Tuple([Type.Ref(\"SurfaceTile\"), Type.Ref(\"SurfaceTile\")]),\n }, { additionalProperties: false }),\n ]),\n}, \"SurfaceTile\");\n\nconst surfaceLayoutSchema = Type.Object({\n root: Type.Union([tileSchema, Type.Null()], { description: \"The whole arrangement: a tile or a binary split. Maximum 64 unique tiles and 16 nested splits. null clears the surface\" }),\n});\n\nconst invalid = (message: string) => new DomainError(\"invalid-surface-layout\", message, 400);\n\nconst parsedLayout = (input: unknown): SurfaceLayout => {\n try {\n return surfaceLayoutOf(input);\n } catch (caught) {\n throw invalid(caught instanceof Error ? caught.message : String(caught));\n }\n};\n\nconst isStopped = (actor: RunView[\"actors\"][number]) => actor.kind !== \"human\" && actor.lifecycle.kind === \"stopped\";\n\nconst surfaceActorOf = (view: RunView, reference: string, where: string) => {\n const entity = surfaceEntityOf(reference);\n if (entity.kind !== \"actor\") throw invalid(`${where}: ${reference} ist kein Actor`);\n const handle = entity.handle;\n const found = actorByHandle(view.actors, handle);\n if (!found) {\n const known = view.actors.filter((actor) => actor.kind !== \"human\").map((actor) => `@${actor.handle}`);\n throw invalid(`${where}: @${handle} ist kein Actor dieses Runs. Vorhanden: ${known.join(\", \") || \"keine\"}`);\n }\n if (found.kind === \"human\") {\n throw invalid(`${where}: @${handle} ist der Mensch im Chat; der Chat liegt fest links neben der Fl\u00E4che`);\n }\n return found;\n};\n\nconst isActorReference = (reference: string) => surfaceEntityOf(reference).kind === \"actor\";\n\nconst resolveAppReferences = (view: RunView, layout: SurfaceLayout): SurfaceLayout => {\n const programs = view.pluginStates.flatMap((entry) => {\n if (entry.pluginId !== ACTOR_PROGRAMS_STATE_ID || entry.scope.kind !== \"actor\") return [];\n const actorId = entry.scope.actorId;\n const actor = view.actors.find((candidate) => candidate.id === actorId);\n if (!actor || actor.kind === \"human\" || isStopped(actor)) return [];\n const { program } = entry.state as unknown as ActorProgramState;\n return program ? [program] : [];\n });\n const resolve = (reference: string, where: string): string => {\n const entity = surfaceEntityOf(reference);\n if (entity.kind !== \"app\") return reference;\n try {\n return `app:${resolveActorView(programs, entity.id).view.id}`;\n } catch (error) {\n throw invalid(`${where}: ${reference}: ${error instanceof Error ? error.message : String(error)} Fl\u00E4chenentit\u00E4ten erhalten das Pr\u00E4fix app:.`);\n }\n };\n return parsedLayout({ root: layout.root ? mapSurfaceTileEntities(layout.root, (entity) => resolve(entity, \"root\")) : null });\n};\n\n/** Resolve app names and validate the placed actors before any layout is stored. */\nexport const checkLayoutAgainstRun = (view: RunView, input: SurfaceLayout): SurfaceLayout => {\n const layout = resolveAppReferences(view, input);\n for (const reference of surfaceTileEntities(layout.root)) {\n if (isActorReference(reference)) surfaceActorOf(view, reference, \"root\");\n }\n return layout;\n};\n\nexport const createSurfaceTool = (): RunFunction =>\n defineRunFunction({\n ...surfaceToolMetadata,\n schema: surfaceLayoutSchema,\n resultSchema: Type.Null(),\n available: canDesignSurface,\n run: ({ runtime, caller, context }, toolCallId, input) => {\n const view = runtime.view(caller.runId);\n const layout = checkLayoutAgainstRun(view, parsedLayout(input));\n runtime.replacePluginState(context(toolCallId), caller.runId, {\n pluginId: ORCHESTRATION_PLUGIN_ID,\n scope: { kind: \"run\" },\n state: layout,\n });\n return null;\n },\n });\n\nexport const createSurfaceToolContributor = (): ToolContributor => ({\n name: \"ragents.orchestration.surface\",\n descriptors: [toolDescriptorFrom(surfaceToolMetadata, canDesignSurface)],\n tools: () => [createSurfaceTool()],\n});\n", "import { handleKey } from \"@ragents/engine/src/http/contracts\";\nimport { surfaceTileNodeOf } from \"./tiled-layout.js\";\n\nexport const ORCHESTRATION_PLUGIN_ID = \"ragents.orchestration\";\n\nexport type SurfaceEntity =\n | { kind: \"actor\"; handle: string }\n | { kind: \"app\"; id: string };\n\nexport type SurfaceTileNode =\n | { entity: string; chatInput?: boolean }\n | { direction: \"horizontal\" | \"vertical\"; weights: [number, number]; children: [SurfaceTileNode, SurfaceTileNode] };\n\nexport type SurfaceLayout = {\n root: SurfaceTileNode | null;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport const surfaceEntityOf = (text: string): SurfaceEntity => {\n const trimmed = text.trim();\n if (trimmed.startsWith(\"@\")) {\n const handle = handleKey(trimmed);\n if (!handle || /\\s/.test(handle)) throw new Error(`Entit\u00E4t ${JSON.stringify(text)}: nach dem @ fehlt ein Handle`);\n return { kind: \"actor\", handle };\n }\n const match = /^app:(.+)$/s.exec(trimmed);\n if (!match) {\n throw new Error(`Entit\u00E4t ${JSON.stringify(text)}: erwartet @handle oder app:<id>`);\n }\n const id = match[1].trim();\n if (!id) throw new Error(`Entit\u00E4t ${JSON.stringify(text)}: die ID nach dem Doppelpunkt ist leer`);\n return { kind: \"app\", id };\n};\n\nexport const surfaceEntityKey = (entity: SurfaceEntity): string =>\n entity.kind === \"actor\" ? `@${entity.handle}` : `app:${entity.id}`;\n\nconst LEGACY_KEYS = [\"nodes\", \"shapes\", \"lines\", \"mode\"] as const;\n\n/** Parses and validates a tile layout; throws a German error naming the first violation. */\nexport const surfaceLayoutOf = (value: unknown): SurfaceLayout => {\n if (!isRecord(value)) throw new Error(\"Die Anordnung muss ein Objekt mit root sein\");\n const legacy = LEGACY_KEYS.filter((key) => key in value);\n if (legacy.length > 0) {\n throw new Error(`Die Programmanordnung stammt aus der entfernten freien Fl\u00E4che (${legacy.join(\", \")}); `\n + \"canvas_layout_replace mit root setzt sie als Kachelaufteilung neu\");\n }\n if (!(\"root\" in value)) throw new Error(\"root fehlt; erwartet wird eine Kachel, eine Teilung oder null\");\n return { root: value.root === null ? null : surfaceTileNodeOf(value.root) };\n};\n", "import { surfaceEntityKey, surfaceEntityOf, type SurfaceTileNode } from \"./contract.js\";\n\nexport type { SurfaceTileNode } from \"./contract.js\";\n\nexport const MAX_SURFACE_TILE_DEPTH = 16;\nexport const MAX_SURFACE_TILES = 64;\n\nexport const surfaceTileNodeOf = (input: unknown): SurfaceTileNode => {\n const entities = new Set<string>();\n const parse = (value: unknown, where: string, depth: number): SurfaceTileNode => {\n if (depth > MAX_SURFACE_TILE_DEPTH) throw new Error(`${where}: h\u00F6chstens ${MAX_SURFACE_TILE_DEPTH} verschachtelte Teilungen sind erlaubt`);\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) throw new Error(`${where} muss eine Kachel oder Teilung sein`);\n const node = value as Record<string, unknown>;\n if (Object.hasOwn(node, \"entity\")) {\n if (Object.keys(node).some((key) => key !== \"entity\" && key !== \"chatInput\")) throw new Error(`${where}: eine Kachel tr\u00E4gt nur entity und chatInput; eine Teilung direction, weights und children`);\n if (typeof node.entity !== \"string\") throw new Error(`${where}.entity muss @handle oder app:<name>/<view> sein`);\n const entity = surfaceEntityOf(node.entity);\n const key = surfaceEntityKey(entity);\n if (node.chatInput !== undefined && (entity.kind !== \"actor\" || typeof node.chatInput !== \"boolean\")) {\n throw new Error(`${where}.chatInput ist nur f\u00FCr Actors als Wahrheitswert erlaubt`);\n }\n if (entities.has(key)) throw new Error(`${where}: ${key} ist mehr als einmal als Kachel platziert`);\n entities.add(key);\n if (entities.size > MAX_SURFACE_TILES) throw new Error(`H\u00F6chstens ${MAX_SURFACE_TILES} Kacheln sind erlaubt`);\n return node.chatInput === undefined ? { entity: key } : { entity: key, chatInput: node.chatInput as boolean };\n }\n if (Object.keys(node).some((key) => ![\"direction\", \"weights\", \"children\"].includes(key))) throw new Error(`${where}: eine Teilung tr\u00E4gt nur direction, weights und children`);\n if (node.direction !== \"horizontal\" && node.direction !== \"vertical\") throw new Error(`${where}.direction muss horizontal oder vertical sein`);\n if (!Array.isArray(node.weights) || node.weights.length !== 2 || node.weights.some((weight) => typeof weight !== \"number\" || !Number.isFinite(weight) || weight <= 0)) {\n throw new Error(`${where}.weights muss genau zwei endliche positive Zahlen enthalten`);\n }\n if (!Array.isArray(node.children) || node.children.length !== 2) throw new Error(`${where}.children muss genau zwei Kacheln oder Teilungen enthalten`);\n return {\n direction: node.direction,\n weights: [node.weights[0], node.weights[1]],\n children: [parse(node.children[0], `${where}.children[0]`, depth + 1), parse(node.children[1], `${where}.children[1]`, depth + 1)],\n };\n };\n return parse(input, \"root\", 0);\n};\n\n/** A tile hides the chat composer of its actor only when its leaf says chatInput: false. */\nexport const surfaceTileChatInput = (root: SurfaceTileNode | null | undefined, entity: string): boolean =>\n !root ? true : \"entity\" in root\n ? root.entity !== entity || root.chatInput !== false\n : surfaceTileChatInput(root.children[0], entity) && surfaceTileChatInput(root.children[1], entity);\n\nexport const surfaceTileEntities = (root: SurfaceTileNode | null | undefined): string[] =>\n !root ? [] : \"entity\" in root ? [root.entity] : root.children.flatMap(surfaceTileEntities);\n\nexport const mapSurfaceTileEntities = (root: SurfaceTileNode, resolve: (entity: string) => string): SurfaceTileNode =>\n \"entity\" in root ? { ...root, entity: resolve(root.entity) } : {\n ...root,\n children: [mapSurfaceTileEntities(root.children[0], resolve), mapSurfaceTileEntities(root.children[1], resolve)],\n };\n", "import { Type } from \"typebox\";\nimport { defineRunFunction, defineToolAvailability, holdsUsable, type ToolContributor } from \"@ragents/engine\";\nimport { toolDescriptorFrom } from \"@ragents/host/plugin-support/agent-tool.js\";\n\nconst available = defineToolAvailability({\n availability: \"conditional\",\n availabilityDetail: \"F\u00FCr den Primary-Actor mit execution.stopOwned im eigenen Run.\",\n requiredCapabilities: [\"execution.stopOwned\"],\n}, (actor, view) => actor.kind !== \"human\" && actor.id === view.primaryActorId && holdsUsable(actor, \"execution.stopOwned\"));\n\nexport const createRunStopContributor = (stop: (runId: string) => Promise<void>, onError: (error: unknown) => void): ToolContributor => {\n const definition = defineRunFunction({\n name: \"run_stop\",\n label: \"Run stoppen\",\n description: \"Leitet den vollst\u00E4ndigen Stopp des eigenen Runs ein: laufende Turns, Werkzeuge, Unteragenten und Plugin-Dienste. Gespr\u00E4ch und Dateien bleiben erhalten. Bricht auch den eigenen Turn ab; die Annahme ist keine Best\u00E4tigung abgeschlossener Bereinigung. Bei Benutzerwunsch nach vollst\u00E4ndigem Abbruch sofort verwenden, keine Abbruchnachricht an besch\u00E4ftigte Agenten senden.\",\n schema: Type.Object({}, { additionalProperties: false }),\n resultSchema: Type.Object({ requested: Type.Literal(true) }, { additionalProperties: false }),\n available,\n run: ({ caller, signal }) => {\n signal?.throwIfAborted();\n void stop(caller.runId).catch(onError);\n return { requested: true as const };\n },\n });\n return {\n name: \"ragents.orchestration.run-stop\",\n descriptors: [toolDescriptorFrom(definition, available)],\n tools: () => [definition],\n };\n};\n"],
5
- "mappings": ";;;;AAAA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAE5B,SAAS,cAAc,wBAAwB;;;ACZ/C,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,0BAA0B;AACnC,SAAS,yBAAyB,wBAAgD;;;ACZlF,SAAS,iBAAiB;;;ACInB,IAAM,yBAAyB;AAC/B,IAAM,oBAAoB;AAE1B,IAAM,oBAAoB,CAAC,UAAoC;AACpE,QAAM,WAAW,oBAAI,IAAY;AACjC,QAAM,QAAQ,CAAC,OAAgB,OAAe,UAAmC;AAC/E,QAAI,QAAQ,uBAAwB,OAAM,IAAI,MAAM,GAAG,KAAK,kBAAe,sBAAsB,wCAAwC;AACzI,QAAI,OAAO,UAAU,YAAY,UAAU,QAA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AAAA,QACnB,GAAI,QAAQ,UAAU,SAAS,WAAW,QAAQ,UAAU,SACxD,EAAE,QAAQ,QAAQ,UAAU,OAAO,IACnC,CAAC;AAAA,QACL,eAAe,QAAQ;AAAA,QACvB,aAAa,QAAQ;AAAA,MACvB,GAAG,QAAQ,OAAO,KAA0B;AAAA,IAChD,CAAC;AACD,SAAK,OAAO;AAAA,MACV,IAAI;AAAA,MACJ,QAAQ,CAAC,aAAa;AAAA,QACpB,QAAQ,IAAI,aAAa,EAAE,SAAS,QAAQ,QAAQ,CAAC;AAAA,MACvD;AAAA,IACF,CAAC;AACD,SAAK;AAAA,MACH,iBAAiB,gCAAgC,KAAK,YAAY,yBAAyB,mBAAmB,CAAC;AAAA,MAC/G;AAAA,QACE,iBAAiB,iCAAiC,KAAK,YAAY,yBAAyB,aAAa,CAAC;AAAA,QAC1G;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,SAAuB,EAAE,QAAQ,MAAM,oBAAoB;",
4
+ "sourcesContent": ["import {\n actorInputSchema,\n agentTools,\n enqueueActorInput,\n eventResultSchemaOf,\n ScriptDriver,\n type ActorInputRequest,\n type RAgentsPlugin,\n} from \"@ragents/engine\";\nimport { runtimeProviderToken } from \"@ragents/host/ragents/host-services.js\";\nimport { pluginAsset } from \"@ragents/host/plugin-support/plugin-folder.js\";\nimport type { PluginModule } from \"@ragents/host/plugin-support/plugin-module.js\";\nimport { boundToTools, handlebarsPrompt } from \"@ragents/host/plugin-support/prompt.js\";\nimport { createSurfaceToolContributor } from \"./surface-tool.js\";\nimport { createRunStopContributor } from \"./run-stop-tool.js\";\nimport { runManagementToken } from \"@ragents/host/ragents/global-chat.js\";\n\nconst orchestrationPlugin: RAgentsPlugin = {\n manifest: { id: \"ragents.orchestration\" },\n register: (host) => {\n host.functions(createSurfaceToolContributor());\n host.functions(createRunStopContributor(\n (runId) => host.service(runManagementToken)().stop(runId),\n (error) => console.error(\"Run stop by the coordinator failed\", error),\n ));\n host.operations({\n id: \"actor_input\",\n label: \"Enqueue actor input\",\n description: \"Enqueues a normal text input for an actor under the bound identity - \"\n + \"as an agent or, from an app action, as the owner of the run. Only confirms the enqueueing. TypeScript actors understand only their programmed input protocol, no free-form tasks.\",\n schema: actorInputSchema,\n resultSchema: eventResultSchemaOf(\"actor.input.enqueued\"),\n operator: \"direct\",\n execute: (context, input) =>\n enqueueActorInput(host.service(runtimeProviderToken)(), {\n actorId: context.principal.actorId,\n commandId: context.invocationId,\n ...(context.principal.kind === \"agent\" && context.principal.turnId\n ? { turnId: context.principal.turnId }\n : {}),\n correlationId: context.invocationId,\n causationId: context.invocationId,\n }, context.runId, input as ActorInputRequest),\n });\n host.script({\n id: \"typescript\",\n create: (context) => ({\n driver: new ScriptDriver({ runtime: context.runtime }),\n }),\n });\n host.prompts(\n handlebarsPrompt(\"ragents.orchestration.prompt\", 600, pluginAsset(\"ragents.orchestration\", \"orchestration.hbs\")),\n boundToTools(\n handlebarsPrompt(\"ragents.orchestration.surface\", 650, pluginAsset(\"ragents.orchestration\", \"surface.hbs\")),\n \"canvas_layout_replace\",\n ),\n );\n },\n};\n\nexport const plugin: PluginModule = { create: () => orchestrationPlugin };\n", "import { Type } from \"typebox\";\nimport {\n DomainError,\n actorByHandle,\n defineRunFunction,\n defineToolAvailability,\n holdsUsable,\n type RunFunction,\n type RunView,\n type ToolContributor,\n} from \"@ragents/engine\";\nimport { toolDescriptorFrom } from \"@ragents/host/plugin-support/agent-tool.js\";\nimport { ACTOR_PROGRAMS_STATE_ID, resolveActorView, type ActorProgramState } from \"@ragents/host/plugin-support/actor-programs/contract.js\";\nimport {\n ORCHESTRATION_PLUGIN_ID,\n surfaceEntityOf,\n surfaceLayoutOf,\n type SurfaceLayout,\n} from \"../contract.js\";\nimport { surfaceTileEntities, mapSurfaceTileEntities } from \"../tiled-layout.js\";\n\nexport const surfaceToolMetadata = {\n name: \"canvas_layout_replace\",\n label: \"Replace Surface Layout\",\n description: \"Arrange actors and mini-apps as tiles on the viewport-filling work surface, using a binary tree of weighted splits.\",\n longDescription: \"root is the whole arrangement and replaces the stored one. A tile is {entity:'@helper'} or \"\n + \"{entity:'app:@workspace/main'}; a split is {direction:'horizontal',weights:[1,1],children:[tile,tile]}. \"\n + \"horizontal means left/right, vertical means top/bottom, and weights give the ratio of the two children. \"\n + \"App left, chat right at 50:50: {root:{direction:'horizontal',weights:[1,1],children:[\"\n + \"{entity:'app:@workspace/main'},{entity:'@helper'}]}}. One tile above two tiles at 2:1: \"\n + \"{root:{direction:'vertical',weights:[2,1],children:[{entity:'@lead'},\"\n + \"{direction:'horizontal',weights:[1,1],children:[{entity:'@first'},{entity:'@second'}]}]}}. \"\n + \"root:null clears the surface. Dividers are draggable, so do not resend a layout to fight a personal arrangement. \"\n + \"Participants you do not place stay reachable through the run header.\",\n} as const;\n\nexport const canDesignSurface = defineToolAvailability({\n availability: \"conditional\",\n availabilityDetail: \"Only for agents and TypeScript actors with the capability plugin.state.write.\",\n requiredCapabilities: [\"plugin.state.write\"],\n}, (actor) => actor.kind !== \"human\" && holdsUsable(actor, \"plugin.state.write\"));\n\nconst tileSchema = Type.Cyclic({\n SurfaceTile: Type.Union([\n Type.Object({\n entity: Type.String({ minLength: 1, description: \"Actor @handle or activated mini-app app:@handle/view-key or app:program-name/view-key; the server resolves the view ID\" }),\n chatInput: Type.Optional(Type.Boolean({ description: \"Actor tiles only: false hides the chat composer in the tile; default true. Does not change permissions or the inspector\" })),\n }, { additionalProperties: false }),\n Type.Object({\n direction: Type.Union([Type.Literal(\"horizontal\"), Type.Literal(\"vertical\")]),\n weights: Type.Tuple([Type.Number({ exclusiveMinimum: 0 }), Type.Number({ exclusiveMinimum: 0 })]),\n children: Type.Tuple([Type.Ref(\"SurfaceTile\"), Type.Ref(\"SurfaceTile\")]),\n }, { additionalProperties: false }),\n ]),\n}, \"SurfaceTile\");\n\nconst surfaceLayoutSchema = Type.Object({\n root: Type.Union([tileSchema, Type.Null()], { description: \"The whole arrangement: a tile or a binary split. Maximum 64 unique tiles and 16 nested splits. null clears the surface\" }),\n});\n\nconst invalid = (message: string) => new DomainError(\"invalid-surface-layout\", message, 400);\n\nconst parsedLayout = (input: unknown): SurfaceLayout => {\n try {\n return surfaceLayoutOf(input);\n } catch (caught) {\n throw invalid(caught instanceof Error ? caught.message : String(caught));\n }\n};\n\nconst isStopped = (actor: RunView[\"actors\"][number]) => actor.kind !== \"human\" && actor.lifecycle.kind === \"stopped\";\n\nconst surfaceActorOf = (view: RunView, reference: string, where: string) => {\n const entity = surfaceEntityOf(reference);\n if (entity.kind !== \"actor\") throw invalid(`${where}: ${reference} is not an actor`);\n const handle = entity.handle;\n const found = actorByHandle(view.actors, handle);\n if (!found) {\n const known = view.actors.filter((actor) => actor.kind !== \"human\").map((actor) => `@${actor.handle}`);\n throw invalid(`${where}: @${handle} is not an actor of this run. Present: ${known.join(\", \") || \"none\"}`);\n }\n if (found.kind === \"human\") {\n throw invalid(`${where}: @${handle} is the human in the chat; the chat is fixed to the left of the surface`);\n }\n return found;\n};\n\nconst isActorReference = (reference: string) => surfaceEntityOf(reference).kind === \"actor\";\n\nconst resolveAppReferences = (view: RunView, layout: SurfaceLayout): SurfaceLayout => {\n const programs = view.pluginStates.flatMap((entry) => {\n if (entry.pluginId !== ACTOR_PROGRAMS_STATE_ID || entry.scope.kind !== \"actor\") return [];\n const actorId = entry.scope.actorId;\n const actor = view.actors.find((candidate) => candidate.id === actorId);\n if (!actor || actor.kind === \"human\" || isStopped(actor)) return [];\n const { program } = entry.state as unknown as ActorProgramState;\n return program ? [program] : [];\n });\n const resolve = (reference: string, where: string): string => {\n const entity = surfaceEntityOf(reference);\n if (entity.kind !== \"app\") return reference;\n try {\n return `app:${resolveActorView(programs, entity.id).view.id}`;\n } catch (error) {\n throw invalid(`${where}: ${reference}: ${error instanceof Error ? error.message : String(error)} Surface entities get the prefix app:.`);\n }\n };\n return parsedLayout({ root: layout.root ? mapSurfaceTileEntities(layout.root, (entity) => resolve(entity, \"root\")) : null });\n};\n\n/** Resolve app names and validate the placed actors before any layout is stored. */\nexport const checkLayoutAgainstRun = (view: RunView, input: SurfaceLayout): SurfaceLayout => {\n const layout = resolveAppReferences(view, input);\n for (const reference of surfaceTileEntities(layout.root)) {\n if (isActorReference(reference)) surfaceActorOf(view, reference, \"root\");\n }\n return layout;\n};\n\nexport const createSurfaceTool = (): RunFunction =>\n defineRunFunction({\n ...surfaceToolMetadata,\n schema: surfaceLayoutSchema,\n resultSchema: Type.Null(),\n available: canDesignSurface,\n run: ({ runtime, caller, context }, toolCallId, input) => {\n const view = runtime.view(caller.runId);\n const layout = checkLayoutAgainstRun(view, parsedLayout(input));\n runtime.replacePluginState(context(toolCallId), caller.runId, {\n pluginId: ORCHESTRATION_PLUGIN_ID,\n scope: { kind: \"run\" },\n state: layout,\n });\n return null;\n },\n });\n\nexport const createSurfaceToolContributor = (): ToolContributor => ({\n name: \"ragents.orchestration.surface\",\n descriptors: [toolDescriptorFrom(surfaceToolMetadata, canDesignSurface)],\n tools: () => [createSurfaceTool()],\n});\n", "import { handleKey } from \"@ragents/engine/src/http/contracts\";\nimport { surfaceTileNodeOf } from \"./tiled-layout.js\";\n\nexport const ORCHESTRATION_PLUGIN_ID = \"ragents.orchestration\";\n\nexport type SurfaceEntity =\n | { kind: \"actor\"; handle: string }\n | { kind: \"app\"; id: string };\n\nexport type SurfaceTileNode =\n | { entity: string; chatInput?: boolean }\n | { direction: \"horizontal\" | \"vertical\"; weights: [number, number]; children: [SurfaceTileNode, SurfaceTileNode] };\n\nexport type SurfaceLayout = {\n root: SurfaceTileNode | null;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport const surfaceEntityOf = (text: string): SurfaceEntity => {\n const trimmed = text.trim();\n if (trimmed.startsWith(\"@\")) {\n const handle = handleKey(trimmed);\n if (!handle || /\\s/.test(handle)) throw new Error(`Entity ${JSON.stringify(text)}: a handle is missing after the @`);\n return { kind: \"actor\", handle };\n }\n const match = /^app:(.+)$/s.exec(trimmed);\n if (!match) {\n throw new Error(`Entity ${JSON.stringify(text)}: expected @handle or app:<id>`);\n }\n const id = match[1].trim();\n if (!id) throw new Error(`Entity ${JSON.stringify(text)}: the ID after the colon is empty`);\n return { kind: \"app\", id };\n};\n\nexport const surfaceEntityKey = (entity: SurfaceEntity): string =>\n entity.kind === \"actor\" ? `@${entity.handle}` : `app:${entity.id}`;\n\nconst LEGACY_KEYS = [\"nodes\", \"shapes\", \"lines\", \"mode\"] as const;\n\n/** Parses and validates a tile layout; throws an error naming the first violation. */\nexport const surfaceLayoutOf = (value: unknown): SurfaceLayout => {\n if (!isRecord(value)) throw new Error(\"The arrangement must be an object with root\");\n const legacy = LEGACY_KEYS.filter((key) => key in value);\n if (legacy.length > 0) {\n throw new Error(`The program arrangement comes from the removed free surface (${legacy.join(\", \")}); `\n + \"canvas_layout_replace with root sets it anew as a tile layout\");\n }\n if (!(\"root\" in value)) throw new Error(\"root is missing; expected a tile, a split or null\");\n return { root: value.root === null ? null : surfaceTileNodeOf(value.root) };\n};\n", "import { surfaceEntityKey, surfaceEntityOf, type SurfaceTileNode } from \"./contract.js\";\n\nexport type { SurfaceTileNode } from \"./contract.js\";\n\nexport const MAX_SURFACE_TILE_DEPTH = 16;\nexport const MAX_SURFACE_TILES = 64;\n\nexport const surfaceTileNodeOf = (input: unknown): SurfaceTileNode => {\n const entities = new Set<string>();\n const parse = (value: unknown, where: string, depth: number): SurfaceTileNode => {\n if (depth > MAX_SURFACE_TILE_DEPTH) throw new Error(`${where}: at most ${MAX_SURFACE_TILE_DEPTH} nested splits are allowed`);\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) throw new Error(`${where} must be a tile or a split`);\n const node = value as Record<string, unknown>;\n if (Object.hasOwn(node, \"entity\")) {\n if (Object.keys(node).some((key) => key !== \"entity\" && key !== \"chatInput\")) throw new Error(`${where}: a tile carries only entity and chatInput; a split direction, weights and children`);\n if (typeof node.entity !== \"string\") throw new Error(`${where}.entity must be @handle or app:<name>/<view>`);\n const entity = surfaceEntityOf(node.entity);\n const key = surfaceEntityKey(entity);\n if (node.chatInput !== undefined && (entity.kind !== \"actor\" || typeof node.chatInput !== \"boolean\")) {\n throw new Error(`${where}.chatInput is only allowed for actors, as a boolean`);\n }\n if (entities.has(key)) throw new Error(`${where}: ${key} is placed as a tile more than once`);\n entities.add(key);\n if (entities.size > MAX_SURFACE_TILES) throw new Error(`At most ${MAX_SURFACE_TILES} tiles are allowed`);\n return node.chatInput === undefined ? { entity: key } : { entity: key, chatInput: node.chatInput as boolean };\n }\n if (Object.keys(node).some((key) => ![\"direction\", \"weights\", \"children\"].includes(key))) throw new Error(`${where}: a split carries only direction, weights and children`);\n if (node.direction !== \"horizontal\" && node.direction !== \"vertical\") throw new Error(`${where}.direction must be horizontal or vertical`);\n if (!Array.isArray(node.weights) || node.weights.length !== 2 || node.weights.some((weight) => typeof weight !== \"number\" || !Number.isFinite(weight) || weight <= 0)) {\n throw new Error(`${where}.weights must contain exactly two finite positive numbers`);\n }\n if (!Array.isArray(node.children) || node.children.length !== 2) throw new Error(`${where}.children must contain exactly two tiles or splits`);\n return {\n direction: node.direction,\n weights: [node.weights[0], node.weights[1]],\n children: [parse(node.children[0], `${where}.children[0]`, depth + 1), parse(node.children[1], `${where}.children[1]`, depth + 1)],\n };\n };\n return parse(input, \"root\", 0);\n};\n\n/** A tile hides the chat composer of its actor only when its leaf says chatInput: false. */\nexport const surfaceTileChatInput = (root: SurfaceTileNode | null | undefined, entity: string): boolean =>\n !root ? true : \"entity\" in root\n ? root.entity !== entity || root.chatInput !== false\n : surfaceTileChatInput(root.children[0], entity) && surfaceTileChatInput(root.children[1], entity);\n\nexport const surfaceTileEntities = (root: SurfaceTileNode | null | undefined): string[] =>\n !root ? [] : \"entity\" in root ? [root.entity] : root.children.flatMap(surfaceTileEntities);\n\nexport const mapSurfaceTileEntities = (root: SurfaceTileNode, resolve: (entity: string) => string): SurfaceTileNode =>\n \"entity\" in root ? { ...root, entity: resolve(root.entity) } : {\n ...root,\n children: [mapSurfaceTileEntities(root.children[0], resolve), mapSurfaceTileEntities(root.children[1], resolve)],\n };\n", "import { Type } from \"typebox\";\nimport { defineRunFunction, defineToolAvailability, holdsUsable, type ToolContributor } from \"@ragents/engine\";\nimport { toolDescriptorFrom } from \"@ragents/host/plugin-support/agent-tool.js\";\n\nconst available = defineToolAvailability({\n availability: \"conditional\",\n availabilityDetail: \"For the primary actor with execution.stopOwned in its own run.\",\n requiredCapabilities: [\"execution.stopOwned\"],\n}, (actor, view) => actor.kind !== \"human\" && actor.id === view.primaryActorId && holdsUsable(actor, \"execution.stopOwned\"));\n\nexport const createRunStopContributor = (stop: (runId: string) => Promise<void>, onError: (error: unknown) => void): ToolContributor => {\n const definition = defineRunFunction({\n name: \"run_stop\",\n label: \"Stop run\",\n description: \"Initiates the complete stop of your own run: running turns, tools, subagents and plugin services. Conversation and files are kept. Also cancels your own turn; acceptance is not a confirmation of completed cleanup. Use immediately when the user wants a complete cancellation; do not send a cancel message to busy agents.\",\n schema: Type.Object({}, { additionalProperties: false }),\n resultSchema: Type.Object({ requested: Type.Literal(true) }, { additionalProperties: false }),\n available,\n run: ({ caller, signal }) => {\n signal?.throwIfAborted();\n void stop(caller.runId).catch(onError);\n return { requested: true as const };\n },\n });\n return {\n name: \"ragents.orchestration.run-stop\",\n descriptors: [toolDescriptorFrom(definition, available)],\n tools: () => [definition],\n };\n};\n"],
5
+ "mappings": ";;;;AAAA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAE5B,SAAS,cAAc,wBAAwB;;;ACZ/C,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,0BAA0B;AACnC,SAAS,yBAAyB,wBAAgD;;;ACZlF,SAAS,iBAAiB;;;ACInB,IAAM,y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AK,WAAW;AAAA,MACd,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,aAAa;AAAA,MAEb,QAAQ;AAAA,MACR,cAAc,oBAAoB,sBAAsB;AAAA,MACxD,UAAU;AAAA,MACV,SAAS,CAAC,SAAS,UACjB,kBAAkB,KAAK,QAAQ,oBAAoB,EAAE,GAAG;AAAA,QACtD,SAAS,QAAQ,UAAU;AAAA,QAC3B,WAAW,QAAQ;AAAA,QACnB,GAAI,QAAQ,UAAU,SAAS,WAAW,QAAQ,UAAU,SACxD,EAAE,QAAQ,QAAQ,UAAU,OAAO,IACnC,CAAC;AAAA,QACL,eAAe,QAAQ;AAAA,QACvB,aAAa,QAAQ;AAAA,MACvB,GAAG,QAAQ,OAAO,KAA0B;AAAA,IAChD,CAAC;AACD,SAAK,OAAO;AAAA,MACV,IAAI;AAAA,MACJ,QAAQ,CAAC,aAAa;AAAA,QACpB,QAAQ,IAAI,aAAa,EAAE,SAAS,QAAQ,QAAQ,CAAC;AAAA,MACvD;AAAA,IACF,CAAC;AACD,SAAK;AAAA,MACH,iBAAiB,gCAAgC,KAAK,YAAY,yBAAyB,mBAAmB,CAAC;AAAA,MAC/G;AAAA,QACE,iBAAiB,iCAAiC,KAAK,YAAY,yBAAyB,aAAa,CAAC;AAAA,QAC1G;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,SAAuB,EAAE,QAAQ,MAAM,oBAAoB;",
6
6
  "names": ["key", "Type", "defineRunFunction", "defineToolAvailability", "holdsUsable", "toolDescriptorFrom"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{n as r}from"/plugins/ragents.orchestration/web/chunks/chunk-OQYCNYXN.js";var n=new Map,s=new Set,i=new Set,a=e=>(s.add(e),()=>s.delete(e));function d(e,t){t?n.set(e,t):n.delete(e),s.forEach(o=>o())}function u(e){let t=()=>n.get(e)??i;return r(a,t,t)}export{d as a,u as b};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-OSKPH6SZ.js.map
1
+ import{n as r}from"/plugins/ragents.orchestration/web/chunks/chunk-HOBLI364.js";var n=new Map,s=new Set,i=new Set,a=e=>(s.add(e),()=>s.delete(e));function d(e,t){t?n.set(e,t):n.delete(e),s.forEach(o=>o())}function u(e){let t=()=>n.get(e)??i;return r(a,t,t)}export{d as a,u as b};
2
+ //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-CFMJD5ZI.js.map
@@ -0,0 +1,2 @@
1
+ var e=(t,r)=>{let o=globalThis.__ragentsHostModules?.[t];if(o===void 0)throw new Error(`The host does not provide ${t}`);if(!(r in o))throw new Error(`The host does not provide ${r} from ${t}; the bundle was built against a newer host`);return o[r]};var a=e("react","createContext");var f=e("react","useContext");var u=e("react","useEffect");var s=e("react","useState");var d=e("react","useSyncExternalStore");var m=e("react","createElement");var l=e("react","forwardRef");var p=e("react","memo");var x=e("react","useCallback");var n=e("react","useId");var c=e("react","useLayoutEffect");var i=e("react","useMemo");var E=e("react","useRef");export{e as a,a as b,m as c,l as d,p as e,x as f,f as g,u as h,n as i,c as j,i as k,E as l,s as m,d as n};
2
+ //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-HOBLI364.js.map
@@ -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#useContext", "ragents-host-value:react#useEffect", "ragents-host-value:react#useState", "ragents-host-value:react#useSyncExternalStore", "ragents-host-value:react#createElement", "ragents-host-value:react#forwardRef", "ragents-host-value:react#memo", "ragents-host-value:react#useCallback", "ragents-host-value:react#useId", "ragents-host-value:react#useLayoutEffect", "ragents-host-value:react#useMemo", "ragents-host-value:react#useRef"],
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\", \"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\", \"useState\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useSyncExternalStore\");\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\", \"memo\");\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\", \"useId\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useLayoutEffect\");\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\", \"useRef\");\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,GAAS,MAAM,IAAI,MAAM,mBAAmBD,CAAI,QAAQD,CAAS,+DAA+D,EAC9I,OAAOE,EAAOD,CAAI,CACpB,ECJA,IAAOE,EAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EAAQC,EAAK,QAAS,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,WAAW,ECAxC,IAAOC,EAAQC,EAAK,QAAS,UAAU,ECAvC,IAAOC,EAAQC,EAAK,QAAS,sBAAsB,ECAnD,IAAOC,EAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EAAQC,EAAK,QAAS,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,MAAM,ECAnC,IAAOC,EAAQC,EAAK,QAAS,aAAa,ECA1C,IAAOC,EAAQC,EAAK,QAAS,OAAO,ECApC,IAAOC,EAAQC,EAAK,QAAS,iBAAiB,ECA9C,IAAOC,EAAQC,EAAK,QAAS,SAAS,ECAtC,IAAOC,EAAQC,EAAK,QAAS,QAAQ",
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\", \"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\", \"useState\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useSyncExternalStore\");\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\", \"memo\");\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\", \"useId\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useLayoutEffect\");\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\", \"useRef\");\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,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,WAAW,ECAxC,IAAOC,EAAQC,EAAK,QAAS,UAAU,ECAvC,IAAOC,EAAQC,EAAK,QAAS,sBAAsB,ECAnD,IAAOC,EAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EAAQC,EAAK,QAAS,YAAY,ECAzC,IAAOC,EAAQC,EAAK,QAAS,MAAM,ECAnC,IAAOC,EAAQC,EAAK,QAAS,aAAa,ECA1C,IAAOC,EAAQC,EAAK,QAAS,OAAO,ECApC,IAAOC,EAAQC,EAAK,QAAS,iBAAiB,ECA9C,IAAOC,EAAQC,EAAK,QAAS,SAAS,ECAtC,IAAOC,EAAQC,EAAK,QAAS,QAAQ",
6
6
  "names": ["read", "specifier", "name", "module", "react_createContext_default", "read", "react_useContext_default", "read", "react_useEffect_default", "read", "react_useState_default", "read", "react_useSyncExternalStore_default", "read", "react_createElement_default", "read", "react_forwardRef_default", "read", "react_memo_default", "read", "react_useCallback_default", "read", "react_useId_default", "read", "react_useLayoutEffect_default", "read", "react_useMemo_default", "read", "react_useRef_default", "read"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{b as e,g as t}from"/plugins/ragents.orchestration/web/chunks/chunk-OQYCNYXN.js";var o=e(void 0),n=()=>t(o);export{o as a,n as b};
2
- //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-ODMMQGX2.js.map
1
+ import{b as e,g as t}from"/plugins/ragents.orchestration/web/chunks/chunk-HOBLI364.js";var o=e(void 0),n=()=>t(o);export{o as a,n as b};
2
+ //# sourceMappingURL=/plugins/ragents.orchestration/web/chunks/chunk-UCIMT2R4.js.map