@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,30 @@
1
+ # Agents
2
+
3
+ Nobody creates an agent. Each coding tool and model a runner reports signed in becomes one agent, named from the model catalog that ships with the plugin (such as "Claude · Opus 5.5"), and starts pending. `docs/runner-agents.md` in the package and the README's "What it does" (Agents) are the reference.
4
+
5
+ ## Enabling agents
6
+
7
+ - A pending agent gets no work. Someone who manages agents (`agents.agents` manage) enables it on the Agent page ("Fill in and enable") or with `PATCH /api/agents/:agentId` (`agent update`), writing what it is good at — the project manager hands it work by this — and optionally its default reasoning effort. The page starts the description from the catalog's suggestion.
8
+ - Every change names the agent's revision (`expectedRevision`); `REVISION_CONFLICT` means someone changed it since, so read it again. `GOOD_AT_REQUIRED`: enabling needs a description. `EFFORT_UNSUPPORTED`: the tool does not take that effort. `AGENT_MANAGED`: an App's own agent is changed through the App.
9
+ - Disabling an agent withdraws its queued runs and announces `agent.removed` (`reason` `disabled`); the App lets go of the work it gave the agent. Work for an agent that is not enabled is refused with `AGENT_NOT_ENABLED`.
10
+ - Anyone signed in reads the agents (`GET /api/agents`, `agent list-all`); `GET /api/agents/agentNames` names every agent there has been, for runs that name a removed one.
11
+
12
+ ## Discovery management
13
+
14
+ The page defaults to enabled agents. New discoveries are collapsed, grouped by tool and known catalog model, and searchable by model or provider; unknown provider-qualified models are kept separate. The enable dialog chooses an original provider candidate without changing its ID or execution model. Opening an enabled group exposes the other provider candidates, and disabled agents remain accessible.
15
+
16
+ Administrators ignore pending groups individually or in an atomic batch through `PUT /api/agents/discoveryPreferences` (`agent discovery set --input <file>`). Read `discoveryKey`, `discoveryRevision` and `ignored` from `GET /api/agents`, then send unique groups with their expected revision and `ignored: true` or `false`. Preferences survive reports and restarts, including new providers in the same group. Restoring returns pending discoveries without enabling them. Enabled groups cannot be ignored; stale revisions conflict with concurrent enabling. See `docs/runner-agents.md` for the body and migration.
17
+
18
+ ## Where an agent can run
19
+
20
+ `GET /api/agents` answers, per caller, how many team and personal runners online have the agent's tool signed in with its model, whether only personal runners have it (`personalOnly`: they take their owners' work only), and `unusable`, why the caller's work cannot start now: `pending`, `disabled`, `unreported` (no runner reported it for 14 days), `notConfigured`, `noRunner` or `othersPersonal`. The roster (`GET /api/agents/available`, `agent list`, `Agents.roster`) lists the enabled agents reported recently with whether each would take the caller's work now. A run that fails `modelUnavailable` marks that tool and model unavailable on its runner until the runner reports the tool's models differently.
21
+
22
+ ## The App's own agents and defaults
23
+
24
+ - `agents.ensureSystem(input)` keeps an agent of the App's own, such as a project manager: fixed id, name, description, instructions, business actions and the tools and models it runs with. Call it at boot; it creates the agent the first time and writes changes after.
25
+ - `agents.setDefaults(provider)` gives every discovered agent the App's instructions and business actions; call `agents.applyDefaults()` after the provider changes so agents discovered earlier get them too. Without a provider, business actions marked `defaultOn` apply.
26
+ - The system default chat agent is the App's to set (`PATCH /api/agents/chatSettings`); upgrading clears it along with every agent an earlier version kept.
27
+
28
+ ## Upgrading from configured agents
29
+
30
+ The `202610240020_ag_runner_agents` migration removes every agent an earlier version kept, online agents included: their rows stay disabled with `deletedAt` so history still names them, their queued runs are cancelled, their pending run requests withdrawn, and default chat agents cleared. After upgrading, wait for runners to report (or restart them), enable the agents that appear, and set the system default chat agent again.
@@ -2,24 +2,25 @@
2
2
 
3
3
  Everything the App contributes goes through `agentsToken` (`@nocobase/app-plugin-agents/server/tokens`), resolved in one of the App's service providers when it boots. Text people read is an `I18nText` (`{ key, ns }`) in the App's own namespace. The README's "Extension points" section describes each field; this is the map. Where the two disagree, the types exported from `server/tokens` (the `Agents` interface) are authoritative.
4
4
 
