@abot-ai/runtime 1.6.0 → 1.7.0

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 (380) hide show
  1. package/README.md +2 -0
  2. package/dist/src/bridge/request-steering.js +60 -15
  3. package/dist/src/capabilities/normal-invocation/contracts.d.ts +3 -0
  4. package/dist/src/capabilities/normal-invocation/output-channels.d.ts +10 -0
  5. package/dist/src/capabilities/normal-invocation/output-channels.js +29 -0
  6. package/dist/src/capabilities/normal-invocation/validator.js +4 -2
  7. package/dist/src/capabilities/tool-types.d.ts +1 -1
  8. package/dist/src/cli/host-companion-bundle.mjs +7570 -6781
  9. package/dist/src/cli/host-companion-entry.js +5 -22
  10. package/dist/src/cli/host-companion-input.d.ts +3 -0
  11. package/dist/src/cli/host-companion-input.js +21 -0
  12. package/dist/src/cli/host-companion-lifecycle.d.ts +11 -0
  13. package/dist/src/cli/host-companion-lifecycle.js +32 -0
  14. package/dist/src/cli/host-companion-setup-target.d.ts +4 -0
  15. package/dist/src/cli/host-companion-setup-target.js +17 -0
  16. package/dist/src/cli/host-companion-startup.d.ts +2 -0
  17. package/dist/src/cli/host-companion-startup.js +7 -2
  18. package/dist/src/cli/host-companion.d.ts +6 -0
  19. package/dist/src/cli/host-companion.js +30 -27
  20. package/dist/src/cli/windows-companion-store-entry.d.ts +9 -0
  21. package/dist/src/cli/windows-companion-store-entry.js +67 -0
  22. package/dist/src/computer-access/command-output-capture.d.ts +37 -0
  23. package/dist/src/computer-access/command-output-capture.js +136 -0
  24. package/dist/src/computer-access/command-output-retention.d.ts +5 -0
  25. package/dist/src/computer-access/command-output-retention.js +90 -0
  26. package/dist/src/computer-access/command-output.d.ts +7 -0
  27. package/dist/src/computer-access/command-output.js +1 -0
  28. package/dist/src/computer-access/commands.d.ts +1 -0
  29. package/dist/src/computer-access/commands.js +1 -1
  30. package/dist/src/computer-access/companion/command-output-protocol.d.ts +12 -0
  31. package/dist/src/computer-access/companion/command-output-protocol.js +28 -0
  32. package/dist/src/computer-access/companion/command-output.d.ts +13 -0
  33. package/dist/src/computer-access/companion/command-output.js +110 -0
  34. package/dist/src/computer-access/companion/install-link-macos.d.ts +7 -0
  35. package/dist/src/computer-access/companion/install-link-macos.js +48 -0
  36. package/dist/src/computer-access/companion/install-link-registration.d.ts +4 -0
  37. package/dist/src/computer-access/companion/install-link-registration.js +184 -0
  38. package/dist/src/computer-access/companion/install-link-windows.d.ts +4 -0
  39. package/dist/src/computer-access/companion/install-link-windows.js +65 -0
  40. package/dist/src/computer-access/companion/install-link.d.ts +9 -0
  41. package/dist/src/computer-access/companion/install-link.js +54 -0
  42. package/dist/src/computer-access/companion/native-messages.js +3 -0
  43. package/dist/src/computer-access/companion/native-session.d.ts +1 -0
  44. package/dist/src/computer-access/companion/native-session.js +14 -2
  45. package/dist/src/computer-access/companion/native-supervisor.js +1 -0
  46. package/dist/src/computer-access/companion/notification-windows.d.ts +1 -1
  47. package/dist/src/computer-access/companion/notification-windows.js +8 -3
  48. package/dist/src/computer-access/companion/protocol.d.ts +1 -1
  49. package/dist/src/computer-access/companion/protocol.js +6 -0
  50. package/dist/src/computer-access/companion/release-version.d.ts +1 -1
  51. package/dist/src/computer-access/companion/release-version.js +1 -1
  52. package/dist/src/computer-access/companion/windows-store/connection-error.d.ts +7 -0
  53. package/dist/src/computer-access/companion/windows-store/connection-error.js +19 -0
  54. package/dist/src/computer-access/companion/windows-store/connection-link.d.ts +13 -0
  55. package/dist/src/computer-access/companion/windows-store/connection-link.js +109 -0
  56. package/dist/src/computer-access/companion/windows-store/identity.d.ts +13 -0
  57. package/dist/src/computer-access/companion/windows-store/identity.js +13 -0
  58. package/dist/src/computer-access/companion/windows-store/lifecycle.d.ts +5 -0
  59. package/dist/src/computer-access/companion/windows-store/lifecycle.js +90 -0
  60. package/dist/src/computer-access/contracts.d.ts +1 -1
  61. package/dist/src/computer-access/handlers.d.ts +2 -1
  62. package/dist/src/computer-access/handlers.js +5 -1
  63. package/dist/src/computer-access/process-capture.d.ts +6 -0
  64. package/dist/src/computer-access/process-capture.js +1 -0
  65. package/dist/src/computer-access/process-result.d.ts +2 -0
  66. package/dist/src/computer-access/process-result.js +14 -6
  67. package/dist/src/computer-access/process-runner.d.ts +2 -1
  68. package/dist/src/computer-access/process-runner.js +21 -13
  69. package/dist/src/model-gateway/server/configuration.d.ts +2 -0
  70. package/dist/src/model-gateway/server/configuration.js +73 -21
  71. package/dist/src/plugin-contract/install-source.d.ts +13 -0
  72. package/dist/src/plugin-contract/install-source.js +99 -0
  73. package/dist/src/plugin-contract/manifest.d.ts +2 -1
  74. package/dist/src/plugin-sdk/computer-access.d.ts +8 -0
  75. package/dist/src/plugin-sdk/computer-access.js +5 -0
  76. package/dist/src/runtime/adapters/in-memory-session-store.js +6 -16
  77. package/dist/src/runtime/admin/config-control.js +2 -1
  78. package/dist/src/runtime/automations/catalog.d.ts +3 -0
  79. package/dist/src/runtime/automations/catalog.js +1 -0
  80. package/dist/src/runtime/automations/model-dependency-projection.d.ts +2 -0
  81. package/dist/src/runtime/automations/service.d.ts +2 -0
  82. package/dist/src/runtime/capabilities/automation-builder/authoring-reference.d.ts +10 -5
  83. package/dist/src/runtime/capabilities/automation-builder/authoring-reference.js +8 -7
  84. package/dist/src/runtime/capabilities/automation-builder/payload-instructions.d.ts +2 -2
  85. package/dist/src/runtime/capabilities/automation-builder/payload-instructions.js +2 -2
  86. package/dist/src/runtime/capabilities/automation-builder/tool-contract.d.ts +2 -2
  87. package/dist/src/runtime/capabilities/automations/authoring-catalog.js +1 -1
  88. package/dist/src/runtime/capabilities/automations/authoring-preparation.d.ts +11 -5
  89. package/dist/src/runtime/capabilities/automations/tool-module.js +1 -1
  90. package/dist/src/runtime/capabilities/request-permission-catalog.d.ts +3 -1
  91. package/dist/src/runtime/capabilities/request-permission-catalog.js +21 -2
  92. package/dist/src/runtime/capabilities/request-permission-tool-registry.d.ts +2 -1
  93. package/dist/src/runtime/capabilities/request-permission-tool-registry.js +18 -10
  94. package/dist/src/runtime/capabilities/request-runtime-tool-registry.d.ts +2 -0
  95. package/dist/src/runtime/capabilities/request-runtime-tool-registry.js +1 -1
  96. package/dist/src/runtime/capabilities/scheduling/create-operations.d.ts +6 -0
  97. package/dist/src/runtime/config/builders.js +6 -5
  98. package/dist/src/runtime/config/effective-model-config-validation.js +4 -35
  99. package/dist/src/runtime/config/fields.js +15 -0
  100. package/dist/src/runtime/config/model-context-capacity.d.ts +20 -0
  101. package/dist/src/runtime/config/model-context-capacity.js +55 -0
  102. package/dist/src/runtime/config/model-execution-policy.d.ts +5 -1
  103. package/dist/src/runtime/config/model-execution-policy.js +16 -0
  104. package/dist/src/runtime/config/model-plugin-config.d.ts +8 -0
  105. package/dist/src/runtime/config/model-plugin-config.js +40 -0
  106. package/dist/src/runtime/config/schema.js +5 -1
  107. package/dist/src/runtime/config/validation/model-profile-validation.js +2 -0
  108. package/dist/src/runtime/config/validation/runtime-config-validation-contract.d.ts +3 -1
  109. package/dist/src/runtime/config/validation/runtime-config-validation-contract.js +3 -1
  110. package/dist/src/runtime/config/validation/runtime-root-section-validation.js +11 -4
  111. package/dist/src/runtime/config/validation/web-ui-config-validation.js +3 -2
  112. package/dist/src/runtime/config/web-ui.d.ts +5 -0
  113. package/dist/src/runtime/config/web-ui.js +5 -0
  114. package/dist/src/runtime/config.js +2 -0
  115. package/dist/src/runtime/local-application.d.ts +2 -0
  116. package/dist/src/runtime/local-host/app-owner.js +50 -6
  117. package/dist/src/runtime/local-host/app-request-control.d.ts +3 -1
  118. package/dist/src/runtime/local-host/app-request-control.js +91 -11
  119. package/dist/src/runtime/local-host/client-requests.js +32 -5
  120. package/dist/src/runtime/local-host/client-services.d.ts +2 -0
  121. package/dist/src/runtime/local-host/local-request-diagnostics.d.ts +9 -0
  122. package/dist/src/runtime/local-host/local-request-diagnostics.js +47 -0
  123. package/dist/src/runtime/local-host/saved-approvals.js +23 -2
  124. package/dist/src/runtime/model/model-selection.js +4 -1
  125. package/dist/src/runtime/observability/request-control-diagnostics.d.ts +6 -0
  126. package/dist/src/runtime/observability/request-control-diagnostics.js +52 -0
  127. package/dist/src/runtime/plugins/configuration-context.d.ts +9 -0
  128. package/dist/src/runtime/plugins/configuration-context.js +42 -0
  129. package/dist/src/runtime/plugins/configuration-settings.d.ts +2 -0
  130. package/dist/src/runtime/plugins/configuration-settings.js +26 -0
  131. package/dist/src/runtime/plugins/configuration-store.d.ts +23 -0
  132. package/dist/src/runtime/plugins/configuration-store.js +100 -0
  133. package/dist/src/runtime/plugins/configuration-write.d.ts +5 -0
  134. package/dist/src/runtime/plugins/configuration-write.js +58 -0
  135. package/dist/src/runtime/plugins/installation/archive.d.ts +2 -0
  136. package/dist/src/runtime/plugins/installation/archive.js +107 -0
  137. package/dist/src/runtime/plugins/installation/github-download.d.ts +9 -0
  138. package/dist/src/runtime/plugins/installation/github-download.js +72 -0
  139. package/dist/src/runtime/plugins/installation/installed-package.d.ts +9 -0
  140. package/dist/src/runtime/plugins/installation/installed-package.js +66 -0
  141. package/dist/src/runtime/plugins/installation/package.d.ts +45 -0
  142. package/dist/src/runtime/plugins/installation/package.js +79 -0
  143. package/dist/src/runtime/plugins/installation/portable-path.d.ts +2 -0
  144. package/dist/src/runtime/plugins/installation/portable-path.js +10 -0
  145. package/dist/src/runtime/plugins/installation/publication.d.ts +10 -0
  146. package/dist/src/runtime/plugins/installation/publication.js +17 -0
  147. package/dist/src/runtime/plugins/installation/service.d.ts +41 -0
  148. package/dist/src/runtime/plugins/installation/service.js +80 -0
  149. package/dist/src/runtime/plugins/loader.js +15 -29
  150. package/dist/src/runtime/plugins/manifest-projection.js +1 -0
  151. package/dist/src/runtime/plugins/manifest-validator.js +3 -0
  152. package/dist/src/runtime/plugins/module-cache.d.ts +2 -0
  153. package/dist/src/runtime/plugins/module-cache.js +19 -0
  154. package/dist/src/runtime/plugins/selection.d.ts +2 -0
  155. package/dist/src/runtime/plugins/selection.js +16 -11
  156. package/dist/src/runtime/ports.d.ts +6 -4
  157. package/dist/src/runtime/request/dependencies.d.ts +2 -1
  158. package/dist/src/runtime/request/execution-payload-compacted-evidence.d.ts +1 -1
  159. package/dist/src/runtime/request/handler.js +8 -0
  160. package/dist/src/runtime/request/prepared-execution.js +6 -1
  161. package/dist/src/runtime/request/request-steering.d.ts +4 -0
  162. package/dist/src/runtime/request/request-steering.js +37 -12
  163. package/dist/src/runtime/request/worker-capability-composition.d.ts +2 -0
  164. package/dist/src/runtime/request/worker-capability-composition.js +4 -1
  165. package/dist/src/runtime/scheduler/journal-index-state.d.ts +1 -1
  166. package/dist/src/sessions/assistant-initiative-message.d.ts +3 -0
  167. package/dist/src/sessions/assistant-initiative-message.js +12 -0
  168. package/dist/src/sessions/assistant-initiative.d.ts +2 -2
  169. package/dist/src/sessions/assistant-initiative.js +1 -7
  170. package/dist/src/sessions/durable-session-commit.d.ts +2 -1
  171. package/dist/src/sessions/durable-session-commit.js +6 -1
  172. package/dist/src/sessions/metadata/projection.d.ts +15 -0
  173. package/dist/src/sessions/metadata/projection.js +55 -0
  174. package/dist/src/sessions/metadata/publication.d.ts +12 -0
  175. package/dist/src/sessions/metadata/publication.js +78 -0
  176. package/dist/src/sessions/metadata/source-receipt.d.ts +5 -0
  177. package/dist/src/sessions/metadata/source-receipt.js +42 -0
  178. package/dist/src/sessions/metadata/store.d.ts +7 -0
  179. package/dist/src/sessions/metadata/store.js +119 -0
  180. package/dist/src/sessions/record/projection.d.ts +3 -1
  181. package/dist/src/sessions/record/projection.js +26 -18
  182. package/dist/src/sessions/request-lifecycle/service.js +3 -3
  183. package/dist/src/sessions/session-service.d.ts +2 -4
  184. package/dist/src/sessions/session-service.js +4 -16
  185. package/dist/src/sessions/session-store.d.ts +2 -1
  186. package/dist/src/sessions/session-store.js +9 -3
  187. package/dist/src/sessions/snapshot.d.ts +17 -0
  188. package/dist/src/sessions/snapshot.js +105 -0
  189. package/dist/src/sessions/types.d.ts +2 -0
  190. package/dist/src/shared/tool-selection.d.ts +2 -0
  191. package/dist/src/shared/tool-selection.js +7 -0
  192. package/dist/src/web-ui/app/ARCHITECTURE.md +14 -0
  193. package/dist/src/web-ui/app/app.js +6 -3
  194. package/dist/src/web-ui/app/components/config-workspace/config-model.js +2 -0
  195. package/dist/src/web-ui/app/components/config-workspace/model-plugin-permissions.js +130 -0
  196. package/dist/src/web-ui/app/components/config-workspace/model-plugin-selection.js +180 -0
  197. package/dist/src/web-ui/app/components/config-workspace/model-plugin-view-state.js +114 -0
  198. package/dist/src/web-ui/app/components/config-workspace/model-rendering.js +3 -0
  199. package/dist/src/web-ui/app/components/config-workspace/model-summary.js +39 -0
  200. package/dist/src/web-ui/app/components/config-workspace/summary-rendering.js +30 -0
  201. package/dist/src/web-ui/app/components/config-workspace/workspace-events.js +37 -0
  202. package/dist/src/web-ui/app/components/config-workspace/workspace-mutations.js +2 -0
  203. package/dist/src/web-ui/app/components/config-workspace/workspace-persistence.js +9 -1
  204. package/dist/src/web-ui/app/components/config-workspace/workspace-view.js +23 -67
  205. package/dist/src/web-ui/app/components/config-workspace.js +11 -2
  206. package/dist/src/web-ui/app/components/conversation-view.js +36 -5
  207. package/dist/src/web-ui/app/components/dashboard/recent-conversations.js +2 -1
  208. package/dist/src/web-ui/app/components/dashboard/workspace.js +2 -1
  209. package/dist/src/web-ui/app/components/operations-summary.js +105 -0
  210. package/dist/src/web-ui/app/components/passive-learning/home.js +1 -9
  211. package/dist/src/web-ui/app/components/plugins/configuration-draft.js +34 -0
  212. package/dist/src/web-ui/app/components/plugins/configuration-editor.js +147 -0
  213. package/dist/src/web-ui/app/components/plugins/configuration-fields.js +103 -0
  214. package/dist/src/web-ui/app/components/plugins/configuration-retained-secrets.js +20 -0
  215. package/dist/src/web-ui/app/components/plugins/configuration-settings.js +108 -0
  216. package/dist/src/web-ui/app/components/plugins/discovery-rendering.js +37 -0
  217. package/dist/src/web-ui/app/components/plugins/installation.js +212 -0
  218. package/dist/src/web-ui/app/components/plugins/manager.js +160 -6
  219. package/dist/src/web-ui/app/components/plugins/removal.js +130 -0
  220. package/dist/src/web-ui/app/components/plugins/rendering.js +14 -2
  221. package/dist/src/web-ui/app/components/plugins/summary.js +54 -0
  222. package/dist/src/web-ui/app/components/plugins/tabs.js +31 -0
  223. package/dist/src/web-ui/app/components/plugins/view-state.js +3 -1
  224. package/dist/src/web-ui/app/components/runtime-setup/connection-form.js +5 -2
  225. package/dist/src/web-ui/app/components/runtime-setup/connection-state.js +9 -1
  226. package/dist/src/web-ui/app/components/runtime-setup/context-window-feedback.js +71 -0
  227. package/dist/src/web-ui/app/components/runtime-setup/optional-steps.js +2 -0
  228. package/dist/src/web-ui/app/components/runtime-setup-guide.js +15 -3
  229. package/dist/src/web-ui/app/components/spark-chat/empty-state.js +1 -0
  230. package/dist/src/web-ui/app/components/spark-chat/panel.js +1 -0
  231. package/dist/src/web-ui/app/components/system-host/connection-card.js +35 -0
  232. package/dist/src/web-ui/app/components/system-host/macos-setup.js +1 -1
  233. package/dist/src/web-ui/app/components/system-host/manager.js +45 -12
  234. package/dist/src/web-ui/app/components/system-host/rendering.js +111 -106
  235. package/dist/src/web-ui/app/components/system-host/windows-store-setup.js +293 -0
  236. package/dist/src/web-ui/app/components/workspace-shell.js +6 -0
  237. package/dist/src/web-ui/app/computer-access-feature.js +22 -5
  238. package/dist/src/web-ui/app/configuration-feature.js +35 -2
  239. package/dist/src/web-ui/app/controllers/app-event-bindings.js +4 -1
  240. package/dist/src/web-ui/app/controllers/conversation-read-state-controller.d.ts +1 -0
  241. package/dist/src/web-ui/app/controllers/conversation-read-state-controller.js +7 -3
  242. package/dist/src/web-ui/app/controllers/conversation-request-hydration.js +88 -0
  243. package/dist/src/web-ui/app/controllers/conversation-session-controller.d.ts +9 -3
  244. package/dist/src/web-ui/app/controllers/conversation-session-controller.js +52 -144
  245. package/dist/src/web-ui/app/controllers/history-pagination.js +111 -0
  246. package/dist/src/web-ui/app/controllers/operations-controller.d.ts +12 -0
  247. package/dist/src/web-ui/app/controllers/operations-controller.js +28 -21
  248. package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.d.ts +1 -0
  249. package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.js +11 -0
  250. package/dist/src/web-ui/app/controllers/session-controller.js +10 -2
  251. package/dist/src/web-ui/app/controllers/session-list-pagination.js +71 -0
  252. package/dist/src/web-ui/app/controllers/session-sidebar-controller.js +6 -4
  253. package/dist/src/web-ui/app/controllers/spark-chat-reading.js +1 -0
  254. package/dist/src/web-ui/app/controllers/spark-chat-sync.js +24 -5
  255. package/dist/src/web-ui/app/controllers/workspace-route-controller.js +21 -19
  256. package/dist/src/web-ui/app/dashboard-feature.js +2 -2
  257. package/dist/src/web-ui/app/index.html +6 -2
  258. package/dist/src/web-ui/app/lib/history-page-messages.js +49 -0
  259. package/dist/src/web-ui/app/lib/request-lifecycle-view.js +8 -0
  260. package/dist/src/web-ui/app/lib/workspace-route.d.ts +3 -0
  261. package/dist/src/web-ui/app/lib/workspace-route.js +4 -0
  262. package/dist/src/web-ui/app/passive-learning-feature.js +0 -1
  263. package/dist/src/web-ui/app/runtime-onboarding-feature.js +3 -0
  264. package/dist/src/web-ui/app/schedules-feature.js +1 -1
  265. package/dist/src/web-ui/app/services/runtime-web-client/configuration.js +20 -0
  266. package/dist/src/web-ui/app/services/runtime-web-client/plugin-configuration.js +19 -0
  267. package/dist/src/web-ui/app/services/runtime-web-client/spark-chat.js +4 -4
  268. package/dist/src/web-ui/app/services/runtime-web-client/system-host.js +2 -0
  269. package/dist/src/web-ui/app/services/runtime-web-client.d.ts +6 -1
  270. package/dist/src/web-ui/app/services/runtime-web-client.js +12 -3
  271. package/dist/src/web-ui/app/spark-chat-feature.js +76 -19
  272. package/dist/src/web-ui/app/styles/11-product-links.css +30 -0
  273. package/dist/src/web-ui/app/styles/41-plugin-configuration.css +79 -0
  274. package/dist/src/web-ui/app/styles/41-plugin-discovery.css +132 -0
  275. package/dist/src/web-ui/app/styles/41-plugin-management.css +6 -0
  276. package/dist/src/web-ui/app/styles/42-model-plugin-permissions.css +173 -0
  277. package/dist/src/web-ui/app/styles/46-system-host.css +61 -107
  278. package/dist/src/web-ui/app/styles/47-config-controls.css +13 -1
  279. package/dist/src/web-ui/app/styles/54-spark-chat.css +33 -1
  280. package/dist/src/web-ui/app/styles.css +4 -0
  281. package/dist/src/web-ui/local-runtime/api-router.js +11 -6
  282. package/dist/src/web-ui/local-runtime/approval-request-attachment.js +14 -5
  283. package/dist/src/web-ui/local-runtime/configuration-activation-source.d.ts +1 -1
  284. package/dist/src/web-ui/local-runtime/configuration-activation-source.js +9 -3
  285. package/dist/src/web-ui/local-runtime/contracts.d.ts +4 -3
  286. package/dist/src/web-ui/local-runtime/environment-registry.d.ts +5 -1
  287. package/dist/src/web-ui/local-runtime/environment-registry.js +53 -11
  288. package/dist/src/web-ui/local-runtime/history-pagination.d.ts +16 -0
  289. package/dist/src/web-ui/local-runtime/history-pagination.js +20 -0
  290. package/dist/src/web-ui/local-runtime/plugin-configuration-routes.d.ts +16 -0
  291. package/dist/src/web-ui/local-runtime/plugin-configuration-routes.js +68 -0
  292. package/dist/src/web-ui/local-runtime/plugin-installation-routes.d.ts +16 -0
  293. package/dist/src/web-ui/local-runtime/plugin-installation-routes.js +96 -0
  294. package/dist/src/web-ui/local-runtime/plugin-management-routes.d.ts +8 -1
  295. package/dist/src/web-ui/local-runtime/plugin-management-routes.js +17 -0
  296. package/dist/src/web-ui/local-runtime/plugin-mutation-admission.d.ts +7 -0
  297. package/dist/src/web-ui/local-runtime/plugin-mutation-admission.js +17 -0
  298. package/dist/src/web-ui/local-runtime/plugin-removal-routes.d.ts +18 -0
  299. package/dist/src/web-ui/local-runtime/plugin-removal-routes.js +60 -0
  300. package/dist/src/web-ui/local-runtime/realtime-controller.js +41 -2
  301. package/dist/src/web-ui/local-runtime/request-cancellation-route.js +28 -1
  302. package/dist/src/web-ui/local-runtime/request-control-observation.d.ts +19 -0
  303. package/dist/src/web-ui/local-runtime/request-control-observation.js +80 -0
  304. package/dist/src/web-ui/local-runtime/request-execution.js +69 -37
  305. package/dist/src/web-ui/local-runtime/runtime-setup-context-window.d.ts +20 -0
  306. package/dist/src/web-ui/local-runtime/runtime-setup-context-window.js +44 -0
  307. package/dist/src/web-ui/local-runtime/runtime-setup-routes.js +2 -0
  308. package/dist/src/web-ui/local-runtime/runtime-setup-validation.js +9 -2
  309. package/dist/src/web-ui/local-runtime/session-routes.d.ts +1 -0
  310. package/dist/src/web-ui/local-runtime/session-routes.js +16 -4
  311. package/dist/src/web-ui/local-runtime/spark-chat-routes.js +4 -3
  312. package/dist/src/web-ui/plugin-capability-selection.js +4 -1
  313. package/dist/src/web-ui/plugin-configuration-input.d.ts +12 -0
  314. package/dist/src/web-ui/plugin-configuration-input.js +68 -0
  315. package/dist/src/web-ui/plugin-configuration-retained-secrets.d.ts +9 -0
  316. package/dist/src/web-ui/plugin-configuration-retained-secrets.js +48 -0
  317. package/dist/src/web-ui/plugin-configuration-service.d.ts +52 -0
  318. package/dist/src/web-ui/plugin-configuration-service.js +66 -0
  319. package/dist/src/web-ui/plugin-configuration-view.d.ts +25 -0
  320. package/dist/src/web-ui/plugin-configuration-view.js +45 -0
  321. package/dist/src/web-ui/plugin-disabled-selection.d.ts +7 -0
  322. package/dist/src/web-ui/plugin-disabled-selection.js +17 -0
  323. package/dist/src/web-ui/plugin-management-catalog.d.ts +3 -1
  324. package/dist/src/web-ui/plugin-management-catalog.js +11 -1
  325. package/dist/src/web-ui/plugin-management-selection.js +22 -9
  326. package/dist/src/web-ui/plugin-management-service.d.ts +5 -1
  327. package/dist/src/web-ui/plugin-management-service.js +11 -7
  328. package/dist/src/web-ui/plugin-removal-error.d.ts +7 -0
  329. package/dist/src/web-ui/plugin-removal-error.js +16 -0
  330. package/dist/src/web-ui/plugin-removal-service.d.ts +30 -0
  331. package/dist/src/web-ui/plugin-removal-service.js +109 -0
  332. package/dist/src/web-ui/runtime-setup-gateway.d.ts +6 -2
  333. package/dist/src/web-ui/runtime-setup-gateway.js +30 -10
  334. package/dist/src/web-ui/server.js +6 -2
  335. package/dist/src/web-ui/session-read-state/overview.d.ts +42 -0
  336. package/dist/src/web-ui/session-read-state/overview.js +16 -0
  337. package/dist/src/web-ui/session-read-state/pagination.d.ts +15 -0
  338. package/dist/src/web-ui/session-read-state/pagination.js +42 -0
  339. package/dist/src/web-ui/session-read-state/projection.d.ts +4 -3
  340. package/dist/src/web-ui/session-read-state/service.d.ts +213 -20
  341. package/dist/src/web-ui/session-read-state/service.js +25 -23
  342. package/dist/src/web-ui/session-read-state/visible-messages.d.ts +3 -3
  343. package/dist/src/web-ui/system-host-setup/companion-linux.js +1 -1
  344. package/dist/src/web-ui/system-host-setup/installer-contract.d.ts +1 -1
  345. package/dist/src/web-ui/system-host-setup/installer-contract.js +2 -2
  346. package/dist/src/web-ui/system-host-setup/installers.js +0 -7
  347. package/dist/src/web-ui/system-host-setup/local-connection.d.ts +4 -1
  348. package/dist/src/web-ui/system-host-setup/local-connection.js +10 -17
  349. package/dist/src/web-ui/system-host-setup/routes.d.ts +2 -0
  350. package/dist/src/web-ui/system-host-setup/routes.js +32 -9
  351. package/dist/src/web-ui/system-host-setup/setup-mutation.d.ts +9 -0
  352. package/dist/src/web-ui/system-host-setup/setup-mutation.js +27 -0
  353. package/dist/src/web-ui/system-host-setup/windows-store-route.d.ts +13 -0
  354. package/dist/src/web-ui/system-host-setup/windows-store-route.js +68 -0
  355. package/docs/configuration.md +46 -0
  356. package/docs/installation.md +45 -24
  357. package/docs/plugins.md +165 -2
  358. package/docs/projects-and-full-plus.md +2 -6
  359. package/docs/runtime-library.md +0 -1
  360. package/docs/windows-companion-store.md +127 -0
  361. package/package.json +3 -3
  362. package/plugins/document-reader/plugin.json +1 -0
  363. package/plugins/exec/plugin.json +3 -0
  364. package/plugins/filesystem/plugin.json +2 -0
  365. package/plugins/local-search/plugin.json +1 -0
  366. package/plugins/system/README.md +43 -3
  367. package/plugins/system/plugin.json +5 -0
  368. package/plugins/system/source/companion-command-output.ts +82 -0
  369. package/plugins/system/source/host-dispatch.ts +4 -0
  370. package/plugins/system/source/index.ts +11 -5
  371. package/plugins/system/source/local-command-output.ts +61 -0
  372. package/plugins/system/source/request-system-modules.ts +2 -0
  373. package/plugins/system/src/index.cjs +474 -39
  374. package/plugins/web/README.md +2 -2
  375. package/plugins/web/plugin.json +4 -0
  376. package/runtime.config.schema.json +25 -1
  377. package/src/runtime/README.md +12 -2
  378. package/dist/src/web-ui/system-host-setup/companion-windows.d.ts +0 -2
  379. package/dist/src/web-ui/system-host-setup/companion-windows.js +0 -108
  380. package/docs/publishing.md +0 -167
