@nocobase/app-plugin-agents 1.0.0-beta.20 → 1.0.0-beta.22

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 (363) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +72 -12
  3. package/dist/cli/runner-token.js +1 -1
  4. package/dist/cli/runner-token.js.map +1 -1
  5. package/dist/client/chat/agent-mode.d.ts +47 -0
  6. package/dist/client/chat/agent-mode.d.ts.map +1 -0
  7. package/dist/client/chat/agent-mode.js +78 -0
  8. package/dist/client/chat/agent-mode.js.map +1 -0
  9. package/dist/client/chat/api.d.ts +2 -1
  10. package/dist/client/chat/api.d.ts.map +1 -1
  11. package/dist/client/chat/api.js +21 -5
  12. package/dist/client/chat/api.js.map +1 -1
  13. package/dist/client/chat/controller.d.ts +26 -0
  14. package/dist/client/chat/controller.d.ts.map +1 -1
  15. package/dist/client/chat/controller.js +328 -7
  16. package/dist/client/chat/controller.js.map +1 -1
  17. package/dist/client/chat/message-model.d.ts +10 -3
  18. package/dist/client/chat/message-model.d.ts.map +1 -1
  19. package/dist/client/chat/message-model.js +32 -4
  20. package/dist/client/chat/message-model.js.map +1 -1
  21. package/dist/client/chat/panel-state.d.ts +3 -0
  22. package/dist/client/chat/panel-state.d.ts.map +1 -1
  23. package/dist/client/chat/panel-state.js +4 -6
  24. package/dist/client/chat/panel-state.js.map +1 -1
  25. package/dist/client/chat/provider.d.ts +13 -2
  26. package/dist/client/chat/provider.d.ts.map +1 -1
  27. package/dist/client/chat/provider.js +25 -2
  28. package/dist/client/chat/provider.js.map +1 -1
  29. package/dist/client/chat/use-chat.d.ts +8 -1
  30. package/dist/client/chat/use-chat.d.ts.map +1 -1
  31. package/dist/client/chat/use-chat.js +28 -4
  32. package/dist/client/chat/use-chat.js.map +1 -1
  33. package/dist/client/chat/use-conversation-model.d.ts +4 -1
  34. package/dist/client/chat/use-conversation-model.d.ts.map +1 -1
  35. package/dist/client/chat/use-conversation-model.js +4 -3
  36. package/dist/client/chat/use-conversation-model.js.map +1 -1
  37. package/dist/client/chat.d.ts +6 -0
  38. package/dist/client/chat.d.ts.map +1 -1
  39. package/dist/client/chat.js +2 -0
  40. package/dist/client/chat.js.map +1 -1
  41. package/dist/client/components/command-line.d.ts +2 -1
  42. package/dist/client/components/command-line.d.ts.map +1 -1
  43. package/dist/client/components/command-line.js +2 -2
  44. package/dist/client/components/command-line.js.map +1 -1
  45. package/dist/client/components/variables/variable-dialogs.js +2 -2
  46. package/dist/client/components/variables/variable-dialogs.js.map +1 -1
  47. package/dist/client/lib/install.d.ts +3 -3
  48. package/dist/client/lib/install.d.ts.map +1 -1
  49. package/dist/client/lib/install.js +3 -5
  50. package/dist/client/lib/install.js.map +1 -1
  51. package/dist/client/lib/runner-tools.d.ts +4 -0
  52. package/dist/client/lib/runner-tools.d.ts.map +1 -0
  53. package/dist/client/lib/runner-tools.js +5 -0
  54. package/dist/client/lib/runner-tools.js.map +1 -0
  55. package/dist/client/locales/chat.en-US.d.ts +17 -0
  56. package/dist/client/locales/chat.en-US.d.ts.map +1 -1
  57. package/dist/client/locales/chat.en-US.js +17 -0
  58. package/dist/client/locales/chat.en-US.js.map +1 -1
  59. package/dist/client/locales/chat.zh-CN.d.ts.map +1 -1
  60. package/dist/client/locales/chat.zh-CN.js +17 -0
  61. package/dist/client/locales/chat.zh-CN.js.map +1 -1
  62. package/dist/client/locales/de-DE.d.ts.map +1 -1
  63. package/dist/client/locales/de-DE.js +8 -1
  64. package/dist/client/locales/de-DE.js.map +1 -1
  65. package/dist/client/locales/en-US.js +9 -9
  66. package/dist/client/locales/en-US.js.map +1 -1
  67. package/dist/client/locales/es-ES.d.ts.map +1 -1
  68. package/dist/client/locales/es-ES.js +8 -1
  69. package/dist/client/locales/es-ES.js.map +1 -1
  70. package/dist/client/locales/fr-FR.d.ts.map +1 -1
  71. package/dist/client/locales/fr-FR.js +8 -1
  72. package/dist/client/locales/fr-FR.js.map +1 -1
  73. package/dist/client/locales/id-ID.d.ts.map +1 -1
  74. package/dist/client/locales/id-ID.js +8 -1
  75. package/dist/client/locales/id-ID.js.map +1 -1
  76. package/dist/client/locales/ja-JP.d.ts.map +1 -1
  77. package/dist/client/locales/ja-JP.js +8 -1
  78. package/dist/client/locales/ja-JP.js.map +1 -1
  79. package/dist/client/locales/pt-BR.d.ts.map +1 -1
  80. package/dist/client/locales/pt-BR.js +8 -1
  81. package/dist/client/locales/pt-BR.js.map +1 -1
  82. package/dist/client/locales/runWait.en-US.js +1 -1
  83. package/dist/client/locales/runWait.en-US.js.map +1 -1
  84. package/dist/client/locales/runWait.zh-CN.js +1 -1
  85. package/dist/client/locales/runtimes.en-US.d.ts +10 -1
  86. package/dist/client/locales/runtimes.en-US.d.ts.map +1 -1
  87. package/dist/client/locales/runtimes.en-US.js +18 -9
  88. package/dist/client/locales/runtimes.en-US.js.map +1 -1
  89. package/dist/client/locales/runtimes.zh-CN.d.ts.map +1 -1
  90. package/dist/client/locales/runtimes.zh-CN.js +18 -9
  91. package/dist/client/locales/runtimes.zh-CN.js.map +1 -1
  92. package/dist/client/locales/vi-VN.d.ts.map +1 -1
  93. package/dist/client/locales/vi-VN.js +8 -1
  94. package/dist/client/locales/vi-VN.js.map +1 -1
  95. package/dist/client/locales/zh-CN.js +9 -9
  96. package/dist/client/locales/zh-CN.js.map +1 -1
  97. package/dist/client/locales/zh-TW.d.ts.map +1 -1
  98. package/dist/client/locales/zh-TW.js +8 -1
  99. package/dist/client/locales/zh-TW.js.map +1 -1
  100. package/dist/client/online/service-editor.js +6 -1
  101. package/dist/client/online/service-editor.js.map +1 -1
  102. package/dist/client/pages/runtimes/connect.js +18 -8
  103. package/dist/client/pages/runtimes/connect.js.map +1 -1
  104. package/dist/client/pages/runtimes/index.js +1 -1
  105. package/dist/client/pages/runtimes/runner-overview.d.ts.map +1 -1
  106. package/dist/client/pages/runtimes/runner-overview.js +3 -2
  107. package/dist/client/pages/runtimes/runner-overview.js.map +1 -1
  108. package/dist/client/pages/usage/prices/model.d.ts +1 -1
  109. package/dist/client/pages/usage/prices/model.js +1 -1
  110. package/dist/client/plugin.js +1 -1
  111. package/dist/client/plugin.js.map +1 -1
  112. package/dist/client/routes.d.ts +1 -1
  113. package/dist/database/migrations/.manifest.json +4 -0
  114. package/dist/database/migrations/202610290001_ag_repair_runner_agents.d.ts +5 -0
  115. package/dist/database/migrations/202610290001_ag_repair_runner_agents.d.ts.map +1 -0
  116. package/dist/database/migrations/202610290001_ag_repair_runner_agents.js +72 -0
  117. package/dist/database/migrations/202610290001_ag_repair_runner_agents.js.map +1 -0
  118. package/dist/package.json +18 -1
  119. package/dist/server/composition.d.ts +2 -0
  120. package/dist/server/composition.d.ts.map +1 -1
  121. package/dist/server/composition.js +13 -3
  122. package/dist/server/composition.js.map +1 -1
  123. package/dist/server/core/agents/agent.store.d.ts +5 -3
  124. package/dist/server/core/agents/agent.store.d.ts.map +1 -1
  125. package/dist/server/core/agents/agent.store.js +25 -6
  126. package/dist/server/core/agents/agent.store.js.map +1 -1
  127. package/dist/server/core/conversations/attachments.d.ts +1 -1
  128. package/dist/server/core/conversations/attachments.d.ts.map +1 -1
  129. package/dist/server/core/conversations/attachments.js +2 -2
  130. package/dist/server/core/conversations/attachments.js.map +1 -1
  131. package/dist/server/core/conversations/availability.d.ts +1 -1
  132. package/dist/server/core/conversations/conversation.service.d.ts.map +1 -1
  133. package/dist/server/core/conversations/conversation.service.js +7 -0
  134. package/dist/server/core/conversations/conversation.service.js.map +1 -1
  135. package/dist/server/core/runs/claim.js +6 -6
  136. package/dist/server/core/runs/claim.js.map +1 -1
  137. package/dist/server/core/runs/eligibility.d.ts +3 -3
  138. package/dist/server/core/runs/eligibility.d.ts.map +1 -1
  139. package/dist/server/core/runs/run-requests.js +1 -1
  140. package/dist/server/core/runs/run-requests.js.map +1 -1
  141. package/dist/server/core/runs/run.service.d.ts +1 -1
  142. package/dist/server/core/runs/run.store.d.ts +1 -1
  143. package/dist/server/core/runs/run.store.d.ts.map +1 -1
  144. package/dist/server/core/runs/workload.js +1 -1
  145. package/dist/server/core/runs/workload.js.map +1 -1
  146. package/dist/server/core/variables/variable.service.d.ts +2 -2
  147. package/dist/server/core/variables/variable.service.js +1 -1
  148. package/dist/server/core/variables/variable.service.js.map +1 -1
  149. package/dist/server/index.d.ts +3 -0
  150. package/dist/server/index.d.ts.map +1 -1
  151. package/dist/server/index.js +1 -0
  152. package/dist/server/index.js.map +1 -1
  153. package/dist/server/jobs/job.service.d.ts +1 -1
  154. package/dist/server/jobs/job.service.js +1 -1
  155. package/dist/server/jobs/spec.d.ts +1 -1
  156. package/dist/server/jobs/spec.d.ts.map +1 -1
  157. package/dist/server/jobs/spec.js +2 -2
  158. package/dist/server/jobs/spec.js.map +1 -1
  159. package/dist/server/kernel/events.d.ts +9 -0
  160. package/dist/server/kernel/events.d.ts.map +1 -1
  161. package/dist/server/kernel/events.js.map +1 -1
  162. package/dist/server/online/agent/configuration.d.ts +2 -0
  163. package/dist/server/online/agent/configuration.d.ts.map +1 -1
  164. package/dist/server/online/agent/configuration.js +21 -2
  165. package/dist/server/online/agent/configuration.js.map +1 -1
  166. package/dist/server/online/agent/contracts.d.ts +5 -3
  167. package/dist/server/online/agent/contracts.d.ts.map +1 -1
  168. package/dist/server/online/agent/index.d.ts +1 -0
  169. package/dist/server/online/agent/index.d.ts.map +1 -1
  170. package/dist/server/online/agent/index.js.map +1 -1
  171. package/dist/server/online/agent/messages/projection.d.ts.map +1 -1
  172. package/dist/server/online/agent/messages/projection.js +3 -0
  173. package/dist/server/online/agent/messages/projection.js.map +1 -1
  174. package/dist/server/online/agent/messages/resend.d.ts +7 -0
  175. package/dist/server/online/agent/messages/resend.d.ts.map +1 -0
  176. package/dist/server/online/agent/messages/resend.js +58 -0
  177. package/dist/server/online/agent/messages/resend.js.map +1 -0
  178. package/dist/server/online/agent/native/backend.d.ts +6 -0
  179. package/dist/server/online/agent/native/backend.d.ts.map +1 -1
  180. package/dist/server/online/agent/native/backend.js +17 -24
  181. package/dist/server/online/agent/native/backend.js.map +1 -1
  182. package/dist/server/online/agent/native/execution.d.ts +8 -12
  183. package/dist/server/online/agent/native/execution.d.ts.map +1 -1
  184. package/dist/server/online/agent/native/execution.js +89 -17
  185. package/dist/server/online/agent/native/execution.js.map +1 -1
  186. package/dist/server/online/agent/native/session.d.ts +2 -0
  187. package/dist/server/online/agent/native/session.d.ts.map +1 -1
  188. package/dist/server/online/agent/native/session.js +11 -0
  189. package/dist/server/online/agent/native/session.js.map +1 -1
  190. package/dist/server/online/agent/native/types.d.ts +20 -0
  191. package/dist/server/online/agent/native/types.d.ts.map +1 -1
  192. package/dist/server/online/agent/persistence/manager.d.ts +1 -2
  193. package/dist/server/online/agent/persistence/manager.d.ts.map +1 -1
  194. package/dist/server/online/agent/persistence/manager.js +0 -7
  195. package/dist/server/online/agent/persistence/manager.js.map +1 -1
  196. package/dist/server/online/agent/persistence/store.d.ts +25 -7
  197. package/dist/server/online/agent/persistence/store.d.ts.map +1 -1
  198. package/dist/server/online/agent/persistence/store.js +165 -47
  199. package/dist/server/online/agent/persistence/store.js.map +1 -1
  200. package/dist/server/online/agent/runner/backend.d.ts +1 -0
  201. package/dist/server/online/agent/runner/backend.d.ts.map +1 -1
  202. package/dist/server/online/agent/runner/backend.js +3 -0
  203. package/dist/server/online/agent/runner/backend.js.map +1 -1
  204. package/dist/server/online/agent/service.d.ts +4 -0
  205. package/dist/server/online/agent/service.d.ts.map +1 -1
  206. package/dist/server/online/agent/service.js +2 -0
  207. package/dist/server/online/agent/service.js.map +1 -1
  208. package/dist/server/online/agent/types.d.ts +5 -0
  209. package/dist/server/online/agent/types.d.ts.map +1 -1
  210. package/dist/server/online/agent/web-search.d.ts +13 -0
  211. package/dist/server/online/agent/web-search.d.ts.map +1 -0
  212. package/dist/server/online/agent/web-search.js +65 -0
  213. package/dist/server/online/agent/web-search.js.map +1 -0
  214. package/dist/server/online/files/cache.d.ts +19 -0
  215. package/dist/server/online/files/cache.d.ts.map +1 -0
  216. package/dist/server/online/files/cache.js +52 -0
  217. package/dist/server/online/files/cache.js.map +1 -0
  218. package/dist/server/online/files/errors.d.ts +8 -0
  219. package/dist/server/online/files/errors.d.ts.map +1 -0
  220. package/dist/server/online/files/errors.js +14 -0
  221. package/dist/server/online/files/errors.js.map +1 -0
  222. package/dist/server/online/files/input.d.ts +23 -0
  223. package/dist/server/online/files/input.d.ts.map +1 -0
  224. package/dist/server/online/files/input.js +129 -0
  225. package/dist/server/online/files/input.js.map +1 -0
  226. package/dist/server/online/files/kimi.d.ts +11 -0
  227. package/dist/server/online/files/kimi.d.ts.map +1 -0
  228. package/dist/server/online/files/kimi.js +177 -0
  229. package/dist/server/online/files/kimi.js.map +1 -0
  230. package/dist/server/online/files/profiles.d.ts +13 -0
  231. package/dist/server/online/files/profiles.d.ts.map +1 -0
  232. package/dist/server/online/files/profiles.js +124 -0
  233. package/dist/server/online/files/profiles.js.map +1 -0
  234. package/dist/server/online/files/service.d.ts +35 -0
  235. package/dist/server/online/files/service.d.ts.map +1 -0
  236. package/dist/server/online/files/service.js +174 -0
  237. package/dist/server/online/files/service.js.map +1 -0
  238. package/dist/server/online/files/types.d.ts +32 -0
  239. package/dist/server/online/files/types.d.ts.map +1 -0
  240. package/dist/server/online/files/types.js +2 -0
  241. package/dist/server/online/files/types.js.map +1 -0
  242. package/dist/server/online/gateway.d.ts +13 -0
  243. package/dist/server/online/gateway.d.ts.map +1 -1
  244. package/dist/server/online/gateway.js +116 -2
  245. package/dist/server/online/gateway.js.map +1 -1
  246. package/dist/server/online/index.d.ts +1 -1
  247. package/dist/server/online/index.d.ts.map +1 -1
  248. package/dist/server/online/index.js.map +1 -1
  249. package/dist/server/online/providers.d.ts +6 -0
  250. package/dist/server/online/providers.d.ts.map +1 -1
  251. package/dist/server/online/providers.js +29 -1
  252. package/dist/server/online/providers.js.map +1 -1
  253. package/dist/server/online/search/alibaba.d.ts +10 -0
  254. package/dist/server/online/search/alibaba.d.ts.map +1 -0
  255. package/dist/server/online/search/alibaba.js +34 -0
  256. package/dist/server/online/search/alibaba.js.map +1 -0
  257. package/dist/server/online/search/anthropic.d.ts +12 -0
  258. package/dist/server/online/search/anthropic.d.ts.map +1 -0
  259. package/dist/server/online/search/anthropic.js +62 -0
  260. package/dist/server/online/search/anthropic.js.map +1 -0
  261. package/dist/server/online/search/budget.d.ts +13 -0
  262. package/dist/server/online/search/budget.d.ts.map +1 -0
  263. package/dist/server/online/search/budget.js +63 -0
  264. package/dist/server/online/search/budget.js.map +1 -0
  265. package/dist/server/online/search/capabilities.d.ts +7 -0
  266. package/dist/server/online/search/capabilities.d.ts.map +1 -0
  267. package/dist/server/online/search/capabilities.js +90 -0
  268. package/dist/server/online/search/capabilities.js.map +1 -0
  269. package/dist/server/online/search/contracts.d.ts +20 -0
  270. package/dist/server/online/search/contracts.d.ts.map +1 -0
  271. package/dist/server/online/search/contracts.js +2 -0
  272. package/dist/server/online/search/contracts.js.map +1 -0
  273. package/dist/server/online/search/google.d.ts +12 -0
  274. package/dist/server/online/search/google.d.ts.map +1 -0
  275. package/dist/server/online/search/google.js +51 -0
  276. package/dist/server/online/search/google.js.map +1 -0
  277. package/dist/server/online/search/openai.d.ts +18 -0
  278. package/dist/server/online/search/openai.d.ts.map +1 -0
  279. package/dist/server/online/search/openai.js +51 -0
  280. package/dist/server/online/search/openai.js.map +1 -0
  281. package/dist/server/online/search/prompts.d.ts +5 -0
  282. package/dist/server/online/search/prompts.d.ts.map +1 -0
  283. package/dist/server/online/search/prompts.js +28 -0
  284. package/dist/server/online/search/prompts.js.map +1 -0
  285. package/dist/server/online/search/results.d.ts +2 -0
  286. package/dist/server/online/search/results.d.ts.map +1 -0
  287. package/dist/server/online/search/results.js +2 -0
  288. package/dist/server/online/search/results.js.map +1 -0
  289. package/dist/server/online/services.d.ts +2 -0
  290. package/dist/server/online/services.d.ts.map +1 -1
  291. package/dist/server/online/services.js +17 -2
  292. package/dist/server/online/services.js.map +1 -1
  293. package/dist/server/providers/agents.d.ts +1 -0
  294. package/dist/server/providers/agents.d.ts.map +1 -1
  295. package/dist/server/providers/agents.js +12 -0
  296. package/dist/server/providers/agents.js.map +1 -1
  297. package/dist/server/providers/authorization.d.ts +2 -2
  298. package/dist/server/providers/authorization.js +2 -2
  299. package/dist/server/routes/admin.js +3 -3
  300. package/dist/server/routes/admin.js.map +1 -1
  301. package/dist/server/routes/chat.d.ts.map +1 -1
  302. package/dist/server/routes/chat.js +34 -1
  303. package/dist/server/routes/chat.js.map +1 -1
  304. package/dist/server/routes/run-requests.js +1 -1
  305. package/dist/server/routes/run-requests.js.map +1 -1
  306. package/dist/server/routes/runners/admin.js +6 -6
  307. package/dist/server/routes/runners/admin.js.map +1 -1
  308. package/dist/server/routes/runners/install.js +1 -1
  309. package/dist/server/routes/schemas.d.ts +3 -0
  310. package/dist/server/routes/schemas.d.ts.map +1 -1
  311. package/dist/server/routes/schemas.js +25 -6
  312. package/dist/server/routes/schemas.js.map +1 -1
  313. package/dist/server/runners/runner.service.js +1 -1
  314. package/dist/server/vendor/just-bash.js +117 -117
  315. package/dist/shared/access.d.ts +2 -2
  316. package/dist/shared/access.js +2 -2
  317. package/dist/shared/agents.d.ts +2 -2
  318. package/dist/shared/agents.d.ts.map +1 -1
  319. package/dist/shared/conversations.d.ts +13 -1
  320. package/dist/shared/conversations.d.ts.map +1 -1
  321. package/dist/shared/conversations.js.map +1 -1
  322. package/dist/shared/file-input-failures.d.ts +5 -0
  323. package/dist/shared/file-input-failures.d.ts.map +1 -0
  324. package/dist/shared/file-input-failures.js +20 -0
  325. package/dist/shared/file-input-failures.js.map +1 -0
  326. package/dist/shared/locales/access.en-US.js +3 -3
  327. package/dist/shared/locales/access.en-US.js.map +1 -1
  328. package/dist/shared/locales/access.zh-CN.js +3 -3
  329. package/dist/shared/locales/access.zh-CN.js.map +1 -1
  330. package/dist/shared/models.d.ts +11 -0
  331. package/dist/shared/models.d.ts.map +1 -1
  332. package/dist/shared/models.js.map +1 -1
  333. package/dist/shared/resend.d.ts +10 -0
  334. package/dist/shared/resend.d.ts.map +1 -0
  335. package/dist/shared/resend.js +2 -0
  336. package/dist/shared/resend.js.map +1 -0
  337. package/dist/shared/runners.d.ts +4 -4
  338. package/dist/shared/runners.d.ts.map +1 -1
  339. package/dist/shared/runners.js +2 -2
  340. package/dist/shared/runs.d.ts +5 -5
  341. package/dist/shared/runs.d.ts.map +1 -1
  342. package/dist/shared/runs.js +1 -1
  343. package/dist/shared/variables.d.ts +3 -3
  344. package/dist/shared/variables.d.ts.map +1 -1
  345. package/dist/shared/variables.js +1 -1
  346. package/dist/shared/web-search-results.d.ts +16 -0
  347. package/dist/shared/web-search-results.d.ts.map +1 -0
  348. package/dist/shared/web-search-results.js +103 -0
  349. package/dist/shared/web-search-results.js.map +1 -0
  350. package/dist/shared/web-search.d.ts +40 -0
  351. package/dist/shared/web-search.d.ts.map +1 -0
  352. package/dist/shared/web-search.js +15 -0
  353. package/dist/shared/web-search.js.map +1 -0
  354. package/docs/execution-history.md +1 -1
  355. package/docs/message-resend.md +39 -0
  356. package/docs/native-web-search.md +76 -0
  357. package/docs/runner-agents.md +3 -3
  358. package/docs/ui-message-clients.md +7 -1
  359. package/package.json +11 -2
  360. package/skills/nocobase-app-plugin-agents/SKILL.md +9 -2
  361. package/skills/nocobase-app-plugin-agents/references/extension-points.md +1 -1
  362. package/skills/nocobase-app-plugin-agents/references/online-agent.md +9 -1
  363. package/skills/nocobase-app-plugin-agents/references/runners.md +7 -3
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: nocobase-app-plugin-agents
3
- description: Register the Agents plugin in a NocoBase App and configure it (agents.* in config.yml), contribute subjects, scopes, business actions, agent defaults, the App's own agents, CLI commands and reports through agentsToken, enable the agents discovered from runners, configure OnlineAgentService and OnlineAgentConfigurator for SDK chats and business tools, set up model services for the App's own model calls, connect runners (registration tokens, protocol, upgrade_required), build and serve the CLI and runner tarballs (pnpm nocobase cli build, --runner), or work out why a run, a runner or a model fails.
3
+ description: Register the Agents plugin in a NocoBase App and configure it (agents.* in config.yml), contribute subjects, scopes, business actions, agent defaults, the App's own agents, CLI commands and reports through agentsToken, enable the agents discovered from runners, configure OnlineAgentService and OnlineAgentConfigurator for SDK chats, business tools and native web search, set up model services for the App's own model calls, connect runners (registration tokens, protocol, upgrade_required), build and serve the CLI and runner tarballs (pnpm nocobase cli build, --runner), or work out why a run, a runner or a model fails.
4
4
  metadata:
