@ai-sdk/svelte 3.0.0-alpha.9 → 3.0.0-beta.10

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,175 @@
1
1
  # @ai-sdk/svelte
2
2
 
3
+ ## 3.0.0-beta.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [16ccfb2]
8
+ - Updated dependencies [90ca2b9]
9
+ - Updated dependencies [af1d5a5]
10
+ - Updated dependencies [2b637d6]
11
+ - ai@5.0.0-beta.10
12
+
13
+ ## 3.0.0-beta.9
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [86cfc72]
18
+ - ai@5.0.0-beta.9
19
+
20
+ ## 3.0.0-beta.8
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [6909543]
25
+ - Updated dependencies [c8fce91]
26
+ - Updated dependencies [9121250]
27
+ - ai@5.0.0-beta.8
28
+
29
+ ## 3.0.0-beta.7
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [60132dd]
34
+ - ai@5.0.0-beta.7
35
+
36
+ ## 3.0.0-beta.6
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [143c55b]
41
+ - Updated dependencies [f04ffe4]
42
+ - Updated dependencies [97c35c0]
43
+ - Updated dependencies [fccf75c]
44
+ - ai@5.0.0-beta.6
45
+
46
+ ## 3.0.0-beta.5
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [4f3e637]
51
+ - ai@5.0.0-beta.5
52
+
53
+ ## 3.0.0-beta.4
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [09f41ac]
58
+ - ai@5.0.0-beta.4
59
+
60
+ ## 3.0.0-beta.3
61
+
62
+ ### Patch Changes
63
+
64
+ - ai@5.0.0-beta.3
65
+
66
+ ## 3.0.0-beta.2
67
+
68
+ ### Patch Changes
69
+
70
+ - d1a034f: feature: using Zod 4 for internal stuff
71
+ - Updated dependencies [0d9583c]
72
+ - Updated dependencies [0571b98]
73
+ - Updated dependencies [c6b64a7]
74
+ - Updated dependencies [39a4fab]
75
+ - Updated dependencies [cb3b9c9]
76
+ - Updated dependencies [d1a034f]
77
+ - ai@5.0.0-beta.2
78
+ - @ai-sdk/provider-utils@3.0.0-beta.2
79
+
80
+ ## 3.0.0-beta.1
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [d88455d]
85
+ - Updated dependencies [45c1ea2]
86
+ - Updated dependencies [9ad0484]
87
+ - Updated dependencies [e025824]
88
+ - Updated dependencies [4048ce3]
89
+ - Updated dependencies [f2b041e]
90
+ - Updated dependencies [cb68df0]
91
+ - Updated dependencies [26695a3]
92
+ - Updated dependencies [bfdca8d]
93
+ - Updated dependencies [e7d2ce3]
94
+ - Updated dependencies [102b066]
95
+ - Updated dependencies [71f938d]
96
+ - Updated dependencies [28a5ed5]
97
+ - Updated dependencies [e862b5b]
98
+ - Updated dependencies [7bd025b]
99
+ - ai@5.0.0-beta.1
100
+ - @ai-sdk/provider-utils@3.0.0-beta.1
101
+
102
+ ## 3.0.0-alpha.15
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies [b1e3abd]
107
+ - Updated dependencies [8ba77a7]
108
+ - Updated dependencies [04d5063]
109
+ - Updated dependencies [b4b4bb2]
110
+ - Updated dependencies [d884051]
111
+ - Updated dependencies [954aa73]
112
+ - Updated dependencies [142576e]
113
+ - Updated dependencies [395c85e]
114
+ - Updated dependencies [60e2c56]
115
+ - ai@5.0.0-alpha.15
116
+ - @ai-sdk/provider-utils@3.0.0-alpha.15
117
+
118
+ ## 3.0.0-alpha.14
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [63f9e9b]
123
+ - ai@5.0.0-alpha.14
124
+ - @ai-sdk/provider-utils@3.0.0-alpha.14
125
+
126
+ ## 3.0.0-alpha.13
127
+
128
+ ### Major Changes
129
+
130
+ - 0a710d8: feat (ui): typed tool parts in ui messages
131
+ - 901df02: feat (ui): use UI_MESSAGE generic
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [0a710d8]
136
+ - Updated dependencies [6a83f7d]
137
+ - Updated dependencies [1f55c21]
138
+ - Updated dependencies [33eb499]
139
+ - Updated dependencies [901df02]
140
+ - ai@5.0.0-alpha.13
141
+ - @ai-sdk/provider-utils@3.0.0-alpha.13
142
+
143
+ ## 3.0.0-alpha.12
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [da1e6f0]
148
+ - Updated dependencies [4892798]
149
+ - ai@5.0.0-alpha.12
150
+ - @ai-sdk/provider-utils@3.0.0-alpha.12
151
+
152
+ ## 3.0.0-alpha.11
153
+
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies [e8324c5]
157
+ - ai@5.0.0-alpha.11
158
+ - @ai-sdk/provider-utils@3.0.0-alpha.11
159
+
160
+ ## 3.0.0-alpha.10
161
+
162
+ ### Major Changes
163
+
164
+ - 98f25e5: chore (ui): remove managed chat inputs
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies [98f25e5]
169
+ - Updated dependencies [7bb58d4]
170
+ - ai@5.0.0-alpha.10
171
+ - @ai-sdk/provider-utils@3.0.0-alpha.10
172
+
3
173
  ## 3.0.0-alpha.9
