@nocobase/app-plugin-agents 1.0.0-beta.18 → 1.0.0-beta.19

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 (93) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +7 -1
  3. package/dist/client/chat/message-model.js +1 -1
  4. package/dist/client/chat/message-model.js.map +1 -1
  5. package/dist/client/locales/de-DE.d.ts.map +1 -1
  6. package/dist/client/locales/de-DE.js +8 -0
  7. package/dist/client/locales/de-DE.js.map +1 -1
  8. package/dist/client/locales/es-ES.d.ts.map +1 -1
  9. package/dist/client/locales/es-ES.js +8 -0
  10. package/dist/client/locales/es-ES.js.map +1 -1
  11. package/dist/client/locales/fr-FR.d.ts.map +1 -1
  12. package/dist/client/locales/fr-FR.js +8 -0
  13. package/dist/client/locales/fr-FR.js.map +1 -1
  14. package/dist/client/locales/id-ID.d.ts.map +1 -1
  15. package/dist/client/locales/id-ID.js +8 -0
  16. package/dist/client/locales/id-ID.js.map +1 -1
  17. package/dist/client/locales/ja-JP.d.ts.map +1 -1
  18. package/dist/client/locales/ja-JP.js +8 -0
  19. package/dist/client/locales/ja-JP.js.map +1 -1
  20. package/dist/client/locales/pt-BR.d.ts.map +1 -1
  21. package/dist/client/locales/pt-BR.js +8 -0
  22. package/dist/client/locales/pt-BR.js.map +1 -1
  23. package/dist/client/locales/runtimes.en-US.d.ts +8 -0
  24. package/dist/client/locales/runtimes.en-US.d.ts.map +1 -1
  25. package/dist/client/locales/runtimes.en-US.js +8 -0
  26. package/dist/client/locales/runtimes.en-US.js.map +1 -1
  27. package/dist/client/locales/runtimes.zh-CN.d.ts.map +1 -1
  28. package/dist/client/locales/runtimes.zh-CN.js +8 -0
  29. package/dist/client/locales/runtimes.zh-CN.js.map +1 -1
  30. package/dist/client/locales/vi-VN.d.ts.map +1 -1
  31. package/dist/client/locales/vi-VN.js +8 -0
  32. package/dist/client/locales/vi-VN.js.map +1 -1
  33. package/dist/client/locales/zh-TW.d.ts.map +1 -1
  34. package/dist/client/locales/zh-TW.js +8 -0
  35. package/dist/client/locales/zh-TW.js.map +1 -1
  36. package/dist/client/pages/runtimes/connect.js +1 -1
  37. package/dist/client/pages/runtimes/runner-cells.d.ts +1 -1
  38. package/dist/client/pages/runtimes/runner-cells.d.ts.map +1 -1
  39. package/dist/client/pages/runtimes/runner-cells.js +31 -7
  40. package/dist/client/pages/runtimes/runner-cells.js.map +1 -1
  41. package/dist/client/pages/runtimes/runner-sheet.js +1 -1
  42. package/dist/client/pages/runtimes/runner-sheet.js.map +1 -1
  43. package/dist/package.json +1 -1
  44. package/dist/server/core/runs/claim.d.ts.map +1 -1
  45. package/dist/server/core/runs/claim.js +3 -3
  46. package/dist/server/core/runs/claim.js.map +1 -1
  47. package/dist/server/core/runs/ports.d.ts +2 -0
  48. package/dist/server/core/runs/ports.d.ts.map +1 -1
  49. package/dist/server/core/runs/ports.js.map +1 -1
  50. package/dist/server/core/runs/preview.d.ts.map +1 -1
  51. package/dist/server/core/runs/preview.js +1 -0
  52. package/dist/server/core/runs/preview.js.map +1 -1
  53. package/dist/server/core/runs/run.service.d.ts +1 -1
  54. package/dist/server/core/runs/run.service.d.ts.map +1 -1
  55. package/dist/server/core/runs/run.service.js +17 -2
  56. package/dist/server/core/runs/run.service.js.map +1 -1
  57. package/dist/server/core/runs/run.store.d.ts.map +1 -1
  58. package/dist/server/core/runs/run.store.js +1 -0
  59. package/dist/server/core/runs/run.store.js.map +1 -1
  60. package/dist/server/core/runs/transitions.d.ts +1 -1
  61. package/dist/server/core/runs/transitions.d.ts.map +1 -1
  62. package/dist/server/core/runs/workload.d.ts.map +1 -1
  63. package/dist/server/core/runs/workload.js +2 -1
  64. package/dist/server/core/runs/workload.js.map +1 -1
  65. package/dist/server/online/agent/messages/projection.d.ts.map +1 -1
  66. package/dist/server/online/agent/messages/projection.js +4 -0
  67. package/dist/server/online/agent/messages/projection.js.map +1 -1
  68. package/dist/server/routes/runners/runner.d.ts.map +1 -1
  69. package/dist/server/routes/runners/runner.js +2 -0
  70. package/dist/server/routes/runners/runner.js.map +1 -1
  71. package/dist/server/routes/schemas.d.ts.map +1 -1
  72. package/dist/server/routes/schemas.js +8 -4
  73. package/dist/server/routes/schemas.js.map +1 -1
  74. package/dist/server/runners/runner.service.d.ts +1 -2
  75. package/dist/server/runners/runner.service.d.ts.map +1 -1
  76. package/dist/server/runners/runner.service.js +14 -9
  77. package/dist/server/runners/runner.service.js.map +1 -1
  78. package/dist/server/runners/runner.store.d.ts.map +1 -1
  79. package/dist/server/runners/runner.store.js +11 -0
  80. package/dist/server/runners/runner.store.js.map +1 -1
  81. package/dist/shared/runners.d.ts +13 -6
  82. package/dist/shared/runners.d.ts.map +1 -1
  83. package/dist/shared/runners.js +4 -0
  84. package/dist/shared/runners.js.map +1 -1
  85. package/dist/shared/runs.d.ts +1 -0
  86. package/dist/shared/runs.d.ts.map +1 -1
  87. package/dist/shared/runs.js.map +1 -1
  88. package/docs/ui-message-clients.md +3 -1
  89. package/docs/ui-messages.md +3 -1
  90. package/package.json +14 -14
  91. package/skills/nocobase-app-plugin-agents/references/extension-points.md +2 -0
  92. package/skills/nocobase-app-plugin-agents/references/online-agent.md +2 -0
  93. package/skills/nocobase-app-plugin-agents/references/runners.md +4 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@nocobase/app-plugin-agents",