5
5
  short-description: Agents, runners, model services and their distribution
6
6
  ---
@@ -13,10 +13,16 @@ The package README is the full reference: read it at `node_modules/@nocobase/app
13
13
 
14
14
  ## Key rules
15
15
 
16
- - Runner tool selection is server-owned and explicit. New registrations default to Codex and Claude Code; additional catalog tools must be selected. Native adapters take precedence over ACP. Owners manage personal tools, and runner managers may also manage team tools. Unknown tools and custom launch commands are not supported. See the README’s “Selecting runner tools and ACP agents” for protocol upgrades, detection triggers and default-model behavior.
16
+ - Runner tool selection is server-owned and explicit. New registrations default to Codex and Claude Code; additional catalog tools must be selected. Native adapters take precedence over ACP. Owners manage personal tools, and runner managers may also manage shared tools. Unknown tools and custom launch commands are not supported. See the README’s “Selecting runner tools and ACP agents” for protocol upgrades, detection triggers and default-model behavior.
17
17
 
18
18
  - The plugin knows no business of its own. Subjects, scopes, business actions, the instructions and actions every discovered agent gets, CLI commands and report pages are the App's, contributed through `agentsToken` from `@nocobase/app-plugin-agents/server/tokens` when the App's providers boot. With nothing contributed, agents still work in conversations.
19
19
  - Nobody creates agents: each coding tool and model a runner reports becomes one, pending until someone who manages agents writes what it is good at and enables it. Only enabled agents get work, and only on a runner that is online, has the agent's tool signed in with its model, and whose owner's local policy lets it take the work. The `agentsToken.onlineAgent` service selects native SDK execution or an explicitly chosen Runner Agent through one realtime conversation contract. Native execution runs registered business tools directly through the SDK; Runner chat uses the existing queue and canonical history. The original chat API and shared browser controller use this service, and never silently change executors. Read [OnlineAgent chats and business tools](references/online-agent.md) to configure that service and its `OnlineAgentConfigurator`.
20
+ - Native files follow legacy Provider defaults: OpenAI/Anthropic/Google/OpenAI-compatible forward PDFs and images, Alibaba forwards images and extracts document text locally, and Moonshot forwards images and uploads supported documents to its selected Kimi Files service automatically. Ollama images remain native; PDF and other supported documents use local text extraction by default, not failure-triggered fallback. DeepSeek/Cohere retain local document extraction and do not forward undeclared images; existing exact profiles still override defaults. Read the package README's **Native document inputs** before configuring exact service/model/Provider/protocol/base URL overrides. Never promote extracted content above the user role, or silently change routes after failure.
21
+ - Unsupported user attachments must not terminate the conversation: replace only the model replay file part with an untrusted filename/MIME/controlled-limitation description, explicitly stating that the contents were not parsed. Apply the same policy to historical follow-up and explicit extractor `unsupported` results; never forward unsupported bytes, guess contents, persist the description as an original message or cache it as extracted text. Keep authorization, inline validation, format-mismatch, budget, cancellation and actual parsing/Provider failures unchanged.
22
+ - Local DOCX text extraction omits embedded binary images before budgeting; it does not perform OCR. Image-only documents fail as unreadable. Do not raise text limits to accommodate base64 image data or change Knowledge's default image representation.
23
+ - File preparation failures expose only controlled reason codes in execution-status notice params, with fixed fallback titles and viewer-localized wording. Keep parser/Provider errors and credentials private; never infer a historical failure reason from current model configuration or turn Stop into a failure.
24
+ - Local document cache hits still reauthorize and read current bytes; cache keys isolate users, sources and extractor instances. Historical/native/reference inputs count toward execution budgets; declare a verified lower native count through profile `maxNativeFiles` when the Provider requires it. Model changes and approvals rebuild replay copies from originals. Stop waits for file-stream cancellation and Worker termination; retryFinalization does not repeat extraction or tools.
25
+ - Kimi Files extraction is automatic for Moonshot; OpenAI-compatible services require an exact remote profile. An exact local profile opts out for a Moonshot model. Use the selected service's saved API key and bound endpoint, never a model-name heuristic, environment-key fallback or second service. Native support skips upload; remote results are execution-only. Upload/content have one five-minute deadline, while DELETE has an independent five-second cleanup window awaited by Stop/shutdown. Lost upload IDs and failed DELETE can leave remote objects; log only sanitized diagnostics. Read the README's **Kimi extraction and exact overrides** section.
20
26
  - Native Skills and bash are opt-in server scope capabilities, not a Runner or default global tool set. Read [Native Skills and application CLI](../../docs/native-sandbox.md) before enabling them. Use `context.execution` only inside the current tool invocation, forward `context.signal`, and never retry unknown writes or restore approval-time `/tmp`.
21
27
  - Variables and model service keys are sealed with the App's secrets service: configure `secrets.keys` before storing any, or the API answers `SECRETS_KEY_MISSING` (503).
22
28
  - The plugin registers no pages. The App routes the exported pages and mounts the chat; the App also binds `agentsAccessToken`, or every business action level is `none`.
@@ -32,6 +38,7 @@ The package README is the full reference: read it at `node_modules/@nocobase/app
32
38
  | Contribute subjects, scopes, actions, agent defaults, the App's own agents, CLI commands, people, reports, mounts | [Extension points](references/extension-points.md) |