@@ -8,39 +8,14 @@
8
8
  background: var(--panel);
9
9
  }
10
10
 
11
- .system-host-summary {
12
- display: flex;
13
- align-items: center;
14
- gap: 16px;
15
- min-height: 60px;
16
- padding: 12px 16px;
17
- list-style: none;
18
- cursor: pointer;
19
- font-size: var(--font-size-sm);
20
- }
21
-
22
- .system-host-summary::-webkit-details-marker { display: none; }
23
- .system-host-summary-title { flex-shrink: 0; color: var(--text); }
24
- .system-host-summary .system-host-status { margin: 0; padding: 0; border: 0; }
25
- .system-host-summary-name {
26
- min-width: 0;
27
- overflow: hidden;
28
- color: var(--muted);
29
- text-overflow: ellipsis;
30
- white-space: nowrap;
31
- }
32
- .system-host-summary-action { margin-left: auto; color: var(--accent); white-space: nowrap; }
11
+ .system-host-permission-details { grid-column: 1 / -1; min-width: 0; }
12
+ .system-host-permission-details > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0; color: var(--muted); cursor: pointer; font-size: var(--font-size-xs); }
13
+ .system-host-permission-details > summary:hover { color: var(--text); }
14
+ .system-host-permission-details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
15
+ .system-host-permission-details > summary::after { content: "⌄"; margin-left: auto; }
16
+ .system-host-permission-details[open] > summary::after { transform: rotate(180deg); }
33
17
  .system-host-summary-permissions { color: var(--muted); font-size: var(--font-size-xs); }