3
3
  "displayName": "Agents",
4
4
  "description": "Agents for NocoBase applications: agents, the model services online agents call, their runs and conversations, and the runners people connect to run them (registration, the long-poll claim, slots, the sweeper, build jobs, and the runner and CLI tarballs the application serves).",
5
- "version": "1.0.0-beta.18",
5
+ "version": "1.0.0-beta.19",
6
6
  "type": "module",
7
7
  "prettier": "@nocobase/dev-config/prettier",
8
8
  "engines": {
@@ -158,8 +158,8 @@
158
158
  "sqlite-vec": "^0.1.9",
159
159
  "yaml": "^2.9.0",
160
160
  "zod": "^4.6.5",
161
- "@nocobase/agent-protocol": "^0.1.0-beta.12",
162
- "@nocobase/app-cli-client": "^0.1.0-beta.13",
161
+ "@nocobase/app-cli-client": "^0.1.0-beta.14",
162
+ "@nocobase/agent-protocol": "^0.1.0-beta.13",
163
163
  "@nocobase/cli-envelope": "^0.1.0-beta.1"
164
164
  },
165
165
  "peerDependencies": {
@@ -176,17 +176,17 @@
176
176
  "react-router": "^7.0.2",
177
177
  "recharts": "^3.8.0",
178
178
  "remark-gfm": "^4.0.1",
179
- "@nocobase/app-cli": "^1.0.0-beta.26",
180
- "@nocobase/app-client": "^4.0.0-beta.1",
181
- "@nocobase/app-plugin-authentication": "^2.0.0-beta.12",
182
- "@nocobase/app-plugin-authorization": "^1.0.0-beta.30",
179
+ "@nocobase/app-plugin-authentication": "^2.0.0-beta.13",
180
+ "@nocobase/app-plugin-authorization": "^1.0.0-beta.31",
181
+ "@nocobase/app-cli": "^1.0.0-beta.27",
183
182
  "@nocobase/app-plugin-file": "^1.0.0-beta.26",
184
- "@nocobase/app-server": "^3.0.0-beta.2",
183
+ "@nocobase/db": "^1.0.0-beta.22",
184
+ "@nocobase/app-server": "^3.0.0-beta.3",
185
185
  "@nocobase/authorization": "^1.0.0-beta.15",
186
- "@nocobase/db": "^1.0.0-beta.21",
186
+ "@nocobase/service-provider": "^0.0.2-beta.2",
187
+ "@nocobase/app-client": "^4.0.0-beta.2",
187
188
  "@nocobase/i18n": "^2.0.0-beta.1",
188
- "@nocobase/markdown-mermaid": "^0.1.0-beta.2",
189
- "@nocobase/service-provider": "^0.0.2-beta.2"
189
+ "@nocobase/markdown-mermaid": "^0.1.0-beta.2"
190
190
  },
191
191
  "devDependencies": {
192
192
  "@testing-library/react": "^16.3.2",
@@ -201,12 +201,12 @@
201
201
  "react-dom": "^19.2.8",
202
202
  "typescript": "^6.0.3",
203
203
  "vitest": "^4.1.10",
204
- "@nocobase/agent-runner": "0.1.0-beta.15",
204
+ "@nocobase/agent-runner": "0.1.0-beta.16",
205
205
  "@nocobase/app-testing": "0.1.0-beta.6",
206
- "@nocobase/db-postgres": "0.1.0-beta.5",
207
206
  "@nocobase/db-sqlite": "0.1.0-beta.6",
208
207
  "@nocobase/dev-config": "0.1.0-beta.24",
209
- "@nocobase/jobs": "0.1.0-beta.3"
208
+ "@nocobase/jobs": "0.1.0-beta.3",
209
+ "@nocobase/db-postgres": "0.1.0-beta.5"
210
210
  },