33
39
  | Agents discovered from runners, the model catalog, enabling agents, availability, the App's own agents | [Agents](references/agents.md) |
34
40
  | Configure OnlineAgentService/OnlineAgentConfigurator, register SDK tools, use realtime/background sessions | [OnlineAgent chats and business tools](references/online-agent.md) |
41
+ | Enable native web search, verify platform admission, isolation, budgets and Registry upgrades | `node_modules/@nocobase/app-plugin-agents/docs/native-web-search.md` |
35
42
  | Open JSON UI context, custom SDK tool cards, generic form adapters and safe browser-draft application | [UI context, tool cards and local form drafts](references/online-agent.md#open-ui-context-custom-tool-cards-and-local-form-drafts) |
36
43
  | Model services, the model gateway, vectors | [Model services](references/model-services.md) |
37
44
  | Register runners, how claims and heartbeats work, local policy, protocol and `upgrade_required` | [Runners](references/runners.md) |
@@ -29,7 +29,7 @@ Rules that are easy to miss:
29
29
  - `context.assemble`, brief sections and mounts run inside the claim's transaction and read the database through the claim's connection only (on SQLite it is the only connection). Read anything else in the provider's optional `prepare(run)`, which runs before the transaction. A throw leaves the run queued; three failures fail it `setupFailed`.
30
30
  - `runs.enqueue` takes an optional outer transaction; inside another plugin's transaction, publish the collected events after it commits.
31
31
  - When someone answers for the subject, pass `responsibleUserId` and the source (`requestedByUserId`, or `causedByRunId` for what a run did). Work another person causes then answers `outcome: 'pending'`: a run request only the responsible confirms (`runs.requests`, `/api/agents/runRequests`), unless `execution: 'mine'` runs it as the asker, which is refused with `NO_RUNNER_AVAILABLE` when no online runner would take the asker's work (`eligibility.canClaim` with the agent's variables). Both people must have agent access; identical pending snapshots are reused without renewing expiry. For mutable responsibility, bind `subjects.register({ …, responsibleUserId: (conn, subjectId) => … })` to read the current responsible using the supplied transaction connection, so old owners cannot confirm or reject before reassignment. Call `runs.requests.reassign` with each responsibility change; without a resolver this is the only protection against stale confirmation. If there is no usable new responsible, reassignment expires and notifies instead of dropping the work, preserving `runAsMe`. Forward `runRequest.*` events and `run_request_expired` notices to the App's inbox, and handle `outcome` before using a possibly null `runId`.