34
- .system-host-summary-action > span { display: inline-block; transition: transform 150ms ease; }
35
- .system-host-compact[open] .system-host-summary-action > span { transform: rotate(180deg); }
36
- .system-host-summary:hover { background: var(--control-bg); }
37
- .system-host-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
38
- .system-host-management-body {
39
- max-height: min(520px, 60dvh);
40
- padding: 0 16px;
41
- overflow-y: auto;
42
- border-top: 1px solid var(--line);
43
- }
18
+ .system-host-permission-details .system-host-permissions { margin-top: 6px; max-height: min(420px, 45dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
44
19
 
45
20
  .home-computer-access:focus-visible {
46
21
  outline: 2px solid var(--accent);
@@ -54,14 +29,6 @@
54
29
  line-height: 1.6;
55
30
  }
56
31
 
57
- .system-host-heading,
58
- .system-host-actions {
59
- display: flex;
60
- align-items: flex-start;
61
- justify-content: space-between;
62
- gap: 16px;
63
- }
64
-
65
32
  .system-host-permissions { margin-block: 20px; border-block: 1px solid var(--line); padding-block: 16px; }
66
33
  .system-host-permission-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
67
34
  .system-host-permission-heading h3 { margin: 0; font-size: var(--font-size-base); font-weight: 500; }
@@ -78,24 +45,7 @@
78
45
  .system-host-native-permissions { margin-top: 16px; }
79
46
  .system-host-native-permissions pre { white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
80
47
 
81
- .system-host-heading h2 {
82
- margin: 0 0 6px;
83
- font-size: var(--font-size-2xl);
84
- font-weight: 400;
85
- }
86
-
87
- .system-host-heading p,
88
- .system-host-note {
89
- color: var(--config-muted, var(--muted));
90
- }
91
-
92
- .system-host-heading p {
93
- margin: 0;
94
- }
95
-
96
- .system-host-heading button {
97
- flex-shrink: 0;
98
- }
48
+ .system-host-note { color: var(--config-muted, var(--muted)); }
99
49
 
100
50
  .system-host-panel button {
101
51
  min-height: 32px;
@@ -130,50 +80,23 @@
130
80
  color: var(--danger);
131
81
  }
132
82
 
133
- .system-host-panel button:disabled {
134
- opacity: 0.45;
135
- cursor: not-allowed;
136
- }
137
-
138
- .system-host-status {
139
- display: flex;
140
- align-items: center;
141
- gap: 9px;
142
- padding-block: 12px;
143
- border-block: 1px solid var(--line);
144
- }
145
-
146
- .system-host-status-dot {
147
- flex: 0 0 8px;
148
- width: 8px;
149
- height: 8px;
150
- border-radius: 50%;
151
- background: var(--danger, #e27575);
152
- }
153
-
154
- .system-host-status[data-tone="ready"] .system-host-status-dot {
155
- background: var(--success, #79d7a7);
156
- }
157
-
158
- .system-host-identity {
159
- display: grid;
160
- gap: 6px;
161
- margin-block: 20px;
162
- }
163
-
164
- .system-host-identity > div {
165
- display: grid;
166
- grid-template-columns: 140px minmax(0, 1fr);
167
- gap: 16px;
83
+ .system-host-panel button[data-system-host-revoke]:hover:not(:disabled) {
84
+ border-color: transparent;
85
+ background: transparent;
86
+ color: var(--danger);
87
+ text-decoration: underline;
88
+ text-underline-offset: 3px;
168
89
  }
169
90
 
170
- .system-host-identity dt {
171
- color: var(--config-muted, var(--muted));
91
+ .system-host-panel button[data-system-host-revoke]:focus-visible {
92
+ background: transparent;
93
+ outline-color: var(--danger);
94
+ outline-offset: 3px;
172
95
  }
173
96
 
174
- .system-host-identity dd {
175
- margin: 0;
176
- overflow-wrap: anywhere;
97
+ .system-host-panel button:disabled {
98
+ opacity: 0.45;
99
+ cursor: not-allowed;
177
100
  }
178
101
 
179
102
  .system-host-download {
@@ -184,6 +107,34 @@
184
107
  overflow-wrap: anywhere;
185
108
  }
186
109
 
110
+ .system-host-card { padding: 14px 18px; line-height: 1.5; }
111
+ .system-host-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
112
+ .system-host-card-heading h2 { margin: 0; font-size: var(--font-size-base); font-weight: 600; line-height: 1.4; }
113
+ .system-host-card-status { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--amber); font-size: var(--font-size-xs); }
114
+ .system-host-card-status[data-tone="ready"] { color: var(--accent); }
115
+ .system-host-card-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
116
+ .system-host-card-description { margin: 0; max-width: 640px; color: var(--muted); }
117
+ .system-host-card-action { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
118
+ .system-host-panel .system-host-card-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 12px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: var(--bg); font-size: var(--font-size-sm); font-weight: 500; text-decoration: none; }
119
+ .system-host-store-icon { flex-shrink: 0; margin-inline-end: 8px; }
120
+ .system-host-panel .system-host-card-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); filter: brightness(1.08); }
121
+ .system-host-panel .system-host-card-secondary { min-height: 32px; padding: 5px 2px; border: 0; background: transparent; color: var(--muted); font-size: var(--font-size-sm); text-decoration: none; }
122
+ .system-host-panel .system-host-card-secondary:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
123
+ .system-host-card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
124
+ .system-host-card-hint { margin: 8px 0 0; color: var(--muted); font-size: var(--font-size-xs); }
125
+ .system-host-card-message { margin: 8px 0 0; color: var(--accent); font-size: var(--font-size-xs); }
126
+ .system-host-card-computer { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: var(--font-size-xs); }
127
+ .system-host-card-computer > span { overflow-wrap: anywhere; min-width: 0; }
128
+ .system-host-card-computer [data-system-host-revoke] { min-height: 32px; padding: 0; border: 0; font-size: inherit; }
129
+ .system-host-card-access-note { margin: 8px 0 0; color: var(--muted); font-size: var(--font-size-xs); }
130
+ .system-host-card-ready { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; min-height: 44px; padding: 6px 16px; }
131
+ .system-host-card-ready-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--font-size-sm); font-weight: 500; white-space: nowrap; }
132
+ .system-host-card-ready .system-host-card-computer { display: contents; }
133
+ .system-host-card-ready .system-host-card-computer > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
134
+ .system-host-card-ready [data-system-host-revoke] { white-space: nowrap; }
135
+ .system-host-card-other { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
136
+ .system-host-card-other .system-host-actions { margin-top: 8px; }
137
+
187
138
  .system-host-restart {
188
139
  border: 1px solid var(--line);
189
140
  border-radius: 6px;
@@ -193,6 +144,8 @@
193
144
  }
194
145
 
195
146
  .system-host-actions {
147
+ display: flex;
148
+ gap: 12px;
196
149
  justify-content: flex-start;
197
150
  flex-wrap: wrap;
198
151
  margin-top: 20px;
@@ -241,14 +194,15 @@
241
194
  display: none;
242
195
  }
243
196
 
197
+ @media (max-width: 620px) {
198
+ .system-host-card.system-host-card-ready { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 14px; }
199
+ .system-host-card-ready-title { grid-column: 1; grid-row: 1; white-space: normal; }
200
+ .system-host-card-ready .system-host-card-computer > span { grid-column: 1; grid-row: 2; }
201
+ .system-host-card-ready [data-system-host-revoke] { grid-column: 2; grid-row: 1 / span 2; }
202
+ }
203
+
244
204
  @media (max-width: 520px) {
245
- .system-host-summary { flex-wrap: wrap; gap: 6px 12px; }
246
- .system-host-summary-name { display: none; }
247
- .system-host-heading {
248
- flex-direction: column;
249
- }
250
- .system-host-identity > div {
251
- grid-template-columns: 110px minmax(0, 1fr);
252
- gap: 10px;
253
- }
205
+ .system-host-card { padding: 12px 14px; }
206
+ .system-host-card-heading { align-items: flex-start; }
207
+ .system-host-card-action { gap: 12px; }
254
208
  }
@@ -135,6 +135,7 @@
135
135
  border-top: 1px solid var(--config-line);
136
136
  }
137
137
 
138
+ .model-plugin-permissions > summary,
138
139
  .config-calibration-section-title {
139
140
  display: flex;
140
141
  align-items: center;
@@ -147,27 +148,38 @@
147
148
  cursor: pointer;
148
149
  }
149
150
 
151
+ .model-plugin-permissions > summary:focus-visible,
152
+ .config-calibration-section-title:focus-visible {
153
+ outline: 2px solid var(--accent);
154
+ outline-offset: 3px;
155
+ }
156
+
157
+ .model-plugin-permissions > summary::-webkit-details-marker,
150
158
  .config-calibration-section-title::-webkit-details-marker {
151
159
  display: none;
152
160
  }
153
161
 
162
+ .model-plugin-permissions > summary::before,
154
163
  .config-calibration-section-title::before {
155
164
  content: "";
156
165
  width: 6px;
157
166
  height: 6px;
158
167
  flex: none;
159
- border-right: 1px solid var(--config-muted);
168
+ border-inline-end: 1px solid var(--config-muted);
160
169
  border-bottom: 1px solid var(--config-muted);
161
170
  transform: rotate(-45deg);
162
171
  }
163
172
 
173
+ .model-plugin-permissions[open] > summary::before,
164
174
  .config-calibration-section[open] > .config-calibration-section-title::before {
165
175
  transform: rotate(45deg);
166
176
  }
167
177
 
178
+ .model-plugin-summary-count,
168
179
  .config-calibration-section-title small {
169
180
  margin-inline-start: auto;
170
181
  color: var(--config-muted);
182
+ font-size: var(--font-size-xs);
171
183
  font-weight: 400;
172
184
  }
173
185
 
@@ -79,7 +79,39 @@
79
79
  .spark-chat-panel .conversation-file-backdrop { display: none; }
80
80
  .spark-chat-results:empty { display: none; }
81
81
  .spark-handoff-actions { margin-top: 10px; }
82
- .spark-handoff-button { min-height: 30px; padding: 5px 9px; border: 1px solid #ffffff14; border-radius: 7px; background: #ffffff08; color: var(--text); font-size: 11px; box-shadow: none; }
82
+ .spark-companion :is(.spark-setup-button, .spark-handoff-button) {
83
+ display: inline-flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ justify-self: start;
87
+ max-width: 100%;
88
+ min-height: 32px;
89
+ padding: 6px 12px;
90
+ border: 1px solid var(--line);
91
+ border-radius: 7px;
92
+ background: var(--control-bg);
93
+ color: var(--accent-strong);
94
+ font-size: var(--font-size-sm);
95
+ font-weight: 400;
96
+ line-height: 1.5;
97
+ white-space: normal;
98
+ text-align: start;
99
+ box-shadow: none;
100
+ }
101
+ .spark-companion :is(.spark-setup-button, .spark-handoff-button):hover:not(:disabled) {
102
+ border-color: var(--line-strong);
103
+ background: var(--control-bg-hover);
104
+ }
105
+ .spark-companion :is(.spark-setup-button, .spark-handoff-button):focus-visible {
106
+ border-color: var(--accent);
107
+ }
108
+ .spark-companion :is(.spark-setup-button, .spark-handoff-button):disabled {
109
+ background: var(--control-fill);
110
+ color: var(--muted-2);
111
+ opacity: .5;
112
+ cursor: not-allowed;
113
+ }
114
+ .spark-companion .spark-setup-button { margin-top: 12px; }
83
115
  .spark-handoff-actions p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
84
116
  .spark-chat-results .conversation-tool-file-action { max-width: 100%; font-size: 12px; }
85
117
  .spark-result-warning { margin: 6px 0; color: var(--amber); font-size: 12px; }
@@ -18,6 +18,9 @@
18
18
  @import url("./styles/30-inspector-config.css");
19
19
  @import url("./styles/40-config-workspace.css");
20
20
  @import url("./styles/41-plugin-management.css");
21
+ @import url("./styles/42-model-plugin-permissions.css");
22
+ @import url("./styles/41-plugin-discovery.css");
23
+ @import url("./styles/41-plugin-configuration.css");
21
24
  @import url("./styles/42-runtime-setup-plugins.css");
22
25
  @import url("./styles/43-model-setup.css");
23
26
  @import url("./styles/44-model-provider-cards.css");
@@ -40,6 +43,7 @@
40
43
  @import url("./styles/45-bridge-setup.css");
41
44
  @import url("./styles/46-system-host.css");
42
45
  @import url("./styles/11-workspace-header-width.css");
46
+ @import url("./styles/11-product-links.css");
43
47
  @import url("./styles/28-tool-approval-card.css");
44
48
  @import url("./styles/14-startup-screen.css");
45
49
  @import url("./styles/93-compact-viewport.css");
@@ -88,6 +88,11 @@ export class LocalRuntimeApiRouter {
88
88
  }));
89
89
  this.plugins = new PluginManagementRoutes({
90
90
  rootDir: options.rootDir ?? process.cwd(),
91
+ requireMutationIdle: () => this.environments.requirePluginMutationIdle(this.requests.healthDetails().length > 0),
92
+ removalRuntime: {
93
+ applyConfiguration: (revision) => this.applyWhenRequestsIdle(revision),
94
+ requireInactive: (pluginId, capabilities) => this.environments.requirePluginInactive(pluginId, capabilities),
95
+ },
91
96
  getConfigPath: () => options.configPath ?? process.env.LLM_RUNTIME_CONFIG_FILE,
92
97
  });
93
98
  this.readStates = new WebSessionReadStates((id) => this.environments.get(id));
@@ -101,7 +106,7 @@ export class LocalRuntimeApiRouter {
101
106
  }));
