@nocobase/app-plugin-agents 0.1.0-beta.9 → 1.0.0-beta.16

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 (914) hide show
  1. package/CHANGELOG.md +315 -0
  2. package/README.md +94 -51
  3. package/dist/client/api/client.d.ts +25 -19
  4. package/dist/client/api/client.d.ts.map +1 -1
  5. package/dist/client/api/client.js +23 -24
  6. package/dist/client/api/client.js.map +1 -1
  7. package/dist/client/api/keys.d.ts +4 -1
  8. package/dist/client/api/keys.d.ts.map +1 -1
  9. package/dist/client/api/keys.js +4 -1
  10. package/dist/client/api/keys.js.map +1 -1
  11. package/dist/client/api/runners.d.ts +8 -4
  12. package/dist/client/api/runners.d.ts.map +1 -1
  13. package/dist/client/api/runners.js +9 -0
  14. package/dist/client/api/runners.js.map +1 -1
  15. package/dist/client/chat/ai-form.d.ts +13 -0
  16. package/dist/client/chat/ai-form.d.ts.map +1 -0
  17. package/dist/client/chat/ai-form.js +57 -0
  18. package/dist/client/chat/ai-form.js.map +1 -0
  19. package/dist/client/chat/api.d.ts +16 -14
  20. package/dist/client/chat/api.d.ts.map +1 -1
  21. package/dist/client/chat/api.js +85 -18
  22. package/dist/client/chat/api.js.map +1 -1
  23. package/dist/client/chat/client-id.d.ts +3 -0
  24. package/dist/client/chat/client-id.d.ts.map +1 -0
  25. package/dist/client/chat/client-id.js +17 -0
  26. package/dist/client/chat/client-id.js.map +1 -0
  27. package/dist/client/chat/consultation-identity.d.ts +7 -0
  28. package/dist/client/chat/consultation-identity.d.ts.map +1 -0
  29. package/dist/client/chat/consultation-identity.js +39 -0
  30. package/dist/client/chat/consultation-identity.js.map +1 -0
  31. package/dist/client/chat/context-model.d.ts +21 -3
  32. package/dist/client/chat/context-model.d.ts.map +1 -1
  33. package/dist/client/chat/context-model.js +33 -4
  34. package/dist/client/chat/context-model.js.map +1 -1
  35. package/dist/client/chat/controller.d.ts +83 -0
  36. package/dist/client/chat/controller.d.ts.map +1 -0
  37. package/dist/client/chat/controller.js +767 -0
  38. package/dist/client/chat/controller.js.map +1 -0
  39. package/dist/client/chat/extensions.d.ts +8 -3
  40. package/dist/client/chat/extensions.d.ts.map +1 -1
  41. package/dist/client/chat/extensions.js.map +1 -1
  42. package/dist/client/chat/feedback.d.ts +18 -0
  43. package/dist/client/chat/feedback.d.ts.map +1 -0
  44. package/dist/client/chat/feedback.js +38 -0
  45. package/dist/client/chat/feedback.js.map +1 -0
  46. package/dist/client/chat/form-registry.d.ts +95 -0
  47. package/dist/client/chat/form-registry.d.ts.map +1 -0
  48. package/dist/client/chat/form-registry.js +384 -0
  49. package/dist/client/chat/form-registry.js.map +1 -0
  50. package/dist/client/chat/keys.d.ts +1 -0
  51. package/dist/client/chat/keys.d.ts.map +1 -1
  52. package/dist/client/chat/keys.js +3 -1
  53. package/dist/client/chat/keys.js.map +1 -1
  54. package/dist/client/chat/message-model.d.ts +38 -44
  55. package/dist/client/chat/message-model.d.ts.map +1 -1
  56. package/dist/client/chat/message-model.js +138 -56
  57. package/dist/client/chat/message-model.js.map +1 -1
  58. package/dist/client/chat/provider.d.ts +12 -2
  59. package/dist/client/chat/provider.d.ts.map +1 -1
  60. package/dist/client/chat/provider.js +130 -4
  61. package/dist/client/chat/provider.js.map +1 -1
  62. package/dist/client/chat/submissions.d.ts +67 -0
  63. package/dist/client/chat/submissions.d.ts.map +1 -0
  64. package/dist/client/chat/submissions.js +241 -0
  65. package/dist/client/chat/submissions.js.map +1 -0
  66. package/dist/client/chat/tool-renderer.d.ts +39 -0
  67. package/dist/client/chat/tool-renderer.d.ts.map +1 -0
  68. package/dist/client/chat/tool-renderer.js +27 -0
  69. package/dist/client/chat/tool-renderer.js.map +1 -0
  70. package/dist/client/chat/use-chat-scroll.d.ts +4 -0
  71. package/dist/client/chat/use-chat-scroll.d.ts.map +1 -0
  72. package/dist/client/chat/use-chat-scroll.js +73 -0
  73. package/dist/client/chat/use-chat-scroll.js.map +1 -0
  74. package/dist/client/chat/use-chat.d.ts +13 -24
  75. package/dist/client/chat/use-chat.d.ts.map +1 -1
  76. package/dist/client/chat/use-chat.js +250 -235
  77. package/dist/client/chat/use-chat.js.map +1 -1
  78. package/dist/client/chat.d.ts +20 -8
  79. package/dist/client/chat.d.ts.map +1 -1
  80. package/dist/client/chat.js +16 -4
  81. package/dist/client/chat.js.map +1 -1
  82. package/dist/client/components/agent-picker.d.ts +6 -23
  83. package/dist/client/components/agent-picker.d.ts.map +1 -1
  84. package/dist/client/components/agent-picker.js +20 -39
  85. package/dist/client/components/agent-picker.js.map +1 -1
  86. package/dist/client/components/quota-status.d.ts +16 -0
  87. package/dist/client/components/quota-status.d.ts.map +1 -0
  88. package/dist/client/components/quota-status.js +39 -0
  89. package/dist/client/components/quota-status.js.map +1 -0
  90. package/dist/client/components/runners-refresh.d.ts.map +1 -1
  91. package/dist/client/components/runners-refresh.js +1 -0
  92. package/dist/client/components/runners-refresh.js.map +1 -1
  93. package/dist/client/components/variables/variable-dialogs.d.ts.map +1 -1
  94. package/dist/client/components/variables/variable-dialogs.js +7 -7
  95. package/dist/client/components/variables/variable-dialogs.js.map +1 -1
  96. package/dist/client/config.d.ts +2 -0
  97. package/dist/client/config.d.ts.map +1 -1
  98. package/dist/client/config.js +2 -0
  99. package/dist/client/config.js.map +1 -1
  100. package/dist/client/hooks/use-agent-picker-labels.d.ts.map +1 -1
  101. package/dist/client/hooks/use-agent-picker-labels.js +4 -12
  102. package/dist/client/hooks/use-agent-picker-labels.js.map +1 -1
  103. package/dist/client/hooks/use-quota-expiry.d.ts +7 -0
  104. package/dist/client/hooks/use-quota-expiry.d.ts.map +1 -0
  105. package/dist/client/hooks/use-quota-expiry.js +92 -0
  106. package/dist/client/hooks/use-quota-expiry.js.map +1 -0
  107. package/dist/client/hooks/use-realtime-topic.d.ts +1 -4
  108. package/dist/client/hooks/use-realtime-topic.d.ts.map +1 -1
  109. package/dist/client/hooks/use-realtime-topic.js +7 -11
  110. package/dist/client/hooks/use-realtime-topic.js.map +1 -1
  111. package/dist/client/kit.d.ts +14 -12
  112. package/dist/client/kit.d.ts.map +1 -1
  113. package/dist/client/kit.js +37 -14
  114. package/dist/client/kit.js.map +1 -1
  115. package/dist/client/lib/agents.d.ts +5 -18
  116. package/dist/client/lib/agents.d.ts.map +1 -1
  117. package/dist/client/lib/agents.js +18 -55
  118. package/dist/client/lib/agents.js.map +1 -1
  119. package/dist/client/lib/format.d.ts +3 -1
  120. package/dist/client/lib/format.d.ts.map +1 -1
  121. package/dist/client/lib/format.js +25 -0
  122. package/dist/client/lib/format.js.map +1 -1
  123. package/dist/client/lib/skill-settings-context.d.ts +9 -0
  124. package/dist/client/lib/skill-settings-context.d.ts.map +1 -0
  125. package/dist/client/lib/skill-settings-context.js +4 -0
  126. package/dist/client/lib/skill-settings-context.js.map +1 -0
  127. package/dist/client/lib/skill-settings.d.ts +12 -0
  128. package/dist/client/lib/skill-settings.d.ts.map +1 -0
  129. package/dist/client/lib/skill-settings.js +37 -0
  130. package/dist/client/lib/skill-settings.js.map +1 -0
  131. package/dist/client/locales/chat.en-US.d.ts +8 -27
  132. package/dist/client/locales/chat.en-US.d.ts.map +1 -1
  133. package/dist/client/locales/chat.en-US.js +12 -30
  134. package/dist/client/locales/chat.en-US.js.map +1 -1
  135. package/dist/client/locales/chat.zh-CN.d.ts.map +1 -1
  136. package/dist/client/locales/chat.zh-CN.js +9 -27
  137. package/dist/client/locales/chat.zh-CN.js.map +1 -1
  138. package/dist/client/locales/de-DE.d.ts +5 -0
  139. package/dist/client/locales/de-DE.d.ts.map +1 -0
  140. package/dist/client/locales/de-DE.js +1219 -0
  141. package/dist/client/locales/de-DE.js.map +1 -0
  142. package/dist/client/locales/en-US.d.ts +95 -217
  143. package/dist/client/locales/en-US.d.ts.map +1 -1
  144. package/dist/client/locales/en-US.js +100 -218
  145. package/dist/client/locales/en-US.js.map +1 -1
  146. package/dist/client/locales/es-ES.d.ts +5 -0
  147. package/dist/client/locales/es-ES.d.ts.map +1 -0
  148. package/dist/client/locales/es-ES.js +1228 -0
  149. package/dist/client/locales/es-ES.js.map +1 -0
  150. package/dist/client/locales/fr-FR.d.ts +5 -0
  151. package/dist/client/locales/fr-FR.d.ts.map +1 -0
  152. package/dist/client/locales/fr-FR.js +1229 -0
  153. package/dist/client/locales/fr-FR.js.map +1 -0
  154. package/dist/client/locales/id-ID.d.ts +5 -0
  155. package/dist/client/locales/id-ID.d.ts.map +1 -0
  156. package/dist/client/locales/id-ID.js +1219 -0
  157. package/dist/client/locales/id-ID.js.map +1 -0
  158. package/dist/client/locales/index.d.ts.map +1 -1
  159. package/dist/client/locales/index.js +8 -0
  160. package/dist/client/locales/index.js.map +1 -1
  161. package/dist/client/locales/ja-JP.d.ts +5 -0
  162. package/dist/client/locales/ja-JP.d.ts.map +1 -0
  163. package/dist/client/locales/ja-JP.js +1219 -0
  164. package/dist/client/locales/ja-JP.js.map +1 -0
  165. package/dist/client/locales/pt-BR.d.ts +5 -0
  166. package/dist/client/locales/pt-BR.d.ts.map +1 -0
  167. package/dist/client/locales/pt-BR.js +1229 -0
  168. package/dist/client/locales/pt-BR.js.map +1 -0
  169. package/dist/client/locales/runWait.en-US.d.ts +7 -0
  170. package/dist/client/locales/runWait.en-US.d.ts.map +1 -1
  171. package/dist/client/locales/runWait.en-US.js +10 -3
  172. package/dist/client/locales/runWait.en-US.js.map +1 -1
  173. package/dist/client/locales/runWait.zh-CN.d.ts +1 -1
  174. package/dist/client/locales/runWait.zh-CN.d.ts.map +1 -1
  175. package/dist/client/locales/runWait.zh-CN.js +11 -4
  176. package/dist/client/locales/runWait.zh-CN.js.map +1 -1
  177. package/dist/client/locales/runtimes.en-US.d.ts +83 -0
  178. package/dist/client/locales/runtimes.en-US.d.ts.map +1 -1
  179. package/dist/client/locales/runtimes.en-US.js +84 -1
  180. package/dist/client/locales/runtimes.en-US.js.map +1 -1
  181. package/dist/client/locales/runtimes.zh-CN.d.ts.map +1 -1
  182. package/dist/client/locales/runtimes.zh-CN.js +83 -0
  183. package/dist/client/locales/runtimes.zh-CN.js.map +1 -1
  184. package/dist/client/locales/skills.en-US.d.ts +7 -0
  185. package/dist/client/locales/skills.en-US.d.ts.map +1 -1
  186. package/dist/client/locales/skills.en-US.js +8 -1
  187. package/dist/client/locales/skills.en-US.js.map +1 -1
  188. package/dist/client/locales/skills.zh-CN.d.ts.map +1 -1
  189. package/dist/client/locales/skills.zh-CN.js +8 -1
  190. package/dist/client/locales/skills.zh-CN.js.map +1 -1
  191. package/dist/client/locales/vi-VN.d.ts +5 -0
  192. package/dist/client/locales/vi-VN.d.ts.map +1 -0
  193. package/dist/client/locales/vi-VN.js +1219 -0
  194. package/dist/client/locales/vi-VN.js.map +1 -0
  195. package/dist/client/locales/zh-CN.d.ts.map +1 -1
  196. package/dist/client/locales/zh-CN.js +102 -220
  197. package/dist/client/locales/zh-CN.js.map +1 -1
  198. package/dist/client/locales/zh-TW.d.ts +5 -0
  199. package/dist/client/locales/zh-TW.d.ts.map +1 -0
  200. package/dist/client/locales/zh-TW.js +1219 -0
  201. package/dist/client/locales/zh-TW.js.map +1 -0
  202. package/dist/client/model-suggestion.d.ts +6 -0
  203. package/dist/client/model-suggestion.d.ts.map +1 -0
  204. package/dist/client/model-suggestion.js +25 -0
  205. package/dist/client/model-suggestion.js.map +1 -0
  206. package/dist/client/online/services.d.ts.map +1 -1
  207. package/dist/client/online/services.js +5 -6
  208. package/dist/client/online/services.js.map +1 -1
  209. package/dist/client/pages/agents/agent-dialog.d.ts +9 -0
  210. package/dist/client/pages/agents/agent-dialog.d.ts.map +1 -0
  211. package/dist/client/pages/agents/agent-dialog.js +99 -0
  212. package/dist/client/pages/agents/agent-dialog.js.map +1 -0
  213. package/dist/client/pages/agents/agent-state.d.ts +11 -0
  214. package/dist/client/pages/agents/agent-state.d.ts.map +1 -0
  215. package/dist/client/pages/agents/agent-state.js +28 -0
  216. package/dist/client/pages/agents/agent-state.js.map +1 -0
  217. package/dist/client/pages/agents/index.d.ts +1 -1
  218. package/dist/client/pages/agents/index.d.ts.map +1 -1
  219. package/dist/client/pages/agents/index.js +7 -101
  220. package/dist/client/pages/agents/index.js.map +1 -1
  221. package/dist/client/pages/agents/runner-agents.d.ts +3 -0
  222. package/dist/client/pages/agents/runner-agents.d.ts.map +1 -0
  223. package/dist/client/pages/agents/runner-agents.js +185 -0
  224. package/dist/client/pages/agents/runner-agents.js.map +1 -0
  225. package/dist/client/pages/runtimes/connect.js.map +1 -1
  226. package/dist/client/pages/runtimes/index.d.ts.map +1 -1
  227. package/dist/client/pages/runtimes/index.js +1 -1
  228. package/dist/client/pages/runtimes/index.js.map +1 -1
  229. package/dist/client/pages/runtimes/quota-targets.d.ts +4 -0
  230. package/dist/client/pages/runtimes/quota-targets.d.ts.map +1 -0
  231. package/dist/client/pages/runtimes/quota-targets.js +18 -0
  232. package/dist/client/pages/runtimes/quota-targets.js.map +1 -0
  233. package/dist/client/pages/runtimes/quota.d.ts +17 -0
  234. package/dist/client/pages/runtimes/quota.d.ts.map +1 -0
  235. package/dist/client/pages/runtimes/quota.js +50 -0
  236. package/dist/client/pages/runtimes/quota.js.map +1 -0
  237. package/dist/client/pages/runtimes/runner-cells.d.ts +11 -4
  238. package/dist/client/pages/runtimes/runner-cells.d.ts.map +1 -1
  239. package/dist/client/pages/runtimes/runner-cells.js +6 -3
  240. package/dist/client/pages/runtimes/runner-cells.js.map +1 -1
  241. package/dist/client/pages/runtimes/runner-overview.d.ts +9 -0
  242. package/dist/client/pages/runtimes/runner-overview.d.ts.map +1 -0
  243. package/dist/client/pages/runtimes/runner-overview.js +109 -0
  244. package/dist/client/pages/runtimes/runner-overview.js.map +1 -0
  245. package/dist/client/pages/runtimes/runner-runs.d.ts +5 -0
  246. package/dist/client/pages/runtimes/runner-runs.d.ts.map +1 -0
  247. package/dist/client/pages/runtimes/runner-runs.js +35 -0
  248. package/dist/client/pages/runtimes/runner-runs.js.map +1 -0
  249. package/dist/client/pages/runtimes/runner-sheet.d.ts +2 -3
  250. package/dist/client/pages/runtimes/runner-sheet.d.ts.map +1 -1
  251. package/dist/client/pages/runtimes/runner-sheet.js +43 -171
  252. package/dist/client/pages/runtimes/runner-sheet.js.map +1 -1
  253. package/dist/client/pages/runtimes/runner-tools.d.ts +17 -0
  254. package/dist/client/pages/runtimes/runner-tools.d.ts.map +1 -0
  255. package/dist/client/pages/runtimes/runner-tools.js +75 -0
  256. package/dist/client/pages/runtimes/runner-tools.js.map +1 -0
  257. package/dist/client/pages/runtimes/runner-workspaces.d.ts +6 -0
  258. package/dist/client/pages/runtimes/runner-workspaces.d.ts.map +1 -0
  259. package/dist/client/pages/runtimes/runner-workspaces.js +37 -0
  260. package/dist/client/pages/runtimes/runner-workspaces.js.map +1 -0
  261. package/dist/client/pages/runtimes/tool-slots-fields.js +1 -1
  262. package/dist/client/pages/runtimes/tool-slots-fields.js.map +1 -1
  263. package/dist/client/pages/runtimes/workspace-diagnostics.d.ts +6 -4
  264. package/dist/client/pages/runtimes/workspace-diagnostics.d.ts.map +1 -1
  265. package/dist/client/pages/runtimes/workspace-diagnostics.js +67 -33
  266. package/dist/client/pages/runtimes/workspace-diagnostics.js.map +1 -1
  267. package/dist/client/pages/skills/detail/index.d.ts.map +1 -1
  268. package/dist/client/pages/skills/detail/index.js +11 -15
  269. package/dist/client/pages/skills/detail/index.js.map +1 -1
  270. package/dist/client/pages/skills/index.d.ts.map +1 -1
  271. package/dist/client/pages/skills/index.js +2 -2
  272. package/dist/client/pages/skills/index.js.map +1 -1
  273. package/dist/client/pages/usage/date-range-picker.d.ts.map +1 -1
  274. package/dist/client/pages/usage/date-range-picker.js +14 -2
  275. package/dist/client/pages/usage/date-range-picker.js.map +1 -1
  276. package/dist/client/pages/usage/index.js +2 -2
  277. package/dist/client/pages/usage/index.js.map +1 -1
  278. package/dist/client/profile/default-agent.d.ts.map +1 -1
  279. package/dist/client/profile/default-agent.js +2 -4
  280. package/dist/client/profile/default-agent.js.map +1 -1
  281. package/dist/client/routes.d.ts +1 -1
  282. package/dist/client/routes.d.ts.map +1 -1
  283. package/dist/client/routes.js +1 -13
  284. package/dist/client/routes.js.map +1 -1
  285. package/dist/client/runs/format-wait.d.ts.map +1 -1
  286. package/dist/client/runs/format-wait.js +15 -1
  287. package/dist/client/runs/format-wait.js.map +1 -1
  288. package/dist/client/runs/subject-runs.d.ts +5 -0
  289. package/dist/client/runs/subject-runs.d.ts.map +1 -1
  290. package/dist/client/runs/subject-runs.js +24 -9
  291. package/dist/client/runs/subject-runs.js.map +1 -1
  292. package/dist/client/runs/use-run-events.d.ts +1 -1
  293. package/dist/client/runs/use-run-events.d.ts.map +1 -1
  294. package/dist/client/runs/use-run-events.js +5 -2
  295. package/dist/client/runs/use-run-events.js.map +1 -1
  296. package/dist/client/runs.d.ts +1 -1
  297. package/dist/client/runs.d.ts.map +1 -1
  298. package/dist/client/runs.js +1 -1
  299. package/dist/client/runs.js.map +1 -1
  300. package/dist/database/migrations/.manifest.json +38 -2
  301. package/dist/database/migrations/202610020003_ag_create_runs.d.ts.map +1 -1
  302. package/dist/database/migrations/202610020003_ag_create_runs.js +0 -1
  303. package/dist/database/migrations/202610020003_ag_create_runs.js.map +1 -1
  304. package/dist/database/migrations/202610120002_ag_add_queue_entered_at.d.ts +4 -0
  305. package/dist/database/migrations/202610120002_ag_add_queue_entered_at.d.ts.map +1 -0
  306. package/dist/database/migrations/202610120002_ag_add_queue_entered_at.js +50 -0
  307. package/dist/database/migrations/202610120002_ag_add_queue_entered_at.js.map +1 -0
  308. package/dist/database/migrations/202610170001_ag_runner_quota.d.ts +4 -0
  309. package/dist/database/migrations/202610170001_ag_runner_quota.d.ts.map +1 -0
  310. package/dist/database/migrations/202610170001_ag_runner_quota.js +19 -0
  311. package/dist/database/migrations/202610170001_ag_runner_quota.js.map +1 -0
  312. package/dist/database/migrations/202610240020_ag_runner_agents.d.ts +4 -0
  313. package/dist/database/migrations/202610240020_ag_runner_agents.d.ts.map +1 -0
  314. package/dist/database/migrations/202610240020_ag_runner_agents.js +115 -0
  315. package/dist/database/migrations/202610240020_ag_runner_agents.js.map +1 -0
  316. package/dist/database/migrations/202610240040_ag_discovery_preferences.d.ts +4 -0
  317. package/dist/database/migrations/202610240040_ag_discovery_preferences.d.ts.map +1 -0
  318. package/dist/database/migrations/202610240040_ag_discovery_preferences.js +18 -0
  319. package/dist/database/migrations/202610240040_ag_discovery_preferences.js.map +1 -0
  320. package/dist/database/migrations/202610250001_ag_comment_runner_consent.d.ts +4 -0
  321. package/dist/database/migrations/202610250001_ag_comment_runner_consent.d.ts.map +1 -0
  322. package/dist/database/migrations/202610250001_ag_comment_runner_consent.js +41 -0
  323. package/dist/database/migrations/202610250001_ag_comment_runner_consent.js.map +1 -0
  324. package/dist/database/migrations/202610260001_ag_drop_directory_index.d.ts +4 -0
  325. package/dist/database/migrations/202610260001_ag_drop_directory_index.d.ts.map +1 -0
  326. package/dist/database/migrations/202610260001_ag_drop_directory_index.js +24 -0
  327. package/dist/database/migrations/202610260001_ag_drop_directory_index.js.map +1 -0
  328. package/dist/database/migrations/202610260001_ag_run_revision.d.ts +4 -0
  329. package/dist/database/migrations/202610260001_ag_run_revision.d.ts.map +1 -0
  330. package/dist/database/migrations/202610260001_ag_run_revision.js +19 -0
  331. package/dist/database/migrations/202610260001_ag_run_revision.js.map +1 -0
  332. package/dist/database/migrations/202610270001_ag_online_agent.d.ts +4 -0
  333. package/dist/database/migrations/202610270001_ag_online_agent.d.ts.map +1 -0
  334. package/dist/database/migrations/202610270001_ag_online_agent.js +43 -0
  335. package/dist/database/migrations/202610270001_ag_online_agent.js.map +1 -0
  336. package/dist/database/migrations/202610270002_ag_chat_list_visibility.d.ts +4 -0
  337. package/dist/database/migrations/202610270002_ag_chat_list_visibility.d.ts.map +1 -0
  338. package/dist/database/migrations/202610270002_ag_chat_list_visibility.js +17 -0
  339. package/dist/database/migrations/202610270002_ag_chat_list_visibility.js.map +1 -0
  340. package/dist/package.json +34 -12
  341. package/dist/server/cli/run-credential.js +1 -1
  342. package/dist/server/cli/surface.d.ts.map +1 -1
  343. package/dist/server/cli/surface.js +4 -1
  344. package/dist/server/cli/surface.js.map +1 -1
  345. package/dist/server/composition.d.ts +36 -35
  346. package/dist/server/composition.d.ts.map +1 -1
  347. package/dist/server/composition.js +99 -66
  348. package/dist/server/composition.js.map +1 -1
  349. package/dist/server/core/agents/agent.service.d.ts +51 -43
  350. package/dist/server/core/agents/agent.service.d.ts.map +1 -1
  351. package/dist/server/core/agents/agent.service.js +347 -321
  352. package/dist/server/core/agents/agent.service.js.map +1 -1
  353. package/dist/server/core/agents/agent.store.d.ts +26 -12
  354. package/dist/server/core/agents/agent.store.d.ts.map +1 -1
  355. package/dist/server/core/agents/agent.store.js +74 -66
  356. package/dist/server/core/agents/agent.store.js.map +1 -1
  357. package/dist/server/core/agents/agent.views.d.ts +29 -0
  358. package/dist/server/core/agents/agent.views.d.ts.map +1 -0
  359. package/dist/server/core/agents/agent.views.js +88 -0
  360. package/dist/server/core/agents/agent.views.js.map +1 -0
  361. package/dist/server/core/agents/discovery.d.ts +12 -0
  362. package/dist/server/core/agents/discovery.d.ts.map +1 -0
  363. package/dist/server/core/agents/discovery.js +39 -0
  364. package/dist/server/core/agents/discovery.js.map +1 -0
  365. package/dist/server/core/agents/index.d.ts +3 -2
  366. package/dist/server/core/agents/index.d.ts.map +1 -1
  367. package/dist/server/core/agents/index.js +3 -2
  368. package/dist/server/core/agents/index.js.map +1 -1
  369. package/dist/server/core/brief/brief.js +3 -3
  370. package/dist/server/core/brief/brief.js.map +1 -1
  371. package/dist/server/core/callers/index.d.ts +10 -1
  372. package/dist/server/core/callers/index.d.ts.map +1 -1
  373. package/dist/server/core/callers/index.js +15 -0
  374. package/dist/server/core/callers/index.js.map +1 -1
  375. package/dist/server/core/conversations/attachments.d.ts.map +1 -1
  376. package/dist/server/core/conversations/attachments.js +6 -1
  377. package/dist/server/core/conversations/attachments.js.map +1 -1
  378. package/dist/server/core/conversations/availability.d.ts +6 -11
  379. package/dist/server/core/conversations/availability.d.ts.map +1 -1
  380. package/dist/server/core/conversations/availability.js +11 -15
  381. package/dist/server/core/conversations/availability.js.map +1 -1
  382. package/dist/server/core/conversations/chat-settings.d.ts +2 -2
  383. package/dist/server/core/conversations/chat-settings.d.ts.map +1 -1
  384. package/dist/server/core/conversations/chat-settings.js +17 -22
  385. package/dist/server/core/conversations/chat-settings.js.map +1 -1
  386. package/dist/server/core/conversations/conversation.service.d.ts +13 -8
  387. package/dist/server/core/conversations/conversation.service.d.ts.map +1 -1
  388. package/dist/server/core/conversations/conversation.service.js +397 -383
  389. package/dist/server/core/conversations/conversation.service.js.map +1 -1
  390. package/dist/server/core/conversations/conversation.store.d.ts +3 -0
  391. package/dist/server/core/conversations/conversation.store.d.ts.map +1 -1
  392. package/dist/server/core/conversations/conversation.store.js +2 -1
  393. package/dist/server/core/conversations/conversation.store.js.map +1 -1
  394. package/dist/server/core/conversations/page-context.d.ts +8 -2
  395. package/dist/server/core/conversations/page-context.d.ts.map +1 -1
  396. package/dist/server/core/conversations/page-context.js +61 -2
  397. package/dist/server/core/conversations/page-context.js.map +1 -1
  398. package/dist/server/core/conversations/ports.d.ts +18 -20
  399. package/dist/server/core/conversations/ports.d.ts.map +1 -1
  400. package/dist/server/core/reports/model-usage.d.ts.map +1 -1
  401. package/dist/server/core/reports/model-usage.js +42 -44
  402. package/dist/server/core/reports/model-usage.js.map +1 -1
  403. package/dist/server/core/reports/prices.d.ts.map +1 -1
  404. package/dist/server/core/reports/prices.js +29 -5
  405. package/dist/server/core/reports/prices.js.map +1 -1
  406. package/dist/server/core/reports/report.service.d.ts +4 -2
  407. package/dist/server/core/reports/report.service.d.ts.map +1 -1
  408. package/dist/server/core/reports/report.service.js +148 -66
  409. package/dist/server/core/reports/report.service.js.map +1 -1
  410. package/dist/server/core/runs/access.d.ts +5 -0
  411. package/dist/server/core/runs/access.d.ts.map +1 -0
  412. package/dist/server/core/runs/access.js +10 -0
  413. package/dist/server/core/runs/access.js.map +1 -0
  414. package/dist/server/core/runs/availability.d.ts +18 -6
  415. package/dist/server/core/runs/availability.d.ts.map +1 -1
  416. package/dist/server/core/runs/availability.js +40 -34
  417. package/dist/server/core/runs/availability.js.map +1 -1
  418. package/dist/server/core/runs/claim.d.ts +30 -106
  419. package/dist/server/core/runs/claim.d.ts.map +1 -1
  420. package/dist/server/core/runs/claim.js +630 -323
  421. package/dist/server/core/runs/claim.js.map +1 -1
  422. package/dist/server/core/runs/comment-consent.d.ts +24 -0
  423. package/dist/server/core/runs/comment-consent.d.ts.map +1 -0
  424. package/dist/server/core/runs/comment-consent.js +116 -0
  425. package/dist/server/core/runs/comment-consent.js.map +1 -0
  426. package/dist/server/core/runs/eligibility.d.ts +13 -1
  427. package/dist/server/core/runs/eligibility.d.ts.map +1 -1
  428. package/dist/server/core/runs/eligibility.js +41 -10
  429. package/dist/server/core/runs/eligibility.js.map +1 -1
  430. package/dist/server/core/runs/execution-view.d.ts +8 -0
  431. package/dist/server/core/runs/execution-view.d.ts.map +1 -1
  432. package/dist/server/core/runs/execution-view.js +9 -0
  433. package/dist/server/core/runs/execution-view.js.map +1 -1
  434. package/dist/server/core/runs/execution.d.ts +1 -1
  435. package/dist/server/core/runs/execution.d.ts.map +1 -1
  436. package/dist/server/core/runs/execution.js +8 -2
  437. package/dist/server/core/runs/execution.js.map +1 -1
  438. package/dist/server/core/runs/identity.d.ts +9 -0
  439. package/dist/server/core/runs/identity.d.ts.map +1 -0
  440. package/dist/server/core/runs/identity.js +75 -0
  441. package/dist/server/core/runs/identity.js.map +1 -0
  442. package/dist/server/core/runs/index.d.ts +6 -6
  443. package/dist/server/core/runs/index.d.ts.map +1 -1
  444. package/dist/server/core/runs/index.js +6 -6
  445. package/dist/server/core/runs/index.js.map +1 -1
  446. package/dist/server/core/runs/input-gate.d.ts +1 -1
  447. package/dist/server/core/runs/input-gate.d.ts.map +1 -1
  448. package/dist/server/core/runs/input-gate.js +4 -2
  449. package/dist/server/core/runs/input-gate.js.map +1 -1
  450. package/dist/server/core/runs/lifecycle.d.ts +16 -18
  451. package/dist/server/core/runs/lifecycle.d.ts.map +1 -1
  452. package/dist/server/core/runs/lifecycle.js +150 -62
  453. package/dist/server/core/runs/lifecycle.js.map +1 -1
  454. package/dist/server/core/runs/policy.d.ts +9 -2
  455. package/dist/server/core/runs/policy.d.ts.map +1 -1
  456. package/dist/server/core/runs/policy.js +17 -8
  457. package/dist/server/core/runs/policy.js.map +1 -1
  458. package/dist/server/core/runs/ports.d.ts +41 -31
  459. package/dist/server/core/runs/ports.d.ts.map +1 -1
  460. package/dist/server/core/runs/ports.js +2 -13
  461. package/dist/server/core/runs/ports.js.map +1 -1
  462. package/dist/server/core/runs/preview.d.ts.map +1 -1
  463. package/dist/server/core/runs/preview.js +1 -3
  464. package/dist/server/core/runs/preview.js.map +1 -1
  465. package/dist/server/core/runs/run-data-purge.d.ts +15 -0
  466. package/dist/server/core/runs/run-data-purge.d.ts.map +1 -0
  467. package/dist/server/core/runs/run-data-purge.js +82 -0
  468. package/dist/server/core/runs/run-data-purge.js.map +1 -0
  469. package/dist/server/core/runs/run-requests.d.ts +25 -0
  470. package/dist/server/core/runs/run-requests.d.ts.map +1 -1
  471. package/dist/server/core/runs/run-requests.js +131 -64
  472. package/dist/server/core/runs/run-requests.js.map +1 -1
  473. package/dist/server/core/runs/run.service.d.ts +31 -2
  474. package/dist/server/core/runs/run.service.d.ts.map +1 -1
  475. package/dist/server/core/runs/run.service.js +638 -74
  476. package/dist/server/core/runs/run.service.js.map +1 -1
  477. package/dist/server/core/runs/run.store.d.ts +11 -0
  478. package/dist/server/core/runs/run.store.d.ts.map +1 -1
  479. package/dist/server/core/runs/run.store.js +39 -11
  480. package/dist/server/core/runs/run.store.js.map +1 -1
  481. package/dist/server/core/runs/runner-view.d.ts +12 -2
  482. package/dist/server/core/runs/runner-view.d.ts.map +1 -1
  483. package/dist/server/core/runs/runner-view.js +55 -13
  484. package/dist/server/core/runs/runner-view.js.map +1 -1
  485. package/dist/server/core/runs/selection.d.ts +13 -0
  486. package/dist/server/core/runs/selection.d.ts.map +1 -0
  487. package/dist/server/core/runs/selection.js +21 -0
  488. package/dist/server/core/runs/selection.js.map +1 -0
  489. package/dist/server/core/runs/sweeper.d.ts +1 -0
  490. package/dist/server/core/runs/sweeper.d.ts.map +1 -1
  491. package/dist/server/core/runs/sweeper.js +66 -17
  492. package/dist/server/core/runs/sweeper.js.map +1 -1
  493. package/dist/server/core/runs/transitions.d.ts +6 -2
  494. package/dist/server/core/runs/transitions.d.ts.map +1 -1
  495. package/dist/server/core/runs/transitions.js +73 -19
  496. package/dist/server/core/runs/transitions.js.map +1 -1
  497. package/dist/server/core/runs/workload.d.ts +17 -5
  498. package/dist/server/core/runs/workload.d.ts.map +1 -1
  499. package/dist/server/core/runs/workload.js +203 -68
  500. package/dist/server/core/runs/workload.js.map +1 -1
  501. package/dist/server/core/skills/skill.service.d.ts +6 -2
  502. package/dist/server/core/skills/skill.service.d.ts.map +1 -1
  503. package/dist/server/core/skills/skill.service.js +87 -66
  504. package/dist/server/core/skills/skill.service.js.map +1 -1
  505. package/dist/server/core/skills/skill.store.d.ts +14 -0
  506. package/dist/server/core/skills/skill.store.d.ts.map +1 -1
  507. package/dist/server/core/skills/skill.store.js +30 -0
  508. package/dist/server/core/skills/skill.store.js.map +1 -1
  509. package/dist/server/core/transaction-read.d.ts +4 -0
  510. package/dist/server/core/transaction-read.d.ts.map +1 -0
  511. package/dist/server/core/transaction-read.js +30 -0
  512. package/dist/server/core/transaction-read.js.map +1 -0
  513. package/dist/server/core/variables/index.d.ts +1 -1
  514. package/dist/server/core/variables/index.d.ts.map +1 -1
  515. package/dist/server/core/variables/index.js.map +1 -1
  516. package/dist/server/core/variables/variable.service.d.ts +18 -0
  517. package/dist/server/core/variables/variable.service.d.ts.map +1 -1
  518. package/dist/server/core/variables/variable.service.js +95 -20
  519. package/dist/server/core/variables/variable.service.js.map +1 -1
  520. package/dist/server/index.d.ts +4 -0
  521. package/dist/server/index.d.ts.map +1 -1
  522. package/dist/server/index.js +3 -0
  523. package/dist/server/index.js.map +1 -1
  524. package/dist/server/jobs/job.service.d.ts +1 -1
  525. package/dist/server/jobs/job.service.d.ts.map +1 -1
  526. package/dist/server/jobs/job.service.js +8 -2
  527. package/dist/server/jobs/job.service.js.map +1 -1
  528. package/dist/server/kernel/events.d.ts +7 -3
  529. package/dist/server/kernel/events.d.ts.map +1 -1
  530. package/dist/server/kernel/events.js.map +1 -1
  531. package/dist/server/kernel/scopes.d.ts +6 -0
  532. package/dist/server/kernel/scopes.d.ts.map +1 -1
  533. package/dist/server/kernel/scopes.js +3 -1
  534. package/dist/server/kernel/scopes.js.map +1 -1
  535. package/dist/server/locales/de-DE.d.ts +5 -0
  536. package/dist/server/locales/de-DE.d.ts.map +1 -0
  537. package/dist/server/locales/de-DE.js +54 -0
  538. package/dist/server/locales/de-DE.js.map +1 -0
  539. package/dist/server/locales/es-ES.d.ts +5 -0
  540. package/dist/server/locales/es-ES.d.ts.map +1 -0
  541. package/dist/server/locales/es-ES.js +54 -0
  542. package/dist/server/locales/es-ES.js.map +1 -0
  543. package/dist/server/locales/fr-FR.d.ts +5 -0
  544. package/dist/server/locales/fr-FR.d.ts.map +1 -0
  545. package/dist/server/locales/fr-FR.js +54 -0
  546. package/dist/server/locales/fr-FR.js.map +1 -0
  547. package/dist/server/locales/id-ID.d.ts +5 -0
  548. package/dist/server/locales/id-ID.d.ts.map +1 -0
  549. package/dist/server/locales/id-ID.js +54 -0
  550. package/dist/server/locales/id-ID.js.map +1 -0
  551. package/dist/server/locales/index.d.ts.map +1 -1
  552. package/dist/server/locales/index.js +8 -0
  553. package/dist/server/locales/index.js.map +1 -1
  554. package/dist/server/locales/ja-JP.d.ts +5 -0
  555. package/dist/server/locales/ja-JP.d.ts.map +1 -0
  556. package/dist/server/locales/ja-JP.js +54 -0
  557. package/dist/server/locales/ja-JP.js.map +1 -0
  558. package/dist/server/locales/pt-BR.d.ts +5 -0
  559. package/dist/server/locales/pt-BR.d.ts.map +1 -0
  560. package/dist/server/locales/pt-BR.js +54 -0
  561. package/dist/server/locales/pt-BR.js.map +1 -0
  562. package/dist/server/locales/vi-VN.d.ts +5 -0
  563. package/dist/server/locales/vi-VN.d.ts.map +1 -0
  564. package/dist/server/locales/vi-VN.js +54 -0
  565. package/dist/server/locales/vi-VN.js.map +1 -0
  566. package/dist/server/locales/zh-TW.d.ts +5 -0
  567. package/dist/server/locales/zh-TW.d.ts.map +1 -0
  568. package/dist/server/locales/zh-TW.js +54 -0
  569. package/dist/server/locales/zh-TW.js.map +1 -0
  570. package/dist/server/online/agent/configuration.d.ts +26 -0
  571. package/dist/server/online/agent/configuration.d.ts.map +1 -0
  572. package/dist/server/online/agent/configuration.js +261 -0
  573. package/dist/server/online/agent/configuration.js.map +1 -0
  574. package/dist/server/online/agent/contracts.d.ts +87 -0
  575. package/dist/server/online/agent/contracts.d.ts.map +1 -0
  576. package/dist/server/online/agent/contracts.js +2 -0
  577. package/dist/server/online/agent/contracts.js.map +1 -0
  578. package/dist/server/online/agent/errors.d.ts +11 -0
  579. package/dist/server/online/agent/errors.d.ts.map +1 -0
  580. package/dist/server/online/agent/errors.js +21 -0
  581. package/dist/server/online/agent/errors.js.map +1 -0
  582. package/dist/server/online/agent/index.d.ts +11 -0
  583. package/dist/server/online/agent/index.d.ts.map +1 -0
  584. package/dist/server/online/agent/index.js +9 -0
  585. package/dist/server/online/agent/index.js.map +1 -0
  586. package/dist/server/online/agent/messages/json.d.ts +5 -0
  587. package/dist/server/online/agent/messages/json.d.ts.map +1 -0
  588. package/dist/server/online/agent/messages/json.js +88 -0
  589. package/dist/server/online/agent/messages/json.js.map +1 -0
  590. package/dist/server/online/agent/messages/projection.d.ts +20 -0
  591. package/dist/server/online/agent/messages/projection.d.ts.map +1 -0
  592. package/dist/server/online/agent/messages/projection.js +495 -0
  593. package/dist/server/online/agent/messages/projection.js.map +1 -0
  594. package/dist/server/online/agent/messages/validation.d.ts +7 -0
  595. package/dist/server/online/agent/messages/validation.d.ts.map +1 -0
  596. package/dist/server/online/agent/messages/validation.js +159 -0
  597. package/dist/server/online/agent/messages/validation.js.map +1 -0
  598. package/dist/server/online/agent/native/backend.d.ts +60 -0
  599. package/dist/server/online/agent/native/backend.d.ts.map +1 -0
  600. package/dist/server/online/agent/native/backend.js +411 -0
  601. package/dist/server/online/agent/native/backend.js.map +1 -0
  602. package/dist/server/online/agent/native/execution.d.ts +41 -0
  603. package/dist/server/online/agent/native/execution.d.ts.map +1 -0
  604. package/dist/server/online/agent/native/execution.js +430 -0
  605. package/dist/server/online/agent/native/execution.js.map +1 -0
  606. package/dist/server/online/agent/native/session.d.ts +40 -0
  607. package/dist/server/online/agent/native/session.d.ts.map +1 -0
  608. package/dist/server/online/agent/native/session.js +104 -0
  609. package/dist/server/online/agent/native/session.js.map +1 -0
  610. package/dist/server/online/agent/native/types.d.ts +32 -0
  611. package/dist/server/online/agent/native/types.d.ts.map +1 -0
  612. package/dist/server/online/agent/native/types.js +2 -0
  613. package/dist/server/online/agent/native/types.js.map +1 -0
  614. package/dist/server/online/agent/persistence/manager.d.ts +16 -0
  615. package/dist/server/online/agent/persistence/manager.d.ts.map +1 -0
  616. package/dist/server/online/agent/persistence/manager.js +209 -0
  617. package/dist/server/online/agent/persistence/manager.js.map +1 -0
  618. package/dist/server/online/agent/persistence/state.d.ts +11 -0
  619. package/dist/server/online/agent/persistence/state.d.ts.map +1 -0
  620. package/dist/server/online/agent/persistence/state.js +45 -0
  621. package/dist/server/online/agent/persistence/state.js.map +1 -0
  622. package/dist/server/online/agent/persistence/store.d.ts +58 -0
  623. package/dist/server/online/agent/persistence/store.d.ts.map +1 -0
  624. package/dist/server/online/agent/persistence/store.js +634 -0
  625. package/dist/server/online/agent/persistence/store.js.map +1 -0
  626. package/dist/server/online/agent/persistence/types.d.ts +44 -0
  627. package/dist/server/online/agent/persistence/types.d.ts.map +1 -0
  628. package/dist/server/online/agent/persistence/types.js +2 -0
  629. package/dist/server/online/agent/persistence/types.js.map +1 -0
  630. package/dist/server/online/agent/runner/backend.d.ts +57 -0
  631. package/dist/server/online/agent/runner/backend.d.ts.map +1 -0
  632. package/dist/server/online/agent/runner/backend.js +501 -0
  633. package/dist/server/online/agent/runner/backend.js.map +1 -0
  634. package/dist/server/online/agent/runner/projection.d.ts +10 -0
  635. package/dist/server/online/agent/runner/projection.d.ts.map +1 -0
  636. package/dist/server/online/agent/runner/projection.js +171 -0
  637. package/dist/server/online/agent/runner/projection.js.map +1 -0
  638. package/dist/server/online/agent/runner/types.d.ts +44 -0
  639. package/dist/server/online/agent/runner/types.d.ts.map +1 -0
  640. package/dist/server/online/agent/runner/types.js +2 -0
  641. package/dist/server/online/agent/runner/types.js.map +1 -0
  642. package/dist/server/online/agent/service.d.ts +47 -0
  643. package/dist/server/online/agent/service.d.ts.map +1 -0
  644. package/dist/server/online/agent/service.js +111 -0
  645. package/dist/server/online/agent/service.js.map +1 -0
  646. package/dist/server/online/agent/transport/streams.d.ts +54 -0
  647. package/dist/server/online/agent/transport/streams.d.ts.map +1 -0
  648. package/dist/server/online/agent/transport/streams.js +440 -0
  649. package/dist/server/online/agent/transport/streams.js.map +1 -0
  650. package/dist/server/online/agent/types.d.ts +155 -0
  651. package/dist/server/online/agent/types.d.ts.map +1 -0
  652. package/dist/server/online/agent/types.js +2 -0
  653. package/dist/server/online/agent/types.js.map +1 -0
  654. package/dist/server/online/index.d.ts +0 -5
  655. package/dist/server/online/index.d.ts.map +1 -1
  656. package/dist/server/online/index.js +0 -5
  657. package/dist/server/online/index.js.map +1 -1
  658. package/dist/server/online/providers.d.ts.map +1 -1
  659. package/dist/server/online/providers.js +26 -2
  660. package/dist/server/online/providers.js.map +1 -1
  661. package/dist/server/online/routes.d.ts.map +1 -1
  662. package/dist/server/online/routes.js +6 -35
  663. package/dist/server/online/routes.js.map +1 -1
  664. package/dist/server/online/services.d.ts.map +1 -1
  665. package/dist/server/online/services.js +101 -24
  666. package/dist/server/online/services.js.map +1 -1
  667. package/dist/server/providers/agents.d.ts +18 -25
  668. package/dist/server/providers/agents.d.ts.map +1 -1
  669. package/dist/server/providers/agents.js +72 -101
  670. package/dist/server/providers/agents.js.map +1 -1
  671. package/dist/server/providers/authorization.d.ts +1 -1
  672. package/dist/server/providers/authorization.d.ts.map +1 -1
  673. package/dist/server/providers/authorization.js +3 -2
  674. package/dist/server/providers/authorization.js.map +1 -1
  675. package/dist/server/providers/runners.d.ts +3 -1
  676. package/dist/server/providers/runners.d.ts.map +1 -1
  677. package/dist/server/providers/runners.js +38 -9
  678. package/dist/server/providers/runners.js.map +1 -1
  679. package/dist/server/routes/admin.d.ts +4 -0
  680. package/dist/server/routes/admin.d.ts.map +1 -1
  681. package/dist/server/routes/admin.js +131 -209
  682. package/dist/server/routes/admin.js.map +1 -1
  683. package/dist/server/routes/chat.d.ts.map +1 -1
  684. package/dist/server/routes/chat.js +313 -164
  685. package/dist/server/routes/chat.js.map +1 -1
  686. package/dist/server/routes/index.d.ts.map +1 -1
  687. package/dist/server/routes/index.js +8 -0
  688. package/dist/server/routes/index.js.map +1 -1
  689. package/dist/server/routes/roster.d.ts.map +1 -1
  690. package/dist/server/routes/roster.js +6 -22
  691. package/dist/server/routes/roster.js.map +1 -1
  692. package/dist/server/routes/run-requests.js +3 -3
  693. package/dist/server/routes/run-requests.js.map +1 -1
  694. package/dist/server/routes/runners/admin.d.ts.map +1 -1
  695. package/dist/server/routes/runners/admin.js +219 -25
  696. package/dist/server/routes/runners/admin.js.map +1 -1
  697. package/dist/server/routes/runners/install.d.ts.map +1 -1
  698. package/dist/server/routes/runners/install.js +7 -2
  699. package/dist/server/routes/runners/install.js.map +1 -1
  700. package/dist/server/routes/runners/runner.d.ts.map +1 -1
  701. package/dist/server/routes/runners/runner.js +2 -0
  702. package/dist/server/routes/runners/runner.js.map +1 -1
  703. package/dist/server/routes/schemas.d.ts +18 -10
  704. package/dist/server/routes/schemas.d.ts.map +1 -1
  705. package/dist/server/routes/schemas.js +497 -153
  706. package/dist/server/routes/schemas.js.map +1 -1
  707. package/dist/server/runners/runner.service.d.ts +47 -4
  708. package/dist/server/runners/runner.service.d.ts.map +1 -1
  709. package/dist/server/runners/runner.service.js +423 -79
  710. package/dist/server/runners/runner.service.js.map +1 -1
  711. package/dist/server/runners/runner.store.d.ts +8 -3
  712. package/dist/server/runners/runner.store.d.ts.map +1 -1
  713. package/dist/server/runners/runner.store.js +63 -6
  714. package/dist/server/runners/runner.store.js.map +1 -1
  715. package/dist/server/runners/slots.d.ts +5 -2
  716. package/dist/server/runners/slots.d.ts.map +1 -1
  717. package/dist/server/runners/slots.js +3 -4
  718. package/dist/server/runners/slots.js.map +1 -1
  719. package/dist/server/runners/workspaces.d.ts.map +1 -1
  720. package/dist/server/runners/workspaces.js +18 -2
  721. package/dist/server/runners/workspaces.js.map +1 -1
  722. package/dist/server/testing.d.ts +0 -2
  723. package/dist/server/testing.d.ts.map +1 -1
  724. package/dist/server/testing.js +1 -4
  725. package/dist/server/testing.js.map +1 -1
  726. package/dist/server/tokens.d.ts +8 -7
  727. package/dist/server/tokens.d.ts.map +1 -1
  728. package/dist/server/tokens.js +4 -2
  729. package/dist/server/tokens.js.map +1 -1
  730. package/dist/shared/access.d.ts +3 -7
  731. package/dist/shared/access.d.ts.map +1 -1
  732. package/dist/shared/access.js +3 -7
  733. package/dist/shared/access.js.map +1 -1
  734. package/dist/shared/agents.d.ts +131 -169
  735. package/dist/shared/agents.d.ts.map +1 -1
  736. package/dist/shared/agents.js +36 -102
  737. package/dist/shared/agents.js.map +1 -1
  738. package/dist/shared/conversations.d.ts +93 -170
  739. package/dist/shared/conversations.d.ts.map +1 -1
  740. package/dist/shared/conversations.js +8 -30
  741. package/dist/shared/conversations.js.map +1 -1
  742. package/dist/shared/locales/access.en-US.js +3 -3
  743. package/dist/shared/locales/access.zh-CN.js +4 -4
  744. package/dist/shared/model-catalog.d.ts +53 -0
  745. package/dist/shared/model-catalog.d.ts.map +1 -0
  746. package/dist/shared/model-catalog.js +182 -0
  747. package/dist/shared/model-catalog.js.map +1 -0
  748. package/dist/shared/online-agent.d.ts +3 -0
  749. package/dist/shared/online-agent.d.ts.map +1 -0
  750. package/dist/shared/online-agent.js +3 -0
  751. package/dist/shared/online-agent.js.map +1 -0
  752. package/dist/shared/page-ui-context.d.ts +26 -0
  753. package/dist/shared/page-ui-context.d.ts.map +1 -0
  754. package/dist/shared/page-ui-context.js +129 -0
  755. package/dist/shared/page-ui-context.js.map +1 -0
  756. package/dist/shared/quota.d.ts +15 -0
  757. package/dist/shared/quota.d.ts.map +1 -0
  758. package/dist/shared/quota.js +2 -0
  759. package/dist/shared/quota.js.map +1 -0
  760. package/dist/shared/runners.d.ts +132 -14
  761. package/dist/shared/runners.d.ts.map +1 -1
  762. package/dist/shared/runners.js +171 -11
  763. package/dist/shared/runners.js.map +1 -1
  764. package/dist/shared/runs.d.ts +57 -1
  765. package/dist/shared/runs.d.ts.map +1 -1
  766. package/dist/shared/runs.js +28 -0
  767. package/dist/shared/runs.js.map +1 -1
  768. package/dist/shared/skills.d.ts +11 -5
  769. package/dist/shared/skills.d.ts.map +1 -1
  770. package/dist/shared/skills.js +7 -2
  771. package/dist/shared/skills.js.map +1 -1
  772. package/dist/shared/ui-message.d.ts +80 -0
  773. package/dist/shared/ui-message.d.ts.map +1 -0
  774. package/dist/shared/ui-message.js +153 -0
  775. package/dist/shared/ui-message.js.map +1 -0
  776. package/dist/shared/variables.js +1 -1
  777. package/dist/shared/variables.js.map +1 -1
  778. package/docs/ai-forms.md +346 -0
  779. package/docs/execution-history.md +19 -0
  780. package/docs/mysql-installation-upgrade.md +7 -0
  781. package/docs/runner-agents.md +27 -0
  782. package/docs/ui-message-clients.md +80 -0
  783. package/docs/ui-messages.md +209 -0
  784. package/docs/workspace-cleanup.md +13 -0
  785. package/package.json +40 -26
  786. package/skills/nocobase-app-plugin-agents/SKILL.md +16 -13
  787. package/skills/nocobase-app-plugin-agents/references/agents.md +30 -0
  788. package/skills/nocobase-app-plugin-agents/references/extension-points.md +21 -21
  789. package/skills/nocobase-app-plugin-agents/references/model-services.md +17 -0
  790. package/skills/nocobase-app-plugin-agents/references/online-agent.md +216 -0
  791. package/skills/nocobase-app-plugin-agents/references/runners.md +12 -0
  792. package/skills/nocobase-app-plugin-agents/references/setup-and-config.md +6 -7
  793. package/skills/nocobase-app-plugin-agents/references/variables-skills-usage.md +6 -4
  794. package/skills/nocobase-app-plugin-agents/references/verification-and-troubleshooting.md +29 -32
  795. package/dist/client/chat/settings-section.d.ts +0 -5
  796. package/dist/client/chat/settings-section.d.ts.map +0 -1
  797. package/dist/client/chat/settings-section.js +0 -86
  798. package/dist/client/chat/settings-section.js.map +0 -1
  799. package/dist/client/components/agent-fields.d.ts +0 -45
  800. package/dist/client/components/agent-fields.d.ts.map +0 -1
  801. package/dist/client/components/agent-fields.js +0 -83
  802. package/dist/client/components/agent-fields.js.map +0 -1
  803. package/dist/client/components/agent-type.d.ts +0 -32
  804. package/dist/client/components/agent-type.d.ts.map +0 -1
  805. package/dist/client/components/agent-type.js +0 -80
  806. package/dist/client/components/agent-type.js.map +0 -1
  807. package/dist/client/components/model-entries.d.ts +0 -44
  808. package/dist/client/components/model-entries.d.ts.map +0 -1
  809. package/dist/client/components/model-entries.js +0 -104
  810. package/dist/client/components/model-entries.js.map +0 -1
  811. package/dist/client/hooks/use-agent-save.d.ts +0 -9
  812. package/dist/client/hooks/use-agent-save.d.ts.map +0 -1
  813. package/dist/client/hooks/use-agent-save.js +0 -40
  814. package/dist/client/hooks/use-agent-save.js.map +0 -1
  815. package/dist/client/hooks/use-model-catalog.d.ts +0 -9
  816. package/dist/client/hooks/use-model-catalog.d.ts.map +0 -1
  817. package/dist/client/hooks/use-model-catalog.js +0 -27
  818. package/dist/client/hooks/use-model-catalog.js.map +0 -1
  819. package/dist/client/lib/model-suggestions.d.ts +0 -28
  820. package/dist/client/lib/model-suggestions.d.ts.map +0 -1
  821. package/dist/client/lib/model-suggestions.js +0 -44
  822. package/dist/client/lib/model-suggestions.js.map +0 -1
  823. package/dist/client/lib/tool-policy.d.ts +0 -3
  824. package/dist/client/lib/tool-policy.d.ts.map +0 -1
  825. package/dist/client/lib/tool-policy.js +0 -5
  826. package/dist/client/lib/tool-policy.js.map +0 -1
  827. package/dist/client/online/default-model.d.ts +0 -5
  828. package/dist/client/online/default-model.d.ts.map +0 -1
  829. package/dist/client/online/default-model.js +0 -65
  830. package/dist/client/online/default-model.js.map +0 -1
  831. package/dist/client/pages/agents/agent-model.d.ts +0 -69
  832. package/dist/client/pages/agents/agent-model.d.ts.map +0 -1
  833. package/dist/client/pages/agents/agent-model.js +0 -153
  834. package/dist/client/pages/agents/agent-model.js.map +0 -1
  835. package/dist/client/pages/agents/detail/brief-preview.d.ts +0 -7
  836. package/dist/client/pages/agents/detail/brief-preview.d.ts.map +0 -1
  837. package/dist/client/pages/agents/detail/brief-preview.js +0 -43
  838. package/dist/client/pages/agents/detail/brief-preview.js.map +0 -1
  839. package/dist/client/pages/agents/detail/history.d.ts +0 -11
  840. package/dist/client/pages/agents/detail/history.d.ts.map +0 -1
  841. package/dist/client/pages/agents/detail/history.js +0 -149
  842. package/dist/client/pages/agents/detail/history.js.map +0 -1
  843. package/dist/client/pages/agents/detail/index.d.ts +0 -3
  844. package/dist/client/pages/agents/detail/index.d.ts.map +0 -1
  845. package/dist/client/pages/agents/detail/index.js +0 -241
  846. package/dist/client/pages/agents/detail/index.js.map +0 -1
  847. package/dist/client/pages/agents/detail/sections.d.ts +0 -21
  848. package/dist/client/pages/agents/detail/sections.d.ts.map +0 -1
  849. package/dist/client/pages/agents/detail/sections.js +0 -280
  850. package/dist/client/pages/agents/detail/sections.js.map +0 -1
  851. package/dist/client/pages/agents/detail/tab-draft.d.ts +0 -43
  852. package/dist/client/pages/agents/detail/tab-draft.d.ts.map +0 -1
  853. package/dist/client/pages/agents/detail/tab-draft.js +0 -115
  854. package/dist/client/pages/agents/detail/tab-draft.js.map +0 -1
  855. package/dist/client/pages/agents/detail/unsaved-bar.d.ts +0 -13
  856. package/dist/client/pages/agents/detail/unsaved-bar.d.ts.map +0 -1
  857. package/dist/client/pages/agents/detail/unsaved-bar.js +0 -21
  858. package/dist/client/pages/agents/detail/unsaved-bar.js.map +0 -1
  859. package/dist/client/pages/agents/new.d.ts +0 -3
  860. package/dist/client/pages/agents/new.d.ts.map +0 -1
  861. package/dist/client/pages/agents/new.js +0 -149
  862. package/dist/client/pages/agents/new.js.map +0 -1
  863. package/dist/client/pages/agents/preset-picker.d.ts +0 -8
  864. package/dist/client/pages/agents/preset-picker.d.ts.map +0 -1
  865. package/dist/client/pages/agents/preset-picker.js +0 -41
  866. package/dist/client/pages/agents/preset-picker.js.map +0 -1
  867. package/dist/server/core/consultations/consultation.service.d.ts +0 -59
  868. package/dist/server/core/consultations/consultation.service.d.ts.map +0 -1
  869. package/dist/server/core/consultations/consultation.service.js +0 -198
  870. package/dist/server/core/consultations/consultation.service.js.map +0 -1
  871. package/dist/server/core/consultations/index.d.ts +0 -3
  872. package/dist/server/core/consultations/index.d.ts.map +0 -1
  873. package/dist/server/core/consultations/index.js +0 -3
  874. package/dist/server/core/consultations/index.js.map +0 -1
  875. package/dist/server/core/consultations/prompt.d.ts +0 -41
  876. package/dist/server/core/consultations/prompt.d.ts.map +0 -1
  877. package/dist/server/core/consultations/prompt.js +0 -64
  878. package/dist/server/core/consultations/prompt.js.map +0 -1
  879. package/dist/server/core/presets/index.d.ts +0 -19
  880. package/dist/server/core/presets/index.d.ts.map +0 -1
  881. package/dist/server/core/presets/index.js +0 -28
  882. package/dist/server/core/presets/index.js.map +0 -1
  883. package/dist/server/online/cli-command.d.ts +0 -20
  884. package/dist/server/online/cli-command.d.ts.map +0 -1
  885. package/dist/server/online/cli-command.js +0 -345
  886. package/dist/server/online/cli-command.js.map +0 -1
  887. package/dist/server/online/consult-tool.d.ts +0 -54
  888. package/dist/server/online/consult-tool.d.ts.map +0 -1
  889. package/dist/server/online/consult-tool.js +0 -177
  890. package/dist/server/online/consult-tool.js.map +0 -1
  891. package/dist/server/online/executor.d.ts +0 -83
  892. package/dist/server/online/executor.d.ts.map +0 -1
  893. package/dist/server/online/executor.js +0 -714
  894. package/dist/server/online/executor.js.map +0 -1
  895. package/dist/server/online/sandbox.d.ts +0 -32
  896. package/dist/server/online/sandbox.d.ts.map +0 -1
  897. package/dist/server/online/sandbox.js +0 -246
  898. package/dist/server/online/sandbox.js.map +0 -1
  899. package/dist/server/online/scripted.d.ts +0 -12
  900. package/dist/server/online/scripted.d.ts.map +0 -1
  901. package/dist/server/online/scripted.js +0 -176
  902. package/dist/server/online/scripted.js.map +0 -1
  903. package/dist/server/online/tools.d.ts +0 -17
  904. package/dist/server/online/tools.d.ts.map +0 -1
  905. package/dist/server/online/tools.js +0 -31
  906. package/dist/server/online/tools.js.map +0 -1
  907. package/dist/server/vendor/THIRD_PARTY_LICENSES.txt +0 -782
  908. package/dist/server/vendor/just-bash.d.ts +0 -83
  909. package/dist/server/vendor/just-bash.js +0 -2102
  910. package/dist/shared/presets.d.ts +0 -30
  911. package/dist/shared/presets.d.ts.map +0 -1
  912. package/dist/shared/presets.js +0 -2
  913. package/dist/shared/presets.js.map +0 -1
  914. package/skills/nocobase-app-plugin-agents/references/online-agents.md +0 -31
