ai 7.0.0 → 7.0.2

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.
@@ -83,7 +83,7 @@ import {
83
83
  } from "@ai-sdk/provider-utils";
84
84
 
85
85
  // src/version.ts
86
- var VERSION = true ? "7.0.0" : "0.0.0-test";
86
+ var VERSION = true ? "7.0.2" : "0.0.0-test";
87
87
 
88
88
  // src/util/download/download.ts
89
89
  var download = async ({
@@ -265,9 +265,5 @@ export default function Chat() {
265
265
  title: 'MCP App Renderer',
266
266
  link: '/docs/reference/ai-sdk-ui/mcp-app-renderer',
267
267
  },
268
- {
269
- title: 'Build MCP Apps with Next.js',
270
- link: '/cookbook/next/mcp-apps',
271
- },
272
268
  ]}
273
269
  />
@@ -6,8 +6,8 @@ description: Debug and inspect AI SDK applications with DevTools
6
6
  # DevTools
7
7
 
8
8
  <Note type="warning">
9
- AI SDK DevTools is experimental and intended for local development only. Do
10
- not use in production environments.
9
+ AI SDK DevTools is intended for local development only. Do not use in
10
+ production environments.
11
11
  </Note>
12
12
 
13
13
  AI SDK DevTools gives you full visibility over your AI SDK calls with [`generateText`](/docs/reference/ai-sdk-core/generate-text), [`streamText`](/docs/reference/ai-sdk-core/stream-text), and [`ToolLoopAgent`](/docs/reference/ai-sdk-core/tool-loop-agent). It helps you debug and inspect LLM requests, responses, tool calls, and multi-step interactions through a web-based UI.
@@ -27,7 +27,7 @@ pnpm add @ai-sdk/devtools
27
27
 
28
28
  ## Requirements
29
29
 
30
- - AI SDK v7 beta (`ai@beta`)
30
+ - AI SDK v7 (`ai@latest`)
31
31
  - Node.js compatible runtime
32
32
 
33
33
  ## Using DevTools
@@ -17,25 +17,25 @@ Install the core harness package, a harness adapter, and a sandbox provider:
17
17
  <Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>
18
18
  <Tab>
19
19
  <Snippet
20
- text="pnpm add @ai-sdk/harness@beta @ai-sdk/harness-claude-code@beta @ai-sdk/sandbox-vercel@beta"
20
+ text="pnpm add @ai-sdk/harness @ai-sdk/harness-claude-code @ai-sdk/sandbox-vercel"
21
21
  dark
22
22
  />
23
23
  </Tab>
24
24
  <Tab>
25
25
  <Snippet
26
- text="npm install @ai-sdk/harness@beta @ai-sdk/harness-claude-code@beta @ai-sdk/sandbox-vercel@beta"
26
+ text="npm install @ai-sdk/harness @ai-sdk/harness-claude-code @ai-sdk/sandbox-vercel"
27
27
  dark
28
28
  />
29
29
  </Tab>
30
30
  <Tab>
31
31
  <Snippet
32
- text="yarn add @ai-sdk/harness@beta @ai-sdk/harness-claude-code@beta @ai-sdk/sandbox-vercel@beta"
32
+ text="yarn add @ai-sdk/harness @ai-sdk/harness-claude-code @ai-sdk/sandbox-vercel"
33
33
  dark
34
34
  />
35
35
  </Tab>
36
36
  <Tab>
37
37
  <Snippet
38
- text="bun add @ai-sdk/harness@beta @ai-sdk/harness-claude-code@beta @ai-sdk/sandbox-vercel@beta"
38
+ text="bun add @ai-sdk/harness @ai-sdk/harness-claude-code @ai-sdk/sandbox-vercel"
39
39
  dark
40
40
  />
41
41
  </Tab>
@@ -16,13 +16,13 @@ The AI SDK includes the following harness adapters:
16
16
 
17
17
  - [Claude Code](/providers/ai-sdk-harnesses/claude-code) (`@ai-sdk/harness-claude-code`)
18
18
  - [Codex](/providers/ai-sdk-harnesses/codex) (`@ai-sdk/harness-codex`)
19
+ - [Deep Agents](/providers/ai-sdk-harnesses/deepagents) (`@ai-sdk/harness-deepagents`)
19
20
  - [OpenCode](/providers/ai-sdk-harnesses/opencode) (`@ai-sdk/harness-opencode`)
20
21
  - [Pi](/providers/ai-sdk-harnesses/pi) (`@ai-sdk/harness-pi`)