102
107
  this.memoryManagement = new LongTermMemoryManagementRoutes((environmentId) => this.environments.get(environmentId).services.longTermMemory);
103
108
  }
104
- async applyWhenRequestsIdle() {
109
+ async applyWhenRequestsIdle(expectedRevision) {
105
110
  const hasAcknowledgedRequests = this.requests.healthDetails().length > 0;
106
111
  if (hasAcknowledgedRequests) {
107
112
  return {
@@ -109,7 +114,7 @@ export class LocalRuntimeApiRouter {
109
114
  message: "Your agent is working. Wait for active conversations and Jobs to finish, then apply again.",
110
115
  };
111
116
  }
112
- return this.environments.applyConfiguration();
117
+ return this.environments.applyConfiguration(expectedRevision);
113
118
  }
114
119
  async initializeSessionReadState(environmentIds) {
115
120
  for (const id of environmentIds) {
@@ -222,7 +227,7 @@ export class LocalRuntimeApiRouter {
222
227
  response: res,
223
228
  }))
224
229
  return;
225
- if (await this.plugins.handle({ method, route, body, response: res }))
230
+ if (await this.plugins.handle({ method, route, body, request: req, response: res }))
226
231
  return;
227
232
  if (segments[0] === "schedules")
228
233
  await this.initializeSessionReadState([environmentId]);
@@ -320,10 +325,10 @@ export class LocalRuntimeApiRouter {
320
325
  });
321
326
  return;
322
327
  }