@@ -0,0 +1,80 @@
1
+ # UI message clients
2
+
3
+ The public client entry is `@nocobase/app-plugin-agents/client/chat`. `ChatProvider` owns one `@ai-sdk/react` Chat per conversation. Sidebar, full-page and home surfaces share that owner. The SDK owns messages, ordered parts, streaming status, response parsing, approval updates and resumption. The application coordinator owns history page metadata, unknown submissions, admission reconciliation, identity disposal and business Stop.
4
+
5
+ Mount a single provider inside the application's router and key its lifetime by authenticated identity. Dispose the old identity before mounting the next, clear the unscoped panel storage and chat query cache, and discard retained application callbacks. Examples implements this in `OnlineAgentProvider`; it preserves drafts across surface changes within the same identity. A request finishing after disposal cannot publish messages, navigate an abandoned editor, update another account's cache or invoke retained Undo.
6
+
7
+ ## Input, admission and recovery
8
+
9
+ The SDK transport uses the host's authenticated `ApiClient.stream`. A POST contains only the current `message: { id, role: "user", parts: [{ type: "text", text }] }`, authorized attachment IDs and optional page context. It never sends the SDK's complete browser history, assistant parts or tool output as input. Uploaded files remain the existing attachment service's responsibility.
10
+
11
+ The response headers acknowledge admission; the coordinator then reads canonical history and conversation detail. Pending controls remain until the stable user ID, or Runner's `metadata.clientId`, is found in saved history. An unknown POST result is reconciled without automatic resend. Explicit creation recovery still warns that a conversation may already have been created.
12
+
13
+ Initial recovery starts only for a known running, non-approval-waiting conversation. GET recovery uses the SDK transport's reconnect entry, including on browser online/realtime reconnection. Manual recovery never POSTs user input. The shared component replays a response's full prefix. After a network error, the coordinator retires the SDK owner that retained delta-resume state and publishes one fresh shared owner using public UIMessage state. Pending tool state is reread from trusted history before replay; a missing stream retains the interrupted display and occupancy. No SDK private fields or custom stream parser are used. A missing/expired stream or a disabled shared recovery facility leaves durable history and execution detail authoritative. An SDK `ready`, EOF, `onFinish` or standard `finish` cannot mark business execution complete. Approval waiting remains occupied.
14
+
15
+ Stop uses the independent business endpoint. It remains stopping until trusted detail confirms idle. Disposing a subscriber only stops its SDK reader. A lost reader may be released after its matching saved assistant message and terminal execution have been read; that reconciliation never stops business execution or repeats input/tools. Save failure keeps occupancy and exposes explicit finalization retry with visible failure feedback.
16
+
17
+ ## History and source segments
18
+
19
+ An aborted SDK text part can retain `state: "streaming"` in saved history. A writing cursor therefore also requires the message to own the current active SDK response. Registry and Examples pass that presentation flag only to the active response at the SDK working array's tail; saved partial replies stay still after Stop, refresh and later turns. This presentation flag does not establish business completion.
20
+
21
+ History APIs return `AppUIMessage[]`. During a live response the SDK working array keeps its active assistant last so subsequent SDK chunks update it in place. Independent notices remain in that same owner; source metadata determines their displayed position. Approval and recovery select the same response target, and the scroll anchor follows the first displayed source segment. Merge by message ID and monotonic `metadata.revision`; preserve an actively streaming SDK assistant against stale history snapshots. A canonical user replaces its optimistic counterpart by ID or client ID. Drain every `nextAfter` page before advancing the forward watermark. Revision events reread exact IDs in batches of at most 100 and never advance that watermark. Failed revision reads retain the requested IDs for later durable polls or repeated announcements until the requested revision is acknowledged.
22
+
23
+ `chatMessageSegments(messages)` creates rendering descriptors referencing the original SDK object. It does not create additional logical messages. Each Runner source record carries its actual sequence, creation time, source record ID and stable part ID in `metadata.sourceRecords`. Render the descriptor's part indexes at its source time; independent notifications retain their own identity between source blocks. A complete logical message remains intact in history pagination. Render `renderMessageExtra` once, on the final segment.
24
+
25
+ The shared presentation omits empty text, SDK step/reasoning bookkeeping, and only the framework's `execution-status` success notice; the original SDK messages and their durable execution outcomes remain unchanged. Thinking is shown at the next response position rather than as an empty assistant bubble. Successful turns add no generic completion banner, while failure, cancellation, approval and uncertain-effect feedback remain available. An application's `renderMessageExtra` still renders once even when the message has no visible standard parts. The Registry transcript scrolls vertically; long code blocks and tables keep their bounded, local scrolling rather than widening the conversation.
26
+
27
+ Native messages generally have one segment. The server places the authorized display snapshot in `metadata.context`, stripping provider-private fields. Input context remains IDs-only and is reauthorized on the server. File parts use their authorized URL and media type; the installed attachment list retains image previews without inventing a size the SDK file part does not contain.
28
+
29
+ ## Extensions
30
+
31
+ `ChatExtensionsContext` accepts UIMessage directly. Existing application business components adapt to these public boundaries:
32
+
33
+ | Extension | Input and behavior |
34
+ | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
35
+ | `useTimelineItems(conversationId, revision)` | Stable-key business items sorted by time among source segments; the hook may query authorized application data. Message insertions, revisions and business occupancy update its revision input. Application business subscriptions may refresh its own queries independently. |
36
+ | `renderMessageExtra(message)` | The complete original UIMessage once per logical message. Extract all text with `appUIMessageText`; reference discovery, code exclusion, deduplication and record permissions remain application responsibilities. |
37
+ | `renderNews(notice, message)` | Independent `data-notice` card. Returning null falls back to `newsText`, then the persisted title. |
38
+ | `newsText(notice, t)` | Localized wording, or null for the persisted title. |
39
+ | `renderDataPart(part, message)` | Ordered public `data-notice` or `data-business` display. Null retains the built-in display, including the ConsultationCard for a genuine consultation payload. |
40
+
41
+ Independent system notifications are persisted through the existing `ConversationService.deliver()` business transaction, then read through business announcements or durable polling. They do not write into a finished model response or wake a new OnlineAgent execution. There is no separate `OnlineAgentService.notify()` entry. These display contracts do not restore a historical Studio plan/delegation producer or the deleted ask_agent chain.
42
+
43
+ `Composer` exposes `toolbar` and `notice` as child component props. The installed view uses them for application actions and notices; they are not generic top-level ChatPanel slots. Preserve application-owned headers, avatars, menus and readiness/error handling when updating installed Registry source.
44
+
45
+ Tool approval buttons use genuine SDK approval parts, binding `messageId`, `executionId` and `approval.id` to the server's pending call. SDK approval updates are followed by a controlled approval POST and canonical reread. They never submit browser tool output. Runner does not gain remote tool approval support. Effect-review hints are advisory after actual tool termination and finalization; pending approvals still enforce their owner, execution, message and tool-call bindings.
46
+
47
+ ## Requests and cost
48
+
49
+ A visible conversation has one shared durable-history poll, regardless of surfaces: every 5 seconds while running, every 30 seconds while idle, and none while the document is hidden or after the last surface unmounts. This provides independent-notification catch-up when instance-local announcements are missed. Running conversation detail retains the existing 5-second React Query polling; shared keys deduplicate in-flight reads, while staggered observers can each refetch. The SDK stream removes the old one-second text-growth polling.
50
+
51
+ A forward history poll makes one GET plus each bounded `nextAfter` continuation. Recovery of an interrupted pending tool can add one ID GET before its GET stream. A revision announcement makes one batched ID GET; duplicate revision announcements from multiple surfaces are coalesced. Successful input admission adds history reconciliation and a detail GET; SDK completion/recovery adds detail, forward history and an ID reread for a revisable assistant. A stalled subscription may require a second completion reconciliation after its SDK reader stops. None of these reads creates SQL writes, locks or transactions. Source creation timestamps and public context are derived in the existing projection/snapshot write; no new storage write is introduced.
52
+
53
+ Measured warm read requests, excluding the host's authentication and authorization queries, are shown below. The native fixture has one completed reply; the Runner fixture has two saved source blocks and an interleaved notification. These counts describe the extra requests a client makes, not new SQL added inside an existing endpoint. Every sample has zero writes, transactions and explicit locks.
54
+
55
+ | Request | Native SELECTs | Runner SELECTs |
56
+ | -------------------------------- | -------------: | -------------: |
57
+ | Full history | 3 | 6 |
58
+ | Forward poll with no new row | 3 | 4 |
59
+ | One logical message reread by ID | 3 | 5 |
60
+ | Saved execution detail | 2 | 6 |
61
+
62
+ Thus an added idle forward poll costs three native or four Runner SELECTs per visible conversation every 30 seconds in these fixtures. Opening a page, reading a changed group or following pagination adds its corresponding read requests. Batched IDs and larger source groups change row counts and execution time; the table is not a production latency estimate. Existing approval, input, Stop and finalization mutations retain their server-side costs; the SDK coordinator does not add another mutation or lock around them.
63
+
64
+ The server's existing native, notification and shared Redis costs remain those in [UI messages](./ui-messages.md#shared-recovery-request-cost). Runner claims, heartbeats, execution scheduling, synchronization, lifecycle and machine writes are unchanged.
65
+
66
+ ## CLI input
67
+
68
+ The public command uses the same current-message body, without legacy `content/clientId` request mapping. Put the entire JSON body in a file:
69
+
70
+ ```json
71
+ {
72
+ "message": {
73
+ "id": "new-client-uuid",
74
+ "role": "user",
75
+ "parts": [{ "type": "text", "text": "Review the checklist" }]
76
+ }
77
+ }
78
+ ```
79
+
80
+ Run `conversation message send <conversation> --file current-user-message.json`, optionally with repeatable `--attach`. Use a new ID for a new input. An unknown outcome requires history/state reconciliation; do not blindly repeat the command. Its response is the standard UI stream, not the former JSON send envelope. The history command's columns read SDK `metadata.seq`, `role`, `parts` and `metadata.createdAt` directly.
@@ -0,0 +1,209 @@
1
+ # OnlineAgent UI message contract
2
+
3
+ The shared public history contract for all OnlineAgent sessions is `AppUIMessage` from `@nocobase/app-plugin-agents/shared/online-agent`. It is an alias of the installed AI SDK `UIMessage<Metadata, Data, Tools>`. The client chat entry and server OnlineAgent entry export the same type. Native and Runner HTTP responses and history use this contract, with optional shared stream recovery. The public client, Registry demo and Examples application consume the same ordered parts through one SDK Chat owner per conversation and identity.
4
+
5
+ ## Dependencies
6
+
7
+ The catalog pins `ai` to `7.0.128` and `@ai-sdk/react` to `4.0.131`. The latter's published manifest depends on exactly `ai@7.0.128`, `@ai-sdk/provider@4.0.22` and `@ai-sdk/provider-utils@5.0.54`, matching the server SDK. The templates, UI Library demo and agent-chat installation recipe use this pair. Keep them aligned when upgrading. A matching major version alone does not establish compatibility.
8
+
9
+ The plugin declares `ai` as an ordinary runtime dependency: its server executes SDK code and its public declarations reference SDK types. It declares the React SDK as a required peer for the application to resolve the client integration. Applications provide the catalog pair directly; the package does not depend on a workspace-only development import. The existing React catalog satisfies the React SDK's published peer range.
10
+
11
+ ## Identity and persistence
12
+
13
+ Allocate the UI message ID before starting a public stream. For native execution it is also the database record ID; no draft insert is required to allocate it. Metadata carries the conversation, creation time, agent, turn and execution association. These IDs are independent of SDK tool call IDs, data-part IDs and the resumable transport's stream ID. A stream ID belongs to transport state, not to the identity of a saved message.
14
+
15
+ `seq` is absent until the first save. `revision` starts at zero before saving and increases when a persisted message changes, including an approval continuation. History reconciliation must compare revisions by message ID, and cannot rely on an append-only sequence cursor. Persistence emits message revisions for by-ID refresh, and client reconciliation prevents an older history response from replacing newer SDK state. Neither message identity nor stream registration requires a draft assistant row.
16
+
17
+ Runner aggregation must retain every distinct source record in `metadata.sourceRecords`, with its database ID, sequence, stable stream part ID and index in the ordered parts (SDK text parts do not retain their stream IDs after assembly). A logical assistant UI message does not make those records share a database primary key. The adapter must apply the same grouping to streaming, history and pagination. It must only project information actually retained by the existing Runner, and must not invent tool calls or approvals.
18
+
19
+ ## Validation and public parts
20
+
21
+ `validateAppUIMessages()` first rejects values that cannot be saved as lossless JSON, then delegates message and part validation to the installed SDK with the exported metadata and data schemas. It requires metadata, nonempty and unique message IDs, and rejects provider annotations and tool metadata from public parts. Callers must project public output before validation; validation does not redact private tool output or grant access to files, references or business records. SDK objects with explicitly undefined properties must be finalized into JSON data before validation; the validator rejects rather than silently dropping values.
22
+
23
+ Tools use standard SDK tool parts, including approval states and real tool call IDs. `AppUITools` constrains public input and output to JSON; each tool's business schema and authorization remain the server's responsibility. Model-only evidence remains private inside the original UIMessage; public history is a projection, not access to that original. A structurally valid approval part is never evidence that a browser is entitled to approve it.
24
+
25
+ `appUIDataSchemas` defines `data-notice` (notification type, fallback title and optional translated parameters) and `data-business` (business kind, stable record ID and public JSON payload). Producers and renderers must use a stable SDK data-part ID to update the same card. Application cards, references and consultation displays may use these public extension points; their presence does not restore a removed production workflow. Independent notifications are persisted and fetched through the business subscription after a model response ends. The Registry and Examples consumers preserve custom rendering and translated fallback behavior.
26
+
27
+ `appUIMessageText()` joins text parts in order for search and message extensions. It does not flatten files, tools or cards into text. Ordered parts remain authoritative. `convertToModelMessages()` ignores these data parts by default; a server that needs business data in model context must explicitly convert authorized data. See the SDK's [metadata guide](https://ai-sdk.dev/docs/ai-sdk-ui/message-metadata) and [message persistence guide](https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-message-persistence).
28
+
29
+ ## Open page UI snapshots
30
+
31
+ `PageContext` and the public `ResolvedPageContext` optionally carry `ui: { version: 1, items: PageUIItem[] }`. A `PageUIItem` requires string `kind` and `id`; every other property is arbitrary `AppUIJson`. Unknown kinds, nested application properties, `false`, `0`, empty strings and `null` are preserved. The envelope is strict; item fields are open. This is a separate channel from `context.items`: business references still go through their existing server resolvers and authorization, whereas UI data never grants access to a record, route, tool or permission. Applications must minimize snapshots and explicitly exclude credentials, password fields and other sensitive values.
32
+
33
+ `PAGE_UI_CONTEXT_LIMITS` centralizes rejection budgets: 10 items, depth 12 (root envelope at depth zero), 64 KiB of UTF-8 JSON, 4,096 JSON values, 64 characters per kind, 200 per id or property key, and 16,384 per string. Duplicate `(kind, id)` pairs are rejected rather than deduplicated. Browser snapshotting, HTTP validation and public metadata use the same validator and detached clone. It rejects cycles, sparse/extended arrays, non-finite numbers, undefined, functions, BigInt, symbols, accessors, hidden properties, non-plain objects and the property names `__proto__`, `prototype` and `constructor` at any depth. There is no silent truncation or JSON serialization coercion.
34
+
35
+ Registering a source is not selecting it. `useChatUIContextSource({ kind, id, label, getSnapshot })` makes a source available under the existing authenticated `ChatProvider`; `getSnapshot` may return a value or Promise and must be side-effect free. `useChatSources().selectUI({ kind, id }, true)` is a separate explicit action. `uiSources` lists the registered descriptors and `selectedUIKeys` identifies the selected ones using `uiItemKey()`. Registration validates identity without reading form values; JSON payload validation happens at the snapshot boundary. A source unmount removes its selection, old cleanup cannot remove a replacement, and a route change clears UI selections. Source/form registration alone never uploads all forms.
36
+
37
+ ```tsx
38
+ const source = {
39
+ kind: 'application-widget',
40
+ id: 'planning-draft',
41
+ label: 'Planning draft',
42
+ getSnapshot: async () => ({
43
+ kind: 'application-widget',
44
+ id: 'planning-draft',
45
+ capabilities: ['summarize'],
46
+ data: { approved: false, estimate: 0, note: '', optional: null },
47
+ }),
48
+ };
49
+ useChatUIContextSource(source);
50
+ const sources = useChatSources();
51
+ // Call from an explicit user action, not from source registration:
52
+ sources.selectUI(source);
53
+ // The existing composer's asynchronous context builder, immediately before submission:
54
+ const ui = await sources.snapshotUI();
55
+ const context = buildPageContext({
56
+ route: location.pathname + location.search,
57
+ pinned: panel.pinned,
58
+ sources: sources.items,
59
+ uiSources: sources.uiSources.filter((item) =>
60
+ sources.selectedUIKeys.has(uiItemKey(item)),
61
+ ),
62
+ ui,
63
+ filter: sources.filter,
64
+ selection: sources.selection,
65
+ removed: sources.removed,
66
+ });
67
+ ```
68
+
69
+ `buildPageContext` remains synchronous for legacy callers: its `ui` input is an already-read envelope and is cloned again. Its optional `uiSources` input contributes UI chips only; it does not read callbacks. Await `snapshotUI()` once at send time, not when rendering chips. Snapshot reads use current callbacks, validate returned identities, reject selection changes or source replacement/unmount while awaiting, and clone accepted data. A read error prevents submission and must be shown by the composer. This source API is independent of `useAIForm` and its registry; a form is one application convention for an open UI item, not a core schema requirement.
70
+
71
+ Native model conversion places saved UI snapshots into their originating user message as explicitly untrusted data, never system instructions. Runner uses the existing user-message page-context rendering with the same warning. Admission, native originals, public metadata projection, Runner projection and saved-history recovery retain accepted custom fields. Public assistant metadata `sourceUserMessageId` identifies the exact originating user message for Native responses and survives approval revisions and restoration; a renderer must resolve that ID in trusted conversation history. It must disable local application when that source message or association is absent, rather than guessing from the nearest user message. An association is not authorization: applications still validate their allowed target, active instance, field capability and revision before applying any draft changes. History and reconnect never execute a browser setter.
72
+
73
+ ## Consumers and background execution
74
+
75
+ The plugin client controller coordinates the SDK owner, trusted history reconciliation, submissions and public extensions. Registry agent-chat, its typed website demo, Examples component copies and the generated CLI send request mapper consume this contract. See [UI message clients](./ui-message-clients.md) for rendering, identity isolation, polling costs and application integration. Private Studio consumers require their own source merge and verification; updating a published plugin does not replace installed Registry source.
76
+
77
+ The former part/delta/message/saved protocol and process-local replay manager are removed. `OnlineAgent` is the common public session interface: `history(): Promise<AppUIMessage[]>`, session identity, status, cancellation and finalization. `RealtimeOnlineAgent extends OnlineAgent` adds `send`, `receive`, `backend`, `approve` and `messages`, exposing standard SDK chunks. Approval is a required operation: Runner explicitly rejects it rather than omitting the method. `BackgroundOnlineAgent extends OnlineAgent` adds `run(messages, schema)`, `get()` and `try()`, without `send` or a browser `receive()` method. `OnlineAgentService.realtime()` and `.background()` return the corresponding interfaces implemented by actual concrete session classes; neither the service nor the Runner backend assembles inline facade objects.
78
+
79
+ ### Backend ownership and orchestration
80
+
81
+ The internal source lives under `server/online/agent/`, alongside the online model gateway and services, and is organized by domain: `native/` contains execution and session implementations, `runner/` contains remote execution and message projection, `persistence/` owns session storage and dependency-light binding/status helpers, `messages/` owns public/model conversion and JSON/input/output validation, and `transport/` owns shared output streams. `contracts.ts` contains interfaces only; `types.ts` and domain-local `types.ts` files contain data definitions only. `configuration.ts`, `errors.ts` and `service.ts` contain their respective runtime implementations. The public package subpath `server/online-agent` maps to this directory's `index.ts`; applications must not depend on internal source paths.
82
+
83
+ `OnlineAgentBackend` defines execution-specific capabilities implemented by `NativeOnlineAgentBackend` and `RunnerOnlineAgentAdapter`: `kind`, realtime/background creation and restoration, `configuration`, `configure` and `shutdown`. No capability method is optional. Sending, history, cancellation, approval, finalization retries and structured-result observation remain on the corresponding session interfaces, not duplicated as backend operations. Shared storage recovery and transport probing are not backend capabilities. The former `OnlineAgentRunnerBackend` contract and `ConfiguredRunnerOnlineAgent` wrapper are removed. Custom injected backends implement this execution contract; normal applications continue to depend directly on the complete `OnlineAgentService`.
84
+
85
+ The service validates trusted entry context, owns the shared `OnlineAgentConfigurator` and UIStreams, resolves new-session defaults and initial configuration exactly once, selects the backend and delegates execution operations. For existing sessions, the session manager first checks ownership, then classifies persisted `mode` and versioned binding metadata as Native realtime/background or Runner realtime. Missing, malformed, conflicting or mode-mismatched bindings are rejected, and an unavailable required backend is an explicit error; configuration reads never probe for backend identity or fall back to Native. Native model fallback and model validation occur only after Native selection. Native owns active executions, serialization gates, admission, approvals, cancellation, result observers, outcome conversion and persistence/finalization retries. Its internal executor and concrete realtime/background sessions share that backend's state; no callbacks manipulate execution state on the service. Background selection also uses the execution contract rather than a hard-coded Native call.
86
+
87
+ Runner currently implements realtime creation/restoration, configuration, safe history and paging, live/shared output, cancellation requests and saved-Run finalization. Structured background execution, SDK tool approval and native model/tool/thinking configuration are explicitly unsupported. Rejections use the existing `ProtocolError` code `INVALID_REQUEST` with `details.reason = 'UNSUPPORTED_CAPABILITY'`, `backend` and `capability`; the HTTP error has reason `INVALID_REQUEST` and carries those details in `metadata`. Unsupported execution is refused before conversation creation, input admission, attachment binding or queue writes, with no Native fallback. Restricted Runner credentials remain a permission rejection. Startup does not dispatch or cancel remote Runner work; the existing Runner lifecycle owns durable recovery, and restoration repairs projection markers only after confirmed termination.
88
+
89
+ One `RunnerRealtimeOnlineAgent` contains trusted context, deferred configuration and its last successfully accepted response. Opening an existing session does not reevaluate Providers. A later send resolves pending overrides against the latest persisted configuration, keeps Agent identity fixed and submits the resolved configuration separately from the expected configuration used by the final admission transaction. The session retains its HTTP parsing boundary. Only successful durable admission consumes pending options and changes response ownership; failed and competing submissions cannot replace an earlier accepted response. The same acceptance-only response binding applies to Native realtime sessions.
90
+
91
+ The internal Runner admission method `ConversationService.sendRealtime()` returns only the committed `{ seq, run }` receipt, without reading or projecting conversation detail after commit. Normal `send()` and HTTP response contracts are unchanged. A detail-projection or stream-bind failure after acceptance must never cause an automatic second business submission.
92
+
93
+ Both backends use the same configurator and UIStreams instances assembled by the plugin. Backend shutdown settles or detaches only its own work; the service closes the shared transport after both backends finish. Runner tracks the whole in-flight admission, including asynchronous configuration, stream registration, database acceptance and stream binding, before shutdown detaches producers. Already accepted remote Runs are neither cancelled nor redispatched by shutdown.
94
+
95
+ Startup correction belongs to the session manager and is invoked directly by the service only during serving-host startup, not through backend lifecycle wrappers. The service also combines Native local execution occupancy with one shared UIStreams producer probe for Native status projection; local background execution and failed finalization remain occupied even without a browser channel. There is no public `OnlineAgentService.isActive()` or `notify()` API and no generic cross-backend occupancy aggregation.
96
+
97
+ Both native modes store a complete UIMessage in `content.original`, sharing raw JSON tool inputs/results and the same public/model conversion boundaries. Background `history()` returns the same public projection as realtime history, not privileged `ModelMessage[]` or tagged model evidence. Model messages are derived internally when read for execution. The JSON-safe structured result and its execution outcome remain separate from UI history; `get`/`try`, status, cancellation and finalization retain their existing semantics. This unification adds no background browser receive transport or Redis dependency.
98
+
99
+ Background SDK callers may supply user-message file/image inputs directly. These trusted inputs are normalized to JSON-persistable SDK file parts before occupancy is reserved; URL objects, URL strings, data URLs and binary payloads preserve their input semantics. Their private file indices and message-level provider options remain inside the original, are restored for model replay, and never grant public file access. Uploaded attachment references continue to use current ownership checks. Historical tagged background ModelMessage records are not accepted by the new reader; this change adds no migration or legacy fallback.
100
+
101
+ ## Native persistence and transport
102
+
103
+ Native realtime input is `POST /api/agents/conversations/:id/messages` with `{ message: { id, role: "user", parts: [{ type: "text", text }] }, attachmentIds?, context?, selectedModel? }`. Only the current user input is accepted. Metadata, browser history, system messages, assistant parts, tool results and configuration are rejected. Uploaded files are bound atomically using existing ownership checks; file-only input uses empty text parts and nonempty attachment IDs. The server assigns the execution ID and assistant message ID before streaming, without inserting a draft assistant record. Input admission is acknowledged by the standard AI SDK response (HTTP 200); transport failure never authorizes automatic input resubmission.
104
+
105
+ `createUIMessageStreamResponse` supplies SDK headers, SSE encoding and the ending marker. `DefaultChatTransport.prepareSendMessagesRequest` must submit only the current user message, rather than the SDK default full browser history. Without shared recovery, `receive()` exposes one unclaimed live response, with bounded buffering; disconnecting or a slow reader releases only that response. With shared recovery, subsequent reads replay and subscribe through the shared component. Generation and saving continue under the producer's own AbortController. The live-only mode has no replay cache. A missing response (204) does not mean idle or success; read execution and history. An unavailable producer remains interrupted/busy; this implementation never restarts it or claims it stopped.
106
+
107
+ For both native realtime and background execution, the database record ID equals `UIMessage.id`. `content.original` is the single complete internal SDK UIMessage, including raw JSON tool inputs/results, reasoning and provider/approval evidence. There is no second full message in row metadata, no separate background ModelMessage codec, and no message format version or legacy fallback. Row metadata retains only execution controls such as `nativeOutcome`; conversation metadata retains ownership, execution binding and state, with the validated background structured result stored independently of message history. Outer text/search fields and unread visibility are derived from the public projection, not private tools or reasoning.
108
+
109
+ `server/online/agent/messages/projection.ts` owns both pure conversion boundaries shared by native realtime and background sessions. `NativeMessages.public()` derives every native history/page/after/by-ID/SDK response using the current display rules, including background `history()`; its realtime stream adapter shares the same public tool projection and field allowlists before chunks reach the live channel or Redis. Private tools are hidden by default, reasoning/provider annotations and approval internals remain private, and errors are sanitized. Failed or missing projections never return raw data. Changing a projection changes historical display without rewriting the stored original.
110
+
111
+ The SDK already validates and transforms tool inputs before execution or approval. Projection uses that parsed input without applying its schema a second time. Rejected model inputs keep `toolMetadata.nativeInputInvalid` inside the single original SDK part, so historical reads suppress them without invoking typed formatters; tool metadata never enters public messages.
112
+
113
+ For either native mode, `NativeMessages.model()` reads the original UIMessage, applies each current tool's `toModelOutput` to its raw result, or uses the SDK string/JSON default, then calls `convertToModelMessages`. It does not use public history as model input or persist a second model-message representation. Missing tools or failed converters produce an explicit safe error result rather than exposing the raw result. Before conversion the store checks current file permissions and resolves authorized attachment URLs to transient data URLs, reauthorizes page references, and removes unfinished text from failed/cancelled turns while retaining paired completed tool facts. UI-only notices and cards do not enter model context. Both conversion directions work on detached copies, never execute tools and have no business effects. The next turn is allowed after actual tool termination and finalization, with advisory risk feedback.
114
+
115
+ Registered tool outputs must be lossless JSON, enforced by the `OnlineAgentToolDefinition` output type and `strictJson()` at every normal result or asynchronous yield. Convert Dates to ISO strings and binary values to an intentional JSON representation inside the tool. Date, BigInt, binary objects, cycles, non-finite numbers, undefined values and other non-JSON data are rejected without implicit serialization. A validation failure is a tool error, not permission to repeat a possibly completed action; finalization retries only save the frozen message. Model converters may derive SDK model output from the raw JSON but never replace that saved raw result.
116
+
117
+ `finish` is emitted only after the native snapshot transaction commits. It ends an HTTP response, including an approval-wait response; execution detail remains authoritative. A save failure emits a standard error, retains execution occupancy and an in-process immutable finalization snapshot, and permits `POST /:id/finalize` with `{}` to retry persistence only. A commit-unknown retry verifies the same ID, revision and message before clearing occupancy. Process failure loses in-process finalization and does not imply automatic execution recovery. Stop uses `POST /:id/stop` independently of subscription cancellation and waits for accepted tool work and saving.
118
+
119
+ ## Native SDK approvals and revisions
120
+
121
+ Register SDK `needsApproval` on a tool together with explicit `public.input` and `public.output` projections. This makes approval input display intentional; projection is never authorization. Business execution still receives the fresh actor, credentials and authoritative session ID. The single saved original retains the actual tool input and raw business result. Approval tools without public projections are refused rather than exposing internal payloads. Non-approval tools remain private by default.
122
+
123
+ `appUIToolApprovalInputSchema` and `AppUIToolApprovalInput` are exported through the shared, client chat and server OnlineAgent entries. `POST /:id/approval` accepts `{ messageId, executionId, approval: { id, approved, reason? } }`, matching the SDK approval response. The server locks the conversation and matches its owner, execution, message and actual pending approval in the single trusted original message. The last required response atomically changes waiting to running and increments the same message's revision; duplicate, concurrent, mismatched and expired (24-hour deadline) responses conflict. Partial answers update the saved revision without invoking tools or the model; continuation starts once all pending approvals have answers. Execution then resumes from trusted history using the SDK. Denial never invokes the tool; completed tools are not executed again. Stop while waiting persists denial and a cancelled business state. Runner remote approval is explicitly unsupported.
124
+
125
+ A first saved assistant has revision 1. Accepting an approval writes revision 2 and continuation saves revision 3 on the same record and sequence. Each committed change emits `conversation.messageUpdated` with message ID and revision through the existing business subscription. `GET /:id/messages?ids=id1,id2` (at most 100 IDs) rereads current revisions; normal newest/older/after pagination is SQL-bounded. Reconcile by stable ID and revision; an older page must not overwrite an SDK-active message. Never use `after=seq` alone to detect approval updates.
126
+
127
+ ## Database cost
128
+
129
+ The following baseline counts cover native realtime store operations, excluding existing model catalog, authorization/business service queries and the database adapter's schema metadata probes. No work is added to Runner claims, heartbeats or sweepers. There are no per-token writes or polling locks.
130
+
131
+ | Operation | Reads at the store boundary | Writes and locking |
132
+ | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
133
+ | Current input and eventual snapshot | Two trusted history loads (owner + message query each), then 1 admission row read and 2 snapshot row reads | Two transactions and two existing conversation locks; each has one lock update, one message insert/update and one conversation update. No assistant draft or separate finish transaction. |
134
+ | Approval and eventual continuation snapshot | 2 reads under the approval lock, one trusted history load (2 reads), then 2 reads under the snapshot lock | Two transactions and two conversation locks, each updating the lock, same message and conversation. Tool execution occurs outside locks. |
135
+ | Stop while waiting for approval | 2 reads under the lock | One transaction and lock; three updates (lock, message and conversation). |
136
+ | Failed finalization retry | 2 reads under the lock | One transaction/lock per attempt; one message and conversation write on success. A verified commit-unknown retry only updates the lock. No model/tool invocation. |
137
+ | Message page or ID reread | Owner + bounded message query | No writes, transactions or locks. HTTP also performs authorized backend-binding classification and executor/ownership lookups. |
138
+
139
+ Background execution uses the same admission and snapshot transactions and then retains its separate finalization transaction to release occupancy only after the validated structured result is durable. This extra finalization step has one conversation lock and metadata update, and never invokes the model or tools again.
140
+
141
+ Native admission and response attachment also retain the facade's ownership reads. Existing native history is currently validated twice (pre-admission safety check, then trusted history including the committed input). Attachments add the existing batched upload lookup/binding and fresh authorized file reads; historical files are reauthorized on both history passes. Page resolvers keep their own permission checks and query costs. GET execution and stream reception add no writes or locks; absent streams cannot release occupancy. Request counts do not include token, provider or application business traffic.
142
+
143
+ ## Runner projection and independent notifications
144
+
145
+ Native and Runner realtime sessions now return `AppUIMessage[]`, standard SDK chunks and the same POST user-message input. A Runner assistant message has ID `runner:<runId>`. Every saved assistant source block becomes one ordered text part with stable stream ID `record:<recordId>`; files retain their own stable IDs. `metadata.sourceRecords` maps each part index to its real database record ID and sequence. `metadata.clientId` on user messages correlates accepted browser input without claiming that input ID is the database primary key. The first saved assistant block starts the logical SDK message; a Run with no saved assistant output ends its response without creating a phantom assistant message. No Run, machine event, message synchronization or lifecycle implementation changes.
146
+
147
+ One Run remains one logical message. A standalone notification retains its own message and source record. Consumers must derive display segments from `sourceRecords` and interleave independent messages by their source sequence: for example, assistant source 2, notification 3, assistant source 4. Do not render the aggregate as an indivisible item ahead of the notice, duplicate the logical message or synthesize another model turn. SDK state continues to own one assistant message. Registry, demo and Examples use the public segment helper to apply this ordering while keeping one SDK message.
148
+
149
+ Message pages expand complete assistant groups and intervening independent notifications. The page size bounds the seed query, not the size of one logical message; an unusually large Run can therefore yield a large page. Older pages use the smallest returned message anchor as their next `before`. Forward readers drain `meta.nextAfter` before advancing to `meta.lastSeq`; expanding an assistant group may reread an existing ID at a newer revision, while independent records already consumed are excluded. By-ID rereads accept logical Runner IDs. Reconcile by stable ID and revision; never overwrite a newer SDK-active response with an older page.
150
+
151
+ Independent system notifications continue through the existing `ConversationService.deliver()` business transaction. OnlineAgent bindings save the notice without waking Native or Runner execution; rollback also removes the notice. Native notices use a system UIMessage in `content.original`, while existing revision/business events and normal history rereads make them visible even after a model response has closed. Notice data stays outside model input. OnlineAgent exposes no separate API for injecting independent business notifications.
152
+
153
+ ## Optional shared recovery
154
+
155
+ Configure the plugin once in the application's server configuration:
156
+
157
+ ```yaml
158
+ agents:
159
+ uiRecovery:
160
+ namespace: acme:online-ui
161
+ redis:
162
+ host: 127.0.0.1
163
+ port: 6379
164
+ ```
165
+
166
+ Provide a unique application namespace, identical on its instances, and normal `ioredis` connection options for the shared Redis deployment. The plugin owns its publisher and subscriber connections and closes them at shutdown. The host cache API has no public pub/sub connection contract, so this explicit plugin configuration does not inspect host-private state or discover credentials from environment variables. Supply any Redis authentication through the application's normal configuration mechanism; never copy credentials into messages.
167
+
168
+ Without this configuration the application starts normally and offers one live standard response plus durable history, with `x-online-agent-recovery: live`. It does not use the old memory replay manager. With configuration, the header is `shared`; unavailable configured Redis is rejected before admission instead of falling back. The manager initializes the upstream subscription/sentinel, then saves the conversation/stream/execution association in existing conversation metadata before exposing a start chunk. ID-checked cleanup completes before a normal finish chunk. Runner binds the actual accepted Run ID before projection starts; a failure after admission interrupts transport but never redispatches the Run.
169
+
170
+ `GET /api/agents/conversations/:id/events` is the authorized SDK resume endpoint. Set `DefaultChatTransport.prepareReconnectToStreamRequest` to this URL. It returns a full replay and subsequent chunks; use the transport's default replay behavior so interrupted text is rebuilt by message ID. The plugin uses SDK SSE encoding/headers/ending markers and the SDK JSON event parser, with `resumable-stream@2.2.13` managing replay and subscription. It does not implement another SSE framing or replay engine. See the [SDK resume guide](https://ai-sdk.dev/docs/ai-sdk-ui/chatbot-resume-streams) and the [upstream component](https://github.com/vercel/resumable-stream).
171
+
172
+ A response channel supplied by an accepted session is pinned to that submission even after its initial stream has been claimed. Shared recovery may resume only that channel's own stream/execution association; it never silently follows a later conversation execution. Only an unpinned restoration/recovery entry discovers the conversation's current association. An unavailable pinned stream requires reconciliation, not input resubmission or occupancy release.
173
+
174
+ The component retains the active replay buffer on its producer and coordinates cross-instance readers through Redis pub/sub and expiring sentinels. It therefore requires a live producer; Redis is not a durable inference checkpoint. Responses are limited to 8 MiB and 4,096 pending source chunks, with at most 1,024 local producers. The projection-only producer lease expires after 30 seconds and renews every 5 seconds. This lease never claims, renews or cancels a Run. Expired associations, missing sentinels and failed replay acknowledgments produce an explicit reconciliation error. A missing response (204), SDK ready state and SDK finish do not establish business completion; read saved history and execution, including approval waiting and interrupted occupancy.
175
+
176
+ Closing a browser subscription never cancels native generation, accepted tools or Runner work. `POST /:id/stop` remains the separate business action. Native Stop on another instance publishes a signal bound to the owner-authorized conversation, actual execution and current stream; the live producer performs the existing abort/save path. The returned detail can remain running until saving completes. Lost producers refuse unconfirmed native Stop rather than clearing occupancy. Runner Stop continues to use its existing cancellation acknowledgment semantics.
177
+
178
+ A Redis failure after acceptance ends or invalidates the stream while the independent producer continues saving. It never resends user input or reruns a tool. Native save failure retains the existing immutable finalization snapshot and occupancy for explicit retry on its producer instance; other instances explicitly refuse a running finalization without that snapshot. A newer trusted revision of the same native message/execution can acknowledge an earlier commit-unknown save without overwriting the continuation. Shared infrastructure loss requires state reconciliation; connections fail closed and require service restart after an unavailable connection, rather than silently rebuilding execution. Process death does not resume inference or tools. A Runner process can finish through its existing execution protocol and core synchronization; this adapter does not automatically take over another projection producer. Opening a Runner conversation with a closing marker and no local producer checks the saved Run. Only a confirmed terminal Run triggers idempotent automatic finalization; a missing stream or running Run keeps the gate. Automatic or explicit finalization first synchronizes final records and clears only the matching adapter closing/stream markers; it never redispatches work. Private Studio wiring remains outside this public repository. The SDK client and installed public consumers are described in [UI message clients](./ui-message-clients.md).
179
+
180
+ ## Shared recovery request cost
181
+
182
+ Counts exclude existing authorization, model catalog, file/page authorization and database schema metadata probes. All new SQL association mutations use the existing conversation lock, compare stream IDs on cleanup and have no token-level writes. The disabled mode adds no SQL association writes or Redis operations. Runner claims, heartbeats, sweepers, execution protocol and machine writes are unchanged.
183
+
184
+ | Request or work | Added SQL at the UI boundary | Shared Redis work |
185
+ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
186
+ | Native input or approval response, through completion | Two association transactions/locks (register and clear), each with one owned-row read, lock update and metadata update; existing native admission/snapshot transactions remain | Preflight ping, one NX producer registration, component subscription/sentinel setup, one lease deletion; component publication per emitted SSE chunk/subscriber and completion cleanup |
187
+ | Runner input through completion | Three association transactions/locks (register, bind accepted Run, clear), each with the same row/lock/metadata work; existing Runner admission, synchronization and closing transactions remain | The same setup/publication/cleanup as native; no execution lease changes |
188
+ | Authorized cross-instance resume | One association owner read in addition to facade authorization, no SQL writes/locks | Preflight ping, producer-key GET, component sentinel GET, subscription and replay request; component sentinel watchdog GET once per 10 seconds and application producer-key GET every 5 seconds while subscribed |
189
+ | Producer lifetime | No SQL polling writes | One ID-checked lease renewal every 5 seconds; SSE publication follows actual native chunks or saved Runner blocks |
190
+ | Remote native execution detail/list | Existing native row reads, no new SQL locks | A remote running native producer check adds preflight ping and producer-key GET; local and idle executions avoid these |
191
+ | Remote native Stop | One association owner read; no added SQL write at the requesting instance | Preflight ping, producer-key GET and a bound Stop publication; producer performs its existing cancellation/snapshot write |
192
+ | Native independent notification | One transaction/lock, owned-row and message-ID reads, one message insert and conversation update plus lock update; an identical retry only updates the lock | None |
193
+ | Runner history/page | Owner plus bounded seed query; up to one complete-group query and one interval query, no locks/writes | None |
194
+ | Runner open with a closing marker and no local producer | One saved-Run read; only a terminal Run invokes final sync and the existing association/closing cleanup transactions. Repeated cleared opens avoid this work. | ID-checked association cleanup after confirmed synchronization; never a new execution |
195
+ | Runner changed-output poll | Existing synchronization and owner reads plus one assistant-source snapshot query only when lastSeq advances | No per-poll write; published stable part IDs suppress repeated snapshots |
196
+
197
+ The association timing hook reports `ui-stream.association`, including lock acquisition and commit. These are upper bounds from isolated tests, not production throughput measurements. Published verification records contain the actual measured samples and executed checks.
198
+
199
+ ### Multiple approvals in one native step
200
+
201
+ Each controlled approval response advances the same saved message revision. While any tool in that step remains `approval-requested`, the response ends with the saved waiting state; neither a tool nor the model continues. The last response changes the execution to running and resumes the SDK with all trusted decisions. Concurrent responses can receive a busy conflict and must reconcile and retry the still-pending decision; accepted decisions cannot execute twice. Stop while partially answered denies every unexecuted call, including an approved call that was waiting for other decisions, and preserves already completed effects.
202
+
203
+ A partial answer uses one approval transaction and conversation lock (lock, message and conversation updates), without the execution-history conversion or continuation snapshot transaction. Shared recovery still uses its existing registration and release associations. Runner automatic finalization adds one saved-Run read only when a closing marker exists without a local producer. Nonterminal checks do not synchronize, write or lock; a terminal check reuses final synchronization and the existing matching-marker cleanup transactions, once per successful closing marker. No claim, heartbeat, execution retry or scheduler path changes.
204
+
205
+ ## Integrated startup and background contracts
206
+
207
+ The serving host performs native startup correction under the single-instance deployment assumption: the previous execution process has fully exited before its replacement starts. Current-process rows and valid approval waits remain intact. Missing native terminal snapshots become failed standard UI messages; complete saved results remain intact and finish closing. No model or tool is replayed. CLI hosts do not perform startup correction. Shared recovery transports remain optional and unchanged, and their liveness markers never prove execution death. Overlapping startup, execution takeover and new execution leases are outside scope.
208
+
209
+ Background `run` returns after admission. `get` and `try` observe that already accepted execution, with observer completion after saving and releasing occupancy. `try`'s finite budget ends observation only. `history()` independently returns public `AppUIMessage[]`; neither a visible message nor successful UI conversion establishes structured-result validation or terminal execution state. Background records always have showInChatList=false; normal creation defaults true. HTTP configuration rejects policy overrides and validates declared scope variables. Transactional conversation notices join their existing business unit of work; native realtime history stores validated data parts, while background notices are excluded from model input.
@@ -0,0 +1,13 @@
1
+ # Workspace cleanup integration
2
+
3
+ Heartbeats announce `workspaces.decisions: true` alongside the report interval. New runners retain the existing `workspaces` and `remove`/`keep` exchange and additionally report `directories`, including legacy directories without a last run, with a unique `reportId`. Decisions echo the report, directory path, optional last run and last use. A mismatched or duplicate decision is not usable as cleanup authority.
4
+
5
+ Register optional `SubjectWorkspaces.resolveKeys(conn, keys)` to map application directory keys to subject ids. Return an array per key so ambiguity can be represented rather than choosing an arbitrary match; an ambiguous or unknown key is left undecided. A directory whose last run the application knows is resolved by that run; one without a last run, or whose run is gone, is resolved by its key. Which runner worked on the subject is not checked: once a subject's work is over, its directories go on every runner, so legacy directories nobody recorded a run for do not pile up.
6
+
7
+ Keep `settled(conn, ids)` to the subject's own status: deleted or unknown subjects must not settle. The framework additionally excludes any subject with a nonterminal run on any runner. `SubjectWorkspaces.commits` is deprecated and no longer read; decisions always carry `commits: []`, which runners released before this rule still require in the protocol and which makes them keep a directory whose pushes they cannot prove.
8
+
9
+ A directory whose work is over is removed whatever it holds: commits never pushed, tracked changes, submodule commits and untracked files go with it, and the runner logs that it held unpushed work. Only three things keep it: a run holding its lock, a run that used it since it was reported (its last run or last use changed), and a second report, sent before deletion, whose decision no longer says the work is over, such as a reopened subject. A directory whose work goes on, or whose status is unknown, keeps the existing protection: its unpushed work is removed only when a person forces it.
10
+
11
+ The runner reports its local cleanup result against the prior decision before attempting deletion. The server accepts it only while the prior report id, directory, run, last use and settlement still match. `allowed` means permission to attempt cleanup, never proof that a directory was removed, and `discardsUntracked` there means the directory still held work that was never pushed. A missing directory in a later report is likewise not a deletion receipt. The cleanup reasons `trackedChanges`, `unpushed`, `missingEvidence` and `gitFailed`, and the decision reason `ownershipUnknown`, stay in the protocol for runners and applications released earlier.
12
+
13
+ Runtime views expose `canSeeMachine` using the existing machine-information permission. Without an explicit true value, clients hide directory diagnostics. The disk summary remains subject to the existing aggregate visibility. Display the report's `measuredAt` and interval, not heartbeat time; offline or expired readings are previous reports, and unknown disk data never implies healthy space. Low disk warnings already flow through the runner collection logger; deployments should verify those service logs are visible.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@nocobase/app-plugin-agents",
3
3
  "displayName": "Agents",