32
- - 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`.
32
+ - 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 shared runner. Enqueue itself does not refuse work run as the responsible or as whoever woke the agent: such work waits with `secretsNotAllowed`.
33
33
  - 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.
34
34
  - 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.
35
35
  - Name commands in a brief with `commandRef(cli, id, flag?)` rather than spelling them.
@@ -8,7 +8,7 @@ Use `OnlineAgentService` for SDK conversations that call application services an
8
8
 
9
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
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.
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`, `resend` 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
12
 
13
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
14
 
@@ -62,6 +62,13 @@ Replace `billing-models/chat` with an enabled chat model in the application's ex
62
62
 
63
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
64
 
65
+ ## Native web search
66
+
67
+ `webSearch` is an opt-in ordinary native tool selected through the existing configuration layers, effective-tool snapshot and idle configuration update. The server derives model capabilities, freezes the same main model for isolated retrieval, and rejects unsupported explicit enabling. Do not register a business tool with that reserved name or replace main conversation tools with provider-hosted search tools. Read `node_modules/@nocobase/app-plugin-agents/docs/native-web-search.md` for the provider-level admission and model compatibility, reasoning-off settings, cancellation and execution budgets, safe sources, Registry release gate and offline-versus-live verification boundary. Compatible/custom endpoints and providers without a search adapter remain unsupported; do not improvise a fallback.
68
+
69
+ The four provider adapters share a retrieval-only prompt: return concise facts and specific gaps for the main model, not a final answer or generic website recommendations. The main tool description batches non-overlapping queries and discourages similar repeats. Source records remain provider-evidence-derived, never reconstructed from prose; reference dates and locations are not automatically injected into the child.
70
+ Alibaba is admitted by platform through its existing Chat Completions SDK and an instance-scoped fetch that sets enable_search=true and search_options.forced_search=true only for the isolated search child. Unlike the other three adapters, it may return source-free text as status=unverified with an empty sources list. Disclose that search execution and freshness cannot be verified; never fabricate citations, classify it as verified success, or silently fall back to another model/protocol. Empty answers and provider errors still fail. The shared model/public projection and installed card preserve this distinction.
71
+
65
72
  ## Use a realtime session or a background result
