ai 7.0.65 → 7.0.66

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.
@@ -92,7 +92,7 @@ import {
92
92
  } from "@ai-sdk/provider-utils";
93
93
 
94
94
  // src/version.ts
95
- var VERSION = true ? "7.0.65" : "0.0.0-test";
95
+ var VERSION = true ? "7.0.66" : "0.0.0-test";
96
96
 
97
97
  // src/util/download/download.ts
98
98
  var download = async ({
@@ -15,6 +15,7 @@ configuration into the harness contract.
15
15
  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
+ - [Cline](/providers/ai-sdk-harnesses/cline) (`@ai-sdk/harness-cline`)
18
19
  - [Codex](/providers/ai-sdk-harnesses/codex) (`@ai-sdk/harness-codex`)
19
20
  - [Deep Agents](/providers/ai-sdk-harnesses/deepagents) (`@ai-sdk/harness-deepagents`)
20
21
  - [Grok Build](/providers/ai-sdk-harnesses/grok-build) (`@ai-sdk/harness-grok-build`)
@@ -32,6 +33,7 @@ The AI SDK includes the following harness adapters:
32
33
  | Adapter | Runtime location | Custom tools | Custom skills | Built-in tool approval | Built-in tool filtering |
33
34
  | ------------------------------------------------------ | ---------------- | ------------ | ------------- | ---------------------- | ---------------------------- |
34
35
  | [Claude Code](/providers/ai-sdk-harnesses/claude-code) | Sandbox bridge | <Check /> | <Check /> | <Check /> | <Check /> |
36
+ | [Cline](/providers/ai-sdk-harnesses/cline) | Host process | <Check /> | <Check /> | <Check /> | <Check /> |
35
37
  | [Codex](/providers/ai-sdk-harnesses/codex) | Sandbox bridge | <Check /> | <Check /> | <Cross /> | <Cross /> |
36
38
  | [Deep Agents](/providers/ai-sdk-harnesses/deepagents) | Sandbox bridge | <Check /> | <Check /> | <Check /> | <Check /> via auto-rejection |
37
39
  | [Grok Build](/providers/ai-sdk-harnesses/grok-build) | Sandbox via ACP | <Check /> | <Check /> | <Check /> | <Cross /> |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "7.0.65",
3
+ "version": "7.0.66",
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",
@@ -34,6 +34,7 @@ export type {
34
34
  OnLanguageModelCallStartCallback,
35
35
  } from './language-model-events';
36
36
  export * as Output from './output';
37
+ export type { Output as OutputInterface } from './output';
37
38
  export type {
38
39
  InferCompleteOutput as InferGenerateOutput,
39
40
  InferPartialOutput as InferStreamOutput,
package/src/ui/chat.ts CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  createStreamingUIMessageState,
16
16
  processUIMessageStream,
17
17
  type StreamingUIMessageState,
18
+ type UIMessageStreamWriteOptions,
18
19
  } from './process-ui-message-stream';
19
20
  import {
20
21
  isToolUIPart,
@@ -757,7 +758,7 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
757
758
  const runUpdateMessageJob = (
758
759
  job: (options: {
759
760
  state: StreamingUIMessageState<UI_MESSAGE>;
760
- write: () => void;
761
+ write: (options?: UIMessageStreamWriteOptions) => void;
761
762
  }) => Promise<void>,
762
763
  ) =>
763
764
  // serialize the job execution to avoid race conditions:
@@ -768,13 +769,14 @@ export abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
768
769
 
769
770
  return job({
770
771
  state: response.state,
771
- write: () => {
772
+ write: ({ updateStatus = true } = {}) => {
772
773
  if (response.abortController.signal.aborted) {
773
774
  return;
774
775
  }
775
776
 
776
- // streaming is set on first write (before it should be "submitted")
777
- this.setStatus({ status: 'streaming' });
777
+ if (updateStatus) {
778
+ this.setStatus({ status: 'streaming' });
779
+ }
778
780
 
779
781
  const replaceLastMessage =
780
782
  response.state.message.id === this.lastMessage?.id;
@@ -49,6 +49,10 @@ export type StreamingUIMessageState<UI_MESSAGE extends UIMessage> = {
49
49
  finishReason?: FinishReason;
50
50
  };
51
51
 
52
+ export type UIMessageStreamWriteOptions = {
53
+ updateStatus?: boolean;
54
+ };
55
+
52
56
  export function createStreamingUIMessageState<UI_MESSAGE extends UIMessage>({
53
57
  lastMessage,
54
58
  messageId,
@@ -95,7 +99,7 @@ export function processUIMessageStream<UI_MESSAGE extends UIMessage>({
95
99
  runUpdateMessageJob: (
96
100
  job: (options: {
97
101
  state: StreamingUIMessageState<UI_MESSAGE>;
98
- write: () => void;
102
+ write: (options?: UIMessageStreamWriteOptions) => void;
99
103
  }) => Promise<void>,
100
104
  ) => Promise<void>;
101
105
  onError: ErrorHandler;
@@ -891,7 +895,7 @@ export function processUIMessageStream<UI_MESSAGE extends UIMessage>({
891
895
  await updateMessageMetadata(chunk.messageMetadata);
892
896
 
893
897
  if (chunk.messageId != null || chunk.messageMetadata != null) {
894
- write();
898
+ write({ updateStatus: false });
895
899
  }
896
900
  break;
897
901
  }
@@ -2,6 +2,7 @@ import {
2
2
  createStreamingUIMessageState,
3
3
  processUIMessageStream,
4
4
  type StreamingUIMessageState,
5
+ type UIMessageStreamWriteOptions,
5
6
  } from '../ui/process-ui-message-stream';
6
7
  import type { UIMessage } from '../ui/ui-messages';
7
8
  import type { ErrorHandler } from '../util/error-handler';
@@ -109,7 +110,7 @@ export function handleUIMessageStreamFinish<UI_MESSAGE extends UIMessage>({
109
110
  const runUpdateMessageJob = async (
110
111
  job: (options: {
111
112
  state: StreamingUIMessageState<UI_MESSAGE>;
112
- write: () => void;
113
+ write: (options?: UIMessageStreamWriteOptions) => void;
113
114
  }) => Promise<void>,
114
115
  ) => {
115
116
  await job({ state, write: () => {} });
@@ -4,6 +4,7 @@ import {
4
4
  createStreamingUIMessageState,
5
5
  processUIMessageStream,
6
6
  type StreamingUIMessageState,
7
+ type UIMessageStreamWriteOptions,
7
8
  } from '../ui/process-ui-message-stream';
8
9
  import {
9
10
  createAsyncIterableStream,
@@ -91,7 +92,7 @@ export function readUIMessageStream<UI_MESSAGE extends UIMessage>({
91
92
  runUpdateMessageJob(
92
93
  job: (options: {
93
94
  state: StreamingUIMessageState<UI_MESSAGE>;
94
- write: () => void;
95
+ write: (options?: UIMessageStreamWriteOptions) => void;
95
96
  }) => Promise<void>,
96
97
  ) {
97
98
  return job({