diff --git a/cspell.config.yaml b/cspell.config.yaml index 47874826..4dcd1b6d 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -1,4 +1,4 @@ -version: "0.2" +version: '0.2' ignorePaths: [] dictionaryDefinitions: [] dictionaries: [] diff --git a/docs/components/ui/hover-border-gradient.tsx b/docs/components/ui/hover-border-gradient.tsx index 44bc9d5c..788e580f 100644 --- a/docs/components/ui/hover-border-gradient.tsx +++ b/docs/components/ui/hover-border-gradient.tsx @@ -47,12 +47,12 @@ export function HoverBorderGradient({ = 'radial-gradient(75% 181.15942028985506% at 50% 50%, #3275F8 0%, rgba(255, 255, 255, 0) 100%)' useEffect(() => { - if (!hovered) { - const interval = setInterval(() => { - setDirection(prevState => rotateDirection(prevState)) - }, duration * 1000) - return () => clearInterval(interval) - } + if (hovered) + return + const interval = setInterval(() => { + setDirection(prevState => rotateDirection(prevState)) + }, duration * 1000) + return () => clearInterval(interval) }, [hovered]) return ( => - await (options.fetch ?? globalThis.fetch)(requestURL('embeddings', options.baseURL), { + (options.fetch ?? globalThis.fetch)(requestURL('embeddings', options.baseURL), { body: requestBody(options), headers: requestHeaders({ 'Content-Type': 'application/json', diff --git a/packages/embed/src/utils/embed.ts b/packages/embed/src/utils/embed.ts index db20cbd7..89c14e69 100644 --- a/packages/embed/src/utils/embed.ts +++ b/packages/embed/src/utils/embed.ts @@ -29,7 +29,7 @@ export interface EmbedResult { } export const embed = async (options: EmbedOptions): Promise => - await (options.fetch ?? globalThis.fetch)(requestURL('embeddings', options.baseURL), { + (options.fetch ?? globalThis.fetch)(requestURL('embeddings', options.baseURL), { body: requestBody(options), headers: requestHeaders({ 'Content-Type': 'application/json', diff --git a/packages/embed/tsconfig.json b/packages/embed/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/embed/tsconfig.json +++ b/packages/embed/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/generate-object/package.json b/packages/generate-object/package.json index 5d72fd4b..64d67e5b 100644 --- a/packages/generate-object/package.json +++ b/packages/generate-object/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/generate-object", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/generate-object" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/generate-object/src/index.ts b/packages/generate-object/src/index.ts index 6b29fe39..2b3b6603 100644 --- a/packages/generate-object/src/index.ts +++ b/packages/generate-object/src/index.ts @@ -15,7 +15,7 @@ export interface GenerateObjectResult extends Omit(options: GenerateObjectOptions): Promise> => - await generateText({ + generateText({ ...options, response_format: { json_schema: { diff --git a/packages/generate-object/tsconfig.json b/packages/generate-object/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/generate-object/tsconfig.json +++ b/packages/generate-object/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/generate-speech/package.json b/packages/generate-speech/package.json index 779468a9..8c5bb344 100644 --- a/packages/generate-speech/package.json +++ b/packages/generate-speech/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/generate-speech", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/generate-speech" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/generate-speech/src/index.ts b/packages/generate-speech/src/index.ts index cb0a52eb..28226aec 100644 --- a/packages/generate-speech/src/index.ts +++ b/packages/generate-speech/src/index.ts @@ -16,7 +16,7 @@ export interface GenerateSpeechOptions extends CommonRequestOptions { * @returns audio array buffer */ export const generateSpeech = async (options: GenerateSpeechOptions): Promise => - await (options.fetch ?? globalThis.fetch)(requestURL('audio/speech', options.baseURL), { + (options.fetch ?? globalThis.fetch)(requestURL('audio/speech', options.baseURL), { body: requestBody(options), headers: requestHeaders({ 'Content-Type': 'application/json', @@ -26,6 +26,6 @@ export const generateSpeech = async (options: GenerateSpeechOptions): Promise res.arrayBuffer()) + .then(async res => res.arrayBuffer()) export default generateSpeech diff --git a/packages/generate-speech/tsconfig.json b/packages/generate-speech/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/generate-speech/tsconfig.json +++ b/packages/generate-speech/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/generate-text/package.json b/packages/generate-text/package.json index e9e0622f..3fafb8cf 100644 --- a/packages/generate-text/package.json +++ b/packages/generate-text/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/generate-text", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/generate-text" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/generate-text/src/index.ts b/packages/generate-text/src/index.ts index c0bdcbba..8d68da3a 100644 --- a/packages/generate-text/src/index.ts +++ b/packages/generate-text/src/index.ts @@ -72,14 +72,14 @@ type RawGenerateTextTrampoline = Promise<(() => RawGenerateTextTrampoline) /** @internal */ const rawGenerateText: RawGenerateText = async (options: GenerateTextOptions) => - await chat({ + chat({ ...options, maxSteps: undefined, messages: options.messages, steps: undefined, stream: false, }) - .then(res => res.json() as Promise) + .then(async res => res.json() as Promise) .then(async ({ choices, usage }) => { const messages: Message[] = options.messages const steps: StepResult[] = options.steps ?? [] @@ -152,7 +152,7 @@ const rawGenerateText: RawGenerateText = async (options: GenerateTextOptions) => if (options.onStepFinish) await options.onStepFinish(step) - return async () => await rawGenerateText({ + return async () => rawGenerateText({ ...options, messages, steps, @@ -162,7 +162,7 @@ const rawGenerateText: RawGenerateText = async (options: GenerateTextOptions) => export const generateText = async (options: GenerateTextOptions): Promise => { let result = await rawGenerateText(options) - while (result instanceof Function) + while (typeof result === 'function') result = await result() return result diff --git a/packages/generate-text/tsconfig.json b/packages/generate-text/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/generate-text/tsconfig.json +++ b/packages/generate-text/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/generate-transcription/package.json b/packages/generate-transcription/package.json index 8a0002f9..f1b3de5e 100644 --- a/packages/generate-transcription/package.json +++ b/packages/generate-transcription/package.json @@ -1,31 +1,31 @@ { "name": "@xsai/generate-transcription", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": [ - "xsai", - "openai", - "ai" - ], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/generate-transcription" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": [ + "xsai", + "openai", + "ai" + ], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/generate-transcription/src/index.ts b/packages/generate-transcription/src/index.ts index 30b78211..bcee1c36 100644 --- a/packages/generate-transcription/src/index.ts +++ b/packages/generate-transcription/src/index.ts @@ -24,7 +24,7 @@ export const generateTranscription = async (options: GenerateTranscriptionOption body.append('model', options.model) body.append('file', options.file, options.fileName) - return await (options.fetch ?? globalThis.fetch)(requestURL('audio/transcriptions', options.baseURL), { + return (options.fetch ?? globalThis.fetch)(requestURL('audio/transcriptions', options.baseURL), { body, headers: requestHeaders(options.headers, options.apiKey), method: 'POST', diff --git a/packages/generate-transcription/tsconfig.json b/packages/generate-transcription/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/generate-transcription/tsconfig.json +++ b/packages/generate-transcription/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/model/package.json b/packages/model/package.json index 69794eca..50997e5d 100644 --- a/packages/model/package.json +++ b/packages/model/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/model", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/model" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/model/src/utils/list-models.ts b/packages/model/src/utils/list-models.ts index 5ad1e719..f4824b01 100644 --- a/packages/model/src/utils/list-models.ts +++ b/packages/model/src/utils/list-models.ts @@ -10,7 +10,7 @@ export interface ListModelsResponse { } export const listModels = async (options: ListModelsOptions): Promise => - await (options.fetch ?? globalThis.fetch)(requestURL('models', options.baseURL), { + (options.fetch ?? globalThis.fetch)(requestURL('models', options.baseURL), { headers: requestHeaders({ 'Content-Type': 'application/json', ...options.headers, diff --git a/packages/model/src/utils/retrieve-model.ts b/packages/model/src/utils/retrieve-model.ts index dd73c83b..e7f73cb2 100644 --- a/packages/model/src/utils/retrieve-model.ts +++ b/packages/model/src/utils/retrieve-model.ts @@ -5,7 +5,7 @@ import type { Model } from '../types/model' export interface RetrieveModelOptions extends CommonRequestOptions {} export const retrieveModel = async (options: RetrieveModelOptions): Promise => - await (options.fetch ?? globalThis.fetch)(requestURL(`models/${options.model}`, options.baseURL), { + (options.fetch ?? globalThis.fetch)(requestURL(`models/${options.model}`, options.baseURL), { headers: requestHeaders({ 'Content-Type': 'application/json', ...options.headers, diff --git a/packages/model/tsconfig.json b/packages/model/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/model/tsconfig.json +++ b/packages/model/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/providers/package.json b/packages/providers/package.json index f5e05d2e..8775ef13 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/providers", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/providers" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/shared-chat/package.json b/packages/shared-chat/package.json index 046d19e7..bfede3f7 100644 --- a/packages/shared-chat/package.json +++ b/packages/shared-chat/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/shared-chat", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/shared-chat" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/shared-chat/src/utils/chat.ts b/packages/shared-chat/src/utils/chat.ts index efe75438..43e331a2 100644 --- a/packages/shared-chat/src/utils/chat.ts +++ b/packages/shared-chat/src/utils/chat.ts @@ -3,7 +3,7 @@ import { requestBody, requestHeaders, requestURL, responseCatch } from '@xsai/sh import type { ChatOptions, Tool } from '../types' export const chat = async (options: T) => - await (options.fetch ?? globalThis.fetch)(requestURL('chat/completions', options.baseURL), { + (options.fetch ?? globalThis.fetch)(requestURL('chat/completions', options.baseURL), { body: requestBody({ ...options, tools: (options.tools as Tool[] | undefined)?.map(tool => ({ diff --git a/packages/shared/package.json b/packages/shared/package.json index b87c4fd2..f5601bb2 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/shared", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/shared" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/shared/src/utils/response-json.ts b/packages/shared/src/utils/response-json.ts index 6ac9ce4c..4c8f2d3f 100644 --- a/packages/shared/src/utils/response-json.ts +++ b/packages/shared/src/utils/response-json.ts @@ -2,4 +2,4 @@ import { responseCatch } from './response-catch' export const responseJSON = async (res: Response) => responseCatch(res) - .then(res => res.json() as Promise) + .then(async res => res.json() as Promise) diff --git a/packages/stream-object/package.json b/packages/stream-object/package.json index 927313ce..5e5f2513 100644 --- a/packages/stream-object/package.json +++ b/packages/stream-object/package.json @@ -1,31 +1,31 @@ { "name": "@xsai/stream-object", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": [ - "xsai", - "openai", - "ai" - ], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/stream-object" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": [ + "xsai", + "openai", + "ai" + ], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/stream-object/src/index.ts b/packages/stream-object/src/index.ts index 58893ba8..1b963d4a 100644 --- a/packages/stream-object/src/index.ts +++ b/packages/stream-object/src/index.ts @@ -17,7 +17,7 @@ export interface StreamObjectResult extends StreamTextResult { /** @experimental WIP */ export const streamObject = async (options: StreamObjectOptions): Promise> => - await streamText({ + streamText({ ...options, response_format: { json_schema: { diff --git a/packages/stream-object/tsconfig.json b/packages/stream-object/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/stream-object/tsconfig.json +++ b/packages/stream-object/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/stream-text/package.json b/packages/stream-text/package.json index 09b9738a..73b218cf 100644 --- a/packages/stream-text/package.json +++ b/packages/stream-text/package.json @@ -1,27 +1,27 @@ { "name": "@xsai/stream-text", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/stream-text" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], diff --git a/packages/stream-text/src/index.ts b/packages/stream-text/src/index.ts index 700eb182..15b6d393 100644 --- a/packages/stream-text/src/index.ts +++ b/packages/stream-text/src/index.ts @@ -49,7 +49,7 @@ const chunkHeaderPrefix = 'data:' /** * @experimental WIP, does not support function calling (tools). */ -export const streamText = async (options: StreamTextOptions): Promise => await chat({ +export const streamText = async (options: StreamTextOptions): Promise => chat({ ...options, stream: true, }).then(async (res) => { diff --git a/packages/stream-text/tsconfig.json b/packages/stream-text/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/stream-text/tsconfig.json +++ b/packages/stream-text/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/tool/package.json b/packages/tool/package.json index f3d03b6e..0ea0a963 100644 --- a/packages/tool/package.json +++ b/packages/tool/package.json @@ -1,21 +1,19 @@ { "name": "@xsai/tool", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/tool" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", @@ -25,6 +23,8 @@ "types": "./dist/generate-text.d.ts" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ], @@ -34,6 +34,14 @@ "test": "vitest run", "test:watch": "vitest" }, + "peerDependencies": { + "@xsai/generate-text": "workspace:" + }, + "peerDependenciesMeta": { + "@xsai/generate-text": { + "optional": true + } + }, "dependencies": { "@typeschema/main": "catalog:", "@xsai/shared": "workspace:" @@ -43,13 +51,5 @@ "@xsai/generate-text": "workspace:", "@xsai/providers": "workspace:", "valibot": "catalog:" - }, - "peerDependencies": { - "@xsai/generate-text": "workspace:" - }, - "peerDependenciesMeta": { - "@xsai/generate-text": { - "optional": true - } } } diff --git a/packages/tool/tsconfig.json b/packages/tool/tsconfig.json index c22e8ffb..6b91ed84 100644 --- a/packages/tool/tsconfig.json +++ b/packages/tool/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "@importantimport/tsconfig/app.json", - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/xsai/package.json b/packages/xsai/package.json index ced97271..6a1aa1f6 100644 --- a/packages/xsai/package.json +++ b/packages/xsai/package.json @@ -1,21 +1,19 @@ { "name": "xsai", - "version": "0.0.29", "type": "module", + "version": "0.0.29", + "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", "author": "Moeru AI", "license": "MIT", "homepage": "https://xsai.js.org", - "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.", - "keywords": ["xsai", "openai", "ai"], "repository": { "type": "git", "url": "git+https://github.com/moeru-ai/xsai.git", "directory": "packages/xsai" }, "bugs": "https://github.com/moeru-ai/xsai/issues", + "keywords": ["xsai", "openai", "ai"], "sideEffects": false, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", @@ -26,6 +24,8 @@ "default": "./dist/providers.js" } }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "files": [ "dist" ],