66
73
 
67
74
  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.
@@ -121,6 +128,7 @@ Use `abort()` for explicit Stop. Native execution waits for terminal persistence
121
128
 
122
129
  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
130
 
131
+ Native realtime sessions can resend or text-edit an existing user message with `chat.resend({ messageId, input: { text } })`; omitted options select the latest saved user. Admission updates that message, permanently deletes its suffix and preserves original files/context. Completed business effects are not undone. Runner refuses this capability and Background does not expose it. Browser UI uses `useResendMessage` and the official SDK regenerate/edit flow, never an automatic retry of unknown admission. See [resend and edit](../../../docs/message-resend.md) for transaction, stream, authorization and recovery contracts.
124
132
  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
133
 
126
134
  Native public history and realtime streams include actual model-provided SDK reasoning, including previously saved parts. Expose only `type`/`text`/optional `state` in history and the SDK routing fields (`type`, `id`, and `delta` for reasoning deltas) in the stream; never expose provider metadata or signatures. Installed Registry/Examples render nonempty parts in order with sanitized Markdown, automatically open only the active streaming part and otherwise collapse by default. A user's manual choice wins for that mounted message/part across incremental updates, part end and history revisions. Reasoning counts as visible output, but does not become answer text, a search/copy value or an execution outcome. Models and Runner responses without genuine reasoning remain ordinary text-only chat.