4
4
  "description": "Agents for NocoBase applications: agents, the model services online agents call, their runs and conversations, and the runners people connect to run them (registration, the long-poll claim, slots, the sweeper, build jobs, and the runner and CLI tarballs the application serves).",
5
- "version": "0.1.0-beta.9",
5
+ "version": "1.0.0-beta.16",
6
6
  "type": "module",
7
7
  "prettier": "@nocobase/dev-config/prettier",
8
8
  "engines": {
@@ -62,13 +62,17 @@
62
62
  "types": "./dist/shared/reports.d.ts",
63
63
  "import": "./dist/shared/reports.js"
64
64
  },
65
+ "./shared/online-agent": {
66
+ "types": "./dist/shared/online-agent.d.ts",
67
+ "import": "./dist/shared/online-agent.js"
68
+ },
65
69
  "./shared/conversations": {
66
70
  "types": "./dist/shared/conversations.d.ts",
67
71
  "import": "./dist/shared/conversations.js"
68
72
  },
69
- "./shared/presets": {
70
- "types": "./dist/shared/presets.d.ts",
71
- "import": "./dist/shared/presets.js"
73
+ "./shared/model-catalog": {
74
+ "types": "./dist/shared/model-catalog.d.ts",
75
+ "import": "./dist/shared/model-catalog.js"
72
76
  },
73
77
  "./shared/models": {
74
78
  "types": "./dist/shared/models.d.ts",
@@ -114,12 +118,17 @@
114
118
  "types": "./dist/cli/index.d.ts",
115
119
  "import": "./dist/cli/index.js"
116
120
  },
117
- "./package.json": "./package.json"
121
+ "./package.json": "./package.json",
122
+ "./server/online-agent": {
123
+ "types": "./dist/server/online/agent/index.d.ts",
124
+ "import": "./dist/server/online/agent/index.js"
125
+ }
118
126
  },