4
174
 
5
175
  ### Patch Changes
@@ -1,20 +1,6 @@
1
- import { AbstractChat, type BaseChatInit, type ChatRequestOptions, type CreateUIMessage, type UIDataPartSchemas, type UIMessage } from 'ai';
2
- export type ChatInit<MESSAGE_METADATA = unknown, DATA_PART_SCHEMAS extends UIDataPartSchemas = UIDataPartSchemas> = Readonly<BaseChatInit<MESSAGE_METADATA, DATA_PART_SCHEMAS>> & {
3
- /**
4
- * Initial input of the chat.
5
- */
6
- initialInput?: string;
7
- };
1
+ import { AbstractChat, type ChatInit, type CreateUIMessage, type UIMessage } from 'ai';
8
2
  export type { CreateUIMessage, UIMessage };
9
- export declare class Chat<MESSAGE_METADATA = unknown, DATA_PART_SCHEMAS extends UIDataPartSchemas = UIDataPartSchemas> extends AbstractChat<MESSAGE_METADATA, DATA_PART_SCHEMAS> {
10
- /** The current value of the input. Writable, so it can be bound to form inputs. */
11
- input: string;
12
- constructor(init: ChatInit<MESSAGE_METADATA, DATA_PART_SCHEMAS>);
13
- /** Form submission handler to automatically reset input and append a user message */
14
- handleSubmit: (event?: {
15
- preventDefault?: () => void;
16
- }, options?: ChatRequestOptions & {
17
- files?: FileList;
18
- }) => Promise<void>;
3
+ export declare class Chat<UI_MESSAGE extends UIMessage = UIMessage> extends AbstractChat<UI_MESSAGE> {
4
+ constructor(init: ChatInit<UI_MESSAGE>);
19
5
  }
20
6
  //# sourceMappingURL=chat.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat.svelte.d.ts","sourceRoot":"","sources":["../src/chat.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAGvB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEf,MAAM,IAAI,CAAC;AAEZ,MAAM,MAAM,QAAQ,CAClB,gBAAgB,GAAG,OAAO,EAC1B,iBAAiB,SAAS,iBAAiB,GAAG,iBAAiB,IAC7D,QAAQ,CAAC,YAAY,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,GAAG;IAChE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAE3C,qBAAa,IAAI,CACf,gBAAgB,GAAG,OAAO,EAC1B,iBAAiB,SAAS,iBAAiB,GAAG,iBAAiB,CAC/D,SAAQ,YAAY,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IACzD,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;gBAEF,IAAI,EAAE,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAS/D,qFAAqF;IACrF,YAAY,WACF;QAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,YAC9B,kBAAkB,GAAG;QAAE,KAAK,CAAC,EAAE,QAAQ,CAAA;KAAE,mBAwBlD;CACH"}
1
+ {"version":3,"file":"chat.svelte.d.ts","sourceRoot":"","sources":["../src/chat.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,QAAQ,EAGb,KAAK,eAAe,EACpB,KAAK,SAAS,EACf,MAAM,IAAI,CAAC;AAEZ,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAE3C,qBAAa,IAAI,CACf,UAAU,SAAS,SAAS,GAAG,SAAS,CACxC,SAAQ,YAAY,CAAC,UAAU,CAAC;gBACpB,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC;CAMvC"}
@@ -1,33 +1,11 @@
1
- import { AbstractChat, convertFileListToFileUIParts, } from 'ai';
1
+ import { AbstractChat, } from 'ai';
2
2
  export class Chat extends AbstractChat {
3
- /** The current value of the input. Writable, so it can be bound to form inputs. */
4
- input;
5
3
  constructor(init) {
6
4
  super({
7
5
  ...init,
8
6
  state: new SvelteChatState(init.messages),
9
7
  });
10
- this.input = $state(init.initialInput ?? '');
11
8
  }
12
- /** Form submission handler to automatically reset input and append a user message */
13
- handleSubmit = async (event, options = {}) => {
14
- event?.preventDefault?.();
15
- const fileParts = Array.isArray(options?.files)
16
- ? options.files
17
- : await convertFileListToFileUIParts(options?.files);
18
- if (!this.input && fileParts.length === 0)
19
- return;
20
- const request = this.append({
21
- id: this.generateId(),
22
- role: 'user',
23
- parts: [...fileParts, { type: 'text', text: this.input }],
24
- }, {
25
- headers: options.headers,
26
- body: options.body,
27
- });
28
- this.input = '';
29
- await request;
30
- };
31
9
  }
32
10
  class SvelteChatState {
33
11
  messages;
@@ -1,8 +1,8 @@
1
1
  import { type FetchFunction, type InferSchema } from '@ai-sdk/provider-utils';
2
2
  import { type DeepPartial, type Schema } from 'ai';
3
3
  import type * as z3 from 'zod/v3';
4
- import type * as z4 from 'zod/v4/core';
5
- export type Experimental_StructuredObjectOptions<SCHEMA extends z3.Schema | z4.$ZodType | Schema, RESULT = InferSchema<SCHEMA>> = {
4
+ import type * as z4 from 'zod/v4';
5
+ export type Experimental_StructuredObjectOptions<SCHEMA extends z3.Schema | z4.ZodType | Schema, RESULT = InferSchema<SCHEMA>> = {
6
6
  /**
7
7
  * The API endpoint. It should stream JSON that matches the schema as chunked text.
8
8
  */
@@ -55,7 +55,7 @@ export type Experimental_StructuredObjectOptions<SCHEMA extends z3.Schema | z4.$
55
55
  */
56
56
  credentials?: RequestCredentials;
57
57
  };
58
- export declare class StructuredObject<SCHEMA extends z3.Schema | z4.$ZodType | Schema, RESULT = InferSchema<SCHEMA>, INPUT = unknown> {
58
+ export declare class StructuredObject<SCHEMA extends z3.Schema | z4.ZodType | Schema, RESULT = InferSchema<SCHEMA>, INPUT = unknown> {
59
59
  #private;
60
60
  /**
61
61
  * The current value for the generated object. Updated as the API streams JSON chunks.
@@ -1 +1 @@
1
- {"version":3,"file":"structured-object.svelte.d.ts","sourceRoot":"","sources":["../src/structured-object.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAQvC,MAAM,MAAM,oCAAoC,CAC9C,MAAM,SAAS,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,QAAQ,GAAG,MAAM,EAC/C,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,IAC1B;IACF;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,EAAE,CAAC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AAM,CAAC,GAAG,SAAS,CAE5C;IAKD,0CAA0C;IAC1C,IAAI,KAAK,sBAER;IAED;;OAEG;IACH,IAAI,OAAO,YAEV;gBAEW,OAAO,EAAE,oCAAoC,CAAC,MAAM,EAAE,MAAM,CAAC;IAUzE;;OAEG;IACH,IAAI,aASF;IAEF;;OAEG;IACH,MAAM,UAAiB,KAAK,mBAqF1B;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/svelte",
3
- "version": "3.0.0-alpha.9",
3
+ "version": "3.0.0-beta.10",
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-alpha.9",
40
- "ai": "5.0.0-alpha.9"
39
+ "ai": "5.0.0-beta.10",
40
+ "@ai-sdk/provider-utils": "3.0.0-beta.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "20.17.24",
@@ -1,90 +1,41 @@
1
1
  import {
2
2
  AbstractChat,
3
- type BaseChatInit,
4
- type ChatRequestOptions,
3
+ type ChatInit,
5
4
  type ChatState,
6
5
  type ChatStatus,
7
6
  type CreateUIMessage,
8
- type UIDataPartSchemas,
9
- type UIDataTypes,
10
7
  type UIMessage,
11
- convertFileListToFileUIParts,
12
8
  } from 'ai';
13
9
 
14
- export type ChatInit<
15
- MESSAGE_METADATA = unknown,
16
- DATA_PART_SCHEMAS extends UIDataPartSchemas = UIDataPartSchemas,
17
- > = Readonly<BaseChatInit<MESSAGE_METADATA, DATA_PART_SCHEMAS>> & {
18
- /**
19
- * Initial input of the chat.
20
- */
21
- initialInput?: string;
22
- };
23
-
24
10
  export type { CreateUIMessage, UIMessage };
25
11
 
26
12
  export class Chat<
27
- MESSAGE_METADATA = unknown,
28
- DATA_PART_SCHEMAS extends UIDataPartSchemas = UIDataPartSchemas,
29
- > extends AbstractChat<MESSAGE_METADATA, DATA_PART_SCHEMAS> {
30
- /** The current value of the input. Writable, so it can be bound to form inputs. */
31
- input: string;
32
-
33
- constructor(init: ChatInit<MESSAGE_METADATA, DATA_PART_SCHEMAS>) {
13
+ UI_MESSAGE extends UIMessage = UIMessage,
14
+ > extends AbstractChat<UI_MESSAGE> {
15
+ constructor(init: ChatInit<UI_MESSAGE>) {
34
16
  super({
35
17
  ...init,
36
18
  state: new SvelteChatState(init.messages),
37
19
  });
38
-
39
- this.input = $state(init.initialInput ?? '');
40
20
  }
41
-
42
- /** Form submission handler to automatically reset input and append a user message */
43
- handleSubmit = async (
44
- event?: { preventDefault?: () => void },
45
- options: ChatRequestOptions & { files?: FileList } = {},
46
- ) => {
47
- event?.preventDefault?.();
48
-
49
- const fileParts = Array.isArray(options?.files)
50
- ? options.files
51
- : await convertFileListToFileUIParts(options?.files);
52
-
53
- if (!this.input && fileParts.length === 0) return;
54
-
55
- const request = this.append(
56
- {
57
- id: this.generateId(),
58
- role: 'user',
59
- parts: [...fileParts, { type: 'text', text: this.input }],
60
- },
61
- {
62
- headers: options.headers,
63
- body: options.body,
64
- },
65
- );
66
-
67
- this.input = '';
68
- await request;
69
- };
70
21
  }
71
22
 
72
- class SvelteChatState<MESSAGE_METADATA, DATA_TYPES extends UIDataTypes>
73
- implements ChatState<MESSAGE_METADATA, DATA_TYPES>
23
+ class SvelteChatState<UI_MESSAGE extends UIMessage>
24
+ implements ChatState<UI_MESSAGE>
74
25
  {
75
- messages: UIMessage<MESSAGE_METADATA, DATA_TYPES>[];
26
+ messages: UI_MESSAGE[];
76
27
  status = $state<ChatStatus>('ready');
77
28
  error = $state<Error | undefined>(undefined);
78
29
 
79
- constructor(messages: UIMessage<MESSAGE_METADATA, DATA_TYPES>[] = []) {
30
+ constructor(messages: UI_MESSAGE[] = []) {
80
31
  this.messages = $state(messages);
81
32
  }
82
33
 
83
- setMessages = (messages: UIMessage<MESSAGE_METADATA, DATA_TYPES>[]) => {
34
+ setMessages = (messages: UI_MESSAGE[]) => {
84
35
  this.messages = messages;
85
36
  };
86
37
 
87
- pushMessage = (message: UIMessage<MESSAGE_METADATA, DATA_TYPES>) => {
38
+ pushMessage = (message: UI_MESSAGE) => {
88
39
  this.messages.push(message);
89
40
  };
90
41
 
@@ -92,10 +43,7 @@ class SvelteChatState<MESSAGE_METADATA, DATA_TYPES extends UIDataTypes>
92
43
  this.messages.pop();
93
44
  };
94
45
 
95
- replaceMessage = (
96
- index: number,
97
- message: UIMessage<MESSAGE_METADATA, DATA_TYPES>,
98
- ) => {
46
+ replaceMessage = (index: number, message: UI_MESSAGE) => {
99
47
  this.messages[index] = message;
100
48
  };
101
49
 
@@ -13,7 +13,7 @@ import {
13
13
  type Schema,
14
14
  } from 'ai';
15
15
  import type * as z3 from 'zod/v3';
16
- import type * as z4 from 'zod/v4/core';
16
+ import type * as z4 from 'zod/v4';
17
17
  import {
18
18
  getStructuredObjectContext,
19
19
  hasStructuredObjectContext,
@@ -22,7 +22,7 @@ import {
22
22
  } from './structured-object-context.svelte.js';
23
23
 
24
24
  export type Experimental_StructuredObjectOptions<
25
- SCHEMA extends z3.Schema | z4.$ZodType | Schema,
25
+ SCHEMA extends z3.Schema | z4.ZodType | Schema,
26
26
  RESULT = InferSchema<SCHEMA>,
27
27
  > = {
28
28
  /**
@@ -88,7 +88,7 @@ export type Experimental_StructuredObjectOptions<
88
88
  };
89
89
 
90
90
  export class StructuredObject<
91
- SCHEMA extends z3.Schema | z4.$ZodType | Schema,
91
+ SCHEMA extends z3.Schema | z4.ZodType | Schema,
92
92
  RESULT = InferSchema<SCHEMA>,
93
93
  INPUT = unknown,
94
94
  > {