ai 4.1.12 → 4.1.13

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # ai
2
2
 
3
+ ## 4.1.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 999085e: feat (ai/core): add write function to DataStreamWriter
8
+
3
9
  ## 4.1.12
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -10,6 +10,10 @@ import { z } from 'zod';
10
10
  import { ServerResponse as ServerResponse$1 } from 'http';
11
11
 
12
12
  interface DataStreamWriter {
13
+ /**
14
+ * Appends a data part to the stream.
15
+ */
16
+ write(data: DataStreamString): void;
13
17
  /**
14
18
  * Appends a data part to the stream.
15
19
  */
package/dist/index.d.ts CHANGED
@@ -10,6 +10,10 @@ import { z } from 'zod';
10
10
  import { ServerResponse as ServerResponse$1 } from 'http';
11
11
 
12
12
  interface DataStreamWriter {
13
+ /**
14
+ * Appends a data part to the stream.
15
+ */
16
+ write(data: DataStreamString): void;
13
17
  /**
14
18
  * Appends a data part to the stream.
15
19
  */
package/dist/index.js CHANGED
@@ -115,6 +115,9 @@ function createDataStream({
115
115
  }
116
116
  try {
117
117
  const result = execute({
118
+ write(data) {
119
+ safeEnqueue(data);
120
+ },
118
121
  writeData(data) {
119
122
  safeEnqueue((0, import_ui_utils.formatDataStreamPart)("data", [data]));
120
123
  },