21
22
 
22
23
  ### Coming Soon
23
24
 
24
25
  - Amp (`@ai-sdk/harness-amp`)
25
- - DeepAgents (`@ai-sdk/harness-deepagents`)
26
26
  - Goose (`@ai-sdk/harness-goose`)
27
27
  - Mastra (`@ai-sdk/harness-mastra`)
28
28
 
@@ -32,5 +32,6 @@ The AI SDK includes the following harness adapters:
32
32
  | ------------------------------------------------------ | ---------------- | ------------------- | ------------------- | ---------------------- |
33
33
  | [Claude Code](/providers/ai-sdk-harnesses/claude-code) | Sandbox bridge | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
34
34
  | [Codex](/providers/ai-sdk-harnesses/codex) | Sandbox bridge | <Check size={18} /> | <Check size={18} /> | <Cross size={18} /> |
35
+ | [Deep Agents](/providers/ai-sdk-harnesses/deepagents) | Sandbox bridge | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
35
36
  | [OpenCode](/providers/ai-sdk-harnesses/opencode) | Sandbox bridge | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
36
37
  | [Pi](/providers/ai-sdk-harnesses/pi) | Host process | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
@@ -21,16 +21,16 @@ integration.
21
21
  <div className="my-4">
22
22
  <Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>
23
23
  <Tab>
24
- <Snippet text="pnpm add @ai-sdk/workflow-harness@beta workflow" dark />
24
+ <Snippet text="pnpm add @ai-sdk/workflow-harness workflow" dark />
25
25
  </Tab>
26
26
  <Tab>
27
- <Snippet text="npm install @ai-sdk/workflow-harness@beta workflow" dark />
27
+ <Snippet text="npm install @ai-sdk/workflow-harness workflow" dark />
28
28
  </Tab>
29
29
  <Tab>
30
- <Snippet text="yarn add @ai-sdk/workflow-harness@beta workflow" dark />
30
+ <Snippet text="yarn add @ai-sdk/workflow-harness workflow" dark />
31
31
  </Tab>
32
32
  <Tab>
33
- <Snippet text="bun add @ai-sdk/workflow-harness@beta workflow" dark />
33
+ <Snippet text="bun add @ai-sdk/workflow-harness workflow" dark />
34
34
  </Tab>
35
35
  </Tabs>
36
36
  </div>
@@ -16,25 +16,25 @@ session for the lifetime of the terminal UI.
16
16
  <Tabs items={['pnpm', 'npm', 'yarn', 'bun']}>
17
17
  <Tab>
18
18
  <Snippet
19
- text="pnpm add @ai-sdk/tui@beta @ai-sdk/harness@beta @ai-sdk/harness-codex@beta @ai-sdk/sandbox-vercel@beta"
19
+ text="pnpm add @ai-sdk/tui @ai-sdk/harness @ai-sdk/harness-codex @ai-sdk/sandbox-vercel"
20
20
  dark
21
21
  />
22
22
  </Tab>
23
23
  <Tab>
24
24
  <Snippet
25
- text="npm install @ai-sdk/tui@beta @ai-sdk/harness@beta @ai-sdk/harness-codex@beta @ai-sdk/sandbox-vercel@beta"
25
+ text="npm install @ai-sdk/tui @ai-sdk/harness @ai-sdk/harness-codex @ai-sdk/sandbox-vercel"
26
26
  dark
27
27
  />
28
28
  </Tab>
29
29
  <Tab>
30
30
  <Snippet
31
- text="yarn add @ai-sdk/tui@beta @ai-sdk/harness@beta @ai-sdk/harness-codex@beta @ai-sdk/sandbox-vercel@beta"
31
+ text="yarn add @ai-sdk/tui @ai-sdk/harness @ai-sdk/harness-codex @ai-sdk/sandbox-vercel"
32
32
  dark
33
33
  />
34
34
  </Tab>
35
35
  <Tab>
36
36
  <Snippet
37
- text="bun add @ai-sdk/tui@beta @ai-sdk/harness@beta @ai-sdk/harness-codex@beta @ai-sdk/sandbox-vercel@beta"
37
+ text="bun add @ai-sdk/tui @ai-sdk/harness @ai-sdk/harness-codex @ai-sdk/sandbox-vercel"
38
38
  dark
39
39
  />
40
40
  </Tab>
@@ -28,7 +28,7 @@ Use the migrate-ai-sdk-v6-to-v7 skill and migrate my app from AI SDK v6 to v7.
28
28
  An example upgrade command would be:
29
29
 
30
30
  ```
31
- pnpm install ai@beta @ai-sdk/react@beta @ai-sdk/openai@beta @ai-sdk/otel@beta
31
+ pnpm install ai @ai-sdk/react @ai-sdk/openai @ai-sdk/otel
32
32
  ```
33
33
 
34
34
  ## Codemods
@@ -6,6 +6,7 @@ collapsed: true
6
6
 
7
7
  # Migration Guides
8
8
 
9
+ - [ Migrate AI SDK 6.x to 7.0 ](/docs/migration-guides/migration-guide-7-0)
9
10
  - [ Migrate AI SDK 5.x to 6.0 ](/docs/migration-guides/migration-guide-6-0)
10
11
  - [ Migrate AI SDK 4.x to 5.0 ](/docs/migration-guides/migration-guide-5-0)
11
12
  - [ Migrate your data to AI SDK 5.0 ](/docs/migration-guides/migration-guide-5-0-data)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "type": "module",
5
5
  "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@ai-sdk/gateway": "4.0.0",
45
+ "@ai-sdk/gateway": "4.0.2",
46
46
  "@ai-sdk/provider": "4.0.0",
47
47
  "@ai-sdk/provider-utils": "5.0.0"
48
48
  },
@@ -791,6 +791,12 @@ export type EnrichedStreamPart<TOOLS extends ToolSet, PARTIAL_OUTPUT> = {
791
791
  partialOutput: PARTIAL_OUTPUT | undefined;
792
792
  };
793
793
 
794
+ async function markPromiseAsHandled<T>(promise: Promise<T>): Promise<void> {
795
+ try {
796
+ await promise;
797
+ } catch {}
798
+ }
799
+
794
800
  function createOutputTransformStream<
795
801
  TOOLS extends ToolSet,
796
802
  OUTPUT extends Output,
@@ -1338,11 +1344,7 @@ class DefaultStreamTextResult<
1338
1344
  message: 'No output generated. Check the stream for errors.',
1339
1345
  }));
1340
1346
 
1341
- self._finishReason.reject(error);
1342
- self._rawFinishReason.reject(error);
1343
- self._totalUsage.reject(error);
1344
- self._steps.reject(error);
1345
- self._initialResponseMessages.reject(error);
1347
+ self.rejectResultPromises(error);
1346
1348
 
1347
1349
  return; // no steps recorded (e.g. in error scenario)
1348
1350
  }
@@ -2335,6 +2337,7 @@ class DefaultStreamTextResult<
2335
2337
  })().catch(async error => {
2336
2338
  await telemetryDispatcher.onError?.({ callId, error });
2337
2339
  self._initialResponseMessages.reject(error);
2340
+ markPromiseAsHandled(self._initialResponseMessages.promise);
2338
2341
 
2339
2342
  // add an error stream part and close the streams:
2340
2343
  self.addStream(
@@ -2511,12 +2514,26 @@ class DefaultStreamTextResult<
2511
2514
  }
2512
2515
 
2513
2516
  private rejectResultPromises(error: unknown) {
2514
- if (this._finishReason.isPending()) this._finishReason.reject(error);
2515
- if (this._rawFinishReason.isPending()) this._rawFinishReason.reject(error);
2516
- if (this._totalUsage.isPending()) this._totalUsage.reject(error);
2517
- if (this._steps.isPending()) this._steps.reject(error);
2518
- if (this._initialResponseMessages.isPending()) {
2519
- this._initialResponseMessages.reject(error);
2517
+ this.rejectResultPromise({ delayedPromise: this._finishReason, error });
2518
+ this.rejectResultPromise({ delayedPromise: this._rawFinishReason, error });
2519
+ this.rejectResultPromise({ delayedPromise: this._totalUsage, error });
2520
+ this.rejectResultPromise({ delayedPromise: this._steps, error });
2521
+ this.rejectResultPromise({
2522
+ delayedPromise: this._initialResponseMessages,
2523
+ error,
2524
+ });
2525
+ }
2526
+
2527
+ private rejectResultPromise<T>({
2528
+ delayedPromise,
2529
+ error,
2530
+ }: {
2531
+ delayedPromise: DelayedPromise<T>;
2532
+ error: unknown;
2533
+ }) {
2534
+ if (delayedPromise.isPending()) {
2535
+ delayedPromise.reject(error);
2536
+ markPromiseAsHandled(delayedPromise.promise);
2520
2537
  }
2521
2538
  }
2522
2539