211
211
  "scripts": {
212
212
  "build": "tsc -p tsconfig.json && node ./scripts/bundle-just-bash.mjs && nocobase-db-manifests",
@@ -1,5 +1,7 @@
1
1
  # Extension points
2
2
 
3
+ A subject's optional `sink.onCancelRequested(tx, run)` runs once in the accepted stop transaction, before `onRunFinished` for a queued run. Its writes roll back with the stop if it throws. `run.cancelledById` identifies a human stop; `runs.cancel(id, null, tx?)` is an incidental system cancellation. An active stop request keeps its first actor and does not replay this callback on a repeated request. Personal runner request rejection uses the same callback. Terminal delivery alone must not infer a new human instruction.
4
+
3
5
  Everything the App contributes goes through `agentsToken` (`@nocobase/app-plugin-agents/server/tokens`), resolved in one of the App's service providers when it boots. Text people read is an `I18nText` (`{ key, ns }`) in the App's own namespace. The README's "Extension points" section describes each field; this is the map. Where the two disagree, the types exported from `server/tokens` (the `Agents` interface) are authoritative.
4
6
 
5
7
  | Extension point | Contributes | Typical use |
@@ -123,6 +123,8 @@ Native `POST /api/agents/conversations/:id/messages` accepts only the current SD
123
123
 
124
124
  In both native realtime and background modes, `content.original` is the only complete internal UIMessage, with the same ID as its record and raw JSON tool inputs/results, reasoning and provider/approval evidence. Both modes share the same original-message storage and raw tool JSON, not a separate background ModelMessage codec. Public tools require explicit `public.input`/`public.output` projections. All public history reads, including background `history()`, and realtime streams use current projections; current `toModelOutput` rules separately derive internal model input from the original when it is read. Both conversions use detached copies and never execute tools. Missing or failed projections never expose the raw original. No duplicate full message, migration, compatibility fallback or format version is used. SDK `needsApproval` tools require these projections. The approval endpoint accepts only `{ messageId, executionId, approval: { id, approved, reason? } }` and resumes from trusted persisted history. Waiting approvals, denials and outcomes update the same message with increasing metadata revision; use message revision notifications and `GET messages?ids=...` to reread changes. Approval retains its owner/execution/message binding and does not bypass active execution occupancy. Background structured execution stays separate.
125
125
 
126
+ 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.
127
+
126
128
  Native and Runner realtime receive use the standard SDK stream with optional shared Redis recovery. Background sessions have no browser receive transport and do not require Redis. Browser disconnect never cancels generation. Finish ends the HTTP response, possibly while waiting for approval; execution detail and saved history determine business state. Failed persistence keeps occupancy and supports explicit finalization without reexecution. Missing streams require history/status reconciliation, never automatic resend. A lost producer remains interrupted and is not automatically restarted. The public ChatProvider and installed Registry/Examples consumers use SDK Chat ownership and GET recovery. See [UI messages](../../../docs/ui-messages.md) and [client coordination](../../../docs/ui-message-clients.md) for configuration, costs and limits.
127
129
 
128
130
  Permission-restricted configuration and custom permission/approval protocols remain unsupported. Native scopes may explicitly select Skills and bash; follow [Native Skills and application CLI](../../../docs/native-sandbox.md) for current support trees, VFS-only inputs, lazy `context.execution`, existing business authorization and approval/new-environment boundaries. SDK approval is native-only; Runner remote tool approval is refused. Verify with isolated model fixtures and authorized application services, never real business writes.
@@ -56,3 +56,7 @@ The runner finds each coding tool on its PATH and reports whether it is signed i
56
56
  Quota exhaustion is scoped to the runtime and a tool, provider prefix or model. Known resets restore claim eligibility automatically; unknown resets require the runtime owner or an administrator to clear the selected mark after restoring quota. This never restarts failed, withdrawn or expired work. Runtime Overview, Workspaces and Runs load separately; the list contains summaries. Use runtime workspaces for directories and runtime quota clear with structured tool/scope/target/window fields for unknown-reset marks (no client revision); known resets clear automatically. Upgrade runners for usage/reset reporting; old runners only report the failure. See the package README for fields, endpoint contracts and read/write costs.
57
57
 
58
58
  For application-owned system agents, `useAgentOption(id)` in the client kit reads the same viewer-scoped agent detail endpoint and includes quota; `useAgentOptions()` lists discovered runner agents only. A final failure reuses accepted event metadata for quota deduplication, while new event sequences remain new observations. The failure snapshot is retained even when its windows were already applied.
59
+
60
+ ## Online capacity
61
+
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.