@adonis-agora/agent 0.46.0 → 0.48.0

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 (89) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/assets/spa/assets/{index-7XqfoeQH.js → index-Be6OClIm.js} +1 -1
  3. package/dist/assets/spa/index.html +1 -1
  4. package/dist/providers/agent_provider.d.ts +1 -1
  5. package/dist/providers/agent_provider.d.ts.map +1 -1
  6. package/dist/providers/agent_provider.js +91 -51
  7. package/dist/providers/agent_provider.js.map +1 -1
  8. package/dist/src/agent-service.d.ts +27 -8
  9. package/dist/src/agent-service.d.ts.map +1 -1
  10. package/dist/src/agent-service.js +66 -7
  11. package/dist/src/agent-service.js.map +1 -1
  12. package/dist/src/client/sse.d.ts +9 -10
  13. package/dist/src/client/sse.d.ts.map +1 -1
  14. package/dist/src/client/sse.js +15 -72
  15. package/dist/src/client/sse.js.map +1 -1
  16. package/dist/src/define_config.d.ts +22 -42
  17. package/dist/src/define_config.d.ts.map +1 -1
  18. package/dist/src/define_config.js +2 -2
  19. package/dist/src/define_config.js.map +1 -1
  20. package/dist/src/durable/agent-run-workflow.d.ts.map +1 -1
  21. package/dist/src/durable/agent-run-workflow.js +8 -1
  22. package/dist/src/durable/agent-run-workflow.js.map +1 -1
  23. package/dist/src/durable/durable-agent-runner.d.ts.map +1 -1
  24. package/dist/src/durable/durable-agent-runner.js +3 -0
  25. package/dist/src/durable/durable-agent-runner.js.map +1 -1
  26. package/dist/src/genui/index.d.ts +1 -1
  27. package/dist/src/genui/index.js +1 -1
  28. package/dist/src/index.d.ts +5 -6
  29. package/dist/src/index.d.ts.map +1 -1
  30. package/dist/src/index.js +4 -5
  31. package/dist/src/index.js.map +1 -1
  32. package/dist/src/media/index.d.ts +7 -0
  33. package/dist/src/media/index.d.ts.map +1 -0
  34. package/dist/src/media/index.js +7 -0
  35. package/dist/src/media/index.js.map +1 -0
  36. package/dist/src/media/media-attachment-staging.d.ts +115 -0
  37. package/dist/src/media/media-attachment-staging.d.ts.map +1 -0
  38. package/dist/src/media/media-attachment-staging.js +145 -0
  39. package/dist/src/media/media-attachment-staging.js.map +1 -0
  40. package/dist/src/redis-token-stream-sink.d.ts +2 -3
  41. package/dist/src/redis-token-stream-sink.d.ts.map +1 -1
  42. package/dist/src/redis-token-stream-sink.js +2 -3
  43. package/dist/src/redis-token-stream-sink.js.map +1 -1
  44. package/dist/src/runners/inline-agent-runner.d.ts +3 -1
  45. package/dist/src/runners/inline-agent-runner.d.ts.map +1 -1
  46. package/dist/src/runners/inline-agent-runner.js +17 -1
  47. package/dist/src/runners/inline-agent-runner.js.map +1 -1
  48. package/dist/src/spi/agent-store.d.ts +8 -0
  49. package/dist/src/spi/agent-store.d.ts.map +1 -1
  50. package/dist/src/spi/agent-store.js +8 -1
  51. package/dist/src/spi/agent-store.js.map +1 -1
  52. package/dist/src/spi/attachment-staging.d.ts +30 -12
  53. package/dist/src/spi/attachment-staging.d.ts.map +1 -1
  54. package/dist/src/spi/token-stream-sink.d.ts +2 -3
  55. package/dist/src/spi/token-stream-sink.d.ts.map +1 -1
  56. package/dist/src/spi/token-stream-sink.js.map +1 -1
  57. package/dist/src/spi/tool.d.ts +1 -2
  58. package/dist/src/spi/tool.d.ts.map +1 -1
  59. package/dist/src/sse.d.ts +0 -20
  60. package/dist/src/sse.d.ts.map +1 -1
  61. package/dist/src/sse.js +0 -27
  62. package/dist/src/sse.js.map +1 -1
  63. package/dist/src/stores/factory.d.ts +18 -65
  64. package/dist/src/stores/factory.d.ts.map +1 -1
  65. package/dist/src/stores/factory.js +24 -56
  66. package/dist/src/stores/factory.js.map +1 -1
  67. package/dist/src/stores/lucid.d.ts +1 -0
  68. package/dist/src/stores/lucid.d.ts.map +1 -1
  69. package/dist/src/stores/lucid.js +9 -2
  70. package/dist/src/stores/lucid.js.map +1 -1
  71. package/dist/src/stream-events.d.ts +2 -2
  72. package/dist/src/testing/in-memory-attachment-staging.d.ts +7 -1
  73. package/dist/src/testing/in-memory-attachment-staging.d.ts.map +1 -1
  74. package/dist/src/testing/in-memory-attachment-staging.js +22 -2
  75. package/dist/src/testing/in-memory-attachment-staging.js.map +1 -1
  76. package/dist/src/testing/in-memory-store.d.ts +1 -0
  77. package/dist/src/testing/in-memory-store.d.ts.map +1 -1
  78. package/dist/src/testing/in-memory-store.js +7 -1
  79. package/dist/src/testing/in-memory-store.js.map +1 -1
  80. package/dist/src/types.d.ts +36 -1
  81. package/dist/src/types.d.ts.map +1 -1
  82. package/dist/stubs/config/agent.stub +3 -6
  83. package/package.json +10 -1
  84. package/skills/agent-setup/SKILL.md +27 -60
  85. package/skills/agent-testing/SKILL.md +5 -5
  86. package/dist/src/stores/ledger-quota.d.ts +0 -23
  87. package/dist/src/stores/ledger-quota.d.ts.map +0 -1
  88. package/dist/src/stores/ledger-quota.js +0 -32
  89. package/dist/src/stores/ledger-quota.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @adonis-agora/agent
