diff --git a/.changeset/smart-flowers-report.md b/.changeset/smart-flowers-report.md new file mode 100644 index 000000000..09e4f9386 --- /dev/null +++ b/.changeset/smart-flowers-report.md @@ -0,0 +1,5 @@ +--- +'@livekit/agents-plugin-baseten': patch +--- + +Updating package definition for public release diff --git a/plugins/baseten/api-extractor.json b/plugins/baseten/api-extractor.json new file mode 100644 index 000000000..1f75e0708 --- /dev/null +++ b/plugins/baseten/api-extractor.json @@ -0,0 +1,20 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + "extends": "../../api-extractor-shared.json", + "mainEntryPointFilePath": "./dist/index.d.ts" +} diff --git a/plugins/baseten/package.json b/plugins/baseten/package.json index 4098aa00d..81026ae45 100644 --- a/plugins/baseten/package.json +++ b/plugins/baseten/package.json @@ -1,53 +1,68 @@ { - "name": "@livekit/agents-plugin-baseten", - "version": "1.0.30", - "description": "Baseten plugin for LiveKit Node Agents", - "private": true, - "main": "dist/index.js", - "types": "dist/index.d.ts", - "type": "module", - "author": "LiveKit", - "repository": "git@github.com:livekit/agents-js.git", - "license": "Apache-2.0", - "files": [ - "dist", - "src", - "README.md" - ], - "scripts": { - "build": "tsc", - "dev": "tsc --watch", - "clean": "rm -rf dist", - "typecheck": "tsc --noEmit", - "lint": "eslint \"src/**/*.ts\"", - "lint:fix": "eslint --fix \"src/**/*.ts\"" + "name": "@livekit/agents-plugin-baseten", + "version": "1.0.30", + "description": "Baseten plugin for LiveKit Node Agents", + "main": "dist/index.js", + "require": "dist/index.cjs", + "types": "dist/index.d.ts", + "exports": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" }, - "keywords": [ - "livekit", - "agents", - "baseten", - "llm", - "stt", - "tts", - "voice-ai" - ], - "dependencies": { - "dotenv": "^17.2.3", - "openai": "^6.8.1", - "ws": "^8.14.2" - }, - "devDependencies": { - "@livekit/agents": "workspace:*", - "@livekit/agents-plugin-silero": "workspace:*", - "@livekit/agents-plugins-test": "workspace:*", - "@livekit/rtc-node": "^0.13.22", - "@types/node": "^22.18.11", - "@types/ws": "^8.5.8", - "tsx": "^4.7.0", - "typescript": "^5.9.3" - }, - "peerDependencies": { - "@livekit/agents": "workspace:*", - "@livekit/rtc-node": "^0.13.22" + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" } + }, + "author": "LiveKit", + "type": "module", + "repository": "git@github.com:livekit/agents-js.git", + "license": "Apache-2.0", + "files": [ + "dist", + "src", + "README.md" + ], + "scripts": { + "build": "tsup --onSuccess \"pnpm build:types\"", + "build:types": "tsc --declaration --emitDeclarationOnly && node ../../scripts/copyDeclarationOutput.js", + "clean": "rm -rf dist", + "clean:build": "pnpm clean && pnpm build", + "dev": "tsc --watch", + "typecheck": "tsc --noEmit", + "lint": "eslint \"src/**/*.ts\"", + "lint:fix": "eslint --fix \"src/**/*.ts\"", + "api:check": "api-extractor run --typescript-compiler-folder ../../node_modules/typescript", + "api:update": "api-extractor run --local --typescript-compiler-folder ../../node_modules/typescript --verbose" + }, + "keywords": [ + "livekit", + "agents", + "baseten", + "llm", + "stt", + "tts", + "voice-ai" + ], + "devDependencies": { + "@livekit/agents": "workspace:*", + "@livekit/agents-plugin-silero": "workspace:*", + "@livekit/agents-plugins-test": "workspace:*", + "@livekit/rtc-node": "^0.13.22", + "@microsoft/api-extractor": "^7.35.0", + "@types/node": "^22.18.11", + "@types/ws": "^8.5.8", + "tsx": "^4.7.0", + "typescript": "^5.9.3" + }, + "dependencies": { + "dotenv": "^17.2.3", + "openai": "^6.8.1", + "ws": "^8.14.2" + }, + "peerDependencies": { + "@livekit/agents": "workspace:*", + "@livekit/rtc-node": "^0.13.22" + } } diff --git a/plugins/baseten/src/index.ts b/plugins/baseten/src/index.ts index 69d2a1393..128587ad4 100644 --- a/plugins/baseten/src/index.ts +++ b/plugins/baseten/src/index.ts @@ -1,14 +1,12 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. // // SPDX-License-Identifier: Apache-2.0 - -/** - * LiveKit Agents Baseten Plugin - * - * Integrates Baseten-hosted models with LiveKit Agents for LLM, STT, and TTS services. - */ import { Plugin } from '@livekit/agents'; +export { LLM } from './llm.js'; +export { STT } from './stt.js'; +export { TTS, ChunkedStream } from './tts.js'; +export type { BasetenLLMOptions, BasetenSttOptions, BasetenTTSOptions } from './types.js'; class BasetenPlugin extends Plugin { constructor() { super({ @@ -20,11 +18,3 @@ class BasetenPlugin extends Plugin { } Plugin.registerPlugin(new BasetenPlugin()); - -// Export classes following LiveKit plugin pattern -export { LLM } from './llm.js'; -export { STT } from './stt.js'; -export { TTS } from './tts.js'; - -// Export all types -export type { BasetenLLMOptions, BasetenSttOptions, BasetenTTSOptions } from './types.js'; diff --git a/plugins/baseten/tsup.config.ts b/plugins/baseten/tsup.config.ts new file mode 100644 index 000000000..8ca20961f --- /dev/null +++ b/plugins/baseten/tsup.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'tsup'; + +import defaults from '../../tsup.config'; + +export default defineConfig({ + ...defaults, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec83bd27b..8340b2eb4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -374,6 +374,9 @@ importers: '@livekit/rtc-node': specifier: ^0.13.22 version: 0.13.22 + '@microsoft/api-extractor': + specifier: ^7.35.0 + version: 7.43.7(@types/node@22.19.1) '@types/node': specifier: ^22.18.11 version: 22.19.1