@ai-sdk/svelte 5.0.0-beta.18 → 5.0.0-beta.181
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 +1252 -0
- package/dist/chat.svelte.d.ts.map +1 -1
- package/dist/completion-context.svelte.d.ts +14 -0
- package/dist/completion-context.svelte.d.ts.map +1 -0
- package/dist/structured-object.svelte.d.ts.map +1 -1
- package/dist/tests/completion-synchronization.svelte.d.ts.map +1 -1
- package/dist/tests/structured-object-synchronization.svelte.d.ts +14 -4
- package/dist/tests/structured-object-synchronization.svelte.d.ts.map +1 -1
- package/package.json +22 -27
- package/src/chat.svelte.ts +3 -4
- package/src/structured-object.svelte.ts +0 -1
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AACZ,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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
2
|
+
import { KeyedStore } from './utils.svelte.js';
|
|
3
|
+
declare class CompletionStore {
|
|
4
|
+
completions: SvelteMap<string, string>;
|
|
5
|
+
data: import("@ai-sdk/provider").JSONValue[];
|
|
6
|
+
loading: boolean;
|
|
7
|
+
error: Error | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare class KeyedCompletionStore extends KeyedStore<CompletionStore> {
|
|
10
|
+
constructor(value?: Iterable<readonly [string, CompletionStore]> | null | undefined);
|
|
11
|
+
}
|
|
12
|
+
export declare const hasCompletionContext: () => boolean, getCompletionContext: () => KeyedCompletionStore, setCompletionContext: (value: KeyedCompletionStore) => KeyedCompletionStore;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=completion-context.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-context.svelte.d.ts","sourceRoot":"","sources":["../src/completion-context.svelte.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAiB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE9D,cAAM,eAAe;IACnB,WAAW,4BAAmC;IAC9C,IAAI,yCAA2B;IAC/B,OAAO,UAAiB;IACxB,KAAK,oBAAmB;CACzB;AAED,qBAAa,oBAAqB,SAAQ,UAAU,CAAC,eAAe,CAAC;gBAEjE,KAAK,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;CAI1E;AAED,eAAO,MACO,oBAAoB,iBACpB,oBAAoB,8BACpB,oBAAoB,uDACmB,CAAC"}
|
|
@@ -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,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,WAAW,EACjB,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"structured-object.svelte.d.ts","sourceRoot":"","sources":["../src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;;OAEG;IACH,IAAI,OAAO,YAEV;gBAEW,OAAO,EAAE,oCAAoC,CAAC,MAAM,EAAE,MAAM,CAAC;IAUzE;;OAEG;IACH,IAAI,aASF;IAEF;;OAEG;IACH,MAAM,GAAU,OAAO,KAAK,mBAqF1B;IAEF;;OAEG;IACH,KAAK,aAGH;CAOH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion-synchronization.svelte.d.ts","sourceRoot":"","sources":["../../src/tests/completion-synchronization.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGpD,KAAK,gBAAgB,GAAI;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAgB1C,QAAA,MAAM,yBAAyB;;;
|
|
1
|
+
{"version":3,"file":"completion-synchronization.svelte.d.ts","sourceRoot":"","sources":["../../src/tests/completion-synchronization.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGpD,KAAK,gBAAgB,GAAI;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAgB1C,QAAA,MAAM,yBAAyB;;;MAAwC,CAAC;AACxE,KAAK,yBAAyB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC9E,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { FlexibleSchema } from '@ai-sdk/provider-utils';
|
|
2
2
|
import { StructuredObject } from '../structured-object.svelte.js';
|
|
3
|
-
declare
|
|
4
|
-
props
|
|
3
|
+
declare function $$render<RESULT>(): {
|
|
4
|
+
props: {
|
|
5
5
|
id?: string;
|
|
6
6
|
api: string;
|
|
7
7
|
schema: FlexibleSchema<RESULT>;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
exports: {
|
|
10
|
+
object1: StructuredObject<FlexibleSchema<RESULT>, RESULT, unknown>;
|
|
11
|
+
object2: StructuredObject<FlexibleSchema<RESULT>, RESULT, unknown>;
|
|
12
|
+
};
|
|
13
|
+
bindings: "";
|
|
14
|
+
slots: {};
|
|
15
|
+
events: {};
|
|
16
|
+
};
|
|
17
|
+
declare class __sveltets_Render<RESULT> {
|
|
18
|
+
props(): ReturnType<typeof $$render<RESULT>>['props'];
|
|
19
|
+
events(): ReturnType<typeof $$render<RESULT>>['events'];
|
|
20
|
+
slots(): ReturnType<typeof $$render<RESULT>>['slots'];
|
|
11
21
|
bindings(): "";
|
|
12
22
|
exports(): {
|
|
13
23
|
object1: StructuredObject<FlexibleSchema<RESULT>, RESULT, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-object-synchronization.svelte.d.ts","sourceRoot":"","sources":["../../src/tests/structured-object-synchronization.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"structured-object-synchronization.svelte.d.ts","sourceRoot":"","sources":["../../src/tests/structured-object-synchronization.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,iBAAS,QAAQ,CAAC,MAAM;;aAKf,MAAM;aACN,MAAM;gBACH,cAAc,CAAC,MAAM,CAAC;;aAiBmC;QAAE,OAAO,4DAAiB;QAAA,OAAO,4DAAgB;KAAE;;;;EAA+D;AACvL,cAAM,iBAAiB,CAAC,MAAM;IAC1B,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IACrD,MAAM,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvD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{
|
|
2
2
|
"name": "@ai-sdk/svelte",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.181",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -27,42 +27,37 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
|
-
"access": "public"
|
|
30
|
+
"access": "public",
|
|
31
|
+
"provenance": true
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
33
34
|
"svelte": "^5.31.0"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@ai-sdk/provider-utils": "5.0.0-beta.
|
|
37
|
-
"ai": "7.0.0-beta.
|
|
37
|
+
"@ai-sdk/provider-utils": "5.0.0-beta.49",
|
|
38
|
+
"ai": "7.0.0-beta.181"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"svelte": "^5.31.0",
|
|
53
|
-
"svelte-check": "^4.0.0",
|
|
54
|
-
"typescript": "^5.0.0",
|
|
55
|
-
"typescript-eslint": "^8.20.0",
|
|
56
|
-
"vite": "^6.0.0",
|
|
57
|
-
"vitest": "^4.1.0",
|
|
41
|
+
"@sveltejs/package": "^2.5.7",
|
|
42
|
+
"@sveltejs/vite-plugin-svelte": "^5.1.1",
|
|
43
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
44
|
+
"@testing-library/svelte": "^5.3.1",
|
|
45
|
+
"@types/node": "22.19.19",
|
|
46
|
+
"jsdom": "^26.1.0",
|
|
47
|
+
"publint": "^0.3.21",
|
|
48
|
+
"svelte": "^5.55.7",
|
|
49
|
+
"svelte-check": "^4.4.8",
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"vite": "^6.4.3",
|
|
52
|
+
"vitest": "^4.1.6",
|
|
58
53
|
"zod": "3.25.76",
|
|
59
54
|
"@vercel/ai-tsconfig": "0.0.0",
|
|
60
|
-
"@ai-sdk/test-server": "2.0.0-beta.
|
|
55
|
+
"@ai-sdk/test-server": "2.0.0-beta.7"
|
|
61
56
|
},
|
|
62
57
|
"homepage": "https://ai-sdk.dev/docs",
|
|
63
58
|
"repository": {
|
|
64
59
|
"type": "git",
|
|
65
|
-
"url": "
|
|
60
|
+
"url": "https://github.com/vercel/ai",
|
|
66
61
|
"directory": "packages/svelte"
|
|
67
62
|
},
|
|
68
63
|
"bugs": {
|
|
@@ -72,15 +67,15 @@
|
|
|
72
67
|
"ai",
|
|
73
68
|
"svelte"
|
|
74
69
|
],
|
|
70
|
+
"engines": {
|
|
71
|
+
"node": ">=22"
|
|
72
|
+
},
|
|
75
73
|
"scripts": {
|
|
76
74
|
"build": "pnpm prepack",
|
|
77
75
|
"build:watch": "pnpm clean && pnpm --filter svelte build && svelte-package --input=src --watch",
|
|
78
76
|
"preview": "vite preview",
|
|
79
77
|
"type-check": "svelte-check --tsconfig ./tsconfig.json",
|
|
80
78
|
"type-check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
81
|
-
"prettier-fix": "prettier --write .",
|
|
82
|
-
"prettier-check": "prettier --check .",
|
|
83
|
-
"lint": "eslint .",
|
|
84
79
|
"test": "vitest --run",
|
|
85
80
|
"test:update": "vitest --run -u",
|
|
86
81
|
"test:watch": "vitest",
|
package/src/chat.svelte.ts
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type CreateUIMessage,
|
|
7
7
|
type UIMessage,
|
|
8
8
|
} from 'ai';
|
|
9
|
-
|
|
10
9
|
export type { CreateUIMessage, UIMessage };
|
|
11
10
|
|
|
12
11
|
export class Chat<
|
|
@@ -20,9 +19,9 @@ export class Chat<
|
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
class SvelteChatState<
|
|
24
|
-
|
|
25
|
-
{
|
|
22
|
+
class SvelteChatState<
|
|
23
|
+
UI_MESSAGE extends UIMessage,
|
|
24
|
+
> implements ChatState<UI_MESSAGE> {
|
|
26
25
|
messages: UI_MESSAGE[];
|
|
27
26
|
status = $state<ChatStatus>('ready');
|
|
28
27
|
error = $state<Error | undefined>(undefined);
|