@@ -12,7 +12,7 @@ A runner (shown as a runtime) is `nocobase-runner` from `@nocobase/agent-runner`
12
12
 
13
13
  A runner registers once per App with a one-time registration token (10 minutes):
14
14
 
15
- - On the web: Runtimes page, "Add runtime". It asks who the runner works for (personal, or team for who manages `agents.runners`), which coding tools it may run and its maximum concurrent runs, then shows the one-line install and the register command with a fresh token, and waits for the runner to connect.
15
+ - On the web: Runtimes page, "Add runtime". It asks the usage scope (personal, or shared for someone who manages `agents.runners`), which coding tools it may run and its maximum concurrent runs, then offers Prompt and Manual installation for macOS, Linux and Windows (WSL Ubuntu), with a fresh one-time registration token, and waits for the runner to connect.
16
16
  - Through the API: `POST /api/agents/runners/registrationTokens` (CLI: `runtime token create`).
17
17
  - From the App's checkout or deployment: `pnpm nocobase agents runner-token --trust team` or `--trust ownerOnly --owner <user id>`, optionally `--tools claude,codex`. It prints the token (`--json` for the envelope).
18
18
 
@@ -24,7 +24,11 @@ Registering again with the same owner, name and hostname revokes previous regist
24
24
 
25
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
26
 
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.
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 "Shared runtimes only" (`teamRunnersOnly`): a run that gets one goes to a shared runner. Their owner may share them with all users. `nocobase-runner unregister --server <url>` or "Revoke" on the Runtimes page ends a registration.
28
+
29
+ The Prompt option asks the host’s agent to check Node.js 24 and signed-in coding tools, use the one-time command to register and install the background service, resolve service PATH, proxy and npm global-permission issues without snap packages, and confirm the connection with `nocobase-runner status`. The Windows prompt first asks the agent to check that it is inside WSL Ubuntu. Otherwise it must stop and tell the user to run `wsl --install` in PowerShell, restart Windows, reopen the agent inside WSL Ubuntu and run the prompt again; only inside WSL may it continue. Install Node.js and the coding tools there too, and enable mirrored networking if WSL cannot reach the internet. Manual installation shows one command on macOS/Linux, or the PowerShell step followed by that same Linux command in Ubuntu on Windows.
30
+
31
+ Personal (`ownerOnly`) and shared (`team`) both need a VM or isolated environment: agents have full access and the runner is not a sandbox. If no coding tools are found, run `nocobase-runner service install` again from a terminal where `which codex` / `which claude` works, then restart the service (or rerun `nocobase-runner start`) to capture PATH.
28
32
 
