@tanstack/ai-svelte 0.1.1 → 0.1.2
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.
|
@@ -59,6 +59,10 @@ export function createChat(options) {
|
|
|
59
59
|
error = newError;
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
|
+
// Note: Cleanup is handled by calling stop() directly when needed.
|
|
63
|
+
// Unlike React/Vue/Solid, Svelte 5 runes like $effect can only be used
|
|
64
|
+
// during component initialization, so we don't add automatic cleanup here.
|
|
65
|
+
// Users should call chat.stop() in their component's cleanup if needed.
|
|
62
66
|
// Define methods
|
|
63
67
|
const sendMessage = async (content) => {
|
|
64
68
|
await client.sendMessage(content);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ai-svelte",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Svelte bindings for TanStack AI",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"svelte": "^5.20.0",
|
|
37
|
-
"@tanstack/ai": "0.0
|
|
38
|
-
"@tanstack/ai-client": "0.0
|
|
37
|
+
"@tanstack/ai": "0.1.0",
|
|
38
|
+
"@tanstack/ai-client": "0.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@sveltejs/package": "^2.3.10",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"svelte": "^5.20.0",
|
|
47
47
|
"svelte-check": "^4.2.0",
|
|
48
48
|
"typescript": "5.9.3",
|
|
49
|
-
"vite": "^7.2.
|
|
49
|
+
"vite": "^7.2.7",
|
|
50
50
|
"zod": "^4.1.13"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"svelte": "^5.0.0",
|
|
54
|
-
"@tanstack/ai": "0.0
|
|
55
|
-
"@tanstack/ai-client": "0.0
|
|
54
|
+
"@tanstack/ai": "0.1.0",
|
|
55
|
+
"@tanstack/ai-client": "0.1.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"clean": "rm -rf ./dist",
|
|
@@ -68,6 +68,11 @@ export function createChat<TTools extends ReadonlyArray<AnyClientTool> = any>(
|
|
|
68
68
|
},
|
|
69
69
|
})
|
|
70
70
|
|
|
71
|
+
// Note: Cleanup is handled by calling stop() directly when needed.
|
|
72
|
+
// Unlike React/Vue/Solid, Svelte 5 runes like $effect can only be used
|
|
73
|
+
// during component initialization, so we don't add automatic cleanup here.
|
|
74
|
+
// Users should call chat.stop() in their component's cleanup if needed.
|
|
75
|
+
|
|
71
76
|
// Define methods
|
|
72
77
|
const sendMessage = async (content: string) => {
|
|
73
78
|
await client.sendMessage(content)
|