ai 7.0.177 → 7.0.179

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 (53) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/default-stop-condition-wtuJTiTo.js +4213 -0
  3. package/dist/default-stop-condition-wtuJTiTo.js.map +1 -0
  4. package/dist/index-CM_8u8gB.d.ts +12107 -0
  5. package/dist/index-CM_8u8gB.d.ts.map +1 -0
  6. package/dist/index.d.ts +3 -11788
  7. package/dist/index.js +680 -4732
  8. package/dist/index.js.map +1 -1
  9. package/dist/internal/index.d.ts +4 -3301
  10. package/dist/internal/index.d.ts.map +1 -1
  11. package/dist/internal/index.js +2 -3819
  12. package/dist/simulate-readable-stream-Bi5kQKbv.js +25 -0
  13. package/dist/simulate-readable-stream-Bi5kQKbv.js.map +1 -0
  14. package/dist/simulate-readable-stream-BuwR4IbD.d.ts +21 -0
  15. package/dist/simulate-readable-stream-BuwR4IbD.d.ts.map +1 -0
  16. package/dist/test/index.d.ts +2 -20
  17. package/dist/test/index.d.ts.map +1 -1
  18. package/dist/test/index.js +3 -23
  19. package/dist/test/index.js.map +1 -1
  20. package/docs/02-foundations/02-providers-and-models.mdx +1 -0
  21. package/docs/03-agents/06-policy-tool-approvals.mdx +27 -2
  22. package/docs/03-agents/06-tool-approvals.mdx +2 -1
  23. package/docs/03-ai-sdk-core/18-tools.mdx +7 -2
  24. package/docs/03-ai-sdk-core/33-extractions.mdx +21 -4
  25. package/docs/03-ai-sdk-core/36-realtime.mdx +3 -1
  26. package/docs/03-ai-sdk-core/36-transcription.mdx +2 -2
  27. package/docs/03-ai-sdk-core/37-speech.mdx +1 -0
  28. package/docs/03-ai-sdk-core/60-telemetry.mdx +52 -4
  29. package/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +124 -2
  30. package/docs/07-reference/01-ai-sdk-core/14-extract.mdx +13 -4
  31. package/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +6 -2
  32. package/docs/07-reference/05-ai-sdk-errors/ai-extraction-refusal-error.mdx +33 -0
  33. package/docs/07-reference/05-ai-sdk-errors/ai-extraction-unsupported-field-type-error.mdx +36 -0
  34. package/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-signature-error.mdx +1 -0
  35. package/package.json +13 -13
  36. package/src/agent/tool-loop-agent-settings.ts +2 -1
  37. package/src/extract/extract-events.ts +135 -0
  38. package/src/extract/extract.ts +177 -74
  39. package/src/extract/index.ts +6 -0
  40. package/src/extract/restricted-telemetry-dispatcher.ts +97 -0
  41. package/src/generate-text/execute-tools-from-stream.ts +14 -8
  42. package/src/generate-text/generate-text.ts +26 -10
  43. package/src/generate-text/stream-language-model-call.ts +3 -0
  44. package/src/generate-text/stream-text.ts +11 -2
  45. package/src/realtime/browser-realtime-live-websocket.ts +23 -5
  46. package/src/realtime/realtime-session.ts +68 -29
  47. package/src/telemetry/create-telemetry-dispatcher.ts +12 -0
  48. package/src/telemetry/filter-telemetry-event.ts +2 -0
  49. package/src/telemetry/redact-telemetry-credentials.ts +13 -1
  50. package/src/telemetry/telemetry.ts +34 -0
  51. package/src/telemetry/tracing-channel.ts +2 -1
  52. package/dist/index.d.ts.map +0 -1
  53. package/dist/internal/index.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.179
4
+
5
+ ### Patch Changes
6
+
7
+ - 7e55599: feat(gateway): support Live models over WebSocket
8
+
9
+ - `gateway.experimental_realtime()` returns a continuous Live model for `openai/gpt-live-1` and `openai/gpt-live-1.1`. It connects to the Gateway Live route and speaks the normalized Live protocol (`session-start`, PCM16 audio, `context-append`, `session-close` with final usage). Pass `{ api: 'live' }` for other Live model IDs or `{ api: 'realtime' }` to force the realtime route. Before, these model IDs opened the realtime route, which rejected them with `invalid_model`.
10
+ - `gateway.experimental_realtime.getToken()` mints Live-bound client secrets for Live models.
11
+ - `experimental_useRealtime` and the realtime session can connect a continuous model straight to the provider with a short-lived token (`api.token`) when the model explicitly declares the `client-secret-websocket` connection. Before, continuous WebSocket sessions required an application relay.
12
+
13
+ - Updated dependencies [7e55599]
14
+ - Updated dependencies [beccad3]
15
+ - @ai-sdk/gateway@4.0.152
16
+
17
+ ## 7.0.178
18
+
19
+ ### Patch Changes
20
+
21
+ - 0b8cbfa: `generateText` and `streamText` passed the messages array that `prepareStep` returned to tools and tool approval functions as it was. When `prepareStep` returned the same array for several steps or calls, tool approval functions could not tell the tool calls of one model response from the tool calls of another. The messages array of every step is now created for that step, so the messages that `prepareStep` returns are copied.
22
+ - 6815153: fix(ai): forward the `preliminary` flag on provider-executed tool results in `streamText`, so preliminary results (e.g. OpenAI image generation previews) are no longer recorded as final tool results in step content and response messages
23
+ - 15bfd6b: add telemetry, runtime context and lifecycle callbacks to `experimental_extract`
24
+ - 15bfd6b: redact file urls from download errors sent to telemetry
25
+ - 2613bb4: fix(ai): build the `ai`, `ai/internal`, and `ai/test` entrypoints together so their types stay compatible with each other
26
+ - 63593a7: With `experimental_toolApprovalSecret` configured, `generateText` and `streamText` signed the approval request of a tool call that the tool approval policy had denied automatically. A client that controls the message history could send that request back with an approved response and have the denied tool call executed. Approval requests of automatically denied tool calls are no longer signed, so such a response is rejected with `AI_InvalidToolApprovalSignatureError`.
27
+
28
+ Signatures that earlier versions issued for automatic denials stay valid. To invalidate them, rotate the secret passed to `experimental_toolApprovalSecret`. Approval requests that are still waiting for a user decision then have to be requested again.
29
+
30
+ - Updated dependencies [1d2c2ff]
31
+ - Updated dependencies [a51981c]
32
+ - Updated dependencies [875de7b]
33
+ - @ai-sdk/provider-utils@5.0.83
34
+ - @ai-sdk/gateway@4.0.151
35
+
3
36
  ## 7.0.177
4
37
 
5
38
  ### Patch Changes