diff --git a/bun.lockb b/bun.lockb index 12a2862d436..cca7a8340f6 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 87d4231d05a..cd30d95f8c9 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "check": "biome check --apply .", "preinstall": "npx only-allow bun", "build": "turbo run build --filter=./packages/*", - "start": "bun --filter=./packages/* --filter=!@elizaos/cli start", - "agent": "bun --filter=@elizaos/agent start", - "dev": "bun --filter=./packages/* dev", + "start": "turbo run start --filter=!./packages/docs", + "agent": "turbo run start --filter=@elizaos/agent", + "dev": "turbo run dev --filter=!./packages/docs", "release": "bun run build && bun format && npx lerna publish --no-private --force-publish", "docker:build": "bash ./scripts/docker.sh build", "docker:run": "bash ./scripts/docker.sh run", diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index bb859ec8d2b..2203962feb3 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -591,7 +591,7 @@ const startAgents = async () => { } elizaLogger.info( - "Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents. When running multiple agents, use client with different port `SERVER_PORT=3001 pnpm start:client`" + "Run `bun start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents. When running multiple agents, use client with different port `SERVER_PORT=3001 bun start:client`" ); }; diff --git a/packages/cli/README.md b/packages/cli/README.md index 6ebd93b6444..ab7e65a5e35 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -7,7 +7,7 @@ The TEE CLI provides a set of commands to manage your ElizaOS TEE deployments, f ### Prerequisites - Docker installed and running -- Node.js and npm/pnpm installed +- Node.js and npm/bun installed - A Docker Hub account for publishing images - A Phala Cloud (https://cloud.phala.network/login) API key for cloud deployments diff --git a/packages/cli/package.json b/packages/cli/package.json index 4bb0864acf2..bf475c1b30a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -32,9 +32,9 @@ "format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache", "format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache", "release": "changeset version", - "pub:beta": "pnpm build && pnpm publish --no-git-checks --access public --tag beta", - "pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next", - "pub:release": "pnpm build && pnpm publish --access public", + "pub:beta": "bun build && bun publish --no-git-checks --access public --tag beta", + "pub:next": "bun build && bun publish --no-git-checks --access public --tag next", + "pub:release": "bun build && bun publish --access public", "test": "vitest run", "test:dev": "REGISTRY_URL=http://localhost:3333 vitest run" }, diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 474eef6d46f..5d0c837be8f 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -69,25 +69,25 @@ async function selectPlugins() { async function installDependencies(targetDir: string, database: string, selectedPlugins: string[]) { logger.info("Installing dependencies...") - // Install pnpm if not already installed - await execa("npm", ["install", "-g", "pnpm"], { + // Install bun if not already installed + await execa("npm", ["install", "-g", "bun"], { stdio: "inherit" }) - // Use pnpm for installation - await execa("pnpm", ["install", "--no-frozen-lockfile"], { + // Use bun for installation + await execa("bun", ["install", "--no-frozen-lockfile"], { cwd: targetDir, stdio: "inherit" }) - await execa("pnpm", ["add", `@elizaos/adapter-${database}`, "--workspace-root"], { + await execa("bun", ["add", `@elizaos/adapter-${database}`, "--workspace-root"], { cwd: targetDir, stdio: "inherit" }) if (selectedPlugins.length > 0) { console.log(selectedPlugins) - await execa("pnpm", ["add", ...selectedPlugins, "--workspace-root"], { + await execa("bun", ["add", ...selectedPlugins, "--workspace-root"], { cwd: targetDir, stdio: "inherit" }) diff --git a/packages/cli/src/tee/phala/constants.ts b/packages/cli/src/tee/phala/constants.ts index c2c25527817..283f069528f 100644 --- a/packages/cli/src/tee/phala/constants.ts +++ b/packages/cli/src/tee/phala/constants.ts @@ -33,7 +33,7 @@ services: /bin/sh -c " cd /app && echo {{characterBase64Data}} | base64 -d > characters/{{characterName}}.character.json && - pnpm run start --non-interactive --character=characters/{{characterName}}.character.json + bun run start --non-interactive --character=characters/{{characterName}}.character.json " stdin_open: true tty: true diff --git a/packages/client/package.json b/packages/client/package.json index c769ddb7d04..5563b71c55f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -5,6 +5,7 @@ "type": "module", "scripts": { "extract-version": "bash ./version.sh", + "start": "bun run extract-version && vite", "dev": "bun run extract-version && vite", "build": "bun run extract-version && tsc -b && vite build", "preview": "vite preview" diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index a383c24a86e..14e65fed9f9 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -1,16 +1,15 @@ // ================ IMPORTS ================ -import { createOpenAI } from "@ai-sdk/openai"; import { createAnthropic } from "@ai-sdk/anthropic"; +import { createOpenAI } from "@ai-sdk/openai"; import { experimental_generateImage as aiGenerateImage, generateObject as aiGenerateObject, generateText as aiGenerateText, - type JSONValue, type StepResult as AIStepResult, type CoreTool, - type GenerateObjectResult, + type JSONValue } from "ai"; -import { object, z, type ZodSchema } from "zod"; +import { z, type ZodSchema } from "zod"; import { elizaLogger, logFunctionCall } from "./index.ts"; import { parseJSONObjectFromText @@ -22,8 +21,7 @@ import { type IAgentRuntime, type IImageDescriptionService, ModelClass, - ServiceType, - type TelemetrySettings, + ServiceType } from "./types.ts"; @@ -89,8 +87,8 @@ async function withRetry( function isAnthropicProvider(runtime: IAgentRuntime): boolean { const provider = runtime.getModelProvider()?.provider; return ( - provider.toLowerCase().includes("anthropic") || - provider.toLowerCase().includes("claude") + provider?.toLowerCase().includes("anthropic") || + provider?.toLowerCase().includes("claude") ); } @@ -119,7 +117,7 @@ function validateModelConfig( ) { const validations = [ { value: config.apiKey, name: 'API key', for: provider }, - { value: config.baseURL, name: 'endpoint URL', for: provider }, + // { value: config.baseURL, name: 'endpoint URL', for: provider }, { value: config.modelProvider, name: 'model provider' }, { value: config.modelProvider?.models, name: 'model configurations', in: 'provider' }, { value: config.model, name: 'model name', for: `class ${config.modelClass}` } @@ -149,7 +147,7 @@ export function initializeModelClient(runtime: IAgentRuntime, modelClass: ModelC const modelProvider = runtime.getModelProvider(); const modelConfig = modelProvider?.models?.[modelClass]; - const model = modelConfig?.name; + const model = modelConfig?.name || "gpt-4o"; // Single validation call replaces multiple if-checks validateModelConfig(provider, { diff --git a/turbo.json b/turbo.json index f1ffeb4bd71..890aa72835e 100644 --- a/turbo.json +++ b/turbo.json @@ -3,8 +3,15 @@ "tasks": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**"], - "cache": false + "outputs": ["dist/**"] + }, + "start": { + "dependsOn": ["build"], + "persistent": true + }, + "dev": { + "persistent": true, + "dependsOn": ["build"] } } } \ No newline at end of file