@ai-sdk/svelte 3.0.0-canary.9 → 3.0.1
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 +929 -0
- package/README.md +5 -5
- package/dist/chat.svelte.d.ts +4 -73
- package/dist/chat.svelte.d.ts.map +1 -1
- package/dist/chat.svelte.js +23 -243
- package/dist/completion.svelte.d.ts +2 -9
- package/dist/completion.svelte.d.ts.map +1 -1
- package/dist/completion.svelte.js +4 -22
- package/dist/context-provider.d.ts.map +1 -1
- package/dist/context-provider.js +0 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/structured-object.svelte.d.ts +11 -6
- package/dist/structured-object.svelte.d.ts.map +1 -1
- package/dist/structured-object.svelte.js +17 -7
- package/dist/tests/structured-object-synchronization.svelte.d.ts +2 -2
- package/dist/utils.svelte.js +1 -1
- package/package.json +8 -8
- package/src/chat.svelte.ts +32 -331
- package/src/completion.svelte.ts +10 -27
- package/src/context-provider.ts +0 -4
- package/src/index.ts +3 -12
- package/src/structured-object.svelte.ts +36 -13
- package/src/utils.svelte.ts +1 -1
- package/dist/chat-context.svelte.d.ts +0 -14
- package/dist/chat-context.svelte.d.ts.map +0 -1
- package/dist/chat-context.svelte.js +0 -13
- package/dist/completion-context.svelte.d.ts +0 -15
- package/dist/completion-context.svelte.d.ts.map +0 -1
- package/dist/tests/chat-synchronization.svelte +0 -12
- package/dist/tests/chat-synchronization.svelte.d.ts +0 -11
- package/dist/tests/chat-synchronization.svelte.d.ts.map +0 -1
- package/src/chat-context.svelte.ts +0 -23
- package/src/tests/chat-synchronization.svelte +0 -12
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-context.svelte.d.ts","sourceRoot":"","sources":["../src/chat-context.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,EAAiB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE9D,cAAM,SAAS;IACb,QAAQ,cAA2B;IACnC,IAAI,0BAAyB;IAC7B,MAAM,gDAAkE;IACxE,KAAK,oBAAmB;CACzB;AAED,qBAAa,cAAe,SAAQ,UAAU,CAAC,SAAS,CAAC;gBAErD,KAAK,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;CAIpE;AAED,eAAO,MACO,cAAc,iBACd,cAAc,wBACd,cAAc,2CACa,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createContext, KeyedStore } from './utils.svelte.js';
|
|
2
|
-
class ChatStore {
|
|
3
|
-
messages = $state([]);
|
|
4
|
-
data = $state();
|
|
5
|
-
status = $state('ready');
|
|
6
|
-
error = $state();
|
|
7
|
-
}
|
|
8
|
-
export class KeyedChatStore extends KeyedStore {
|
|
9
|
-
constructor(value) {
|
|
10
|
-
super(ChatStore, value);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export const { hasContext: hasChatContext, getContext: getChatContext, setContext: setChatContext, } = createContext('Chat');
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { JSONValue } from 'ai';
|
|
2
|
-
import { SvelteMap } from 'svelte/reactivity';
|
|
3
|
-
import { KeyedStore } from './utils.svelte.js';
|
|
4
|
-
declare class CompletionStore {
|
|
5
|
-
completions: SvelteMap<string, string>;
|
|
6
|
-
data: JSONValue[];
|
|
7
|
-
loading: boolean;
|
|
8
|
-
error: Error | undefined;
|
|
9
|
-
}
|
|
10
|
-
export declare class KeyedCompletionStore extends KeyedStore<CompletionStore> {
|
|
11
|
-
constructor(value?: Iterable<readonly [string, CompletionStore]> | null | undefined);
|
|
12
|
-
}
|
|
13
|
-
export declare const hasCompletionContext: () => boolean, getCompletionContext: () => KeyedCompletionStore, setCompletionContext: (value: KeyedCompletionStore) => KeyedCompletionStore;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=completion-context.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completion-context.svelte.d.ts","sourceRoot":"","sources":["../src/completion-context.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAiB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE9D,cAAM,eAAe;IACnB,WAAW,4BAAmC;IAC9C,IAAI,cAA2B;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,12 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Chat } from '../chat.svelte.js';
|
|
3
|
-
import { createAIContext } from '../context-provider.js';
|
|
4
|
-
|
|
5
|
-
let { id }: { id?: string } = $props();
|
|
6
|
-
|
|
7
|
-
createAIContext();
|
|
8
|
-
const chat1 = new Chat({ id });
|
|
9
|
-
const chat2 = new Chat({ id });
|
|
10
|
-
|
|
11
|
-
export { chat1, chat2 };
|
|
12
|
-
</script>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Chat } from '../chat.svelte.js';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
id?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const ChatSynchronization: import("svelte").Component<$$ComponentProps, {
|
|
6
|
-
chat1: Chat;
|
|
7
|
-
chat2: Chat;
|
|
8
|
-
}, "">;
|
|
9
|
-
type ChatSynchronization = ReturnType<typeof ChatSynchronization>;
|
|
10
|
-
export default ChatSynchronization;
|
|
11
|
-
//# sourceMappingURL=chat-synchronization.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-synchronization.svelte.d.ts","sourceRoot":"","sources":["../../src/tests/chat-synchronization.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGxC,KAAK,gBAAgB,GAAI;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAgB1C,QAAA,MAAM,mBAAmB;;;MAAsC,CAAC;AAChE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { JSONValue, UIMessage } from 'ai';
|
|
2
|
-
import { createContext, KeyedStore } from './utils.svelte.js';
|
|
3
|
-
|
|
4
|
-
class ChatStore {
|
|
5
|
-
messages = $state<UIMessage[]>([]);
|
|
6
|
-
data = $state<JSONValue[]>();
|
|
7
|
-
status = $state<'submitted' | 'streaming' | 'ready' | 'error'>('ready');
|
|
8
|
-
error = $state<Error>();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class KeyedChatStore extends KeyedStore<ChatStore> {
|
|
12
|
-
constructor(
|
|
13
|
-
value?: Iterable<readonly [string, ChatStore]> | null | undefined,
|
|
14
|
-
) {
|
|
15
|
-
super(ChatStore, value);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const {
|
|
20
|
-
hasContext: hasChatContext,
|
|
21
|
-
getContext: getChatContext,
|
|
22
|
-
setContext: setChatContext,
|
|
23
|
-
} = createContext<KeyedChatStore>('Chat');
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Chat } from '../chat.svelte.js';
|
|
3
|
-
import { createAIContext } from '../context-provider.js';
|
|
4
|
-
|
|
5
|
-
let { id }: { id?: string } = $props();
|
|
6
|
-
|
|
7
|
-
createAIContext();
|
|
8
|
-
const chat1 = new Chat({ id });
|
|
9
|
-
const chat2 = new Chat({ id });
|
|
10
|
-
|
|
11
|
-
export { chat1, chat2 };
|
|
12
|
-
</script>
|