323
- if ((method === "GET" && route === "chat/sessions") ||
328
+ if (((method === "GET" && route === "chat/sessions") || (method === "POST" && route === "chat/sessions/page")) ||
324
329
  (method === "POST" && route === "chat/messages")) {
325
330
  const setupRequirement = this.environments.setupRequirement(environmentId);
326
- if (setupRequirement && method === "GET") {
331
+ if (setupRequirement && route !== "chat/messages") {
327
332
  sendJson(res, 200, {
328
333
  ok: true,
329
334
  sessions: [],
@@ -350,7 +355,7 @@ export class LocalRuntimeApiRouter {
350
355
  if (await this.sessions.handle({
351
356
  method,
352
357
  segments,
353
- body,
358
+ url, body,
354
359
  environmentId,
355
360
  environment,
356
361
  response: res,
@@ -1,4 +1,5 @@
1
1
  import { createRequestSteeringInbox } from "../../runtime/request/request-steering.js";
2
+ import { traceWebProjection } from "./request-control-observation.js";
2
3
  function hasMatchingRequestView(active, input) {
3
4
  if (active.environmentId !== input.environmentId)
4
5
  return false;
@@ -22,9 +23,13 @@ export async function attachApprovalRequest(input) {
22
23
  lastEventName: "tool.approval.required",
23
24
  events: [...input.events],
24
25
  finalState: null,
25
- requestSteering: createRequestSteeringInbox({ requestId }),
26
+ requestSteering: createRequestSteeringInbox({
27
+ requestId,
28
+ diagnostics: { origin: "web_projection" },
29
+ }),
26
30
  };
27
31
  activeRequests.set(requestId, active);
32
+ traceWebProjection("projection.opened", requestId, active, "approval_attachment");
28
33
  }
29
34
  if (pending.run)
30
35
  return;
@@ -37,8 +42,10 @@ export async function attachApprovalRequest(input) {
37
42
  resolve();
38
43
  })
39
44
  .catch((error) => {
40
- if (createdProjection && activeRequests.get(requestId) === projection)
41
- activeRequests.delete(requestId);
45
+ if (createdProjection && activeRequests.get(requestId) === projection) {
46
+ const removed = activeRequests.delete(requestId);
47
+ traceWebProjection("projection.removed", requestId, projection, "attachment_error", removed);
48
+ }
42
49
  if (accepted)
43
50
  input.publish(JSON.stringify({
44
51
  type: "control",
@@ -51,8 +58,10 @@ export async function attachApprovalRequest(input) {
51
58
  .finally(() => {
52
59
  if (!projection.finalState)
53
60
  return;
54
- if (activeRequests.get(requestId) === projection)
55
- activeRequests.delete(requestId);
61
+ if (activeRequests.get(requestId) === projection) {
62
+ const removed = activeRequests.delete(requestId);
63
+ traceWebProjection("projection.removed", requestId, projection, "attachment_terminal_settled", removed);
64
+ }
56
65
  });
57
66
  });
58
67
  }
@@ -4,4 +4,4 @@ export type ConfigurationActivationPreparation = {
4
4
  restoreConfiguration(): void;
5
5
  };
6
6
  /** Cooperating root and linked-file saves wait for activation or restoration to finish. */
7
- export declare function withConfigurationActivationSource(configPath: string, operation: (preparation: ConfigurationActivationPreparation) => Promise<RuntimeSetupActivation>): Promise<RuntimeSetupActivation>;
7
+ export declare function withConfigurationActivationSource(configPath: string, operation: (preparation: ConfigurationActivationPreparation) => Promise<RuntimeSetupActivation>, expectedRevision?: string, pluginRootDir?: string): Promise<RuntimeSetupActivation>;
@@ -1,4 +1,5 @@
1
- import { withConfigFileTransaction } from "../../runtime/adapters/config-file-transaction.js";
1
+ import { withPluginConfigurationLock } from "../../runtime/plugins/configuration-write.js";
2
+ import { ConfigFileConflictError, withConfigFileTransaction, } from "../../runtime/adapters/config-file-transaction.js";
2
3
  import { resolveRequestRunnerConfigReference } from "../../runtime/config/request-runner-config.js";
3
4
  import { invalidateRequestRunnerConfig } from "../../runtime/config/runner/loader.js";
4
5
  function restoreUnappliedRequestRunner(activation, preparation) {
@@ -7,8 +8,11 @@ function restoreUnappliedRequestRunner(activation, preparation) {
7
8
  preparation.restoreConfiguration();
8
9
  }
9
10
  /** Cooperating root and linked-file saves wait for activation or restoration to finish. */
10
- export function withConfigurationActivationSource(configPath, operation) {
11
+ export function withConfigurationActivationSource(configPath, operation, expectedRevision, pluginRootDir) {
11
12
  return withConfigFileTransaction(configPath, async (transaction) => {
13
+ if (expectedRevision !== undefined &&
14
+ transaction.snapshot.revision !== expectedRevision)
15
+ throw new ConfigFileConflictError();
12
16
  const runner = resolveRequestRunnerConfigReference({
13
17
  fileConfig: transaction.snapshot.config,
14
18
  mainConfigPath: configPath,
@@ -24,7 +28,9 @@ export function withConfigurationActivationSource(configPath, operation) {
24
28
  },
25
29
  };
26
30
  try {
27
- const activation = await operation(preparation);
31
+ const activation = await (pluginRootDir
32
+ ? withPluginConfigurationLock(pluginRootDir, () => operation(preparation))
33
+ : operation(preparation));
28
34
  restoreUnappliedRequestRunner(activation, preparation);
29
35
  return activation;
30
36
  }
@@ -1,4 +1,4 @@
1
- import type { RuntimeSetupGatewayRestorePoint } from "../runtime-setup-gateway.js";
1
+ import type { AppliedGatewayConfigurations, RuntimeSetupGatewayRestorePoint } from "../runtime-setup-gateway.js";
2
2
  import type { WebUiEnvironmentConfig } from "../environment-config.js";
3
3
  import type { RuntimeSetupActivation } from "./runtime-setup-input.js";
4
4
  import type { LocalRuntimeApplication } from "../../runtime/local-application.js";
@@ -11,9 +11,10 @@ export type LocalRuntimeBackendOptions = {
11
11
  defaultEnvironmentId: string;
12
12
  resolveEnvironmentConfig?: (configPath?: string) => WebUiEnvironmentConfig;
13
13
  providerAdapters?: ModelProviderAdapterRegistry;
14
- onRuntimeSetup?: (configPath: string) => Promise<RuntimeSetupActivation>;
14
+ captureRuntimeSetupConfiguration?: (configPath?: string) => string | null;
15
+ onRuntimeSetup?: (configPath: string, applied?: AppliedGatewayConfigurations) => Promise<RuntimeSetupActivation>;
15
16
  createRuntimeSetupRestorePoint?: () => RuntimeSetupGatewayRestorePoint;
16
- checkRuntimeSetupActivation?: (configPath: string) => Promise<RuntimeSetupActivation>;
17
+ checkRuntimeSetupActivation?: (configPath: string, applied?: AppliedGatewayConfigurations) => Promise<RuntimeSetupActivation>;
17
18
  };
18
19
  export type ResolvedLocalRuntimeBackendOptions = Omit<LocalRuntimeBackendOptions, "providerAdapters"> & {
19
20
  providerAdapters: ModelProviderAdapterRegistry;
@@ -7,6 +7,7 @@ export declare class RuntimeEnvironmentRegistry {
7
7
  private readonly options;
8
8
  private readonly schedulerBindings;
9
9
  private readonly environments;
10
+ private readonly gatewayConfigurations;
10
11
  private stopped;
11
12
  private readonly desiredEnvironmentIds;
12
13
  private applying;
@@ -23,13 +24,16 @@ export declare class RuntimeEnvironmentRegistry {
23
24
  status(): Promise<import("../../computer-access/native-permission-contract.js").NativePermissionStatus>;
24
25
  prepare(input: import("../../computer-access/native-permission-contract.js").NativePermissionInput): Promise<import("../../computer-access/native-permission-contract.js").NativePermissionResult>;
25
26
  }> | undefined;
26
- applyConfiguration(): Promise<RuntimeSetupActivation>;
27
+ requirePluginInactive(pluginId: string, capabilityIds: readonly string[]): void;
28
+ requirePluginMutationIdle(hasAcknowledgedRequests?: boolean): void;
29
+ applyConfiguration(expectedRevision?: string): Promise<RuntimeSetupActivation>;
27
30
  private applySavedConfiguration;
28
31
  private checkGatewayActivation;
29
32
  configure(configPath: string): void;
30
33
  modelCatalog(environmentId: string): RuntimeModelCatalogState;
31
34
  setupRequirement(environmentId: string): RuntimeSetupRequirement | null;
32
35
  get(environmentId: string): RuntimeEnvironment;
36
+ private captureGatewayConfiguration;
33
37
  private createEnvironment;
34
38
  start(environmentIds: readonly string[]): Promise<void>;
35
39
  private startEnvironment;
@@ -1,3 +1,7 @@
1
+ import { requirePluginOwnersIdle } from "./plugin-mutation-admission.js";
2
+ import { ConfigFileConflictError } from "../../runtime/adapters/config-file-transaction.js";
3
+ import { PluginManagementError } from "../plugin-management-service.js";
4
+ import { isPluginToolSelected, normalizePluginSelection, } from "../../runtime/plugins/selection.js";
1
5
  import { requiresConfiguredCredential } from "./runtime-setup-provider.js";
2
6
  import { applyRuntimeConfiguration } from "./configuration-activation.js";
3
7
  import { withConfigurationActivationSource, } from "./configuration-activation-source.js";
@@ -11,6 +15,7 @@ export class RuntimeEnvironmentRegistry {
11
15
  options;
12
16
  schedulerBindings;
13
17
  environments = new Map();
18
+ gatewayConfigurations = new WeakMap();
14
19
  stopped = false;
15
20
  desiredEnvironmentIds = new Set();
16
21
  applying;
@@ -30,13 +35,35 @@ export class RuntimeEnvironmentRegistry {
30
35
  return undefined;
31
36
  return this.environments.get(environmentId)?.nativePermissions;
32
37
  }
33
- applyConfiguration() {
38
+ requirePluginInactive(pluginId, capabilityIds) {
39
+ this.requireEnvironmentIntakeOpen();
40
+ if (this.setupActivationPending || this.environments.size === 0)
41
+ throw new PluginManagementError("plugin_runtime_unavailable", "Apply Runtime configuration before removing plugins.", 409);
42
+ for (const environment of this.environments.values()) {
43
+ const selection = normalizePluginSelection(environment.services.config.plugins);
44
+ if (environment.getOwnership() !== "owner" ||
45
+ capabilityIds.some((toolName) => isPluginToolSelected({ pluginId, toolName, selection })))
46
+ throw new PluginManagementError("plugin_still_active", "The plugin is still available in a Runtime environment. Apply its disable before removing it.", 409);
47
+ }
48
+ }
49
+ requirePluginMutationIdle(hasAcknowledgedRequests = false) {
50
+ requirePluginOwnersIdle({
51
+ environments: this.environments.values(),
52
+ unavailable: this.stopped || this.setupActivationPending,
53
+ busy: hasAcknowledgedRequests || !!this.applying,
54
+ });
55
+ }
56
+ applyConfiguration(expectedRevision) {
34
57
  if (this.stopped)
35
58
  return Promise.reject(new Error("web_runtime_stopped"));
36
- if (this.applying)
59
+ if (this.applying) {
60
+ // A coalesced Apply may have loaded a different revision from this removal.
61
+ if (expectedRevision !== undefined)
62
+ return Promise.reject(new ConfigFileConflictError());
37
63
  return this.applying;
64
+ }
38
65
  const configPath = inspectRuntimeConfigFileWithMeta(this.options.rootDir ?? process.cwd(), this.options.configPath ?? process.env.LLM_RUNTIME_CONFIG_FILE).path;
39
- const apply = withConfigurationActivationSource(configPath, (prepare) => this.applySavedConfiguration(configPath, prepare));
66
+ const apply = withConfigurationActivationSource(configPath, (prepare) => this.applySavedConfiguration(configPath, prepare), expectedRevision, this.options.rootDir ?? process.cwd());
40
67
  this.applying = apply.finally(() => {
41
68
  this.applying = undefined;
42
69
  });
@@ -44,6 +71,7 @@ export class RuntimeEnvironmentRegistry {
44
71
  }
45
72
  applySavedConfiguration(configPath, preparation) {
46
73
  const nextEnvironments = this.options.resolveEnvironmentConfig?.(configPath);
74
+ let appliedGatewayConfigurations;
47
75
  return applyRuntimeConfiguration({
48
76
  environments: this.environments,
49
77
  defaultEnvironmentId: nextEnvironments?.defaultEnvironmentId ??
@@ -51,16 +79,18 @@ export class RuntimeEnvironmentRegistry {
51
79
  environmentIds: nextEnvironments?.environments.map(({ id }) => id) ?? [
52
80
  ...this.desiredEnvironmentIds,
53
81
  ],
54
- createEnvironment: (id) => this.createEnvironment(id, this.loadConfig(id, configPath)),
55
- recreateEnvironment: (id, previous) => this.createEnvironment(id, previous.services.config),
82
+ createEnvironment: (id) => this.createEnvironment(id, this.loadConfig(id, configPath), this.captureGatewayConfiguration(configPath)),
83
+ recreateEnvironment: (id, previous) => this.createEnvironment(id, previous.services.config, this.gatewayConfigurations.get(previous) ?? null),
56
84
  createGatewayRestorePoint: this.options.createRuntimeSetupRestorePoint,
57
85
  onRestorationFailure: () => {
58
86
  this.setupActivationPending = true;
59
87
  },
60
88
  ...preparation,
61
- checkGateway: () => this.checkGatewayActivation(configPath),
62
- activateGateway: () => this.options.onRuntimeSetup?.(configPath) ??
63
- Promise.resolve({ status: "ready" }),
89
+ checkGateway: () => {
90
+ appliedGatewayConfigurations = [...this.environments.values()].map((environment) => this.gatewayConfigurations.get(environment) ?? null);
91
+ return this.checkGatewayActivation(configPath, appliedGatewayConfigurations);
92
+ },
93
+ activateGateway: () => this.options.onRuntimeSetup?.(configPath, appliedGatewayConfigurations) ?? Promise.resolve({ status: "ready" }),
64
94
  canContinue: () => !this.stopped,
65
95
  }).then((result) => {
66
96
  if (result.status !== "ready")
@@ -77,9 +107,9 @@ export class RuntimeEnvironmentRegistry {
77
107
  return result;
78
108
  });
79
109
  }
80
- checkGatewayActivation(configPath) {
110
+ checkGatewayActivation(configPath, applied) {
81
111
  if (this.options.checkRuntimeSetupActivation)
82
- return this.options.checkRuntimeSetupActivation(configPath);
112
+ return this.options.checkRuntimeSetupActivation(configPath, applied);
83
113
  if (this.options.onRuntimeSetup)
84
114
  return Promise.resolve({ status: "ready" });
85
115
  return Promise.resolve({
@@ -141,10 +171,22 @@ export class RuntimeEnvironmentRegistry {
141
171
  this.environments.set(normalized, environment);
142
172
  return environment;
143
173
  }
144
- createEnvironment(environmentId, config = this.loadConfig(environmentId)) {
174
+ captureGatewayConfiguration(configPath) {
175
+ try {
176
+ return (this.options.captureRuntimeSetupConfiguration?.(configPath) ?? null);
177
+ }
178
+ catch {
179
+ // An unavailable gateway snapshot cannot block an otherwise valid Runtime.
180
+ // Apply still refuses external reuse when any owner's snapshot is unknown.
181
+ return null;
182
+ }
183
+ }
184
+ createEnvironment(environmentId, config = this.loadConfig(environmentId), gatewayConfiguration = this.captureGatewayConfiguration(this.options.configPath)) {
145
185
  const environment = createLocalRuntimeApplication(config, {
146
186
  scheduledRequestOptions: this.schedulerBindings.requestOptions,
147
187
  });
188
+ // Capture before startup; restored owners keep their prior immutable snapshot.
189
+ this.gatewayConfigurations.set(environment, gatewayConfiguration);
148
190
  if (this.schedulerBindings.publish) {
149
191
  environment.subscribeScheduledEvents(this.schedulerBindings.publish);
150
192
  }
@@ -0,0 +1,16 @@
1
+ import type { RuntimeConfig } from "../../runtime/ports.js";
2
+ import type { SessionSnapshotOptions } from "../../sessions/snapshot.js";
3
+ import type { SessionSnapshot } from "../../sessions/types.js";
4
+ export declare function webPageSize(config: RuntimeConfig): number;
5
+ export declare function historyPageOptions(url: URL | undefined, config: RuntimeConfig): SessionSnapshotOptions;
6
+ /** Compact identities stay between the session service and the read-state owner. */
7
+ export declare function publicHistorySnapshot(snapshot: SessionSnapshot): {
8
+ kind?: import("../../sessions/spark-session.js").SessionKind;
9
+ project?: import("../../sessions/project-binding.js").SessionProject;
10
+ sessionId: string;
11
+ title: string;
12
+ messages: import("../../sessions/types.js").SessionSnapshotMessage[];
13
+ requests: import("../../sessions/types.js").SessionSnapshotRequest[];
14
+ nextCursor: string | null;
15
+ newerCursor?: string | null;
16
+ };