119
127
  "files": [
120
128
  "dist",
121
129
  "README.md",
122
130
  "CHANGELOG.md",
131
+ "docs",
123
132
  "skills"
124
133
  ],
125
134
  "publishConfig": {
@@ -134,20 +143,27 @@
134
143
  "@ai-sdk/moonshotai": "^3.0.62",
135
144
  "@ai-sdk/openai": "^4.0.83",
136
145
  "@ai-sdk/openai-compatible": "^3.0.62",
137
- "ai": "^7.0.127",
146
+ "@ai-sdk/provider-utils": "5.0.54",
147
+ "ai": "7.0.128",
148
+ "ajv": "^8.20.0",
149
+ "ajv-formats": "^3.0.1",
138
150
  "better-sqlite3": "^13.0.3",
139
151
  "hono": "^4.13.2",
152
+ "ioredis": "^5.11.1",
140
153
  "knex": "^3.1.0",
141
154
  "ollama-ai-provider-v2": "^4.0.1",
142
155
  "pg": "^8.23.0",
156
+ "re2js": "^2.8.6",
157
+ "resumable-stream": "2.2.13",
143
158
  "sqlite-vec": "^0.1.9",
144
159
  "yaml": "^2.9.0",
145
160
  "zod": "^4.6.5",
146
- "@nocobase/agent-protocol": "^0.1.0-beta.6",
147
- "@nocobase/app-cli-client": "^0.1.0-beta.5",
161
+ "@nocobase/agent-protocol": "^0.1.0-beta.10",
162
+ "@nocobase/app-cli-client": "^0.1.0-beta.11",
148
163
  "@nocobase/cli-envelope": "^0.1.0-beta.1"
149
164
  },
