@ai-sdk/svelte 3.0.0-canary.11 → 3.0.0-canary.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,25 @@
1
1
  # @ai-sdk/svelte
2
2
 
3
+ ## 3.0.0-canary.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9bf7291]
8
+ - Updated dependencies [4617fab]
9
+ - Updated dependencies [a76a62b]
10
+ - ai@5.0.0-canary.14
11
+ - @ai-sdk/provider-utils@3.0.0-canary.12
12
+
13
+ ## 3.0.0-canary.12
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [14cb3be]
18
+ - Updated dependencies [66962ed]
19
+ - Updated dependencies [9301f86]
20
+ - ai@5.0.0-canary.13
21
+ - @ai-sdk/provider-utils@3.0.0-canary.11
22
+
3
23
  ## 3.0.0-canary.11
4
24
 
5
25
  ### Patch Changes
@@ -82,23 +82,23 @@ export class StructuredObject {
82
82
  let accumulatedText = '';
83
83
  let latestObject = undefined;
84
84
  await response.body.pipeThrough(new TextDecoderStream()).pipeTo(new WritableStream({
85
- write: chunk => {
85
+ write: async (chunk) => {
86
86
  if (abortController?.signal.aborted) {
87
87
  throw new DOMException('Stream aborted', 'AbortError');
88
88
  }
89
89
  accumulatedText += chunk;
90
- const { value } = parsePartialJson(accumulatedText);
90
+ const { value } = await parsePartialJson(accumulatedText);
91
91
  const currentObject = value;
92
92
  if (!isDeepEqualData(latestObject, currentObject)) {
93
93
  latestObject = currentObject;
94
94
  this.#store.object = currentObject;
95
95
  }
96
96
  },
97
- close: () => {
97
+ close: async () => {
98
98
  this.#store.loading = false;
99
99
  this.#abortController = undefined;
100
100
  if (this.#options.onFinish != null) {
101
- const validationResult = safeValidateTypes({
101
+ const validationResult = await safeValidateTypes({
102
102
  value: latestObject,
103
103
  schema: asSchema(this.#options.schema),
104
104
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/svelte",
3
- "version": "3.0.0-canary.11",
3
+ "version": "3.0.0-canary.13",
4
4
  "license": "Apache-2.0",
5
5
  "files": [
6
6
  "dist",
@@ -36,8 +36,8 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@ai-sdk/provider-utils": "3.0.0-canary.10",
40
- "ai": "5.0.0-canary.12"
39
+ "ai": "5.0.0-canary.14",
40
+ "@ai-sdk/provider-utils": "3.0.0-canary.12"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -177,13 +177,13 @@ export class StructuredObject<RESULT, INPUT = unknown> {
177
177
 
178
178
  await response.body.pipeThrough(new TextDecoderStream()).pipeTo(
179
179
  new WritableStream<string>({
180
- write: chunk => {
180
+ write: async chunk => {
181
181
  if (abortController?.signal.aborted) {
182
182
  throw new DOMException('Stream aborted', 'AbortError');
183
183
  }
184
184
  accumulatedText += chunk;
185
185
 
186
- const { value } = parsePartialJson(accumulatedText);
186
+ const { value } = await parsePartialJson(accumulatedText);
187
187
  const currentObject = value as DeepPartial<RESULT>;
188
188
 
189
189
  if (!isDeepEqualData(latestObject, currentObject)) {
@@ -193,12 +193,12 @@ export class StructuredObject<RESULT, INPUT = unknown> {
193
193
  }
194
194
  },
195
195
 
196
- close: () => {
196
+ close: async () => {
197
197
  this.#store.loading = false;
198
198
  this.#abortController = undefined;
199
199
 
200
200
  if (this.#options.onFinish != null) {
201
- const validationResult = safeValidateTypes({
201
+ const validationResult = await safeValidateTypes({
202
202
  value: latestObject,
203
203
  schema: asSchema(this.#options.schema),
204
204
  });