5
- | Extension point | Contributes | Typical use |
6
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
- | `subjects.register(binding)` | A kind of subject runs work on: `kind`, `title`, `triggers`, `preview`, `context.assemble`, `sink.onRunFinished`, `queuedExpiryMs`, `reports.describe`, `agentTypes` | An issue, a ticket, a document an agent works on |
8
- | `runs.enqueue(...)`, `runs.withdrawQueued(...)`, `runs.workload(...)` | Wake an agent on a subject, withdraw queued work, read the board of open runs | Assigning work to an agent from a business action |
9
- | `scopes.register(kind)` | A scope of variables and default skills (`key`, `title`, `description`, `access(scopeId, userId)`); `agent` is reserved, `workdir` is registered by the App | Per-project or per-team variables |
10
- | `actions.provide(source)` | The business actions an agent may be given (`key`, `group`, `title`, `description`, `defaultOn`), and those never granted (`grantable: false` with a `reason`) | What the agent editor's Capabilities tab offers |
11
- | `presets.register(preset)` | A role a new agent starts from (`name`, `description`, `instructions`, `actions`) | "Reviewer", "Support assistant" |
12
- | `gate.set(gate)` (`ActionGate`: `allowed(identity)`, optional `consultable(action)`) | Which business actions a caller holds now: a person their own (narrowed by an API key's scope), a run those its agent is configured with within the waking person's | Bounding the command manifest and every request a run makes; without a gate a caller holds only `agents.agents/view` (and `agents.runs/self` for a run) |
13
- | `conversations.sources.register`, `conversations.contextKinds.register`, `conversations.rules.provide`, `conversations.deliver`, `consultations.rules.provide` | Where conversations start from, what a page context may reference, extra system rules, news delivered into a conversation | "Ask agent" buttons on business pages |
14
- | `people.provide(source)` | The App's directory: names, whom to pick, who can no longer act (`inactive`) | Disabling a person stops their runners |
15
- | `events.on('agent.removed' \| 'notice', listener)` | An agent archived or deleted; people to be told, such as `runner_upgrade_required` | Releasing work given to an agent; forwarding notices to the App's inbox |
16
- | `jobs.register(kind, registration)` | A build job kind, only for an off-by-default runner build method | Builds on runners |
17
- | `reporting.usage`, `reporting.runFigures`, `reporting.range`, `reporting.modelUsage` | What runs used and cost, grouped as the App needs | The App's report pages |
18
- | `briefs.sections.register(provider)` | Sections added to every brief's context layer | Project conventions every run should read |
19
- | `mounts.register(provider)` | Directories of files placed beside the agent | Reference material for a run |
20
- | `repoAccess.register(provider)` | Commit identity and short-lived push credentials per run, at the claim or, with `issue`, whenever the runner's git needs one (`gitCredentials` runners) | Git hosting integration |
21
- | `online.skills`, `online.gateway` | Skills every online run gets; the model gateway for the App's own model calls | See [Online agents](online-agents.md) |
22
- | `vectors.collection(spec)`, `vectors.stores.register` | Vector collections searched by meaning; another vector store type | Semantic search for a knowledge base |
5
+ | Extension point | Contributes | Typical use |
6
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | `subjects.register(binding)` | A kind of subject runs work on: `kind`, `title`, `triggers`, `preview`, `context.assemble`, `sink.onRunFinished`, `queuedExpiryMs`, `reports.describe` | An issue, a ticket, a document an agent works on |
8
+ | `runs.enqueue(...)`, `runs.withdrawQueued(...)`, `runs.workload(...)` | Wake an agent on a subject, withdraw queued work, read the board of open runs | Assigning work to an agent from a business action |
9
+ | `scopes.register(kind)` | A scope of variables and default skills (`key`, `title`, `description`, `access(scopeId, userId)`); `agent` and the skill-only `global` are reserved, `workdir` is registered by the App | Per-project or per-team variables |
10
+ | `actions.provide(source)` | The business actions an agent may be given (`key`, `group`, `title`, `description`, `defaultOn`), and those never granted (`grantable: false` with a `reason`) | What the agent editor's Capabilities tab offers |
11
+ | `agents.setDefaults(provider)`, `agents.applyDefaults()` | The instructions and business actions every agent discovered from runners gets; `applyDefaults` writes them to the agents that differ |
12
+ | `agents.ensureSystem(input)` | An agent of the App's own (fixed id, name, description, instructions, actions, tools and models), kept as given and enabled |
13
+ | `gate.set(gate)` (`ActionGate`: `allowed(identity)`, optional `consultable(action)`) | Which business actions a caller holds now: a person their own (narrowed by an API key's scope), a run those its agent is configured with within the waking person's | Bounding the command manifest and every request a run makes; without a gate a caller holds only `agents.agents/view` (and `agents.runs/self` for a run) |
14
+ | `conversations.sources.register`, `conversations.contextKinds.register`, `conversations.rules.provide`, `conversations.deliver`, `consultations.rules.provide` | Where conversations start from, what a page context may reference, extra system rules, news delivered into a conversation | "Ask agent" buttons on business pages |
15
+ | `people.provide(source)` | The App's directory: names, whom to pick, who can no longer act (`inactive`) | Disabling a person stops their runners |
16
+ | `events.on('agent.removed' \| 'notice', listener)` | An agent disabled; people to be told, such as `runner_upgrade_required` | Releasing work given to an agent; forwarding notices to the App's inbox |
17
+ | `jobs.register(kind, registration)` | A build job kind, only for an off-by-default runner build method | Builds on runners |
18
+ | `reporting.usage`, `reporting.runFigures`, `reporting.range`, `reporting.modelUsage` | What runs used and cost, grouped as the App needs | The App's report pages |
19
+ | `briefs.sections.register(provider)` | Sections added to every brief's context layer | Project conventions every run should read |
20
+ | `mounts.register(provider)` | Directories of files placed beside the agent | Reference material for a run |
21
+ | `repoAccess.register(provider)` | Commit identity and short-lived push credentials per run, at the claim or, with `issue`, whenever the runner's git needs one (`gitCredentials` runners) | Git hosting integration |
22
+ | `models.gateway` | The model gateway for the App's own model calls | See [Online agents](online-agents.md) |
23
+ | `vectors.collection(spec)`, `vectors.stores.register` | Vector collections searched by meaning; another vector store type | Semantic search for a knowledge base |
23
24
 
24
25
  Rules that are easy to miss:
25
26
 
@@ -29,14 +30,13 @@ Rules that are easy to miss:
29
30
  - To tell a person before queuing whether a runner would take their work, call `eligibility.canClaim` (online now) or `mayQueue` (some registered runner could) with the subject's variable scopes; a variable marked `teamRunnersOnly` needs a team runner. Enqueue itself does not refuse work run as the responsible or as whoever woke the agent: such work waits with `secretsNotAllowed`.
30
31
  - Forward `notice` / `notice.cleared` using the exported `AgentsNotice` interface. Dispatch by its `type`: runner notices go to the runner's owner, `run_secrets_not_allowed` to the run's actor and owner, and `run_request_expired` to the requester. Subjects are of kind `runner`, `run` or `runRequest`. A secrets notice names the run, the agent and the team-only variables in its parameters. Deduplicate by the notice key. Existing copied queue components must merge the `secretsNotAllowed` type and label from the Registry.
31
32
  - A repository provider minting credentials in `prepare` implements idempotent `discard(run, prepared)` to revoke undelivered credentials. The plugin calls it outside the transaction on a skipped or rolled-back claim; the App implements the code host revocation API.
32
- - A subject kind takes runner agents only unless its binding lists `online` in `agentTypes`; a run of another type is refused with `AGENT_TYPE_NOT_ALLOWED`.
33
- - Name commands in a brief with `commandRef(dialect, cli, id, flag?)` rather than spelling them, so online and runner agents both get the right form.
33
+ - Name commands in a brief with `commandRef(cli, id, flag?)` rather than spelling them.
34
34
  - The App's CLI commands are its API routes: a route declares `...cliRoute({ command, action, ... })` in `describeRoute()`, and lists `runToken` in its `security` when a run may call it. The command manifest (`GET /api/cli/manifest`) offers each caller only the commands whose `action` the gate allows. There is no separate command registry.
35
35
  - `GET /api/agents/vocabulary` hands the browser the subjects, sources and scopes the App contributed; the browser never imports server code for them.
36
36
 
37
37
  The README's example under "Extension points" shows a subject registered and work enqueued and withdrawn.
38
38
 
39
- A subject assembly may return `inputs` containing only the effective inputs for its current task. Render the task and turn from that same selection. Runner and online claims use it for delivery, brief sections and mounts; omitted inputs are resolved in the claim transaction and retained in the audit history, so polling and completion do not replay obsolete work. Omit the field to deliver all queued inputs.
39
+ A subject assembly may return `inputs` containing only the effective inputs for its current task. Render the task and turn from that same selection. Claims use it for delivery, brief sections and mounts; omitted inputs are resolved in the claim transaction and retained in the audit history, so polling and completion do not replay obsolete work. Omit the field to deliver all queued inputs.
40
40
 
41
41
  A working run is held to the same policy: before input joins a dispatched or running run, and before pending input is delivered to one, the plugin asks `admit` and then `selectInputs` with that input. New input either hook keeps from the working run waits in a queued run for the claim to admit or cancel; pending input rejected or left out by `selectInputs` is marked handled instead of being delivered. Implement `selectInputs` with the same selection the assembly returns as `inputs`.
42
42
 
@@ -0,0 +1,17 @@
1
+ # Model services
2
+
3
+ Agents run on runners and do not use model services. The plugin keeps model services for the App's own model calls, such as a knowledge base's embeddings, reranking and short texts. The README's "Model services" and "Vectors" sections are the reference.
4
+
5
+ ## Model services
6
+
7
+ - A service is a provider type (`MODEL_PROVIDERS` in `@nocobase/app-plugin-agents/shared/models`: OpenAI, Anthropic, Google, DeepSeek, Alibaba, Moonshot, Cohere, Ollama, and OpenAI-compatible endpoints), a name, a base URL, a write-only API key sealed with the secrets service, an on/off switch and the models it offers. OpenCode Zen and Go serve each model family through its own API under one base URL: DeepSeek, GLM, Kimi and MiMo through a DeepSeek or OpenAI-compatible service, Claude, MiniMax and Qwen through an Anthropic one, GPT and Grok through an OpenAI one; a call to an OpenCode base URL sends `x-opencode-session` automatically. Each model has a kind: `chat` (short texts), `embedding` or `rerank`.
8
+ - Services are added on the Models page (`modelsRoute`, behind `agents.services`) or through the API (`service create|discover|check` on the CLI). They are never configured in `config.yml`.
9
+ - `GET /api/agents/models` (anyone signed in) lists the models of a kind the enabled services offer; `POST /api/agents/checkModel` (who reads agents) tests one with a short call and never throws.
10
+
11
+ ## The model gateway
12
+
13
+ `models.gateway` on `agentsToken` serves the App's own model calls: `catalog(kind)`, `check(ref)`, `embed({ model, values, source })`, `rerank({ model, query, documents, topN?, source })` and `generate({ model, system?, prompt, maxOutputTokens?, source })`. Each names who asks (`source`), is recorded in `agModelUsage` and priced from the service's model prices, and throws `ModelError` with a code (`config`, `auth`, `quota`, `rateLimit`, `network`, `contextOverflow`, `filtered`, `badResponse`, `aborted`, `unknown`). Use it rather than calling a provider SDK, so keys, usage and prices stay in one place.
14
+
15
+ ## Vectors
16
+
17
+ `vectors.collection(spec)` gives the App semantic search over items it names, embedded with the model it chooses, in the store `agents.vectors` configures (`sqlite-vec` by default, `pgvector` for several instances or Alpine). `status()` answers availability and a `VectorUnavailableCode` when it is not available; then search answers null and the caller keeps its keyword search. See the README's "Vectors" section.
@@ -0,0 +1,216 @@
1
+ # OnlineAgent chats and business tools
2
+
3
+ The shared OnlineAgent entry exports the SDK UI message contract; see `docs/ui-messages.md` in the installed `@nocobase/app-plugin-agents` package for types, validation, dependency versions and conversion boundaries. Realtime routes, Registry and Examples consume that contract through the SDK.
4
+
5
+ Use `OnlineAgentService` for SDK conversations that call application services and continue answering with their results, or for lightweight background generation with a JSON Schema-constrained result. Native model execution runs inside the application process. Realtime sessions can also select a callable Runner agent through the same service; Runner output arrives as completed text blocks. The plugin owns persistence, model selection, execution control and public chat transport; the application owns its business tools, permissions and page composition.
6
+
7
+ ## Obtain and configure the shared service
8
+
9
+ Import the original `agentsToken` from `@nocobase/app-plugin-agents/server/tokens` and resolve `agentsToken.onlineAgent` in an application provider after the plugin has registered. Do not construct a second service for an HTTP entry or user: the application instance coordinates busy, stop and finalization across all facades. `OnlineAgentService` and `OnlineAgentConfigurator` are exported from `@nocobase/app-plugin-agents/server` and `@nocobase/app-plugin-agents/server/online-agent`; the latter also exports the prefixed configuration, tool and stream contracts.
10
+
11
+ Application dependencies and function parameters use the complete `OnlineAgentService` type. Resolve the shared instance through `agentsToken`; do not introduce another service interface or a method-only type projection. `OnlineAgent` is the common public session interface, with `history(): Promise<AppUIMessage[]>`, session identity, status, cancellation and finalization. `RealtimeOnlineAgent extends OnlineAgent` adds `send`, `receive`, `backend`, required `approve` and `messages`; `BackgroundOnlineAgent extends OnlineAgent` adds `run`, `get` and `try`, without `send` or browser `receive`. The service's `realtime()` and `background()` factories return the corresponding interfaces, implemented by the actual session classes rather than inline facade objects.
12
+
13
+ `onlineAgent.configurator` is the `OnlineAgentConfigurator` (the configuration component). Register global layers, named business scopes and versioned tools once at application boot. It resolves prompts, variables, model lists and tool sets; a Scope selects ordinary configuration and grants no business permission.
14
+
15
+ ```ts
16
+ import { agentsToken } from '@nocobase/app-plugin-agents/server/tokens';
17
+ import type {
18
+ OnlineAgentService,
19
+ OnlineAgentToolContext,
20
+ } from '@nocobase/app-plugin-agents/server/online-agent';
21
+ import type { ServiceResolver, ServiceToken } from '@nocobase/service-provider';
22
+ import { z } from 'zod';
23
+
24
+ type InvoiceService = {
25
+ read(
26
+ id: string,
27
+ actor: OnlineAgentToolContext,
28
+ ): Promise<{ id: string; total: number }>;
29
+ };
30
+
31
+ // Call once from the application's provider, with its existing business service token.
32
+ export function configureInvoices(
33
+ resolver: ServiceResolver,
34
+ invoiceToken: ServiceToken<InvoiceService>,
35
+ ): OnlineAgentService {
36
+ const online = resolver.resolve(agentsToken).onlineAgent;
37
+ online.configurator.registerTool('read_invoice', {
38
+ version: '1',
39
+ definition: (services) => ({
40
+ inputSchema: z.object({ id: z.string() }),
41
+ execute: ({ id }, { context }) =>
42
+ services.resolve(invoiceToken).read(id, context),
43
+ }),
44
+ });
45
+ online.configurator.registerOnlineAgentGlobalScope({
46
+ model: ['billing-models/chat'],
47
+ systemPromptTemplate: 'Answer using the authorized business tools.',
48
+ });
49
+ online.configurator.registerOnlineAgentScope('invoices', {
50
+ tool: ['read_invoice'],
51
+ systemPromptTemplate: {
52
+ variableSchema: z.object({ invoiceId: z.string() }),
53
+ template: (context) =>
54
+ `${context.systemPrompt}\nInvoice reference: ${JSON.stringify(context.variable)}`,
55
+ },
56
+ });
57
+ return online;
58
+ }
59
+ ```
60
+
61
+ Replace `billing-models/chat` with an enabled chat model in the application's existing model services. Model credentials remain in that service. Factories resolve application dependencies once and must not capture a current user. Each tool invocation receives fresh `OnlineAgentToolContext`: user, current authorization, complete entry credentials, business data, signal and the authoritative runtime `sessionId`. Forward it to the original business service; retain its object, row and field checks. Never use model-provided user/session IDs as authority. Keep secrets out of tool output, prompts, variables and saved configuration. Every tool result and async yield must already be lossless JSON: convert Date to an ISO string and other business objects to intentional JSON values inside `execute`. Non-JSON returns are rejected, not implicitly serialized or retried. The SDK's `toModelOutput` derives model input from that raw JSON without replacing the saved result.
62
+
63
+ Layers resolve in order: global registrations, selected named scopes, then explicit options. Providers run sequentially; omitted fields keep their preceding value and arrays replace it, including empty arrays. Prompt functions can compose `context.systemPrompt` and validate variables. The resolved serializable snapshot is saved. Loading an existing session restores it without reevaluating Providers. Idle explicit overrides reevaluate only the named sources requested; running configuration is frozen. `selectedModel` explicitly selects the existing model columns, while a model-list replacement selects its first entry. A prompt-only override retains the selected model.
64
+
65
+ ## Use a realtime session or a background result
66
+
67
+ Construct `OnlineAgentContext` from the authenticated user and full trusted entry identity, never from browser JSON. The authorization principal must match `user.id`. Business references are untrusted input and still require authorization in tools.
68
+
69
+ ```ts
70
+ import type {
71
+ OnlineAgentContext,
72
+ OnlineAgentService,
73
+ } from '@nocobase/app-plugin-agents/server/online-agent';
74
+
75
+ export async function askInvoice(
76
+ online: OnlineAgentService,
77
+ actor: OnlineAgentContext,
78
+ invoiceId: string,
79
+ ) {
80
+ const chat = await online.realtime(actor, {
81
+ scope: ['invoices'],
82
+ context: { variable: { invoiceId } },
83
+ source: 'chat',
84
+ });
85
+ await chat.send([{ role: 'user', content: 'What is the invoice total?' }]);
86
+ const events = await chat.receive();
87
+ // Consume the standard SDK stream when present; always reconcile saved history and execution state.
88
+ return {
89
+ sessionId: chat.sessionId,
90
+ events,
91
+ history: await chat.history(),
92
+ };
93
+ }
94
+
95
+ export async function classify(
96
+ online: OnlineAgentService,
97
+ actor: OnlineAgentContext,
98
+ ) {
99
+ const job = await online.background(actor);
100
+ await job.run(
101
+ [{ role: 'user', content: 'Return JSON with category: invoice.' }],
102
+ {
103
+ type: 'object',
104
+ properties: { category: { type: 'string' } },
105
+ required: ['category'],
106
+ additionalProperties: false,
107
+ },
108
+ );
109
+ // run acknowledges admission; get waits for validation, persistence and release.
110
+ return await job.get();
111
+ }
112
+ ```
113
+
114
+ Pass `{ sessionId }` to `realtime`/`background` to load without starting execution. Realtime `send` accepts input for the bound executor; native background `run` saves its input and starts the SDK. `status` includes pending finalization. `get` waits for the execution already admitted at invocation and returns only its successfully persisted and finalized result validated against the submitted JSON Schema. `try({ wait })` observes the same execution with a finite non-negative budget (default 0), returning pending, success, failed or cancelled without stopping work on timeout; admission, authorization and persistence errors still throw. `get` throws OnlineAgentResultError for safe failed/cancelled outcomes. Every session's `history()` returns public `AppUIMessage[]` with ordered SDK parts and stable identities, including background sessions. It never returns privileged model history or raw tool/provider evidence. Background structured results remain separate from message history: `get`/`try` observe the validated result and execution outcome, while status, cancellation and finalization retain their own execution state. Only successful JSON-safe background results persist.
115
+
116
+ `run(messages, schema)` requires a plain Draft-07 JSON Schema, not Zod. Browser callers submit the same JSON through an authenticated application-owned API; the server supplies the trusted actor, scopes and tools. The schema is snapshotted and compiled before input admission, passed to the AI SDK through `Output.object({ schema: jsonSchema(...) })`, and used for final server-side validation without coercion, default insertion or property removal. Invalid schemas are rejected before model execution. Only local references are supported; schemas are limited to 64 KiB, 32 nesting levels and 4096 JSON nodes. Patterns use a linear-time RE2 engine; unsupported syntax such as lookaround and backreferences is rejected before admission. Use explicit null types instead of OpenAPI `nullable`. Provider warnings that JSON response formatting is unsupported fail the execution rather than falling back to text.
117
+
118
+ Use `abort()` for explicit Stop. Native execution waits for terminal persistence; Runner acknowledges its existing cancellation request and remains busy until its normal terminal confirmation. Read saved execution state before permitting another turn. A save or seal failure keeps the session busy; `retryFinalization()` retries only that closing work and never reruns the model or tools. Application shutdown drains active executions and warns if finalization fails, allowing the application to close. Cancelled tool exchanges retain paired actual results or an explicit unknown result in private model context; advisory risk feedback never permanently blocks a finished conversation.
119
+
120
+ ## Browser integration and limits
121
+
122
+ Native `POST /api/agents/conversations/:id/messages` accepts only the current SDK user message (`id`, `role: "user"`, text `parts`) plus authorized attachment IDs, page context and optional selected model. It returns a standard SDK UI message stream. Use a `DefaultChatTransport.prepareSendMessagesRequest` mapper; do not submit browser history or trusted metadata. Tool input/output, assistant/system messages and configuration cannot be supplied as history. Creation starts no model. Detail, list, history, config, attachment and Stop retain ownership checks.
123
+
124
+ In both native realtime and background modes, `content.original` is the only complete internal UIMessage, with the same ID as its record and raw JSON tool inputs/results, reasoning and provider/approval evidence. Both modes share the same original-message storage and raw tool JSON, not a separate background ModelMessage codec. Public tools require explicit `public.input`/`public.output` projections. All public history reads, including background `history()`, and realtime streams use current projections; current `toModelOutput` rules separately derive internal model input from the original when it is read. Both conversions use detached copies and never execute tools. Missing or failed projections never expose the raw original. No duplicate full message, migration, compatibility fallback or format version is used. SDK `needsApproval` tools require these projections. The approval endpoint accepts only `{ messageId, executionId, approval: { id, approved, reason? } }` and resumes from trusted persisted history. Waiting approvals, denials and outcomes update the same message with increasing metadata revision; use message revision notifications and `GET messages?ids=...` to reread changes. Approval retains its owner/execution/message binding and does not bypass active execution occupancy. Background structured execution stays separate.
125
+
126
+ Native and Runner realtime receive use the standard SDK stream with optional shared Redis recovery. Background sessions have no browser receive transport and do not require Redis. Browser disconnect never cancels generation. Finish ends the HTTP response, possibly while waiting for approval; execution detail and saved history determine business state. Failed persistence keeps occupancy and supports explicit finalization without reexecution. Missing streams require history/status reconciliation, never automatic resend. A lost producer remains interrupted and is not automatically restarted. The public ChatProvider and installed Registry/Examples consumers use SDK Chat ownership and GET recovery. See [UI messages](../../../docs/ui-messages.md) and [client coordination](../../../docs/ui-message-clients.md) for configuration, costs and limits.
127
+
128
+ Permission-restricted configuration, custom permission/approval protocols and nonempty Skills execution remain unsupported. SDK approval is native-only; Runner remote tool approval is refused. Verify with isolated model fixtures and authorized application services, never real business writes.
129
+
130
+ ## Open UI context, custom tool cards and local form drafts
131
+
132
+ Use the public `@nocobase/app-plugin-agents/client/chat` exports for these capabilities; the full contracts and integrated application wiring are in [UI context, tool cards and AI form adapters](../../../docs/ai-forms.md). The plugin supplies infrastructure only. Applications own tool names/schemas, fields, permissions, proposal cards and browser adapters. The Examples application's `examples_form_proposal`, `examples-form-fill` scope and `/ai-form-fill` page are application demonstrations, not plugin defaults or APIs to import into another application.
133
+
134
+ `PageContext.ui = { version: 1, items: [...] }` is open JSON data: every `PageUIItem` has required `kind`/`id` and arbitrary accepted `AppUIJson` fields, including unknown kinds and nested values. This is separate from server-resolved/authorized `context.items`. UI items grant no server record access or tool permission and enter Native/Runner model context as explicitly untrusted data, never instructions. Accepted fields survive public user metadata, saved history and recovery. Budgets in `PAGE_UI_CONTEXT_LIMITS` reject non-JSON, dangerous keys, duplicate identities and oversized snapshots without truncation; applications must minimize data and exclude secrets.
135
+
136
+ Register availability with `useChatUIContextSource({ kind, id, label, getSnapshot })`. Registration does not select, read or upload values. An explicit user action calls `useChatSources().selectUI({ kind, id }, true)`; selection state uses `selectedUIKeys` and `uiItemKey`. The installed composer awaits `snapshotUI()` immediately before Send and gives its detached envelope to `buildPageContext`. Custom composers must await this too: `buildPageContext` is synchronous and `uiSources` alone adds chips, not data. Async read failures or selection/source/lifetime changes must block sending with visible feedback. Do not register a resolver for UI data or automatically include every mounted form. Include a fresh snapshot explicitly for each turn that needs it.
137
+
138
+ `AIToolRendererProvider` takes an `AIToolRendererMap` keyed by exact SDK tool name, with components accepting `AIToolRendererProps`. Registry chat dispatches static `tool-*` and `dynamic-tool` parts using the SDK name helpers; unregistered tools keep their fallback. Nested renderer providers inherit other keys and override matching keys. Renderers receive the public SDK `part`, owning `message`, and `context` with read-only/streaming gates, source message/context and the bound SDK `approval.respond(approved, reason?)` control. A registered renderer owns presentation in every streaming, input, approval, success, error and denial state; only complete schema-valid `output-available` proposals may enable local Apply. Preserve genuine approval controls for approval tools. Keep existing data/message extensions and the one Chat owner; never start effects from rendering, mount, history replay or reconnect.
139
+
140
+ A card's source comes only from server-owned assistant `metadata.sourceUserMessageId`. Native execution sets it to the admitted user-message id and retains it through approval revisions/public projection. `getAIToolSourceMessage` requires an assistant conversation id and exactly one loaded user message matching that id and conversation; the Registry passes that message and its saved `metadata.context`. Missing source history, legacy messages or a backend without this linkage must disable local application, not fall back to adjacency, the latest user message, current composer selection or model-supplied allowed ids. Native-only Examples tools must not be advertised as Runner browser callbacks.
141
+
142
+ `AIFormRegistryProvider`, `useAIFormRegistry`, `AIFormRegistry` and `useAIForm` provide generic draft registration, `locate`/`list` descriptors, async `snapshot(id)` and controlled `apply({ source, operationId, values, signal? })`. `useAIForm` returns a **ref callback**, not `{ ref, context }`; attach it to the form and register/select its UI source separately. A registration declares stable id, user/record identity, safe fields, synchronous `getRevision`, current `getValues`/`setValues` callbacks and optional validation. Instances rotate on reattachment or identity change, including A→B→A; duplicate live ids throw. Flat declared fields only: undeclared, read-only, dangerous paths, invalid types/enums and changed revisions are rejected before writing.
143
+
144
+ Mount form/renderer providers inside the existing keyed authenticated lifetime and around both page and panel, never as a module-global registry or second `ChatProvider`. Nested form registries are isolated, not merged. A card passes the selected snapshot from its exact source message, its final user-edited patch and a stable conversation/message/tool operation key to `apply`. Same-key identical requests deduplicate; changed content under the same key is rejected. The registry checks live identity/instance/revision/capabilities, validates, awaits the setter and reports real applied/partial/failed/rejected/cancelled outcomes. A setter attempt invalidates that snapshot even on failure; do not auto-retry an uncertain or partial write.
145
+
146
+ Adapters must exclude sensitive fields, advance a monotonic revision synchronously on every draft edit and remain side-effect free while reading. Async preparation must honor `signal` and check `context.isCurrent()` immediately before a synchronous draft commit, without an intervening await. The registry cannot make an arbitrary third-party setter transactional or stop one that ignores cancellation; adapters own atomicity/rollback and truthful partial/failure reporting. A successful local Apply is browser draft state only: no form submission, business save request, fabricated message/tool output, `addToolOutput`, HITL/resume or SDK continuation. The proposal tool already completed on the server. Keep explicit `public.input`/`public.output` safety projections; SDK-standard `toModelOutput` is a separate private model-conversion boundary.
147
+
148
+ ## Select a Runner executor
149
+
150
+ Applications depend directly on the shared `OnlineAgentService`. Native and Runner realtime execution share `RealtimeOnlineAgent`, and the Runner adapter implements `OnlineAgentBackend`. Both executors return `AppUIMessage[]` history and standard SDK streams. Runner blocks retain source IDs, sequences, creation times and stable part identities in message metadata; render source segments around independent notifications while retaining one logical message. Use the SDK to parse, assemble and resume the stream. Native background sessions implement `BackgroundOnlineAgent`: public UI history is shared with realtime sessions, model conversion remains internal, and the structured `run(messages, schema)` / `get()` / `try()` result and execution state remain separate from UI history. They have neither `send()` nor a browser `receive()` method, and acquire no Redis dependency. The retired custom stream contracts and memory replay manager are no longer exported. EOF or cancelling a subscriber means neither saved completion nor business Stop.
151
+
152
+ `OnlineAgentBackend` defines required realtime/background creation and restoration, configuration read/write and shutdown. Shared persistence recovery and output transport are not execution-backend capabilities. Runner implements realtime and rejects unsupported background execution, approval and Native-only configuration before persistence or dispatch. A rejected capability uses `INVALID_REQUEST` with `details.reason = 'UNSUPPORTED_CAPABILITY'`, `backend` and `capability` (HTTP exposes details as `metadata`). Applications continue to use the complete `OnlineAgentService` and its canonical `.configurator`; custom injected backends implement this execution contract rather than the removed `OnlineAgentRunnerBackend`. Session `approve` is required, with Runner explicitly rejecting the operation. There is no public Service `isActive()` or `notify()` API.
153
+
154
+ Creation resolves defaults and configuration Providers once before choosing the backend. On restoration, the session manager first verifies ownership and identifies Native realtime/background or Runner realtime from persisted `mode` and versioned binding metadata, without probing configuration or running Providers. Missing, malformed, conflicting or mode-mismatched bindings and unavailable backends are explicitly rejected, never defaulted to Native. Pending overrides are resolved on send against the latest saved configuration, under the original trusted/HTTP boundary, and cannot change the Agent. Only successful acceptance consumes pending options and pins a new response. Failed or concurrent rejected sends leave the prior accepted response intact. A pinned stream cannot follow a later round; use an unpinned recovery entry to discover the current execution. Startup correction is a session-manager operation invoked directly by the service; shared producer availability is composed once from Native local occupancy and UIStreams. Shutdown drains Runner admissions before detaching projection transport and never cancels or redispatches an already accepted remote Run. Shared transport closes only after both backends have settled.
155
+
156
+ ```ts
157
+ online.configurator.registerOnlineAgentScope('coding', {
158
+ agentId: 'runner-agent-id',
159
+ });
160
+ const chat = await online.realtime(actor, { scope: ['coding'] });
161
+ // Or pass { agentId: 'runner-agent-id' } explicitly.
162
+ await chat.send([{ role: 'user', content: 'Review the selected code.' }]);
163
+ const events = await chat.receive();
164
+ ```
165
+
166
+ `agentId` follows global → ordered scopes → explicit options. Omission or `online` selects native execution. Selection happens before native model lookup. Existing sessions restore their saved executor and configuration without evaluating providers; a different executor requires a new conversation. New creation and each admission check the actual caller, Agent and execution eligibility. Scope never grants authority. `GET /api/agents/chatAgents` reads the conversation directory directly, independently of OnlineAgent execution, and retains offline reasons; an offline Agent may be displayed but cannot accept new input until executable.
167
+
168
+ Runner sessions accept one user message per round. Send authorized files by `attachmentIds`, with text parts only; native execution resolves authorized stored files into transient model data URLs. Prompts, configuration variables, resolved page context and business data are assembled on the server. Native model references, thinking settings, local tools, structured background execution and restricted credentials cannot be mapped to Runner execution and are explicitly refused. Keep native business tools in an explicit `agentId: 'online'` business scope selected by the application's native chat, Ask agent and Organize entries; do not put them in a global layer shared with Runner scopes or silently remove them in an adapter.
169
+
170
+ Request-level business context is assembled directly into the existing Runner input as untrusted data. It is not stored again in message metadata or content, and public messages exclude that internal payload; public page context retains its existing authorized projection.
171
+
172
+ Runner admission, files and enqueue share the existing conversation transaction. Queued, dispatched, running, cancelling and terminal-history closing all remain busy. Existing Runner synchronization is the only assistant-history writer; persisted event identity and real conversation message positions handle retransmission, blank events and notices. Notifications trigger coalesced persisted catch-up; only active executions have a one-second read fallback. No-change catch-up takes no write lock. Stop requests reuse Runner cancellation and keep the gate until terminal confirmation; retries remain the same active execution. Closing a browser only unsubscribes. Browser recovery reconnects only the standard output stream and never repeats input; Runner claim, lease, retry, spool and adapter protocols are unchanged.
173
+
174
+ ### History confirmation and identity lifetime
175
+
176
+ Message insertion notifications advance the committed watermark; same-ID revision notifications trigger exact ID rereads. The shared coordinator drains every bounded `nextAfter` page before advancing its forward cursor and preserves older pages and active SDK output. Canonical history merges by ID and revision; browser input with an unknown outcome is reconciled without resending. SDK actions and retained Undo notifications are guarded by the Provider lifetime; removing an archived row does not invalidate its legitimate Undo. Consumers must not write stale detail snapshots into the shared cache from submission callbacks; the controller orders trusted details before notifying consumers.
177
+
178
+ Use one `ChatProvider` for the authenticated identity and remount it on every identity lifetime change, including logout followed by login to the same user. The SDK orders detail refreshes and commands together, preserves fresh refreshes queued behind older pages, and replaces temporary output only when its canonical message has actually loaded. Submission reconciliation merges confirmed messages without sending again or reopening events. SDK actions and retained Undo notifications are guarded by the Provider lifetime; removing an archived row does not invalidate its legitimate Undo. Consumers must not write stale detail snapshots back into the shared cache from submission callbacks; the controller already commits those details before notifying consumers.
179
+
180
+ ## Chat feedback, defaults and read state
181
+
182
+ `chatFeedback`, `chatIsRunning` and `useChatScroll` from the public client/chat entry provide presentation shared by the Registry block and its application copies. Local submissions show sending immediately; occupied OnlineAgent execution shows thinking until the first visible reply, even before the subscription attaches or emits text. The busy indicator belongs immediately after the latest message in the scrolling log, not in the composer footer, and is not provider reasoning output; legacy Run-only state may still show waiting. A successful Stop request remains stopping until the execution actually becomes idle. EOF or an interrupted subscription reports an unconfirmed result, never success or an automatic resend. Outcomes use localized safe keys; internal provider errors are not displayed. Legacy effect-review hints are advisory and never disable sending after execution has actually ended. Check possibly completed actions before repeating them. Layout growth follows only while the reader remains near the bottom; loading older messages preserves their position.
183
+
184
+ The built-in `online` choice is part of the service directory and may be saved as a personal or team default even before a model is configured; its availability still reports `noModel`. UI selection remains picked agent, personal default, then team default and passes that choice explicitly. Service calls that omit `agentId` retain Native compatibility, regardless of a Runner preference. Explicit scope/options precedence and existing session binding are unchanged; invalid or unavailable choices never silently select another backend.
185
+
186
+ Accepted user input marks the conversation read in its existing transaction. Only newly persisted visible assistant output marks it unread; empty cancellation/failure, tool-only records and duplicate finalization do not. Stop/abort resolves after the cancellation request has been processed; consumers must use execution status, saved history and terminal stream confirmation rather than the request Promise to decide whether another turn is safe. Follow-up context is limited to reauthorized references from the latest earlier page-bearing user message, with current page references taking priority. Full historical page context, including old selections, filters, routes and credentials, is not replayed.
187
+
188
+ The historical `runCancelled` notice means that cancellation was requested, not that execution has ended. It is rendered as “Cancellation requested.” even when older stored text says otherwise; terminal feedback still waits for the existing execution and saved-history confirmation.
189
+
190
+ ## Historical page references
191
+
192
+ On a follow-up, OnlineAgent may supplement the current user input with authorized references from only the latest earlier page-bearing user message. Current page references (including a selection source) take priority, duplicates are removed, and historical additions use only the remaining slots of a ten-reference budget after counting current references; existing current-context limits stay unchanged. An empty, deleted, unknown or inaccessible latest page never falls back to an older one.
193
+
194
+ References are re-resolved through the existing page-kind resolver for the current user, once per kind. Only kind, identifier and the current title (at most 2,000 characters) enter the supplementary untrusted user data. Stored titles, URLs, keys, routes, filters, selections and entry credentials are not replayed. The supplement is not written back to conversation history or promoted to a system instruction. A Native entry with a restricted credential scope receives no inferred historical references because the existing resolver accepts user identity only; ordinary current context and tool authorization stay unchanged.
195
+
196
+ Resolvers remain responsible for business authorization and their own database reads. One batched resolver invocation does not imply one SQL query: Studio currently resolves each issue through its authorized detail service. Native UI history validation and attachment reauthorization add reads; admission, approval and finalization reuse the existing conversation lock with no new tables or per-token writes. There is no automatic resend. Optional `agents.uiRecovery` uses the plugin-owned shared Redis stream component; SDK consumers use the authorized events endpoint for full replay and later chunks. Runner protocol and lifecycle remain unchanged; existing Runner session memory and previously generated answers are not erased by this policy.
197
+
198
+ ## Shared UI transport and independent notifications
199
+
200
+ Native and Runner realtime history is `AppUIMessage[]`, and HTTP input for both is the current `{ message: { id, role: "user", parts }, attachmentIds?, context?, selectedModel? }`. Responses use the SDK UI message stream, not the old block events. Runner assistant ID is `runner:<runId>`; `metadata.sourceRecords` retains real saved record IDs, source sequences and stable part IDs/indices. Display segments must interleave independent notifications by source sequence without duplicating the logical assistant message. Registry and application consumers use `chatMessageSegments` to retain that source ordering. Forward history readers must drain `meta.nextAfter` before advancing to the conversation watermark.
201
+
202
+ For multiple instances configure `agents.uiRecovery: { namespace, redis: { host, port, ... } }` with an application-specific namespace and a shared Redis deployment. The plugin owns the connections. `DefaultChatTransport.prepareReconnectToStreamRequest` points to `/api/agents/conversations/:id/events`. Without configuration there is one live response and history only, reported as `x-online-agent-recovery: live`; configured failures never fall back. Replay requires the live producer: process death does not restart inference, tools or Runner work. Stop remains a separate authenticated action and can signal a live native producer on another instance; read execution and saved history until termination is confirmed. Approval waiting and a missing stream are not business success. See [UI messages and recovery](../../../docs/ui-messages.md) for identity, lifecycle, limits, costs and validation boundaries.
203
+
204
+ Existing system notices are delivered through `ConversationService.deliver()` in the caller's business transaction. OnlineAgent bindings persist them without starting another execution, and rollback removes them with the business changes. Native notices use standard public data parts and remain readable after a response closes. Independent application timeline content should use the authorized business subscription and rendering extensions; OnlineAgent has no separate notification-injection API.
205
+
206
+ ## Public UI messages
207
+
208
+ Browser consumers use the SDK-owned `AppUIMessage` and `ChatProvider` from `client/chat`. Render ordered parts and use `chatMessageSegments` to preserve Runner source ordering around independent notifications. The public extension hooks receive the complete SDK message, and approval uses only a bound server-validated control. Follow [the client contract](../../../docs/ui-message-clients.md) for identity lifetimes, unknown admission, revision rereads, durable notification polling and independent Stop. A standard response finish or a missing recovery stream never implies saved business completion.
209
+
210
+ ## Single-instance startup and visibility
211
+
212
+ Deploy one execution process per logical application/database, fully stopping the old process before starting its replacement. A real serving host repairs pre-process native occupancy at startup: complete saved results are finalized; missing terminal snapshots become failed UI messages on their stable IDs. Current-process rows, valid approval waits and Runner bindings are preserved. Command hosts do not perform crash recovery. Repeated reads and initialization do not rerun models or tools. Shared stream markers express transport reachability, never execution-process death; overlapping deployment and execution takeover are outside this contract.
213
+
214
+ Normal native and Runner creation accepts showInChatList (default true); background creation always hides the record. List filtering happens in the database before pagination. A known hidden ID retains its ownership checks and remains readable. Notifications delivered through conversations.deliver join the caller's transaction, do not wake new native/Runner execution, and roll back with business changes; native realtime notices are saved as standard data parts.
215
+
216
+ HTTP creation/configuration cannot override tool lists, model lists or system prompts. Business variables must be declared and validated by selected scopes; selectedModel still selects an authorized catalog entry. Trusted server SDK configuration retains its policy capability. Legacy unbound conversations are read-only but their owner can still Stop their existing Run without a current model or online Agent.
@@ -18,6 +18,12 @@ A runner registers once per App with a one-time registration token (10 minutes):
18
18
 
19
19
  Then on the runner's machine: `nocobase-runner register --server <App URL> --token <token>`, and `nocobase-runner start` or `nocobase-runner service install` (launchd on macOS, a systemd user unit on Linux). The install script does all of this in one line; see [Distribution](distribution.md).
20
20
 
21
+ Registering again with the same owner, name and hostname revokes previous registrations and their keys atomically. Old runtimes take no more work, and the sweeper requeues what they held; historical records retain their ids. Hostnames are self-reported, so another owner's matching runtime is preserved. Agent configurations limited to a previous runtime id need to select the new runtime.
22
+
23
+ `runtime token list` (`GET /api/agents/runners/registrationTokens`, paged with `page` and `pageSize`) lists unused, unexpired token metadata. Signed-in callers see their own tokens; managers of runners see all. Tokens and hashes are never returned: create a fresh token if the original secret is lost. To delete a runtime, run `runtime revoke <runtime>` and then `runtime delete <runtime>`; deleting a live runtime returns `RUNNER_NOT_REVOKED` with those steps.
24
+
25
+ The install script requires an explicit `--server <App URL>` with `--runner` and rejects a missing or empty value before downloading or installing anything. CLI-only installation still defaults to the application that served the script.
26
+
21
27
  A runner authenticates afterwards with its own key. Personal runners (`ownerOnly`) run only work their owner started, and receive its variables like any runner, except those marked "Team runtimes only" (`teamRunnersOnly`): a run that gets one goes to a team runner. Their owner may share them with the team. `nocobase-runner unregister --server <url>` or "Revoke" on the Runtimes page ends a registration.
22
28
 
23
29
  ## How work reaches a runner
@@ -44,3 +50,9 @@ Run lists and details expose `executions`, one claim snapshot per attempt, with
44
50
  `effort` is requested; `actualEffort` is only a tool report, with `actualEffortSource`, `actualEffortAt` and per-attempt `effortReports`. Show unreported actual values explicitly, never infer from requests or token counts. Import `runForViewer`/`executionForViewer` from `@nocobase/app-plugin-agents/server/tokens` and apply them to custom user-facing run/workload/CLI outputs, using the runner machine rights; `machineHidden` means a generic runtime label, not a fallback to the hostname/id. A projects viewer may provide `seesExecutionMachine` from those same rights. See `docs/execution-history.md` for the report and projection contracts.
45
51
 
46
52
  The runner finds each coding tool on its PATH and reports whether it is signed in. A tool not found, or not signed in, is offered no runs: sign in on the runner's machine as the runner's user (for example `claude` and its login), then wait for the next heartbeat. Which tools a runner is offered work for is chosen on the Runtimes page (`enabledTools`). A model the tool's account cannot use fails the run `modelUnavailable`.
53
+
54
+ ## Quota recovery
55
+
56
+ Quota exhaustion is scoped to the runtime and a tool, provider prefix or model. Known resets restore claim eligibility automatically; unknown resets require the runtime owner or an administrator to clear the selected mark after restoring quota. This never restarts failed, withdrawn or expired work. Runtime Overview, Workspaces and Runs load separately; the list contains summaries. Use runtime workspaces for directories and runtime quota clear with structured tool/scope/target/window fields for unknown-reset marks (no client revision); known resets clear automatically. Upgrade runners for usage/reset reporting; old runners only report the failure. See the package README for fields, endpoint contracts and read/write costs.
57
+
58
+ For application-owned system agents, `useAgentOption(id)` in the client kit reads the same viewer-scoped agent detail endpoint and includes quota; `useAgentOptions()` lists discovered runner agents only. A final failure reuses accepted event metadata for quota deduplication, while new event sequences remain new observations. The failure snapshot is retained even when its windows were already applied.
@@ -37,10 +37,6 @@ agents:
37
37
  versions: { acme: 0.1.0 } # pin a product instead of the channel's highest
38
38
  npm: # a product with no tarball in dir, named on npm instead (exact versions)
39
39
  nocobase-runner: { package: '@nocobase/agent-runner', version: 1.0.0 }
40
- server: # online agents, run by every instance
41
- enabled: true
42
- maxSteps: 16
43
- consult: { timeoutMs: 120000, tokenBudget: 200000 }
44
40
  vectors:
45
41
  store: sqlite-vec # the default; pgvector (own PostgreSQL), or false
46
42
  path: storage/vectors.sqlite
@@ -49,14 +45,17 @@ agents:
49
45
  ```
50
46
 
51
47
  - `agents.cli.name` defaults to `agents.app.id`; set it to the App's `nocobase.cli.bin` so runs install and call the same CLI the App serves.
52
- - `agents.server.enabled: false` leaves online runs to the other instances.
53
48
  - `sqlite-vec` is local to an instance and has no build for Alpine (musl), where it reports `SQLITE_VEC_UNSUPPORTED`; an App running several instances, or on Alpine, uses `pgvector`, which takes its own PostgreSQL connection and never the App's.
54
49
  - Moving `agents.skills.disk` does not copy what is stored: copy `skills/blobs/` across first.
55
- - Model services are not configured here; they are added on the Models page or through the API.
50
+ - Model services, for the App's own model calls, are not configured here; they are added on the Models page or through the API.
56
51
  - `secrets.keys` (the App's secrets service) must be set before variables or model service keys can be stored. `pnpm nocobase secrets rotate` reseals both stores.
57
52
 
58
53
  ## Pages and chat
59
54
 
60
- The plugin has no routes of its own. The App routes what `@nocobase/app-plugin-agents/client/routes` exports (`agentsRoute`, `runtimesRoute`, `skillsRoute`, `usageRoute`, `modelsRoute`), each behind a page grant named like its route (`PAGES` in `shared/access`); `modelsRoute` stands behind `agents.services` read. `client/kit` has the pieces for the App's own settings pages (`VariablesSection`, `DefaultSkillsSection`, `useRunnerOptions`, `useAgentOptions`), `client/runs` the headless parts of a subject's runs, `client/profile` the person's default chat agent, and `client/config` the business-action catalog context.
55
+ The plugin has no routes of its own. The App routes what `@nocobase/app-plugin-agents/client/routes` exports (`agentsRoute`, `runtimesRoute`, `skillsRoute`, `usageRoute`, `modelsRoute`), each behind a page grant named like its route (`PAGES` in `shared/access`); `modelsRoute` stands behind `agents.services` read. `client/kit` has the pieces for the App's own pages (`RunnerAgentsSection`, the Agent page's list for an App that shows its own agents beside it, `VariablesSection`, `DefaultSkillsSection`, `useRunnerOptions`, `useAgentOptions`), `client/runs` the headless parts of a subject's runs, `client/profile` the person's default chat agent, and `client/config` the business-action catalog context.
61
56
 
62
57
  The chat is headless in `client/chat`: wrap the App's routes in `ChatProvider` and install the UI Library's `agent-chat` block (`yes n | pnpm exec shadcn add @nocobase/agent-chat`) for its UI. The README's "Web UI" section describes every export.
58
+
59
+ ## OnlineAgent chat
60
+
61
+ Mount `ChatProvider` from the plugin client chat entry and key it by the authenticated user identity. It owns the shared submission, canonical-history and initial-stream controller for every chat view. New chats use create then messages; legacy start/fallback/restore endpoints are removed. Network uncertainty requires explicit saved-history inspection, never hidden resend or stream reconnect. Existing Runner conversations remain read-only in the switched UI. Ordinary configuration snapshots and custom server tools use `agentsToken.onlineAgent`; see [OnlineAgent chats and business tools](online-agent.md) for configuration, server examples and browser integration.
@@ -8,14 +8,16 @@ On the App's own pages, `VariablesSection` from `client/kit` edits a scope's var
8
8
 
9
9
  ## The skill library
10
10
 
11
- Skills (`agSkills`) follow the open Agent Skills format: a directory with `SKILL.md` (front matter `name` and `description` required) and supporting files under `scripts/`, `references/` and `assets/`. Every save is a version runs get at once; saves name the revision they were made against and conflict with 409 `REVISION_CONFLICT`. Skills are attached to agents, and as defaults to a working directory or a registered scope (`DefaultSkillsSection` in `client/kit`). Runner agents may run a skill's scripts; online agents only read them. File contents go to the Drive disk `agents.skills.disk` names. See the README's "What it does" (Skills) and "Configuration" sections.
11
+ Skills (`agSkills`) follow the open Agent Skills format: a directory with `SKILL.md` (front matter `name` and `description` required) and supporting files under `scripts/`, `references/` and `assets/`. Every save is a version runs get at once; saves name the revision they were made against and conflict with 409 `REVISION_CONFLICT`. Skills are attached to the fixed `global/default` target, a registered application scope, or a working directory (`DefaultSkillsSection` in `client/kit`). Agents may run a skill's scripts. File contents go to the Drive disk `agents.skills.disk` names. See the README's "What it does" (Skills) and "Configuration" sections.
12
12
 
13
- Skills the App's CLI ships (`nocobase.cli.skills`) reach every runner run beside the run's own; `online.skills.register` does the same for online runs.
13
+ Every run merges global → application scopes → workdir; later targets override the same slug. `skill attachment get/set global default` requires `agents.agents` read/manage for reading and manage for writing. An empty `skillIds` array clears the target. Agent skill attachments are refused and legacy rows are ignored; agent variables remain supported. `global` is reserved and cannot be registered as an application scope or used for variables. Global changes affect subsequent claims and their existing skill fingerprint; no runner protocol change is needed.
14
+
15
+ Skills the App's CLI ships (`nocobase.cli.skills`) reach every run beside the run's own.
14
16
 
15
17
  ## Chat attachments
16
18
 
17
- A person may send files with a message: each is uploaded first (`POST /api/agents/chatAttachments`, one file, stored through the file plugin), readable only by its uploader until sent, then sent with the message (`attachmentIds`). After that only the conversation's owner and a run of its agent on that conversation read it. A runner agent downloads a file with the CLI (`conversation attachment download <file-id>`); an online agent is shown the images and only the names of the rest. Uploads never sent are purged. Size and count limits are the `CHAT_ATTACHMENT_*` constants in `@nocobase/app-plugin-agents/shared/conversations`, whose header comment is the contract.
19
+ A person may send files with a message: each is uploaded first (`POST /api/agents/chatAttachments`, one file, stored through the file plugin), readable only by its uploader until sent, then sent with the message (`attachmentIds`). After that only the conversation's owner and a run of its agent on that conversation read it. The agent downloads a file with the CLI (`conversation attachment download <file-id>`). Uploads never sent are purged. Size and count limits are the `CHAT_ATTACHMENT_*` constants in `@nocobase/app-plugin-agents/shared/conversations`, whose header comment is the contract.
18
20
 
19
21
  ## Usage, prices and reports
20
22
 
21
- Every run records what it used (tokens per model and tool) as it reports. The Usage page (`usageRoute`, `GET /api/agents/usage`) groups it by agent, person, group, subject, day, model, tool or type; who reads `agents.prices` sets prices on its prices sheet, and costs are computed from them. Model calls outside runs (embeddings, reranking, short generations through `online.gateway`) appear as "Other model use" (`GET /api/agents/usage/models`). The App's own report pages read `reporting.usage`, `reporting.runFigures`, `reporting.range` and `reporting.modelUsage` from `agentsToken`, and each subject kind's `reports.describe` labels and groups its runs.
23
+ Every run records what it used (tokens per model and tool) as it reports. The Usage page (`usageRoute`, `GET /api/agents/usage`) groups it by agent, person, group, subject, day, model, tool or type; who reads `agents.prices` sets prices on its prices sheet, and costs are computed from them. Model calls outside runs (embeddings, reranking, short generations through `models.gateway`) appear as "Other model use" (`GET /api/agents/usage/models`). The App's own report pages read `reporting.usage`, `reporting.runFigures`, `reporting.range` and `reporting.modelUsage` from `agentsToken`, and each subject kind's `reports.describe` labels and groups its runs.