150
165
  "peerDependencies": {
166
+ "@ai-sdk/react": "4.0.131",
151
167
  "@base-ui/react": "^1.6.0",
152
168
  "@oclif/core": "^4.14.0",
153
169
  "@tanstack/react-query": "^5.81.5",
@@ -160,39 +176,37 @@
160
176
  "react-router": "^7.0.2",
161
177
  "recharts": "^3.8.0",
162
178
  "remark-gfm": "^4.0.1",
163
- "@nocobase/app-cli": "^1.0.0-beta.20",
164
- "@nocobase/app-plugin-authentication": "^2.0.0-beta.7",
165
- "@nocobase/app-client": "^3.0.0-beta.1",
166
- "@nocobase/app-plugin-authorization": "^1.0.0-beta.27",
167
- "@nocobase/app-plugin-file": "^1.0.0-beta.23",
168
- "@nocobase/authorization": "^1.0.0-beta.13",
169
- "@nocobase/app-server": "^2.0.0-beta.4",
170
- "@nocobase/db": "^1.0.0-beta.19",
171
- "@nocobase/i18n": "^1.0.0-beta.7",
172
- "@nocobase/service-provider": "^0.0.2-beta.2",
173
- "@nocobase/markdown-mermaid": "^0.1.0-beta.2"
179
+ "@nocobase/app-cli": "^1.0.0-beta.25",
180
+ "@nocobase/app-client": "^4.0.0-beta.0",
181
+ "@nocobase/app-plugin-authentication": "^2.0.0-beta.12",
182
+ "@nocobase/app-plugin-authorization": "^1.0.0-beta.30",
183
+ "@nocobase/app-plugin-file": "^1.0.0-beta.26",
184
+ "@nocobase/app-server": "^3.0.0-beta.0",
185
+ "@nocobase/authorization": "^1.0.0-beta.15",
186
+ "@nocobase/db": "^1.0.0-beta.21",
187
+ "@nocobase/i18n": "^2.0.0-beta.1",
188
+ "@nocobase/markdown-mermaid": "^0.1.0-beta.2",
189
+ "@nocobase/service-provider": "^0.0.2-beta.2"
174
190
  },
