diff --git a/ai-service/src/handlers/chat/route.ts b/ai-service/src/handlers/chat/route.ts index dd454fc02..7ad63262f 100644 --- a/ai-service/src/handlers/chat/route.ts +++ b/ai-service/src/handlers/chat/route.ts @@ -17,14 +17,18 @@ import fs from 'fs'; import path from 'path'; export const handleChatRequest = async (c: Context) => { + console.log("incoming request"); const signal = c.req.raw.signal; let body: ChatRequestBodyType; // Parse request body try { - body = chatRequestBodySchema.parse(await c.req.json()); + const json = await c.req.json(); + // console.log("json", json); + body = chatRequestBodySchema.parse(json); } catch (error) { if (error instanceof z.ZodError) { + console.log("zod error", error); return c.json({ errors: error.issues }, 400); } @@ -39,6 +43,8 @@ export const handleChatRequest = async (c: Context) => { return c.body(null, 200); } + console.log("body", body); + const artifactId = process.env.IMAGINE_ARTIFACT_ID!; // TODO: dynamically from body const projectId = process.env.IMAGINE_PROJECT_ID!; // TODO: dynamically from body @@ -54,8 +60,6 @@ export const handleChatRequest = async (c: Context) => { const latestMessageTextPart = latestMessage.content[0] as TextPart; const restMessages = convertedMessages.slice(0, -1); - console.log("isNewConversation", isNewConversation); - // If it's a new conversation, we need to clone the workspace // This is temporary and will be handled by Synapse shortly! if (isNewConversation) { @@ -102,14 +106,10 @@ export const handleChatRequest = async (c: Context) => { type: 'start-step' }); - console.log("BEFORE STREAM"); - for await (const chunk of result.stream) { // We must await the stream } - console.log("AFTER STREAM"); - writer.write({ type: 'finish-step' }); @@ -126,8 +126,6 @@ export const handleChatRequest = async (c: Context) => { const { messages } = event; - console.log("Saving conversation", { conversationId }); - await updateConversation({ conversation: { ...conversation, diff --git a/ai-service/src/lib/ai/mastra/workflows/code-workflow.ts b/ai-service/src/lib/ai/mastra/workflows/code-workflow.ts index e2edcf3e1..ecc0de4b4 100644 --- a/ai-service/src/lib/ai/mastra/workflows/code-workflow.ts +++ b/ai-service/src/lib/ai/mastra/workflows/code-workflow.ts @@ -49,10 +49,8 @@ const planStep = createStep({ const artifactId = runtimeContext.get("artifactId") as string; console.log("artifactId", artifactId); const gitRepositoryUtils = new GitRepositoryUtils(artifactId); - console.log("gitRepositoryUtils", gitRepositoryUtils); const existingFiles = await gitRepositoryUtils.listRepositoryFileStrucrture(); - console.log("existingFiles", existingFiles); const relevantFiles = getPagesAndComponents(existingFiles); const readonlyFiles = [ ...existingFiles.filter( diff --git a/ai-service/src/lib/imagine/imagine-client.ts b/ai-service/src/lib/imagine/imagine-client.ts new file mode 100644 index 000000000..233f5d708 --- /dev/null +++ b/ai-service/src/lib/imagine/imagine-client.ts @@ -0,0 +1,698 @@ +import { AppwriteException } from '@appwrite.io/console'; +import type { Client, Payload } from '@appwrite.io/console'; + +export class Imagine { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * List all artifacts. This endpoint supports pagination and searching. + * + * @param {string[]} queries + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + list(queries?: string[], search?: string): Promise { + const apiPath = '/imagine/artifacts'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('get', uri, apiHeaders, payload); + } + /** + * Create a new artifact. You can pass a custom ID or generate a random ID with `ID.unique()`. + * + * @param {string} artifactId + * @throws {AppwriteException} + * @returns {Promise} + */ + create(artifactId: string): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + const apiPath = '/imagine/artifacts'; + const payload: Payload = {}; + if (typeof artifactId !== 'undefined') { + payload['artifactId'] = artifactId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('post', uri, apiHeaders, payload); + } + /** + * Get an artifact by its unique ID. + * + * @param {string} artifactId + * @throws {AppwriteException} + * @returns {Promise} + */ + get(artifactId: string): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}'.replace('{artifactId}', artifactId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('get', uri, apiHeaders, payload); + } + /** + * Update an artifact name by its unique ID. + * + * @param {string} artifactId + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + update(artifactId: string, name?: string): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}'.replace('{artifactId}', artifactId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('patch', uri, apiHeaders, payload); + } + /** + * Delete an artifact by its unique ID. Once deleted, the artifact will no longer be available +and all associated resources will be removed. + * + * @param {string} artifactId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(artifactId: string): Promise<{}> { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}'.replace('{artifactId}', artifactId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('delete', uri, apiHeaders, payload); + } + /** + * List all conversations for an artifact. This endpoint supports pagination and searching. + * + * @param {string} artifactId + * @param {string[]} queries + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + listConversations( + artifactId: string, + queries?: string[], + search?: string + ): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}/conversations'.replace( + '{artifactId}', + artifactId + ); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('get', uri, apiHeaders, payload); + } + /** + * Create a new conversation for an artifact. + * + * @param {string} artifactId + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + createConversation(artifactId: string, name: string): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + const apiPath = '/imagine/artifacts/{artifactId}/conversations'.replace( + '{artifactId}', + artifactId + ); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('post', uri, apiHeaders, payload); + } + /** + * Get a conversation by its unique ID. + * + * @param {string} artifactId + * @param {string} conversationId + * @throws {AppwriteException} + * @returns {Promise} + */ + getConversation(artifactId: string, conversationId: string): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}/conversations/{conversationId}' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('get', uri, apiHeaders, payload); + } + /** + * Update a conversation by its unique ID. This endpoint allows you to update the conversation's name, + messages, and status. + * + * @param {string} artifactId + * @param {string} conversationId + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + updateConversation( + artifactId: string, + conversationId: string, + name?: string + ): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}/conversations/{conversationId}' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('patch', uri, apiHeaders, payload); + } + /** + * Delete a conversation by its unique ID. Once deleted, the conversation will no longer be available. + * + * @param {string} artifactId + * @param {string} conversationId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteConversation(artifactId: string, conversationId: string): Promise<{}> { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}/conversations/{conversationId}' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('delete', uri, apiHeaders, payload); + } + /** + * List all messages in a conversation. This endpoint supports pagination and searching. + * + * @param {string} artifactId + * @param {string} conversationId + * @param {string[]} queries + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + listMessages( + artifactId: string, + conversationId: string, + queries?: string[], + search?: string + ): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + const apiPath = '/imagine/artifacts/{artifactId}/conversations/{conversationId}/messages' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('get', uri, apiHeaders, payload); + } + /** + * Create a new message in a conversation. + * + * @param {string} artifactId + * @param {string} conversationId + * @param {Type} type + * @param {string} content + * @throws {AppwriteException} + * @returns {Promise} + */ + createMessage( + artifactId: string, + conversationId: string, + type: Type, + content: string + ): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + if (typeof content === 'undefined') { + throw new AppwriteException('Missing required parameter: "content"'); + } + const apiPath = '/imagine/artifacts/{artifactId}/conversations/{conversationId}/messages' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId); + const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof content !== 'undefined') { + payload['content'] = content; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('post', uri, apiHeaders, payload); + } + /** + * Get a message by its unique ID. + * + * @param {string} artifactId + * @param {string} conversationId + * @param {string} messageId + * @throws {AppwriteException} + * @returns {Promise} + */ + getMessage( + artifactId: string, + conversationId: string, + messageId: string + ): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + if (typeof messageId === 'undefined') { + throw new AppwriteException('Missing required parameter: "messageId"'); + } + const apiPath = + '/imagine/artifacts/{artifactId}/conversations/{conversationId}/messages/{messageId}' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId) + .replace('{messageId}', messageId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('get', uri, apiHeaders, payload); + } + /** + * Update a message by its unique ID. This endpoint allows you to update the message's content and type. + * + * @param {string} artifactId + * @param {string} conversationId + * @param {string} messageId + * @param {string} content + * @param {string} type + * @throws {AppwriteException} + * @returns {Promise} + */ + updateMessage( + artifactId: string, + conversationId: string, + messageId: string, + content?: string, + type?: string + ): Promise { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + if (typeof messageId === 'undefined') { + throw new AppwriteException('Missing required parameter: "messageId"'); + } + const apiPath = + '/imagine/artifacts/{artifactId}/conversations/{conversationId}/messages/{messageId}' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId) + .replace('{messageId}', messageId); + const payload: Payload = {}; + if (typeof content !== 'undefined') { + payload['content'] = content; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('patch', uri, apiHeaders, payload); + } + /** + * Delete a message by its unique ID. Once deleted, the message will no longer be available. + * + * @param {string} artifactId + * @param {string} conversationId + * @param {string} messageId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteMessage(artifactId: string, conversationId: string, messageId: string): Promise<{}> { + if (typeof artifactId === 'undefined') { + throw new AppwriteException('Missing required parameter: "artifactId"'); + } + if (typeof conversationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "conversationId"'); + } + if (typeof messageId === 'undefined') { + throw new AppwriteException('Missing required parameter: "messageId"'); + } + const apiPath = + '/imagine/artifacts/{artifactId}/conversations/{conversationId}/messages/{messageId}' + .replace('{artifactId}', artifactId) + .replace('{conversationId}', conversationId) + .replace('{messageId}', messageId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json' + }; + + return this.client.call('delete', uri, apiHeaders, payload); + } +} + +export enum Type { + Text = 'text', + Image = 'image' +} +export type Artifact = { + /** + * Artifact unique ID. + */ + $id: string; + /** + * Artifact creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Artifact update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Artifact name. + */ + name: string; + /** + * Artifact description. + */ + description?: string; + /** + * Artifact version. + */ + version?: string; + /** + * Framework used in the artifact. + */ + framework?: string; + /** + * Technology stack used in the artifact. + */ + stack?: string[]; + /** + * Original prompt used to generate the artifact. + */ + prompt?: string; + /** + * Current status of the artifact. Possible values: draft, processing, completed, failed. + */ + status: string; +}; +/** + * Conversation + */ +export type Conversation = { + /** + * Conversation unique ID. + */ + $id: string; + /** + * Conversation creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Conversation update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * ID of the artifact this conversation belongs to. + */ + artifactId: string; + /** + * Conversation name. + */ + name: string; + /** + * Search index string. + */ + search: string; +}; +/** + * ConversationsMessage + */ +export type ConversationsMessage = { + /** + * Message unique ID. + */ + $id: string; + /** + * Message creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Message update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Artifact unique ID. + */ + artifactId: string; + /** + * Conversation unique ID. + */ + conversationId: string; + /** + * Message type. + */ + type: string; + /** + * Message content. + */ + content: string; + /** + * Message role. + */ + role: string; +}; +/** + * Artifacts List + */ +export type ArtifactsList = { + /** + * Total number of artifacts documents that matched your query. + */ + total: number; + /** + * List of artifacts. + */ + artifacts: Artifact[]; +}; +/** + * Conversations List + */ +export type ConversationsList = { + /** + * Total number of conversations documents that matched your query. + */ + total: number; + /** + * List of conversations. + */ + conversations: Conversation[]; +}; +/** + * Conversations Messages List + */ +export type ConversationsMessagesList = { + /** + * Total number of messages documents that matched your query. + */ + total: number; + /** + * List of messages. + */ + messages: ConversationsMessage[]; +}; + +/** + * Message + */ +export type Message = { + /** + * Message ID. + */ + $id: string; + /** + * Message creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Message update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Message provider type. + */ + providerType: string; + /** + * Topic IDs set as recipients. + */ + topics: string[]; + /** + * User IDs set as recipients. + */ + users: string[]; + /** + * Target IDs set as recipients. + */ + targets: string[]; + /** + * The scheduled time for message. + */ + scheduledAt?: string; + /** + * The time when the message was delivered. + */ + deliveredAt?: string; + /** + * Delivery errors if any. + */ + deliveryErrors?: string[]; + /** + * Number of recipients the message was delivered to. + */ + deliveredTotal: number; + /** + * Data of the message. + */ + data: object; + /** + * Status of delivery. + */ + status: string; +}; \ No newline at end of file diff --git a/package.json b/package.json index e18c8cec1..40fc2bfed 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dev": "vite dev", "build": "node build.js", "preview": "vite preview", - "prepare": "svelte-kit sync || echo ''", + "prepare": "svelte-kit sync", "clean": "rm -rf node_modules && rm -rf .svelte_kit && pnpm i --force", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", @@ -21,7 +21,7 @@ "e2e:ui": "playwright test --ui" }, "dependencies": { - "@ai-sdk/svelte": "^2.1.12", + "@ai-sdk/svelte": "3.0.0-beta.19", "@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@a5e5564", "@appwrite.io/pink-icons": "0.25.0", "@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1", @@ -30,7 +30,7 @@ "@popperjs/core": "^2.11.8", "@sentry/sveltekit": "^8.38.0", "@stripe/stripe-js": "^3.5.0", - "ai": "^2.2.37", + "ai": "5.0.0-beta.10", "analytics": "^0.8.16", "cron-parser": "^4.9.0", "dayjs": "^1.11.13", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4532f1acd..64c520d3e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@ai-sdk/svelte': - specifier: ^2.1.12 - version: 2.1.12(svelte@5.25.3)(zod@3.25.67) + specifier: 3.0.0-beta.19 + version: 3.0.0-beta.19(svelte@5.25.3)(zod@3.25.67) '@appwrite.io/console': specifier: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@a5e5564 version: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@a5e5564 @@ -36,8 +36,8 @@ importers: specifier: ^3.5.0 version: 3.5.0 ai: - specifier: ^2.2.37 - version: 2.2.37(react@18.3.1)(solid-js@1.9.5)(svelte@5.25.3)(vue@3.5.13(typescript@5.8.2)) + specifier: 5.0.0-beta.10 + version: 5.0.0-beta.10(zod@3.25.67) analytics: specifier: ^0.8.16 version: 0.8.16(@types/dlv@1.1.5) @@ -219,31 +219,43 @@ packages: '@adobe/css-tools@4.4.2': resolution: {integrity: sha512-baYZExFpsdkBNuvGKTKWCwKH57HRZLVtycZS05WTQNVOiXVSeAki3nU35zlRbToeMW8aHlJfyS+1C4BOv27q0A==} - '@ai-sdk/provider-utils@2.2.8': - resolution: {integrity: sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA==} + '@ai-sdk/gateway@1.0.0-beta.4': + resolution: {integrity: sha512-P5/dS7pb+cBRWnTP0Aezq3/3PIrF+p64fUTxBAyZIert8qTyHm2gd6atbAJZprZ304Ui3QjA9MFybAa849//2w==} engines: {node: '>=18'} peerDependencies: - zod: ^3.23.8 + zod: ^3.25.49 - '@ai-sdk/provider@1.1.3': - resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==} + '@ai-sdk/gateway@1.0.0-beta.8': + resolution: {integrity: sha512-D2SqYRT/42JTiRxUuiWtn5cYQFscpb9Z14UNvJx7lnurBUXx57zy7TbLH0h7O+WbCluTQN5G6146JpUZ/SRyzw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.49 || ^4 + + '@ai-sdk/provider-utils@3.0.0-beta.2': + resolution: {integrity: sha512-H4K+4weOVgWqrDDeAbQWoA4U5mN4WrQPHQFdH7ynQYcnhj/pzctU9Q6mGlR5ESMWxaXxazxlOblSITlXo9bahA==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.49 + + '@ai-sdk/provider-utils@3.0.0-beta.3': + resolution: {integrity: sha512-4gZ392GxjzMF7TnReF2eTKhOSyiSS3ydRVq4I7jxkeV5sdEuMoH3gzfItmlctsqGxlMU1/+zKPwl5yYz9O2dzg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.49 || ^4 + + '@ai-sdk/provider@2.0.0-beta.1': + resolution: {integrity: sha512-Z8SPncMtS3RsoXITmT7NVwrAq6M44dmw0DoUOYJqNNtCu8iMWuxB8Nxsoqpa0uEEy9R1V1ZThJAXTYgjTUxl3w==} engines: {node: '>=18'} - '@ai-sdk/svelte@2.1.12': - resolution: {integrity: sha512-1N0rRuMTIUR7m4z4Lq0SYVdtK+KPPivwmG0vb7Wu+P8YOy+dNgCuyiQtbHP0NAfdv06BMsdv5ByalHNhXM9kEA==} + '@ai-sdk/svelte@3.0.0-beta.19': + resolution: {integrity: sha512-ga3ZItXUT+sBxMyvlFIc9JnGUfcP0RuW2vE1TVWbTOGnPUhqPmHCoWhMyIR0Zc5y8dyItJpCHEn78bINSYMMQA==} peerDependencies: - svelte: ^5.0.0 - zod: ^3.23.8 + svelte: ^5.31.0 + zod: ^3.25.49 || ^4 peerDependenciesMeta: zod: optional: true - '@ai-sdk/ui-utils@1.2.11': - resolution: {integrity: sha512-3zcwCc8ezzFlwp3ZD15wAPjf2Au4s3vAbKsXQVyhxODHcmu0iyPO2Eua6D/vicq/AUm/BAo60r97O6HU+EI0+w==} - engines: {node: '>=18'} - peerDependencies: - zod: ^3.23.8 - '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -1237,6 +1249,9 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} + '@standard-schema/spec@1.0.0': + resolution: {integrity: sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==} + '@stripe/stripe-js@3.5.0': resolution: {integrity: sha512-pKS3wZnJoL1iTyGBXAvCwduNNeghJHY6QSRSNNvpYnrrQrLZ6Owsazjyynu0e0ObRgks0i7Rv+pe2M7/MBTZpQ==} engines: {node: '>=12.16'} @@ -1505,35 +1520,6 @@ packages: '@vitest/utils@3.0.9': resolution: {integrity: sha512-ilHM5fHhZ89MCp5aAaM9uhfl1c2JdxVxl3McqsdVyVNN6JffnEen8UMCdRTzOhGXNQGo5GNL9QugHrz727Wnng==} - '@vue/compiler-core@3.5.13': - resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} - - '@vue/compiler-dom@3.5.13': - resolution: {integrity: sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==} - - '@vue/compiler-sfc@3.5.13': - resolution: {integrity: sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==} - - '@vue/compiler-ssr@3.5.13': - resolution: {integrity: sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==} - - '@vue/reactivity@3.5.13': - resolution: {integrity: sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==} - - '@vue/runtime-core@3.5.13': - resolution: {integrity: sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==} - - '@vue/runtime-dom@3.5.13': - resolution: {integrity: sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==} - - '@vue/server-renderer@3.5.13': - resolution: {integrity: sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==} - peerDependencies: - vue: 3.5.13 - - '@vue/shared@3.5.13': - resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} - '@xterm/addon-fit@0.10.0': resolution: {integrity: sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==} peerDependencies: @@ -1565,23 +1551,18 @@ packages: resolution: {integrity: sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==} engines: {node: '>= 14'} - ai@2.2.37: - resolution: {integrity: sha512-JIYm5N1muGVqBqWnvkt29FmXhESoO5TcDxw74OE41SsM+uIou6NPDDs0XWb/ABcd1gmp6k5zym64KWMPM2xm0A==} - engines: {node: '>=14.6'} + ai@5.0.0-beta.10: + resolution: {integrity: sha512-99NBfy2yqN/XkomQ24X1wIb0m7IjHUW3/4W7cskq3cxRjHrdSt3apfn7ao6tXwBXD+6hro9qar7AQhhaQ6n8yw==} + engines: {node: '>=18'} peerDependencies: - react: ^18.2.0 - solid-js: ^1.7.7 - svelte: ^3.0.0 || ^4.0.0 - vue: ^3.3.4 - peerDependenciesMeta: - react: - optional: true - solid-js: - optional: true - svelte: - optional: true - vue: - optional: true + zod: ^3.25.49 + + ai@5.0.0-beta.19: + resolution: {integrity: sha512-oBBQMUUZde/p4FlYdxteh5LCq6v8XQnD4oujHZ3OvwCbLDP/t9VYBq/fx8HKQ48AcKU2uTkvSy3q697SfajAbw==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + zod: ^3.25.49 || ^4 ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -2151,9 +2132,6 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} @@ -2161,9 +2139,9 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - eventsource-parser@1.0.0: - resolution: {integrity: sha512-9jgfSCa3dmEme2ES3mPByGXfgZ87VbP97tng1G2nWwWx6bV2nYxm2AWCrbQjXToSe+yYlqaZNtxffR9IeQr95g==} - engines: {node: '>=14.18'} + eventsource-parser@3.0.3: + resolution: {integrity: sha512-nVpZkTMM9rF6AQ9gPJpFsNAMt48wIzB5TQgiTLdHiuO8XEDhUgZEhqKlZWXbIzo9VmJ/HvysHqEaVeD5v9TPvA==} + engines: {node: '>=20.0.0'} expect-type@1.2.0: resolution: {integrity: sha512-80F22aiJ3GLyVnS/B3HzgR6RelZVumzj9jkL0Rhz4h0xYbNW9PjlQz5h3J/SShErbXBc295vseR4/MIbVmUbeA==} @@ -2577,10 +2555,6 @@ packages: longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - loupe@3.1.3: resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} @@ -2809,11 +2783,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - nanoid@3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - nanoid@5.1.5: resolution: {integrity: sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==} engines: {node: ^18 || >=20} @@ -3048,10 +3017,6 @@ packages: react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -3158,9 +3123,6 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - secure-json-parse@2.7.0: - resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} - semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -3170,16 +3132,6 @@ packages: engines: {node: '>=10'} hasBin: true - seroval-plugins@1.2.1: - resolution: {integrity: sha512-H5vs53+39+x4Udwp4J5rNZfgFuA+Lt+uU+09w1gYBVWomtAl98B+E9w7yC05Xc81/HgLvJdlyqJbU0fJCKCmdw==} - engines: {node: '>=10'} - peerDependencies: - seroval: ^1.0 - - seroval@1.2.1: - resolution: {integrity: sha512-yBxFFs3zmkvKNmR0pFSU//rIsYjuX418TnlDmc2weaq5XFDqDIV/NOMPBoLrbxjLH42p4UzRuXHryXh9dYcKcw==} - engines: {node: '>=10'} - set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} @@ -3228,16 +3180,6 @@ packages: resolution: {integrity: sha512-FoqMu0NCGBLCcAkS1qA+XJIQTR6/JHfQXl+uGteNCQ76T91DMUjPa9xfmeqMY3z80nLSg9yQmNjK0Px6RWsH/A==} engines: {node: '>=18'} - solid-js@1.9.5: - resolution: {integrity: sha512-ogI3DaFcyn6UhYhrgcyRAMbu/buBJitYQASZz5WzfQVPP10RD2AbCoRZ517psnezrasyCbWzIxZ6kVqet768xw==} - - solid-swr-store@0.10.7: - resolution: {integrity: sha512-A6d68aJmRP471aWqKKPE2tpgOiR5fH4qXQNfKIec+Vap+MGQm3tvXlT8n0I8UgJSlNAsSAUuw2VTviH2h3Vv5g==} - engines: {node: '>=10'} - peerDependencies: - solid-js: ^1.2 - swr-store: ^0.10 - sorcery@1.0.0: resolution: {integrity: sha512-5ay9oJE+7sNmhzl3YNG18jEEEf4AOQCM/FAqR5wMmzqd1FtRorFbJXn3w3SKOhbiQaVgHM+Q1lszZspjri7bpA==} hasBin: true @@ -3256,11 +3198,6 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - sswr@2.0.0: - resolution: {integrity: sha512-mV0kkeBHcjcb0M5NqKtKVg/uTIYNlIIniyDfSGrSfxpEdM9C365jK0z55pl9K0xAkNTJi2OAOVFQpgMPUk+V0w==} - peerDependencies: - svelte: ^4.0.0 - stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -3379,23 +3316,6 @@ packages: resolution: {integrity: sha512-J9rcZ/xVJonAoESqVGHHZhrNdVbrCfkdB41BP6eiwHMoFShD9it3yZXApVYMHdGfCshBsZCKsajwJeBbS/M1zg==} engines: {node: '>=18'} - swr-store@0.10.6: - resolution: {integrity: sha512-xPjB1hARSiRaNNlUQvWSVrG5SirCjk2TmaUyzzvk69SZQan9hCJqw/5rG9iL7xElHU784GxRPISClq4488/XVw==} - engines: {node: '>=10'} - - swr@2.2.0: - resolution: {integrity: sha512-AjqHOv2lAhkuUdIiBu9xbuettzAzWXmCEcLONNKJRba87WAefz8Ca9d6ds/SzrPc235n1IxWYdhJ2zF3MNUaoQ==} - peerDependencies: - react: ^16.11.0 || ^17.0.0 || ^18.0.0 - - swrev@4.0.0: - resolution: {integrity: sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA==} - - swrv@1.0.4: - resolution: {integrity: sha512-zjEkcP8Ywmj+xOJW3lIT65ciY/4AL4e/Or7Gj0MzU3zBJNMdJiT8geVZhINavnlHRMMCcJLHhraLTAiDOTmQ9g==} - peerDependencies: - vue: '>=3.2.26 < 4' - symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -3545,11 +3465,6 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - use-sync-external-store@1.5.0: - resolution: {integrity: sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -3640,14 +3555,6 @@ packages: jsdom: optional: true - vue@3.5.13: - resolution: {integrity: sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - w3c-xmlserializer@5.0.0: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} @@ -3762,32 +3669,46 @@ snapshots: '@adobe/css-tools@4.4.2': {} - '@ai-sdk/provider-utils@2.2.8(zod@3.25.67)': + '@ai-sdk/gateway@1.0.0-beta.4(zod@3.25.67)': dependencies: - '@ai-sdk/provider': 1.1.3 - nanoid: 3.3.11 - secure-json-parse: 2.7.0 + '@ai-sdk/provider': 2.0.0-beta.1 + '@ai-sdk/provider-utils': 3.0.0-beta.2(zod@3.25.67) zod: 3.25.67 - '@ai-sdk/provider@1.1.3': + '@ai-sdk/gateway@1.0.0-beta.8(zod@3.25.67)': + dependencies: + '@ai-sdk/provider': 2.0.0-beta.1 + '@ai-sdk/provider-utils': 3.0.0-beta.3(zod@3.25.67) + zod: 3.25.67 + + '@ai-sdk/provider-utils@3.0.0-beta.2(zod@3.25.67)': + dependencies: + '@ai-sdk/provider': 2.0.0-beta.1 + '@standard-schema/spec': 1.0.0 + eventsource-parser: 3.0.3 + zod: 3.25.67 + zod-to-json-schema: 3.24.6(zod@3.25.67) + + '@ai-sdk/provider-utils@3.0.0-beta.3(zod@3.25.67)': + dependencies: + '@ai-sdk/provider': 2.0.0-beta.1 + '@standard-schema/spec': 1.0.0 + eventsource-parser: 3.0.3 + zod: 3.25.67 + zod-to-json-schema: 3.24.6(zod@3.25.67) + + '@ai-sdk/provider@2.0.0-beta.1': dependencies: json-schema: 0.4.0 - '@ai-sdk/svelte@2.1.12(svelte@5.25.3)(zod@3.25.67)': + '@ai-sdk/svelte@3.0.0-beta.19(svelte@5.25.3)(zod@3.25.67)': dependencies: - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.67) - '@ai-sdk/ui-utils': 1.2.11(zod@3.25.67) + '@ai-sdk/provider-utils': 3.0.0-beta.3(zod@3.25.67) + ai: 5.0.0-beta.19(zod@3.25.67) svelte: 5.25.3 optionalDependencies: zod: 3.25.67 - '@ai-sdk/ui-utils@1.2.11(zod@3.25.67)': - dependencies: - '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@3.25.67) - zod: 3.25.67 - zod-to-json-schema: 3.24.6(zod@3.25.67) - '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.8 @@ -4849,6 +4770,8 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} + '@standard-schema/spec@1.0.0': {} + '@stripe/stripe-js@3.5.0': {} '@sveltejs/acorn-typescript@1.0.5(acorn@8.14.1)': @@ -5211,60 +5134,6 @@ snapshots: loupe: 3.1.3 tinyrainbow: 2.0.0 - '@vue/compiler-core@3.5.13': - dependencies: - '@babel/parser': 7.27.0 - '@vue/shared': 3.5.13 - entities: 4.5.0 - estree-walker: 2.0.2 - source-map-js: 1.2.1 - - '@vue/compiler-dom@3.5.13': - dependencies: - '@vue/compiler-core': 3.5.13 - '@vue/shared': 3.5.13 - - '@vue/compiler-sfc@3.5.13': - dependencies: - '@babel/parser': 7.27.0 - '@vue/compiler-core': 3.5.13 - '@vue/compiler-dom': 3.5.13 - '@vue/compiler-ssr': 3.5.13 - '@vue/shared': 3.5.13 - estree-walker: 2.0.2 - magic-string: 0.30.17 - postcss: 8.5.3 - source-map-js: 1.2.1 - - '@vue/compiler-ssr@3.5.13': - dependencies: - '@vue/compiler-dom': 3.5.13 - '@vue/shared': 3.5.13 - - '@vue/reactivity@3.5.13': - dependencies: - '@vue/shared': 3.5.13 - - '@vue/runtime-core@3.5.13': - dependencies: - '@vue/reactivity': 3.5.13 - '@vue/shared': 3.5.13 - - '@vue/runtime-dom@3.5.13': - dependencies: - '@vue/reactivity': 3.5.13 - '@vue/runtime-core': 3.5.13 - '@vue/shared': 3.5.13 - csstype: 3.1.3 - - '@vue/server-renderer@3.5.13(vue@3.5.13(typescript@5.8.2))': - dependencies: - '@vue/compiler-ssr': 3.5.13 - '@vue/shared': 3.5.13 - vue: 3.5.13(typescript@5.8.2) - - '@vue/shared@3.5.13': {} - '@xterm/addon-fit@0.10.0(@xterm/xterm@5.5.0)': dependencies: '@xterm/xterm': 5.5.0 @@ -5289,20 +5158,21 @@ snapshots: agent-base@7.1.3: {} - ai@2.2.37(react@18.3.1)(solid-js@1.9.5)(svelte@5.25.3)(vue@3.5.13(typescript@5.8.2)): + ai@5.0.0-beta.10(zod@3.25.67): dependencies: - eventsource-parser: 1.0.0 - nanoid: 3.3.6 - solid-swr-store: 0.10.7(solid-js@1.9.5)(swr-store@0.10.6) - sswr: 2.0.0(svelte@5.25.3) - swr: 2.2.0(react@18.3.1) - swr-store: 0.10.6 - swrv: 1.0.4(vue@3.5.13(typescript@5.8.2)) - optionalDependencies: - react: 18.3.1 - solid-js: 1.9.5 - svelte: 5.25.3 - vue: 3.5.13(typescript@5.8.2) + '@ai-sdk/gateway': 1.0.0-beta.4(zod@3.25.67) + '@ai-sdk/provider': 2.0.0-beta.1 + '@ai-sdk/provider-utils': 3.0.0-beta.2(zod@3.25.67) + '@opentelemetry/api': 1.9.0 + zod: 3.25.67 + + ai@5.0.0-beta.19(zod@3.25.67): + dependencies: + '@ai-sdk/gateway': 1.0.0-beta.8(zod@3.25.67) + '@ai-sdk/provider': 2.0.0-beta.1 + '@ai-sdk/provider-utils': 3.0.0-beta.3(zod@3.25.67) + '@opentelemetry/api': 1.9.0 + zod: 3.25.67 ajv@6.12.6: dependencies: @@ -5953,15 +5823,13 @@ snapshots: estraverse@5.3.0: {} - estree-walker@2.0.2: {} - estree-walker@3.0.3: dependencies: '@types/estree': 1.0.7 esutils@2.0.3: {} - eventsource-parser@1.0.0: {} + eventsource-parser@3.0.3: {} expect-type@1.2.0: {} @@ -6375,10 +6243,6 @@ snapshots: longest-streak@3.1.0: {} - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - loupe@3.1.3: {} lowlight@3.3.0: @@ -6771,8 +6635,6 @@ snapshots: nanoid@3.3.11: {} - nanoid@3.3.6: {} - nanoid@5.1.5: {} nanotar@0.1.1: {} @@ -6966,10 +6828,6 @@ snapshots: react-is@17.0.2: {} - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - readdirp@3.6.0: dependencies: picomatch: 2.3.1 @@ -7136,18 +6994,10 @@ snapshots: dependencies: xmlchars: 2.2.0 - secure-json-parse@2.7.0: {} - semver@6.3.1: {} semver@7.7.1: {} - seroval-plugins@1.2.1(seroval@1.2.1): - dependencies: - seroval: 1.2.1 - - seroval@1.2.1: {} - set-cookie-parser@2.7.1: {} set-function-length@1.2.2: @@ -7221,17 +7071,6 @@ snapshots: mrmime: 2.0.1 totalist: 3.0.1 - solid-js@1.9.5: - dependencies: - csstype: 3.1.3 - seroval: 1.2.1 - seroval-plugins: 1.2.1(seroval@1.2.1) - - solid-swr-store@0.10.7(solid-js@1.9.5)(swr-store@0.10.6): - dependencies: - solid-js: 1.9.5 - swr-store: 0.10.6 - sorcery@1.0.0: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -7246,11 +7085,6 @@ snapshots: sprintf-js@1.0.3: {} - sswr@2.0.0(svelte@5.25.3): - dependencies: - svelte: 5.25.3 - swrev: 4.0.0 - stackback@0.0.2: {} std-env@3.8.1: {} @@ -7381,21 +7215,6 @@ snapshots: magic-string: 0.30.17 zimmerframe: 1.1.2 - swr-store@0.10.6: - dependencies: - dequal: 2.0.3 - - swr@2.2.0(react@18.3.1): - dependencies: - react: 18.3.1 - use-sync-external-store: 1.5.0(react@18.3.1) - - swrev@4.0.0: {} - - swrv@1.0.4(vue@3.5.13(typescript@5.8.2)): - dependencies: - vue: 3.5.13(typescript@5.8.2) - symbol-tree@3.2.4: {} tabbable@6.2.0: {} @@ -7545,10 +7364,6 @@ snapshots: dependencies: punycode: 2.3.1 - use-sync-external-store@1.5.0(react@18.3.1): - dependencies: - react: 18.3.1 - util-deprecate@1.0.2: {} vfile-message@4.0.2: @@ -7637,16 +7452,6 @@ snapshots: - tsx - yaml - vue@3.5.13(typescript@5.8.2): - dependencies: - '@vue/compiler-dom': 3.5.13 - '@vue/compiler-sfc': 3.5.13 - '@vue/runtime-dom': 3.5.13 - '@vue/server-renderer': 3.5.13(vue@3.5.13(typescript@5.8.2)) - '@vue/shared': 3.5.13 - optionalDependencies: - typescript: 5.8.2 - w3c-xmlserializer@5.0.0: dependencies: xml-name-validator: 5.0.0 diff --git a/src/lib/commandCenter/panels/ai.svelte b/src/lib/commandCenter/panels/ai.svelte index e44d0e28e..5f46f726b 100644 --- a/src/lib/commandCenter/panels/ai.svelte +++ b/src/lib/commandCenter/panels/ai.svelte @@ -7,7 +7,7 @@ import { AvatarInitials, Code, LoadingDots, SvgIcon } from '$lib/components'; import { user } from '$lib/stores/user'; - import { useCompletion } from '@ai-sdk/svelte'; + import { Completion } from '@ai-sdk/svelte'; import { subPanels } from '../subPanels'; import { isLanguage, type Language } from '$lib/components/code.svelte'; @@ -15,14 +15,16 @@ import { getApiEndpoint } from '$lib/stores/sdk'; const endpoint = getApiEndpoint(); - const { input, handleSubmit, completion, isLoading, complete, error } = useCompletion({ + + const completion = new Completion({ api: endpoint + '/console/assistant', headers: { 'x-appwrite-project': 'console' }, credentials: 'include', streamProtocol: 'text' - }); + }) + const examples = [ 'How to add platform in the console?', @@ -88,7 +90,7 @@ return answer; } - $: answer = parseCompletion($completion); + $: answer = parseCompletion(completion.completion); function renderMarkdown(answer: string): string { const trimmedAnswer = answer @@ -123,25 +125,25 @@ } let previousQuestion = ''; - $: if ($input) { - previousQuestion = $input; + $: if (completion.input) { + previousQuestion = completion.input; } - $: if (!$isLoading && answer) { + $: if (!completion.loading && answer) { // reset input if answer received. - $input = ''; + completion.input = ''; }