2
2
 
3
+ ## 0.48.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#220](https://github.com/DavideCarvalho/adonis-agora-agent/pull/220) [`17ea478`](https://github.com/DavideCarvalho/adonis-agora-agent/commit/17ea478a7531d15bf42b87335036ed04e319ccab) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - **BREAKING — the agent stream protocol is the only wire.** `POST /agent/chat` and `GET /agent/chat/:runId/stream` always write the chat stream protocol shared with `@dudousxd/nestjs-agent`: `event: meta`, then one numbered `AgentStreamEvent` per `data:` frame (`{"kind":"text","text":…}`, `ui`, `elicitation`, `approval-requested`, reasoning, tool calls, steps, title, …), then `event: done` — or `event: error` `{ code, message }` for a failed run. `@dudousxd/nestjs-agent-react` and `@adonis-agora/agent/client` / `./react` read it unchanged.
8
+
9
+ - **The `'legacy'` envelope is removed** — `data: {"delta":…}` text, the named `event: component` / `event: elicitation` / `event: approval` frames and the `[error]` text delta are no longer written, and `@adonis-agora/agent/client`'s `decodeFrame` no longer reads them (a `{"delta"}` payload decodes to `null`).
10
+ - **The `streamProtocol` option is removed** from `defineConfig`, with no shim: delete `streamProtocol: 'agent'` from `config/agent.ts`; if you relied on the old `'legacy'` default, move the browser to `@adonis-agora/agent/client` (or `./react`, or `@dudousxd/nestjs-agent-react`) or read `{"kind":"text","text":…}` where you read `{"delta":…}`.
11
+ - **`frameToSse` and the `StreamProtocol` type are no longer exported.** Use `AgentSseEncoder` (or the pure `frameToEvents`).
12
+
13
+ `ChatFrame` / `ChatPart` / `foldPart` are unchanged, so code built on the package client needs no change beyond the server config.
14
+
15
+ ## 0.47.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#218](https://github.com/DavideCarvalho/adonis-agora-agent/pull/218) [`a27f79b`](https://github.com/DavideCarvalho/adonis-agora-agent/commit/a27f79bc2f7a0d5dceb6b1ffa7b857ca467fab25) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Chat attachments by id, media-backed, bring-your-own storage — matching `@dudousxd/nestjs-agent`'s refs-only contract.
20
+
21
+ - **One `attachments` option (BREAKING).** `attachments: attachmentStores.media()` stores uploads through `@adonis-agora/media` (an optional peer; any Drive disk — S3, GCS, R2, the filesystem): a media row per file in its own collection, owned by the actor, with signed short-lived urls by default (`visibility`, `urlExpiresInSeconds`, `resolveUrl`, `canAccess`, `maxBytes`, `allowedContentTypes`, `disk`, `collection`). `attachmentStores.memory({ maxBytes?, allowedContentTypes? })` for tests; or pass your own `AttachmentStagingStore`. Replaces `attachmentStaging`, `attachmentMaxBytes` and `attachmentAllowedContentTypes`; limits now come from the store's `describe()`. `@adonis-agora/agent/media` exports `MediaAttachmentStaging` to wire over a media setup of your own.
22
+ - **Refs only (BREAKING).** `POST /agent/chat` takes `attachments: [{ mediaId }]` — anything else in an entry is `400`, at most 10 — and resolves each through the store for the calling actor (`403` for one it may not use, `501` when attachments are off). The url the model fetches is never taken from the request.
23
+ - **`AttachmentStagingStore.resolve({ mediaId, actor })`** is now required (the store mints the url per request); `describe()` is optional. `GET /agent/threads/:id` re-mints each attachment's url by `mediaId`, so an old turn's signed link has not expired. `GET /agent/config` reports the store's limits.
24
+
25
+ - [#216](https://github.com/DavideCarvalho/adonis-agora-agent/pull/216) [`b032763`](https://github.com/DavideCarvalho/adonis-agora-agent/commit/b03276346c6a7679b795a598da06f49c945a7f57) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - One way each, matching `@dudousxd/nestjs-agent`'s consolidation ([#230](https://github.com/DavideCarvalho/adonis-agora-agent/issues/230)):
26
+
27
+ - **One `quota` option (BREAKING).** `quota: { limits: { day?: { tokens?, usd? }, month?: { tokens?, usd? } } }` or a `QuotaProvider`. The `quotas.*` factories (`ledger`, `memory`, `windows`), `LedgerQuotaStore` and `QuotaStore`-as-`quota` are removed; migrate `quota: quotas.ledger({ limitTokens: N })` to `quota: { limits: { day: { tokens: N } } }`. The check moved to the send (`429 quota_exceeded` before the turn starts). Drain in-flight durable runs started under the old option first — their journals hold the loop's quota checkpoints.
28
+ - **`GET /agent/quota/today` removed** — read the day window of `GET /agent/quota`. The governance dashboard now does.
29
+ - **`activeRunId` only.** Thread summaries and details carry `activeRunId` (the run streaming right now, `null` otherwise) instead of `ThreadDetail.activeStreamId`. The runners set it before a turn starts and clear it when it ends (`clearActiveStream`, optional on `AgentStore`, only clears a pointer still naming that run), so a reloading client resumes only a live run.
30
+ - **`GET /agent/config`** — `{ attachments: { enabled, upload, maxBytes, allowedContentTypes, maxPerMessage }, models: { enabled }, quota: { enforced }, identity: { anonymous } }`, what the React `useAgentConfig` reads.
31
+
3
32
  ## 0.46.0
4
33
 
5
34
  ### Minor Changes