@nocobase/app-plugin-agents 1.0.0-beta.27 → 1.0.0-beta.28

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 (189) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +40 -22
  3. package/dist/client/chat/api.d.ts +18 -1
  4. package/dist/client/chat/api.d.ts.map +1 -1
  5. package/dist/client/chat/api.js +37 -0
  6. package/dist/client/chat/api.js.map +1 -1
  7. package/dist/client/chat/coalesced-invalidation.d.ts +15 -0
  8. package/dist/client/chat/coalesced-invalidation.d.ts.map +1 -0
  9. package/dist/client/chat/coalesced-invalidation.js +29 -0
  10. package/dist/client/chat/coalesced-invalidation.js.map +1 -0
  11. package/dist/client/chat/controller.d.ts +8 -1
  12. package/dist/client/chat/controller.d.ts.map +1 -1
  13. package/dist/client/chat/controller.js +21 -0
  14. package/dist/client/chat/controller.js.map +1 -1
  15. package/dist/client/chat/message-model.d.ts.map +1 -1
  16. package/dist/client/chat/message-model.js +4 -0
  17. package/dist/client/chat/message-model.js.map +1 -1
  18. package/dist/client/chat/submissions.d.ts +3 -0
  19. package/dist/client/chat/submissions.d.ts.map +1 -1
  20. package/dist/client/chat/submissions.js +1 -0
  21. package/dist/client/chat/submissions.js.map +1 -1
  22. package/dist/client/chat/use-chat-scroll.d.ts +8 -1
  23. package/dist/client/chat/use-chat-scroll.d.ts.map +1 -1
  24. package/dist/client/chat/use-chat-scroll.js +29 -5
  25. package/dist/client/chat/use-chat-scroll.js.map +1 -1
  26. package/dist/client/chat/use-chat.d.ts +2 -0
  27. package/dist/client/chat/use-chat.d.ts.map +1 -1
  28. package/dist/client/chat/use-chat.js +17 -7
  29. package/dist/client/chat/use-chat.js.map +1 -1
  30. package/dist/client/components/agent-prompt-callout.d.ts +19 -0
  31. package/dist/client/components/agent-prompt-callout.d.ts.map +1 -0
  32. package/dist/client/components/agent-prompt-callout.js +28 -0
  33. package/dist/client/components/agent-prompt-callout.js.map +1 -0
  34. package/dist/client/locales/chat.en-US.d.ts +1 -0
  35. package/dist/client/locales/chat.en-US.d.ts.map +1 -1
  36. package/dist/client/locales/chat.en-US.js +1 -0
  37. package/dist/client/locales/chat.en-US.js.map +1 -1
  38. package/dist/client/locales/chat.zh-CN.d.ts.map +1 -1
  39. package/dist/client/locales/chat.zh-CN.js +1 -0
  40. package/dist/client/locales/chat.zh-CN.js.map +1 -1
  41. package/dist/client/locales/de-DE.d.ts.map +1 -1
  42. package/dist/client/locales/de-DE.js +1 -0
  43. package/dist/client/locales/de-DE.js.map +1 -1
  44. package/dist/client/locales/es-ES.d.ts.map +1 -1
  45. package/dist/client/locales/es-ES.js +1 -0
  46. package/dist/client/locales/es-ES.js.map +1 -1
  47. package/dist/client/locales/fr-FR.d.ts.map +1 -1
  48. package/dist/client/locales/fr-FR.js +1 -0
  49. package/dist/client/locales/fr-FR.js.map +1 -1
  50. package/dist/client/locales/id-ID.d.ts.map +1 -1
  51. package/dist/client/locales/id-ID.js +1 -0
  52. package/dist/client/locales/id-ID.js.map +1 -1
  53. package/dist/client/locales/ja-JP.d.ts.map +1 -1
  54. package/dist/client/locales/ja-JP.js +1 -0
  55. package/dist/client/locales/ja-JP.js.map +1 -1
  56. package/dist/client/locales/pt-BR.d.ts.map +1 -1
  57. package/dist/client/locales/pt-BR.js +1 -0
  58. package/dist/client/locales/pt-BR.js.map +1 -1
  59. package/dist/client/locales/runtimes.en-US.d.ts +4 -1
  60. package/dist/client/locales/runtimes.en-US.d.ts.map +1 -1
  61. package/dist/client/locales/runtimes.en-US.js +6 -3
  62. package/dist/client/locales/runtimes.en-US.js.map +1 -1
  63. package/dist/client/locales/runtimes.zh-CN.d.ts.map +1 -1
  64. package/dist/client/locales/runtimes.zh-CN.js +6 -3
  65. package/dist/client/locales/runtimes.zh-CN.js.map +1 -1
  66. package/dist/client/locales/vi-VN.d.ts.map +1 -1
  67. package/dist/client/locales/vi-VN.js +1 -0
  68. package/dist/client/locales/vi-VN.js.map +1 -1
  69. package/dist/client/locales/zh-TW.d.ts.map +1 -1
  70. package/dist/client/locales/zh-TW.js +1 -0
  71. package/dist/client/locales/zh-TW.js.map +1 -1
  72. package/dist/client/pages/runtimes/connect.d.ts.map +1 -1
  73. package/dist/client/pages/runtimes/connect.js +16 -10
  74. package/dist/client/pages/runtimes/connect.js.map +1 -1
  75. package/dist/client/pages/skills/index.js +2 -2
  76. package/dist/client/pages/skills/index.js.map +1 -1
  77. package/dist/database/migrations/.manifest.json +8 -0
  78. package/dist/database/migrations/202611010001_ag_conversation_runner_attention.d.ts +4 -0
  79. package/dist/database/migrations/202611010001_ag_conversation_runner_attention.d.ts.map +1 -0
  80. package/dist/database/migrations/202611010001_ag_conversation_runner_attention.js +30 -0
  81. package/dist/database/migrations/202611010001_ag_conversation_runner_attention.js.map +1 -0
  82. package/dist/database/migrations/202611010002_ag_create_conversation_links.d.ts +4 -0
  83. package/dist/database/migrations/202611010002_ag_create_conversation_links.d.ts.map +1 -0
  84. package/dist/database/migrations/202611010002_ag_create_conversation_links.js +30 -0
  85. package/dist/database/migrations/202611010002_ag_create_conversation_links.js.map +1 -0
  86. package/dist/package.json +1 -1
  87. package/dist/server/composition.d.ts.map +1 -1
  88. package/dist/server/composition.js +1 -0
  89. package/dist/server/composition.js.map +1 -1
  90. package/dist/server/core/conversations/attachments.d.ts +5 -0
  91. package/dist/server/core/conversations/attachments.d.ts.map +1 -1
  92. package/dist/server/core/conversations/attachments.js +10 -0
  93. package/dist/server/core/conversations/attachments.js.map +1 -1
  94. package/dist/server/core/conversations/conversation.service.d.ts +3 -1
  95. package/dist/server/core/conversations/conversation.service.d.ts.map +1 -1
  96. package/dist/server/core/conversations/conversation.service.js +693 -32
  97. package/dist/server/core/conversations/conversation.service.js.map +1 -1
  98. package/dist/server/core/conversations/conversation.store.d.ts +24 -0
  99. package/dist/server/core/conversations/conversation.store.d.ts.map +1 -1
  100. package/dist/server/core/conversations/conversation.store.js +10 -0
  101. package/dist/server/core/conversations/conversation.store.js.map +1 -1
  102. package/dist/server/core/conversations/index.d.ts +1 -1
  103. package/dist/server/core/conversations/index.d.ts.map +1 -1
  104. package/dist/server/core/conversations/index.js.map +1 -1
  105. package/dist/server/core/conversations/links.d.ts +27 -0
  106. package/dist/server/core/conversations/links.d.ts.map +1 -0
  107. package/dist/server/core/conversations/links.js +188 -0
  108. package/dist/server/core/conversations/links.js.map +1 -0
  109. package/dist/server/core/conversations/ports.d.ts +107 -3
  110. package/dist/server/core/conversations/ports.d.ts.map +1 -1
  111. package/dist/server/core/runs/claim.d.ts.map +1 -1
  112. package/dist/server/core/runs/claim.js +47 -3
  113. package/dist/server/core/runs/claim.js.map +1 -1
  114. package/dist/server/core/runs/lifecycle.d.ts.map +1 -1
  115. package/dist/server/core/runs/lifecycle.js +28 -3
  116. package/dist/server/core/runs/lifecycle.js.map +1 -1
  117. package/dist/server/core/runs/ports.d.ts +15 -0
  118. package/dist/server/core/runs/ports.d.ts.map +1 -1
  119. package/dist/server/core/runs/ports.js.map +1 -1
  120. package/dist/server/core/runs/run-data-purge.d.ts +7 -0
  121. package/dist/server/core/runs/run-data-purge.d.ts.map +1 -1
  122. package/dist/server/core/runs/run-data-purge.js +13 -0
  123. package/dist/server/core/runs/run-data-purge.js.map +1 -1
  124. package/dist/server/core/runs/run.store.d.ts +6 -2
  125. package/dist/server/core/runs/run.store.d.ts.map +1 -1
  126. package/dist/server/core/runs/run.store.js +28 -10
  127. package/dist/server/core/runs/run.store.js.map +1 -1
  128. package/dist/server/kernel/errors.d.ts +1 -1
  129. package/dist/server/kernel/errors.d.ts.map +1 -1
  130. package/dist/server/kernel/errors.js +2 -0
  131. package/dist/server/kernel/errors.js.map +1 -1
  132. package/dist/server/kernel/events.d.ts +19 -0
  133. package/dist/server/kernel/events.d.ts.map +1 -1
  134. package/dist/server/kernel/events.js.map +1 -1
  135. package/dist/server/online/agent/contracts.d.ts +5 -0
  136. package/dist/server/online/agent/contracts.d.ts.map +1 -1
  137. package/dist/server/online/agent/native/session.d.ts +1 -0
  138. package/dist/server/online/agent/native/session.d.ts.map +1 -1
  139. package/dist/server/online/agent/native/session.js +4 -1
  140. package/dist/server/online/agent/native/session.js.map +1 -1
  141. package/dist/server/online/agent/persistence/store.d.ts.map +1 -1
  142. package/dist/server/online/agent/persistence/store.js +8 -1
  143. package/dist/server/online/agent/persistence/store.js.map +1 -1
  144. package/dist/server/online/agent/runner/backend.d.ts +15 -0
  145. package/dist/server/online/agent/runner/backend.d.ts.map +1 -1
  146. package/dist/server/online/agent/runner/backend.js +310 -70
  147. package/dist/server/online/agent/runner/backend.js.map +1 -1
  148. package/dist/server/online/agent/runner/projection.d.ts +24 -2
  149. package/dist/server/online/agent/runner/projection.d.ts.map +1 -1
  150. package/dist/server/online/agent/runner/projection.js +330 -26
  151. package/dist/server/online/agent/runner/projection.js.map +1 -1
  152. package/dist/server/online/agent/runner/types.d.ts +8 -1
  153. package/dist/server/online/agent/runner/types.d.ts.map +1 -1
  154. package/dist/server/online/agent/types.d.ts +2 -0
  155. package/dist/server/online/agent/types.d.ts.map +1 -1
  156. package/dist/server/providers/agents.d.ts +7 -0
  157. package/dist/server/providers/agents.d.ts.map +1 -1
  158. package/dist/server/providers/agents.js +3 -1
  159. package/dist/server/providers/agents.js.map +1 -1
  160. package/dist/server/providers/runners.d.ts.map +1 -1
  161. package/dist/server/providers/runners.js +12 -1
  162. package/dist/server/providers/runners.js.map +1 -1
  163. package/dist/server/routes/chat.d.ts.map +1 -1
  164. package/dist/server/routes/chat.js +270 -2
  165. package/dist/server/routes/chat.js.map +1 -1
  166. package/dist/server/routes/run.d.ts.map +1 -1
  167. package/dist/server/routes/run.js +44 -0
  168. package/dist/server/routes/run.js.map +1 -1
  169. package/dist/server/routes/schemas.d.ts +15 -1
  170. package/dist/server/routes/schemas.d.ts.map +1 -1
  171. package/dist/server/routes/schemas.js +116 -1
  172. package/dist/server/routes/schemas.js.map +1 -1
  173. package/dist/server/runners/workspaces.d.ts.map +1 -1
  174. package/dist/server/runners/workspaces.js +46 -2
  175. package/dist/server/runners/workspaces.js.map +1 -1
  176. package/dist/server/tokens.d.ts +1 -1
  177. package/dist/server/tokens.d.ts.map +1 -1
  178. package/dist/server/tokens.js.map +1 -1
  179. package/dist/shared/conversations.d.ts +107 -1
  180. package/dist/shared/conversations.d.ts.map +1 -1
  181. package/dist/shared/conversations.js +19 -0
  182. package/dist/shared/conversations.js.map +1 -1
  183. package/dist/shared/ui-message.d.ts +30 -0
  184. package/dist/shared/ui-message.d.ts.map +1 -1
  185. package/dist/shared/ui-message.js +17 -0
  186. package/dist/shared/ui-message.js.map +1 -1
  187. package/package.json +9 -9
  188. package/skills/nocobase-app-plugin-agents/references/extension-points.md +19 -19
  189. package/skills/nocobase-app-plugin-agents/references/online-agent.md +16 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @nocobase/app-plugin-agents