175
191
  "devDependencies": {
176
192
  "@testing-library/react": "^16.3.2",
177
193
  "@testing-library/user-event": "^14.6.3",
178
194
  "@types/node": "^24.0.0",
179
195
  "@types/react": "^19.2.0",
180
- "esbuild": "^0.28.2",
181
196
  "eslint": "^10.0.0",
182
197
  "jsdom": "^30.0.1",
183
- "just-bash": "^3.6.0",
184
198
  "prettier": "^3.9.6",
185
199
  "react-dom": "^19.2.8",
186
200
  "typescript": "^6.0.3",
187
201
  "vitest": "^4.1.10",
188
- "@nocobase/app-testing": "0.1.0-beta.3",
189
- "@nocobase/db-postgres": "0.1.0-beta.4",
190
- "@nocobase/db-sqlite": "0.1.0-beta.5",
191
- "@nocobase/dev-config": "0.1.0-beta.22",
202
+ "@nocobase/app-testing": "0.1.0-beta.5",
203
+ "@nocobase/db-postgres": "0.1.0-beta.5",
204
+ "@nocobase/db-sqlite": "0.1.0-beta.6",
205
+ "@nocobase/dev-config": "0.1.0-beta.24",
192
206
  "@nocobase/jobs": "0.1.0-beta.3"
193
207
  },