29
33
  ## How work reaches a runner
30
34
 
@@ -59,4 +63,4 @@ For application-owned system agents, `useAgentOption(id)` in the client kit read
59
63
 
60
64
  ## Online capacity
61
65
 
62
- Each application's heartbeat supplies complete total and tool slots; updated runners count only that application's tasks and build jobs. Change capacity on the Runtimes page or the application's online CLI, never with local register/start flags. New registrations default to four slots. Old servers without this heartbeat field use legacy local values temporarily; status labels that source. No local values are uploaded. A configuration change wakes waiting claims and adds one confirmation heartbeat; shrinking never kills existing leases. Custom application projections and installed page copies must forward reportedSlots, capacitySource, capacityReportedAt and toolLoad, and show pending sync or last-report time. See the package README's effective runner slots section.
66
+ Each application's heartbeat supplies complete total and tool slots; updated runners count only that application's tasks and build jobs. Change capacity on the Runtimes page or the application's online CLI, never with local register/start flags. New registrations default to three slots. Old servers without this heartbeat field use legacy local values temporarily; status labels that source. No local values are uploaded. A configuration change wakes waiting claims and adds one confirmation heartbeat; shrinking never kills existing leases. Custom application projections and installed page copies must forward reportedSlots, capacitySource, capacityReportedAt and toolLoad, and show pending sync or last-report time. See the package README's effective runner slots section.