2
2
 
3
+ ## 1.0.0-beta.28
4
+
5
+ ### Minor Changes
6
+
7
+ - 22748f7: A message sent while a runner conversation's agent works is no longer refused as busy: `POST /api/agents/conversations/{conversationId}/queue` (`conversation message queue`) joins it to the run at work, which the runner steers into the running turn when its tool can and takes as the next turn otherwise, and `POST /api/agents/conversations/{conversationId}/messages/{messageId}/withdraw` takes it back while its runner has not taken it. A queued message carries `metadata.queue` (`queued`, `withdrawn` or `unanswered`), and the answer to it is its own response. The agent's todo list shows as a `data-plan` part, from Codex's `turn/plan/updated` and ACP plan updates; conversation usage adds `costUsd` from the cost Claude Code, Pi and OpenCode report. A live runner response opens at once and says where it stands before its first output (`data-phase`: `waiting`, `starting`, `thinking`).
8
+
9
+ Runs respond faster. Claude Code starts with `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` unless the runner is started with `NOCOBASE_RUNNER_CLAUDE_NONESSENTIAL_TRAFFIC=1` or the run sets the variable itself. The events answer carries input that arrived for the run (`EventsResponse.inputs`, absent from older servers), so it reaches the agent with the next events rather than the next status poll, and tool steps, input, status, usage and error events are sent as they happen instead of at the next spool interval.
10
+
11
+ - 22748f7: A conversation no longer loses its context when its kept tool session cannot be resumed. When the brief changed since the session was kept, the claim starts a new session with the conversation's recent history, as a first one gets; when it resumes, the payload carries `prompt.recoveryContext` (that history), which the runner gives a new session should the kept one be gone on its machine. A subject's per-turn rules can now change without ending the kept session (`ConversationRuleLines.turn`).
12
+
13
+ `DELETE /api/agents/conversations/{conversationId}` (`conversation delete`) deletes the owner's conversation for good: its open runs are cancelled, its messages, files (and their stored bytes), links and kept sessions are deleted, its inbox notices are settled, and runners remove its working directories and session files on their next workspace report. Conversations archived longer than `agents.conversations.archivedRetentionDays` (30 by default, 0 keeps them) are deleted the same way by a daily cleanup.
14
+
15
+ - 22748f7: Runners report how full the context window is after a turn, as a `status` event `context` with `{ used, size }`: Claude Code from the turn's per-model context window and the main thread's latest request, Codex from `thread/tokenUsage/updated` when it names the model's window, and ACP agents from their `usage_update`. OpenCode and Pi report none. A runner conversation's response ends with a `data-turn` part once its run has ended (how long the turn took, its input, cached and output tokens, and whether it completed, failed or was cancelled), and `GET /api/agents/conversations/{conversationId}/usage` (`conversation usage`) sums the tokens of a conversation's runs and returns its latest context window.
16
+ - 22748f7: Bind a conversation to the first runner that takes one of its runs: later runs wait for that runner, `ConversationSummary.runner` reports whether it is online, and `POST /api/agents/conversations/{conversationId}/switchRunner` lets the owner move on to another runner, which starts a fresh session with the history. A session whose working directory a runner no longer reports starts fresh as well. Conversations can be tied to records of kinds the application registers (`conversations.links`, `GET|POST|DELETE /api/agents/conversations/{conversationId}/links`, `linkKind` and `linkTargetId` on the conversation list), and every turn lists them as linked work; `conversations.rules.provide` may add `turn` sections, and `conversations.deliver` wakes a Runner conversation with `news.wake`. Conversations keep their owner's read position and what waits for them (`seenSeq`, `needsYou`, `POST …/markSeen`, `GET /api/agents/conversationAttention`, the `conversation.attention` event and the run command `conversation ask-owner`). Adds the `202611010001_ag_conversation_runner_attention` and `202611010002_ag_create_conversation_links` migrations.
17
+ - 22748f7: A runner conversation's responses now carry the agent's tool calls and their results as SDK `dynamic-tool` parts, live while the run streams (`tool-input-available`, then `tool-output-available` or `tool-output-error`) and in history replay, ordered among the response's reasoning and texts by the run's events. Inputs and outputs are bounded in the message; the run's transcript keeps them whole. The runner sends a conversation's tool steps as soon as they happen rather than at its next event interval.
18
+
19
+ ### Patch Changes
20
+
21
+ - 22748f7: `useChatScroll` no longer takes a reader who just scrolled up back to the end when the layout changes (a window resize, content reflow) before the browser delivers their scroll event.
22
+ - 5782713: Allow Runner messages to confirm the final Agent selection atomically with message admission, avoiding switch notices for unused selections.
23
+ - 22748f7: Show a conversation's new messages and replies sooner. An accepted message is announced with its `seq`, so every page that shows the conversation reads it at once instead of waiting for the run's next announcement. The chat reads lists and details once per burst of announcements instead of once per announcement. The runner sends the first words of a reply preview after 50 ms and later text every 200 ms, instead of holding text for up to a second.
24
+ - 22748f7: A message the owner sends also announces the conversation without a `seq` once it settles what waited for them, so a listener that settles notices on `conversation.changed` (such as an application's inbox) hears that a reply was answered from the CLI or any surface that does not mark it seen. A run that fails after asking its owner a question now waits as `failed` rather than keeping the question. A runner's empty workspace report no longer forgets every session's directory, since it more likely means the runner could not read them. Tying a record a conversation already has answers `200` instead of `201`.
25
+ - 22748f7: Let an owner change the agent of an idle Runner conversation while retaining its history and links; the next message starts a fresh tool session. Refuse changes while any queued, running or finalizing work remains.
26
+ - 22748f7: The "Add runtime" dialog offers its agent prompt as one compact callout after choosing the system: a title, the whole description with a "View prompt" toggle, and "Copy the prompt for the agent" as the primary action, followed by the steps to install it by hand, instead of prompt and manual tabs.
27
+ - 22748f7: The Skills page's empty state shows a puzzle piece, matching the Skills navigation item, so the sparkles stand for conversations with agents alone.
28
+ - cc0b521: Allow task-linked conversation questions to settle when their task resumes, using the recorded status transition time while preserving newer questions and unread replies.
29
+ - Updated dependencies [07b14c0]
30
+ - Updated dependencies [451bf75]
31
+ - Updated dependencies [22748f7]
32
+ - Updated dependencies [22748f7]
33
+ - Updated dependencies [e3d9a52]
34
+ - Updated dependencies [22748f7]
35
+ - @nocobase/app-cli@1.0.0-beta.30
36
+ - @nocobase/app-client@4.0.0-beta.4
37
+ - @nocobase/agent-protocol@0.1.0-beta.16
38
+ - @nocobase/app-server@3.0.0-beta.4
39
+ - @nocobase/app-plugin-authorization@1.0.0-beta.33
40
+ - @nocobase/db@1.0.0-beta.23
41
+ - @nocobase/app-plugin-authentication@2.0.0-beta.15
42
+ - @nocobase/app-plugin-file@1.0.0-beta.27
43
+ - @nocobase/app-cli-client@0.1.0-beta.17
44
+
3
45
  ## 1.0.0-beta.27
4
46
 
5
47
  ### Patch Changes
package/README.md CHANGED
@@ -33,7 +33,7 @@ Repository access providers that mint credentials in `prepare` implement the ide
33
33
  - **The sweep** (`server/runners/sweeper.ts`, the `RunnersSweep` schedule every 30 seconds, or `agents.runners.sweepIntervalMs`, on the application's jobs service, or an in-process timer without one) marks runners not heard from for 150 s offline, takes jobs back from silent runners and fails jobs far past their timeout, and takes runs back from runners that went away, lost their lease or never started, fails runs idle for twice their idle timeout, records unacknowledged cancellations, cancels queued runs of archived agents, and fails a queued run that waited longer than its subject allows (`queuedExpiryMs` on the subject's binding, counted from the run's last change or from its `fireAt`) as `queuedExpired`.
34
34
  - **Variables** (`agSecrets`): environment variables for the agent's process, every one a secret sealed with the application's secrets service (`secrets.keys`) and bound to its scope and name, set on an agent, a working directory (`workdir`) or a scope the application registers, merged for a run in the order the subject names its scopes < its working directories < the agent, delivered only to runners with the `secrets` feature: to whichever runner takes the run, a personal runner of anyone who may use the agent included, since sharing an agent shares the tokens it works with. A variable marked `teamRunnersOnly` (off by default; `PUT /api/agents/variables/...` with `teamRunnersOnly`, and without `value` to change only that) keeps runs and jobs that get it on shared runners. Jobs check the exact variables referenced by their prepared spec, including repository credentials, before opening any value in the claim transaction; a personal runner skips such a job without counting a preparation failure, leaving it queued for a shared runner and continuing to other jobs. Values are write-only; reading them back and every delivery are audited (`agSecretAudits`).
35
35
  - **Skills** (`agSkills`, `agSkillVersions`, `agSkillAttachments`): a library of skills in the open Agent Skills format (https://agentskills.io/specification): a directory of `SKILL.md` and supporting files, conventionally under `scripts/`, `references/` and `assets/`. Only the front matter of `SKILL.md` names and describes a skill: `name` (1–64 lower-case letters, digits and single hyphens) is its slug and directory, so a save that changes it renames the skill, and `description` (1–1024 characters) is required; `license`, `compatibility` (at most 500 characters), `metadata` (string values) and `allowed-tools` are checked when present, and other keys are kept. Every create, save, restore and import is checked against these rules in the browser as it is typed and on the server (`shared/skill-markdown.ts`), which answers 400 with each problem's `field` and `reason` in `metadata.problems` (`taken` for a name another skill has; `mismatch` for an archive whose folder is named otherwise). Files under `scripts/` or marked executable are scripts (`Skill.scripts`): runners may run them. Every save is a new version that runs get at once, with older versions to compare and restore. Skills are attached globally, or as defaults to a working directory or a registered scope. A skill's revision is its current version: a save or a restore names the version it was made against (`expectedRevision`) and is refused with 409 `REVISION_CONFLICT` when another save came first. A runner fetches a run's skills from `GET /api/agents/runners/runs/:runId/skills/:slug` and places them where the run's coding tool finds them.
36
- - **Conversations** (`agConversations`, `agConversationMessages`): owner-only chats through the OnlineAgent service, with native model execution or a callable Runner binding. Existing bindings are immutable. Historical unbound conversations retain readable history and owner-authorized Stop for unfinished runs, but cannot continue chatting through HTTP. Ordinary conversations default to visible; new background sessions are hidden from lists before pagination. The [OnlineAgent reference](skills/nocobase-app-plugin-agents/references/online-agent.md) documents execution, result observation, browser configuration, notification transactions and migration from removed start/fallback/restore endpoints and CLI commands.
36
+ - **Conversations** (`agConversations`, `agConversationMessages`): owner-only chats through the OnlineAgent service, with native model execution or a callable Runner binding. Existing bindings are immutable. Historical unbound conversations retain readable history and owner-authorized Stop for unfinished runs, but cannot continue chatting through HTTP. Ordinary conversations default to visible; new background sessions are hidden from lists before pagination. A conversation is bound to the first runner that takes one of its runs and waits for it while it is offline, until its owner switches runner (`POST /conversations/:id/switchRunner`); it may be tied to records of kinds the application registers (`agConversationLinks`), and keeps its owner's read position and what waits for them (`seenSeq`, `needsYou`). The [OnlineAgent reference](skills/nocobase-app-plugin-agents/references/online-agent.md) documents execution, result observation, browser configuration, notification transactions and migration from removed start/fallback/restore endpoints and CLI commands.
37
37
  - **Chat defaults**: the system default chat agent (`agSettings`, `PATCH /api/agents/chatSettings` by who manages `agents.agents`, or the application), each person's default chat agent (`agChatPreferences`), and each agent's "confirm before changing data" (`confirmChanges`: `always` or only `larger` changes).
38
38
  - **No setup scripts.** Preparing a working directory is the agent's job: its brief tells it to follow each directory's own instructions (AGENTS.md, CLAUDE.md, README), to install what is missing inside the directory, and to say so (the way the subject's guidance tells it) when it cannot. A working directory's optional initialization prompt reaches the agent only when the runner prepared that directory fresh. "Clean working directory" (`POST /api/agents/workspaces/:subjectKind/:subjectId/reset`) makes the next run start from a fresh checkout.
39
39
 
@@ -172,26 +172,28 @@ Realtime announcements carry no content: `agents:runs:<runId>` when a run's stat
172
172
 
173
173
  Everything the application contributes goes through `agentsToken` (`server/tokens.ts`) at boot. Text people read is an `I18nText` (`{ key, ns }`, `shared/i18n`) in the contributor's own namespace.
174
174
 
175
- | Extension point | What the application gives |
176
- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
177
- | `subjects.register(binding)` | A kind of subject runs work on: `kind`, `title`, `triggers` (what `input.payload.trigger` values mean, for the run panel), `preview` (a `SubjectSample`: the assembly of a made-up subject of the kind, its values marked with `sampleValue`, offered as a scenario of "Preview full prompt"), `context.assemble` (the brief's task and context, the turn, the working directories, the scopes, and `guidance`: the subject's own lines of the rules and of the environment check), `sink.onRunFinished`, `queuedExpiryMs` (how long a run may wait for a runner; forever without it), `reports.describe` (a subject's label, whether the person may see it, and its `group`). Name the commands `assemble` mentions with `commandRef(cli, id, flag?)` (`acme issue get`). |
178
- | `scopes.register(kind)` | A scope of variables and default skills (`key`, `title`, `description`, `access(scopeId, userId)`). `agent` is reserved; `workdir` is a core key the application registers to decide who may see and change a working directory's. |
179
- | `actions.provide(source)` | The business actions an agent may be configured with (`key`, `group`, `title`, `groupTitle`, `description`, `defaultOn` for the ones every discovered agent gets unless `agents.setDefaults` says otherwise), and those never granted to an agent, listed only to show the boundary (`grantable: false` with a `reason`). |
180
- | `agents.setDefaults(provider)` | The instructions and business actions every agent discovered from runners gets (`AgentDefaults`), asked whenever one is written; `agents.applyDefaults()` writes them to every one that differs. Optional `modelDescriptions` maps tools and normalized model ids to `{ en, zh }` enable-dialog suggestions, falling back to the catalog without changing saved descriptions. Returns what removes the provider. |
181
- | `agents.ensureSystem(input)` | An agent of the application's own (`SystemAgentInput`: its fixed id, name, description, instructions, business actions and the tools and models it runs with, none until it is configured), created the first time, kept as given and enabled; people do not change it. |
182
- | `gate.set(gate)` | Who holds which business actions: an `ActionGate` answering `allowed(identity)` for a person or a run, and optionally `consultable(action)` for what a consultation may keep besides reading. `gate.allowed` and `gate.reach` answer for a caller; the gate also bounds what a run may do over the API. |
183
- | `conversations.sources.register(source)` | A place conversations start from besides the panel (`POST /conversations` takes `source`, then `POST /conversations/:id/messages` the first message as the agent should read it). |
184
- | `conversations.contextKinds.register(kind, resolver)` | A kind of object a page context may reference, resolved for the message's owner. |
185
- | `conversations.rules.provide(rules)` | Rules and sections added to the system layer of conversation runs. |
186
- | `conversations.deliver(tx, id, news)`, `conversations.lock(conn, id)` | A `news` notice (`type`, English `title`, `params`) saved in the caller's transaction. Native and Runner OnlineAgent bindings ignore wake-up input and return null; unbound conversations retain the existing wake-up path. |
187
- | `people.provide(source)` | The application's directory: names, whom to pick from, and who can no longer act (`inactive`: their runners stop). |
188
- | `events.on('agent.removed', listener)` | An agent was disabled (`agentId`, `name` then, `reason` `disabled`, `byUserId`), after the transaction that withdrew its queued runs commits: the application lets go of the work it gave the agent. The assembling application clears it as executor of unfinished issues (`server/agents/removal.ts`). |
189
- | `events.on('notice', listener)` | People the plugin wants told (`AgentsNotice`: `key`, `type`, `userIds`, `subject`, English `title` and `body`, `params`): runner notices to their owner, `run_secrets_not_allowed` to a run's actor and owner, and `run_request_expired` to its requester. Subjects are `runner`, `run` or `runRequest`; `notice.cleared` names one that no longer holds. |
190
- | `jobs.register(kind, registration)` | A kind of build job, for the off-by-default runner build method (see Jobs above). |
191
- | `reporting.usage`, `reporting.runFigures`, `reporting.range` | What runs used and cost, grouped by agent, person, `group`, `subject`, day, model, tool or agent `type`, and how the runs of a range went with their usage by type (`usageByType`) and day by day (`daily`: runs by outcome, cost by type), for the application's report pages. The plugin serves usage over HTTP for its usage page (`GET /api/agents/usage`, behind the `usage` page grant; every run for a reader of agents, else the caller's own; `series=true` breaks each day of `daily` down by the grouping). |
192
- | `briefs.sections.register(provider)` | Sections added to every brief's context layer after the subject's own context (`key`, `order`, `section(conn, claim, assembly)` answering Markdown or null), in claims and in brief previews. The context layer is outside the session fingerprint, so a section that changes does not end a resumable session. Database reads only. |
193
- | `mounts.register(provider)` | Directories of files placed beside the agent (`name`, `forRun(conn, { claim, assembly, session, sessionKey })` answering `{ hash, target, note?, resumeNote? }` or null, and `bundle(conn, { runId })`). Offered at claim only to runners announcing the `mounts` feature, never required, so an older runner runs without them; served at `GET /api/agents/runners/runs/:runId/mounts/:name` while the runner holds the run. A mount's hash stays out of the session fingerprint: a resumed run gets its `resumeNote` in the turn instead. |
194
- | `repoAccess.register(provider)` | Per run, in the claim's transaction: who the run's commits name and the short-lived credentials its checkouts push with (`forRun(conn, { claim, repos, onDemand, tools, responsibleUserId })` answering `RunGit` or null). It may read from elsewhere in an optional `prepare(run, { onDemand, tools, responsibleUserId })` before the transaction. `responsibleUserId` is who answers for the subject now (`SubjectBinding.responsibleUserId`), passed to `issue` too; whose credential the run gets is the provider's decision. With `tools` (a `gitTools` runner) it may name code host CLIs in `RunGit.tools`, kept only for repositories with a credential in the payload. For a runner with the `gitCredentials` feature (`onDemand`), a provider that implements `issue(request)` lists its repositories in `RunGit.onDemand` instead of minting credentials at the claim: the runner then asks `POST /api/agents/runners/runs/:runId/gitCredentials` whenever git needs one, and the plugin calls `issue` outside any transaction (15 s at most) only while that runner holds that attempt of the run under a live lease, for a URL the claim listed, compared exactly. `issue` answers `{ username, password, expiresAt }` (the username is the one git uses, such as `oauth2`), null when the repository is not its own, or throws `RepoAccessError('unavailable' \| 'denied', message)` with a message safe to show; with `refresh` it issues a new credential rather than a cached one. Issued credentials are never stored and are redacted from what the run reports. |
175
+ | Extension point | What the application gives |
176
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
177
+ | `subjects.register(binding)` | A kind of subject runs work on: `kind`, `title`, `triggers` (what `input.payload.trigger` values mean, for the run panel), `preview` (a `SubjectSample`: the assembly of a made-up subject of the kind, its values marked with `sampleValue`, offered as a scenario of "Preview full prompt"), `context.assemble` (the brief's task and context, the turn, the working directories, the scopes, and `guidance`: the subject's own lines of the rules and of the environment check), `sink.onRunFinished`, `queuedExpiryMs` (how long a run may wait for a runner; forever without it), `reports.describe` (a subject's label, whether the person may see it, and its `group`). Name the commands `assemble` mentions with `commandRef(cli, id, flag?)` (`acme issue get`). |
178
+ | `scopes.register(kind)` | A scope of variables and default skills (`key`, `title`, `description`, `access(scopeId, userId)`). `agent` is reserved; `workdir` is a core key the application registers to decide who may see and change a working directory's. |
179
+ | `actions.provide(source)` | The business actions an agent may be configured with (`key`, `group`, `title`, `groupTitle`, `description`, `defaultOn` for the ones every discovered agent gets unless `agents.setDefaults` says otherwise), and those never granted to an agent, listed only to show the boundary (`grantable: false` with a `reason`). |
180
+ | `agents.setDefaults(provider)` | The instructions and business actions every agent discovered from runners gets (`AgentDefaults`), asked whenever one is written; `agents.applyDefaults()` writes them to every one that differs. Optional `modelDescriptions` maps tools and normalized model ids to `{ en, zh }` enable-dialog suggestions, falling back to the catalog without changing saved descriptions. Returns what removes the provider. |
181
+ | `agents.ensureSystem(input)` | An agent of the application's own (`SystemAgentInput`: its fixed id, name, description, instructions, business actions and the tools and models it runs with, none until it is configured), created the first time, kept as given and enabled; people do not change it. |
182
+ | `gate.set(gate)` | Who holds which business actions: an `ActionGate` answering `allowed(identity)` for a person or a run, and optionally `consultable(action)` for what a consultation may keep besides reading. `gate.allowed` and `gate.reach` answer for a caller; the gate also bounds what a run may do over the API. |
183
+ | `conversations.sources.register(source)` | A place conversations start from besides the panel (`POST /conversations` takes `source`, then `POST /conversations/:id/messages` the first message as the agent should read it). |
184
+ | `conversations.contextKinds.register(kind, resolver)` | A kind of object a page context may reference, resolved for the message's owner. |
185
+ | `conversations.rules.provide(rules)` | Rules and sections added to the system layer of conversation runs, and `turn` sections added to every turn. |
186
+ | `conversations.deliver(tx, id, news)`, `conversations.lock(conn, id)` | A `news` notice (`type`, English `title`, `params`) saved in the caller's transaction. Native bindings ignore wake-up input and return null, as Runner OnlineAgent bindings do unless `news.wake`; unbound conversations retain the existing wake-up path. |
187
+ | `people.provide(source)` | The application's directory: names, whom to pick from, and who can no longer act (`inactive`: their runners stop). |
188
+ | `conversations.links.registerKind(kind)`, `conversations.links.attach(id, target, options)`, `conversations.links.linkedTo(conn, target)`, `conversations.ofRunId(runId)` | What conversations may be tied to (`resolve` answers the owner's views of the targets), tying what a run on a conversation created, and the conversations tied to a target. Every turn lists the conversation's links as "Linked work". |
189
+ | `events.on('conversation.attention', listener)`, `conversations.markNoticed(id, seq)`, `conversations.attention(userId)` | A conversation started waiting for its owner (`reason` `reply`, `failed` or `confirm`, at message `seq`): for reminders, push and the badge; `markNoticed` records what the application told them. |
190
+ | `events.on('agent.removed', listener)` | An agent was disabled (`agentId`, `name` then, `reason` `disabled`, `byUserId`), after the transaction that withdrew its queued runs commits: the application lets go of the work it gave the agent. The assembling application clears it as executor of unfinished issues (`server/agents/removal.ts`). |
191
+ | `events.on('notice', listener)` | People the plugin wants told (`AgentsNotice`: `key`, `type`, `userIds`, `subject`, English `title` and `body`, `params`): runner notices to their owner, `run_secrets_not_allowed` to a run's actor and owner, and `run_request_expired` to its requester. Subjects are `runner`, `run` or `runRequest`; `notice.cleared` names one that no longer holds. |
192
+ | `jobs.register(kind, registration)` | A kind of build job, for the off-by-default runner build method (see Jobs above). |
193
+ | `reporting.usage`, `reporting.runFigures`, `reporting.range` | What runs used and cost, grouped by agent, person, `group`, `subject`, day, model, tool or agent `type`, and how the runs of a range went with their usage by type (`usageByType`) and day by day (`daily`: runs by outcome, cost by type), for the application's report pages. The plugin serves usage over HTTP for its usage page (`GET /api/agents/usage`, behind the `usage` page grant; every run for a reader of agents, else the caller's own; `series=true` breaks each day of `daily` down by the grouping). |
194
+ | `briefs.sections.register(provider)` | Sections added to every brief's context layer after the subject's own context (`key`, `order`, `section(conn, claim, assembly)` answering Markdown or null), in claims and in brief previews. The context layer is outside the session fingerprint, so a section that changes does not end a resumable session. Database reads only. |
195
+ | `mounts.register(provider)` | Directories of files placed beside the agent (`name`, `forRun(conn, { claim, assembly, session, sessionKey })` answering `{ hash, target, note?, resumeNote? }` or null, and `bundle(conn, { runId })`). Offered at claim only to runners announcing the `mounts` feature, never required, so an older runner runs without them; served at `GET /api/agents/runners/runs/:runId/mounts/:name` while the runner holds the run. A mount's hash stays out of the session fingerprint: a resumed run gets its `resumeNote` in the turn instead. |
196
+ | `repoAccess.register(provider)` | Per run, in the claim's transaction: who the run's commits name and the short-lived credentials its checkouts push with (`forRun(conn, { claim, repos, onDemand, tools, responsibleUserId })` answering `RunGit` or null). It may read from elsewhere in an optional `prepare(run, { onDemand, tools, responsibleUserId })` before the transaction. `responsibleUserId` is who answers for the subject now (`SubjectBinding.responsibleUserId`), passed to `issue` too; whose credential the run gets is the provider's decision. With `tools` (a `gitTools` runner) it may name code host CLIs in `RunGit.tools`, kept only for repositories with a credential in the payload. For a runner with the `gitCredentials` feature (`onDemand`), a provider that implements `issue(request)` lists its repositories in `RunGit.onDemand` instead of minting credentials at the claim: the runner then asks `POST /api/agents/runners/runs/:runId/gitCredentials` whenever git needs one, and the plugin calls `issue` outside any transaction (15 s at most) only while that runner holds that attempt of the run under a live lease, for a URL the claim listed, compared exactly. `issue` answers `{ username, password, expiresAt }` (the username is the one git uses, such as `oauth2`), null when the repository is not its own, or throws `RepoAccessError('unavailable' \| 'denied', message)` with a message safe to show; with `refresh` it issues a new credential rather than a cached one. Issued credentials are never stored and are redacted from what the run reports. |
195
197
 
196
198
  `GET /api/agents/vocabulary` hands the browser what the application contributed: subjects (title, triggers, preview), conversation sources, and scopes (title, description).
197
199
 
@@ -252,7 +254,7 @@ Native agents use the application's CLI for every operation on the management in
252
254
 
253
255
  The CLI's commands are the application's API routes: `GET /api/cli/manifest` (`@nocobase/app-server/router`) answers every command the API document describes for the caller, named and shaped by each route's `x-cli` extension, and this plugin tells it who calls (a run by its run token, a person by the application's authentication) and which business actions each holds (`gate.allowed`). A run token is also a credential of the application's authentication (`server/cli/run-credential.ts`): a request carrying it acts for the person who woke the agent, as a scoped session the routes accept only where their security lists `runToken`; the application bounds it by its scope (for example, `server/agents/run-principal.ts`). A route lists `runToken` and gives its `x-cli` an `action` for the commands a run may use.
254
256
 
255
- The plugin's own commands are its routes. A run uses `run self`, `run context` and `conversation title set` (`GET /api/agents/runs/current`, `/current/context`, `PATCH /current/conversation`, action `agents.runs/self`), and a run or a person `agent list` (`GET /api/agents/available`, action `agents.agents/view`: the agents the caller may give work to, with what each is good at and whether it can take work now). The rest are a person's: `agent list-all|get|update|history|brief`, `agent action list`, `skill …` (with `skill version …` and `skill attachment get|set`), `variable list|set|delete|reveal` and `variable audit list` (positional scope kind and scope), `runtime list|get|update|revoke|delete|work` and `runtime token create`, `model list|check|usage` and `model price get|set`, `service list|create|update|delete|discover|check`, `conversation list|get|create|update|stop`, `conversation message list|send`, `conversation preferences|settings get|update`, `conversation attachment upload|download`, and `run list|get|events|brief|cancel|retry|usage`, `run workspace reset` and `run request list|get|confirm|reject|withdraw|run-as-me`. The runner protocol, the downloads and the browser's helpers (the vocabulary, the people picker, every agent's name, the chat agent picker, starting a conversation from a page, marking one read) stay off the command line. The application's routes and custom commands are the rest.
257
+ The plugin's own commands are its routes. A run uses `run self`, `run context`, `conversation title set` and `conversation ask-owner` (`GET /api/agents/runs/current`, `/current/context`, `PATCH /current/conversation`, `POST /current/conversation/askOwner`, action `agents.runs/self`), and a run or a person `agent list` (`GET /api/agents/available`, action `agents.agents/view`: the agents the caller may give work to, with what each is good at and whether it can take work now). The rest are a person's: `agent list-all|get|update|history|brief`, `agent action list`, `skill …` (with `skill version …` and `skill attachment get|set`), `variable list|set|delete|reveal` and `variable audit list` (positional scope kind and scope), `runtime list|get|update|revoke|delete|work` and `runtime token create`, `model list|check|usage` and `model price get|set`, `service list|create|update|delete|discover|check`, `conversation list|get|create|update|stop|switch-runner`, `conversation link list|add|remove`, `conversation message list|send`, `conversation preferences|settings get|update`, `conversation attachment upload|download`, and `run list|get|events|brief|cancel|retry|usage`, `run workspace reset` and `run request list|get|confirm|reject|withdraw|run-as-me`. The runner protocol, the downloads and the browser's helpers (the vocabulary, the people picker, every agent's name, the chat agent picker, starting a conversation from a page, marking one read) stay off the command line. The application's routes and custom commands are the rest.
256
258
 
257
259
  ## Workspace
258
260
 
@@ -343,6 +345,18 @@ Multi-instance deployments must set `jobs.default: redis` with a shared Redis co
343
345
 
344
346
  Studio publishes `agents.runs.retentionDays` through its existing public configuration. The process view displays a retention notice only for an expired terminal run with a complete empty transcript and no brief. This uses the current retention rule, rather than a historical cleanup marker; changing or disabling the policy changes the inferred notice. Run, event and brief API contracts are unchanged.
345
347
 
348
+ ## Conversations while the agent works
349
+
350
+ A Runner conversation takes a message while its agent works: `POST /api/agents/conversations/{conversationId}/queue` (`OnlineAgent.queue`) joins it to the run at work, steered into the running turn where the coding tool can take it, else taken as the next turn; `POST …/messages/{messageId}/withdraw` takes it back until a runner has it (`400 CONVERSATION_CONFLICT`, `messageTaken`, after). Delivery and withdrawal are conditional updates of the input row on an empty `deliveredAt` and `handledAt`, so a message is never both withdrawn and delivered. `POST …/markSeen { seq }` moves the owner's read position, `GET /api/agents/conversationAttention` answers the badge counts, and `GET …/usage` sums tokens, cost and the latest context window over the conversation's runs.
351
+
352
+ A run can ask its conversation owner with `conversation ask-owner "Proceed with the plan?" --issue PM-721`. The optional `issue` identifier is saved with the question and its server timestamp in conversation metadata. Without it, behavior is unchanged. Applications can call `conversations.settleOwnerQuestion(id, issue, resumedAt)` with the actual task transition timestamp to settle only a matching earlier question; it emits `conversation.changed` without changing read positions, unread replies or waking a run. The application owns task visibility, links and resumption rules.
353
+
354
+ ## Deleting conversations and archived retention
355
+
356
+ `DELETE /api/agents/conversations/{conversationId}` (`conversation delete`) lets the owner delete a conversation for good. Its open runs are cancelled, and its messages, files (with their stored bytes), links and kept tool sessions are deleted in one transaction; its inbox notices are settled. Its finished runs and what they recorded (events, usage, inputs, briefs) are deleted too; a run still stopping is deleted by the next cleanup once it ended. Runners remove the conversation's working directories and the coding tools' session files on their next workspace report, because a deleted conversation's work counts as over.
357
+
358
+ Set `agents.conversations.archivedRetentionDays` to a non-negative integer (default `30`); `0` keeps archived conversations. The `ArchivedConversationPurge` job runs once a day, beside the hourly `RunDataPurge`, and deletes conversations whose `archivedAt` is older than the cutoff exactly as the owner's delete does, 50 at a time, at most 1,000 per round and for at most five minutes. A conversation restored before its turn is kept.
359
+
346
360
  ## Runtime quotas and detail tabs
347
361
 
348
362
  Runtime quota marks share `unavailableModels` with model availability marks and use internal `quotaRevision` conditional writes. Known reset times restore eligibility automatically and cannot be cleared manually. Unknown limits remain until the owner or a runtime administrator clears the selected mark. Expiry and clearing never revive terminal runs or extend queue deadlines.
@@ -378,3 +392,7 @@ Personal runtimes execute only their owner’s tasks; shared runtimes execute an
378
392
  Capacity belongs to each application independently. Heartbeat replies include the complete capacity configuration; updated runners apply it without restarting and send one confirmation heartbeat when it changes. Their load report identifies the source and actual total and tool limits. The existing load JSON stores these values, and capacity changes emit runner.changed through the existing refresh mechanism; no schema migration is needed. Normal heartbeats and claims add no database operations, locks or transactions. A configuration change adds one confirmation heartbeat, with the same database cost as a normal heartbeat.
379
393
 
380
394
  The runtime status cell displays reported capacity, a pending-sync notice when online settings differ, and unknown synchronization support for older runners. Offline runtimes display the last report time. Editing continues to change online configuration. New registrations default to three slots; legacy clients cannot override a token's online settings through registration. Applications with custom runner projections must forward reportedSlots, capacitySource, capacityReportedAt and toolLoad; installed UI component copies need an explicit merge. Update the application server before relying on dynamic slots; upgraded runners connected to an older server temporarily retain their legacy local allowance.
395
+
396
+ `POST /api/agents/conversations/{conversationId}/switchAgent { agentId }` changes an idle Runner conversation to another enabled, callable Runner Agent. Its history and links stay; the next message starts a fresh tool session. Pending, running and finalizing work must finish first. Switching does not cancel a run or send a message.
397
+
398
+ To defer a selection until a message is accepted, pass optional `agentId` alongside the current SDK user `message` to `POST /api/agents/conversations/{conversationId}/messages`. Only idle, unarchived Runner conversations can change agents this way. Admission validates the target and commits the new binding, fresh thread, one switch notice, message and target run in the existing transaction. Selecting the current agent adds no notice; omitting the field preserves existing behavior. Rejection rolls everything back. A later execution failure keeps the accepted switch; an interrupted response must be reconciled through history, never automatically resent. Queued input and native conversations do not accept this field.
@@ -7,7 +7,7 @@ import { DefaultChatTransport } from 'ai';
7
7
  import type { AppUIMessage } from '../../shared/online-agent.js';
8
8
  import type { UIMessagePage } from './message-model.js';
9
9
  import { type ApiClient } from '@nocobase/app-client';
10
- import { type ChatAgent, type OnlineChatConfigSnapshot, type ChatPreferences, type ChatPreferencesPatch, type ChatSettings, type ChatSettingsPatch, type ConversationDetail, type ConversationListQuery, type ConversationPage, type ConversationPatch, type CreateConversationRequest, type MessageAttachment, type MessageListQuery } from '../../shared/conversations.js';
10
+ import { type ChatAgent, type OnlineChatConfigSnapshot, type ChatPreferences, type ChatPreferencesPatch, type ChatSettings, type ChatSettingsPatch, type ConversationDetail, type ConversationListQuery, type ConversationPage, type ConversationPatch, type CreateConversationRequest, type MessageAttachment, type MessageListQuery, type ConversationUsage, type PageContext } from '../../shared/conversations.js';
11
11
  import type { ModelService } from '../../shared/models.js';
12
12
  export declare class ChatApi {
13
13
  private readonly api;
@@ -28,6 +28,23 @@ export declare class ChatApi {
28
28
  /** Discards an upload not sent yet. */
29
29
  discardAttachment(id: string): Promise<void>;
30
30
  markRead(id: string): Promise<ConversationDetail>;
31
+ /**
32
+ * One message while the agent works on the conversation: it joins that work (steered into the running turn, or
33
+ * taken as the next one). Answers the saved message, `metadata.queue` `queued` until the agent takes it; refused
34
+ * (`409`) when the agent is not working, when it is sent as usual instead.
35
+ */
36
+ queue(id: string, input: {
37
+ readonly clientId: string;
38
+ readonly content: string;
39
+ readonly context?: PageContext;
40
+ readonly attachmentIds?: readonly string[];
41
+ }): Promise<AppUIMessage>;
42
+ /** Deletes the conversation for good, with its messages and files. */
43
+ deleteConversation(id: string): Promise<void>;
44
+ /** Takes back a queued message its runner has not taken (`409` once it has). */
45
+ withdraw(id: string, messageId: string): Promise<void>;
46
+ /** Tokens, context window and cost over the conversation's runs, as far as their tools report them. */
47
+ usage(id: string, signal?: AbortSignal): Promise<ConversationUsage>;
31
48
  /** Requests cancellation. Only execution.status=idle confirms termination and synchronized history. */
32
49
  stop(id: string): Promise<ConversationDetail>;
33
50
  agents(): Promise<ChatAgent[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sour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AC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;KAC5C,GACA,OAAO,CAAC,YAAY,CAAC;IAcxB,sEAAsE;IACzD,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1D,gFAAgF;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnE,uGAAuG;IAChG,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI1E,uGAAuG;IAChG,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIvC,MAAM,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAI3C,wFAAwF;IACjF,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAIrD,WAAW,IAAI,OAAO,CAAC,eAAe,CAAC;IAIvC,iBAAiB,CACtB,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,eAAe,CAAC;IAIpB,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IAIjC,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAItE,OAAO,CAAC,IAAI;YAUE,GAAG;IAQjB,OAAO,CAAC,IAAI;YAaE,IAAI;CAYnB"}
@@ -159,6 +159,43 @@ export class ChatApi {
159
159
  markRead(id) {
160
160
  return this.send(chatPath('markRead', id), 'POST');
161
161
  }
162
+ /**
163
+ * One message while the agent works on the conversation: it joins that work (steered into the running turn, or
164
+ * taken as the next one). Answers the saved message, `metadata.queue` `queued` until the agent takes it; refused
165
+ * (`409`) when the agent is not working, when it is sent as usual instead.
166
+ */
167
+ queue(id, input) {
168
+ return this.send(chatPath('queue', id), 'POST', {
169
+ message: {
170
+ id: input.clientId,
171
+ role: 'user',
172
+ parts: [{ type: 'text', text: input.content }],
173
+ },
174
+ ...(input.context ? { context: input.context } : {}),
175
+ ...(input.attachmentIds?.length
176
+ ? { attachmentIds: input.attachmentIds }
177
+ : {}),
178
+ });
179
+ }
180
+ /** Deletes the conversation for good, with its messages and files. */
181
+ async deleteConversation(id) {
182
+ await this.api.request({
183
+ path: chatPath('conversation', id),
184
+ method: 'DELETE',
185
+ });
186
+ }
187
+ /** Takes back a queued message its runner has not taken (`409` once it has). */
188
+ async withdraw(id, messageId) {
189
+ await this.api.request({
190
+ path: `${chatPath('messages', id)}/${encodeURIComponent(messageId)}/withdraw`,
191
+ method: 'POST',
192
+ json: {},
193
+ });
194
+ }
195
+ /** Tokens, context window and cost over the conversation's runs, as far as their tools report them. */
196
+ usage(id, signal) {
197
+ return this.get(chatPath('usage', id), undefined, signal);
198
+ }
162
199
  /** Requests cancellation. Only execution.status=idle confirms termination and synchronized history. */
163
200
  stop(id) {
164
201
  return this.send(chatPath('stop', id), 'POST');
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../client/chat/api.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,IAAI,CAAC;AAMrE,OAAO,EAAE,cAAc,EAAkB,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EACL,QAAQ,GAeT,MAAM,+BAA+B,CAAC;AAMvC,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC;AAED,SAAS,KAAK,CAAC,KAAY;IACzB,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAC1B,CAAC,KAAK,EAAgD,EAAE,CACtD,KAAK,CAAC,CAAC,CAAC,K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IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { QueryClient, QueryKey } from '@tanstack/react-query';
2
+ /** How long announcements gather before the queries they name are read again. */
3
+ export declare const CHAT_INVALIDATION_MS = 150;
4
+ interface CoalescedInvalidation {
5
+ /** The query is stale: read it again, once for the announcements that arrive meanwhile. */
6
+ readonly add: (queryKey: QueryKey) => void;
7
+ readonly stop: () => void;
8
+ }
9
+ /**
10
+ * A run announces its conversation many times in a moment (the message, its state, its title); each announcement
11
+ * marking the same lists and details stale would read them again every time. Gathered for `delay`, they are read once.
12
+ */
13
+ export declare function coalescedInvalidation(client: Pick<QueryClient, 'invalidateQueries'>, delay?: number): CoalescedInvalidation;
14
+ export {};
15
+ //# sourceMappingURL=coalesced-invalidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coalesced-invalidation.d.ts","sourceRoot":"","sources":["../../../client/chat/coalesced-invalidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEnE,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,UAAU,qBAAqB;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,EAC9C,KAAK,GAAE,MAA6B,GACnC,qBAAqB,CAmBvB"}
@@ -0,0 +1,29 @@
1
+ /** How long announcements gather before the queries they name are read again. */
2
+ export const CHAT_INVALIDATION_MS = 150;
3
+ /**
4
+ * A run announces its conversation many times in a moment (the message, its state, its title); each announcement
5
+ * marking the same lists and details stale would read them again every time. Gathered for `delay`, they are read once.
6
+ */
7
+ export function coalescedInvalidation(client, delay = CHAT_INVALIDATION_MS) {
8
+ const keys = new Map();
9
+ let timer;
10
+ return {
11
+ add(queryKey) {
12
+ keys.set(JSON.stringify(queryKey), queryKey);
13
+ timer ??= setTimeout(() => {
14
+ timer = undefined;
15
+ const due = [...keys.values()];
16
+ keys.clear();
17
+ for (const key of due)
18
+ void client.invalidateQueries({ queryKey: key });
19
+ }, delay);
20
+ },
21
+ stop() {
22
+ if (timer !== undefined)
23
+ clearTimeout(timer);
24
+ timer = undefined;
25
+ keys.clear();
26
+ },
27
+ };
28
+ }
29
+ //# sourceMappingURL=coalesced-invalidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coalesced-invalidation.js","sourceRoot":"","sources":["../../../client/chat/coalesced-invalidation.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAQxC;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAA8C,EAC9C,QAAgB,oBAAoB;IAEpC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAoB,CAAC;IACzC,IAAI,KAAgD,CAAC;IACrD,OAAO;QACL,GAAG,CAAC,QAAQ;YACV,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC7C,KAAK,KAAK,UAAU,CAAC,GAAG,EAAE;gBACxB,KAAK,GAAG,SAAS,CAAC;gBAClB,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACb,KAAK,MAAM,GAAG,IAAI,GAAG;oBAAE,KAAK,MAAM,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1E,CAAC,EAAE,KAAK,CAAC,CAAC;QACZ,CAAC;QACD,IAAI;YACF,IAAI,KAAK,KAAK,SAAS;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAC7C,KAAK,GAAG,SAAS,CAAC;YAClB,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -13,7 +13,7 @@ import { type ReactElement, type ReactNode } from 'react';
13
13
  import type { ConversationDetail } from '../../shared/conversations.js';
14
14
  import type { AppUIMessage, AppUIToolApprovalInput } from '../../shared/online-agent.js';
15
15
  import { ChatApi } from './api.js';
16
- import { ChatSubmissions } from './submissions.js';
16
+ import { ChatSubmissions, type SubmissionSend } from './submissions.js';
17
17
  import { type MessagesAction, type MessagesState } from './message-model.js';
18
18
  /** SDK transport state is presentation only. Business completion always comes from saved execution/history. */
19
19
  export type StreamState = {
@@ -76,6 +76,13 @@ export declare class ChatController {
76
76
  watch(id: string): () => void;
77
77
  reconnect(): void;
78
78
  messageUpdated(id: string, messageId: string, revision: number): void;
79
+ /**
80
+ * A message sent while the agent works: it joins that work and shows as queued until the agent takes it. Throws
81
+ * the server's refusal (`409` when the agent is not working any more), which the caller answers by sending it.
82
+ */
83
+ queue(id: string, input: SubmissionSend): Promise<AppUIMessage>;
84
+ /** Takes back a queued message the agent has not taken; rereads it either way, so it shows where it stands. */
85
+ withdraw(id: string, messageId: string): Promise<void>;
79
86
  private sendInput;
80
87
  state(id: string): StreamState | undefined;
81
88
  receive(id: string, known?: ConversationDetail): void;
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../client/chat/controller.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,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