194
208
  "scripts": {
195
- "build": "tsc -p tsconfig.json && node ./scripts/bundle-just-bash.mjs && nocobase-db-manifests",
209
+ "build": "tsc -p tsconfig.json && nocobase-db-manifests",
196
210
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.type-tests.json --noEmit",
197
211
  "test": "vitest run --passWithNoTests",
198
212
  "lint": "eslint . --max-warnings 0",
@@ -1,20 +1,20 @@
1
1
  ---
2
2
  name: nocobase-app-plugin-agents
3
- description: Register the Agents plugin in a NocoBase App and configure it (agents.* in config.yml), contribute subjects, scopes, business actions, presets, CLI commands and reports through agentsToken, set up online agents and model services, connect runners (registration tokens, protocol, upgrade_required), build and serve the CLI and runner tarballs (pnpm nocobase cli build, --runner), or work out why a run, a runner or a model fails.
3
+ description: Register the Agents plugin in a NocoBase App and configure it (agents.* in config.yml), contribute subjects, scopes, business actions, agent defaults, the App's own agents, CLI commands and reports through agentsToken, enable the agents discovered from runners, configure OnlineAgentService and OnlineAgentConfigurator for SDK chats and business tools, set up model services for the App's own model calls, connect runners (registration tokens, protocol, upgrade_required), build and serve the CLI and runner tarballs (pnpm nocobase cli build, --runner), or work out why a run, a runner or a model fails.
4
4
  metadata:
5
5
  short-description: Agents, runners, model services and their distribution
6
6
  ---
7
7
 
8
8
  # Agents App Plugin
9
9
 
10
- Use this Skill when an App gives people agents to work with: online agents that answer through a model service on the server, or work agents that drive a coding tool (Claude Code, Codex, OpenCode, Pi) on a runner someone connects. Use it as well to build the App's CLI and the runner as tarballs the App serves, and to diagnose a run, a runner or a model that does not work. Do not use it for the business data agents act on; that stays with `nocobase-app-development` and the plugins that own it.
10
+ Use this Skill when an App gives people agents to work with: agents that drive a coding tool (Claude Code, Codex, OpenCode, Pi) on a runner someone connects, one for each tool and model the runners report. Use it as well to build the App's CLI and the runner as tarballs the App serves, and to diagnose a run, a runner or a model that does not work. Do not use it for the business data agents act on; that stays with `nocobase-app-development` and the plugins that own it.
11
11
 
12
12
  The package README is the full reference: read it at `node_modules/@nocobase/app-plugin-agents/README.md` (in this repository, `packages/plugins/app-plugin-agents/README.md`). The references below say what to do and point to its sections rather than repeating them.
13
13
 
14
14
  ## Key rules
15
15
 
16
- - The plugin knows no business of its own. Subjects, scopes, business actions, presets, CLI commands and report pages are the App's, contributed through `agentsToken` from `@nocobase/app-plugin-agents/server/tokens` when the App's providers boot. With nothing contributed, agents still work in conversations.
17
- - An agent's type (`runner` or `online`) is chosen once and never changes. Online agents need a model service and no runner; runner agents need a runner that is online, has the agent's coding tool installed and signed in, and whose owner's local policy lets it take the work.
16
+ - The plugin knows no business of its own. Subjects, scopes, business actions, the instructions and actions every discovered agent gets, CLI commands and report pages are the App's, contributed through `agentsToken` from `@nocobase/app-plugin-agents/server/tokens` when the App's providers boot. With nothing contributed, agents still work in conversations.
17
+ - Nobody creates agents: each coding tool and model a runner reports becomes one, pending until someone who manages agents writes what it is good at and enables it. Only enabled agents get work, and only on a runner that is online, has the agent's tool signed in with its model, and whose owner's local policy lets it take the work. The `agentsToken.onlineAgent` service selects native SDK execution or an explicitly chosen Runner Agent through one realtime conversation contract. Native execution runs registered business tools directly through the SDK; Runner chat uses the existing queue and canonical history. The original chat API and shared browser controller use this service, and never silently change executors. Read [OnlineAgent chats and business tools](references/online-agent.md) to configure that service and its `OnlineAgentConfigurator`.
18
18
  - Variables and model service keys are sealed with the App's secrets service: configure `secrets.keys` before storing any, or the API answers `SECRETS_KEY_MISSING` (503).
19
19
  - The plugin registers no pages. The App routes the exported pages and mounts the chat; the App also binds `agentsAccessToken`, or every business action level is `none`.
20
20
  - `subjects.register`'s `context.assemble`, brief sections and mounts run inside the claim's transaction: database reads only, never a network or a model call. Read anything else in the optional `prepare(run)`.
@@ -23,12 +23,15 @@ The package README is the full reference: read it at `node_modules/@nocobase/app
23
23
 
24
24
  ## References
25
25
 
26
- | Task | Read |
27
- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
28
- | Register the plugin, its prerequisites and `agents.*` configuration, mount the pages and the chat | [Setup and configuration](references/setup-and-config.md) |
29
- | Contribute subjects, scopes, actions, presets, CLI commands, people, reports, brief sections, mounts | [Extension points](references/extension-points.md) |
30
- | Online agents, model services, the model gateway, consultations, vectors | [Online agents and model services](references/online-agents.md) |
31
- | Register runners, how claims and heartbeats work, local policy, protocol and `upgrade_required` | [Runners](references/runners.md) |
32
- | Build the CLI and runner tarballs, serve them, CI artifacts, install script, download tokens, updates, the npm runner | [Distribution](references/distribution.md) |
33
- | Variables and secrets, the skill library, chat attachments, usage, prices and reports | [Variables, skills, attachments and usage](references/variables-skills-usage.md) |
34
- | Check that everything works, and diagnose failures | [Verification and troubleshooting](references/verification-and-troubleshooting.md) |
26
+ | Task | Read |
27
+ | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
28
+ | Register the plugin, its prerequisites and `agents.*` configuration, mount the pages and the chat | [Setup and configuration](references/setup-and-config.md) |
29
+ | Contribute subjects, scopes, actions, agent defaults, the App's own agents, CLI commands, people, reports, mounts | [Extension points](references/extension-points.md) |
30
+ | Agents discovered from runners, the model catalog, enabling agents, availability, the App's own agents | [Agents](references/agents.md) |
31
+ | Configure OnlineAgentService/OnlineAgentConfigurator, register SDK tools, use realtime/background sessions | [OnlineAgent chats and business tools](references/online-agent.md) |
32
+ | Open JSON UI context, custom SDK tool cards, generic form adapters and safe browser-draft application | [UI context, tool cards and local form drafts](references/online-agent.md#open-ui-context-custom-tool-cards-and-local-form-drafts) |
33
+ | Model services, the model gateway, vectors | [Model services](references/model-services.md) |
34
+ | Register runners, how claims and heartbeats work, local policy, protocol and `upgrade_required` | [Runners](references/runners.md) |
35
+ | Build the CLI and runner tarballs, serve them, CI artifacts, install script, download tokens, updates, the npm runner | [Distribution](references/distribution.md) |
36
+ | Variables and secrets, the skill library, chat attachments, usage, prices and reports | [Variables, skills, attachments and usage](references/variables-skills-usage.md) |
37
+ | Check that everything works, and diagnose failures | [Verification and troubleshooting](references/verification-and-troubleshooting.md) |