diff --git a/.env.example b/.env.example index 12b23378378..b3a1bdf30d2 100644 --- a/.env.example +++ b/.env.example @@ -336,6 +336,13 @@ MEDIUM_GALADRIEL_MODEL= # Default: gpt-4o LARGE_GALADRIEL_MODEL= # Default: gpt-4o GALADRIEL_FINE_TUNE_API_KEY= # Use an OpenAI key to use a fine-tuned model with the verified inference endpoint +# LM Studio Configuration +LMSTUDIO_SERVER_URL= # Default: http://localhost:1234/v1 +LMSTUDIO_MODEL= +SMALL_LMSTUDIO_MODEL= # Default: hermes-3-llama-3.1-8b +MEDIUM_LMSTUDIO_MODEL= # Default: hermes-3-llama-3.1-8b +LARGE_LMSTUDIO_MODEL= # Default: hermes-3-llama-3.1-8b + # Remaining Provider Configurations GOOGLE_GENERATIVE_AI_API_KEY= # Gemini API key ALI_BAILIAN_API_KEY= # Ali Bailian API Key diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a7b56b734c..b0ae26bf7d9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: - uses: pnpm/action-setup@v3 with: - version: 9.4.0 + version: 9.15.0 - uses: actions/setup-node@v4 with: diff --git a/.github/workflows/integrationTests.yaml b/.github/workflows/integrationTests.yaml index bea615f0fe5..0681d3d3327 100644 --- a/.github/workflows/integrationTests.yaml +++ b/.github/workflows/integrationTests.yaml @@ -20,7 +20,7 @@ jobs: - uses: pnpm/action-setup@v3 with: - version: 9.4.0 + version: 9.15.0 - uses: actions/setup-node@v4 with: @@ -41,4 +41,4 @@ jobs: fi - name: Run integration tests - run: pnpm run integrationTests + run: pnpm run integrationTests \ No newline at end of file diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index e228b9d071e..b90c3031bfb 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -22,7 +22,7 @@ jobs: - uses: pnpm/action-setup@v3 with: - version: 8 + version: 9.15.0 - name: Configure Git run: | diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 234ae7984ad..3070cd3f63b 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -20,7 +20,7 @@ jobs: - uses: pnpm/action-setup@v3 with: - version: 9.4.0 + version: 9.15.0 - uses: actions/setup-node@v4 with: diff --git a/agent/package.json b/agent/package.json index 87e92ac76b1..d89236155d6 100644 --- a/agent/package.json +++ b/agent/package.json @@ -19,10 +19,10 @@ }, "dependencies": { "@elizaos/adapter-supabase": "workspace:*", + "@elizaos/adapter-pglite": "workspace:*", "@elizaos/adapter-postgres": "workspace:*", "@elizaos/adapter-redis": "workspace:*", "@elizaos/adapter-sqlite": "workspace:*", - "@elizaos/adapter-pglite": "workspace:*", "@elizaos/adapter-qdrant": "workspace:*", "@elizaos/adapter-mongodb": "workspace:*", "@elizaos/client-auto": "workspace:*", @@ -43,26 +43,26 @@ "@elizaos/plugin-agentkit": "workspace:*", "@elizaos/plugin-aptos": "workspace:*", "@elizaos/plugin-birdeye": "workspace:*", - "@elizaos/plugin-coingecko": "workspace:*", - "@elizaos/plugin-coinmarketcap": "workspace:*", "@elizaos/plugin-zerion": "workspace:*", "@elizaos/plugin-binance": "workspace:*", "@elizaos/plugin-avail": "workspace:*", "@elizaos/plugin-bnb": "workspace:*", "@elizaos/plugin-bootstrap": "workspace:*", "@elizaos/plugin-di": "workspace:*", - "@elizaos/plugin-cosmos": "workspace:*", "@elizaos/plugin-intiface": "workspace:*", "@elizaos/plugin-coinbase": "workspace:*", + "@elizaos/plugin-coingecko": "workspace:*", + "@elizaos/plugin-coinmarketcap": "workspace:*", "@elizaos/plugin-conflux": "workspace:*", - "@elizaos/plugin-evm": "workspace:*", + "@elizaos/plugin-cosmos": "workspace:*", "@elizaos/plugin-echochambers": "workspace:*", + "@elizaos/plugin-evm": "workspace:*", "@elizaos/plugin-flow": "workspace:*", + "@elizaos/plugin-giphy": "workspace:*", "@elizaos/plugin-gitbook": "workspace:*", - "@elizaos/plugin-story": "workspace:*", "@elizaos/plugin-gitcoin-passport": "workspace:*", "@elizaos/plugin-goat": "workspace:*", - "@elizaos/plugin-lensNetwork": "workspace:*", + "@elizaos/plugin-lens-network": "workspace:*", "@elizaos/plugin-icp": "workspace:*", "@elizaos/plugin-initia": "workspace:*", "@elizaos/plugin-image-generation": "workspace:*", @@ -83,18 +83,14 @@ "@elizaos/plugin-squid-router": "workspace:*", "@elizaos/plugin-autonome": "workspace:*", "@elizaos/plugin-starknet": "workspace:*", - "@elizaos/plugin-stargaze": "workspace:*", - "@elizaos/plugin-giphy": "workspace:*", - "@elizaos/plugin-ton": "workspace:*", + "@elizaos/plugin-story": "workspace:*", "@elizaos/plugin-sui": "workspace:*", "@elizaos/plugin-sgx": "workspace:*", "@elizaos/plugin-iq6900": "workspace:*", "@elizaos/plugin-tee": "workspace:*", "@elizaos/plugin-tee-log": "workspace:*", "@elizaos/plugin-tee-marlin": "workspace:*", - "@elizaos/plugin-multiversx": "workspace:*", - "@elizaos/plugin-near": "workspace:*", - "@elizaos/plugin-zksync-era": "workspace:*", + "@elizaos/plugin-ton": "workspace:*", "@elizaos/plugin-twitter": "workspace:*", "@elizaos/plugin-primus": "workspace:*", "@elizaos/plugin-cronoszkevm": "workspace:*", @@ -150,6 +146,10 @@ "@elizaos/plugin-zilliqa": "workspace:*", "@elizaos/client-deva": "workspace:*", "@elizaos/plugin-arbitrage": "workspace:*", + "@elizaos/plugin-multiversx": "workspace:*", + "@elizaos/plugin-near": "workspace:*", + "@elizaos/plugin-stargaze": "workspace:*", + "@elizaos/plugin-zksync-era": "workspace:*", "readline": "1.3.0", "ws": "8.18.0", "yargs": "17.7.2" diff --git a/agent/src/index.ts b/agent/src/index.ts index 2a4cc1c0a58..e3dfa639f8e 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -91,11 +91,10 @@ import { genLayerPlugin } from "@elizaos/plugin-genlayer"; import { gitcoinPassportPlugin } from "@elizaos/plugin-gitcoin-passport"; import { initiaPlugin } from "@elizaos/plugin-initia"; import { imageGenerationPlugin } from "@elizaos/plugin-image-generation"; -import { lensPlugin } from "@elizaos/plugin-lensNetwork"; +import { lensPlugin } from "@elizaos/plugin-lens-network"; import { mindNetworkPlugin } from "@elizaos/plugin-mind-network"; import { multiversxPlugin } from "@elizaos/plugin-multiversx"; import { nearPlugin } from "@elizaos/plugin-near"; -import { newsPlugin } from "@elizaos/plugin-news"; import createNFTCollectionsPlugin from "@elizaos/plugin-nft-collections"; import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation"; import { createNodePlugin } from "@elizaos/plugin-node"; @@ -523,11 +522,13 @@ export function getTokenForProvider( character: Character ): string | undefined { switch (provider) { - // no key needed for llama_local or gaianet + // no key needed for llama_local, ollama, lmstudio, gaianet or bedrock case ModelProviderName.LLAMALOCAL: return ""; case ModelProviderName.OLLAMA: return ""; + case ModelProviderName.LMSTUDIO: + return ""; case ModelProviderName.GAIANET: return ""; case ModelProviderName.BEDROCK: diff --git a/docs/docs/core/actions.md b/docs/docs/core/actions.md index 38fe9304921..cb84914f81c 100644 --- a/docs/docs/core/actions.md +++ b/docs/docs/core/actions.md @@ -35,7 +35,7 @@ interface Action { } ``` -Source: https://github.com/elizaos/eliza/packages/core/src/types.ts +Source: https://github.com/elizaOS/eliza/blob/main/packages/core/src/types.ts --- @@ -88,7 +88,7 @@ const take_order: Action = { }; ``` -Source: https://github.com/elizaos/eliza/packages/plugin-solana/src/actions/takeOrder.ts +Source: https://github.com/elizaOS/eliza/blob/main/packages/plugin-solana/src/actions/takeOrder.ts --- diff --git a/docs/package.json b/docs/package.json index 32cd79f98fc..9ad7b6b3ef4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,58 +1,58 @@ { - "name": "eliza-docs", - "version": "0.1.9", - "private": true, - "packageManager": "pnpm@9.4.0", - "scripts": { - "docusaurus": "docusaurus", - "start": "docusaurus start --no-open", - "dev": "docusaurus start --port 3002 --no-open", - "build": "docusaurus build", - "swizzle": "docusaurus swizzle", - "deploy": "docusaurus deploy", - "clear": "docusaurus clear", - "serve": "docusaurus serve", - "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" - }, - "dependencies": { - "@docusaurus/core": "3.7.0", - "@docusaurus/plugin-content-blog": "3.7.0", - "@docusaurus/plugin-content-docs": "3.7.0", - "@docusaurus/plugin-ideal-image": "3.7.0", - "@docusaurus/preset-classic": "3.7.0", - "@docusaurus/theme-mermaid": "3.7.0", - "@docusaurus/theme-common": "3.7.0", - "@mdx-js/react": "3.0.1", - "clsx": "2.1.1", - "docusaurus-lunr-search": "3.5.0", - "lunr": "2.3.9", - "dotenv": "^16.4.7", - "prism-react-renderer": "2.3.1", - "react": "18.3.1", - "react-dom": "18.3.1", - "react-router-dom": "6.22.1" - }, - "devDependencies": { - "@docusaurus/module-type-aliases": "3.7.0", - "@docusaurus/types": "3.7.0", - "docusaurus-plugin-typedoc": "1.0.5", - "typedoc": "0.26.11", - "typedoc-plugin-markdown": "4.2.10" - }, - "browserslist": { - "production": [ - ">0.5%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 3 chrome version", - "last 3 firefox version", - "last 5 safari version" - ] - }, - "engines": { - "node": "23.3.0" - } + "name": "eliza-docs", + "version": "0.1.9", + "private": true, + "packageManager": "pnpm@9.4.0", + "scripts": { + "docusaurus": "docusaurus", + "start": "docusaurus start --no-open", + "dev": "docusaurus start --port 3002 --no-open", + "build": "docusaurus build", + "swizzle": "docusaurus swizzle", + "deploy": "docusaurus deploy", + "clear": "docusaurus clear", + "serve": "docusaurus serve", + "write-translations": "docusaurus write-translations", + "write-heading-ids": "docusaurus write-heading-ids" + }, + "dependencies": { + "@docusaurus/core": "3.7.0", + "@docusaurus/plugin-content-blog": "3.7.0", + "@docusaurus/plugin-content-docs": "3.7.0", + "@docusaurus/plugin-ideal-image": "3.7.0", + "@docusaurus/preset-classic": "3.7.0", + "@docusaurus/theme-mermaid": "3.7.0", + "@docusaurus/theme-common": "3.7.0", + "@mdx-js/react": "3.0.1", + "clsx": "2.1.1", + "docusaurus-lunr-search": "3.5.0", + "lunr": "2.3.9", + "dotenv": "^16.4.7", + "prism-react-renderer": "2.3.1", + "react": "18.3.1", + "react-dom": "18.3.1", + "react-router-dom": "6.22.1" + }, + "devDependencies": { + "@docusaurus/module-type-aliases": "3.7.0", + "@docusaurus/types": "3.7.0", + "docusaurus-plugin-typedoc": "1.0.5", + "typedoc": "0.26.11", + "typedoc-plugin-markdown": "4.2.10" + }, + "browserslist": { + "production": [ + ">0.5%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 3 chrome version", + "last 3 firefox version", + "last 5 safari version" + ] + }, + "engines": { + "node": "23.3.0" + } } diff --git a/lerna.json b/lerna.json index 14c942f24c3..d5bf47f753c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,11 +1,12 @@ { - "version": "0.1.9", - "packages": [ - "packages/*", - "docs", - "agent", - "client", - "!packages/_examples" - ], - "npmClient": "pnpm" + "version": "0.1.9", + "packages": ["packages/*", "docs", "agent", "client", "!packages/_examples"], + "npmClient": "pnpm", + "command": { + "publish": { + "registry": "https://registry.npmjs.org/", + "access": "public", + "allowBranch": "main" + } + } } diff --git a/packages/_examples/plugin-with-di/.npmignore b/packages/_examples/plugin-with-di/.npmignore new file mode 100644 index 00000000000..078562eceab --- /dev/null +++ b/packages/_examples/plugin-with-di/.npmignore @@ -0,0 +1,6 @@ +* + +!dist/** +!package.json +!readme.md +!tsup.config.ts \ No newline at end of file diff --git a/packages/_examples/plugin-with-di/README.md b/packages/_examples/plugin-with-di/README.md new file mode 100644 index 00000000000..3d396d51a84 --- /dev/null +++ b/packages/_examples/plugin-with-di/README.md @@ -0,0 +1,39 @@ +# Sample Plugin for Eliza + +The Sample Plugin for Eliza extends the functionality of the Eliza platform by providing additional actions, providers, evaluators, and more. This plugin is designed to be easily extendable and customizable to fit various use cases. + +## Description + +The Sample Plugin offers a set of features that can be integrated into the Eliza platform to enhance its capabilities. Below is a high-level overview of the different components available in this plugin. + +## Actions + +- **createResourceAction**: This action enables the creation and management of generic resources. It can be customized to handle different types of resources and integrate with various data sources. + +## Providers + +- **sampleProvider**: This provider offers a mechanism to supply data or services to the plugin. It can be extended to include additional providers as needed. + +## Evaluators + +- **sampleEvaluator**: This evaluator provides a way to assess or analyze data within the plugin. It can be extended to include additional evaluators as needed. + +## Services + +- **[ServiceName]**: Description of the service and its functionality. This can be extended to include additional services as needed. + +## Clients + +- **[ClientName]**: Description of the client and its functionality. This can be extended to include additional clients as needed. + +## How to Extend + +To extend the Sample Plugin, you can add new actions, providers, evaluators, services, and clients by following the structure provided in the plugin. Each component can be customized to fit your specific requirements. + +1. **Actions**: Add new actions by defining them in the `actions` array. +2. **Providers**: Add new providers by defining them in the `providers` array. +3. **Evaluators**: Add new evaluators by defining them in the `evaluators` array. +4. **Services**: Add new services by defining them in the `services` array. +5. **Clients**: Add new clients by defining them in the `clients` array. + +For more detailed information on how to extend the plugin, refer to the documentation provided in the Eliza platform. diff --git a/packages/_examples/plugin-with-di/package.json b/packages/_examples/plugin-with-di/package.json new file mode 100644 index 00000000000..61717121e89 --- /dev/null +++ b/packages/_examples/plugin-with-di/package.json @@ -0,0 +1,19 @@ +{ + "name": "@elizaos/plugin-sample-with-di", + "version": "0.1.9-alpha.1", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "@elizaos/plugin-di": "workspace:*" + }, + "devDependencies": { + "tsup": "8.3.5", + "@types/node": "^20.0.0" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + } +} diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/_examples/plugin-with-di/src/actions/sampleAction.ts similarity index 94% rename from packages/plugin-di/src/_examples/sampleAction.ts rename to packages/_examples/plugin-with-di/src/actions/sampleAction.ts index f0f43dc97a9..a5505b226ed 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/_examples/plugin-with-di/src/actions/sampleAction.ts @@ -1,3 +1,5 @@ +import { z } from "zod"; +import { inject, injectable } from "inversify"; import { type IAgentRuntime, type Memory, @@ -5,13 +7,14 @@ import { type State, elizaLogger, } from "@elizaos/core"; -import { z } from "zod"; -import { inject, injectable } from "inversify"; -import { BaseInjectableAction } from "../actions"; -import type { ActionOptions } from "../types"; -import { property } from "../decorators"; -import { globalContainer } from "../di"; -import { SampleProvider } from "./sampleProvider"; +import { + property, + globalContainer, + BaseInjectableAction, + type ActionOptions +} from "@elizaos/plugin-di"; + +import { SampleProvider } from "../providers/sampleProvider"; /** * The content class for the action diff --git a/packages/plugin-di/src/_examples/sampleEvaluator.ts b/packages/_examples/plugin-with-di/src/evaluators/sampleEvaluator.ts similarity index 93% rename from packages/plugin-di/src/_examples/sampleEvaluator.ts rename to packages/_examples/plugin-with-di/src/evaluators/sampleEvaluator.ts index 3f3858575c1..4138fe81cd2 100644 --- a/packages/plugin-di/src/_examples/sampleEvaluator.ts +++ b/packages/_examples/plugin-with-di/src/evaluators/sampleEvaluator.ts @@ -1,8 +1,10 @@ import { type IAgentRuntime, type Memory, elizaLogger } from "@elizaos/core"; import { injectable } from "inversify"; -import { BaseInjectableEvaluator } from "../evaluators"; -import type { EvaluatorOptions } from "../types"; -import { globalContainer } from "../di"; +import { + globalContainer, + BaseInjectableEvaluator, + type EvaluatorOptions +} from "@elizaos/plugin-di"; const options: EvaluatorOptions = { alwaysRun: false, diff --git a/packages/_examples/plugin-with-di/src/index.ts b/packages/_examples/plugin-with-di/src/index.ts new file mode 100644 index 00000000000..10aba3a2706 --- /dev/null +++ b/packages/_examples/plugin-with-di/src/index.ts @@ -0,0 +1,5 @@ +import { samplePlugin } from "./samplePlugin"; + +export * from "./samplePlugin"; + +export default samplePlugin; diff --git a/packages/plugin-di/src/_examples/sampleProvider.ts b/packages/_examples/plugin-with-di/src/providers/sampleProvider.ts similarity index 94% rename from packages/plugin-di/src/_examples/sampleProvider.ts rename to packages/_examples/plugin-with-di/src/providers/sampleProvider.ts index ff9cf76fe9a..e126ba818fe 100644 --- a/packages/plugin-di/src/_examples/sampleProvider.ts +++ b/packages/_examples/plugin-with-di/src/providers/sampleProvider.ts @@ -6,8 +6,7 @@ import { type State, elizaLogger, } from "@elizaos/core"; -import type { InjectableProvider } from "../types"; -import { globalContainer } from "../di"; +import { globalContainer, type InjectableProvider } from "@elizaos/plugin-di"; // Dynamic Data Provider diff --git a/packages/_examples/plugin-with-di/src/samplePlugin.ts b/packages/_examples/plugin-with-di/src/samplePlugin.ts new file mode 100644 index 00000000000..806c74ca125 --- /dev/null +++ b/packages/_examples/plugin-with-di/src/samplePlugin.ts @@ -0,0 +1,17 @@ +import type { PluginOptions } from '@elizaos/plugin-di'; +import { CreateResourceAction } from "./actions/sampleAction"; +import { SampleProvider } from "./providers/sampleProvider"; +import { SampleEvaluator } from "./evaluators/sampleEvaluator"; +import { SampleService } from './services/sampleService'; + +export const samplePlugin: PluginOptions = { + name: "sample", + description: "Enables creation and management of generic resources", + actions: [CreateResourceAction], + providers: [SampleProvider], + evaluators: [SampleEvaluator], + services: [SampleService], + clients: [], +}; + +export default samplePlugin; diff --git a/packages/_examples/plugin-with-di/src/services/sampleService.ts b/packages/_examples/plugin-with-di/src/services/sampleService.ts new file mode 100644 index 00000000000..717a0c8218a --- /dev/null +++ b/packages/_examples/plugin-with-di/src/services/sampleService.ts @@ -0,0 +1,154 @@ +import { inject, injectable } from "inversify"; +import { + Service, + ServiceType, + type IAgentRuntime, + elizaLogger, + stringToUuid, + Memory, + State, +} from "@elizaos/core"; +import { globalContainer } from "@elizaos/plugin-di"; + +import { SampleProvider } from "../providers/sampleProvider"; + +// Add SAMPLE to ServiceType enum in types.ts +declare module "@elizaos/core" { + export enum ServiceType { + SAMPLE = "sample", + } +} + +// The SampleService is a simple service that logs "Hello world" every 15 minutes. +@injectable() +export class SampleService extends Service { + private runtime: IAgentRuntime | null = null; + private intervalId: NodeJS.Timeout | null = null; + private readonly DEFAULT_INTERVAL = 15 * 60 * 1000; // 15 minutes in milliseconds + + constructor( + @inject(SampleProvider) + private readonly sampleProvider: SampleProvider + ) { + super(); + } + + static get serviceType(): ServiceType { + return ServiceType.SAMPLE; + } + + private static isInitialized = false; + + async initialize(runtime: IAgentRuntime): Promise { + // Verify if the service is already initialized + if (SampleService.isInitialized) { + return; + } + + this.runtime = runtime; + + // Start the periodic task + this.startPeriodicTask(); + SampleService.isInitialized = true; + elizaLogger.info("SampleService initialized and started periodic task"); + } + + private static activeTaskCount = 0; + + private startPeriodicTask(): void { + // Verify if a task is already active + if (SampleService.activeTaskCount > 0) { + elizaLogger.warn( + "SampleService: Periodic task already running, skipping" + ); + return; + } + + // Clear any existing interval + if (this.intervalId) { + clearInterval(this.intervalId); + } + + SampleService.activeTaskCount++; + elizaLogger.info( + `SampleService: Starting periodic task (active tasks: ${SampleService.activeTaskCount})` + ); + + // Initial call immediately + this.fetchSample(); + + // Set up periodic calls + this.intervalId = setInterval(() => { + this.fetchSample(); + }, this.DEFAULT_INTERVAL); + } + + private async fetchSample(): Promise { + if (!this.runtime) { + elizaLogger.error("SampleService: Runtime not initialized"); + return; + } + + try { + // Example of using the sampleProvider + // Create dummy memory and state objects for the provider + const dummyMemory: Memory = { + id: stringToUuid("sample-service-trigger"), + userId: this.runtime.agentId, + agentId: this.runtime.agentId, + roomId: this.runtime.agentId, + content: { text: "Periodic sample fetch" }, + createdAt: Date.now(), + }; + + const dummyState: State = { + userId: this.runtime.agentId, + bio: "", + lore: "", + messageDirections: "", + postDirections: "", + roomId: this.runtime.agentId, + actors: "", + recentMessages: "", + recentMessagesData: [], + }; + await this.sampleProvider.get( + this.runtime, + dummyMemory, + dummyState + ); + + // hello world log example + elizaLogger.info("SampleService: Hello world"); + + elizaLogger.info( + "SampleService: Successfully fetched and processed sample" + ); + } catch (error) { + elizaLogger.error("SampleService: Error fetching sample:", error); + } + } + + // Method to stop the service + stop(): void { + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = null; + SampleService.activeTaskCount--; + elizaLogger.info( + `SampleService stopped (active tasks: ${SampleService.activeTaskCount})` + ); + } + SampleService.isInitialized = false; + } + + // Method to manually trigger a sample fetch (for testing) + async forceFetch(): Promise { + await this.fetchSample(); + } +} + +// Register the provider with the global container +globalContainer.bind(SampleService).toSelf().inSingletonScope(); + +export default SampleService; diff --git a/packages/_examples/plugin-with-di/tsconfig.json b/packages/_examples/plugin-with-di/tsconfig.json new file mode 100644 index 00000000000..a4134313dc6 --- /dev/null +++ b/packages/_examples/plugin-with-di/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../core/tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "types": ["node"], + "experimentalDecorators": true, + "emitDecoratorMetadata": true + }, + "include": ["src/**/*.ts"] +} diff --git a/packages/_examples/plugin-with-di/tsup.config.ts b/packages/_examples/plugin-with-di/tsup.config.ts new file mode 100644 index 00000000000..1a96f24afa1 --- /dev/null +++ b/packages/_examples/plugin-with-di/tsup.config.ts @@ -0,0 +1,21 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/index.ts"], + outDir: "dist", + sourcemap: true, + clean: true, + format: ["esm"], // Ensure you're targeting CommonJS + external: [ + "dotenv", // Externalize dotenv to prevent bundling + "fs", // Externalize fs to use Node.js built-in module + "path", // Externalize other built-ins if necessary + "@reflink/reflink", + "@node-llama-cpp", + "https", + "http", + "agentkeepalive", + "safe-buffer", + // Add other modules you want to externalize + ], +}); diff --git a/packages/adapter-pglite/package.json b/packages/adapter-pglite/package.json index 292bb8de33e..de74843405f 100644 --- a/packages/adapter-pglite/package.json +++ b/packages/adapter-pglite/package.json @@ -1,35 +1,35 @@ { - "name": "@elizaos/adapter-pglite", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@electric-sql/pglite": "^0.2.15", - "@elizaos/core": "workspace:*" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/adapter-pglite", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@electric-sql/pglite": "^0.2.15", + "@elizaos/core": "workspace:*" + }, + "devDependencies": { + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/adapter-postgres/package.json b/packages/adapter-postgres/package.json index a1b0e4a64cf..699c7940e4e 100644 --- a/packages/adapter-postgres/package.json +++ b/packages/adapter-postgres/package.json @@ -1,35 +1,35 @@ { - "name": "@elizaos/adapter-postgres", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist", - "schema.sql", - "seed.sql" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@types/pg": "8.11.10", - "pg": "8.13.1" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } + "name": "@elizaos/adapter-postgres", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist", + "schema.sql", + "seed.sql" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@types/pg": "8.11.10", + "pg": "8.13.1" + }, + "devDependencies": { + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + } } diff --git a/packages/adapter-redis/package.json b/packages/adapter-redis/package.json index 574eef5e58d..87aed23e0b4 100644 --- a/packages/adapter-redis/package.json +++ b/packages/adapter-redis/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/adapter-redis", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "ioredis": "5.4.2" - }, - "devDependencies": { - "@types/ioredis": "^5.0.0", - "tsup": "8.3.5", - "vitest": "^3.0.2" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/adapter-redis", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "ioredis": "5.4.2" + }, + "devDependencies": { + "@types/ioredis": "^5.0.0", + "tsup": "8.3.5", + "vitest": "^3.0.2" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/adapter-sqlite/package.json b/packages/adapter-sqlite/package.json index 76517f80625..1c96ff4846a 100644 --- a/packages/adapter-sqlite/package.json +++ b/packages/adapter-sqlite/package.json @@ -1,41 +1,41 @@ { - "name": "@elizaos/adapter-sqlite", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@types/better-sqlite3": "7.6.12", - "better-sqlite3": "11.6.0", - "sqlite-vec": "0.1.6" - }, - "devDependencies": { - "tsup": "8.3.5", - "vitest": "^3.0.2", - "@vitest/coverage-v8": "^3.0.2" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:coverage": "vitest run --coverage" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/adapter-sqlite", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@types/better-sqlite3": "7.6.12", + "better-sqlite3": "11.6.0", + "sqlite-vec": "0.1.6" + }, + "devDependencies": { + "tsup": "8.3.5", + "vitest": "^3.0.2", + "@vitest/coverage-v8": "^3.0.2" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:coverage": "vitest run --coverage" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/adapter-sqljs/package.json b/packages/adapter-sqljs/package.json index 5d052a3f6df..ee7da589b41 100644 --- a/packages/adapter-sqljs/package.json +++ b/packages/adapter-sqljs/package.json @@ -1,37 +1,37 @@ { - "name": "@elizaos/adapter-sqljs", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@types/sql.js": "1.4.9", - "sql.js": "1.12.0", - "uuid": "11.0.3" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/adapter-sqljs", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@types/sql.js": "1.4.9", + "sql.js": "1.12.0", + "uuid": "11.0.3" + }, + "devDependencies": { + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/adapter-supabase/package.json b/packages/adapter-supabase/package.json index a69df11d094..b18c262966a 100644 --- a/packages/adapter-supabase/package.json +++ b/packages/adapter-supabase/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/adapter-supabase", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@supabase/supabase-js": "2.46.2" - }, - "devDependencies": { - "@vitest/coverage-v8": "^3.0.2", - "tsup": "8.3.5", - "vitest": "^3.0.2" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:coverage": "vitest run --coverage" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/adapter-supabase", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@supabase/supabase-js": "2.46.2" + }, + "devDependencies": { + "@vitest/coverage-v8": "^3.0.2", + "tsup": "8.3.5", + "vitest": "^3.0.2" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:coverage": "vitest run --coverage" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/client-auto/package.json b/packages/client-auto/package.json index 0b00f9622ee..74122d72a84 100644 --- a/packages/client-auto/package.json +++ b/packages/client-auto/package.json @@ -1,40 +1,40 @@ { - "name": "@elizaos/client-auto", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@types/body-parser": "1.19.5", - "@types/cors": "2.8.17", - "@types/express": "5.0.0", - "body-parser": "1.20.3", - "cors": "2.8.5", - "multer": "1.4.5-lts.1" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/client-auto", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@types/body-parser": "1.19.5", + "@types/cors": "2.8.17", + "@types/express": "5.0.0", + "body-parser": "1.20.3", + "cors": "2.8.5", + "multer": "1.4.5-lts.1" + }, + "devDependencies": { + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/client-direct/package.json b/packages/client-direct/package.json index 3675e93506a..85f30e66534 100644 --- a/packages/client-direct/package.json +++ b/packages/client-direct/package.json @@ -1,47 +1,47 @@ { - "name": "@elizaos/client-direct", - "version": "0.1.9", - "main": "dist/index.js", - "module": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-image-generation": "workspace:*", - "@elizaos/plugin-tee-verifiable-log": "workspace:*", - "@elizaos/plugin-tee-log": "workspace:*", - "@types/body-parser": "1.19.5", - "@types/cors": "2.8.17", - "@types/express": "5.0.0", - "body-parser": "1.20.3", - "cors": "2.8.5", - "discord.js": "14.16.3", - "express": "4.21.1", - "multer": "1.4.5-lts.1", - "openai": "4.73.0" - }, - "devDependencies": { - "@types/multer": "^1.4.12", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/client-direct", + "version": "0.1.9", + "main": "dist/index.js", + "module": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@elizaos/plugin-image-generation": "workspace:*", + "@elizaos/plugin-tee-verifiable-log": "workspace:*", + "@elizaos/plugin-tee-log": "workspace:*", + "@types/body-parser": "1.19.5", + "@types/cors": "2.8.17", + "@types/express": "5.0.0", + "body-parser": "1.20.3", + "cors": "2.8.5", + "discord.js": "14.16.3", + "express": "4.21.1", + "multer": "1.4.5-lts.1", + "openai": "4.73.0" + }, + "devDependencies": { + "@types/multer": "^1.4.12", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/client-discord/package.json b/packages/client-discord/package.json index 28573e7976a..af9c7b148f9 100644 --- a/packages/client-discord/package.json +++ b/packages/client-discord/package.json @@ -1,48 +1,48 @@ { - "name": "@elizaos/client-discord", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-node": "workspace:*", - "@discordjs/opus": "github:discordjs/opus", - "@discordjs/rest": "2.4.0", - "@discordjs/voice": "0.17.0", - "discord.js": "14.16.3", - "libsodium-wrappers": "0.7.15", - "prism-media": "1.3.5", - "zod": "3.23.8" - }, - "devDependencies": { - "tsup": "8.3.5", - "vitest": "1.2.1" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "trustedDependencies": { - "@discordjs/opus": "github:discordjs/opus", - "@discordjs/voice": "0.17.0" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/client-discord", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@discordjs/opus": "github:discordjs/opus", + "@discordjs/rest": "2.4.0", + "@discordjs/voice": "0.17.0", + "@elizaos/core": "workspace:*", + "@elizaos/plugin-node": "workspace:*", + "discord.js": "14.16.3", + "libsodium-wrappers": "0.7.15", + "prism-media": "1.3.5", + "zod": "3.23.8" + }, + "devDependencies": { + "tsup": "8.3.5", + "vitest": "1.2.1" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "trustedDependencies": { + "@discordjs/opus": "github:discordjs/opus", + "@discordjs/voice": "0.17.0" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/client-farcaster/package.json b/packages/client-farcaster/package.json index ede91d8bd09..f50ff388244 100644 --- a/packages/client-farcaster/package.json +++ b/packages/client-farcaster/package.json @@ -1,37 +1,37 @@ { - "name": "@elizaos/client-farcaster", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@neynar/nodejs-sdk": "^2.0.3" - }, - "devDependencies": { - "tsup": "^8.3.5", - "vitest": "^2.1.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache .", - "test": "vitest run", - "test:watch": "vitest watch", - "test:coverage": "vitest run --coverage" - } + "name": "@elizaos/client-farcaster", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@neynar/nodejs-sdk": "^2.0.3" + }, + "devDependencies": { + "tsup": "^8.3.5", + "vitest": "^2.1.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache .", + "test": "vitest run", + "test:watch": "vitest watch", + "test:coverage": "vitest run --coverage" + } } diff --git a/packages/client-github/package.json b/packages/client-github/package.json index 9c4dcfca497..be9f5b01679 100644 --- a/packages/client-github/package.json +++ b/packages/client-github/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/client-github", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@octokit/rest": "20.1.1", - "@octokit/types": "12.6.0", - "glob": "10.4.5", - "simple-git": "3.27.0" - }, - "devDependencies": { - "@types/glob": "8.1.0", - "tsup": "8.3.5", - "vitest": "^1.2.1" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - } + "name": "@elizaos/client-github", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@octokit/rest": "20.1.1", + "@octokit/types": "12.6.0", + "glob": "10.4.5", + "simple-git": "3.27.0" + }, + "devDependencies": { + "@types/glob": "8.1.0", + "tsup": "8.3.5", + "vitest": "^1.2.1" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + } } diff --git a/packages/client-instagram/__tests__/environment.test.ts b/packages/client-instagram/__tests__/environment.test.ts index 5891cbe73a5..edd2428786a 100644 --- a/packages/client-instagram/__tests__/environment.test.ts +++ b/packages/client-instagram/__tests__/environment.test.ts @@ -14,17 +14,17 @@ describe('Instagram Environment Configuration', () => { INSTAGRAM_PASSWORD: 'test_password', INSTAGRAM_APP_ID: 'test_app_id', INSTAGRAM_APP_SECRET: 'test_app_secret', - INSTAGRAM_POST_INTERVAL_MIN: 60, - INSTAGRAM_POST_INTERVAL_MAX: 120, + INSTAGRAM_POST_INTERVAL_MIN: '60', + INSTAGRAM_POST_INTERVAL_MAX: '120', INSTAGRAM_ENABLE_ACTION_PROCESSING: false, - INSTAGRAM_ACTION_INTERVAL: 5, - INSTAGRAM_MAX_ACTIONS: 1, + INSTAGRAM_ACTION_INTERVAL: '5', + INSTAGRAM_MAX_ACTIONS: '1', }; vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { if (key === 'INSTAGRAM_DRY_RUN') return 'false'; if (key === 'INSTAGRAM_ENABLE_ACTION_PROCESSING') return 'false'; - return validConfig[key as keyof typeof validConfig]; + return validConfig[key as keyof typeof validConfig]?.toString() || null; }); const config = await validateInstagramConfig(mockRuntime); @@ -39,17 +39,80 @@ describe('Instagram Environment Configuration', () => { INSTAGRAM_APP_ID: 'test_app_id', INSTAGRAM_APP_SECRET: 'test_app_secret', INSTAGRAM_BUSINESS_ACCOUNT_ID: 'business_123', - INSTAGRAM_POST_INTERVAL_MIN: 60, - INSTAGRAM_POST_INTERVAL_MAX: 120, + INSTAGRAM_POST_INTERVAL_MIN: '60', + INSTAGRAM_POST_INTERVAL_MAX: '120', INSTAGRAM_ENABLE_ACTION_PROCESSING: false, - INSTAGRAM_ACTION_INTERVAL: 5, - INSTAGRAM_MAX_ACTIONS: 1, + INSTAGRAM_ACTION_INTERVAL: '5', + INSTAGRAM_MAX_ACTIONS: '1', }; vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { if (key === 'INSTAGRAM_DRY_RUN') return 'false'; if (key === 'INSTAGRAM_ENABLE_ACTION_PROCESSING') return 'false'; - return validConfig[key as keyof typeof validConfig]; + return validConfig[key as keyof typeof validConfig]?.toString() || null; + }); + + const config = await validateInstagramConfig(mockRuntime); + expect(config).toEqual(validConfig); + }); + + it('validates configuration with enhanced image settings', async () => { + const validConfig = { + INSTAGRAM_DRY_RUN: false, + INSTAGRAM_USERNAME: 'test_user', + INSTAGRAM_PASSWORD: 'test_password', + INSTAGRAM_APP_ID: 'test_app_id', + INSTAGRAM_APP_SECRET: 'test_app_secret', + INSTAGRAM_POST_INTERVAL_MIN: '60', + INSTAGRAM_POST_INTERVAL_MAX: '120', + INSTAGRAM_ENABLE_ACTION_PROCESSING: false, + INSTAGRAM_ACTION_INTERVAL: '5', + INSTAGRAM_MAX_ACTIONS: '1', + INSTAGRAM_IMAGE_WIDTH: '1920', + INSTAGRAM_IMAGE_HEIGHT: '1080', + INSTAGRAM_IMAGE_NEGATIVE_PROMPT: 'blurry, low quality', + INSTAGRAM_IMAGE_ITERATIONS: '30', + INSTAGRAM_IMAGE_GUIDANCE_SCALE: '8.5', + INSTAGRAM_IMAGE_SEED: '12345', + INSTAGRAM_IMAGE_CFG_SCALE: '9', + INSTAGRAM_IMAGE_SAFE_MODE: true, + INSTAGRAM_IMAGE_STYLE_PRESET: 'test-preset', + INSTAGRAM_IMAGE_HIDE_WATERMARK: true + }; + + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + if (key === 'INSTAGRAM_DRY_RUN') return 'false'; + if (key === 'INSTAGRAM_ENABLE_ACTION_PROCESSING') return 'false'; + if (key === 'INSTAGRAM_IMAGE_SAFE_MODE') return 'true'; + if (key === 'INSTAGRAM_IMAGE_HIDE_WATERMARK') return 'true'; + return validConfig[key as keyof typeof validConfig]?.toString() || null; + }); + + const config = await validateInstagramConfig(mockRuntime); + expect(config).toEqual(validConfig); + }); + + it('validates configuration with partial image settings', async () => { + const validConfig = { + INSTAGRAM_DRY_RUN: false, + INSTAGRAM_USERNAME: 'test_user', + INSTAGRAM_PASSWORD: 'test_password', + INSTAGRAM_APP_ID: 'test_app_id', + INSTAGRAM_APP_SECRET: 'test_app_secret', + INSTAGRAM_POST_INTERVAL_MIN: '60', + INSTAGRAM_POST_INTERVAL_MAX: '120', + INSTAGRAM_ENABLE_ACTION_PROCESSING: false, + INSTAGRAM_ACTION_INTERVAL: '5', + INSTAGRAM_MAX_ACTIONS: '1', + INSTAGRAM_IMAGE_WIDTH: '1920', + INSTAGRAM_IMAGE_HEIGHT: '1080', + INSTAGRAM_IMAGE_NEGATIVE_PROMPT: 'blurry' + }; + + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + if (key === 'INSTAGRAM_DRY_RUN') return 'false'; + if (key === 'INSTAGRAM_ENABLE_ACTION_PROCESSING') return 'false'; + return validConfig[key as keyof typeof validConfig]?.toString() || null; }); const config = await validateInstagramConfig(mockRuntime); @@ -67,7 +130,7 @@ describe('Instagram Environment Configuration', () => { vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { if (key === 'INSTAGRAM_DRY_RUN') return 'false'; - return invalidConfig[key as keyof typeof invalidConfig]; + return invalidConfig[key as keyof typeof invalidConfig]?.toString() || null; }); await expect(validateInstagramConfig(mockRuntime)).rejects.toThrow(); @@ -82,7 +145,46 @@ describe('Instagram Environment Configuration', () => { vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { if (key === 'INSTAGRAM_DRY_RUN') return 'false'; - return invalidConfig[key as keyof typeof invalidConfig]; + return invalidConfig[key as keyof typeof invalidConfig]?.toString() || null; + }); + + await expect(validateInstagramConfig(mockRuntime)).rejects.toThrow(); + }); + + it('throws error for invalid image dimensions', async () => { + const invalidConfig = { + INSTAGRAM_DRY_RUN: false, + INSTAGRAM_USERNAME: 'test_user', + INSTAGRAM_PASSWORD: 'test_password', + INSTAGRAM_APP_ID: 'test_app_id', + INSTAGRAM_APP_SECRET: 'test_app_secret', + INSTAGRAM_IMAGE_WIDTH: '-100', // Invalid negative width + INSTAGRAM_IMAGE_HEIGHT: '0', // Invalid zero height + }; + + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + if (key === 'INSTAGRAM_DRY_RUN') return 'false'; + return invalidConfig[key as keyof typeof invalidConfig]?.toString() || null; + }); + + await expect(validateInstagramConfig(mockRuntime)).rejects.toThrow(); + }); + + it('throws error for invalid numeric image settings', async () => { + const invalidConfig = { + INSTAGRAM_DRY_RUN: false, + INSTAGRAM_USERNAME: 'test_user', + INSTAGRAM_PASSWORD: 'test_password', + INSTAGRAM_APP_ID: 'test_app_id', + INSTAGRAM_APP_SECRET: 'test_app_secret', + INSTAGRAM_IMAGE_GUIDANCE_SCALE: '-1', // Invalid negative guidance scale + INSTAGRAM_IMAGE_CFG_SCALE: '0', // Invalid zero cfg scale + INSTAGRAM_IMAGE_ITERATIONS: '-5' // Invalid negative iterations + }; + + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + if (key === 'INSTAGRAM_DRY_RUN') return 'false'; + return invalidConfig[key as keyof typeof invalidConfig]?.toString() || null; }); await expect(validateInstagramConfig(mockRuntime)).rejects.toThrow(); diff --git a/packages/client-instagram/__tests__/services/post.test.ts b/packages/client-instagram/__tests__/services/post.test.ts new file mode 100644 index 00000000000..b804d5bee82 --- /dev/null +++ b/packages/client-instagram/__tests__/services/post.test.ts @@ -0,0 +1,281 @@ +import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { InstagramPostService } from '../../src/services/post'; +import { type IAgentRuntime, elizaLogger, generateImage } from '@elizaos/core'; +import type { InstagramState } from '../../src/types'; +import path from 'path'; +import { promises as fs } from 'fs'; + +// Mock dependencies +vi.mock('@elizaos/core', () => ({ + elizaLogger: { + log: vi.fn(), + error: vi.fn(), + }, + generateImage: vi.fn(), + stringToUuid: vi.fn().mockReturnValue('mock-uuid'), + getEmbeddingZeroVector: vi.fn().mockReturnValue([]), +})); + +vi.mock('fs', () => ({ + promises: { + mkdir: vi.fn(), + writeFile: vi.fn(), + }, +})); + +describe('InstagramPostService', () => { + let service: InstagramPostService; + let mockRuntime: IAgentRuntime; + let mockState: InstagramState; + + beforeEach(() => { + // Initialize mockRuntime with required properties for testing + mockRuntime = { + getSetting: vi.fn(), + agentId: 'mock-agent-id', + character: { + settings: { + imageSettings: { + width: 1920, + height: 1080, + hideWatermark: true, + stylePreset: 'test-preset', + }, + }, + system: '', + name: 'test-character', + modelEndpointOverride: null, + }, + cacheManager: { + get: vi.fn(), + set: vi.fn(), + }, + messageManager: { + createMemory: vi.fn(), + }, + // Add minimal required properties for the test + serverUrl: 'http://test.com', + token: 'test-token', + modelProvider: 'test-provider', + imageModelProvider: 'test-image-provider', + databaseAdapter: null, + verifiableInferenceAdapter: null, + fetch: vi.fn(), + getService: vi.fn(), + } as unknown as IAgentRuntime; + + mockState = { + profile: { + username: 'test_user', + }, + } as InstagramState; + + service = new InstagramPostService(mockRuntime, mockState); + }); + + describe('Post Intervals', () => { + it('uses Instagram-specific interval settings when available', async () => { + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + switch (key) { + case 'INSTAGRAM_POST_INTERVAL_MIN': + return '120'; + case 'INSTAGRAM_POST_INTERVAL_MAX': + return '240'; + default: + return null; + } + }); + + vi.mocked(mockRuntime.cacheManager.get).mockResolvedValue(null); + + await service.start(); + + expect(mockRuntime.getSetting).toHaveBeenCalledWith('INSTAGRAM_POST_INTERVAL_MIN'); + expect(mockRuntime.getSetting).toHaveBeenCalledWith('INSTAGRAM_POST_INTERVAL_MAX'); + }); + + it('falls back to generic interval settings when Instagram-specific ones are not set', async () => { + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + switch (key) { + case 'POST_INTERVAL_MIN': + return '90'; + case 'POST_INTERVAL_MAX': + return '180'; + default: + return null; + } + }); + + vi.mocked(mockRuntime.cacheManager.get).mockResolvedValue(null); + + await service.start(); + + expect(mockRuntime.getSetting).toHaveBeenCalledWith('INSTAGRAM_POST_INTERVAL_MIN'); + expect(mockRuntime.getSetting).toHaveBeenCalledWith('POST_INTERVAL_MIN'); + }); + + it('uses default intervals when no settings are available', async () => { + vi.mocked(mockRuntime.getSetting).mockReturnValue(null); + vi.mocked(mockRuntime.cacheManager.get).mockResolvedValue(null); + + await service.start(); + + expect(mockRuntime.getSetting).toHaveBeenCalledWith('INSTAGRAM_POST_INTERVAL_MIN'); + expect(mockRuntime.getSetting).toHaveBeenCalledWith('POST_INTERVAL_MIN'); + // Default values should be used (60 and 120) + expect(elizaLogger.log).toHaveBeenCalledWith(expect.stringContaining('Post interval:')); + }); + }); + + describe('Image Generation', () => { + it('uses character image settings for generation', async () => { + vi.mocked(generateImage).mockResolvedValue({ + success: true, + data: ['data:image/png;base64,test123'], + }); + + await service['getOrGenerateImage']('test content'); + + expect(generateImage).toHaveBeenCalledWith( + expect.objectContaining({ + width: 1920, + height: 1080, + hideWatermark: true, + stylePreset: 'test-preset', + }), + mockRuntime + ); + }); + + it('uses default values when image settings are not provided', async () => { + // Ensure character and settings are defined before modifying + mockRuntime.character = { + ...mockRuntime.character, + settings: { + imageSettings: {} + } + }; + + vi.mocked(generateImage).mockResolvedValue({ + success: true, + data: ['data:image/png;base64,test123'], + }); + + await service['getOrGenerateImage']('test content'); + + expect(generateImage).toHaveBeenCalledWith( + expect.objectContaining({ + width: 1024, + height: 1024, + count: 1, + numIterations: 50, + guidanceScale: 7.5, + }), + mockRuntime + ); + }); + + it('handles image generation failure', async () => { + vi.mocked(generateImage).mockResolvedValue({ + success: false, + error: 'Generation failed', + }); + + await expect(service['getOrGenerateImage']('test content')).rejects.toThrow('Failed to generate image'); + }); + + it('saves generated image to temp directory', async () => { + vi.mocked(generateImage).mockResolvedValue({ + success: true, + data: ['data:image/png;base64,test123'], + }); + + await service['getOrGenerateImage']('test content'); + + expect(fs.mkdir).toHaveBeenCalledWith(expect.stringContaining('temp'), { recursive: true }); + expect(fs.writeFile).toHaveBeenCalledWith( + expect.stringContaining('instagram-post-'), + expect.any(Buffer) + ); + }); + + it('uses enhanced image generation settings when provided', async () => { + // Ensure character and settings are defined before modifying + mockRuntime.character = { + ...mockRuntime.character, + settings: { + imageSettings: { + width: 1920, + height: 1080, + hideWatermark: true, + stylePreset: 'test-preset', + negativePrompt: 'blurry, low quality', + numIterations: 30, + guidanceScale: 8.5, + seed: 12345, + cfgScale: 9, + safeMode: true + } + } + }; + + vi.mocked(generateImage).mockResolvedValue({ + success: true, + data: ['data:image/png;base64,test123'], + }); + + await service['getOrGenerateImage']('test content'); + + expect(generateImage).toHaveBeenCalledWith( + expect.objectContaining({ + width: 1920, + height: 1080, + hideWatermark: true, + stylePreset: 'test-preset', + negativePrompt: 'blurry, low quality', + numIterations: 30, + guidanceScale: 8.5, + seed: 12345, + cfgScale: 9, + safeMode: true + }), + mockRuntime + ); + }); + + it('handles partial enhanced image settings', async () => { + // Ensure character and settings are defined before modifying + mockRuntime.character = { + ...mockRuntime.character, + settings: { + imageSettings: { + width: 1920, + height: 1080, + negativePrompt: 'blurry', + seed: 12345 + } + } + }; + + vi.mocked(generateImage).mockResolvedValue({ + success: true, + data: ['data:image/png;base64,test123'], + }); + + await service['getOrGenerateImage']('test content'); + + expect(generateImage).toHaveBeenCalledWith( + expect.objectContaining({ + width: 1920, + height: 1080, + negativePrompt: 'blurry', + seed: 12345, + count: 1, + numIterations: 50, + guidanceScale: 7.5 + }), + mockRuntime + ); + }); + }); +}); diff --git a/packages/client-instagram/src/services/post.ts b/packages/client-instagram/src/services/post.ts index a8e94735ccc..0a434a7c68d 100644 --- a/packages/client-instagram/src/services/post.ts +++ b/packages/client-instagram/src/services/post.ts @@ -65,11 +65,11 @@ export class InstagramPostService { const lastPostTimestamp = lastPost?.timestamp ?? 0; const minMinutes = Number.parseInt( - this.runtime.getSetting("POST_INTERVAL_MIN") || "90", + this.runtime.getSetting("INSTAGRAM_POST_INTERVAL_MIN") || this.runtime.getSetting("POST_INTERVAL_MIN") || "90", 10 ); const maxMinutes = Number.parseInt( - this.runtime.getSetting("POST_INTERVAL_MAX") || "180", + this.runtime.getSetting("INSTAGRAM_POST_INTERVAL_MAX") || this.runtime.getSetting("POST_INTERVAL_MAX") || "180", 10 ); const randomMinutes = @@ -217,14 +217,24 @@ export class InstagramPostService { try { elizaLogger.log("Generating image for Instagram post"); + let imageSettings = this.runtime.character.settings.imageSettings || {}; + const result = await generateImage( { prompt: content, - width: 1024, - height: 1024, - count: 1, - numIterations: 50, - guidanceScale: 7.5, + width: imageSettings?.width || 1024, + height: imageSettings?.height || 1024, + count: imageSettings?.count || 1, +negativePrompt: imageSettings?.negativePrompt || null, + numIterations: imageSettings?.numIterations || 50, + guidanceScale: imageSettings?.guidanceScale || 7.5, +seed: imageSettings?.seed || null, + modelId: imageSettings?.modelId || null, + jobId: imageSettings?.jobId || null, + stylePreset: imageSettings?.stylePreset || "", + hideWatermark: imageSettings?.hideWatermark ?? true, + safeMode: imageSettings?.safeMode ?? true, + cfgScale: imageSettings?.cfgScale || null, }, this.runtime ); diff --git a/packages/client-lens/package.json b/packages/client-lens/package.json index 24a205251a7..1ce96d10da6 100644 --- a/packages/client-lens/package.json +++ b/packages/client-lens/package.json @@ -1,43 +1,43 @@ { - "name": "@elizaos/client-lens", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache .", - "test": "vitest run", - "test:watch": "vitest watch", - "test:coverage": "vitest run --coverage" - }, - "dependencies": { - "@elizaos/core": "workspace:*", - "@lens-protocol/client": "2.2.0", - "@lens-protocol/metadata": "1.2.0", - "axios": "^1.7.9" - }, - "devDependencies": { - "tsup": "^8.3.5", - "vitest": "^1.2.1", - "@vitest/coverage-v8": "^1.2.1" - }, - "peerDependencies": { - "@elizaos/core": "workspace:*" - } + "name": "@elizaos/client-lens", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache .", + "test": "vitest run", + "test:watch": "vitest watch", + "test:coverage": "vitest run --coverage" + }, + "dependencies": { + "@elizaos/core": "workspace:*", + "@lens-protocol/client": "2.2.0", + "@lens-protocol/metadata": "1.2.0", + "axios": "^1.7.9" + }, + "devDependencies": { + "tsup": "^8.3.5", + "vitest": "^1.2.1", + "@vitest/coverage-v8": "^1.2.1" + }, + "peerDependencies": { + "@elizaos/core": "workspace:*" + } } diff --git a/packages/client-slack/package.json b/packages/client-slack/package.json index 74bb149742e..843e167be75 100644 --- a/packages/client-slack/package.json +++ b/packages/client-slack/package.json @@ -1,56 +1,56 @@ { - "name": "@elizaos/client-slack", - "version": "0.1.9", - "description": "Slack client plugin for Eliza framework", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "scripts": { - "build": "tsup src/index.ts --format esm --dts", - "test": "vitest run", - "test:watch": "vitest", - "clean": "rimraf dist", - "dev": "tsup src/index.ts --watch", - "example": "ts-node src/examples/standalone-example.ts", - "example:attachment": "ts-node src/examples/standalone-attachment.ts", - "example:summarize": "ts-node src/examples/standalone-summarize.ts", - "example:transcribe": "ts-node src/examples/standalone-transcribe.ts" - }, - "dependencies": { - "@elizaos/core": "workspace:*", - "@ffmpeg-installer/ffmpeg": "^1.1.0", - "@slack/events-api": "^3.0.1", - "@slack/web-api": "^6.8.1", - "body-parser": "^1.20.2", - "dotenv": "^16.0.3", - "express": "^4.18.2", - "fluent-ffmpeg": "^2.1.2", - "node-fetch": "^2.6.9" - }, - "devDependencies": { - "@types/express": "^4.17.21", - "@types/fluent-ffmpeg": "^2.1.24", - "@types/node": "^18.15.11", - "rimraf": "^5.0.0", - "tsup": "^6.7.0", - "typescript": "^5.0.3", - "vitest": "^1.2.1" - }, - "engines": { - "node": ">=14.0.0" - } + "name": "@elizaos/client-slack", + "version": "0.1.9", + "description": "Slack client plugin for Eliza framework", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsup src/index.ts --format esm --dts", + "test": "vitest run", + "test:watch": "vitest", + "clean": "rimraf dist", + "dev": "tsup src/index.ts --watch", + "example": "ts-node src/examples/standalone-example.ts", + "example:attachment": "ts-node src/examples/standalone-attachment.ts", + "example:summarize": "ts-node src/examples/standalone-summarize.ts", + "example:transcribe": "ts-node src/examples/standalone-transcribe.ts" + }, + "dependencies": { + "@elizaos/core": "workspace:*", + "@ffmpeg-installer/ffmpeg": "^1.1.0", + "@slack/events-api": "^3.0.1", + "@slack/web-api": "^6.8.1", + "body-parser": "^1.20.2", + "dotenv": "^16.0.3", + "express": "^4.18.2", + "fluent-ffmpeg": "^2.1.2", + "node-fetch": "^2.6.9" + }, + "devDependencies": { + "@types/express": "^4.17.21", + "@types/fluent-ffmpeg": "^2.1.24", + "@types/node": "^18.15.11", + "rimraf": "^5.0.0", + "tsup": "^6.7.0", + "typescript": "^5.0.3", + "vitest": "^1.2.1" + }, + "engines": { + "node": ">=14.0.0" + } } diff --git a/packages/client-telegram/package.json b/packages/client-telegram/package.json index 484b6df620d..337c4b6a048 100644 --- a/packages/client-telegram/package.json +++ b/packages/client-telegram/package.json @@ -1,37 +1,37 @@ { - "name": "@elizaos/client-telegram", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@telegraf/types": "7.1.0", - "telegraf": "4.16.3", - "zod": "3.23.8" - }, - "devDependencies": { - "tsup": "8.3.5", - "vitest": "1.2.1" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - } + "name": "@elizaos/client-telegram", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@telegraf/types": "7.1.0", + "telegraf": "4.16.3", + "zod": "3.23.8" + }, + "devDependencies": { + "tsup": "8.3.5", + "vitest": "1.2.1" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + } } diff --git a/packages/client-twitter/package.json b/packages/client-twitter/package.json index 9c67d4d26be..1985b0673bb 100644 --- a/packages/client-twitter/package.json +++ b/packages/client-twitter/package.json @@ -1,42 +1,42 @@ { - "name": "@elizaos/client-twitter", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "agent-twitter-client": "0.0.18", - "glob": "11.0.0", - "zod": "3.23.8", - "discord.js": "14.16.3" - }, - "devDependencies": { - "tsup": "8.3.5", - "vitest": "1.1.3", - "@vitest/coverage-v8": "1.1.3" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:coverage": "vitest run --coverage" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/client-twitter", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "agent-twitter-client": "0.0.18", + "discord.js": "14.16.3", + "glob": "11.0.0", + "zod": "3.23.8" + }, + "devDependencies": { + "@vitest/coverage-v8": "1.1.3", + "tsup": "8.3.5", + "vitest": "1.1.3" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:coverage": "vitest run --coverage" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/client-twitter/src/interactions.ts b/packages/client-twitter/src/interactions.ts index ca85b814209..df0706a5395 100644 --- a/packages/client-twitter/src/interactions.ts +++ b/packages/client-twitter/src/interactions.ts @@ -483,14 +483,15 @@ export class TwitterInteractionClient { } else { try { const callback: HandlerCallback = async ( - response: Content + response: Content, + tweetId?: string ) => { const memories = await sendTweet( this.client, response, message.roomId, this.client.twitterConfig.TWITTER_USERNAME, - tweet.id + tweetId || tweet.id ); return memories; }; @@ -514,12 +515,16 @@ export class TwitterInteractionClient { responseMessage ); } - + const responseTweetId = + responseMessages[responseMessages.length - 1]?.content + ?.tweetId; await this.runtime.processActions( message, responseMessages, state, - callback + (response: Content) => { + return callback(response, responseTweetId); + } ); const responseInfo = `Context:\n\n${context}\n\nSelected Post: ${tweet.id} - ${tweet.username}: ${tweet.text}\nAgent's Output:\n${response.text}`; diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index 8b787b36ec6..e985455d73f 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -505,7 +505,7 @@ export class TwitterPostClient { ); const topics = this.runtime.character.topics.join(", "); - + const maxTweetLength = this.client.twitterConfig.MAX_TWEET_LENGTH; const state = await this.runtime.composeState( { userId: this.runtime.agentId, @@ -518,6 +518,7 @@ export class TwitterPostClient { }, { twitterUserName: this.client.profile.username, + maxTweetLength, } ); @@ -574,7 +575,6 @@ export class TwitterPostClient { } // Truncate the content to the maximum tweet length specified in the environment settings, ensuring the truncation respects sentence boundaries. - const maxTweetLength = this.client.twitterConfig.MAX_TWEET_LENGTH; if (maxTweetLength) { tweetTextForPosting = truncateToCompleteSentence( tweetTextForPosting, diff --git a/packages/client-twitter/src/utils.ts b/packages/client-twitter/src/utils.ts index fd8a86b8763..f62564bef1b 100644 --- a/packages/client-twitter/src/utils.ts +++ b/packages/client-twitter/src/utils.ts @@ -274,6 +274,7 @@ export async function sendTweet( agentId: client.runtime.agentId, userId: client.runtime.agentId, content: { + tweetId: tweet.id, text: tweet.text, source: "twitter", url: tweet.permanentUrl, diff --git a/packages/core/__tests__/parsing.test.ts b/packages/core/__tests__/parsing.test.ts index d2739fa8890..b91e390a12a 100644 --- a/packages/core/__tests__/parsing.test.ts +++ b/packages/core/__tests__/parsing.test.ts @@ -74,18 +74,24 @@ describe("Parsing Module", () => { "item2", "item3", ]); - input = "```json\n[\"A's item\", \"B's item\", \"C's item\"]\n```"; + input = '```json\n["A\'s item", "B\'s item", "C\'s item"]\n```'; expect(parseJsonArrayFromText(input)).toEqual([ "A's item", "B's item", "C's item", ]); - input = "[\"A's item\", \"B's item\", \"C's item\"]"; + input = '["A\'s item", "B\'s item", "C\'s item"]'; expect(parseJsonArrayFromText(input)).toEqual([ "A's item", "B's item", "C's item", ]); + input = `[ + 'MANAGE_POSITIONS_RETRIGGER_EVALUATOR' + ]`; + expect(parseJsonArrayFromText(input)).toEqual([ + "MANAGE_POSITIONS_RETRIGGER_EVALUATOR", + ]); }); it("should handle empty arrays", () => { diff --git a/packages/core/package.json b/packages/core/package.json index aee352af3fe..d5fdfe8f186 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,96 +1,96 @@ { - "name": "@elizaos/core", - "version": "0.1.9", - "description": "", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "scripts": { - "build": "tsup --format esm --dts", - "watch": "tsc --watch", - "dev": "tsup --format esm --dts --watch", - "build:docs": "cd docs && pnpm run build", - "test": "vitest run", - "test:coverage": "vitest run --coverage", - "test:watch": "vitest" - }, - "author": "", - "license": "MIT", - "devDependencies": { - "@eslint/js": "9.16.0", - "@rollup/plugin-commonjs": "25.0.8", - "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "15.3.0", - "@rollup/plugin-replace": "5.0.7", - "@rollup/plugin-terser": "0.1.0", - "@rollup/plugin-typescript": "11.1.6", - "@solana/web3.js": "npm:@solana/web3.js@1.95.8", - "@types/fluent-ffmpeg": "2.1.27", - "@types/jest": "29.5.14", - "@types/mocha": "10.0.10", - "@types/node": "22.8.4", - "@types/pdfjs-dist": "2.10.378", - "@types/tar": "6.1.13", - "@types/wav-encoder": "1.3.3", - "@typescript-eslint/eslint-plugin": "8.16.0", - "@typescript-eslint/parser": "8.16.0", - "@vitest/coverage-v8": "2.1.5", - "jest": "29.7.0", - "lint-staged": "15.2.10", - "nodemon": "3.1.7", - "pm2": "5.4.3", - "rimraf": "6.0.1", - "rollup": "2.79.2", - "ts-jest": "29.2.5", - "ts-node": "10.9.2", - "tslib": "2.8.1", - "tsup": "8.3.5", - "typescript": "5.6.3" - }, - "dependencies": { - "@ai-sdk/anthropic": "0.0.56", - "@ai-sdk/google": "0.0.55", - "@ai-sdk/google-vertex": "0.0.43", - "@ai-sdk/groq": "0.0.3", - "@ai-sdk/mistral": "1.0.9", - "@ai-sdk/openai": "1.0.5", - "@ai-sdk/amazon-bedrock": "1.1.0", - "@fal-ai/client": "1.2.0", - "@tavily/core": "^0.0.2", - "@types/uuid": "10.0.0", - "ai": "3.4.33", - "anthropic-vertex-ai": "1.0.2", - "dotenv": "16.4.5", - "fastembed": "1.14.1", - "fastestsmallesttextencoderdecoder": "1.0.22", - "gaxios": "6.7.1", - "glob": "11.0.0", - "handlebars": "^4.7.8", - "js-sha1": "0.7.0", - "js-tiktoken": "1.0.15", - "langchain": "0.3.6", - "ollama-ai-provider": "0.16.1", - "openai": "4.73.0", - "pino": "^9.6.0", - "pino-pretty": "^13.0.0", - "tinyld": "1.3.4", - "together-ai": "0.7.0", - "unique-names-generator": "4.7.1", - "uuid": "11.0.3", - "zod": "3.23.8" - } + "name": "@elizaos/core", + "version": "0.1.9", + "description": "", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsup --format esm --dts", + "watch": "tsc --watch", + "dev": "tsup --format esm --dts --watch", + "build:docs": "cd docs && pnpm run build", + "test": "vitest run", + "test:coverage": "vitest run --coverage", + "test:watch": "vitest" + }, + "author": "", + "license": "MIT", + "devDependencies": { + "@eslint/js": "9.16.0", + "@rollup/plugin-commonjs": "25.0.8", + "@rollup/plugin-json": "6.1.0", + "@rollup/plugin-node-resolve": "15.3.0", + "@rollup/plugin-replace": "5.0.7", + "@rollup/plugin-terser": "0.1.0", + "@rollup/plugin-typescript": "11.1.6", + "@solana/web3.js": "npm:@solana/web3.js@1.95.8", + "@types/fluent-ffmpeg": "2.1.27", + "@types/jest": "29.5.14", + "@types/mocha": "10.0.10", + "@types/node": "22.8.4", + "@types/pdfjs-dist": "2.10.378", + "@types/tar": "6.1.13", + "@types/wav-encoder": "1.3.3", + "@typescript-eslint/eslint-plugin": "8.16.0", + "@typescript-eslint/parser": "8.16.0", + "@vitest/coverage-v8": "2.1.5", + "jest": "29.7.0", + "lint-staged": "15.2.10", + "nodemon": "3.1.7", + "pm2": "5.4.3", + "rimraf": "6.0.1", + "rollup": "2.79.2", + "ts-jest": "29.2.5", + "ts-node": "10.9.2", + "tslib": "2.8.1", + "tsup": "8.3.5", + "typescript": "5.6.3" + }, + "dependencies": { + "@ai-sdk/anthropic": "0.0.56", + "@ai-sdk/google": "0.0.55", + "@ai-sdk/google-vertex": "0.0.43", + "@ai-sdk/groq": "0.0.3", + "@ai-sdk/mistral": "1.0.9", + "@ai-sdk/openai": "1.0.5", + "@ai-sdk/amazon-bedrock": "1.1.0", + "@fal-ai/client": "1.2.0", + "@tavily/core": "^0.0.2", + "@types/uuid": "10.0.0", + "ai": "3.4.33", + "anthropic-vertex-ai": "1.0.2", + "dotenv": "16.4.5", + "fastembed": "1.14.1", + "fastestsmallesttextencoderdecoder": "1.0.22", + "gaxios": "6.7.1", + "glob": "11.0.0", + "handlebars": "^4.7.8", + "js-sha1": "0.7.0", + "js-tiktoken": "1.0.15", + "langchain": "0.3.6", + "ollama-ai-provider": "0.16.1", + "openai": "4.73.0", + "pino": "^9.6.0", + "pino-pretty": "^13.0.0", + "tinyld": "1.3.4", + "together-ai": "0.7.0", + "unique-names-generator": "4.7.1", + "uuid": "11.0.3", + "zod": "3.23.8" + } } diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index 269b8b68fd5..78b0b8dc941 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -534,7 +534,8 @@ export async function generateText({ case ModelProviderName.HYPERBOLIC: case ModelProviderName.TOGETHER: case ModelProviderName.NINETEEN_AI: - case ModelProviderName.AKASH_CHAT_API: { + case ModelProviderName.AKASH_CHAT_API: + case ModelProviderName.LMSTUDIO: { elizaLogger.debug( "Initializing OpenAI model with Cloudflare check" ); @@ -2178,6 +2179,7 @@ export async function handleProvider( case ModelProviderName.TOGETHER: case ModelProviderName.NANOGPT: case ModelProviderName.AKASH_CHAT_API: + case ModelProviderName.LMSTUDIO: return await handleOpenAI(options); case ModelProviderName.ANTHROPIC: case ModelProviderName.CLAUDE_VERTEX: diff --git a/packages/core/src/models.ts b/packages/core/src/models.ts index 4334c858ba6..76a6838d1ba 100644 --- a/packages/core/src/models.ts +++ b/packages/core/src/models.ts @@ -331,6 +331,35 @@ export const models: Models = { }, }, }, + [ModelProviderName.LMSTUDIO]: { + endpoint: settings.LMSTUDIO_SERVER_URL || "http://localhost:1234/v1", + model: { + [ModelClass.SMALL]: { + name: settings.SMALL_LMSTUDIO_MODEL || settings.LMSTUDIO_MODEL || "hermes-3-llama-3.1-8b", + stop: ["<|eot_id|>", "<|eom_id|>"], + maxInputTokens: 32768, + maxOutputTokens: 8192, + repetition_penalty: 0.4, + temperature: 0.7, + }, + [ModelClass.MEDIUM]: { + name: settings.MEDIUM_LMSTUDIO_MODEL || settings.LMSTUDIO_MODEL || "hermes-3-llama-3.1-8b", + stop: ["<|eot_id|>", "<|eom_id|>"], + maxInputTokens: 32768, + maxOutputTokens: 8192, + repetition_penalty: 0.4, + temperature: 0.7, + }, + [ModelClass.LARGE]: { + name: settings.LARGE_LMSTUDIO_MODEL || settings.LMSTUDIO_MODEL || "hermes-3-llama-3.1-8b", + stop: ["<|eot_id|>", "<|eom_id|>"], + maxInputTokens: 32768, + maxOutputTokens: 8192, + repetition_penalty: 0.4, + temperature: 0.7, + }, + }, + }, [ModelProviderName.GOOGLE]: { endpoint: "https://generativelanguage.googleapis.com", model: { diff --git a/packages/core/src/parsing.ts b/packages/core/src/parsing.ts index b27dcdf8407..75ea8373df8 100644 --- a/packages/core/src/parsing.ts +++ b/packages/core/src/parsing.ts @@ -15,7 +15,7 @@ If {{agentName}} is talking too much, you can choose [IGNORE] Your response must include one of the options.`; export const parseShouldRespondFromText = ( - text: string, + text: string ): "RESPOND" | "IGNORE" | "STOP" | null => { const match = text .split("\n")[0] @@ -27,12 +27,12 @@ export const parseShouldRespondFromText = ( return match ? (match[0].toUpperCase() as "RESPOND" | "IGNORE" | "STOP") : text.includes("RESPOND") - ? "RESPOND" - : text.includes("IGNORE") - ? "IGNORE" - : text.includes("STOP") - ? "STOP" - : null; + ? "RESPOND" + : text.includes("IGNORE") + ? "IGNORE" + : text.includes("STOP") + ? "STOP" + : null; }; export const booleanFooter = `Respond with only a YES or a NO.`; @@ -91,7 +91,10 @@ export function parseJsonArrayFromText(text: string) { if (jsonBlockMatch) { try { // Only replace quotes that are actually being used for string delimitation - const normalizedJson = jsonBlockMatch[1].replace(/(? | null { let jsonData = null; @@ -184,7 +190,7 @@ export function parseJSONObjectFromText( */ export function extractAttributes( response: string, - attributesToExtract?: string[], + attributesToExtract?: string[] ): { [key: string]: string | undefined } { const attributes: { [key: string]: string | undefined } = {}; @@ -198,7 +204,7 @@ export function extractAttributes( // Extract only specified attributes attributesToExtract.forEach((attribute) => { const match = response.match( - new RegExp(`"${attribute}"\\s*:\\s*"([^"]*)"`, "i"), + new RegExp(`"${attribute}"\\s*:\\s*"([^"]*)"`, "i") ); if (match) { attributes[attribute] = match[1]; @@ -228,7 +234,7 @@ export function cleanJsonResponse(response: string): string { export const postActionResponseFooter = `Choose any combination of [LIKE], [RETWEET], [QUOTE], and [REPLY] that are appropriate. Each action must be on its own line. Your response must only include the chosen actions.`; export const parseActionResponseFromText = ( - text: string, + text: string ): { actions: ActionResponse } => { const actions: ActionResponse = { like: false, @@ -267,7 +273,7 @@ export const parseActionResponseFromText = ( */ export function truncateToCompleteSentence( text: string, - maxLength: number, + maxLength: number ): string { if (text.length <= maxLength) { return text; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 1d096554578..ee9687ee4c8 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -209,6 +209,7 @@ export type Models = { [ModelProviderName.LLAMACLOUD]: Model; [ModelProviderName.TOGETHER]: Model; [ModelProviderName.LLAMALOCAL]: Model; + [ModelProviderName.LMSTUDIO]: Model; [ModelProviderName.GOOGLE]: Model; [ModelProviderName.MISTRAL]: Model; [ModelProviderName.CLAUDE_VERTEX]: Model; @@ -246,6 +247,7 @@ export enum ModelProviderName { LLAMACLOUD = "llama_cloud", TOGETHER = "together", LLAMALOCAL = "llama_local", + LMSTUDIO = "lmstudio", GOOGLE = "google", MISTRAL = "mistral", CLAUDE_VERTEX = "claude_vertex", diff --git a/packages/create-eliza-app/package.json b/packages/create-eliza-app/package.json index 1701dad1686..575d4834f72 100644 --- a/packages/create-eliza-app/package.json +++ b/packages/create-eliza-app/package.json @@ -1,30 +1,30 @@ { - "name": "create-eliza-app", - "version": "0.1.9", - "description": "", - "sideEffects": false, - "files": [ - "dist" - ], - "main": "dist/index.cjs", - "bin": { - "create-eliza-app": "dist/index.mjs" - }, - "scripts": { - "build": "unbuild", - "start": "node ./dist/index.cjs", - "automd": "automd" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "citty": "0.1.6", - "giget": "1.2.3" - }, - "devDependencies": { - "automd": "0.3.12", - "jiti": "2.4.0", - "unbuild": "2.0.0" - } + "name": "create-eliza-app", + "version": "0.1.9", + "description": "", + "sideEffects": false, + "files": [ + "dist" + ], + "main": "dist/index.cjs", + "bin": { + "create-eliza-app": "dist/index.mjs" + }, + "scripts": { + "build": "unbuild", + "start": "node ./dist/index.cjs", + "automd": "automd" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "citty": "0.1.6", + "giget": "1.2.3" + }, + "devDependencies": { + "automd": "0.3.12", + "jiti": "2.4.0", + "unbuild": "2.0.0" + } } diff --git a/packages/plugin-0g/package.json b/packages/plugin-0g/package.json index 85c1ec22f3c..8fddc8a82bc 100644 --- a/packages/plugin-0g/package.json +++ b/packages/plugin-0g/package.json @@ -1,36 +1,36 @@ { - "name": "@elizaos/plugin-0g", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@0glabs/0g-ts-sdk": "0.2.1", - "@elizaos/core": "workspace:*", - "ethers": "6.13.4", - "tsup": "8.3.5" - }, - "devDependencies": { - "vitest": "^1.2.1" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-0g", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@0glabs/0g-ts-sdk": "0.2.1", + "@elizaos/core": "workspace:*", + "ethers": "6.13.4", + "tsup": "8.3.5" + }, + "devDependencies": { + "vitest": "^1.2.1" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-3d-generation/package.json b/packages/plugin-3d-generation/package.json index 68a4ab2d9a6..cd3e821b0ad 100644 --- a/packages/plugin-3d-generation/package.json +++ b/packages/plugin-3d-generation/package.json @@ -1,37 +1,37 @@ { - "name": "@elizaos/plugin-3d-generation", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5", - "whatwg-url": "7.1.0" - }, - "devDependencies": { - "vitest": "^2.1.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-3d-generation", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5", + "whatwg-url": "7.1.0" + }, + "devDependencies": { + "vitest": "^2.1.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-abstract/package.json b/packages/plugin-abstract/package.json index 7353e65743d..4795f922ca6 100644 --- a/packages/plugin-abstract/package.json +++ b/packages/plugin-abstract/package.json @@ -1,43 +1,43 @@ { - "name": "@elizaos/plugin-abstract", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@abstract-foundation/agw-client": "1.0.1", - "@elizaos/core": "workspace:*", - "tsup": "^8.3.5", - "viem": "2.22.2" - }, - "scripts": { - "lint": "eslint --fix --cache .", - "build": "tsup --format esm --no-dts", - "dev": "tsup --format esm --no-dts --watch", - "test": "vitest run", - "test:watch": "vitest watch", - "test:coverage": "vitest run --coverage" - }, - "devDependencies": { - "tsup": "8.3.5", - "typescript": "4.9", - "vitest": "^1.0.0" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-abstract", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@abstract-foundation/agw-client": "1.0.1", + "@elizaos/core": "workspace:*", + "tsup": "^8.3.5", + "viem": "2.22.2" + }, + "scripts": { + "lint": "eslint --fix --cache .", + "build": "tsup --format esm --no-dts", + "dev": "tsup --format esm --no-dts --watch", + "test": "vitest run", + "test:watch": "vitest watch", + "test:coverage": "vitest run --coverage" + }, + "devDependencies": { + "tsup": "8.3.5", + "typescript": "4.9", + "vitest": "^1.0.0" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-akash/package.json b/packages/plugin-akash/package.json index 4f76fc558d3..8da2ca91a7c 100644 --- a/packages/plugin-akash/package.json +++ b/packages/plugin-akash/package.json @@ -1,53 +1,53 @@ { - "name": "@elizaos/plugin-akash", - "version": "0.1.9", - "description": "Akash Network Plugin for Eliza", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "type": "module", - "scripts": { - "build": "tsup", - "dev": "tsup --watch", - "clean": "rm -rf dist", - "lint:fix": "eslint . --fix", - "test": "vitest", - "test:watch": "vitest watch", - "test:coverage": "vitest run --coverage", - "test:ui": "vitest --ui" - }, - "dependencies": { - "@akashnetwork/akash-api": "^1.4.0", - "@akashnetwork/akashjs": "0.10.1", - "@cosmjs/proto-signing": "^0.31.3", - "@cosmjs/stargate": "0.31.3", - "@elizaos/core": "workspace:*", - "@types/js-yaml": "^4.0.9", - "zod": "^3.22.4", - "axios": "^1.7.9", - "dotenv": "^16.4.1", - "jsrsasign": "^11.1.0", - "node-fetch": "^2.7.0", - "chalk": "^5.3.0", - "cli-table3": "^0.6.3", - "ora": "^8.0.1" - }, - "devDependencies": { - "@types/dotenv": "^8.2.0", - "@types/jest": "^29.5.11", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.10.5", - "@typescript-eslint/eslint-plugin": "^6.15.0", - "@typescript-eslint/parser": "^6.15.0", - "@vitest/coverage-v8": "^0.34.6", - "@vitest/ui": "^0.34.6", - "eslint": "^9.16.0", - "tsup": "^8.0.1", - "typescript": "^5.3.3", - "vite": "^5.0.10", - "vite-tsconfig-paths": "^4.2.2", - "vitest": "^0.34.6" - }, - "peerDependencies": { - "@elizaos/core": "workspace:*" - } + "name": "@elizaos/plugin-akash", + "version": "0.1.9", + "description": "Akash Network Plugin for Eliza", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "type": "module", + "scripts": { + "build": "tsup", + "dev": "tsup --watch", + "clean": "rm -rf dist", + "lint:fix": "eslint . --fix", + "test": "vitest", + "test:watch": "vitest watch", + "test:coverage": "vitest run --coverage", + "test:ui": "vitest --ui" + }, + "dependencies": { + "@akashnetwork/akash-api": "^1.4.0", + "@akashnetwork/akashjs": "0.10.1", + "@cosmjs/proto-signing": "^0.31.3", + "@cosmjs/stargate": "0.31.3", + "@elizaos/core": "workspace:*", + "@types/js-yaml": "^4.0.9", + "zod": "^3.22.4", + "axios": "^1.7.9", + "dotenv": "^16.4.1", + "jsrsasign": "^11.1.0", + "node-fetch": "^2.7.0", + "chalk": "^5.3.0", + "cli-table3": "^0.6.3", + "ora": "^8.0.1" + }, + "devDependencies": { + "@types/dotenv": "^8.2.0", + "@types/jest": "^29.5.11", + "@types/js-yaml": "^4.0.9", + "@types/node": "^20.10.5", + "@typescript-eslint/eslint-plugin": "^6.15.0", + "@typescript-eslint/parser": "^6.15.0", + "@vitest/coverage-v8": "^0.34.6", + "@vitest/ui": "^0.34.6", + "eslint": "^9.16.0", + "tsup": "^8.0.1", + "typescript": "^5.3.3", + "vite": "^5.0.10", + "vite-tsconfig-paths": "^4.2.2", + "vitest": "^0.34.6" + }, + "peerDependencies": { + "@elizaos/core": "workspace:*" + } } diff --git a/packages/plugin-allora/package.json b/packages/plugin-allora/package.json index 939df853849..6dee6303b49 100644 --- a/packages/plugin-allora/package.json +++ b/packages/plugin-allora/package.json @@ -1,22 +1,22 @@ { - "name": "@elizaos/plugin-allora", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5", - "node-cache": "5.1.2", - "vitest": "2.1.8", - "@alloralabs/allora-sdk": "^0.1.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-allora", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@alloralabs/allora-sdk": "0.0.4", + "@elizaos/core": "workspace:*", + "node-cache": "5.1.2", + "vitest": "2.1.8", + "@alloralabs/allora-sdk": "^0.1.0" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-anyone/package.json b/packages/plugin-anyone/package.json index 82e0d59446b..82d9f6fbf8f 100644 --- a/packages/plugin-anyone/package.json +++ b/packages/plugin-anyone/package.json @@ -1,27 +1,27 @@ { - "name": "@elizaos/plugin-anyone", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@anyone-protocol/anyone-client": "^0.4.3", - "@elizaos/core": "workspace:*", - "axios": "^1.7.9", - "tsup": "8.3.5" - }, - "devDependencies": { - "vitest": "^1.2.1", - "@vitest/coverage-v8": "^1.2.1" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest", - "test:coverage": "vitest run --coverage" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-anyone", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@anyone-protocol/anyone-client": "^0.4.3", + "@elizaos/core": "workspace:*", + "axios": "^1.7.9", + "tsup": "8.3.5" + }, + "devDependencies": { + "vitest": "^1.2.1", + "@vitest/coverage-v8": "^1.2.1" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest", + "test:coverage": "vitest run --coverage" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-apro/__tests__/actions/attpsPriceQuery.test.ts b/packages/plugin-apro/__tests__/actions/attpsPriceQuery.test.ts new file mode 100644 index 00000000000..179b829f31c --- /dev/null +++ b/packages/plugin-apro/__tests__/actions/attpsPriceQuery.test.ts @@ -0,0 +1,174 @@ +// Mock declarations must come first +vi.mock('@elizaos/core'); +vi.mock('ai-agent-sdk-js'); + +import { vi, describe, it, expect, beforeEach } from 'vitest'; +import type { IAgentRuntime, Memory, State } from '@elizaos/core'; +import { generateObject } from '@elizaos/core'; +import { attpsPriceQuery } from '../../src/actions/attpsPriceQuery'; + +describe('attpsPriceQuery', () => { + const mockRuntime: IAgentRuntime = { + composeState: vi.fn(), + updateRecentMessageState: vi.fn(), + getSetting: vi.fn() + } as unknown as IAgentRuntime; + + const mockMessage: Memory = { + userId: 'test-user', + agentId: 'test-agent', + roomId: 'test-room', + content: { + text: 'query price' + } + } as Memory; + + const mockState: State = {}; + const mockCallback = vi.fn(); + const mockFetch = vi.fn(); + + beforeEach(() => { + vi.clearAllMocks(); + vi.mocked(mockRuntime.composeState).mockResolvedValue(mockState); + vi.mocked(mockRuntime.updateRecentMessageState).mockResolvedValue(mockState); + global.fetch = mockFetch; + }); + + describe('validate', () => { + it('should always return true', async () => { + const result = await attpsPriceQuery.validate(mockRuntime, mockMessage); + expect(result).toBe(true); + }); + }); + + describe('handler', () => { + const mockPriceQuery = { + sourceAgentId: 'test-source-agent', + feedId: 'test-feed' + }; + + const mockPriceResponse = { + code: 0, + message: 'success', + result: { + askPrice: '100.50', + bidPrice: '100.40', + midPrice: '100.45', + validTimeStamp: '1234567890' + } + }; + + it('should successfully fetch price data', async () => { + // Mock generateObject to return price query params + vi.mocked(generateObject).mockResolvedValueOnce({ + object: mockPriceQuery + }); + + // Mock successful API response + mockFetch.mockResolvedValueOnce({ + json: () => Promise.resolve(mockPriceResponse) + }); + + const result = await attpsPriceQuery.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith(expect.objectContaining({ + text: expect.stringContaining('Ask price: 100.5') + })); + expect(mockFetch).toHaveBeenCalledWith( + expect.stringContaining('sourceAgentId=test-source-agent') + ); + }); + + it('should handle price query params generation failure', async () => { + // Mock generateObject to throw an error + vi.mocked(generateObject).mockRejectedValueOnce( + new Error('Failed to generate params') + ); + + await attpsPriceQuery.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: expect.stringContaining('Failed to generate price query params') + }); + }); + + it('should handle API error response', async () => { + // Mock generateObject to return price query params + vi.mocked(generateObject).mockResolvedValueOnce({ + object: mockPriceQuery + }); + + // Mock API error response + mockFetch.mockResolvedValueOnce({ + json: () => Promise.resolve({ + code: 1, + message: 'API Error' + }) + }); + + await attpsPriceQuery.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Error fetching price data, error: API Error' + }); + }); + + it('should handle network failure', async () => { + // Mock generateObject to return price query params + vi.mocked(generateObject).mockResolvedValueOnce({ + object: mockPriceQuery + }); + + // Mock network failure + mockFetch.mockRejectedValueOnce(new Error('Network error')); + + await attpsPriceQuery.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Error fetching price data, error: Network error' + }); + }); + }); + + describe('metadata', () => { + it('should have correct name and description', () => { + expect(attpsPriceQuery.name).toBe('ATTPS_PRICE_QUERY'); + expect(attpsPriceQuery.description).toContain('Call remote API to fetch price data'); + }); + + it('should have valid examples', () => { + expect(Array.isArray(attpsPriceQuery.examples)).toBe(true); + expect(attpsPriceQuery.examples.length).toBeGreaterThan(0); + + attpsPriceQuery.examples.forEach(example => { + expect(Array.isArray(example)).toBe(true); + expect(example.length).toBe(2); + expect(example[1].content.action).toBe('ATTPS_PRICE_QUERY'); + }); + }); + }); +}); diff --git a/packages/plugin-apro/__tests__/actions/createAndRegisterAgent.test.ts b/packages/plugin-apro/__tests__/actions/createAndRegisterAgent.test.ts new file mode 100644 index 00000000000..1dcaf85e7dd --- /dev/null +++ b/packages/plugin-apro/__tests__/actions/createAndRegisterAgent.test.ts @@ -0,0 +1,155 @@ +// Mock declarations must come first +vi.mock('@elizaos/core'); +vi.mock('ai-agent-sdk-js', () => { + const mockCreateAndRegisterAgent = vi.fn(); + return { + AgentSDK: vi.fn().mockImplementation(() => ({ + createAndRegisterAgent: mockCreateAndRegisterAgent + })), + parseNewAgentAddress: vi.fn().mockReturnValue('test-agent-address') + }; +}); +vi.mock('../../src/types', () => ({ + isAgentSettings: vi.fn().mockReturnValue(true), + AgentSettingsSchema: {} +})); + +import { vi, describe, it, expect, beforeEach } from 'vitest'; +import type { IAgentRuntime, Memory, State } from '@elizaos/core'; +import { generateObject } from '@elizaos/core'; +import { createAndRegisterAgent } from '../../src/actions/createAndRegisterAgent'; +import { AgentSDK } from 'ai-agent-sdk-js'; + +describe('createAndRegisterAgent', () => { + const mockRuntime: IAgentRuntime = { + composeState: vi.fn(), + updateRecentMessageState: vi.fn(), + getSetting: vi.fn() + } as unknown as IAgentRuntime; + + const mockMessage: Memory = { + userId: 'test-user', + agentId: 'test-agent', + roomId: 'test-room', + content: { + text: 'create agent' + } + } as Memory; + + const mockState: State = {}; + const mockCallback = vi.fn(); + const mockTx = { + hash: 'test-hash', + wait: vi.fn().mockResolvedValue({ hash: 'test-hash' }) + }; + const mockAgentSettings = { + name: 'test-agent', + description: 'test description', + settings: { + key: 'value' + } + }; + + beforeEach(() => { + vi.clearAllMocks(); + vi.mocked(mockRuntime.composeState).mockResolvedValue(mockState); + vi.mocked(mockRuntime.updateRecentMessageState).mockResolvedValue(mockState); + }); + + describe('validate', () => { + it('should always return true', async () => { + const result = await createAndRegisterAgent.validate(mockRuntime, mockMessage); + expect(result).toBe(true); + }); + }); + + describe('handler', () => { + it('should successfully create and register agent', async () => { + // Mock generateObject to return agent settings + vi.mocked(generateObject).mockResolvedValueOnce({ + object: mockAgentSettings + }); + + // Mock successful registration + const mockAgent = { + createAndRegisterAgent: vi.fn().mockResolvedValue(mockTx) + }; + vi.mocked(AgentSDK).mockImplementation(() => mockAgent); + + await createAndRegisterAgent.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Agent created and registered successfully: test-agent-address' + }); + expect(mockAgent.createAndRegisterAgent).toHaveBeenCalledWith({agentSettings: mockAgentSettings}); + }); + + it('should handle agent settings generation failure', async () => { + // Mock generateObject to throw an error + vi.mocked(generateObject).mockRejectedValueOnce( + new Error('Failed to generate settings') + ); + + await createAndRegisterAgent.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Failed to generate Agent settings. Please provide valid input.' + }); + }); + + it('should handle registration failure', async () => { + // Mock generateObject to return agent settings + vi.mocked(generateObject).mockResolvedValueOnce({ + object: mockAgentSettings + }); + + // Mock registration failure + const mockAgent = { + createAndRegisterAgent: vi.fn().mockRejectedValue(new Error('Registration failed')) + }; + vi.mocked(AgentSDK).mockImplementation(() => mockAgent); + + await createAndRegisterAgent.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Error creating agent: Registration failed' + }); + }); + }); + + describe('metadata', () => { + it('should have correct name and description', () => { + expect(createAndRegisterAgent.name).toBe('CREATE_AND_REGISTER_AGENT'); + expect(createAndRegisterAgent.description).toContain('Create and register an agent with APRO'); + }); + + it('should have valid examples', () => { + expect(Array.isArray(createAndRegisterAgent.examples)).toBe(true); + expect(createAndRegisterAgent.examples.length).toBeGreaterThan(0); + + createAndRegisterAgent.examples.forEach(example => { + expect(Array.isArray(example)).toBe(true); + expect(example.length).toBe(2); + expect(example[1].content.action).toBe('CREATE_AND_REGISTER_AGENT'); + }); + }); + }); +}); diff --git a/packages/plugin-apro/__tests__/actions/verifyData.test.ts b/packages/plugin-apro/__tests__/actions/verifyData.test.ts new file mode 100644 index 00000000000..b8dd65c7085 --- /dev/null +++ b/packages/plugin-apro/__tests__/actions/verifyData.test.ts @@ -0,0 +1,169 @@ +// Mock declarations must come first +vi.mock('@elizaos/core', () => ({ + Action: class {}, + composeContext: vi.fn(), + elizaLogger: { + info: vi.fn(), + error: vi.fn() + }, + generateObject: vi.fn(), + ModelClass: { + LARGE: 'LARGE' + } +})); + +vi.mock('ai-agent-sdk-js', () => { + const mockVerify = vi.fn(); + return { + AgentSDK: vi.fn().mockImplementation(() => ({ + verify: mockVerify + })) + }; +}); + +import { vi, describe, it, expect, beforeEach } from 'vitest'; +import type { IAgentRuntime, Memory, State } from '@elizaos/core'; +import { generateObject } from '@elizaos/core'; +import { verifyData } from '../../src/actions/verifyData'; +import { AgentSDK } from 'ai-agent-sdk-js'; + +describe('verifyData', () => { + const mockRuntime: IAgentRuntime = { + composeState: vi.fn(), + updateRecentMessageState: vi.fn(), + getSetting: vi.fn() + } as unknown as IAgentRuntime; + + const mockMessage: Memory = { + userId: 'test-user', + agentId: 'test-agent', + roomId: 'test-room', + content: { + text: 'verify data' + } + } as Memory; + + const mockState: State = {}; + const mockCallback = vi.fn(); + const mockVerify = vi.fn(); + + beforeEach(() => { + vi.clearAllMocks(); + vi.mocked(mockRuntime.composeState).mockResolvedValue(mockState); + vi.mocked(mockRuntime.updateRecentMessageState).mockResolvedValue(mockState); + }); + + describe('validate', () => { + it('should always return true', async () => { + const result = await verifyData.validate(mockRuntime, mockMessage); + expect(result).toBe(true); + }); + }); + + describe('handler', () => { + const mockVerifyParams = { + agent: 'test-agent', + digest: 'test-digest', + payload: { + data: 'test-data', + dataHash: 'test-hash', + signatures: [{ + r: 'test-r', + s: 'test-s', + v: 27 + }] + } + }; + + it('should successfully verify data', async () => { + // Mock generateObject to return verify params + vi.mocked(generateObject).mockResolvedValueOnce({ + object: mockVerifyParams + }); + + const mockTx = { + hash: 'test-hash', + wait: vi.fn().mockResolvedValue({ hash: 'test-hash' }) + }; + + const mockAgent = { + verify: vi.fn().mockResolvedValue(mockTx) + }; + vi.mocked(AgentSDK).mockImplementation(() => mockAgent); + + await verifyData.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Success: Data verified successfully. Transaction ID: test-hash' + }); + expect(mockAgent.verify).toHaveBeenCalledWith(mockVerifyParams); + }); + + it('should handle verify params generation failure', async () => { + // Mock generateObject to throw an error + vi.mocked(generateObject).mockRejectedValueOnce( + new Error('Failed to generate params') + ); + + await verifyData.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Failed to generate verify params. Please provide valid input.' + }); + }); + + it('should handle verification failure', async () => { + // Mock generateObject to return verify params + vi.mocked(generateObject).mockResolvedValueOnce({ + object: mockVerifyParams + }); + + const mockAgent = { + verify: vi.fn().mockRejectedValue(new Error('Verification failed')) + }; + vi.mocked(AgentSDK).mockImplementation(() => mockAgent); + + await verifyData.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(mockCallback).toHaveBeenCalledWith({ + text: 'Error verifying data: Verification failed' + }); + }); + }); + + describe('metadata', () => { + it('should have correct name and description', () => { + expect(verifyData.name).toBe('VERIFY'); + expect(verifyData.description).toContain('Verify data with APRO'); + }); + + it('should have valid examples', () => { + expect(Array.isArray(verifyData.examples)).toBe(true); + expect(verifyData.examples.length).toBeGreaterThan(0); + + verifyData.examples.forEach(example => { + expect(Array.isArray(example)).toBe(true); + expect(example.length).toBe(2); + expect(example[1].content.action).toBe('VERIFY'); + }); + }); + }); +}); diff --git a/packages/plugin-apro/__tests__/index.test.ts b/packages/plugin-apro/__tests__/index.test.ts new file mode 100644 index 00000000000..03f70546f93 --- /dev/null +++ b/packages/plugin-apro/__tests__/index.test.ts @@ -0,0 +1,55 @@ +import { vi, describe, it, expect } from 'vitest'; + +vi.mock('@elizaos/core', () => ({ + Plugin: class {}, + Action: class {}, + composeContext: vi.fn(), + elizaLogger: { + info: vi.fn(), + error: vi.fn() + }, + generateObject: vi.fn(), + ModelClass: { + LARGE: 'LARGE' + } +})); + +vi.mock('ai-agent-sdk-js', () => ({ + AgentSDK: { + createAndRegisterAgent: vi.fn(), + verify: vi.fn() + }, + AgentSettings: class {}, + VerifyParams: class {}, + parseNewAgentAddress: vi.fn() +})); + +import { aproPlugin } from '../src'; + +describe('aproPlugin', () => { + it('should have correct plugin metadata', () => { + expect(aproPlugin.name).toBe('apro'); + expect(aproPlugin.description).toBe('Apro Plugin for Eliza'); + }); + + it('should register all required actions', () => { + expect(aproPlugin.actions).toHaveLength(3); + + const actionNames = aproPlugin.actions.map(action => action.name); + expect(actionNames).toContain('CREATE_AND_REGISTER_AGENT'); + expect(actionNames).toContain('VERIFY'); + expect(actionNames).toContain('ATTPS_PRICE_QUERY'); + }); + + it('should have correct similes for each action', () => { + const createAction = aproPlugin.actions.find(a => a.name === 'CREATE_AND_REGISTER_AGENT'); + expect(createAction?.similes).toContain('CREATE_AGENT'); + expect(createAction?.similes).toContain('REGISTER_AGENT'); + + const verifyAction = aproPlugin.actions.find(a => a.name === 'VERIFY'); + expect(verifyAction?.similes).toContain('VERIFY_DATA'); + + const priceAction = aproPlugin.actions.find(a => a.name === 'ATTPS_PRICE_QUERY'); + expect(priceAction?.similes).toContain('ATTPS_PRICE_FETCH'); + }); +}); diff --git a/packages/plugin-apro/vitest.config.ts b/packages/plugin-apro/vitest.config.ts new file mode 100644 index 00000000000..19d97aa7c6d --- /dev/null +++ b/packages/plugin-apro/vitest.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + }, + resolve: { + alias: [ + { + find: /^@elizaos\/core$/, + replacement: '../core/src/index.ts' + }, + { + find: /^ai-agent-sdk-js$/, + replacement: '../node_modules/ai-agent-sdk-js/src/index.ts' + } + ] + } +}); diff --git a/packages/plugin-aptos/package.json b/packages/plugin-aptos/package.json index 3fb5a0c8d16..34eb22470aa 100644 --- a/packages/plugin-aptos/package.json +++ b/packages/plugin-aptos/package.json @@ -1,38 +1,38 @@ { - "name": "@elizaos/plugin-aptos", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@aptos-labs/ts-sdk": "^1.26.0", - "bignumber.js": "9.1.2", - "node-cache": "5.1.2", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-aptos", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@aptos-labs/ts-sdk": "^1.26.0", + "@elizaos/core": "workspace:*", + "bignumber.js": "9.1.2", + "node-cache": "5.1.2", + "tsup": "8.3.5", + "vitest": "2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-arbitrage/__tests__/actions/arbitrageAction.test.ts b/packages/plugin-arbitrage/__tests__/actions/arbitrageAction.test.ts new file mode 100644 index 00000000000..9de78c32895 --- /dev/null +++ b/packages/plugin-arbitrage/__tests__/actions/arbitrageAction.test.ts @@ -0,0 +1,110 @@ +import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { executeArbitrageAction } from '../../src/actions/arbitrageAction'; +import { ServiceType } from '@elizaos/core'; +import { ArbitrageService } from '../../src/services/ArbitrageService'; + +describe('executeArbitrageAction', () => { + const mockRuntime = { + getSetting: vi.fn(), + getService: vi.fn() + }; + + const mockMessage = { + userId: 'test-user', + content: { + text: 'Execute arbitrage' + } + }; + + const mockArbitrageService = { + evaluateMarkets: vi.fn(), + executeArbitrage: vi.fn() + }; + + beforeEach(() => { + vi.clearAllMocks(); + mockRuntime.getService.mockReturnValue(mockArbitrageService); + }); + + describe('metadata', () => { + it('should have correct name and description', () => { + expect(executeArbitrageAction.name).toBe('EXECUTE_ARBITRAGE'); + expect(executeArbitrageAction.description).toContain('Execute arbitrage trades'); + }); + + it('should have valid examples', () => { + expect(Array.isArray(executeArbitrageAction.examples)).toBe(true); + executeArbitrageAction.examples.forEach(example => { + expect(Array.isArray(example)).toBe(true); + expect(example.length).toBe(2); + expect(example[1].content.action).toBe('EXECUTE_ARBITRAGE'); + }); + }); + }); + + describe('validation', () => { + it('should validate required settings', async () => { + mockRuntime.getSetting.mockReturnValue('test-key'); + const isValid = await executeArbitrageAction.validate(mockRuntime, mockMessage); + expect(isValid).toBe(true); + }); + + it('should fail validation when settings are missing', async () => { + mockRuntime.getSetting.mockReturnValue(undefined); + const isValid = await executeArbitrageAction.validate(mockRuntime, mockMessage); + expect(isValid).toBe(false); + }); + }); + + describe('handler', () => { + it('should execute arbitrage when opportunities exist', async () => { + const mockOpportunities = [ + { + buyFromMarket: { id: 'market1' }, + sellToMarket: { id: 'market2' }, + profit: '100' + } + ]; + + mockArbitrageService.evaluateMarkets.mockResolvedValue(mockOpportunities); + mockArbitrageService.executeArbitrage.mockResolvedValue(true); + + const result = await executeArbitrageAction.handler(mockRuntime, mockMessage); + expect(result).toBe(true); + expect(mockArbitrageService.evaluateMarkets).toHaveBeenCalled(); + expect(mockArbitrageService.executeArbitrage).toHaveBeenCalledWith(mockOpportunities); + }); + + it('should handle case when no opportunities exist', async () => { + mockArbitrageService.evaluateMarkets.mockResolvedValue([]); + + const result = await executeArbitrageAction.handler(mockRuntime, mockMessage); + expect(result).toBe(true); + expect(mockArbitrageService.evaluateMarkets).toHaveBeenCalled(); + expect(mockArbitrageService.executeArbitrage).not.toHaveBeenCalled(); + }); + + it('should handle evaluation errors', async () => { + mockArbitrageService.evaluateMarkets.mockRejectedValue(new Error('Evaluation failed')); + + await expect(executeArbitrageAction.handler(mockRuntime, mockMessage)) + .rejects.toThrow('Evaluation failed'); + }); + + it('should handle execution errors', async () => { + const mockOpportunities = [ + { + buyFromMarket: { id: 'market1' }, + sellToMarket: { id: 'market2' }, + profit: '100' + } + ]; + + mockArbitrageService.evaluateMarkets.mockResolvedValue(mockOpportunities); + mockArbitrageService.executeArbitrage.mockRejectedValue(new Error('Execution failed')); + + await expect(executeArbitrageAction.handler(mockRuntime, mockMessage)) + .rejects.toThrow('Execution failed'); + }); + }); +}); diff --git a/packages/plugin-arbitrage/__tests__/core/Arbitrage.test.ts b/packages/plugin-arbitrage/__tests__/core/Arbitrage.test.ts new file mode 100644 index 00000000000..783a0919cc7 --- /dev/null +++ b/packages/plugin-arbitrage/__tests__/core/Arbitrage.test.ts @@ -0,0 +1,81 @@ +import { describe, it, expect, vi } from 'vitest'; +import { Arbitrage } from '../../src/core/Arbitrage'; +import { BigNumber } from '@ethersproject/bignumber'; +import { TestMarket } from '../utils/TestMarket'; +import { CrossedMarketDetails } from '../../src/type'; + +describe('Arbitrage', () => { + let arbitrage: Arbitrage; + let mockProvider: any; + let mockWallet: any; + + beforeEach(() => { + mockProvider = { + getGasPrice: vi.fn().mockResolvedValue(BigNumber.from('50000000000')), + getBlock: vi.fn().mockResolvedValue({ number: 1 }) + }; + + mockWallet = { + provider: mockProvider, + address: '0xmockaddress' + }; + + arbitrage = new Arbitrage(mockWallet, mockProvider); + }); + + describe('market evaluation', () => { + it('should filter out markets with insufficient liquidity', async () => { + const mockMarkets = { + '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2': [ + new TestMarket('0xmarket1', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'), + new TestMarket('0xmarket2', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2') + ] + }; + + // Mock insufficient liquidity + vi.spyOn(mockMarkets['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'][0], 'getReserves').mockResolvedValue(BigNumber.from('100')); + vi.spyOn(mockMarkets['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'][1], 'getReserves').mockResolvedValue(BigNumber.from('100')); + + const opportunities = await arbitrage.evaluateMarkets(mockMarkets); + expect(opportunities.length).toBe(0); + }); + }); + + describe('bundle execution', () => { + it('should handle simulation success', async () => { + const mockMarket = new TestMarket('0xmarket1', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'); + const mockOpportunities: CrossedMarketDetails[] = [{ + marketPairs: [{ + buyFromMarket: mockMarket, + sellToMarket: mockMarket + }], + profit: BigNumber.from('1000000'), + volume: BigNumber.from('1000000'), + tokenAddress: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + buyFromMarket: mockMarket, + sellToMarket: mockMarket + }]; + + await expect(arbitrage.takeCrossedMarkets(mockOpportunities, 1, 1)).resolves.not.toThrow(); + }); + + it('should handle simulation failure', async () => { + const mockMarket = new TestMarket('0xmarket1', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'); + vi.spyOn(mockMarket, 'sellTokensToNextMarket').mockRejectedValue(new Error('Simulation failed')); + + const mockOpportunities: CrossedMarketDetails[] = [{ + marketPairs: [{ + buyFromMarket: mockMarket, + sellToMarket: mockMarket + }], + profit: BigNumber.from('1000000'), + volume: BigNumber.from('1000000'), + tokenAddress: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', + buyFromMarket: mockMarket, + sellToMarket: mockMarket + }]; + + await expect(arbitrage.takeCrossedMarkets(mockOpportunities, 1, 1)).resolves.not.toThrow(); + }); + }); +}); diff --git a/packages/plugin-arbitrage/__tests__/index.test.ts b/packages/plugin-arbitrage/__tests__/index.test.ts new file mode 100644 index 00000000000..a77cccb9f72 --- /dev/null +++ b/packages/plugin-arbitrage/__tests__/index.test.ts @@ -0,0 +1,25 @@ +import { describe, it, expect } from 'vitest'; +import arbitragePlugin from '../src/index'; +import { executeArbitrageAction } from '../src/actions/arbitrageAction'; +import { marketProvider } from '../src/providers/marketProvider'; +import { ArbitrageService } from '../src/services/ArbitrageService'; + +describe('arbitragePlugin', () => { + it('should have correct name and description', () => { + expect(arbitragePlugin.name).toBe('arbitrage-plugin'); + expect(arbitragePlugin.description).toBe('Automated arbitrage trading plugin'); + }); + + it('should register the correct action', () => { + expect(arbitragePlugin.actions).toContain(executeArbitrageAction); + }); + + it('should register the correct provider', () => { + expect(arbitragePlugin.providers).toContain(marketProvider); + }); + + it('should register the arbitrage service', () => { + expect(arbitragePlugin.services.length).toBe(1); + expect(arbitragePlugin.services[0]).toBeInstanceOf(ArbitrageService); + }); +}); diff --git a/packages/plugin-arbitrage/__tests__/services/ArbitrageService.test.ts b/packages/plugin-arbitrage/__tests__/services/ArbitrageService.test.ts new file mode 100644 index 00000000000..256cbbbe624 --- /dev/null +++ b/packages/plugin-arbitrage/__tests__/services/ArbitrageService.test.ts @@ -0,0 +1,48 @@ +import { describe, it, expect, vi } from 'vitest'; +import { ArbitrageService } from '../../src/services/ArbitrageService'; +import { ServiceType, IAgentRuntime } from '@elizaos/core'; + +describe('ArbitrageService', () => { + let arbitrageService: ArbitrageService; + let mockRuntime: IAgentRuntime; + + beforeEach(() => { + mockRuntime = { + getSetting: vi.fn((key: string) => { + switch (key) { + case 'ARBITRAGE_ETHEREUM_WS_URL': + return 'ws://test.com'; + case 'ARBITRAGE_EVM_PROVIDER_URL': + return 'http://test.com'; + case 'ARBITRAGE_EVM_PRIVATE_KEY': + return '0x1234567890123456789012345678901234567890123456789012345678901234'; + case 'FLASHBOTS_RELAY_SIGNING_KEY': + return '0x1234567890123456789012345678901234567890123456789012345678901234'; + default: + return undefined; + } + }), + getLogger: vi.fn().mockReturnValue({ + log: vi.fn(), + error: vi.fn(), + warn: vi.fn() + }), + getBlocksApi: vi.fn().mockReturnValue({ + getRecentBlocks: vi.fn().mockResolvedValue([]) + }) + } as unknown as IAgentRuntime; + + arbitrageService = new ArbitrageService(); + }); + + describe('basic functionality', () => { + it('should have correct service type', () => { + expect(arbitrageService.serviceType).toBe(ServiceType.ARBITRAGE); + }); + + it('should throw error if required settings are missing', async () => { + mockRuntime.getSetting = vi.fn().mockReturnValue(undefined); + await expect(arbitrageService.initialize(mockRuntime)).rejects.toThrow(); + }); + }); +}); diff --git a/packages/plugin-arbitrage/__tests__/setup.ts b/packages/plugin-arbitrage/__tests__/setup.ts new file mode 100644 index 00000000000..3efccda5cc2 --- /dev/null +++ b/packages/plugin-arbitrage/__tests__/setup.ts @@ -0,0 +1,49 @@ +import { vi } from 'vitest'; +import { WebSocket } from 'ws'; +import { FlashbotsBundleProvider } from '@flashbots/ethers-provider-bundle'; + +// Mock WebSocket +vi.mock('ws', () => ({ + WebSocket: vi.fn().mockImplementation(() => ({ + on: vi.fn(), + close: vi.fn(), + send: vi.fn() + })) +})); + +// Mock ethers providers +vi.mock('@ethersproject/providers', () => ({ + WebSocketProvider: vi.fn().mockImplementation(() => ({ + on: vi.fn(), + getGasPrice: vi.fn().mockResolvedValue('1000000000'), + getBlock: vi.fn().mockResolvedValue({ number: 1 }) + })) +})); + +// Mock Flashbots provider +vi.mock('@flashbots/ethers-provider-bundle', () => ({ + FlashbotsBundleProvider: { + create: vi.fn().mockResolvedValue({ + sendBundle: vi.fn().mockResolvedValue({ + wait: vi.fn().mockResolvedValue(true) + }), + simulate: vi.fn().mockResolvedValue({ + success: true, + profit: '1000000000000000' + }) + }) + } +})); + +// Mock @elizaos/core +vi.mock('@elizaos/core', () => ({ + Service: class {}, + ServiceType: { + ARBITRAGE: 'arbitrage' + }, + elizaLogger: { + info: vi.fn(), + error: vi.fn(), + log: vi.fn() + } +})); diff --git a/packages/plugin-arbitrage/__tests__/utils/TestMarket.ts b/packages/plugin-arbitrage/__tests__/utils/TestMarket.ts new file mode 100644 index 00000000000..28f6b06abd2 --- /dev/null +++ b/packages/plugin-arbitrage/__tests__/utils/TestMarket.ts @@ -0,0 +1,31 @@ +import { EthMarket } from '../../src/core/EthMarket'; +import { BigNumber } from '@ethersproject/bignumber'; + +export class TestMarket extends EthMarket { + constructor(address: string, tokenAddress: string) { + super(address, tokenAddress, [tokenAddress], {}); + } + + receiveDirectly(tokenAddress: string): boolean { + return true; + } + + async getReserves(tokenAddress: string): Promise { + return BigNumber.from('1000000'); + } + + async getTokensOut(tokenIn: string, tokenOut: string, amountIn: BigNumber): Promise { + return amountIn.mul(95).div(100); // 5% slippage + } + + async sellTokens(tokenAddress: string, volume: BigNumber, recipient: string): Promise { + return '0xmocktx'; + } + + async sellTokensToNextMarket(tokenAddress: string, volume: BigNumber, nextMarket: EthMarket): Promise<{ targets: string[], data: string[] }> { + return { + targets: ['0xmocktarget'], + data: ['0xmockdata'] + }; + } +} diff --git a/packages/plugin-arbitrage/package.json b/packages/plugin-arbitrage/package.json index 98377ab9f8c..a4b9b041619 100644 --- a/packages/plugin-arbitrage/package.json +++ b/packages/plugin-arbitrage/package.json @@ -15,7 +15,10 @@ "scripts": { "clean": "rm -rf dist", "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest", + "test:coverage": "vitest run --coverage" }, "dependencies": { "@elizaos/adapter-sqlite": "^0.1.8", @@ -41,7 +44,9 @@ "rimraf": "^5.0.5", "typescript": "^5.7.3", "@types/dotenv": "^8.2.0", - "tsup": "^8.0.2" + "tsup": "^8.0.2", + "vitest": "^2.1.4", + "@vitest/coverage-v8": "^2.1.4" }, "peerDependencies": { "@elizaos/core": "workspace:*" diff --git a/packages/plugin-arbitrage/src/core/Arbitrage.ts b/packages/plugin-arbitrage/src/core/Arbitrage.ts index c8f2c40804f..94e205e8bc0 100644 --- a/packages/plugin-arbitrage/src/core/Arbitrage.ts +++ b/packages/plugin-arbitrage/src/core/Arbitrage.ts @@ -1,380 +1,553 @@ -import * as _ from "lodash"; import { BigNumber } from "@ethersproject/bignumber"; import { Contract } from "@ethersproject/contracts"; +import { Provider, TransactionResponse } from "@ethersproject/providers"; import { Wallet } from "@ethersproject/wallet"; -import { Provider } from "@ethersproject/providers"; import { FlashbotsBundleProvider } from "@flashbots/ethers-provider-bundle"; -// import { WETH_ADDRESS } from "././addresses"; -import { EthMarket } from "././EthMarket"; -// import { ETHER, bigNumberToDecimal } from "./utils"; -import { EthMarket as EthMarketType, CrossedMarketDetails, MarketsByToken, MarketType, BuyCalls } from "././types"; -// import { TransactionResponse } from "@ethersproject/providers"; -// import { DEFAULT_THRESHOLDS, MarketThresholds } from '../config/thresholds'; -// import { MarketsByToken as ImportedMarketsByToken, CrossedMarketDetails as ImportedCrossedMarketDetails } from "../type"; -export { MarketsByToken, EthMarket, CrossedMarketDetails } from '././types'; +import { DEFAULT_THRESHOLDS, MarketThresholds } from '../config/thresholds'; +import { WETH_ADDRESS } from "./addresses"; +import { EthMarket } from "./EthMarket"; +import { CrossedMarketDetails, MarketsByToken, MarketType } from "./types"; +import { ETHER } from "./utils"; +import { elizaLogger } from "@elizaos/core"; export interface BundleEntry { - to: string, - gas: number, - gas_price: string, - value: number, - input: string, - from: string, - signedTransaction: string, - signer: string, + to: string; + gas: number; + gas_price: string; + value: number; + input: string; + from: string; + signedTransaction: string; + signer: string; } -interface ArbitrageTransaction { - hash: string; - wait: () => Promise<{ blockNumber: number }>; -} +export class Arbitrage { + private bundleEntries: { bundle: BundleEntry[], blockNumber: number }[] = []; + private thresholds: MarketThresholds = DEFAULT_THRESHOLDS; + private MAX_RETRIES = 3; + private RETRY_DELAY = 1000; // 1 second + + constructor( + private wallet: Wallet, + private flashbotsProvider: FlashbotsBundleProvider, + private bundleExecutorContract: Contract + ) {} + + async evaluateMarkets(marketsByToken: MarketsByToken): Promise { + elizaLogger.log("Starting market evaluation..."); + const opportunities: CrossedMarketDetails[] = []; + + for (const [tokenAddress, markets] of Object.entries(marketsByToken)) { + // Filter out markets with insufficient liquidity + const validMarkets = await this.filterValidMarkets(markets, tokenAddress); + + // Compare each market pair for arbitrage opportunities + for (let i = 0; i < validMarkets.length; i++) { + for (let j = i + 1; j < validMarkets.length; j++) { + const opportunity = await this.checkArbitrageOpportunity( + validMarkets[i], + validMarkets[j], + tokenAddress + ); + if (opportunity) { + opportunities.push(opportunity); + } + } + } + } -const CFMM = { - reserves: { - x: BigNumber.from(0), - y: BigNumber.from(0), - }, - getOutputAmount: (inputAmount: BigNumber, inputReserve: BigNumber, outputReserve: BigNumber) => { - const inputAmountWithFee = inputAmount.mul(997); - const numerator = inputAmountWithFee.mul(outputReserve); - const denominator = inputReserve.mul(1000).add(inputAmountWithFee); - return numerator.div(denominator); - }, - tradingFee: BigNumber.from("3000"), -}; - -const acceptTrade = (R: BigNumber, deltaPlus: number, deltaMinus: number) => { - const tradingFunctionResult = CFMM.getOutputAmount(R.sub(CFMM.tradingFee.mul(deltaMinus)).sub(deltaPlus), CFMM.reserves.x, CFMM.reserves.y); - const tradingFunctionResult2 = CFMM.getOutputAmount(R, CFMM.reserves.x, CFMM.reserves.y); - console.log(`acceptTrade: tradingFunctionResult = ${tradingFunctionResult}, tradingFunctionResult2 = ${tradingFunctionResult2}`); - return tradingFunctionResult.gte(tradingFunctionResult2) && R.sub(CFMM.tradingFee.mul(deltaMinus)).sub(deltaPlus).gte(0); -}; - - -export const dualDecomposition = (referencePrices: string | any[], objectiveFunction: (arg0: any) => any, penaltyVector: number[]) => { - console.log("Entering dualDecomposition"); - const T = []; - for (let i = 0; i < referencePrices.length; i++) { - let deltaPlus = referencePrices[i].cumulativePrice; - let deltaMinus = Math.min(referencePrices[i].cumulativePrice, 0); - console.log(`dualDecomposition: iteration ${i}, deltaPlus = ${deltaPlus}, deltaMinus = ${deltaMinus}`); - if (acceptTrade(CFMM.reserves.x, deltaPlus, deltaMinus)) { - T.push([deltaPlus, deltaMinus]); + // Sort opportunities by profit + return opportunities.sort((a, b) => b.profit.sub(a.profit).toNumber()); } - } - let nu = 0; - for (let i = 0; i < T.length; i++) { - let objectiveFunctionResult = objectiveFunction(T[i][0]); - let penaltyResult = penaltyVector[i] * nu; - console.log(`dualDecomposition: iteration ${i}, objectiveFunctionResult = ${objectiveFunctionResult}, penaltyResult = ${penaltyResult}`); - nu = Math.max(nu, (objectiveFunctionResult - penaltyResult)); - } - console.log(`dualDecomposition: final nu = ${nu}`); - return nu; -}; -export async function calculateOptimalVolume( - buyFromMarket: MarketType, - sellToMarket: MarketType, - tokenAddress: string, - profit: number -): Promise { - console.log("Entering calculateOptimalVolume"); - - // Determine the available liquidity in both markets involved in the arbitrage - const availableLiquidityBuy = await buyFromMarket.getReserves(tokenAddress); - const availableLiquiditySell = await sellToMarket.getReserves(tokenAddress); - - // Set a maximum trade size limit to manage risk - const maxTradeSize = BigNumber.from(100000); // Adjust as needed - - // Minimum profit threshold - const minProfitThreshold = BigNumber.from(1); // Adjust as needed - - // Calculate price impacts and trading fees - const priceImpactBuy = await buyFromMarket.getPriceImpact(tokenAddress, maxTradeSize); - const priceImpactSell = await sellToMarket.getPriceImpact(tokenAddress, maxTradeSize); - - const tradingFeeBuy = await buyFromMarket.getTradingFee(tokenAddress); - const tradingFeeSell = await sellToMarket.getTradingFee(tokenAddress); - - // Binary Search Initialization - let left = BigNumber.from(1); - let right = maxTradeSize; - let optimalVolume = BigNumber.from(0); - let maxExpectedProfit = BigNumber.from(0); - - while (left.lt(right)) { - const mid = left.add(right).div(2); - - // Calculate expected profit at mid - const expectedProfit = BigNumber.from(profit) - .mul(mid) - .sub(priceImpactBuy.mul(mid)) - .sub(priceImpactSell.mul(mid)) - .sub(tradingFeeBuy.mul(mid)) - .sub(tradingFeeSell.mul(mid)); - - if (expectedProfit.gt(maxExpectedProfit) && expectedProfit.gte(minProfitThreshold)) { - maxExpectedProfit = expectedProfit; - optimalVolume = mid; - left = mid.add(1); - } else { - right = mid.sub(1); + private async filterValidMarkets(markets: EthMarket[], tokenAddress: string): Promise { + const validMarkets: EthMarket[] = []; + for (const market of markets) { + try { + const reserves = await market.getReserves(tokenAddress); + if (reserves.gt(this.thresholds.minProfitThreshold)) { + validMarkets.push(market); + } + } catch (error) { + console.error(`Error checking market ${market.marketAddress}:`, error); + } + } + return validMarkets; } - } - - // Ensure that the optimal volume does not exceed available liquidity - optimalVolume = BigNumber.from(Math.min( - optimalVolume.toNumber(), - availableLiquidityBuy.toNumber(), - availableLiquiditySell.toNumber() - )); - - console.log(`calculateOptimalVolume: optimalVolume = ${optimalVolume}`); - return optimalVolume; -} -// // Define the bisection search -// // Define the bisection search -// let bisectionSearch = (referencePrices: Array<{cumulativePrice: number, marketCount: number}>, objectiveFunction: (arg0: number) => number, penaltyVector: number[]) => { -// console.log("Entering bisectionSearch"); -// let left = 0; -// let right = referencePrices.length - 1; -// let tolerance = 1e-6; -// let psi; - -// while (right - left > tolerance) { -// let mid = Math.floor((left + right) / 2); -// let midValue = objectiveFunction(mid); -// let penaltyResult = penaltyVector[mid] * mid; - -// if (midValue > penaltyResult) { -// left = mid; -// psi = mid; -// } else { -// right = mid; -// } -// } -// console.log(`bisectionSearch: final psi = ${psi}`); - -// return psi; -// }; - -// let swapMarketArbitrage = (referencePrices: Array<{cumulativePrice: number, marketCount: number}> = [], objectiveFunction: (price: number) => number, penaltyVector: number[]) => { -// // Initialize the dual variable ν -// console.log("Entering swapMarketArbitrage"); - -// let nu = 0; - -// // Use bisection or ternary search to solve for the vector Ψ -// // Assuming that bisectionSearch accepts a number, not an array -// let psi = bisectionSearch(referencePrices, objectiveFunction, penaltyVector); - -// // Iterate through the ∆i with i = 1, . . . , m -// for (let i = 0; i < referencePrices.length; i++) { -// // Compute the objective function U(Ψ) -// // Ensure psi is used correctly as an index -// if (psi !== undefined && psi >= 0 && psi < referencePrices.length) { -// const objectiveFunctionResult = objectiveFunction(referencePrices[psi].cumulativePrice); - -// // Compute the linear penalty in the objective -// let penaltyResult = penaltyVector[i] * nu; - -// // Update the dual variable ν -// nu = Math.max(nu, (objectiveFunctionResult - penaltyResult)); -// } -// } -// // Return the dual variable ν -// console.log(`swapMarketArbitrage: final nu = ${nu}`); -// return nu; -// }; - -export async function getGasPriceInfo(provider: Provider): Promise<{ currentGasPrice: BigNumber, avgGasPrice: BigNumber }> { - console.log("Entering getGasPriceInfo"); - const latestBlock = await provider.getBlock("latest"); - if (!latestBlock) { - throw new Error("Failed to get latest block"); - } - const blockNumber = latestBlock.number; - const blockGasPrices: BigNumber[] = []; - - for (let i = 0; i < 10; i++) { - const block = await provider.getBlock(blockNumber - i); - if (!block) { - console.warn(`Failed to get block ${blockNumber - i}`); - continue; - } - const transactions = block.transactions; - let totalGasPriceInBlock = BigNumber.from(0); - let transactionCountInBlock = 0; - for (const txHash of transactions) { - const tx = await provider.getTransaction(txHash); - if (tx?.gasPrice) { - totalGasPriceInBlock = totalGasPriceInBlock.add(tx.gasPrice); - transactionCountInBlock++; + private async checkArbitrageOpportunity( + market1: EthMarket, + market2: EthMarket, + tokenAddress: string + ): Promise { + try { + // Get prices from both markets + const price1 = await market1.getTokensOut(WETH_ADDRESS, tokenAddress, ETHER); + const price2 = await market2.getTokensOut(WETH_ADDRESS, tokenAddress, ETHER); + + // Calculate potential profit + const [buyMarket, sellMarket] = price1.gt(price2) + ? [market2, market1] + : [market1, market2]; + + const profit = price1.gt(price2) + ? price1.sub(price2) + : price2.sub(price1); + + if (profit.gt(this.thresholds.minProfitThreshold)) { + // Calculate optimal trade volume + const volume = await this.calculateOptimalVolume(buyMarket, sellMarket, tokenAddress, profit); + + return { + marketPairs: [{ + buyFromMarket: buyMarket, + sellToMarket: sellMarket + }], + profit, + volume, + tokenAddress, + buyFromMarket: buyMarket, + sellToMarket: sellMarket + }; + } + } catch (error) { + console.error("Error checking arbitrage opportunity:", error); } - } - - const avgGasPriceInBlock = transactionCountInBlock > 0 - ? totalGasPriceInBlock.div(BigNumber.from(transactionCountInBlock)) - : BigNumber.from(0); + return null; + } - blockGasPrices.push(avgGasPriceInBlock); + async takeCrossedMarkets( + markets: CrossedMarketDetails[], + currentBlock: number, + maxAttempts: number + ): Promise { + for (const market of markets) { + for (let attempt = 1; attempt <= maxAttempts; attempt++) { + try { + const transaction = await this.executeArbitrageTrade(market, currentBlock); + if (transaction) { + elizaLogger.log(`Successful arbitrage execution: ${transaction.hash}`); + // Wait for confirmation + await transaction.wait(1); + break; + } + } catch (error) { + console.error(`Attempt ${attempt} failed:`, error); + if (attempt === maxAttempts) { + console.error("Max attempts reached for market", market); + } else { + await new Promise(r => setTimeout(r, this.RETRY_DELAY)); + } + } + } + } } - const currentGasPrice = blockGasPrices[0]; -let totalGasPrice = BigNumber.from(0); -for (let i = 0; i < blockGasPrices.length; i++) { -totalGasPrice = totalGasPrice.add(blockGasPrices[i]); -} -const avgGasPrice = totalGasPrice.div(BigNumber.from(blockGasPrices.length)); -console.log(`getGasPriceInfo: currentGasPrice = ${currentGasPrice}, avgGasPrice = ${avgGasPrice}`); -return { currentGasPrice, avgGasPrice }; -} -export async function ensureHigherEffectiveGasPrice(transactionGasPrice: BigNumber, tailTransactionGasPrice: BigNumber): Promise { - const effectiveGasPrice = transactionGasPrice.gt(tailTransactionGasPrice) ? transactionGasPrice : tailTransactionGasPrice.add(1); - console.log(`ensureHigherEffectiveGasPrice: transactionGasPrice = ${transactionGasPrice}, tailTransactionGasPrice = ${tailTransactionGasPrice}, effectiveGasPrice = ${effectiveGasPrice}`); - return effectiveGasPrice; -} -// async function checkBundleGas(bundleGas: BigNumber): Promise { -// const isValid = bundleGas.gte(42000); -// console.log(`checkBundleGas: bundleGas = ${bundleGas}, isValid = ${isValid}`); -// return isValid; -// } -interface Block { - bundleGasPrice: BigNumber; -} + private async executeArbitrageTrade( + market: CrossedMarketDetails, + blockNumber: number + ): Promise { + // Prepare the trade calls + const buyCalls = await market.buyFromMarket.sellTokensToNextMarket( + WETH_ADDRESS, + market.volume, + market.sellToMarket + ); + + // Calculate intermediate amounts + const intermediateAmount = await market.buyFromMarket.getTokensOut( + WETH_ADDRESS, + market.tokenAddress, + market.volume + ); + + // Prepare sell call + const sellCallData = await market.sellToMarket.sellTokens( + market.tokenAddress, + intermediateAmount, + this.bundleExecutorContract.address + ); + + // Combine all calls + const targets = [...buyCalls.targets, market.sellToMarket.marketAddress]; + const payloads = [...buyCalls.data, sellCallData]; + + // Calculate miner reward (90% of profit) + const minerReward = market.profit.mul(90).div(100); + + // Create and simulate bundle + const bundle = await this.createBundle( + market.volume, + minerReward, + targets, + payloads, + blockNumber + ); + + // Execute if simulation successful + return this.executeBundleWithRetry(bundle, blockNumber); + } -interface BlocksApi { - getRecentBlocks: () => Promise; -} + private async createBundle( + volume: BigNumber, + minerReward: BigNumber, + targets: string[], + payloads: string[], + blockNumber: number + ): Promise { + // Estimate gas + const gasEstimate = await this.estimateGasWithBuffer( + volume, + minerReward, + targets, + payloads + ); + + // Get optimal gas price + const gasPrice = await this.getOptimalGasPrice(blockNumber); + + // Create transaction + const transaction = await this.bundleExecutorContract.populateTransaction.uniswapWeth( + volume, + minerReward, + targets, + payloads, + { gasLimit: gasEstimate, gasPrice } + ); + + // Sign transaction + const signedTx = await this.wallet.signTransaction(transaction); + + // Create bundle entry + const bundleEntry = await this.createBundleEntry(signedTx); + + return [bundleEntry]; + } -export async function monitorCompetingBundlesGasPrices(blocksApi: BlocksApi): Promise> { - console.log("Entering monitorCompetingBundlesGasPrices"); - const recentBlocks = await blocksApi.getRecentBlocks(); - const competingBundlesGasPrices = recentBlocks.map((block: Block) => block.bundleGasPrice); - console.log(`monitorCompetingBundlesGasPrices: competingBundlesGasPrices = ${competingBundlesGasPrices}`); - return competingBundlesGasPrices; -} -export class Arbitrage { - constructor( - private wallet: Wallet, - private flashbotsProvider: FlashbotsBundleProvider, - private bundleExecutorContract: Contract - ) {} - - async evaluateMarkets(_marketsByToken: MarketsByToken): Promise { - // Implement market evaluation logic - return []; + private async estimateGasWithBuffer( + volume: BigNumber, + minerReward: BigNumber, + targets: string[], + payloads: string[] + ): Promise { + const estimate = await this.bundleExecutorContract.estimateGas.uniswapWeth( + volume, + minerReward, + targets, + payloads + ); + return estimate.mul(120).div(100); // Add 20% buffer } - async takeCrossedMarkets(_markets: CrossedMarketDetails[], _currentBlock: number, _maxAttempts: number): Promise { - // Implement arbitrage execution logic + private async getOptimalGasPrice(blockNumber: number): Promise { + const { currentGasPrice, avgGasPrice } = await getGasPriceInfo(this.wallet.provider as Provider); + const basePrice = currentGasPrice.gt(avgGasPrice) ? currentGasPrice : avgGasPrice; + return basePrice.mul(110).div(100); // Add 10% to be competitive } - async getOutputAmount( - dexAddress: string, - tokenIn: string, - tokenOut: string, - amountIn: BigNumber - ): Promise { - // Get the market for this DEX - const market = await this.getMarketForDex(dexAddress); - if (!market) { - throw new Error(`No market found for DEX ${dexAddress}`); + private async executeBundleWithRetry( + bundle: BundleEntry[], + blockNumber: number + ): Promise { + for (let i = 0; i < this.MAX_RETRIES; i++) { + try { + // Simulate first + await this.simulateBundle(bundle, blockNumber); + + // If simulation successful, submit + const response = await this.flashbotsProvider.sendBundle( + bundle.map(entry => ({ + signedTransaction: entry.signedTransaction, + signer: this.wallet, + transaction: { + to: entry.to, + gasLimit: entry.gas, + gasPrice: entry.gas_price, + value: entry.value, + data: entry.input + } + })), + blockNumber + 1 + ); + + if ('error' in response) { + throw new Error(response.error.message); + } + + return response as unknown as TransactionResponse; + } catch (error) { + console.error(`Bundle execution attempt ${i + 1} failed:`, error); + if (i === this.MAX_RETRIES - 1) throw error; + await new Promise(r => setTimeout(r, this.RETRY_DELAY)); + } } - - // Get the output amount using the market's getTokensOut method - return market.getTokensOut(tokenIn, tokenOut, amountIn); + return null; } - async executeArbitrage( - sourceRouter: string, - targetRouter: string, - tokenIn: string, - _tokenOut: string, - amountIn: BigNumber - ): Promise { - // Create the arbitrage transaction - const markets: CrossedMarketDetails[] = [{ - marketPairs: [{ - buyFromMarket: await this.getMarketForDex(sourceRouter) as EthMarket, - sellToMarket: await this.getMarketForDex(targetRouter) as EthMarket - }], - profit: BigNumber.from(0), // This will be calculated during execution - volume: amountIn, - tokenAddress: tokenIn, - buyFromMarket: await this.getMarketForDex(sourceRouter) as EthMarket, - sellToMarket: await this.getMarketForDex(targetRouter) as EthMarket - }]; - - // Execute the arbitrage using takeCrossedMarkets - await this.takeCrossedMarkets(markets, await this.getCurrentBlock(), 1); - - // Return a mock transaction response for now - // In a real implementation, this should return the actual transaction + private async createBundleEntry(signedTx: string): Promise { + const tx = await this.wallet.provider.getTransaction(signedTx); + if (!tx?.to || !tx?.gasPrice || !tx?.value) { + throw new Error("Invalid transaction"); + } + return { - hash: `0x${Math.random().toString(16).slice(2)}`, - wait: async () => ({ blockNumber: await this.getCurrentBlock() }) + to: tx.to, + gas: tx.gasLimit.toNumber(), + gas_price: tx.gasPrice.toString(), + value: tx.value.toNumber(), + input: tx.data, + from: this.wallet.address, + signedTransaction: signedTx, + signer: this.wallet.address }; } - private async getMarketForDex(_dexAddress: string): Promise { - // This should be implemented to return the appropriate market instance - // based on the DEX address - return null; + private async simulateBundle(bundle: BundleEntry[], blockNumber: number): Promise { + const stringBundle = bundle.map(entry => entry.signedTransaction); + const simulation = await this.flashbotsProvider.simulate(stringBundle, blockNumber); + + if ('error' in simulation) { + throw new Error(`Simulation failed: ${simulation.error.message}`); + } + + // Verify profitability + const { bundleGasPrice, coinbaseDiff, totalGasUsed } = simulation; + const cost = bundleGasPrice.mul(totalGasUsed); + const profit = coinbaseDiff.sub(cost); + + if (profit.lte(this.thresholds.minProfitThreshold)) { + throw new Error("Bundle not profitable enough"); + } } - private async getCurrentBlock(): Promise { - const provider = this.wallet.provider; - const block = await provider.getBlock("latest"); - return block.number; + async submitBundleWithAdjustedGasPrice(bundle: BundleEntry[], blockNumber: number, blocksApi: any): Promise { + elizaLogger.log(`Submitting bundle with adjusted gas price for block ${blockNumber}`); + + try { + // Get current gas prices + const { currentGasPrice, avgGasPrice } = await getGasPriceInfo(this.wallet.provider as Provider); + + // Monitor competing bundles + const competingBundlesGasPrices = await monitorCompetingBundlesGasPrices(blocksApi); + let competingBundleGasPrice = BigNumber.from(0); + + // Find highest competing gas price + for (const price of competingBundlesGasPrices) { + const currentPrice = BigNumber.from(price); + if (currentPrice.gt(competingBundleGasPrice)) { + competingBundleGasPrice = currentPrice; + } + } + + // Calculate adjusted gas price + const adjustedGasPrice = await this.adjustGasPriceForTransaction( + currentGasPrice, + avgGasPrice, + competingBundleGasPrice + ); + + // Validate adjusted gas price + if (adjustedGasPrice.lte(currentGasPrice)) { + throw new Error("Adjusted gas price is not competitive"); + } + + // Validate bundle gas + const isValidBundleGas = await checkBundleGas(adjustedGasPrice); + if (!isValidBundleGas) { + throw new Error("Invalid bundle gas"); + } + + // Set submission window + const currentTimestamp = Math.floor(Date.now() / 1000); + const maxTimestamp = currentTimestamp + 60; // 1 minute window + + // Submit bundle + const targetBlockNumber = blockNumber + 1; + const bundleSubmission = await this.flashbotsProvider.sendBundle( + bundle.map(entry => ({ + signedTransaction: entry.signedTransaction, + signer: this.wallet, + transaction: { + to: entry.to, + gasLimit: entry.gas, + gasPrice: entry.gas_price, + value: entry.value, + data: entry.input + } + })), + targetBlockNumber, + { + minTimestamp: currentTimestamp, + maxTimestamp: maxTimestamp + } + ); + + // Check submission result + if ('error' in bundleSubmission) { + throw new Error(`Bundle submission failed: ${bundleSubmission.error.message}`); + } + + elizaLogger.log("Bundle submitted successfully:", { + blockNumber: targetBlockNumber, + adjustedGasPrice: adjustedGasPrice.toString(), + bundleHash: bundleSubmission.bundleHash + }); + + } catch (error) { + console.error("Failed to submit bundle with adjusted gas price:", error); + throw error; + } } - async updatePrices(dexAddress: string): Promise { - const market = await this.getMarketForDex(dexAddress); - if (!market) { - throw new Error(`No market found for DEX ${dexAddress}`); + private async adjustGasPriceForTransaction( + currentGasPrice: BigNumber, + avgGasPrice: BigNumber, + competingBundleGasPrice: BigNumber + ): Promise { + elizaLogger.log("Calculating adjusted gas price", { + current: currentGasPrice.toString(), + average: avgGasPrice.toString(), + competing: competingBundleGasPrice.toString() + }); + + // Find highest gas price + let adjustedGasPrice = currentGasPrice; + if (avgGasPrice.gt(adjustedGasPrice)) { + adjustedGasPrice = avgGasPrice; + } + if (competingBundleGasPrice.gt(adjustedGasPrice)) { + adjustedGasPrice = competingBundleGasPrice; + } + + // Add premium to ensure priority (10% increase) + const premium = adjustedGasPrice.mul(10).div(100); + adjustedGasPrice = adjustedGasPrice.add(premium); + + elizaLogger.log("Adjusted gas price:", adjustedGasPrice.toString()); + return adjustedGasPrice; + } + + private async calculateOptimalVolume( + buyFromMarket: MarketType, + sellToMarket: MarketType, + tokenAddress: string, + profit: BigNumber + ): Promise { + elizaLogger.log("Entering calculateOptimalVolume"); + + // Determine the available liquidity in both markets + const availableLiquidityBuy = await buyFromMarket.getReserves(tokenAddress); + const availableLiquiditySell = await sellToMarket.getReserves(tokenAddress); + + // Set a maximum trade size limit to manage risk + const maxTradeSize = BigNumber.from(100000); // Adjust as needed + + // Calculate price impacts and trading fees + const priceImpactBuy = await buyFromMarket.getPriceImpact(tokenAddress, maxTradeSize); + const priceImpactSell = await sellToMarket.getPriceImpact(tokenAddress, maxTradeSize); + + const tradingFeeBuy = await buyFromMarket.getTradingFee(tokenAddress); + const tradingFeeSell = await sellToMarket.getTradingFee(tokenAddress); + + // Binary Search Initialization + let left = BigNumber.from(1); + let right = maxTradeSize; + let optimalVolume = BigNumber.from(0); + let maxExpectedProfit = BigNumber.from(0); + + while (left.lt(right)) { + const mid = left.add(right).div(2); + + // Calculate expected profit at mid + const expectedProfit = profit + .mul(mid) + .sub(priceImpactBuy.mul(mid)) + .sub(priceImpactSell.mul(mid)) + .sub(tradingFeeBuy.mul(mid)) + .sub(tradingFeeSell.mul(mid)); + + if (expectedProfit.gt(maxExpectedProfit) && expectedProfit.gte(this.thresholds.minProfitThreshold)) { + maxExpectedProfit = expectedProfit; + optimalVolume = mid; + left = mid.add(1); + } else { + right = mid.sub(1); + } } - // Update market prices by fetching latest reserves - await Promise.all(market.tokens.map(token => - market.getReserves(token) + + // Ensure that the optimal volume does not exceed available liquidity + optimalVolume = BigNumber.from(Math.min( + optimalVolume.toNumber(), + availableLiquidityBuy.toNumber(), + availableLiquiditySell.toNumber() )); + + elizaLogger.log(`calculateOptimalVolume: optimalVolume = ${optimalVolume}`); + return optimalVolume; } +} + +// Helper functions +async function checkBundleGas(bundleGas: BigNumber): Promise { + const isValid = bundleGas.gte(42000); + elizaLogger.log(`checkBundleGas: bundleGas = ${bundleGas}, isValid = ${isValid}`); + return isValid; +} + +export async function monitorCompetingBundlesGasPrices(blocksApi: { getRecentBlocks: () => any; }): Promise> { + elizaLogger.log("Entering monitorCompetingBundlesGasPrices"); + const recentBlocks = await blocksApi.getRecentBlocks(); + const competingBundlesGasPrices = recentBlocks.map((block: { bundleGasPrice: any; }) => block.bundleGasPrice); + elizaLogger.log(`monitorCompetingBundlesGasPrices: competingBundlesGasPrices = ${competingBundlesGasPrices}`); + return competingBundlesGasPrices; +} - async getTokenPair(dexAddress: string): Promise<{ token0: string, token1: string } | null> { - const market = await this.getMarketForDex(dexAddress); - if (!market || market.tokens.length < 2) { - return null; +export async function getGasPriceInfo(provider: Provider): Promise<{ + currentGasPrice: BigNumber, + avgGasPrice: BigNumber +}> { + const feeData = await provider.getFeeData(); + const currentGasPrice = feeData.gasPrice || BigNumber.from(0); + + // Get average from last few blocks + const block = await provider.getBlock("latest"); + const prices: BigNumber[] = []; + for (let i = 0; i < 5; i++) { + const historicalBlock = await provider.getBlock(block.number - i); + if (historicalBlock.baseFeePerGas) { + prices.push(historicalBlock.baseFeePerGas); } - return { - token0: market.tokens[0], - token1: market.tokens[1] - }; } + + const avgGasPrice = prices.length > 0 + ? prices.reduce((a, b) => a.add(b)).div(prices.length) + : currentGasPrice; + + return { currentGasPrice, avgGasPrice }; } -// async function fetchWETHBalance(address: string, provider: Provider, retries = 5, delayMs = 500): Promise { -// const WETH_CONTRACT_ADDRESS = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; -// const ABI = [ -// "function balanceOf(address owner) view returns (uint256)" -// ]; -// const contract = new Contract(WETH_CONTRACT_ADDRESS, ABI, provider); - -// for (let attempt = 1; attempt <= retries; attempt++) { -// try { -// const balance: BigNumber = await contract.balanceOf(address); -// return balance; -// } catch (error: any) { -// console.error(`Attempt ${attempt} - Failed to fetch WETH balance for address ${address}:`, error.message); -// if (attempt < retries) { -// await new Promise(res => setTimeout(res, delayMs * attempt)); -// } else { -// console.error(`All ${retries} attempts failed for address ${address}`); -// return null; -// } -// } -// } -// return null; -// } +export async function calculateOptimalVolume( + buyFromMarket: MarketType, + sellToMarket: MarketType, + tokenAddress: string, + profit: BigNumber +): Promise { + const buyLiquidity = await buyFromMarket.getReserves(tokenAddress); + const sellLiquidity = await sellToMarket.getReserves(tokenAddress); + + // Start with 1% of the smaller liquidity pool + let optimalVolume = buyLiquidity.lt(sellLiquidity) + ? buyLiquidity.div(100) + : sellLiquidity.div(100); + + // Adjust based on price impact + const buyImpact = await buyFromMarket.getPriceImpact(tokenAddress, optimalVolume); + const sellImpact = await sellToMarket.getPriceImpact(tokenAddress, optimalVolume); + + // If price impact is too high, reduce volume + if (buyImpact.add(sellImpact).gt(BigNumber.from(300))) { // 3% total impact + optimalVolume = optimalVolume.mul(80).div(100); // Reduce by 20% + } + + return optimalVolume; +} \ No newline at end of file diff --git a/packages/plugin-arbitrage/vitest.config.ts b/packages/plugin-arbitrage/vitest.config.ts new file mode 100644 index 00000000000..45670e50fc1 --- /dev/null +++ b/packages/plugin-arbitrage/vitest.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + environment: 'node', + setupFiles: ['./__tests__/setup.ts'], + include: ['__tests__/**/*.test.ts'], + coverage: { + reporter: ['text', 'json', 'html'], + include: ['src/**/*.ts'], + exclude: ['**/*.d.ts', '**/*.test.ts'] + } + }, + resolve: { + alias: { + '@elizaos/core': '/packages/core/src' + } + } +}); diff --git a/packages/plugin-arthera/package.json b/packages/plugin-arthera/package.json index 0368fff55ee..9e2831e0476 100644 --- a/packages/plugin-arthera/package.json +++ b/packages/plugin-arthera/package.json @@ -1,23 +1,23 @@ { - "name": "@elizaos/plugin-arthera", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5", - "viem": "2.21.58" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "devDependencies": { - "whatwg-url": "7.1.0" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-arthera", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5", + "viem": "2.21.58" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "devDependencies": { + "whatwg-url": "7.1.0" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-asterai/__tests__/actions/query.test.ts b/packages/plugin-asterai/__tests__/actions/query.test.ts new file mode 100644 index 00000000000..bd9745cfa8f --- /dev/null +++ b/packages/plugin-asterai/__tests__/actions/query.test.ts @@ -0,0 +1,110 @@ +const mockQuery = vi.fn(); + +vi.mock('@asterai/client', () => ({ + AsteraiClient: vi.fn(() => ({ + query: mockQuery + })) +})); + +vi.mock('../../src/index', () => ({ + getInitAsteraiClient: vi.fn(() => ({ + query: mockQuery + })) +})); + +import { vi, describe, it, expect, beforeEach } from 'vitest'; +import type { IAgentRuntime, Memory, State } from '@elizaos/core'; +import { queryAction } from '../../src/actions/query'; + +describe('queryAction', () => { + const mockRuntime: IAgentRuntime = { + getSetting: vi.fn(), + } as unknown as IAgentRuntime; + + const mockMessage: Memory = { + userId: 'test-user', + agentId: 'test-agent', + roomId: 'test-room', + content: { + text: 'test query' + } + } as Memory; + + const mockState: State = {}; + const mockCallback = vi.fn(); + + beforeEach(() => { + vi.clearAllMocks(); + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + const settings = { + ASTERAI_AGENT_ID: 'test-agent-id', + ASTERAI_PUBLIC_QUERY_KEY: 'test-query-key' + }; + return settings[key as keyof typeof settings] || null; + }); + }); + + describe('validate', () => { + it('should validate with correct configuration', async () => { + const result = await queryAction.validate(mockRuntime, mockMessage); + expect(result).toBe(true); + }); + + it('should throw error with invalid configuration', async () => { + vi.mocked(mockRuntime.getSetting).mockReturnValue(null); + + await expect(queryAction.validate(mockRuntime, mockMessage)) + .rejects + .toThrow('Asterai plugin configuration validation failed'); + }); + }); + + describe('handler', () => { + it('should handle query and return response', async () => { + mockQuery.mockResolvedValueOnce({ text: () => Promise.resolve('mocked response') }); + + const result = await queryAction.handler( + mockRuntime, + mockMessage, + mockState, + {}, + mockCallback + ); + + expect(result).toBe(true); + expect(mockCallback).toHaveBeenCalledWith({ + text: 'mocked response' + }); + expect(mockQuery).toHaveBeenCalledWith({ + query: 'test query' + }); + }); + + it('should handle query errors gracefully', async () => { + mockQuery.mockRejectedValueOnce(new Error('Query failed')); + + await expect( + queryAction.handler(mockRuntime, mockMessage, mockState, {}, mockCallback) + ).rejects.toThrow('Query failed'); + }); + }); + + describe('metadata', () => { + it('should have correct name and similes', () => { + expect(queryAction.name).toBe('QUERY_ASTERAI_AGENT'); + expect(queryAction.similes).toContain('MESSAGE_ASTERAI_AGENT'); + expect(queryAction.similes).toContain('TALK_TO_ASTERAI_AGENT'); + }); + + it('should have valid examples', () => { + expect(Array.isArray(queryAction.examples)).toBe(true); + expect(queryAction.examples.length).toBeGreaterThan(0); + + queryAction.examples.forEach(example => { + expect(Array.isArray(example)).toBe(true); + expect(example.length).toBe(2); + expect(example[1].content.action).toBe('QUERY_ASTERAI_AGENT'); + }); + }); + }); +}); diff --git a/packages/plugin-asterai/__tests__/environment.test.ts b/packages/plugin-asterai/__tests__/environment.test.ts new file mode 100644 index 00000000000..2ff08992b1d --- /dev/null +++ b/packages/plugin-asterai/__tests__/environment.test.ts @@ -0,0 +1,58 @@ +import { describe, it, expect, vi } from 'vitest'; +import { validateAsteraiConfig } from '../src/environment'; +import type { IAgentRuntime } from '@elizaos/core'; + +describe('environment configuration', () => { + const mockRuntime: IAgentRuntime = { + getSetting: vi.fn(), + } as unknown as IAgentRuntime; + + beforeEach(() => { + vi.clearAllMocks(); + }); + + it('should validate correct configuration', async () => { + vi.mocked(mockRuntime.getSetting) + .mockImplementation((key: string) => { + const settings = { + ASTERAI_AGENT_ID: 'test-agent-id', + ASTERAI_PUBLIC_QUERY_KEY: 'test-query-key' + }; + return settings[key as keyof typeof settings] || null; + }); + + const config = await validateAsteraiConfig(mockRuntime); + expect(config).toEqual({ + ASTERAI_AGENT_ID: 'test-agent-id', + ASTERAI_PUBLIC_QUERY_KEY: 'test-query-key' + }); + }); + + it('should throw error for missing ASTERAI_AGENT_ID', async () => { + vi.mocked(mockRuntime.getSetting) + .mockImplementation((key: string) => { + const settings = { + ASTERAI_PUBLIC_QUERY_KEY: 'test-query-key' + }; + return settings[key as keyof typeof settings] || null; + }); + + await expect(validateAsteraiConfig(mockRuntime)) + .rejects + .toThrow('Asterai plugin configuration validation failed'); + }); + + it('should throw error for missing ASTERAI_PUBLIC_QUERY_KEY', async () => { + vi.mocked(mockRuntime.getSetting) + .mockImplementation((key: string) => { + const settings = { + ASTERAI_AGENT_ID: 'test-agent-id' + }; + return settings[key as keyof typeof settings] || null; + }); + + await expect(validateAsteraiConfig(mockRuntime)) + .rejects + .toThrow('Asterai plugin configuration validation failed'); + }); +}); diff --git a/packages/plugin-asterai/__tests__/providers/asterai.provider.test.ts b/packages/plugin-asterai/__tests__/providers/asterai.provider.test.ts new file mode 100644 index 00000000000..0f307bfaf4a --- /dev/null +++ b/packages/plugin-asterai/__tests__/providers/asterai.provider.test.ts @@ -0,0 +1,97 @@ +const mockFetchSummary = vi.fn(); + +vi.mock('@asterai/client', () => ({ + AsteraiClient: vi.fn(() => ({ + fetchSummary: mockFetchSummary + })) +})); + +vi.mock('../../src/index', () => ({ + getInitAsteraiClient: vi.fn(() => ({ + fetchSummary: mockFetchSummary + })) +})); + +import { vi, describe, it, expect, beforeEach } from 'vitest'; +import type { IAgentRuntime, Memory, State } from '@elizaos/core'; +import { asteraiProvider } from '../../src/providers/asterai.provider'; + +describe('asteraiProvider', () => { + const mockRuntime: IAgentRuntime = { + getSetting: vi.fn(), + knowledgeManager: { + getMemoryById: vi.fn(), + createMemory: vi.fn() + } + } as unknown as IAgentRuntime; + + const mockMessage: Memory = { + userId: 'test-user', + agentId: 'test-agent', + roomId: 'test-room', + content: { + text: 'test message' + } + } as Memory; + + const mockState: State = {}; + + beforeEach(() => { + vi.clearAllMocks(); + vi.mocked(mockRuntime.getSetting).mockImplementation((key: string) => { + const settings = { + ASTERAI_AGENT_ID: 'test-agent-id', + ASTERAI_PUBLIC_QUERY_KEY: 'test-query-key' + }; + return settings[key as keyof typeof settings] || null; + }); + }); + + describe('get', () => { + it('should return null if environment is not configured', async () => { + vi.mocked(mockRuntime.getSetting).mockReturnValue(null); + + const result = await asteraiProvider.get(mockRuntime, mockMessage, mockState); + expect(result).toBeNull(); + }); + + it('should return existing summary from knowledge manager', async () => { + const mockSummary = { + content: { text: 'existing summary' } + }; + vi.mocked(mockRuntime.knowledgeManager.getMemoryById).mockResolvedValue(mockSummary); + + const result = await asteraiProvider.get(mockRuntime, mockMessage, mockState); + expect(result).toBe('existing summary'); + }); + + it('should fetch and store new summary if none exists', async () => { + vi.mocked(mockRuntime.knowledgeManager.getMemoryById) + .mockResolvedValueOnce(null) + .mockResolvedValueOnce({ content: { text: 'new summary' } }); + + mockFetchSummary.mockResolvedValueOnce('new summary'); + vi.mocked(mockRuntime.knowledgeManager.createMemory).mockResolvedValueOnce(undefined); + + const result = await asteraiProvider.get(mockRuntime, mockMessage, mockState); + + expect(mockRuntime.knowledgeManager.createMemory).toHaveBeenCalledWith(expect.objectContaining({ + id: 'test-agent-id', + content: { text: 'new summary' } + })); + expect(result).toBe('new summary'); + }); + + it('should handle errors when fetching summary', async () => { + vi.mocked(mockRuntime.knowledgeManager.getMemoryById).mockResolvedValue(null); + mockFetchSummary.mockRejectedValue(new Error('Failed to fetch summary')); + + try { + await asteraiProvider.get(mockRuntime, mockMessage, mockState); + } catch (error) { + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe('Failed to fetch summary'); + } + }); + }); +}); diff --git a/packages/plugin-asterai/package.json b/packages/plugin-asterai/package.json index 8b1916bbc1a..9e8af0e1ab1 100644 --- a/packages/plugin-asterai/package.json +++ b/packages/plugin-asterai/package.json @@ -1,45 +1,48 @@ { - "name": "@elizaos/plugin-asterai", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@asterai/client": "0.1.6", - "@elizaos/core": "workspace:*", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "elliptic": "6.6.1", - "node-cache": "5.1.2", - "sha3": "2.1.4", - "uuid": "11.0.3", - "zod": "3.23.8" - }, - "devDependencies": { - "@types/elliptic": "6.4.18", - "@types/uuid": "10.0.0", - "tsup": "8.3.5" - }, - "scripts": { - "lines": "find . \\( -name '*.cdc' -o -name '*.ts' \\) -not -path '*/node_modules/*' -not -path '*/tests/*' -not -path '*/deps/*' -not -path '*/dist/*' -not -path '*/imports*' | xargs wc -l", - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-asterai", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@asterai/client": "0.1.6", + "@elizaos/core": "workspace:*", + "bignumber.js": "9.1.2", + "bs58": "6.0.0", + "elliptic": "6.6.1", + "node-cache": "5.1.2", + "sha3": "2.1.4", + "uuid": "11.0.3", + "zod": "3.23.8" + }, + "devDependencies": { + "@types/elliptic": "6.4.18", + "@types/uuid": "10.0.0", + "tsup": "8.3.5", + "vitest": "^1.2.1" + }, + "scripts": { + "lines": "find . \\( -name '*.cdc' -o -name '*.ts' \\) -not -path '*/node_modules/*' -not -path '*/tests/*' -not -path '*/deps/*' -not -path '*/dist/*' -not -path '*/imports*' | xargs wc -l", + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-asterai/vitest.config.ts b/packages/plugin-asterai/vitest.config.ts new file mode 100644 index 00000000000..3b66182de91 --- /dev/null +++ b/packages/plugin-asterai/vitest.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + environment: 'node', + include: ['__tests__/**/*.test.ts'], + mockReset: true, + clearMocks: true, + restoreMocks: true, + reporters: ['default'], + testTimeout: 10000 + }, +}); diff --git a/packages/plugin-autonome/package.json b/packages/plugin-autonome/package.json index 2ca0de7996a..a3c1d895ccb 100644 --- a/packages/plugin-autonome/package.json +++ b/packages/plugin-autonome/package.json @@ -1,23 +1,23 @@ { - "name": "@elizaos/plugin-autonome", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@coral-xyz/anchor": "0.30.1", - "@elizaos/core": "workspace:*", - "@elizaos/plugin-tee": "workspace:*", - "@elizaos/plugin-trustdb": "workspace:*", - "axios": "^1.7.9" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-autonome", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@coral-xyz/anchor": "0.30.1", + "@elizaos/core": "workspace:*", + "@elizaos/plugin-tee": "workspace:*", + "@elizaos/plugin-trustdb": "workspace:*", + "axios": "^1.7.9" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-avail/package.json b/packages/plugin-avail/package.json index 8605749031d..14f4324018b 100644 --- a/packages/plugin-avail/package.json +++ b/packages/plugin-avail/package.json @@ -1,20 +1,21 @@ { - "name": "@elizaos/plugin-avail", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-trustdb": "workspace:*", - "avail-js-sdk": "^0.3.0" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "tsup": "8.3.5", - "@polkadot/types": "^10.11.3" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } + "name": "@elizaos/plugin-avail", + "version": "0.1.8+build.1", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "@elizaos/plugin-trustdb": "workspace:*", + "avail-js-sdk": "^0.3.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "tsup": "8.3.5", + "@polkadot/types": "^10.11.3" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + } } diff --git a/packages/plugin-avalanche/package.json b/packages/plugin-avalanche/package.json index f8e817642a0..9e1045e39d6 100644 --- a/packages/plugin-avalanche/package.json +++ b/packages/plugin-avalanche/package.json @@ -1,33 +1,33 @@ { - "name": "@elizaos/plugin-avalanche", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*" - }, - "devDependencies": { - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup src/index.ts --format esm --no-dts" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-avalanche", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*" + }, + "devDependencies": { + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup src/index.ts --format esm --no-dts" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-binance/package.json b/packages/plugin-binance/package.json index a70958e6d90..6314f5cad7b 100644 --- a/packages/plugin-binance/package.json +++ b/packages/plugin-binance/package.json @@ -1,38 +1,39 @@ { - "name": "@elizaos/plugin-binance", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@binance/connector": "^3.6.0", - "@elizaos/core": "workspace:*", - "zod": "^3.22.4" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "tsup": "8.3.5", - "vite-tsconfig-paths": "^5.1.4", - "vitest": "^3.0.2" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - } + "name": "@elizaos/plugin-binance", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@binance/connector": "^3.6.0", + "@binance/connector": "^3.6.0", + "@elizaos/core": "workspace:*", + "zod": "^3.22.4" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "tsup": "8.3.5", + "vite-tsconfig-paths": "^5.1.4", + "vitest": "^3.0.2" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + } } diff --git a/packages/plugin-bootstrap/package.json b/packages/plugin-bootstrap/package.json index f95d284f8ce..a952d27a92b 100644 --- a/packages/plugin-bootstrap/package.json +++ b/packages/plugin-bootstrap/package.json @@ -1,32 +1,32 @@ { - "name": "@elizaos/plugin-bootstrap", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-bootstrap", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-bootstrap/src/evaluators/fact.ts b/packages/plugin-bootstrap/src/evaluators/fact.ts index c1ed56c7ccd..0e22be19fd6 100644 --- a/packages/plugin-bootstrap/src/evaluators/fact.ts +++ b/packages/plugin-bootstrap/src/evaluators/fact.ts @@ -22,7 +22,7 @@ const factsTemplate = `TASK: Extract Claims from the conversation as an array of claims in JSON format. # START OF EXAMPLES -These are an examples of the expected output of this task: +These are examples of the expected output of this task: {{evaluationExamples}} # END OF EXAMPLES @@ -36,7 +36,7 @@ Extract any claims from the conversation that are not already present in the lis - For true facts about the world or the character that do not change, set the claim type to 'fact' - For facts that are true but change over time, set the claim type to 'status' - For non-facts, set the type to 'opinion' -- 'opinion' inlcudes non-factual opinions and also includes the character's thoughts, feelings, judgments or recommendations +- 'opinion' includes non-factual opinions and also includes the character's thoughts, feelings, judgments or recommendations - Include any factual detail, including where the user lives, works, or goes to school, what they do for a living, their hobbies, and any other relevant information Recent Messages: diff --git a/packages/plugin-coinbase/package.json b/packages/plugin-coinbase/package.json index e7e71c35ad9..4122279ac38 100644 --- a/packages/plugin-coinbase/package.json +++ b/packages/plugin-coinbase/package.json @@ -1,40 +1,40 @@ { - "name": "@elizaos/plugin-coinbase", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "coinbase-api": "1.0.5", - "coinbase-advanced-sdk": "file:../../packages/plugin-coinbase/advanced-sdk-ts", - "jsonwebtoken": "^9.0.2", - "@types/jsonwebtoken": "^9.0.7", - "node-fetch": "^2.6.1" - }, - "devDependencies": { - "tsup": "8.3.5", - "@types/node": "^20.0.0", - "vitest": "^1.0.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - } + "name": "@elizaos/plugin-coinbase", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@types/jsonwebtoken": "^9.0.7", + "coinbase-advanced-sdk": "file:../../packages/plugin-coinbase/advanced-sdk-ts", + "coinbase-api": "1.0.5", + "jsonwebtoken": "^9.0.2", + "node-fetch": "^2.6.1" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "tsup": "8.3.5", + "vitest": "^1.0.0" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + } } diff --git a/packages/plugin-coingecko/package.json b/packages/plugin-coingecko/package.json index ecc72edcce8..a7718a7ae37 100644 --- a/packages/plugin-coingecko/package.json +++ b/packages/plugin-coingecko/package.json @@ -1,18 +1,18 @@ { - "name": "@elizaos/plugin-coingecko", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "axios": "^1.6.7", - "tsup": "^8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-coingecko", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "axios": "^1.6.7", + "tsup": "^8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-coinmarketcap/package.json b/packages/plugin-coinmarketcap/package.json index c75fc2ab19e..4f2768470a0 100644 --- a/packages/plugin-coinmarketcap/package.json +++ b/packages/plugin-coinmarketcap/package.json @@ -1,20 +1,20 @@ { - "name": "@elizaos/plugin-coinmarketcap", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "axios": "^1.6.7", - "zod": "^3.22.4" - }, - "devDependencies": { - "tsup": "^8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-coinmarketcap", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "axios": "^1.6.7", + "zod": "^3.22.4" + }, + "devDependencies": { + "tsup": "^8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-conflux/package.json b/packages/plugin-conflux/package.json index 135640e8049..ffc9494c2a6 100644 --- a/packages/plugin-conflux/package.json +++ b/packages/plugin-conflux/package.json @@ -1,30 +1,30 @@ { - "name": "@elizaos/plugin-conflux", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "cive": "0.7.1" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-conflux", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "cive": "0.7.1" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-cosmos/package.json b/packages/plugin-cosmos/package.json index 508bdf111b5..dbc8ce43e19 100644 --- a/packages/plugin-cosmos/package.json +++ b/packages/plugin-cosmos/package.json @@ -14,9 +14,9 @@ "axios": "^1.7.9", "bignumber.js": "9.1.2", "chain-registry": "^1.69.68", + "interchain": "^1.10.4", "tsup": "8.3.5", - "zod": "3.23.8", - "interchain": "^1.10.4" + "zod": "3.23.8" }, "scripts": { "build": "tsup --format esm --dts", diff --git a/packages/plugin-cronoszkevm/package.json b/packages/plugin-cronoszkevm/package.json index aaefee2f447..1fa9d00e023 100644 --- a/packages/plugin-cronoszkevm/package.json +++ b/packages/plugin-cronoszkevm/package.json @@ -1,33 +1,33 @@ { - "name": "@elizaos/plugin-cronoszkevm", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "^8.3.5", - "viem": "2.22.2" - }, - "scripts": { - "build": "tsup --format esm --dts", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-cronoszkevm", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "^8.3.5", + "viem": "2.22.2" + }, + "scripts": { + "build": "tsup --format esm --dts", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-depin/package.json b/packages/plugin-depin/package.json index 56541e5e557..76f6e69fe26 100644 --- a/packages/plugin-depin/package.json +++ b/packages/plugin-depin/package.json @@ -1,20 +1,20 @@ { - "name": "@elizaos/plugin-depin", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5", - "axios": "^1.7.9" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-depin", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "axios": "^1.7.9", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-di/README.md b/packages/plugin-di/README.md index 1dc474e7c12..bd6eed7f76b 100644 --- a/packages/plugin-di/README.md +++ b/packages/plugin-di/README.md @@ -8,7 +8,17 @@ Dependency Injection is a design pattern that allows you to inject dependencies ## Examples of How to build a Plugin using Dependency Injection -Check the [example](./src/_examples/) folder for a simple example of how to create a plugin using Dependency Injection. +Check the [example](../_examples/plugin-with-di/) folder for a simple example of how to create a plugin using Dependency Injection. + +### Where can I use Dependency Injection? + +You can use Dependency Injection in any part of your Eliza plugin, including actions, evaluators, providers, services, and clients. + +- Actions: Inject services or providers to interact with external APIs or services. [Example](../_examples/plugin-with-di/src/actions/sampleAction.ts) +- Evaluators: Inject services or providers to evaluate conditions or perform calculations. [Example](../_examples/plugin-with-di/src/evaluators/sampleEvaluator.ts) +- Providers: Inject services or providers to provide data or resources. [Example](../_examples/plugin-with-di/src/providers/sampleProvider.ts) +- Services: Inject other services to perform business logic. [Example](../_examples/plugin-with-di/src/services/sampleService.ts) +- Clients: Inject services to interact with external APIs or services. Lack of examples, but you can refer to the services example. ## Decorators for Dependency Injection @@ -62,9 +72,9 @@ class SampleClass { } ``` -### From di plugin +### From di plugin (used for BaseInjectableAction) -DI plugin provides abstract classes that you can extend to create Injectable actions or evaluators. +DI plugin provides abstract classes that you can extend to create Injectable actions. And that provides the following decorators to improve the readability of the code. #### `@property` @@ -86,9 +96,14 @@ class SampleActionContent { } ``` -## Abstract Classes for Injaectable Actions and Evaluators +## Abstract Classes provided by this plugin + +This plugin provides the following abstract classes that you can extend to create Injectable classes: -This plugin provides abstract classes that you can extend to create Injectable actions or evaluators. +- `BaseInjectableAction` +- `BaseInjectableEvaluator` + +Note: This is optional, you can create your own classes to create injectable actions. ### `BaseInjectableAction` @@ -131,9 +146,3 @@ class SampleAction extends BaseInjectableAction { } } ``` - -### `BaseInjectableEvaluator` - -This abstract class simplify the creation of injectable evaluators. - -Please refer to the [sampleEvaluator](./src/_examples/sampleEvaluator.ts) for an example of how to create an evaluator. diff --git a/packages/plugin-di/src/_examples/samplePlugin.ts b/packages/plugin-di/src/_examples/samplePlugin.ts deleted file mode 100644 index 901c4f1d0c1..00000000000 --- a/packages/plugin-di/src/_examples/samplePlugin.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CreateResourceAction } from "./sampleAction"; -import { SampleProvider } from "./sampleProvider"; -import { SampleEvaluator } from "./sampleEvaluator"; -import type { PluginOptions } from "../types"; - -export const samplePlugin: PluginOptions = { - name: "sample", - description: "Enables creation and management of generic resources", - actions: [CreateResourceAction], - providers: [SampleProvider], - evaluators: [SampleEvaluator], - // separate examples will be added for services and clients - services: [], - clients: [], -}; - -export default samplePlugin; diff --git a/packages/plugin-di/src/factories/plugin.ts b/packages/plugin-di/src/factories/plugin.ts index 2b74dac93a9..bd4b9fc9870 100644 --- a/packages/plugin-di/src/factories/plugin.ts +++ b/packages/plugin-di/src/factories/plugin.ts @@ -1,10 +1,7 @@ import type { interfaces } from "inversify"; import { - type Action, elizaLogger, - type Evaluator, type Plugin, - type Provider, } from "@elizaos/core"; import type { PluginFactory, PluginOptions } from "../types"; @@ -52,7 +49,7 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { plugin.providers = ( await Promise.all( opts.providers.map((provider) => - getInstanceFromContainer( + getInstanceFromContainer( ctx, provider, "provider" @@ -69,7 +66,7 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { plugin.actions = ( await Promise.all( opts.actions.map((action) => - getInstanceFromContainer(ctx, action, "action") + getInstanceFromContainer(ctx, action, "action") ) ) ).filter(Boolean); // Filter out undefined actions @@ -82,7 +79,7 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { plugin.evaluators = ( await Promise.all( opts.evaluators.map((evaluator) => - getInstanceFromContainer( + getInstanceFromContainer( ctx, evaluator, "evaluator" @@ -94,12 +91,24 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { // Handle services - if provided, assign directly if (typeof opts.services !== "undefined") { - plugin.services = opts.services; + plugin.services = ( + await Promise.all( + opts.services.map((service) => + getInstanceFromContainer(ctx, service, "service") + ) + ) + ) } // Handle clients - if provided, assign directly if (typeof opts.clients !== "undefined") { - plugin.clients = opts.clients; + plugin.clients = ( + await Promise.all( + opts.clients.map((client) => + getInstanceFromContainer(ctx, client, "client") + ) + ) + ) } return plugin; }; diff --git a/packages/plugin-di/src/types.ts b/packages/plugin-di/src/types.ts index 2775b1c49cf..95ff5eae38f 100644 --- a/packages/plugin-di/src/types.ts +++ b/packages/plugin-di/src/types.ts @@ -1,11 +1,13 @@ import type { Action, + Client, Evaluator, HandlerCallback, IAgentRuntime, Memory, Plugin, Provider, + Service, State, } from "@elizaos/core"; import type { ContentClass } from "./decorators"; @@ -24,13 +26,6 @@ export interface InjectableProvider extends Provider { getInstance(runtime: IAgentRuntime): Promise; } -/** - * The Class of Injectable Provider - */ -export type InjectableProviderClass = new ( - ...args: Args -) => InjectableProvider; - /** * Action options */ @@ -61,13 +56,6 @@ export interface InjectableAction extends Action { ): Promise; } -/** - * The Class of Injectable Action - */ -export type InjectableActionClass = new ( - ...args: Args -) => InjectableAction; - /** * Evaluator options */ @@ -82,11 +70,36 @@ export type EvaluatorOptions = Pick< export type InjectableEvaluator = Evaluator; /** - * The Class of Injectable Evaluator + * The Class of Injectable Object */ -export type InjectableEvaluatorClass = new ( +export type InjectableObjectClass = new ( ...args: Args -) => InjectableEvaluator; +) => T; + +/** + * The Class of Injectable Provider + */ +export type InjectableProviderClass = InjectableObjectClass | Provider, Args> + +/** + * The Class of Injectable Action + */ +export type InjectableActionClass = InjectableObjectClass | Action, Args> + +/** + * The Class of Injectable Evaluator + */ +export type InjectableEvaluatorClass = InjectableObjectClass + +/** + * The Class of Injectable Service + */ +export type InjectableServiceClass = InjectableObjectClass; + +/** + * The Class of Injectable Client + */ +export type InjectableClientClass = InjectableObjectClass; // ----------- Interfaces for Plugin ----------- @@ -95,7 +108,7 @@ export type InjectableEvaluatorClass = new ( */ export type PluginOptions = Pick< Plugin, - "name" | "description" | "services" | "clients" + "name" | "description" > & { /** Optional actions */ actions?: (Action | InjectableActionClass)[]; @@ -103,6 +116,10 @@ export type PluginOptions = Pick< providers?: (Provider | InjectableProviderClass)[]; /** Optional evaluators */ evaluators?: (Evaluator | InjectableEvaluatorClass)[]; + /** Optional services */ + services?: (Service | InjectableServiceClass)[]; + /** Optional clients */ + clients?: (Client | InjectableClientClass)[]; }; /** diff --git a/packages/plugin-echochambers/package.json b/packages/plugin-echochambers/package.json index 61cad243f69..b223212f52f 100644 --- a/packages/plugin-echochambers/package.json +++ b/packages/plugin-echochambers/package.json @@ -1,30 +1,30 @@ { - "name": "@elizaos/plugin-echochambers", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-node": "workspace:*" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-echochambers", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@elizaos/plugin-node": "workspace:*" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-evm/package.json b/packages/plugin-evm/package.json index 17f837a4d5a..6a448e9c530 100644 --- a/packages/plugin-evm/package.json +++ b/packages/plugin-evm/package.json @@ -1,37 +1,37 @@ { - "name": "@elizaos/plugin-evm", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-tee": "workspace:*", - "@lifi/data-types": "5.15.5", - "@lifi/sdk": "3.4.1", - "@lifi/types": "16.3.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-evm", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@elizaos/plugin-tee": "workspace:*", + "@lifi/data-types": "5.15.5", + "@lifi/sdk": "3.4.1", + "@lifi/types": "16.3.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-flow/package.json b/packages/plugin-flow/package.json index 32fd1a67c0e..e081192a9eb 100644 --- a/packages/plugin-flow/package.json +++ b/packages/plugin-flow/package.json @@ -1,49 +1,49 @@ { - "name": "@elizaos/plugin-flow", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@onflow/config": "1.5.1", - "@onflow/fcl": "1.13.1", - "@onflow/typedefs": "1.4.0", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "elliptic": "6.6.1", - "node-cache": "5.1.2", - "sha3": "2.1.4", - "uuid": "11.0.3", - "zod": "3.23.8" - }, - "devDependencies": { - "@types/elliptic": "6.4.18", - "@types/uuid": "10.0.0", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "lines": "find . \\( -name '*.cdc' -o -name '*.ts' \\) -not -path '*/node_modules/*' -not -path '*/tests/*' -not -path '*/deps/*' -not -path '*/dist/*' -not -path '*/imports*' | xargs wc -l", - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-flow", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@onflow/config": "1.5.1", + "@onflow/fcl": "1.13.1", + "@onflow/typedefs": "1.4.0", + "bignumber.js": "9.1.2", + "bs58": "6.0.0", + "elliptic": "6.6.1", + "node-cache": "5.1.2", + "sha3": "2.1.4", + "uuid": "11.0.3", + "zod": "3.23.8" + }, + "devDependencies": { + "@types/elliptic": "6.4.18", + "@types/uuid": "10.0.0", + "tsup": "8.3.5", + "vitest": "2.1.4" + }, + "scripts": { + "lines": "find . \\( -name '*.cdc' -o -name '*.ts' \\) -not -path '*/node_modules/*' -not -path '*/tests/*' -not -path '*/deps/*' -not -path '*/dist/*' -not -path '*/imports*' | xargs wc -l", + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-fuel/package.json b/packages/plugin-fuel/package.json index b751be7b56d..4cd740dce4b 100644 --- a/packages/plugin-fuel/package.json +++ b/packages/plugin-fuel/package.json @@ -1,36 +1,36 @@ { - "name": "@elizaos/plugin-fuel", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "fuels": "0.97.2", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-fuel", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "fuels": "0.97.2", + "tsup": "8.3.5", + "vitest": "2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-genlayer/package.json b/packages/plugin-genlayer/package.json index 3929fb5658b..62bfa9cf586 100644 --- a/packages/plugin-genlayer/package.json +++ b/packages/plugin-genlayer/package.json @@ -1,17 +1,17 @@ { - "name": "@elizaos/plugin-genlayer", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "dependencies": { - "genlayer-js": "0.4.7", - "@elizaos/core": "workspace:*", - "tsup": "8.3.5" - } + "name": "@elizaos/plugin-genlayer", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "dependencies": { + "@elizaos/core": "workspace:*", + "genlayer-js": "0.4.7", + "tsup": "8.3.5" + } } diff --git a/packages/plugin-giphy/package.json b/packages/plugin-giphy/package.json index cec41bee17d..3259402f9bb 100644 --- a/packages/plugin-giphy/package.json +++ b/packages/plugin-giphy/package.json @@ -1,19 +1,19 @@ { - "name": "@elizaos/plugin-giphy", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "axios": "^1.6.7", - "tsup": "^8.3.5", - "zod": "^3.22.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-giphy", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "axios": "^1.6.7", + "tsup": "^8.3.5", + "zod": "^3.22.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-gitbook/package.json b/packages/plugin-gitbook/package.json index dc705ba249c..ae982346a31 100644 --- a/packages/plugin-gitbook/package.json +++ b/packages/plugin-gitbook/package.json @@ -1,30 +1,30 @@ { - "name": "@elizaos/plugin-gitbook", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest" - } + "name": "@elizaos/plugin-gitbook", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest" + } } diff --git a/packages/plugin-goat/package.json b/packages/plugin-goat/package.json index ac1c8a8c4bf..da7581c8ad7 100644 --- a/packages/plugin-goat/package.json +++ b/packages/plugin-goat/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/plugin-goat", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@goat-sdk/adapter-vercel-ai": "0.2.0", - "@goat-sdk/core": "0.4.6", - "@goat-sdk/plugin-erc20": "0.2.2", - "@goat-sdk/plugin-kim": "0.1.2", - "@goat-sdk/wallet-evm": "0.2.0", - "@goat-sdk/wallet-viem": "0.2.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-goat", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@goat-sdk/adapter-vercel-ai": "0.2.0", + "@goat-sdk/core": "0.4.6", + "@goat-sdk/plugin-erc20": "0.2.2", + "@goat-sdk/plugin-kim": "0.1.2", + "@goat-sdk/wallet-evm": "0.2.0", + "@goat-sdk/wallet-viem": "0.2.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-goplus/package.json b/packages/plugin-goplus/package.json index 7ae84a624fb..dec3783b5a8 100644 --- a/packages/plugin-goplus/package.json +++ b/packages/plugin-goplus/package.json @@ -1,20 +1,20 @@ { - "name": "@elizaos/plugin-goplus", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "^8.3.5", - "ws": "^8.18.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsx watch src/index.ts" - }, - "devDependencies": { - "@types/ws": "^8.5.13", - "tsx": "^4.19.2" - } + "name": "@elizaos/plugin-goplus", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "^8.3.5", + "ws": "^8.18.0" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsx watch src/index.ts" + }, + "devDependencies": { + "@types/ws": "^8.5.13", + "tsx": "^4.19.2" + } } diff --git a/packages/plugin-holdstation/package.json b/packages/plugin-holdstation/package.json index 266103096af..ac7f451cbac 100644 --- a/packages/plugin-holdstation/package.json +++ b/packages/plugin-holdstation/package.json @@ -1,36 +1,36 @@ { - "name": "@elizaos/plugin-holdstation", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "node-cache": "5.1.2", - "tsup": "^8.3.5", - "viem": "2.21.58" - }, - "scripts": { - "build": "tsup --format esm --dts" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - }, - "devDependencies": { - "ts-node": "^10.9.2" - } + "name": "@elizaos/plugin-holdstation", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "node-cache": "5.1.2", + "tsup": "^8.3.5", + "viem": "2.21.58" + }, + "scripts": { + "build": "tsup --format esm --dts" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + }, + "devDependencies": { + "ts-node": "^10.9.2" + } } diff --git a/packages/plugin-hyperliquid/package.json b/packages/plugin-hyperliquid/package.json index 763c2c73616..93772af00fe 100644 --- a/packages/plugin-hyperliquid/package.json +++ b/packages/plugin-hyperliquid/package.json @@ -1,20 +1,20 @@ { - "name": "@elizaos/plugin-hyperliquid", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "hyperliquid": "^1.5.6", - "zod": "^3.23.8" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } + "name": "@elizaos/plugin-hyperliquid", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "hyperliquid": "^1.5.6", + "zod": "^3.23.8" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + } } diff --git a/packages/plugin-icp/package.json b/packages/plugin-icp/package.json index b79818f0d3d..15d7d5d8b92 100644 --- a/packages/plugin-icp/package.json +++ b/packages/plugin-icp/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/plugin-icp", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@dfinity/agent": "2.1.3", - "@dfinity/candid": "2.1.3", - "@dfinity/identity": "2.1.3", - "@dfinity/principal": "2.1.3" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache ." - }, - "devDependencies": { - "@types/jest": "29.5.14", - "jest": "29.7.0", - "tsup": "8.3.5", - "typescript": "5.6.3" - } + "name": "@elizaos/plugin-icp", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@dfinity/agent": "2.1.3", + "@dfinity/candid": "2.1.3", + "@dfinity/identity": "2.1.3", + "@dfinity/principal": "2.1.3", + "@elizaos/core": "workspace:*" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache ." + }, + "devDependencies": { + "@types/jest": "29.5.14", + "jest": "29.7.0", + "tsup": "8.3.5", + "typescript": "5.6.3" + } } diff --git a/packages/plugin-image-generation/package.json b/packages/plugin-image-generation/package.json index f5e3bbe6701..ecf85d245c4 100644 --- a/packages/plugin-image-generation/package.json +++ b/packages/plugin-image-generation/package.json @@ -1,32 +1,32 @@ { - "name": "@elizaos/plugin-image-generation", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-image-generation", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-image-generation/src/index.ts b/packages/plugin-image-generation/src/index.ts index 4d37bfb6519..1bfcda5b25f 100644 --- a/packages/plugin-image-generation/src/index.ts +++ b/packages/plugin-image-generation/src/index.ts @@ -9,8 +9,8 @@ import { ModelClass, } from "@elizaos/core"; import { generateImage } from "@elizaos/core"; -import fs from "fs"; -import path from "path"; +import fs from "node:fs"; +import path from "node:path"; import { validateImageGenConfig } from "./environment"; export function saveBase64Image(base64Data: string, filename: string): string { diff --git a/packages/plugin-imgflip/src/actions/generate-meme.ts b/packages/plugin-imgflip/src/actions/generate-meme.ts index dae01c661e3..125dfd8655a 100644 --- a/packages/plugin-imgflip/src/actions/generate-meme.ts +++ b/packages/plugin-imgflip/src/actions/generate-meme.ts @@ -155,11 +155,18 @@ async function genereateMeme( imgflipTemplate: ImgflipTemplate, captions: string[] ): Promise { + const username = process.env.IMGFLIP_USERNAME; + const password = process.env.IMGFLIP_PASSWORD; + + if (!username || !password) { + throw new Error("Imgflip credentials not configured. Please set IMGFLIP_USERNAME and IMGFLIP_PASSWORD environment variables."); + } + // Create form data with template ID and credentials const formData = new URLSearchParams({ template_id: imgflipTemplate.id, - username: process.env.IMGFLIP_USERNAME!, - password: process.env.IMGFLIP_PASSWORD!, + username, + password, }); // Add each caption as text0, text1, etc. @@ -180,7 +187,7 @@ async function genereateMeme( const result: ImgflipCaptionResponse = await response.json(); if (!result.success || !result.data.url) { - throw new Error("Failed to generate meme: " + result.error_message); + throw new Error(`Failed to generate meme: ${result.error_message}`); } return result.data.url; @@ -214,7 +221,11 @@ export async function generateMemeActionHandler( ); const url = await genereateMeme(imgflipTemplate, captions); - const text = `Generated a meme, using imgflip.com:\nMeme template: "${template}".\nCaptions:\n${captions.join("\n")}\nMeme URL: ${url}`; + const text = `Generated a meme, using imgflip.com: +Meme template: "${template}". +Captions: +${captions.join("\n")} +Meme URL: ${url}`; return { url, @@ -226,14 +237,14 @@ export const generateMemeAction: Action = { name: "GENERATE_MEME", similes: ["MAKE_MEME", "NEW_MEME", "GENERATE_NEW_MEME", "MAKE_NEW_MEME"], description: "Use this action to generate a meme", - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, _message: Memory) => { return true; }, handler: async ( runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: Record, callback: HandlerCallback ) => { const meme = await generateMemeActionHandler( diff --git a/packages/plugin-initia/src/actions/transfer.ts b/packages/plugin-initia/src/actions/transfer.ts index 5de193b04e5..9984d94f3b4 100644 --- a/packages/plugin-initia/src/actions/transfer.ts +++ b/packages/plugin-initia/src/actions/transfer.ts @@ -17,9 +17,11 @@ export interface TransferContent extends Content { amount: string; } -function isTransferContent(runtime: IAgentRuntime, content: any): content is TransferContent { +function isTransferContent(_runtime: IAgentRuntime, content: unknown): content is TransferContent { return ( - typeof content.sender === "string" && typeof content.recipient === "string" && typeof content.amount === "number" + typeof (content as TransferContent).sender === "string" && + typeof (content as TransferContent).recipient === "string" && + typeof (content as TransferContent).amount === "string" ); } @@ -53,7 +55,7 @@ export default { "PAY_ON_INITIA" ], description: "", - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { const privateKey = runtime.getSetting("INITIA_PRIVATE_KEY"); return typeof privateKey === "string" && privateKey.startsWith("0x"); }, @@ -64,14 +66,17 @@ export default { _options: { [key: string]: unknown }, callback?: HandlerCallback ): Promise => { - if (!state) { - state = (await runtime.composeState(message)) as State; + // Initialize or update state + let currentState = state; + if (!currentState) { + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(currentState); } + const transferContext = composeContext({ - state, + state: currentState, template: transferTemplate, }); @@ -108,11 +113,11 @@ export default { const txResult = await walletProvider.sendTransaction(signedTx); if (callback) { callback({ - text: `Successfully transferred INITIA.\n` + - `Transaction Hash: ${txResult.txhash}\n` + - `Sender: ${content.sender}\n` + - `Recipient: ${content.recipient}\n` + - `Amount: ${content.amount}` + text: `Successfully transferred INITIA. +Transaction Hash: ${txResult.txhash} +Sender: ${content.sender} +Recipient: ${content.recipient} +Amount: ${content.amount}` }); } return true; diff --git a/packages/plugin-initia/src/providers/wallet.ts b/packages/plugin-initia/src/providers/wallet.ts index 423a2c957b5..9255ece1805 100644 --- a/packages/plugin-initia/src/providers/wallet.ts +++ b/packages/plugin-initia/src/providers/wallet.ts @@ -1,5 +1,7 @@ -import { IAgentRuntime, Provider, Memory, State } from "@elizaos/core"; +import type { IAgentRuntime, Provider, Memory, State } from "@elizaos/core"; +// Add type imports for Initia.js +import type { Wallet, RESTClient, Tx } from '@initia/initia.js'; interface WalletProviderOptions { chainId: string; @@ -12,8 +14,8 @@ const DEFAULT_INITIA_TESTNET_CONFIGS: WalletProviderOptions = { } export class WalletProvider { - private wallet: any = null; - private restClient: any = null; + private wallet: Wallet | null = null; + private restClient: RESTClient | null = null; private runtime: IAgentRuntime; async initialize(runtime: IAgentRuntime, options: WalletProviderOptions = DEFAULT_INITIA_TESTNET_CONFIGS) { @@ -59,13 +61,13 @@ export class WalletProvider { return this.wallet.rest.bank.balance(this.getAddress()); } - async sendTransaction(signedTx: any) { + async sendTransaction(signedTx: Tx | string) { return await this.restClient.tx.broadcast(signedTx); } } export const initiaWalletProvider: Provider = { - async get(runtime: IAgentRuntime, message: Memory, state?: State): Promise { + async get(runtime: IAgentRuntime, _message: Memory, _state?: State): Promise { if (!runtime.getSetting("INITIA_PRIVATE_KEY")) { return null; } diff --git a/packages/plugin-injective/src/action/base.ts b/packages/plugin-injective/src/action/base.ts index 077de8c9d4f..58c5498cf26 100644 --- a/packages/plugin-injective/src/action/base.ts +++ b/packages/plugin-injective/src/action/base.ts @@ -62,15 +62,18 @@ export function createGenericAction({ ): Promise => { elizaLogger.debug(`create action: ${name}`); // 1. Compose or update the state - if (!state) { - state = (await runtime.composeState(message)) as State; + + let currentState = state; + if (!currentState) { + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(currentState); } - + + // 2. Compose a context from the given template const context = composeContext({ - state, + state: currentState, template, }); @@ -121,7 +124,7 @@ export function createGenericAction({ ); // 6. Dynamically call the specified functionName on the Injective client - const method = (client as any)[functionName]; + const method = ((client as unknown) as { [key: string]: (params: unknown) => Promise<{ success: boolean; result: { code: number } }> })[functionName]; if (typeof method !== "function") { throw new Error( `Method "${functionName}" does not exist on InjectiveGrpcClient` @@ -138,7 +141,7 @@ export function createGenericAction({ // Lets convert the result of the response into something that can be read if (response.success) { console.log("Cleaning up the response"); - const additionalTemplate = `Extract the response from the following data, also make sure that you format the response into human readable format, make it the prettiest thing anyone can read basically a very nice comprehensive summary in a string format.`; + const additionalTemplate = 'Extract the response from the following data, also make sure that you format the response into human readable format, make it the prettiest thing anyone can read basically a very nice comprehensive summary in a string format.'; const responseResult = JSON.stringify(response.result); const newContext = `${additionalTemplate}\n${responseResult}`; const totalContext = `Previous chat context:${context} \n New information : ${newContext}`; diff --git a/packages/plugin-intiface/package.json b/packages/plugin-intiface/package.json index a6678306041..68229d21f9d 100644 --- a/packages/plugin-intiface/package.json +++ b/packages/plugin-intiface/package.json @@ -1,36 +1,36 @@ { - "name": "@elizaos/plugin-intiface", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "buttplug": "3.2.2", - "net": "1.0.2", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test-via-bun": "bun test/simulate.ts", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-intiface", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "buttplug": "3.2.2", + "net": "1.0.2", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test-via-bun": "bun test/simulate.ts", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-intiface/src/index.ts b/packages/plugin-intiface/src/index.ts index c093e5ff9a2..e6d346a3c6b 100644 --- a/packages/plugin-intiface/src/index.ts +++ b/packages/plugin-intiface/src/index.ts @@ -15,19 +15,35 @@ import { shutdownIntifaceEngine, } from "./utils"; +// Define the Device interface based on Buttplug device properties +interface Device { + name: string; + index: number; + vibrate?: (strength: number) => Promise; + rotate?: (strength: number) => Promise; + stop?: () => Promise; + battery?: () => Promise; + id?: number; +} + +interface ActionOptions { + intensity?: number; + duration?: number; +} + export interface IIntifaceService extends Service { vibrate(strength: number, duration: number): Promise; rotate?(strength: number, duration: number): Promise; getBatteryLevel?(): Promise; isConnected(): boolean; - getDevices(): any[]; + getDevices(): Device[]; } export class IntifaceService extends Service implements IIntifaceService { static serviceType: ServiceType = ServiceType.INTIFACE; private client: ButtplugClient; private connected = false; - private devices: Map = new Map(); + private devices: Map = new Map(); private vibrateQueue: VibrateEvent[] = []; private isProcessingQueue = false; private config: IntifaceConfig | null = null; @@ -132,10 +148,10 @@ export class IntifaceService extends Service implements IIntifaceService { console.log("Scanning for devices..."); await new Promise((r) => setTimeout(r, 2000)); - this.client.devices.forEach((device) => { + for (const device of this.client.devices) { this.devices.set(device.name, device); console.log(`- ${device.name} (${device.index})`); - }); + } if (this.devices.size === 0) { console.log("No devices found"); @@ -179,12 +195,12 @@ export class IntifaceService extends Service implements IIntifaceService { this.devices.clear(); } - private handleDeviceAdded(device: any) { + private handleDeviceAdded(device: Device) { this.devices.set(device.name, device); console.log(`Device connected: ${device.name}`); } - private handleDeviceRemoved(device: any) { + private handleDeviceRemoved(device: Device) { this.devices.delete(device.name); console.log(`Device disconnected: ${device.name}`); } @@ -292,10 +308,14 @@ export class IntifaceService extends Service implements IIntifaceService { } private async rampedRotate( - device: any, + device: Device, targetStrength: number, duration: number ) { + if (!device.rotate || !device.stop) { + throw new Error("Device does not support rotation"); + } + const stepTime = (duration * 0.2) / this.rampSteps; // Ramp up @@ -333,9 +353,9 @@ const vibrateAction: Action = { }, handler: async ( runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, + _message: Memory, + _state: State, + options: ActionOptions, callback: HandlerCallback ) => { const service = runtime.getService( @@ -443,9 +463,9 @@ const rotateAction: Action = { }, handler: async ( runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, + _message: Memory, + _state: State, + options: ActionOptions, callback: HandlerCallback ) => { const service = runtime.getService( @@ -501,9 +521,9 @@ const batteryAction: Action = { }, handler: async ( runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, + _message: Memory, + _state: State, + _options: ActionOptions, callback: HandlerCallback ) => { const service = runtime.getService( diff --git a/packages/plugin-intiface/src/utils.ts b/packages/plugin-intiface/src/utils.ts index 12019898d98..231c70b44a0 100644 --- a/packages/plugin-intiface/src/utils.ts +++ b/packages/plugin-intiface/src/utils.ts @@ -1,7 +1,7 @@ -import { spawn, type ChildProcess } from "child_process"; -import net from "net"; -import path from "path"; -import { fileURLToPath } from "url"; +import { spawn, type ChildProcess } from "node:child_process"; +import net from "node:net"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); diff --git a/packages/plugin-iq6900/src/functions/bringIQData.ts b/packages/plugin-iq6900/src/functions/bringIQData.ts index a87c85200c9..b4139726895 100644 --- a/packages/plugin-iq6900/src/functions/bringIQData.ts +++ b/packages/plugin-iq6900/src/functions/bringIQData.ts @@ -17,6 +17,12 @@ interface TransactionData { before_tx: string; } +interface TransactionDataResponse { + code: string; + method: string; + decode_break: number; +} + interface CodeResult { json_data: string; commit_message: string; @@ -82,7 +88,7 @@ async function fetchDBPDA(): Promise { } async function getTransactionData(transactionData: TransactionData): Promise<{ - data: any; + data: TransactionDataResponse | "fail"; before_tx: string; }> { if (!transactionData || !("code" in transactionData)) { @@ -115,6 +121,10 @@ async function extractCommitMessage(dataTxid: string): Promise { return null; } +function isTransactionDataResponse(data: TransactionDataResponse | "fail"): data is TransactionDataResponse { + return data !== "fail" && typeof data === "object" && "code" in data; +} + async function bringCode(dataTxid: string): Promise { const txInfo = await fetchTransactionInfo(dataTxid); if (!txInfo || !txInfo.tail_tx) return ERROR_RESULT; @@ -142,8 +152,8 @@ async function bringCode(dataTxid: string): Promise { const chunkData = await getTransactionData( chunk as TransactionData ); - if (!chunkData.data || chunkData.data === null) { - elizaLogger.error("Chunk data undefined"); + if (!chunkData.data || !isTransactionDataResponse(chunkData.data)) { + elizaLogger.error("Chunk data undefined or invalid"); return ERROR_RESULT; } diff --git a/packages/plugin-irys/package.json b/packages/plugin-irys/package.json index ee511fce9dd..0446f76b313 100644 --- a/packages/plugin-irys/package.json +++ b/packages/plugin-irys/package.json @@ -1,22 +1,22 @@ { - "name": "@elizaos/plugin-irys", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "@irys/upload": "^0.0.14", - "@irys/upload-ethereum": "^0.0.14", - "graphql-request": "^4.0.0" - }, - "devDependencies": { - "tsup": "8.3.5", - "@types/node": "^20.0.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - } + "name": "@elizaos/plugin-irys", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "@irys/upload": "^0.0.14", + "@irys/upload-ethereum": "^0.0.14", + "graphql-request": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + } } diff --git a/packages/plugin-irys/src/services/irysService.ts b/packages/plugin-irys/src/services/irysService.ts index 547891ad542..c12b34e5f54 100644 --- a/packages/plugin-irys/src/services/irysService.ts +++ b/packages/plugin-irys/src/services/irysService.ts @@ -15,7 +15,7 @@ import { import { Uploader } from "@irys/upload"; import { BaseEth } from "@irys/upload-ethereum"; import { GraphQLClient, gql } from 'graphql-request'; -import crypto from 'crypto'; +import crypto from 'node:crypto'; interface NodeGQL { id: string; @@ -28,22 +28,34 @@ interface TransactionsIdAddress { error?: string; } +interface TransactionEdge { + node: { + id: string; + address: string; + } +} + interface TransactionGQL { transactions: { - edges: { - node: { - id: string; - address: string; - } - }[] + edges: TransactionEdge[] } } -export class IrysService extends Service implements IIrysService { +interface IrysUploader { + upload: (data: string, options: { tags: { name: string; value: string }[] }) => Promise<{ id: string }>; + uploadFile: (data: string, options: { tags: { name: string; value: string }[] }) => Promise<{ id: string }>; +} + +interface IrysDataNode { + data: string; + address: string; +} + +class IrysService extends Service implements IIrysService { static serviceType: ServiceType = ServiceType.IRYS; private runtime: IAgentRuntime | null = null; - private irysUploader: any | null = null; + private irysUploader: IrysUploader | null = null; private endpointForTransactionId = "https://uploader.irys.xyz/graphql"; private endpointForData = "https://gateway.irys.xyz"; @@ -73,7 +85,7 @@ export class IrysService extends Service implements IIrysService { timestamp: timestamp } const data: TransactionGQL = await graphQLClient.request(QUERY, variables); - const listOfTransactions : NodeGQL[] = data.transactions.edges.map((edge: any) => edge.node); + const listOfTransactions : NodeGQL[] = data.transactions.edges.map((edge: TransactionEdge) => edge.node); console.log("Transaction IDs retrieved") return { success: true, data: listOfTransactions }; } catch (error) { @@ -102,23 +114,25 @@ export class IrysService extends Service implements IIrysService { private async fetchDataFromTransactionId(transactionId: string): Promise { console.log(`Fetching data from transaction ID: ${transactionId}`); const response = await fetch(`${this.endpointForData}/${transactionId}`); - if (!response.ok) return { success: false, data: null, error: "Error fetching data from transaction ID" }; + if (!response.ok) { + return { success: false, data: null, error: "Error fetching data from transaction ID" }; + } return { success: true, data: response, }; } - private converToValues(value: any): any[] { + private converToValues(value: unknown): string[] { if (Array.isArray(value)) { - return value; + return value.map(String); } - return [value]; + return [String(value)]; } private async orchestrateRequest(requestMessage: string, tags: GraphQLTag[], timestamp: IrysTimestamp = null): Promise { - const serviceCategory = tags.find((tag) => tag.name == "Service-Category")?.values; - const protocol = tags.find((tag) => tag.name == "Protocol")?.values; - const minimumProviders = Number(tags.find((tag) => tag.name == "Minimum-Providers")?.values); + const serviceCategory = tags.find((tag) => tag.name === "Service-Category")?.values; + const protocol = tags.find((tag) => tag.name === "Protocol")?.values; + const minimumProviders = Number(tags.find((tag) => tag.name === "Minimum-Providers")?.values); /* Further implementation of the orchestrator { name: "Validation-Threshold", values: validationThreshold }, @@ -131,51 +145,55 @@ export class IrysService extends Service implements IIrysService { { name: "Protocol", values: this.converToValues(protocol) }, ]; const data = await this.getDataFromAnAgent(null, tagsToRetrieve, timestamp); - if (!data.success) return { success: false, data: null, error: data.error }; - const dataArray = data.data as Array; - try { - for (let i = 0; i < dataArray.length; i++) { + if (!data.success) { + return { success: false, data: null, error: data.error }; + } + const dataArray = data.data as IrysDataNode[]; + + for (let i = 0; i < dataArray.length; i++) { + try { const node = dataArray[i]; const templateRequest = ` Determine the truthfulness of the relationship between the given context and text. Context: ${requestMessage} Text: ${node.data} Return True or False - `; - const responseFromModel = await generateMessageResponse({ - runtime: this.runtime, - context: templateRequest, - modelClass: ModelClass.MEDIUM, - }); - console.log("RESPONSE FROM MODEL : ", responseFromModel) - if (!responseFromModel.success || ((responseFromModel.content?.toString().toLowerCase().includes('false')) && (!responseFromModel.content?.toString().toLowerCase().includes('true')))) { - dataArray.splice(i, 1); + `; + const responseFromModel = await generateMessageResponse({ + runtime: this.runtime, + context: templateRequest, + modelClass: ModelClass.MEDIUM, + }); + console.log("RESPONSE FROM MODEL : ", responseFromModel); + if (!responseFromModel.success || (responseFromModel.content?.toString().toLowerCase().includes('false') && !responseFromModel.content?.toString().toLowerCase().includes('true'))) { + dataArray.splice(i, 1); i--; } - } - } catch (error) { - if (error.message.includes("TypeError: Cannot read properties of undefined (reading 'settings')")) { - return { success: false, data: null, error: "Error in the orchestrator" }; + } catch (error: unknown) { + if (error instanceof Error && error.message.includes("TypeError: Cannot read properties of undefined (reading 'settings')")) { + return { success: false, data: null, error: "Error in the orchestrator" }; + } + throw error; } } const responseTags: GraphQLTag[] = [ { name: "Message-Type", values: [IrysMessageType.REQUEST_RESPONSE] }, { name: "Service-Category", values: [serviceCategory] }, { name: "Protocol", values: [protocol] }, - { name: "Request-Id", values: [tags.find((tag) => tag.name == "Request-Id")?.values[0]] }, + { name: "Request-Id", values: [tags.find((tag) => tag.name === "Request-Id")?.values[0]] }, ]; - if (dataArray.length == 0) { + if (dataArray.length === 0) { const response = await this.uploadDataOnIrys("No relevant data found from providers", responseTags, IrysMessageType.REQUEST_RESPONSE); console.log("Response from Irys: ", response); return { success: false, data: null, error: "No relevant data found from providers" }; } - const listProviders = new Set(dataArray.map((provider: any) => provider.address)); + const listProviders = new Set(dataArray.map((provider: IrysDataNode) => provider.address)); if (listProviders.size < minimumProviders) { const response = await this.uploadDataOnIrys("Not enough providers", responseTags, IrysMessageType.REQUEST_RESPONSE); console.log("Response from Irys: ", response); return { success: false, data: null, error: "Not enough providers" }; } - const listData = dataArray.map((provider: any) => provider.data); + const listData = dataArray.map((provider: IrysDataNode) => provider.data); const response = await this.uploadDataOnIrys(listData, responseTags, IrysMessageType.REQUEST_RESPONSE); console.log("Response from Irys: ", response); return { @@ -185,7 +203,7 @@ export class IrysService extends Service implements IIrysService { } // Orchestrator - private async uploadDataOnIrys(data: any, tags: GraphQLTag[], messageType: IrysMessageType, timestamp: IrysTimestamp = null): Promise { + private async uploadDataOnIrys(data: unknown, tags: GraphQLTag[], messageType: IrysMessageType, timestamp: IrysTimestamp = null): Promise { if (!(await this.initializeIrysUploader())) { return { success: false, @@ -204,26 +222,27 @@ export class IrysService extends Service implements IIrysService { name: "Request-Id", value: requestId }); + try { const dataToStore = { data: data, }; const receipt = await this.irysUploader.upload(JSON.stringify(dataToStore), { tags: formattedTags }); - if (messageType == IrysMessageType.DATA_STORAGE || messageType == IrysMessageType.REQUEST_RESPONSE) { + if (messageType === IrysMessageType.DATA_STORAGE || messageType === IrysMessageType.REQUEST_RESPONSE) { return { success: true, url: `https://gateway.irys.xyz/${receipt.id}`}; - } else if (messageType == IrysMessageType.REQUEST) { - const response = await this.orchestrateRequest(data, tags, timestamp); + } + if (messageType === IrysMessageType.REQUEST) { + const response = await this.orchestrateRequest(data as string, tags, timestamp); return { success: response.success, url: `https://gateway.irys.xyz/${receipt.id}`, data: response.data, error: response.error ? response.error : null - } - + }; } return { success: true, url: `https://gateway.irys.xyz/${receipt.id}` }; } catch (error) { - return { success: false, error: "Error uploading to Irys, " + error }; + return { success: false, error: `Error uploading to Irys, ${error}` }; } } @@ -244,7 +263,7 @@ export class IrysService extends Service implements IIrysService { const receipt = await this.irysUploader.uploadFile(data, { tags: formattedTags }); return { success: true, url: `https://gateway.irys.xyz/${receipt.id}` }; } catch (error) { - return { success: false, error: "Error uploading to Irys, " + error }; + return { success: false, error: `Error uploading to Irys, ${error}` }; } } @@ -254,25 +273,25 @@ export class IrysService extends Service implements IIrysService { } } - private normalizeArraySize(arr: any[]): any { - if (arr.length == 1) { - return arr[0]; + private normalizeArraySize(arr: string[] | number[] | boolean[]): (string | number | boolean)[] { + if (arr.length === 1) { + return [arr[0]]; } return arr; } - async workerUploadDataOnIrys(data: any, dataType: IrysDataType, messageType: IrysMessageType, serviceCategory: string[], protocol: string[], validationThreshold: number[] = [], minimumProviders: number[] = [], testProvider: boolean[] = [], reputation: number[] = []): Promise { + async workerUploadDataOnIrys(data: unknown, dataType: IrysDataType, messageType: IrysMessageType, serviceCategory: string[], protocol: string[], validationThreshold: number[] = [], minimumProviders: number[] = [], testProvider: boolean[] = [], reputation: number[] = []): Promise { this.normalizeArrayValues(validationThreshold, 0, 1); this.normalizeArrayValues(minimumProviders, 0); this.normalizeArrayValues(reputation, 0, 1); const tags = [ - { name: "Message-Type", values: messageType }, + { name: "Message-Type", values: [messageType] }, { name: "Service-Category", values: this.normalizeArraySize(serviceCategory) }, { name: "Protocol", values: this.normalizeArraySize(protocol) }, ] as GraphQLTag[]; - if (messageType == IrysMessageType.REQUEST) { + if (messageType === IrysMessageType.REQUEST) { if (validationThreshold.length > 0) { tags.push({ name: "Validation-Threshold", values: this.normalizeArraySize(validationThreshold) }); } @@ -286,35 +305,37 @@ export class IrysService extends Service implements IIrysService { tags.push({ name: "Reputation", values: this.normalizeArraySize(reputation) }); } } - if (dataType == IrysDataType.FILE || dataType == IrysDataType.IMAGE) { - return await this.uploadFileOrImageOnIrys(data, tags); + if (dataType === IrysDataType.FILE || dataType === IrysDataType.IMAGE) { + return await this.uploadFileOrImageOnIrys(data as string, tags); } return await this.uploadDataOnIrys(data, tags, messageType); } - async providerUploadDataOnIrys(data: any, dataType: IrysDataType, serviceCategory: string[], protocol: string[]): Promise { + async providerUploadDataOnIrys(data: unknown, dataType: IrysDataType, serviceCategory: string[], protocol: string[]): Promise { const tags = [ { name: "Message-Type", values: [IrysMessageType.DATA_STORAGE] }, { name: "Service-Category", values: serviceCategory }, { name: "Protocol", values: protocol }, ] as GraphQLTag[]; - if (dataType == IrysDataType.FILE || dataType == IrysDataType.IMAGE) { - return await this.uploadFileOrImageOnIrys(data, tags); + if (dataType === IrysDataType.FILE || dataType === IrysDataType.IMAGE) { + return await this.uploadFileOrImageOnIrys(data as string, tags); } return await this.uploadDataOnIrys(data, tags, IrysMessageType.DATA_STORAGE); } - async getDataFromAnAgent(agentsWalletPublicKeys: string[] = null, tags: GraphQLTag[] = null, timestamp: IrysTimestamp = null): Promise { + async getDataFromAnAgent(agentsWalletPublicKeys: string[] | null = null, tags: GraphQLTag[] | null = null, timestamp: IrysTimestamp | null = null): Promise { try { const transactionIdsResponse = await this.getTransactionId(agentsWalletPublicKeys, tags, timestamp); - if (!transactionIdsResponse.success) return { success: false, data: null, error: "Error fetching transaction IDs" }; + if (!transactionIdsResponse.success) { + return { success: false, data: null, error: "Error fetching transaction IDs" }; + } const transactionIdsAndResponse = transactionIdsResponse.data.map((node: NodeGQL) => node); - const dataPromises: Promise[] = transactionIdsAndResponse.map(async (node: NodeGQL) => { + const dataPromises: Promise<{ data: unknown; address: string }>[] = transactionIdsAndResponse.map(async (node: NodeGQL) => { const fetchDataFromTransactionIdResponse = await this.fetchDataFromTransactionId(node.id); - if (await fetchDataFromTransactionIdResponse.data.headers.get('content-type') == "application/octet-stream") { + if (await fetchDataFromTransactionIdResponse.data.headers.get('content-type') === "application/octet-stream") { let data = null; const responseText = await fetchDataFromTransactionIdResponse.data.text(); try { @@ -325,19 +346,17 @@ export class IrysService extends Service implements IIrysService { return { data: data, address: node.address - } - } - else { - return { - data: fetchDataFromTransactionIdResponse.data.url, - address: node.address - } + }; } + return { + data: fetchDataFromTransactionIdResponse.data.url, + address: node.address + }; }); const data = await Promise.all(dataPromises); return { success: true, data: data }; } catch (error) { - return { success: false, data: null, error: "Error fetching data from transaction IDs " + error }; + return { success: false, data: null, error: `Error fetching data from transaction IDs ${error}` }; } } } diff --git a/packages/plugin-irys/src/services/irysService_bk.ts b/packages/plugin-irys/src/services/irysService_bk.ts new file mode 100644 index 00000000000..37d1564ca01 --- /dev/null +++ b/packages/plugin-irys/src/services/irysService_bk.ts @@ -0,0 +1,345 @@ +import { + type IAgentRuntime, + Service, + ServiceType, + type IIrysService, + type UploadIrysResult, + type DataIrysFetchedFromGQL, + type GraphQLTag, + IrysMessageType, + generateMessageResponse, + ModelClass, + IrysDataType, + type IrysTimestamp, +} from "@elizaos/core"; +import { Uploader } from "@irys/upload"; +import { BaseEth } from "@irys/upload-ethereum"; +import { GraphQLClient, gql } from 'graphql-request'; +import crypto from 'node:crypto'; + +interface NodeGQL { + id: string; + address: string; +} + +interface TransactionsIdAddress { + success: boolean; + data: NodeGQL[]; + error?: string; +} + +interface TransactionGQL { + transactions: { + edges: { + node: { + id: string; + address: string; + } + }[] + } +} + +export class IrysService extends Service implements IIrysService { + static serviceType: ServiceType = ServiceType.IRYS; + + private runtime: IAgentRuntime | null = null; + private irysUploader: any | null = null; + private endpointForTransactionId = "https://uploader.irys.xyz/graphql"; + private endpointForData = "https://gateway.irys.xyz"; + + async initialize(runtime: IAgentRuntime): Promise { + console.log("Initializing IrysService"); + this.runtime = runtime; + } + + private async getTransactionId(owners: string[] = null, tags: GraphQLTag[] = null, timestamp: IrysTimestamp = null): Promise { + const graphQLClient = new GraphQLClient(this.endpointForTransactionId); + const QUERY = gql` + query($owners: [String!], $tags: [TagFilter!], $timestamp: TimestampFilter) { + transactions(owners: $owners, tags: $tags, timestamp: $timestamp) { + edges { + node { + id, + address + } + } + } + } + `; + try { + const variables = { + owners: owners, + tags: tags, + timestamp: timestamp + } + const data: TransactionGQL = await graphQLClient.request(QUERY, variables); + const listOfTransactions : NodeGQL[] = data.transactions.edges.map((edge: any) => edge.node); + console.log("Transaction IDs retrieved") + return { success: true, data: listOfTransactions }; + } catch (error) { + console.error("Error fetching transaction IDs", error); + return { success: false, data: [], error: "Error fetching transaction IDs" }; + } + } + + private async initializeIrysUploader(): Promise { + if (this.irysUploader) return true; + if (!this.runtime) return false; + + try { + const EVM_WALLET_PRIVATE_KEY = this.runtime.getSetting("EVM_WALLET_PRIVATE_KEY"); + if (!EVM_WALLET_PRIVATE_KEY) return false; + + const irysUploader = await Uploader(BaseEth).withWallet(EVM_WALLET_PRIVATE_KEY); + this.irysUploader = irysUploader; + return true; + } catch (error) { + console.error("Error initializing Irys uploader:", error); + return false; + } + } + + private async fetchDataFromTransactionId(transactionId: string): Promise { + console.log(`Fetching data from transaction ID: ${transactionId}`); + const response = await fetch(`${this.endpointForData}/${transactionId}`); + if (!response.ok) return { success: false, data: null, error: "Error fetching data from transaction ID" }; + return { + success: true, + data: response, + }; + } + private converToValues(value: any): any[] { + if (Array.isArray(value)) { + return value; + } + return [value]; + } + + private async orchestrateRequest(requestMessage: string, tags: GraphQLTag[], timestamp: IrysTimestamp = null): Promise { + const serviceCategory = tags.find((tag) => tag.name == "Service-Category")?.values; + const protocol = tags.find((tag) => tag.name == "Protocol")?.values; + const minimumProviders = Number(tags.find((tag) => tag.name == "Minimum-Providers")?.values); + /* + Further implementation of the orchestrator + { name: "Validation-Threshold", values: validationThreshold }, + { name: "Test-Provider", values: testProvider }, + { name: "Reputation", values: reputation }, + */ + const tagsToRetrieve : GraphQLTag[] = [ + { name: "Message-Type", values: [IrysMessageType.DATA_STORAGE] }, + { name: "Service-Category", values: this.converToValues(serviceCategory) }, + { name: "Protocol", values: this.converToValues(protocol) }, + ]; + const data = await this.getDataFromAnAgent(null, tagsToRetrieve, timestamp); + if (!data.success) return { success: false, data: null, error: data.error }; + const dataArray = data.data as Array; + try { + for (let i = 0; i < dataArray.length; i++) { + const node = dataArray[i]; + const templateRequest = ` + Determine the truthfulness of the relationship between the given context and text. + Context: ${requestMessage} + Text: ${node.data} + Return True or False + `; + const responseFromModel = await generateMessageResponse({ + runtime: this.runtime, + context: templateRequest, + modelClass: ModelClass.MEDIUM, + }); + console.log("RESPONSE FROM MODEL : ", responseFromModel) + if (!responseFromModel.success || ((responseFromModel.content?.toString().toLowerCase().includes('false')) && (!responseFromModel.content?.toString().toLowerCase().includes('true')))) { + dataArray.splice(i, 1); + i--; + } + } + } catch (error) { + if (error.message.includes("TypeError: Cannot read properties of undefined (reading 'settings')")) { + return { success: false, data: null, error: "Error in the orchestrator" }; + } + } + const responseTags: GraphQLTag[] = [ + { name: "Message-Type", values: [IrysMessageType.REQUEST_RESPONSE] }, + { name: "Service-Category", values: [serviceCategory] }, + { name: "Protocol", values: [protocol] }, + { name: "Request-Id", values: [tags.find((tag) => tag.name == "Request-Id")?.values[0]] }, + ]; + if (dataArray.length == 0) { + const response = await this.uploadDataOnIrys("No relevant data found from providers", responseTags, IrysMessageType.REQUEST_RESPONSE); + console.log("Response from Irys: ", response); + return { success: false, data: null, error: "No relevant data found from providers" }; + } + const listProviders = new Set(dataArray.map((provider: any) => provider.address)); + if (listProviders.size < minimumProviders) { + const response = await this.uploadDataOnIrys("Not enough providers", responseTags, IrysMessageType.REQUEST_RESPONSE); + console.log("Response from Irys: ", response); + return { success: false, data: null, error: "Not enough providers" }; + } + const listData = dataArray.map((provider: any) => provider.data); + const response = await this.uploadDataOnIrys(listData, responseTags, IrysMessageType.REQUEST_RESPONSE); + console.log("Response from Irys: ", response); + return { + success: true, + data: listData + } + } + + // Orchestrator + private async uploadDataOnIrys(data: any, tags: GraphQLTag[], messageType: IrysMessageType, timestamp: IrysTimestamp = null): Promise { + if (!(await this.initializeIrysUploader())) { + return { + success: false, + error: "Irys uploader not initialized", + }; + } + + // Transform tags to the correct format + const formattedTags = tags.map(tag => ({ + name: tag.name, + value: Array.isArray(tag.values) ? tag.values.join(',') : tag.values + })); + + const requestId = String(crypto.createHash('sha256').update(new Date().toISOString()).digest('hex')); + formattedTags.push({ + name: "Request-Id", + value: requestId + }); + try { + const dataToStore = { + data: data, + }; + const receipt = await this.irysUploader.upload(JSON.stringify(dataToStore), { tags: formattedTags }); + if (messageType == IrysMessageType.DATA_STORAGE || messageType == IrysMessageType.REQUEST_RESPONSE) { + return { success: true, url: `https://gateway.irys.xyz/${receipt.id}`}; + } else if (messageType == IrysMessageType.REQUEST) { + const response = await this.orchestrateRequest(data, tags, timestamp); + return { + success: response.success, + url: `https://gateway.irys.xyz/${receipt.id}`, + data: response.data, + error: response.error ? response.error : null + } + + } + return { success: true, url: `https://gateway.irys.xyz/${receipt.id}` }; + } catch (error) { + return { success: false, error: "Error uploading to Irys, " + error }; + } + } + + private async uploadFileOrImageOnIrys(data: string, tags: GraphQLTag[]): Promise { + if (!(await this.initializeIrysUploader())) { + return { + success: false, + error: "Irys uploader not initialized" + }; + } + + const formattedTags = tags.map(tag => ({ + name: tag.name, + value: Array.isArray(tag.values) ? tag.values.join(',') : tag.values + })); + + try { + const receipt = await this.irysUploader.uploadFile(data, { tags: formattedTags }); + return { success: true, url: `https://gateway.irys.xyz/${receipt.id}` }; + } catch (error) { + return { success: false, error: "Error uploading to Irys, " + error }; + } + } + + private normalizeArrayValues(arr: number[], min: number, max?: number): void { + for (let i = 0; i < arr.length; i++) { + arr[i] = Math.max(min, max !== undefined ? Math.min(arr[i], max) : arr[i]); + } + } + + private normalizeArraySize(arr: any[]): any { + if (arr.length == 1) { + return arr[0]; + } + return arr; + } + + async workerUploadDataOnIrys(data: any, dataType: IrysDataType, messageType: IrysMessageType, serviceCategory: string[], protocol: string[], validationThreshold: number[] = [], minimumProviders: number[] = [], testProvider: boolean[] = [], reputation: number[] = []): Promise { + this.normalizeArrayValues(validationThreshold, 0, 1); + this.normalizeArrayValues(minimumProviders, 0); + this.normalizeArrayValues(reputation, 0, 1); + + const tags = [ + { name: "Message-Type", values: messageType }, + { name: "Service-Category", values: this.normalizeArraySize(serviceCategory) }, + { name: "Protocol", values: this.normalizeArraySize(protocol) }, + ] as GraphQLTag[]; + + if (messageType == IrysMessageType.REQUEST) { + if (validationThreshold.length > 0) { + tags.push({ name: "Validation-Threshold", values: this.normalizeArraySize(validationThreshold) }); + } + if (minimumProviders.length > 0) { + tags.push({ name: "Minimum-Providers", values: this.normalizeArraySize(minimumProviders) }); + } + if (testProvider.length > 0) { + tags.push({ name: "Test-Provider", values: this.normalizeArraySize(testProvider) }); + } + if (reputation.length > 0) { + tags.push({ name: "Reputation", values: this.normalizeArraySize(reputation) }); + } + } + if (dataType == IrysDataType.FILE || dataType == IrysDataType.IMAGE) { + return await this.uploadFileOrImageOnIrys(data, tags); + } + + return await this.uploadDataOnIrys(data, tags, messageType); + } + + async providerUploadDataOnIrys(data: any, dataType: IrysDataType, serviceCategory: string[], protocol: string[]): Promise { + const tags = [ + { name: "Message-Type", values: [IrysMessageType.DATA_STORAGE] }, + { name: "Service-Category", values: serviceCategory }, + { name: "Protocol", values: protocol }, + ] as GraphQLTag[]; + + if (dataType == IrysDataType.FILE || dataType == IrysDataType.IMAGE) { + return await this.uploadFileOrImageOnIrys(data, tags); + } + + return await this.uploadDataOnIrys(data, tags, IrysMessageType.DATA_STORAGE); + } + + async getDataFromAnAgent(agentsWalletPublicKeys: string[] = null, tags: GraphQLTag[] = null, timestamp: IrysTimestamp = null): Promise { + try { + const transactionIdsResponse = await this.getTransactionId(agentsWalletPublicKeys, tags, timestamp); + if (!transactionIdsResponse.success) return { success: false, data: null, error: "Error fetching transaction IDs" }; + const transactionIdsAndResponse = transactionIdsResponse.data.map((node: NodeGQL) => node); + const dataPromises: Promise[] = transactionIdsAndResponse.map(async (node: NodeGQL) => { + const fetchDataFromTransactionIdResponse = await this.fetchDataFromTransactionId(node.id); + if (await fetchDataFromTransactionIdResponse.data.headers.get('content-type') == "application/octet-stream") { + let data = null; + const responseText = await fetchDataFromTransactionIdResponse.data.text(); + try { + data = JSON.parse(responseText); + } catch { + data = responseText; + } + return { + data: data, + address: node.address + } + } + else { + return { + data: fetchDataFromTransactionIdResponse.data.url, + address: node.address + } + } + }); + const data = await Promise.all(dataPromises); + return { success: true, data: data }; + } catch (error) { + return { success: false, data: null, error: `Error fetching data from transaction IDs ${error}` }; + } + } +} + +export default IrysService; \ No newline at end of file diff --git a/packages/plugin-lensNetwork/README.md b/packages/plugin-lens-network/README.md similarity index 100% rename from packages/plugin-lensNetwork/README.md rename to packages/plugin-lens-network/README.md diff --git a/packages/plugin-lensNetwork/eslint.config.mjs b/packages/plugin-lens-network/eslint.config.mjs similarity index 100% rename from packages/plugin-lensNetwork/eslint.config.mjs rename to packages/plugin-lens-network/eslint.config.mjs diff --git a/packages/plugin-lens-network/package.json b/packages/plugin-lens-network/package.json new file mode 100644 index 00000000000..1ba435a7623 --- /dev/null +++ b/packages/plugin-lens-network/package.json @@ -0,0 +1,37 @@ +{ + "name": "@elizaos/plugin-lens-network", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "^8.3.5", + "web3": "^4.15.0", + "@lens-network/sdk": "^0.0.0-canary-20241203140504", + "dotenv": "^16.0.3", + "ethers": "^6.0.0", + "zksync-ethers": "^6.0.0" + }, + "scripts": { + "build": "tsup --format esm --dts", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } +} diff --git a/packages/plugin-lensNetwork/src/actions/transfer.ts b/packages/plugin-lens-network/src/actions/transfer.ts similarity index 83% rename from packages/plugin-lensNetwork/src/actions/transfer.ts rename to packages/plugin-lens-network/src/actions/transfer.ts index 54ef36cbcdb..58ffaa3ac19 100644 --- a/packages/plugin-lensNetwork/src/actions/transfer.ts +++ b/packages/plugin-lens-network/src/actions/transfer.ts @@ -13,7 +13,8 @@ import { } from "@elizaos/core"; import { validateLensConfig } from "../environment"; import { getDefaultProvider, Network, Wallet } from "@lens-network/sdk/ethers"; -import { ethers } from "ethers"; +import { ethers, type Provider as EthersProvider } from "ethers"; +import { Provider as ZkSyncProvider } from "zksync-ethers"; import { type Address, @@ -23,12 +24,6 @@ import { import { z } from "zod"; -const TransferSchema = z.object({ - tokenAddress: z.string(), - recipient: z.string(), - amount: z.string(), -}); - export interface TransferContent extends Content { tokenAddress: string; recipient: string; @@ -83,18 +78,18 @@ Respond with a JSON markdown block containing only the extracted values.`; //const ETH_ADDRESS = "0x000000000000000000000000000000000000800A"; -export async function setupProviders() { +export async function setupProviders(): Promise<{ lensProvider: ZkSyncProvider; ethProvider: EthersProvider }> { // Initialize providers for both L2 (Lens) and L1 (Ethereum) - const lensProvider = getDefaultProvider(Network.Testnet); + const lensProvider = getDefaultProvider(Network.Testnet) as unknown as ZkSyncProvider; const ethProvider = ethers.getDefaultProvider("sepolia"); return { lensProvider, ethProvider }; } export async function setupWallet( - lensProvider: any, - ethProvider: any, - key: any + lensProvider: ZkSyncProvider, + ethProvider: EthersProvider, + key: string ) { // Create wallet instance with both L2 and L1 providers const wallet = new Wallet(key, lensProvider, ethProvider); @@ -103,7 +98,7 @@ export async function setupWallet( } export async function transferTokens( - wallet: any, + wallet: Wallet, recipientAddress: string, amount: string ) { @@ -151,7 +146,7 @@ export default { "MOVE_GRASS_ON_LENS", ], // eslint-disable-next-line - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateLensConfig(runtime); return true; }, @@ -166,15 +161,16 @@ export default { elizaLogger.log("Starting LENS SEND_TOKEN handler..."); // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose transfer context const transferContext = composeContext({ - state, + state: currentState, template: transferTemplate, }); @@ -184,9 +180,10 @@ export default { runtime, context: transferContext, modelClass: ModelClass.SMALL, - schema: TransferSchema, + schemaName: "TransferSchema", + schemaDescription: "Schema for token transfer with tokenAddress, recipient, and amount" }) - ).object as unknown as TransferContent; + ).object as TransferContent; // Validate transfer content if (!isTransferContent(content)) { @@ -201,7 +198,10 @@ export default { } try { - const PRIVATE_KEY = runtime.getSetting("LENS_PRIVATE_KEY")!; + const PRIVATE_KEY = runtime.getSetting("LENS_PRIVATE_KEY"); + if (!PRIVATE_KEY) { + throw new Error("LENS_PRIVATE_KEY not found in runtime settings"); + } const { lensProvider, ethProvider } = await setupProviders(); const wallet = await setupWallet( lensProvider, @@ -210,7 +210,7 @@ export default { ); const amount = content.amount.toString(); - let hash; + let hash: string; hash = await transferTokens( wallet, @@ -219,24 +219,22 @@ export default { ); elizaLogger.success( - "Transfer completed successfully! Transaction hash: " + hash + `Transfer completed successfully! Transaction hash: ${hash}` ); if (callback) { callback({ - text: - "Transfer completed successfully! Transaction hash: " + - hash, + text: `Transfer completed successfully! Transaction hash: ${hash}`, content: {}, }); } return true; - } catch (error) { + } catch (error: unknown) { elizaLogger.error("Error during token transfer:", error); if (callback) { callback({ - text: `Error transferring tokens: ${error.message}`, - content: { error: error.message }, + text: `Error transferring tokens: ${error instanceof Error ? error.message : String(error)}`, + content: { error: error instanceof Error ? error.message : String(error) }, }); } return false; diff --git a/packages/plugin-lensNetwork/src/environment.ts b/packages/plugin-lens-network/src/environment.ts similarity index 100% rename from packages/plugin-lensNetwork/src/environment.ts rename to packages/plugin-lens-network/src/environment.ts diff --git a/packages/plugin-lensNetwork/src/index.ts b/packages/plugin-lens-network/src/index.ts similarity index 100% rename from packages/plugin-lensNetwork/src/index.ts rename to packages/plugin-lens-network/src/index.ts diff --git a/packages/plugin-lensNetwork/tsconfig.json b/packages/plugin-lens-network/tsconfig.json similarity index 100% rename from packages/plugin-lensNetwork/tsconfig.json rename to packages/plugin-lens-network/tsconfig.json diff --git a/packages/plugin-lensNetwork/tsup.config.ts b/packages/plugin-lens-network/tsup.config.ts similarity index 100% rename from packages/plugin-lensNetwork/tsup.config.ts rename to packages/plugin-lens-network/tsup.config.ts diff --git a/packages/plugin-lensNetwork/package.json b/packages/plugin-lensNetwork/package.json deleted file mode 100644 index e197ed00a62..00000000000 --- a/packages/plugin-lensNetwork/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@elizaos/plugin-lensNetwork", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "^8.3.5", - "web3": "^4.15.0", - "@lens-network/sdk": "^0.0.0-canary-20241203140504", - "dotenv": "^16.0.3", - "ethers": "^6.0.0", - "zksync-ethers": "^6.0.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } -} diff --git a/packages/plugin-letzai/package.json b/packages/plugin-letzai/package.json index aea686edfec..533c0c4393b 100644 --- a/packages/plugin-letzai/package.json +++ b/packages/plugin-letzai/package.json @@ -1,17 +1,17 @@ { - "name": "@elizaos/plugin-letzai", - "version": "0.1.9", - "author": "LetzAI", - "description": "Enables Image Generation through LetzAI API", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } + "name": "@elizaos/plugin-letzai", + "version": "0.1.9", + "author": "LetzAI", + "description": "Enables Image Generation through LetzAI API", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + } } diff --git a/packages/plugin-letzai/src/index.ts b/packages/plugin-letzai/src/index.ts index 36d52837527..aa180441bb1 100644 --- a/packages/plugin-letzai/src/index.ts +++ b/packages/plugin-letzai/src/index.ts @@ -20,7 +20,7 @@ else async function pollLetzAiImageStatus( id: string, letzAiApiKey: string, - callback: any, + callback: (response: { text: string; attachments?: Array<{ id: string; url: string; title: string; source: string; description: string; contentType: string; text: string; }> }) => void, maxPolls = 40, pollIntervalMs = 3000 // 3 seconds ) { @@ -63,13 +63,13 @@ async function pollLetzAiImageStatus( if (!finalUrl) { callback({ - text: `Image is ready, but no final URL found.`, + text: 'Image is ready, but no final URL found.', }); return; } callback({ - text: `Your image is ready!`, + text: 'Your image is ready!', attachments: [ { id, @@ -83,9 +83,9 @@ async function pollLetzAiImageStatus( ], }); } - } catch (err: any) { + } catch (err: unknown) { callback({ - text: `Error while polling LetzAI: ${err.message}`, + text: `Error while polling LetzAI: ${err instanceof Error ? err.message : "Unknown error"}`, }); return; } @@ -104,7 +104,7 @@ export const letzAiImageGeneration = { description: "Generate an image via LetzAI API (with polling).", suppressInitialMessage: true, - validate: async (_runtime: any, _message: any, _state: any) => { + validate: async (_runtime: IAgentRuntime, _message: Memory, _state: State) => { // Provide a default validate() that simply returns true return true; }, @@ -164,10 +164,10 @@ export const letzAiImageGeneration = { customSystemPrompt: IMAGE_SYSTEM_PROMPT, });*/ - let imagePrompt = `${userPrompt}`.trim(); + let imagePrompt = userPrompt.trim(); //Prepend our Models from the .env config to make sure characters, styles and objects are respected - imagePrompt = letzAiModels + ", " + imagePrompt; + imagePrompt = `${letzAiModels}, ${imagePrompt}`; const prompt = imagePrompt; elizaLogger.log("Image prompt received:", imagePrompt); @@ -201,7 +201,7 @@ export const letzAiImageGeneration = { - // 3) Let the user know we’ve started generating + // 3) Let the user know we've started generating const { id, status, progress } = createData; callback({ text: `Started generating your image. (ID: ${id}, status: ${status}, progress: ${progress}%)`, @@ -209,9 +209,9 @@ export const letzAiImageGeneration = { // 4) Begin polling every 5s await pollLetzAiImageStatus(id, letzAiApiKey, callback, /* maxPolls */ 20, /* pollIntervalMs */ 5000); - } catch (error: any) { + } catch (error: unknown) { callback({ - text: `Error while requesting LetzAI: ${error.message}`, + text: `Error while requesting LetzAI: ${error instanceof Error ? error.message : "Unknown error"}`, }); } }, diff --git a/packages/plugin-lightning/src/actions/createInvoice.ts b/packages/plugin-lightning/src/actions/createInvoice.ts index e51417f99b6..ff5817f9aee 100644 --- a/packages/plugin-lightning/src/actions/createInvoice.ts +++ b/packages/plugin-lightning/src/actions/createInvoice.ts @@ -40,7 +40,7 @@ export const createInvoiceAction = { runtime: IAgentRuntime, _message: Memory, state: State, - _options: any, + _options: Record, callback?: (response: { text: string; content?: { success: boolean; invoice?: string }; diff --git a/packages/plugin-lightning/src/actions/payInvoice.ts b/packages/plugin-lightning/src/actions/payInvoice.ts index 886f79e6ad4..745dbd4a951 100644 --- a/packages/plugin-lightning/src/actions/payInvoice.ts +++ b/packages/plugin-lightning/src/actions/payInvoice.ts @@ -13,6 +13,7 @@ import { import type { PayResult } from "astra-lightning"; import type { PayArgs } from "../types"; import { payInvoiceTemplate } from "../templates"; +import { z } from "zod"; export { payInvoiceTemplate }; @@ -54,6 +55,14 @@ export class PayInvoiceAction { } } +// Define the schema type +const payInvoiceSchema = z.object({ + request: z.string(), + outgoing_channel: z.string() +}); + +type PayInvoiceContent = z.infer; + export const payInvoiceAction = { name: "PAY_INVOICE", description: "Make a payment.", @@ -61,8 +70,11 @@ export const payInvoiceAction = { runtime: IAgentRuntime, _message: Memory, state: State, - _options: any, - callback?: any + _options: Record, + callback?: (response: { + text: string; + content?: { success: boolean }; + }) => void ) => { elizaLogger.log("payInvoice action handler called"); const lightningProvider = await initLightningProvider(runtime); @@ -76,12 +88,15 @@ export const payInvoiceAction = { const content = await generateObject({ runtime, context: payInvoiceContext, + schema: payInvoiceSchema as z.ZodType, modelClass: ModelClass.LARGE, }); + const payInvoiceContent = content.object as PayInvoiceContent; + const payInvoiceOptions: PayArgs = { - request: content.request, - outgoing_channel: content.outgoing_channel, + request: payInvoiceContent.request, + outgoing_channel: payInvoiceContent.outgoing_channel, }; try { @@ -89,15 +104,14 @@ export const payInvoiceAction = { elizaLogger.log("🚀 ~ payInvoiceResp:", payInvoiceResp); if (callback) { - const text = ""; if (payInvoiceResp.is_confirmed) { callback({ - text: `Successfully paid invoice ${content.request} from ${payInvoiceResp.outgoing_channel};\nAmount: ${payInvoiceResp.tokens};\nFee: ${payInvoiceResp.fee};\nPayment Hash: ${payInvoiceResp.id};`, + text: `Successfully paid invoice ${payInvoiceContent.request} from ${payInvoiceResp.outgoing_channel};\nAmount: ${payInvoiceResp.tokens};\nFee: ${payInvoiceResp.fee};\nPayment Hash: ${payInvoiceResp.id};`, content: { success: true }, }); } else { callback({ - text: `Failed to payInvoice ${content.request} from ${content.outgoing_channel};\r\n Amount: ${payInvoiceResp.tokens};`, + text: `Failed to payInvoice ${payInvoiceContent.request} from ${payInvoiceContent.outgoing_channel};\r\n Amount: ${payInvoiceResp.tokens};`, content: { success: false, }, diff --git a/packages/plugin-lit/src/actions/sendEth.ts b/packages/plugin-lit/src/actions/sendEth.ts index 0fbaea99bed..e6f13d915b9 100644 --- a/packages/plugin-lit/src/actions/sendEth.ts +++ b/packages/plugin-lit/src/actions/sendEth.ts @@ -9,320 +9,323 @@ import { generateObject, Content } from "@elizaos/core"; - import { ethers } from "ethers"; - import { LitNodeClient } from "@lit-protocol/lit-node-client"; - import { LIT_RPC, LIT_ABILITY } from "@lit-protocol/constants"; +import { ethers } from "ethers"; +import { LitNodeClient } from "@lit-protocol/lit-node-client"; +import { LIT_RPC, LIT_ABILITY } from "@lit-protocol/constants"; import { LitPKPResource, createSiweMessageWithRecaps, generateAuthSig, LitActionResource, AuthSig, - } from "@lit-protocol/auth-helpers"; - import { z } from "zod"; - - interface LitState { - nodeClient: LitNodeClient; - evmWallet?: ethers.Wallet; - pkp?: { - publicKey: string; - ethAddress: string; - }; - capacityCredit?: { - tokenId: string; - }; - } - - // Add template for content extraction - const sendEthTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. - - Example response: - \`\`\`json - { - "amount": "0.01", - "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" - } - \`\`\` - - {{recentMessages}} - - Given the recent messages, extract the following information about the ETH transfer: - - amount (the amount of ETH to send) - - to (the destination address) - - Respond with a JSON markdown block containing only the extracted values.`; - - // Define the schema type - const sendEthSchema = z.object({ - amount: z.string().nullable(), - to: z.string().nullable() - }); - - // Add type guard function - function isSendEthContent(content: Content): content is SendEthContent { - return ( - (typeof content.amount === "string" || content.amount === null) && - (typeof content.to === "string" || content.to === null) - ); - } - - interface SendEthContent extends Content { - amount: string | null; - to: string | null; - } - - export const sendEth: Action = { - name: "SEND_ETH", - description: "Sends ETH to an address on Sepolia using PKP wallet", - similes: [ - "send eth", - "send * eth to *", - "send ethereum", - "send * ETH to *", - "transfer * eth to *", - "transfer * ETH to *", - ], - validate: async (runtime: IAgentRuntime) => true, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - _options: Record, - callback?: HandlerCallback - ): Promise => { - console.log("SEND_ETH handler started"); - try { - // Update state if needed - if (!state) { - state = await runtime.composeState(message); - } else { - state = await runtime.updateRecentMessageState(state); - } - - // Compose context and generate content - const sendEthContext = composeContext({ - state, - template: sendEthTemplate, - }); - - // Generate content with the schema - const content = await generateObject({ - runtime, - context: sendEthContext, - schema: sendEthSchema as any, - modelClass: ModelClass.LARGE, +} from "@lit-protocol/auth-helpers"; +import { z } from "zod"; + +interface LitState { + nodeClient: LitNodeClient; + evmWallet?: ethers.Wallet; + pkp?: { + publicKey: string; + ethAddress: string; + }; + capacityCredit?: { + tokenId: string; + }; +} + +// Add template for content extraction +const sendEthTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. + +Example response: +\`\`\`json +{ + "amount": "0.01", + "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" +} +\`\`\` + +{{recentMessages}} + +Given the recent messages, extract the following information about the ETH transfer: +- amount (the amount of ETH to send) +- to (the destination address) + +Respond with a JSON markdown block containing only the extracted values.`; + +// Define the schema type +const sendEthSchema = z.object({ + amount: z.string().nullable(), + to: z.string().nullable() +}); + +// Add type guard function +function isSendEthContent(content: Content): content is SendEthContent { + return ( + (typeof content.amount === "string" || content.amount === null) && + (typeof content.to === "string" || content.to === null) + ); +} + +interface SendEthContent extends Content { + amount: string | null; + to: string | null; +} + +export const sendEth: Action = { + name: "SEND_ETH", + description: "Sends ETH to an address on Sepolia using PKP wallet", + similes: [ + "send eth", + "send * eth to *", + "send ethereum", + "send * ETH to *", + "transfer * eth to *", + "transfer * ETH to *", + ], + validate: async (_runtime: IAgentRuntime) => true, + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State, + _options: Record, + callback?: HandlerCallback + ): Promise => { + console.log("SEND_ETH handler started"); + try { + // Initialize or update state + let currentState: State; + if (!state) { + currentState = (await runtime.composeState(message)) as State; + } else { + currentState = await runtime.updateRecentMessageState(state); + } + // Compose context and generate content + const sendEthContext = composeContext({ + state: currentState, + template: sendEthTemplate, + }); + + // Generate content with the schema + const content = await generateObject({ + runtime, + context: sendEthContext, + schema: sendEthSchema as any, + modelClass: ModelClass.LARGE, + }); + + const sendEthContent = content.object as SendEthContent; + + // Validate content + if (!isSendEthContent(sendEthContent)) { + console.error("Invalid content for SEND_ETH action."); + callback?.({ + text: "Unable to process ETH transfer request. Invalid content provided.", + content: { error: "Invalid send ETH content" } }); + return false; + } - const sendEthContent = content.object as SendEthContent; - - // Validate content - if (!isSendEthContent(sendEthContent)) { - console.error("Invalid content for SEND_ETH action."); - callback?.({ - text: "Unable to process ETH transfer request. Invalid content provided.", - content: { error: "Invalid send ETH content" } - }); - return false; - } - - if (!sendEthContent.amount) { - console.log("Amount is not provided, skipping transfer"); - callback?.({ text: "The amount must be provided" }); - return false; - } - - if (!sendEthContent.to) { - console.log("Destination address is not provided, skipping transfer"); - callback?.({ text: "The destination address must be provided" }); - return false; - } - - // Validate amount format - const cleanedAmount = sendEthContent.amount.replace(/[^\d.]/g, ''); - const parsedAmount = parseFloat(cleanedAmount); - if (isNaN(parsedAmount) || parsedAmount <= 0) { - throw new Error(`Invalid amount value: ${sendEthContent.amount}`); - } - - // Validate address format - if (!/^0x[a-fA-F0-9]{40}$/.test(sendEthContent.to)) { - throw new Error(`Invalid Ethereum address: ${sendEthContent.to}`); - } - - // Validate Lit environment - const litState = (state.lit || {}) as LitState; - if ( - !litState.nodeClient || - !litState.pkp || - !litState.evmWallet || - !litState.capacityCredit?.tokenId - ) { - throw new Error( - "Lit environment not fully initialized - missing nodeClient, pkp, evmWallet, or capacityCredit" - ); - } + if (!sendEthContent.amount) { + console.log("Amount is not provided, skipping transfer"); + callback?.({ text: "The amount must be provided" }); + return false; + } - // Get RPC URL from runtime settings - const rpcUrl = runtime.getSetting("EVM_RPC_URL"); - if (!rpcUrl) { - throw new Error("No RPC URL provided"); - } + if (!sendEthContent.to) { + console.log("Destination address is not provided, skipping transfer"); + callback?.({ text: "The destination address must be provided" }); + return false; + } - const provider = new ethers.providers.JsonRpcProvider(rpcUrl); + // Validate amount format + const cleanedAmount = sendEthContent.amount.replace(/[^\d.]/g, ''); + const parsedAmount = Number.parseFloat(cleanedAmount); + if (Number.isNaN(parsedAmount) || parsedAmount <= 0) { + throw new Error(`Invalid amount value: ${sendEthContent.amount}`); + } - // Create transaction - const nonce = await provider.getTransactionCount(litState.pkp.ethAddress); - const gasPrice = await provider.getGasPrice(); - const gasLimit = 30000; + // Validate address format + if (!/^0x[a-fA-F0-9]{40}$/.test(sendEthContent.to)) { + throw new Error(`Invalid Ethereum address: ${sendEthContent.to}`); + } - const unsignedTx = { - to: sendEthContent.to, - value: ethers.utils.parseEther(sendEthContent.amount), - chainId: 11155111, // Sepolia chainId - nonce: nonce, - gasPrice: gasPrice, - gasLimit: gasLimit, - }; - - const fundingWallet = new ethers.Wallet( - runtime.getSetting("FUNDING_PRIVATE_KEY"), - new ethers.providers.JsonRpcProvider(LIT_RPC.CHRONICLE_YELLOWSTONE) + // Validate Lit environment + const litState = (state.lit || {}) as LitState; + if ( + !litState.nodeClient || + !litState.pkp || + !litState.evmWallet || + !litState.capacityCredit?.tokenId + ) { + throw new Error( + "Lit environment not fully initialized - missing nodeClient, pkp, evmWallet, or capacityCredit" ); + } - const { capacityDelegationAuthSig } = - await litState.nodeClient.createCapacityDelegationAuthSig({ - dAppOwnerWallet: fundingWallet, - capacityTokenId: litState.capacityCredit.tokenId, - delegateeAddresses: [litState.pkp.ethAddress], - uses: "1", - expiration: new Date(Date.now() + 1000 * 60 * 10).toISOString(), // 10 minutes - }); + // Get RPC URL from runtime settings + const rpcUrl = runtime.getSetting("EVM_RPC_URL"); + if (!rpcUrl) { + throw new Error("No RPC URL provided"); + } - // Get session signatures with capacity delegation - console.log("Generating session signatures with capacity delegation..."); - const sessionSigs = await litState.nodeClient.getSessionSigs({ - pkpPublicKey: litState.pkp.publicKey, - chain: "sepolia", - capabilityAuthSigs: [capacityDelegationAuthSig], - expiration: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(), // 24 hours - resourceAbilityRequests: [ - { - resource: new LitPKPResource("*"), - ability: LIT_ABILITY.PKPSigning, - }, - { - resource: new LitActionResource("*"), - ability: LIT_ABILITY.LitActionExecution, - }, - ], - authNeededCallback: async ({ - resourceAbilityRequests, - expiration, - uri, - }) => { - const toSign = await createSiweMessageWithRecaps({ - uri: uri!, - expiration: expiration!, - resources: resourceAbilityRequests!, - walletAddress: litState.evmWallet.address, - nonce: await litState.nodeClient.getLatestBlockhash(), - litNodeClient: litState.nodeClient, - }); - - return await generateAuthSig({ - signer: litState.evmWallet, - toSign, - }); - }, - }); - console.log("Session signatures generated"); - - console.log("Signing transaction..."); - const sig = await litState.nodeClient.pkpSign({ - pubKey: litState.pkp.publicKey, - toSign: ethers.utils.arrayify( - ethers.utils.keccak256(ethers.utils.serializeTransaction(unsignedTx)) - ), - sessionSigs, + const provider = new ethers.providers.JsonRpcProvider(rpcUrl); + + // Create transaction + const nonce = await provider.getTransactionCount(litState.pkp.ethAddress); + const gasPrice = await provider.getGasPrice(); + const gasLimit = 30000; + + const unsignedTx = { + to: sendEthContent.to, + value: ethers.utils.parseEther(sendEthContent.amount), + chainId: 11155111, // Sepolia chainId + nonce: nonce, + gasPrice: gasPrice, + gasLimit: gasLimit, + }; + + const fundingWallet = new ethers.Wallet( + runtime.getSetting("FUNDING_PRIVATE_KEY"), + new ethers.providers.JsonRpcProvider(LIT_RPC.CHRONICLE_YELLOWSTONE) + ); + + const { capacityDelegationAuthSig } = + await litState.nodeClient.createCapacityDelegationAuthSig({ + dAppOwnerWallet: fundingWallet, + capacityTokenId: litState.capacityCredit.tokenId, + delegateeAddresses: [litState.pkp.ethAddress], + uses: "1", + expiration: new Date(Date.now() + 1000 * 60 * 10).toISOString(), // 10 minutes }); - // Combine signature with transaction - const signature = { - r: "0x" + sig.r, - s: "0x" + sig.s, - v: sig.recid === 0 ? 27 : 28, // Set v based on recid being 0 or 1 - }; + // Get session signatures with capacity delegation + console.log("Generating session signatures with capacity delegation..."); + const sessionSigs = await litState.nodeClient.getSessionSigs({ + pkpPublicKey: litState.pkp.publicKey, + chain: "sepolia", + capabilityAuthSigs: [capacityDelegationAuthSig], + expiration: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(), // 24 hours + resourceAbilityRequests: [ + { + resource: new LitPKPResource("*"), + ability: LIT_ABILITY.PKPSigning, + }, + { + resource: new LitActionResource("*"), + ability: LIT_ABILITY.LitActionExecution, + }, + ], + authNeededCallback: async ({ + resourceAbilityRequests, + expiration, + uri, + }) => { + if (!uri || !expiration || !resourceAbilityRequests) { + throw new Error("Missing required parameters for auth callback"); + } + const toSign = await createSiweMessageWithRecaps({ + uri, + expiration, + resources: resourceAbilityRequests, + walletAddress: litState.evmWallet.address, + nonce: await litState.nodeClient.getLatestBlockhash(), + litNodeClient: litState.nodeClient, + }); - // Verify signature by recovering the address - const msgHash = ethers.utils.keccak256( - ethers.utils.serializeTransaction(unsignedTx) + return await generateAuthSig({ + signer: litState.evmWallet, + toSign, + }); + }, + }); + console.log("Session signatures generated"); + + console.log("Signing transaction..."); + const sig = await litState.nodeClient.pkpSign({ + pubKey: litState.pkp.publicKey, + toSign: ethers.utils.arrayify( + ethers.utils.keccak256(ethers.utils.serializeTransaction(unsignedTx)) + ), + sessionSigs, + }); + + // Combine signature with transaction + const signature = { + r: `0x${sig.r}`, + s: `0x${sig.s}`, + v: sig.recid === 0 ? 27 : 28, + }; + + // Verify signature by recovering the address + const msgHash = ethers.utils.keccak256( + ethers.utils.serializeTransaction(unsignedTx) + ); + const recoveredAddress = ethers.utils.recoverAddress(msgHash, signature); + + // If address doesn't match, try the other v value + if ( + recoveredAddress.toLowerCase() !== litState.pkp.ethAddress.toLowerCase() + ) { + signature.v = signature.v === 27 ? 28 : 27; // Toggle between 27 and 28 + const altRecoveredAddress = ethers.utils.recoverAddress( + msgHash, + signature ); - const recoveredAddress = ethers.utils.recoverAddress(msgHash, signature); - // If address doesn't match, try the other v value if ( - recoveredAddress.toLowerCase() !== litState.pkp.ethAddress.toLowerCase() + altRecoveredAddress.toLowerCase() !== + litState.pkp.ethAddress.toLowerCase() ) { - signature.v = signature.v === 27 ? 28 : 27; // Toggle between 27 and 28 - const altRecoveredAddress = ethers.utils.recoverAddress( - msgHash, - signature - ); - - if ( - altRecoveredAddress.toLowerCase() !== - litState.pkp.ethAddress.toLowerCase() - ) { - throw new Error("Failed to recover correct address from signature"); - } + throw new Error("Failed to recover correct address from signature"); } + } - const signedTx = ethers.utils.serializeTransaction(unsignedTx, signature); - - // Send transaction - console.log("Sending transaction..."); - const sentTx = await provider.sendTransaction(signedTx); - await sentTx.wait(); + const signedTx = ethers.utils.serializeTransaction(unsignedTx, signature); - callback?.({ - text: `Successfully sent ${sendEthContent.amount} ETH to ${sendEthContent.to}. Transaction hash: ${sentTx.hash}`, - content: { - success: true, - hash: sentTx.hash, - amount: sendEthContent.amount, - to: sendEthContent.to, - }, - }); + // Send transaction + console.log("Sending transaction..."); + const sentTx = await provider.sendTransaction(signedTx); + await sentTx.wait(); - return true; - } catch (error) { - console.error("Error in sendEth:", error); - callback?.({ - text: `Failed to send ETH: ${ - error instanceof Error ? error.message : "Unknown error" - }`, - content: { - success: false, - error: error instanceof Error ? error.message : "Unknown error", - }, - }); - return false; - } - }, - examples: [ - [ - { - user: "{{user1}}", - content: { - text: "Send 0.01 ETH to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - }, + callback?.({ + text: `Successfully sent ${sendEthContent.amount} ETH to ${sendEthContent.to}. Transaction hash: ${sentTx.hash}`, + content: { + success: true, + hash: sentTx.hash, + amount: sendEthContent.amount, + to: sendEthContent.to, }, - { - user: "{{user2}}", - content: { - text: "Successfully sent ETH", - }, + }); + + return true; + } catch (error) { + console.error("Error in sendEth:", error); + callback?.({ + text: `Failed to send ETH: ${ + error instanceof Error ? error.message : "Unknown error" + }`, + content: { + success: false, + error: error instanceof Error ? error.message : "Unknown error", + }, + }); + return false; + } + }, + examples: [ + [ + { + user: "{{user1}}", + content: { + text: "Send 0.01 ETH to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e", }, - ], + }, + { + user: "{{user2}}", + content: { + text: "Successfully sent ETH", + }, + }, ], - }; + ], +}; diff --git a/packages/plugin-lit/src/actions/sendSol.ts b/packages/plugin-lit/src/actions/sendSol.ts index 7fdc32e4bc2..ae13f88cf79 100644 --- a/packages/plugin-lit/src/actions/sendSol.ts +++ b/packages/plugin-lit/src/actions/sendSol.ts @@ -16,6 +16,7 @@ import * as ethers from "ethers"; import { LitConfigManager } from "../config/configManager"; import { composeContext, generateObject, ModelClass } from "@elizaos/core"; import { z } from "zod"; +import { sendUsdcSchema } from "./sendUSDC"; const { importPrivateKey, signTransactionWithEncryptedKey } = api; @@ -82,7 +83,7 @@ export const sendSol: Action = { "transfer * sol to *", "transfer * SOL to *", ], - validate: async (runtime: IAgentRuntime) => true, + validate: async (_runtime: IAgentRuntime) => true, handler: async ( runtime: IAgentRuntime, message: Memory, @@ -92,19 +93,21 @@ export const sendSol: Action = { ): Promise => { console.log("SEND_SOL handler started"); try { - // Update state if needed + // Initialize or update state + let currentState: State; if (!state) { - state = await runtime.composeState(message); + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose context and generate content const sendSolContext = composeContext({ - state, + state: currentState, template: sendSolTemplate, }); + // Generate content with the schema // Generate content with the schema const content = await generateObject({ runtime, @@ -207,7 +210,10 @@ export const sendSol: Action = { } // Fund the wallet with 2 devnet SOL if needed - const fromPubkey = new web3.PublicKey(litState.pkp.solanaAddress!); + if (!litState.pkp.solanaAddress) { + throw new Error("Solana address not found in PKP"); + } + const fromPubkey = new web3.PublicKey(litState.pkp.solanaAddress); const toPubkey = new web3.PublicKey(sendSolContent.to); console.log("Sending from wallet address:", fromPubkey.toString()); @@ -249,7 +255,7 @@ export const sendSol: Action = { web3.SystemProgram.transfer({ fromPubkey, toPubkey, - lamports: web3.LAMPORTS_PER_SOL * parseFloat(sendSolContent.amount), + lamports: web3.LAMPORTS_PER_SOL * Number.parseFloat(sendSolContent.amount), }) ); @@ -279,10 +285,13 @@ export const sendSol: Action = { // Sign and send transaction // For devnet: change 'mainnet-beta' to 'devnet' + if (!litState.wrappedKeyId) { + throw new Error("Wrapped key ID not found"); + } const signedTx = await signTransactionWithEncryptedKey({ pkpSessionSigs, network: "solana", - id: litState.wrappedKeyId!, + id: litState.wrappedKeyId, unsignedTransaction: { chain: 'mainnet-beta', serializedTransaction: transaction.serialize({ diff --git a/packages/plugin-lit/src/actions/sendUSDC.ts b/packages/plugin-lit/src/actions/sendUSDC.ts index 4acbb419bc0..36bbeb846bd 100644 --- a/packages/plugin-lit/src/actions/sendUSDC.ts +++ b/packages/plugin-lit/src/actions/sendUSDC.ts @@ -41,7 +41,7 @@ Given the recent messages, extract the following information about the USDC tran Respond with a JSON markdown block containing only the extracted values.`; // Define the schema type -const sendUsdcSchema = z.object({ +export const sendUsdcSchema = z.object({ amount: z.string().nullable(), to: z.string().nullable() }); @@ -63,7 +63,7 @@ export const sendUSDC: Action = { name: "SEND_USDC", description: "Sends USDC to an address on Sepolia using PKP wallet", similes: ["send usdc", "send * usdc to *", "transfer * usdc to *"], - validate: async (runtime: IAgentRuntime) => true, + validate: async (_runtime: IAgentRuntime) => true, handler: async ( runtime: IAgentRuntime, message: Memory, @@ -72,16 +72,17 @@ export const sendUSDC: Action = { callback?: HandlerCallback ): Promise => { try { - // Update state if needed + // Initialize or update state + let currentState: State; if (!state) { - state = await runtime.composeState(message); + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose context and generate content const sendUsdcContext = composeContext({ - state, + state: currentState, template: sendUsdcTemplate, }); @@ -158,10 +159,13 @@ export const sendUSDC: Action = { { resource: new LitActionResource("*"), ability: LIT_ABILITY.LitActionExecution }, ], authNeededCallback: async ({ resourceAbilityRequests, expiration, uri }) => { + if (!uri || !expiration || !resourceAbilityRequests) { + throw new Error("Missing required parameters for auth callback"); + } const toSign = await createSiweMessageWithRecaps({ - uri: uri!, - expiration: expiration!, - resources: resourceAbilityRequests!, + uri, + expiration, + resources: resourceAbilityRequests, walletAddress: litState.evmWallet.address, nonce: await litState.nodeClient.getLatestBlockhash(), litNodeClient: litState.nodeClient, @@ -176,7 +180,7 @@ export const sendUSDC: Action = { sessionSigs, }); - const signature = { r: "0x" + sig.r, s: "0x" + sig.s, v: sig.recid === 0 ? 27 : 28 }; + const signature = { r: `0x${sig.r}`, s: `0x${sig.s}`, v: sig.recid === 0 ? 27 : 28 }; const signedTx = ethers.utils.serializeTransaction(unsignedTx, signature); const sentTx = await provider.sendTransaction(signedTx); await sentTx.wait(); diff --git a/packages/plugin-lit/src/config/configManager.ts b/packages/plugin-lit/src/config/configManager.ts index 85dfb0ed140..02c412e1906 100644 --- a/packages/plugin-lit/src/config/configManager.ts +++ b/packages/plugin-lit/src/config/configManager.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import path from "path"; +import fs from "node:fs"; +import path from "node:path"; export interface LitConfig { pkp: { @@ -46,7 +46,7 @@ export class LitConfigManager { } } - async verifyConfig(config: LitConfig): Promise { + async verifyConfig(_config: LitConfig): Promise { // Add verification logic here // For example, check if the PKP is still valid // Return false if verification fails diff --git a/packages/plugin-lit/src/providers/pkpPermissionsProvider.ts b/packages/plugin-lit/src/providers/pkpPermissionsProvider.ts index 0634a458ac2..8a8b31b0ee2 100644 --- a/packages/plugin-lit/src/providers/pkpPermissionsProvider.ts +++ b/packages/plugin-lit/src/providers/pkpPermissionsProvider.ts @@ -17,7 +17,7 @@ interface LitState { export const pkpPermissionsProvider = { addPermissions: async ( - runtime: IAgentRuntime, + _runtime: IAgentRuntime, _message: Memory, state: State, tokenId: string, diff --git a/packages/plugin-massa/package.json b/packages/plugin-massa/package.json index 7c18f6756da..a3aa5db87c6 100644 --- a/packages/plugin-massa/package.json +++ b/packages/plugin-massa/package.json @@ -1,18 +1,18 @@ { - "name": "@elizaos/plugin-massa", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "@massalabs/massa-web3": "^5.0.1-dev", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-massa", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "@massalabs/massa-web3": "^5.0.1-dev", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-massa/src/actions/transfer.ts b/packages/plugin-massa/src/actions/transfer.ts index eaada0fbe56..753b44db252 100644 --- a/packages/plugin-massa/src/actions/transfer.ts +++ b/packages/plugin-massa/src/actions/transfer.ts @@ -33,7 +33,13 @@ export interface TransferContent extends Content { amount: string; } -export function isTransferContent(content: any): content is TransferContent { +interface TransferContentInput { + tokenAddress?: string | unknown; + recipient?: string | unknown; + amount?: string | number | unknown; +} + +export function isTransferContent(content: TransferContentInput): content is TransferContent { elizaLogger.log("Starting SEND_TOKEN content", content); // Validate types @@ -47,15 +53,16 @@ export function isTransferContent(content: any): content is TransferContent { return false; } - const tokenAddr = validateAddress(content.tokenAddress); + // Now TypeScript knows these are strings after validTypes check + const tokenAddr = validateAddress(content.tokenAddress as string); if (!tokenAddr || tokenAddr.isEOA) { return false; } - const recipient: string = content.recipient; + const recipient = content.recipient as string; // Additional checks based on whether recipient or mns is defined if (recipient && !recipient.endsWith(".massa")) { - Address.fromString(content.recipient); + Address.fromString(recipient); } return true; @@ -120,10 +127,11 @@ export default { elizaLogger.log("Starting SEND_TOKEN handler..."); // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } const secretKey = runtime.getSetting("MASSA_PRIVATE_KEY"); @@ -141,7 +149,7 @@ export default { const { chainId } = await provider.networkInfos(); // Compose transfer context const transferContext = composeContext({ - state, + state: currentState, template: transferTemplate( chainId === CHAIN_ID.Mainnet ? MAINNET_TOKENS : BUILDNET_TOKENS ), @@ -176,14 +184,15 @@ export default { try { recipientAddress = await getMnsTarget(provider, content.recipient.substring(0, content.recipient.length - ".massa".length)); Address.fromString(recipientAddress); - } catch (error: any) { + } catch (error: unknown) { + const errorMessage = error instanceof Error ? error.message : String(error); elizaLogger.error( "Error resolving MNS target:", - error?.message + errorMessage ); if (callback) { callback({ - text: `Error resolving MNS target: ${error?.message}`, + text: `Error resolving MNS target: ${errorMessage}`, content: { error: error }, }); } @@ -212,7 +221,7 @@ export default { await operation.waitSpeculativeExecution(); elizaLogger.success( - "Transfer completed successfully! Operation id: " + operation.id + `Successfully transferred ${content.amount} tokens to ${content.recipient}\nOperationId: ${operation.id}`, ); if (callback) { callback({ @@ -228,12 +237,12 @@ export default { } return true; - } catch (error: any) { - elizaLogger.error("Error during token transfer:", error?.message); + } catch (error: unknown) { + elizaLogger.error("Error during token transfer:", error); if (callback) { callback({ - text: `Error transferring tokens: ${error?.message}`, - content: { error: error }, + text: `Error transferring tokens: ${error instanceof Error ? error.message : String(error)}`, + content: { error }, }); } return false; diff --git a/packages/plugin-mina/src/actions/balance.ts b/packages/plugin-mina/src/actions/balance.ts index 8d9637bc59d..c10962675fc 100644 --- a/packages/plugin-mina/src/actions/balance.ts +++ b/packages/plugin-mina/src/actions/balance.ts @@ -14,6 +14,7 @@ import { import { z } from "zod"; import { walletProvider } from "../providers/wallet"; import { PublicKey, TokenId, fetchAccount } from "o1js"; +import type { UInt64 } from "o1js"; import BigNumber from "bignumber.js"; export interface BalanceContent extends Content { @@ -44,10 +45,16 @@ Extract the following information about the requested Balance request: Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined.`; +interface MinaAccount { + account: { + balance: UInt64; + }; +} + export default { name: "BALANCE", similes: ["BALANCE", "GET_BALANCE", "CHECK_BALANCE"], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, message: Memory) => { console.log("Validating mina Balance from user:", message.userId); return true; }, @@ -65,21 +72,22 @@ export default { state.walletInfo = walletInfo; // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } - + // Define the schema for the expected output const BalanceSchema = z.object({ address: z.string(), token: z.union([z.string(), z.null()]), }); - + // Compose Balance context const BalanceContext = composeContext({ - state, + state: currentState, template: BalanceTemplate, }); @@ -107,7 +115,7 @@ export default { try { const address = PublicKey.fromBase58(BalanceContent.address); - let account; + let account: MinaAccount; if (!BalanceContent.token) { account = await fetchAccount({ publicKey: address }); } else { @@ -118,8 +126,8 @@ export default { }); } const balance = new BigNumber( - account.account.balance.div(1e9), - ).toFixed(2); + account.account.balance.toString() + ).div(1e9).toFixed(2); console.log("Balance successful: ", balance.toString()); diff --git a/packages/plugin-mina/src/actions/faucet.ts b/packages/plugin-mina/src/actions/faucet.ts index fb68df21692..da3155b7602 100644 --- a/packages/plugin-mina/src/actions/faucet.ts +++ b/packages/plugin-mina/src/actions/faucet.ts @@ -52,7 +52,7 @@ Respond with a JSON markdown block containing only the extracted values. Use nul export default { name: "FAUCET", similes: ["FAUCET", "GET_TEST_TOKENS"], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, message: Memory) => { console.log("Validating mina Faucet from user:", message.userId); return true; }, @@ -70,10 +70,11 @@ export default { state.walletInfo = walletInfo; // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Define the schema for the expected output @@ -81,7 +82,7 @@ export default { // Compose Faucet context const FaucetContext = composeContext({ - state, + state: currentState, template: FaucetTemplate, }); diff --git a/packages/plugin-mina/src/actions/transfer.ts b/packages/plugin-mina/src/actions/transfer.ts index e2cba00b6fe..3cbb37c584d 100644 --- a/packages/plugin-mina/src/actions/transfer.ts +++ b/packages/plugin-mina/src/actions/transfer.ts @@ -60,7 +60,7 @@ export default { "SEND_MINA", "PAY", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, message: Memory) => { console.log("Validating mina transfer from user:", message.userId); return true; }, @@ -78,10 +78,11 @@ export default { state.walletInfo = walletInfo; // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Define the schema for the expected output @@ -92,7 +93,7 @@ export default { // Compose transfer context const transferContext = composeContext({ - state, + state: currentState, template: transferTemplate, }); diff --git a/packages/plugin-mina/src/providers/wallet.ts b/packages/plugin-mina/src/providers/wallet.ts index 979ad278003..5b0fbf1818a 100644 --- a/packages/plugin-mina/src/providers/wallet.ts +++ b/packages/plugin-mina/src/providers/wallet.ts @@ -8,7 +8,7 @@ import type { import { Mina, PublicKey, UInt64, fetchAccount } from "o1js"; import NodeCache from "node-cache"; -import * as path from "path"; +import * as path from "node:path"; import { parseAccount } from "../utils"; import { MINA_UNIT, USD_UNIT } from "../constants"; import BigNumber from "bignumber.js"; @@ -93,7 +93,7 @@ export class WalletProvider { for (let i = 0; i < PROVIDER_CONFIG.MAX_RETRIES; i++) { try { const response = await fetch( - `https://data-api.binance.vision/api/v3/ticker/price?symbols=[%22MINAUSDT%22]`, + "https://data-api.binance.vision/api/v3/ticker/price?symbols=[%22MINAUSDT%22]", ); if (!response.ok) { @@ -109,9 +109,8 @@ export class WalletProvider { console.error(`Attempt ${i + 1} failed:`, error); lastError = error; if (i < PROVIDER_CONFIG.MAX_RETRIES - 1) { - const delay = PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i); + const delay = PROVIDER_CONFIG.RETRY_DELAY * (2 ** i); // Using ** instead of Math.pow await new Promise((resolve) => setTimeout(resolve, delay)); - continue; } } } diff --git a/packages/plugin-mind-network/src/actions/encryptAction.ts b/packages/plugin-mind-network/src/actions/encryptAction.ts index 4fbf5f71ca0..a984423a8d4 100644 --- a/packages/plugin-mind-network/src/actions/encryptAction.ts +++ b/packages/plugin-mind-network/src/actions/encryptAction.ts @@ -53,6 +53,8 @@ export const encryptAction: Action = { state: resolvedState, template: dataExtractionTemplate, }); + elizaLogger.log("Data context:", dataContext); + const content = ( await generateObject({ runtime, diff --git a/packages/plugin-moralis/src/actions/solana/getPairOHLCV.ts b/packages/plugin-moralis/src/actions/solana/getPairOHLCV.ts index 6acd1fe9f59..a9cb02baaea 100644 --- a/packages/plugin-moralis/src/actions/solana/getPairOHLCV.ts +++ b/packages/plugin-moralis/src/actions/solana/getPairOHLCV.ts @@ -24,7 +24,7 @@ export default { "SHOW_SOLANA_PAIR_CANDLES", "CHECK_SOLANA_PRICE_CHART", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateMoralisConfig(runtime); return true; }, @@ -39,16 +39,18 @@ export default { ): Promise => { elizaLogger.log("Starting Moralis GET_SOLANA_PAIR_OHLCV handler..."); + // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } try { elizaLogger.log("Composing OHLCV request context..."); const ohlcvContext = composeContext({ - state, + state: currentState, template: getPairOHLCVTemplate, }); @@ -112,7 +114,7 @@ export default { if (candles.length === 0) { if (callback) { callback({ - text: `No price history data available for this Solana trading pair in the specified time range.`, + text: "No price history data available for this Solana trading pair in the specified time range.", content: { candles: [], pairAddress: content.pairAddress, @@ -177,7 +179,7 @@ export default { summaryText += `Latest ${displayCount} candles:\n`; // Add latest candles - sortedCandles.slice(0, displayCount).forEach((candle) => { + for (const candle of sortedCandles.slice(0, displayCount)) { const date = new Date(candle.timestamp).toLocaleString(); summaryText += `\nTime: ${date}\n` + @@ -185,7 +187,7 @@ export default { `Low: $${candle.low.toFixed(4)}, Close: $${candle.close.toFixed(4)}\n` + `Volume: $${Math.round(candle.volume).toLocaleString()}, ` + `Trades: ${candle.trades.toLocaleString()}`; - }); + } callback({ text: summaryText, @@ -202,9 +204,9 @@ export default { } return true; - } catch (error: any) { + } catch (error: unknown) { elizaLogger.error("Error in GET_SOLANA_PAIR_OHLCV handler:", error); - const errorMessage = error.response?.data?.message || error.message; + const errorMessage = error instanceof Error ? error.message : String(error); if (callback) { callback({ text: `Error fetching Solana pair OHLCV data: ${errorMessage}`, diff --git a/packages/plugin-moralis/src/actions/solana/getPairStats.ts b/packages/plugin-moralis/src/actions/solana/getPairStats.ts index d77b1ba5552..e5dc1cde114 100644 --- a/packages/plugin-moralis/src/actions/solana/getPairStats.ts +++ b/packages/plugin-moralis/src/actions/solana/getPairStats.ts @@ -24,7 +24,7 @@ export default { "GET_SOLANA_PAIR_INFO", "CHECK_SOLANA_PAIR_STATS", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateMoralisConfig(runtime); return true; }, @@ -38,17 +38,18 @@ export default { callback?: HandlerCallback ): Promise => { elizaLogger.log("Starting Moralis GET_SOLANA_PAIR_STATS handler..."); - + // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } try { elizaLogger.log("Composing pair stats context..."); const statsContext = composeContext({ - state, + state: currentState, template: getPairStatsTemplate, }); @@ -115,12 +116,14 @@ export default { } return true; - } catch (error: any) { + } catch (error: unknown) { elizaLogger.error("Error in GET_SOLANA_PAIR_STATS handler:", error); + const errorMessage = + error instanceof Error ? error.message : String(error); if (callback) { callback({ - text: `Error fetching Solana pair stats: ${error.message}`, - content: { error: error.message }, + text: `Error fetching Solana pair stats: ${errorMessage}`, + content: { error: errorMessage }, }); } return false; diff --git a/packages/plugin-moralis/src/actions/solana/getTokenMetadata.ts b/packages/plugin-moralis/src/actions/solana/getTokenMetadata.ts index e9f59b2fc16..8493f082875 100644 --- a/packages/plugin-moralis/src/actions/solana/getTokenMetadata.ts +++ b/packages/plugin-moralis/src/actions/solana/getTokenMetadata.ts @@ -24,7 +24,7 @@ export default { "CHECK_SOLANA_TOKEN_FDV", "SHOW_SOLANA_TOKEN_METADATA", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateMoralisConfig(runtime); return true; }, @@ -41,16 +41,18 @@ export default { "Starting Moralis GET_SOLANA_TOKEN_METADATA handler..." ); + // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } try { elizaLogger.log("Composing token metadata context..."); const metadataContext = composeContext({ - state, + state: currentState, template: getTokenMetadataTemplate, }); @@ -90,19 +92,20 @@ export default { ); if (callback) { - const formattedText = - `Token Metadata:\n\n` + - `Name: ${metadata.name} (${metadata.symbol})\n` + - `Token Address: ${metadata.mint}\n` + - `Total Supply: ${metadata.totalSupplyFormatted}\n` + - `Fully Diluted Value: $${Number(metadata.fullyDilutedValue).toLocaleString()}\n` + - `Standard: ${metadata.standard}\n` + - `Decimals: ${metadata.decimals}\n\n` + - `Metaplex Details:\n` + - `- Update Authority: ${metadata.metaplex.updateAuthority}\n` + - `- Mutable: ${metadata.metaplex.isMutable}\n` + - `- Master Edition: ${metadata.metaplex.masterEdition}\n` + - `- Seller Fee: ${metadata.metaplex.sellerFeeBasisPoints / 100}%`; + const formattedText = [ + 'Token Metadata:\n', + `Name: ${metadata.name} (${metadata.symbol})`, + `Token Address: ${metadata.mint}`, + `Total Supply: ${metadata.totalSupplyFormatted}`, + `Fully Diluted Value: $${Number(metadata.fullyDilutedValue).toLocaleString()}`, + `Standard: ${metadata.standard}`, + `Decimals: ${metadata.decimals}\n`, + 'Metaplex Details:', + `- Update Authority: ${metadata.metaplex.updateAuthority}`, + `- Mutable: ${metadata.metaplex.isMutable}`, + `- Master Edition: ${metadata.metaplex.masterEdition}`, + `- Seller Fee: ${metadata.metaplex.sellerFeeBasisPoints / 100}%` + ].join('\n'); callback({ text: formattedText, @@ -111,12 +114,12 @@ export default { } return true; - } catch (error: any) { + } catch (error: unknown) { elizaLogger.error( "Error in GET_SOLANA_TOKEN_METADATA handler:", error ); - const errorMessage = error.response?.data?.message || error.message; + const errorMessage = error instanceof Error ? error.message : String(error); if (callback) { callback({ text: `Error fetching Solana token metadata: ${errorMessage}`, diff --git a/packages/plugin-moralis/src/actions/solana/getTokenPairs.ts b/packages/plugin-moralis/src/actions/solana/getTokenPairs.ts index 6466ad6e94a..10854ebf096 100644 --- a/packages/plugin-moralis/src/actions/solana/getTokenPairs.ts +++ b/packages/plugin-moralis/src/actions/solana/getTokenPairs.ts @@ -24,7 +24,7 @@ export default { "SHOW_SOLANA_PAIRS", "GET_SOLANA_TRADING_PAIRS", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateMoralisConfig(runtime); return true; }, @@ -38,16 +38,18 @@ export default { ): Promise => { elizaLogger.log("Starting Moralis GET_SOLANA_TOKEN_PAIRS handler..."); + // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } try { elizaLogger.log("Composing token pairs context..."); const pairsContext = composeContext({ - state, + state: currentState, template: getTokenPairsTemplate, }); @@ -121,15 +123,17 @@ export default { } return true; - } catch (error: any) { + } catch (error: unknown) { elizaLogger.error( "Error in GET_SOLANA_TOKEN_PAIRS handler:", error ); + const errorMessage = + error instanceof Error ? error.message : String(error); if (callback) { callback({ - text: `Error fetching Solana token pairs: ${error.message}`, - content: { error: error.message }, + text: `Error fetching Solana token pairs: ${errorMessage}`, + content: { error: errorMessage }, }); } return false; diff --git a/packages/plugin-moralis/src/actions/solana/getTokenPrice.ts b/packages/plugin-moralis/src/actions/solana/getTokenPrice.ts index 587c53284a0..cb59c22dea6 100644 --- a/packages/plugin-moralis/src/actions/solana/getTokenPrice.ts +++ b/packages/plugin-moralis/src/actions/solana/getTokenPrice.ts @@ -23,7 +23,7 @@ export default { "CHECK_SOLANA_TOKEN_PRICE", "SHOW_SOLANA_TOKEN_PRICE", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateMoralisConfig(runtime); return true; }, @@ -37,16 +37,18 @@ export default { ): Promise => { elizaLogger.log("Starting Moralis GET_SOLANA_TOKEN_PRICE handler..."); + // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } try { elizaLogger.log("Composing token price context..."); const priceContext = composeContext({ - state, + state: currentState, template: getTokenPriceTemplate, }); @@ -86,11 +88,13 @@ export default { ); if (callback) { - const formattedText = - `Current price for the Solana token:\n\n` + - `USD Price: $${price.usdPrice.toFixed(6)}\n` + - `Native Price: ${(Number(price.nativePrice.value) / Math.pow(10, price.nativePrice.decimals)).toFixed(6)} ${price.nativePrice.symbol}\n` + - `Exchange: ${price.exchangeName} (${price.exchangeAddress})`; + const formattedText = [ + 'Current price for the Solana token:', + '', + `USD Price: $${price.usdPrice.toFixed(6)}`, + `Native Price: ${(Number(price.nativePrice.value) / (10 ** price.nativePrice.decimals)).toFixed(6)} ${price.nativePrice.symbol}`, + `Exchange: ${price.exchangeName} (${price.exchangeAddress})` + ].join('\n'); callback({ text: formattedText, @@ -99,12 +103,12 @@ export default { } return true; - } catch (error: any) { + } catch (error: unknown) { elizaLogger.error( "Error in GET_SOLANA_TOKEN_PRICE handler:", error ); - const errorMessage = error.response?.data?.message || error.message; + const errorMessage = error instanceof Error ? error.message : String(error); if (callback) { callback({ text: `Error fetching Solana token price: ${errorMessage}`, diff --git a/packages/plugin-moralis/src/actions/solana/getTokenStats.ts b/packages/plugin-moralis/src/actions/solana/getTokenStats.ts index 97436b72f11..18ff5449605 100644 --- a/packages/plugin-moralis/src/actions/solana/getTokenStats.ts +++ b/packages/plugin-moralis/src/actions/solana/getTokenStats.ts @@ -24,7 +24,7 @@ export default { "SHOW_SOLANA_TOKEN_STATS", "CHECK_SOLANA_TOKEN_STATS", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateMoralisConfig(runtime); return true; }, @@ -39,16 +39,18 @@ export default { ): Promise => { elizaLogger.log("Starting Moralis GET_SOLANA_TOKEN_STATS handler..."); + // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } try { elizaLogger.log("Composing token stats context..."); const statsContext = composeContext({ - state, + state: currentState, template: getTokenStatsTemplate, }); @@ -88,24 +90,27 @@ export default { ); if (callback) { - const formattedStats = - `Token Statistics Overview:\n\n` + - `Market Overview:\n` + - `- Total Liquidity: $${Math.round(stats.totalLiquidityUsd).toLocaleString()}\n` + - `- Active Pairs: ${stats.totalActivePairs}\n` + - `- Active DEXes: ${stats.totalActiveDexes}\n\n` + - `24h Trading Activity:\n` + - `- Total Volume: $${Math.round(stats.totalVolume["24h"]).toLocaleString()}\n` + - ` • Buy Volume: $${Math.round(stats.totalBuyVolume["24h"]).toLocaleString()}\n` + - ` • Sell Volume: $${Math.round(stats.totalSellVolume["24h"]).toLocaleString()}\n` + - `- Total Trades: ${stats.totalSwaps["24h"].toLocaleString()}\n` + - `- Unique Traders:\n` + - ` • Buyers: ${stats.totalBuyers["24h"]}\n` + - ` • Sellers: ${stats.totalSellers["24h"]}\n\n` + - `Recent Activity (Past Hour):\n` + - `- Volume: $${Math.round(stats.totalVolume["1h"]).toLocaleString()}\n` + - `- Trades: ${stats.totalSwaps["1h"]}\n` + - `- Active Traders: ${stats.totalBuyers["1h"] + stats.totalSellers["1h"]}`; + const formattedStats = [ + 'Token Statistics Overview:\n', + 'Market Overview:', + `- Total Liquidity: $${Math.round(stats.totalLiquidityUsd).toLocaleString()}`, + `- Active Pairs: ${stats.totalActivePairs}`, + `- Active DEXes: ${stats.totalActiveDexes}`, + '', + '24h Trading Activity:', + `- Total Volume: $${Math.round(stats.totalVolume["24h"]).toLocaleString()}`, + ` • Buy Volume: $${Math.round(stats.totalBuyVolume["24h"]).toLocaleString()}`, + ` • Sell Volume: $${Math.round(stats.totalSellVolume["24h"]).toLocaleString()}`, + `- Total Trades: ${stats.totalSwaps["24h"].toLocaleString()}`, + '- Unique Traders:', + ` • Buyers: ${stats.totalBuyers["24h"]}`, + ` • Sellers: ${stats.totalSellers["24h"]}`, + '', + 'Recent Activity (Past Hour):', + `- Volume: $${Math.round(stats.totalVolume["1h"]).toLocaleString()}`, + `- Trades: ${stats.totalSwaps["1h"]}`, + `- Active Traders: ${stats.totalBuyers["1h"] + stats.totalSellers["1h"]}` + ].join('\n'); callback({ text: formattedStats, @@ -114,12 +119,12 @@ export default { } return true; - } catch (error: any) { + } catch (error: unknown) { elizaLogger.error( "Error in GET_SOLANA_TOKEN_STATS handler:", error ); - const errorMessage = error.response?.data?.message || error.message; + const errorMessage = error instanceof Error ? error.message : String(error); if (callback) { callback({ text: `Error fetching Solana token stats: ${errorMessage}`, diff --git a/packages/plugin-movement/package.json b/packages/plugin-movement/package.json index a482184bf76..177c7f7d07f 100644 --- a/packages/plugin-movement/package.json +++ b/packages/plugin-movement/package.json @@ -1,29 +1,29 @@ { - "name": "@elizaos/plugin-movement", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "description": "Movement Network Plugin for Eliza", - "dependencies": { - "@elizaos/core": "workspace:*", - "@aptos-labs/ts-sdk": "^1.26.0", - "bignumber": "1.1.0", - "bignumber.js": "9.1.2", - "node-cache": "5.1.2" - }, - "devDependencies": { - "tsup": "8.3.5", - "vitest": "2.1.4", - "typescript": "^5.0.0" - }, - "scripts": { - "build": "tsup", - "dev": "tsup --watch", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-movement", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "description": "Movement Network Plugin for Eliza", + "dependencies": { + "@aptos-labs/ts-sdk": "^1.26.0", + "@elizaos/core": "workspace:*", + "bignumber": "1.1.0", + "bignumber.js": "9.1.2", + "node-cache": "5.1.2" + }, + "devDependencies": { + "tsup": "8.3.5", + "typescript": "^5.0.0", + "vitest": "2.1.4" + }, + "scripts": { + "build": "tsup", + "dev": "tsup --watch", + "test": "vitest run" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-movement/src/actions/transfer.ts b/packages/plugin-movement/src/actions/transfer.ts index 470086cfd88..41dcd6ee2cf 100644 --- a/packages/plugin-movement/src/actions/transfer.ts +++ b/packages/plugin-movement/src/actions/transfer.ts @@ -21,19 +21,23 @@ import { PrivateKeyVariants, } from "@aptos-labs/ts-sdk"; import { walletProvider } from "../providers/wallet"; -import { MOVEMENT_NETWORK_CONFIG, MOVE_DECIMALS, MOVEMENT_EXPLORER_URL } from "../constants"; +import { + MOVEMENT_NETWORK_CONFIG, + MOVE_DECIMALS, + MOVEMENT_EXPLORER_URL, +} from "../constants"; export interface TransferContent extends Content { recipient: string; amount: string | number; } -function isTransferContent(content: any): content is TransferContent { +function isTransferContent(content: unknown): content is TransferContent { elizaLogger.debug("Validating transfer content:", content); return ( - typeof content.recipient === "string" && - (typeof content.amount === "string" || - typeof content.amount === "number") + typeof (content as TransferContent).recipient === "string" && + (typeof (content as TransferContent).amount === "string" || + typeof (content as TransferContent).amount === "number") ); } @@ -80,19 +84,27 @@ export default { "transfer token", "can you send", "please send", - "send" + "send", ], shouldHandle: (message: Memory) => { const text = message.content?.text?.toLowerCase() || ""; - return text.includes("send") && text.includes("move") && text.includes("0x"); + return ( + text.includes("send") && + text.includes("move") && + text.includes("0x") + ); }, - validate: async (runtime: IAgentRuntime, message: Memory) => { - elizaLogger.debug("Starting transfer validation for user:", message.userId); + validate: async (_runtime: IAgentRuntime, message: Memory) => { + elizaLogger.debug( + "Starting transfer validation for user:", + message.userId + ); elizaLogger.debug("Message text:", message.content?.text); return true; // Let the handler do the validation }, priority: 1000, // High priority for transfer actions - description: "Transfer Move tokens from the agent's wallet to another address", + description: + "Transfer Move tokens from the agent's wallet to another address", handler: async ( runtime: IAgentRuntime, message: Memory, @@ -104,16 +116,22 @@ export default { elizaLogger.debug("Message:", { text: message.content?.text, userId: message.userId, - action: message.content?.action + action: message.content?.action, }); try { const privateKey = runtime.getSetting("MOVEMENT_PRIVATE_KEY"); - elizaLogger.debug("Got private key:", privateKey ? "Present" : "Missing"); + elizaLogger.debug( + "Got private key:", + privateKey ? "Present" : "Missing" + ); const network = runtime.getSetting("MOVEMENT_NETWORK"); elizaLogger.debug("Network config:", network); - elizaLogger.debug("Available networks:", Object.keys(MOVEMENT_NETWORK_CONFIG)); + elizaLogger.debug( + "Available networks:", + Object.keys(MOVEMENT_NETWORK_CONFIG) + ); const movementAccount = Account.fromPrivateKey({ privateKey: new Ed25519PrivateKey( @@ -123,29 +141,40 @@ export default { ) ), }); - elizaLogger.debug("Created Movement account:", movementAccount.accountAddress.toStringLong()); + elizaLogger.debug( + "Created Movement account:", + movementAccount.accountAddress.toStringLong() + ); const aptosClient = new Aptos( new AptosConfig({ network: Network.CUSTOM, - fullnode: MOVEMENT_NETWORK_CONFIG[network].fullnode + fullnode: MOVEMENT_NETWORK_CONFIG[network].fullnode, }) ); - elizaLogger.debug("Created Aptos client with network:", MOVEMENT_NETWORK_CONFIG[network].fullnode); + elizaLogger.debug( + "Created Aptos client with network:", + MOVEMENT_NETWORK_CONFIG[network].fullnode + ); - const walletInfo = await walletProvider.get(runtime, message, state); + const walletInfo = await walletProvider.get( + runtime, + message, + state + ); state.walletInfo = walletInfo; // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose transfer context const transferContext = composeContext({ - state, + state: currentState, template: transferTemplate, }); @@ -169,7 +198,7 @@ export default { } const adjustedAmount = BigInt( - Number(content.amount) * Math.pow(10, MOVE_DECIMALS) + Number(content.amount) * 10 ** MOVE_DECIMALS ); console.log( `Transferring: ${content.amount} tokens (${adjustedAmount} base units)` @@ -197,7 +226,7 @@ export default { hash: executedTransaction.hash, amount: content.amount, recipient: content.recipient, - explorerUrl + explorerUrl, }); if (callback) { @@ -208,7 +237,7 @@ export default { hash: executedTransaction.hash, amount: content.amount, recipient: content.recipient, - explorerUrl + explorerUrl, }, }); } @@ -256,6 +285,6 @@ export default { action: "TRANSFER_MOVE", }, }, - ] + ], ] as ActionExample[][], } as Action; diff --git a/packages/plugin-movement/src/providers/wallet.ts b/packages/plugin-movement/src/providers/wallet.ts index fa824d65cd8..931164cc4c7 100644 --- a/packages/plugin-movement/src/providers/wallet.ts +++ b/packages/plugin-movement/src/providers/wallet.ts @@ -16,7 +16,7 @@ import { } from "@aptos-labs/ts-sdk"; import BigNumber from "bignumber.js"; import NodeCache from "node-cache"; -import * as path from "path"; +import * as path from "node:path"; import { MOVE_DECIMALS, MOVEMENT_NETWORK_CONFIG } from "../constants"; // Provider configuration @@ -109,9 +109,9 @@ export class WalletProvider { console.error(`Attempt ${i + 1} failed:`, error); lastError = error; if (i < PROVIDER_CONFIG.MAX_RETRIES - 1) { - const delay = PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i); + const delay = PROVIDER_CONFIG.RETRY_DELAY * (2 ** i); await new Promise((resolve) => setTimeout(resolve, delay)); - continue; + } } } diff --git a/packages/plugin-multiversx/README.md b/packages/plugin-multiversx/README.md index 4cb3148df7f..8400af721a2 100644 --- a/packages/plugin-multiversx/README.md +++ b/packages/plugin-multiversx/README.md @@ -164,7 +164,7 @@ pnpm test:watch ## Contributing -Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information. +Contributions are welcome! Please see the [CONTRIBUTING.md](../../CONTRIBUTING.md) file for more information. ## Credits diff --git a/packages/plugin-multiversx/package.json b/packages/plugin-multiversx/package.json index 94ddfe3fbbd..905230eaecf 100644 --- a/packages/plugin-multiversx/package.json +++ b/packages/plugin-multiversx/package.json @@ -1,41 +1,41 @@ { - "name": "@elizaos/plugin-multiversx", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@multiversx/sdk-core": "13.15.0", - "@multiversx/sdk-native-auth-client": "1.0.9", - "bignumber.js": "9.1.2", - "browserify": "^17.0.1", - "esbuild-plugin-polyfill-node": "^0.3.0", - "esmify": "^2.1.1", - "tsup": "8.3.5", - "vitest": "2.1.5", - "graphql-request": "7.1.2" - }, - "scripts": { - "build": "tsup --format esm --dts", - "test": "vitest run", - "test:watch": "vitest" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-multiversx", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@multiversx/sdk-core": "13.15.0", + "@multiversx/sdk-native-auth-client": "1.0.9", + "bignumber.js": "9.1.2", + "browserify": "^17.0.1", + "esbuild-plugin-polyfill-node": "^0.3.0", + "esmify": "^2.1.1", + "tsup": "8.3.5", + "vitest": "2.1.5", + "graphql-request": "7.1.2" + }, + "scripts": { + "build": "tsup --format esm --dts", + "test": "vitest run", + "test:watch": "vitest" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-multiversx/src/actions/createToken.ts b/packages/plugin-multiversx/src/actions/createToken.ts index ce59ce6e600..f227559b78f 100644 --- a/packages/plugin-multiversx/src/actions/createToken.ts +++ b/packages/plugin-multiversx/src/actions/createToken.ts @@ -79,15 +79,23 @@ export default { } // Initialize or update state + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + + // Initialize or update state + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose transfer context const transferContext = composeContext({ - state, + state: currentState, template: createTokenTemplate, }); diff --git a/packages/plugin-multiversx/src/actions/swap.ts b/packages/plugin-multiversx/src/actions/swap.ts index 69b9b1d237d..b8248f31812 100644 --- a/packages/plugin-multiversx/src/actions/swap.ts +++ b/packages/plugin-multiversx/src/actions/swap.ts @@ -106,15 +106,21 @@ export default { } // Initialize or update state + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose transfer context const swapContext = composeContext({ - state, + state: currentState, template: swapTemplate, }); diff --git a/packages/plugin-multiversx/src/actions/transfer.ts b/packages/plugin-multiversx/src/actions/transfer.ts index 2e0ebde8e1e..7dc1a625cc9 100644 --- a/packages/plugin-multiversx/src/actions/transfer.ts +++ b/packages/plugin-multiversx/src/actions/transfer.ts @@ -86,15 +86,22 @@ export default { } // Initialize or update state + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose transfer context const transferContext = composeContext({ - state, + state: currentState, template: transferTemplate, }); diff --git a/packages/plugin-multiversx/src/providers/wallet.ts b/packages/plugin-multiversx/src/providers/wallet.ts index 18f09618edf..147cdab8a90 100644 --- a/packages/plugin-multiversx/src/providers/wallet.ts +++ b/packages/plugin-multiversx/src/providers/wallet.ts @@ -25,7 +25,7 @@ export class WalletProvider { private apiNetworkProvider: ApiNetworkProvider; // Interacts with the MultiversX network private chainID: string; // Current network chain ID private explorerURL: string; // Current network explorer URL - private minEGLD: number = 0.0005; // Minimum balance for EGLD, in order to cover gas fees + private minEGLD = 0.0005; // Minimum balance for EGLD, in order to cover gas fees /** * Constructor to initialize WalletProvider with a private key and network configuration @@ -364,7 +364,7 @@ export class WalletProvider { */ public async signMessage(messageToSign: string) { const computer = new MessageComputer(); - let message = new Message({ + const message = new Message({ data: Buffer.from(messageToSign), }); diff --git a/packages/plugin-near/package.json b/packages/plugin-near/package.json index 0331aa9b977..1f441684fdc 100644 --- a/packages/plugin-near/package.json +++ b/packages/plugin-near/package.json @@ -1,38 +1,38 @@ { - "name": "@elizaos/plugin-near", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@ref-finance/ref-sdk": "^1.4.6", - "tsup": "8.3.5", - "near-api-js": "5.0.1", - "bignumber.js": "9.1.2", - "node-cache": "5.1.2" - }, - "scripts": { - "build": "tsup --format esm,cjs --dts", - "test": "vitest run", - "test:watch": "vitest" - }, - "peerDependencies": { - "whatwg-url": "7.1.0", - "form-data": "4.0.1" - } + "name": "@elizaos/plugin-near", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@ref-finance/ref-sdk": "^1.4.6", + "bignumber.js": "9.1.2", + "near-api-js": "5.0.1", + "node-cache": "5.1.2", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm,cjs --dts", + "test": "vitest run", + "test:watch": "vitest" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-near/src/actions/swap.ts b/packages/plugin-near/src/actions/swap.ts index a9464143265..5d87a8b6b00 100644 --- a/packages/plugin-near/src/actions/swap.ts +++ b/packages/plugin-near/src/actions/swap.ts @@ -23,15 +23,40 @@ import { import { walletProvider } from "../providers/wallet"; import type { KeyPairString } from "near-api-js/lib/utils"; +// Add interface for swap response +interface SwapResponse { + inputTokenId: string; + outputTokenId: string; + amount: string; +} + +// Add type for swap result +interface SwapTransaction { + receiverId: string; + functionCalls: Array<{ + methodName: string; + args: Record; + gas: string; + amount: string; + }>; +} + async function checkStorageBalance( - account: any, + account: unknown, contractId: string ): Promise { try { - const balance = await account.viewFunction({ + const balance = await (account as { + viewFunction: (args: { + contractId: string; + methodName: string; + args: { account_id: string }; + }) => Promise<{ total: string } | null>; + accountId: string; + }).viewFunction({ contractId, methodName: "storage_balance_of", - args: { account_id: account.accountId }, + args: { account_id: (account as { accountId: string }).accountId }, }); return balance !== null && balance.total !== "0"; } catch (error) { @@ -48,7 +73,7 @@ async function swapToken( slippageTolerance: number = Number( runtime.getSetting("SLIPPAGE_TOLERANCE") ) || 0.01 -): Promise { +): Promise { try { // Get token metadata const tokenIn = await ftGetTokenMetadata(inputTokenId); @@ -202,17 +227,25 @@ export const executeSwap: Action = { // Initialize Ref SDK with testnet environment init_env(runtime.getSetting("NEAR_NETWORK") || "testnet"); // Compose state + + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + let currentState: State; + if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } - const walletInfo = await walletProvider.get(runtime, message, state); - state.walletInfo = walletInfo; + const walletInfo = await walletProvider.get(runtime, message, currentState); + currentState.walletInfo = walletInfo; const swapContext = composeContext({ - state, + state: currentState, template: swapTemplate, }); @@ -220,15 +253,20 @@ export const executeSwap: Action = { runtime, context: swapContext, modelClass: ModelClass.LARGE, - }); - - elizaLogger.log("Response:", response); + }) as unknown as SwapResponse; + + // Type guard for response validation + function isSwapResponse(obj: unknown): obj is SwapResponse { + return ( + typeof obj === 'object' && + obj !== null && + 'inputTokenId' in obj && + 'outputTokenId' in obj && + 'amount' in obj + ); + } - if ( - !response.inputTokenId || - !response.outputTokenId || - !response.amount - ) { + if (!isSwapResponse(response)) { elizaLogger.log("Missing required parameters, skipping swap"); const responseMsg = { text: "I need the input token ID, output token ID, and amount to perform the swap", @@ -262,13 +300,13 @@ export const executeSwap: Action = { }); // Execute swap - const swapResult = await swapToken( + const swapResult = (await swapToken( runtime, response.inputTokenId, response.outputTokenId, response.amount, Number(runtime.getSetting("SLIPPAGE_TOLERANCE")) || 0.01 - ); + )) as SwapTransaction[]; // Sign and send transactions const account = await nearConnection.account(accountId); @@ -280,7 +318,7 @@ export const executeSwap: Action = { contractId: tx.receiverId, methodName: functionCall.methodName, args: functionCall.args, - gas: functionCall.gas, + gas: BigInt(functionCall.gas), // Convert string to BigInt attachedDeposit: BigInt( functionCall.amount === ONE_YOCTO_NEAR ? "1" diff --git a/packages/plugin-near/src/actions/transfer.ts b/packages/plugin-near/src/actions/transfer.ts index 16879c0c0fe..e6456174aa8 100644 --- a/packages/plugin-near/src/actions/transfer.ts +++ b/packages/plugin-near/src/actions/transfer.ts @@ -23,13 +23,13 @@ export interface TransferContent extends Content { } function isTransferContent( - runtime: IAgentRuntime, - content: any + _runtime: IAgentRuntime, + content: unknown ): content is TransferContent { return ( - typeof content.recipient === "string" && - (typeof content.amount === "string" || - typeof content.amount === "number") + typeof (content as TransferContent).recipient === "string" && + (typeof (content as TransferContent).amount === "string" || + typeof (content as TransferContent).amount === "number") ); } @@ -88,11 +88,13 @@ async function transferNEAR( const account = await nearConnection.account(accountId); - // Execute transfer - const result = await account.sendMoney( - recipient, - BigInt(nearUtils.format.parseNearAmount(amount)!) - ); + // Execute transfer with null check + const parsedAmount = utils.format.parseNearAmount(amount); + if (!parsedAmount) { + throw new Error("Failed to parse NEAR amount"); + } + + const result = await account.sendMoney(recipient, BigInt(parsedAmount)); return result.transaction.hash; } @@ -112,15 +114,17 @@ export const executeTransfer: Action = { callback?: HandlerCallback ): Promise => { // Initialize or update state + let currentState: State; + if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } // Compose transfer context const transferContext = composeContext({ - state, + state: currentState, template: transferTemplate, }); diff --git a/packages/plugin-near/src/providers/wallet.ts b/packages/plugin-near/src/providers/wallet.ts index 76580e6b0fb..d022dc8fbf9 100644 --- a/packages/plugin-near/src/providers/wallet.ts +++ b/packages/plugin-near/src/providers/wallet.ts @@ -97,8 +97,8 @@ export class WalletProvider implements Provider { private async fetchWithRetry( url: string, options: RequestInit = {} - ): Promise { - let lastError: Error; + ): Promise { + let lastError = new Error('Failed to fetch after all retries'); for (let i = 0; i < PROVIDER_CONFIG.MAX_RETRIES; i++) { try { @@ -114,13 +114,13 @@ export class WalletProvider implements Provider { await new Promise((resolve) => setTimeout( resolve, - PROVIDER_CONFIG.RETRY_DELAY * Math.pow(2, i) + PROVIDER_CONFIG.RETRY_DELAY * (2 ** i) ) ); } } } - throw lastError!; + throw lastError; } async fetchPortfolioValue( @@ -182,7 +182,8 @@ export class WalletProvider implements Provider { try { const response = await this.fetchWithRetry( "https://api.coingecko.com/api/v3/simple/price?ids=near&vs_currencies=usd" - ); + ) as { near: { usd: number } }; + const price = response.near.usd; this.cache.set(cacheKey, price); return price; diff --git a/packages/plugin-news/src/actions/news.ts b/packages/plugin-news/src/actions/news.ts index c6d20f473bf..bd26944ce04 100644 --- a/packages/plugin-news/src/actions/news.ts +++ b/packages/plugin-news/src/actions/news.ts @@ -32,25 +32,14 @@ export const currentNewsAction: Action = { ): Promise => { async function getCurrentNews(searchTerm: string) { try { - // Add quotes and additional context terms const enhancedSearchTerm = encodeURIComponent(`"${searchTerm}" AND (Spain OR Spanish OR Madrid OR Felipe)`); const [everythingResponse, headlinesResponse] = await Promise.all([ fetch( - `https://newsapi.org/v2/everything?` + - `q=${enhancedSearchTerm}&` + - `sortBy=relevancy&` + - `language=en&` + - `pageSize=50&` + - `apiKey=${process.env.NEWS_API_KEY}` + `https://newsapi.org/v2/everything?q=${enhancedSearchTerm}&sortBy=relevancy&language=en&pageSize=50&apiKey=${process.env.NEWS_API_KEY}` ), fetch( - `https://newsapi.org/v2/top-headlines?` + - `q=${searchTerm}&` + - `country=es&` + - `language=en&` + - `pageSize=50&` + - `apiKey=${process.env.NEWS_API_KEY}` + `https://newsapi.org/v2/top-headlines?q=${searchTerm}&country=es&language=en&pageSize=50&apiKey=${process.env.NEWS_API_KEY}` ) ]); @@ -80,17 +69,19 @@ export const currentNewsAction: Action = { } return uniqueArticles.map((article, index) => { - const content = article.description || "No content available"; - const urlDomain = article.url ? new URL(article.url).hostname : ""; - return `📰 Article ${index + 1}\n` + - `━━━━━━━━━━━━━━━━━━━━━━\n` + - `📌 **${article.title || "No title"}**\n\n` + - `📝 ${content}\n\n` + - `🔗 Read more at: ${urlDomain}\n`; - }).join("\n"); + const content = article.description || 'No content available'; + const urlDomain = article.url ? new URL(article.url).hostname : ''; + return [ + `📰 Article ${index + 1}`, + '━━━━━━━━━━━━━━━━━━━━━━', + `📌 **${article.title || 'No title'}**\n`, + `📝 ${content}\n`, + `🔗 Read more at: ${urlDomain}` + ].join('\n'); + }).join('\n'); } catch (error) { - console.error("Error fetching news:", error); - return "Sorry, there was an error fetching the news."; + console.error('Failed to fetch news:', error); + return 'Sorry, there was an error fetching the news.'; } } diff --git a/packages/plugin-nft-collections/src/actions/get-collections.ts b/packages/plugin-nft-collections/src/actions/get-collections.ts index c288d488683..1ee34780748 100644 --- a/packages/plugin-nft-collections/src/actions/get-collections.ts +++ b/packages/plugin-nft-collections/src/actions/get-collections.ts @@ -10,7 +10,7 @@ export const getCollectionsAction = ( similes: ["LIST_NFT_COLLECTIONS", "SHOW_NFT_COLLECTIONS"], description: "Fetches information about curated NFT collections on Ethereum", - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, message: Memory) => { return message.content.text .toLowerCase() .includes("nft collections"); @@ -18,8 +18,8 @@ export const getCollectionsAction = ( handler: async ( runtime: IAgentRuntime, message: Memory, - state: State, - options: any, + _state: State, + _options: { [key: string]: unknown }, callback: HandlerCallback ) => { try { diff --git a/packages/plugin-nft-collections/src/actions/list-nft.ts b/packages/plugin-nft-collections/src/actions/list-nft.ts index 64feb2a85e1..8666c54f8dc 100644 --- a/packages/plugin-nft-collections/src/actions/list-nft.ts +++ b/packages/plugin-nft-collections/src/actions/list-nft.ts @@ -26,7 +26,7 @@ export const listNFTAction = (nftService: ReservoirService): Action => { description: "Lists an NFT for sale on ikigailabs.xyz marketplace at double the purchase price.", - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, message: Memory) => { const content = message.content.text.toLowerCase(); return ( (content.includes("list") || content.includes("sell")) && @@ -40,8 +40,8 @@ export const listNFTAction = (nftService: ReservoirService): Action => { handler: async ( runtime: IAgentRuntime, message: Memory, - state: State, - options: any, + _state: State, + _options: { [key: string]: unknown }, callback: HandlerCallback ) => { try { @@ -84,16 +84,13 @@ export const listNFTAction = (nftService: ReservoirService): Action => { Math.floor(Date.now() / 1000) + 30 * 24 * 60 * 60, // 30 days }); - const response = - `Successfully created listing on ikigailabs.xyz:\n` + - `• Collection: ${collectionAddress}\n` + - `• Token ID: ${tokenId}\n` + - `• Listing Price: ${userSpecifiedPrice} ETH\n` + - `• Status: ${listing.status}\n` + - `• Listing URL: ${listing.marketplaceUrl}\n` + - (listing.transactionHash - ? `• Transaction: ${listing.transactionHash}\n` - : ""); + const response = `Successfully created listing on ikigailabs.xyz: +• Collection: ${collectionAddress} +• Token ID: ${tokenId} +• Listing Price: ${userSpecifiedPrice} ETH +• Status: ${listing.status} +• Listing URL: ${listing.marketplaceUrl} +${listing.transactionHash ? `• Transaction: ${listing.transactionHash}` : ''}`; callback({ text: response, diff --git a/packages/plugin-nft-collections/src/actions/sweep-floor.ts b/packages/plugin-nft-collections/src/actions/sweep-floor.ts index 592d38780db..e2216ebb11d 100644 --- a/packages/plugin-nft-collections/src/actions/sweep-floor.ts +++ b/packages/plugin-nft-collections/src/actions/sweep-floor.ts @@ -23,7 +23,7 @@ export const sweepFloorAction = (nftService: ReservoirService): Action => { description: "Sweeps the floor of a specified EVM NFT collection by purchasing the lowest-priced available NFTs.", - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, message: Memory) => { const content = message.content.text.toLowerCase(); return ( (content.includes("sweep") || content.includes("buy")) && @@ -35,8 +35,8 @@ export const sweepFloorAction = (nftService: ReservoirService): Action => { handler: async ( runtime: IAgentRuntime, message: Memory, - state: State, - options: any, + _state: State, + _options: { [key: string]: unknown }, callback: HandlerCallback ) => { try { diff --git a/packages/plugin-nft-collections/src/constants/curated-collections.ts b/packages/plugin-nft-collections/src/constants/curated-collections.ts index be7e518a780..3bbe15fdb98 100644 --- a/packages/plugin-nft-collections/src/constants/curated-collections.ts +++ b/packages/plugin-nft-collections/src/constants/curated-collections.ts @@ -1766,6 +1766,9 @@ export { getVerifiedAddresses, } from "./collections"; +// Define CollectionCategory as a type +type CollectionCategory = string; + // Helper functions export function getCollectionsByCategory( category: CollectionCategory diff --git a/packages/plugin-nft-collections/src/evaluators/nft-knowledge.ts b/packages/plugin-nft-collections/src/evaluators/nft-knowledge.ts index 1c28c69b432..a535229bc1f 100644 --- a/packages/plugin-nft-collections/src/evaluators/nft-knowledge.ts +++ b/packages/plugin-nft-collections/src/evaluators/nft-knowledge.ts @@ -11,7 +11,7 @@ export const nftKnowledgeEvaluator: Evaluator = { "artist-info", ], alwaysRun: false, - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, message: Memory) => { const content = message.content.text.toLowerCase(); return ( content.includes("nft") || @@ -24,7 +24,7 @@ export const nftKnowledgeEvaluator: Evaluator = { content.includes("onchain") ); }, - handler: async (runtime: IAgentRuntime, message: Memory, state: State) => { + handler: async (_runtime: IAgentRuntime, message: Memory, state: State) => { const content = message.content.text.toLowerCase(); const extractedInfo: NFTKnowledge = { diff --git a/packages/plugin-nft-collections/src/providers/nft-collections.ts b/packages/plugin-nft-collections/src/providers/nft-collections.ts index 85775de4cc7..56f164d3caf 100644 --- a/packages/plugin-nft-collections/src/providers/nft-collections.ts +++ b/packages/plugin-nft-collections/src/providers/nft-collections.ts @@ -3,6 +3,41 @@ import type { ReservoirService } from "../services/reservoir"; import type { MarketIntelligenceService } from "../services/market-intelligence"; import type { SocialAnalyticsService } from "../services/social-analytics"; +interface MarketIntelligenceResponse { + washTradingMetrics: { + washTradingScore: number; + suspiciousVolume24h: number; + }; + liquidityMetrics: { + bestBid: number; + bestAsk: number; + }; + floorPrice?: number; + volume24h?: number; + marketCap?: number; + holders?: number; +} + +interface SocialMetricsResponse { + twitterMetrics: { + followers: number; + engagement: { + likes: number; + retweets: number; + replies: number; + }; + trending: boolean; + }; + communityMetrics: { + totalMembers: number; + growthRate: number; + engagement: { + activeUsers: number; + messagesPerDay: number; + }; + }; +} + export const createNftCollectionProvider = ( nftService: ReservoirService, marketIntelligenceService: MarketIntelligenceService, @@ -42,54 +77,45 @@ export const createNftCollectionProvider = ( if (collection) { response += `\nDetailed information for ${collection.name}:\n\n`; - // Market intelligence data (optional) if (marketIntelligenceService) { try { - const marketIntelligence = - await marketIntelligenceService.getMarketIntelligence( - collection.address - ); + const marketIntelligence = await marketIntelligenceService.getMarketIntelligence( + collection.address + ) as MarketIntelligenceResponse; + response += "Market Intelligence:\n"; response += `• Wash Trading Score: ${marketIntelligence.washTradingMetrics.washTradingScore}\n`; response += `• Suspicious Volume (24h): ${marketIntelligence.washTradingMetrics.suspiciousVolume24h} ETH\n`; response += `• Best Bid: ${marketIntelligence.liquidityMetrics.bestBid} ETH\n`; response += `• Best Ask: ${marketIntelligence.liquidityMetrics.bestAsk} ETH\n\n`; } catch (error) { - console.error( - "Failed to fetch market intelligence:", - error - ); + console.error("Failed to fetch market intelligence:", error); } } - // Social analytics data (optional) if (socialAnalyticsService) { try { - const [socialMetrics, communityMetrics] = - await Promise.all([ - socialAnalyticsService.getSocialMetrics( - collection.address - ), - socialAnalyticsService.getCommunityMetrics( - collection.address - ), - ]); + const [socialMetrics, communityMetrics] = await Promise.all([ + socialAnalyticsService.getSocialMetrics(collection.address), + socialAnalyticsService.getCommunityMetrics(collection.address) + ]) as [SocialMetricsResponse, SocialMetricsResponse]; response += "Social Metrics:\n"; - response += `• Twitter Followers: ${socialMetrics.twitter.followers}\n`; - response += `• Twitter Engagement: ${socialMetrics.twitter.engagement.likes + socialMetrics.twitter.engagement.retweets + socialMetrics.twitter.engagement.replies} interactions\n`; - response += `• Trending: ${socialMetrics.trending ? "Yes" : "No"}\n\n`; + response += `• Twitter Followers: ${socialMetrics.twitterMetrics.followers}\n`; + response += `• Twitter Engagement: ${ + socialMetrics.twitterMetrics.engagement.likes + + socialMetrics.twitterMetrics.engagement.retweets + + socialMetrics.twitterMetrics.engagement.replies + } interactions\n`; + response += `• Trending: ${socialMetrics.twitterMetrics.trending ? "Yes" : "No"}\n\n`; response += "Community Metrics:\n"; - response += `• Total Members: ${communityMetrics.totalMembers}\n`; - response += `• Growth Rate: ${communityMetrics.growthRate}%\n`; - response += `• Active Users: ${communityMetrics.engagement.activeUsers}\n`; - response += `• Messages per Day: ${communityMetrics.engagement.messagesPerDay}\n`; + response += `• Total Members: ${communityMetrics.communityMetrics.totalMembers}\n`; + response += `• Growth Rate: ${communityMetrics.communityMetrics.growthRate}%\n`; + response += `• Active Users: ${communityMetrics.communityMetrics.engagement.activeUsers}\n`; + response += `• Messages per Day: ${communityMetrics.communityMetrics.engagement.messagesPerDay}\n`; } catch (error) { - console.error( - "Failed to fetch social analytics:", - error - ); + console.error("Failed to fetch social analytics:", error); } } } diff --git a/packages/plugin-nft-collections/src/services/cache-manager.ts b/packages/plugin-nft-collections/src/services/cache-manager.ts index 10b1fd9fb9f..d9dae3ad57a 100644 --- a/packages/plugin-nft-collections/src/services/cache-manager.ts +++ b/packages/plugin-nft-collections/src/services/cache-manager.ts @@ -12,7 +12,7 @@ interface CacheEntry { } export class MemoryCacheManager { - private cache: LRUCache>; + private cache: LRUCache>; private readonly DEFAULT_TTL = 3600000; // 1 hour private readonly COLLECTION_TTL = 300000; // 5 minutes private readonly MARKET_TTL = 60000; // 1 minute @@ -64,7 +64,7 @@ export class MemoryCacheManager { } async has(key: string): Promise { - const entry = this.cache.get(key) as CacheEntry; + const entry = this.cache.get(key) as CacheEntry; if (!entry) return false; if (Date.now() > entry.expiresAt) { diff --git a/packages/plugin-nft-collections/src/services/coingecko.ts b/packages/plugin-nft-collections/src/services/coingecko.ts index 91e0a0d800c..f745c293dbf 100644 --- a/packages/plugin-nft-collections/src/services/coingecko.ts +++ b/packages/plugin-nft-collections/src/services/coingecko.ts @@ -15,6 +15,17 @@ interface CoinGeckoNFTData { number_of_unique_currencies?: number; } +interface GlobalNFTStats { + data: { + total_market_cap_usd: number; + total_volume_24h_usd: number; + market_cap_change_24h: number; + volume_change_24h: number; + number_of_unique_currencies: number; + number_of_unique_addresses: number; + }; +} + export class CoinGeckoService { private baseUrl = "https://api.coingecko.com/api/v3"; private apiKey?: string; @@ -25,13 +36,18 @@ export class CoinGeckoService { private async fetch( endpoint: string, - params: Record = {} + params: Record = {} ): Promise { if (this.apiKey) { params.x_cg_pro_api_key = this.apiKey; } - const queryString = new URLSearchParams(params).toString(); + const queryString = new URLSearchParams( + Object.fromEntries( + Object.entries(params).map(([key, value]) => [key, String(value)]) + ) + ).toString(); + const url = `${this.baseUrl}${endpoint}${queryString ? `?${queryString}` : ""}`; const response = await fetch(url, { @@ -79,12 +95,12 @@ export class CoinGeckoService { number_of_unique_currencies: number; number_of_unique_addresses: number; }> { - const data = await this.fetch("/global/nft"); + const data = await this.fetch("/global/nft"); return data.data; } async getTrendingCollections(): Promise { - const data = await this.fetch("/nfts/list", { + const data = await this.fetch("/nfts/list", { order: "market_cap_usd_desc", per_page: "20", page: "1", diff --git a/packages/plugin-nft-collections/src/services/rate-limiter.ts b/packages/plugin-nft-collections/src/services/rate-limiter.ts index e34f649923e..9135684c222 100644 --- a/packages/plugin-nft-collections/src/services/rate-limiter.ts +++ b/packages/plugin-nft-collections/src/services/rate-limiter.ts @@ -7,6 +7,11 @@ interface RateLimiterConfig { retryDelay?: number; } +interface RateLimitError extends Error { + remainingPoints: number; + msBeforeNext: number; +} + export class RateLimiter { private limiter: RateLimiterMemory; private maxRetries: number; @@ -24,9 +29,10 @@ export class RateLimiter { async consume(key: string, points = 1): Promise { try { await this.limiter.consume(key, points); - } catch (error: any) { - if (error.remainingPoints === 0) { - const retryAfter = Math.ceil(error.msBeforeNext / 1000); + } catch (error: unknown) { + if (error instanceof Error && 'remainingPoints' in error) { + const rateLimitError = error as RateLimitError; + const retryAfter = Math.ceil(rateLimitError.msBeforeNext / 1000); throw new Error( `Rate limit exceeded. Retry after ${retryAfter} seconds` ); @@ -47,11 +53,11 @@ export class RateLimiter { try { await this.consume(key, points); return await operation(); - } catch (error: any) { - lastError = error; + } catch (error: unknown) { + lastError = error as Error; retries++; - if (error.message?.includes("Rate limit exceeded")) { + if (error instanceof Error && error.message?.includes("Rate limit exceeded")) { const retryAfter = Number.parseInt( error.message.match(/\d+/)?.[0] || "1", 10 diff --git a/packages/plugin-nft-collections/src/services/security-manager.ts b/packages/plugin-nft-collections/src/services/security-manager.ts index 29c32629861..d2c33a21521 100644 --- a/packages/plugin-nft-collections/src/services/security-manager.ts +++ b/packages/plugin-nft-collections/src/services/security-manager.ts @@ -1,8 +1,9 @@ -import * as crypto from "crypto"; +import * as crypto from "node:crypto"; interface SecurityConfig { algorithm: string; } +type SensitiveData = string | number | boolean | object; export class SecurityManager { private config: SecurityConfig; @@ -16,7 +17,7 @@ export class SecurityManager { this.iv = crypto.randomBytes(16); // 128 bits for AES } - encryptSensitiveData(data: any): string { + encryptSensitiveData(data: SensitiveData): string { const cipher = crypto.createCipheriv( this.config.algorithm, this.key, @@ -27,7 +28,7 @@ export class SecurityManager { encrypted += cipher.final("hex"); // Return IV + encrypted data - return this.iv.toString("hex") + ":" + encrypted; + return `${this.iv.toString("hex")}:${encrypted}`; } decryptSensitiveData(encryptedData: string): T { @@ -54,7 +55,7 @@ export class SecurityManager { return crypto.createHash("sha256").update(data).digest("hex"); } - generateSignature(data: any, timestamp: number): string { + generateSignature(data: SensitiveData, timestamp: number): string { const message = JSON.stringify(data) + timestamp; return crypto .createHmac("sha256", this.key) @@ -62,7 +63,7 @@ export class SecurityManager { .digest("hex"); } - verifySignature(data: any, timestamp: number, signature: string): boolean { + verifySignature(data: SensitiveData, timestamp: number, signature: string): boolean { const expectedSignature = this.generateSignature(data, timestamp); const signatureBuffer = Buffer.from(signature); const expectedBuffer = Buffer.from(expectedSignature); diff --git a/packages/plugin-nft-collections/src/utils/performance.ts b/packages/plugin-nft-collections/src/utils/performance.ts index 38a4a07319f..94d0f664a6a 100644 --- a/packages/plugin-nft-collections/src/utils/performance.ts +++ b/packages/plugin-nft-collections/src/utils/performance.ts @@ -1,4 +1,4 @@ -import { EventEmitter } from "events"; +import { EventEmitter } from "node:events"; interface PerformanceMetric { operation: string; @@ -109,7 +109,11 @@ export class PerformanceMonitor extends EventEmitter { } > { const operations = new Set(this.metrics.map((m) => m.operation)); - const summary: Record = {}; + const summary: Record = {}; for (const operation of operations) { summary[operation] = { diff --git a/packages/plugin-nft-generation/package.json b/packages/plugin-nft-generation/package.json index d77c9c10b75..d9b39d5f6b1 100644 --- a/packages/plugin-nft-generation/package.json +++ b/packages/plugin-nft-generation/package.json @@ -1,47 +1,47 @@ { - "name": "@elizaos/plugin-nft-generation", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-image-generation": "workspace:*", - "@elizaos/plugin-node": "workspace:*", - "@metaplex-foundation/mpl-token-metadata": "^3.3.0", - "@metaplex-foundation/mpl-toolbox": "^0.9.4", - "@metaplex-foundation/umi": "^0.9.2", - "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", - "@openzeppelin/contracts": "^5.1.0", - "@solana-developers/helpers": "^2.5.6", - "@solana/web3.js": "npm:@solana/web3.js@1.95.5", - "axios": "^1.7.9", - "bs58": "6.0.0", - "express": "4.21.1", - "node-cache": "5.1.2", - "solc": "^0.8.28", - "tsup": "8.3.5", - "viem": "^2.21.60" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-nft-generation", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@elizaos/plugin-image-generation": "workspace:*", + "@elizaos/plugin-node": "workspace:*", + "@metaplex-foundation/mpl-token-metadata": "^3.3.0", + "@metaplex-foundation/mpl-toolbox": "^0.9.4", + "@metaplex-foundation/umi": "^0.9.2", + "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", + "@openzeppelin/contracts": "^5.1.0", + "@solana-developers/helpers": "^2.5.6", + "@solana/web3.js": "npm:@solana/web3.js@1.95.5", + "axios": "^1.7.9", + "bs58": "6.0.0", + "express": "4.21.1", + "node-cache": "5.1.2", + "solc": "^0.8.28", + "tsup": "8.3.5", + "viem": "^2.21.60" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-nft-generation/src/actions/mintNFTAction.ts b/packages/plugin-nft-generation/src/actions/mintNFTAction.ts index cd09706d316..3d3c3841ebf 100644 --- a/packages/plugin-nft-generation/src/actions/mintNFTAction.ts +++ b/packages/plugin-nft-generation/src/actions/mintNFTAction.ts @@ -24,6 +24,7 @@ const _SupportedChainList = Object.keys(viemChains) as Array< keyof typeof viemChains >; + function isMintNFTContent(content: any): content is MintNFTContent { return typeof content.collectionAddress === "string" && typeof content.collectionAddress === "string"; } @@ -68,19 +69,27 @@ const mintNFTAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: { [key: string]: unknown }, + _options: { [key: string]: unknown }, callback: HandlerCallback ) => { try { elizaLogger.log("Composing state for message:", message); + + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } - + const context = composeContext({ - state, + state: currentState, template: mintNFTTemplate, }); @@ -229,7 +238,7 @@ const mintNFTAction: Action = { } } return []; - } catch (e: any) { + } catch (e: unknown) { elizaLogger.log(e); throw e; } diff --git a/packages/plugin-nft-generation/src/actions/nftCollectionGeneration.ts b/packages/plugin-nft-generation/src/actions/nftCollectionGeneration.ts index 793ef1892d6..d4ce91605fc 100644 --- a/packages/plugin-nft-generation/src/actions/nftCollectionGeneration.ts +++ b/packages/plugin-nft-generation/src/actions/nftCollectionGeneration.ts @@ -61,8 +61,8 @@ const nftCollectionGeneration: Action = { handler: async ( runtime: IAgentRuntime, message: Memory, - state: State, - options: { [key: string]: unknown }, + _state: State, + _options: { [key: string]: unknown }, callback: HandlerCallback ) => { try { diff --git a/packages/plugin-nft-generation/src/handlers/createSolanaCollection.ts b/packages/plugin-nft-generation/src/handlers/createSolanaCollection.ts index 37197d6e4ba..7ebd4ec62db 100644 --- a/packages/plugin-nft-generation/src/handlers/createSolanaCollection.ts +++ b/packages/plugin-nft-generation/src/handlers/createSolanaCollection.ts @@ -30,7 +30,8 @@ export async function createCollectionMetadata({ elizaLogger.log("User ID:", userId); const awsS3Service: AwsS3Service = runtime.getService(ServiceType.AWS_S3); const agentName = runtime.character.name; - const roomId = stringToUuid("nft_generate_room-" + agentName); + // const roomId = stringToUuid("nft_generate_room-" + agentName); + const roomId = stringToUuid(`nft_generate_room-${agentName}`); // Create memory for the message const memory: Memory = { agentId: userId, @@ -61,7 +62,7 @@ export async function createCollectionMetadata({ ); if (images.success && images.data && images.data.length > 0) { const image = images.data[0]; - const filename = `collection-image`; + const filename = 'collection-image'; if (image.startsWith("http")) { elizaLogger.log("Generating image url:", image); } diff --git a/packages/plugin-nft-generation/src/utils/deployEVMContract.ts b/packages/plugin-nft-generation/src/utils/deployEVMContract.ts index 99f2d618738..ff12a9f2998 100644 --- a/packages/plugin-nft-generation/src/utils/deployEVMContract.ts +++ b/packages/plugin-nft-generation/src/utils/deployEVMContract.ts @@ -1,4 +1,11 @@ import { encodeAbiParameters } from "viem"; +import type { + Address, + WalletClient, + PublicClient, + Hash, + Abi +} from 'viem'; import { compileWithImports } from "./generateERC721ContractCode.ts"; import CustomERC721 from "../contract/CustomERC721.sol" @@ -39,6 +46,7 @@ export async function deployContract({ } // 调用 mint 方法 + export async function mintNFT({ walletClient, publicClient, @@ -46,11 +54,12 @@ export async function mintNFT({ abi, recipient, }: { - contractAddress: any; + contractAddress: string; abi: any; recipient: any; walletClient: any; publicClient: any; + }) { console.log("Minting NFT..."); const txHash = await walletClient.writeContract({ diff --git a/packages/plugin-nft-generation/src/utils/generateERC721ContractCode.ts b/packages/plugin-nft-generation/src/utils/generateERC721ContractCode.ts index 588c144aae7..c4f3ab02850 100644 --- a/packages/plugin-nft-generation/src/utils/generateERC721ContractCode.ts +++ b/packages/plugin-nft-generation/src/utils/generateERC721ContractCode.ts @@ -1,7 +1,7 @@ import solc from "solc"; -import fs from "fs"; -import path from "path"; -import { fileURLToPath } from "url"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; // Load OpenZeppelin contract source code export function loadOpenZeppelinFile(contractPath) { @@ -45,7 +45,9 @@ export function compileWithImports(contractName, sourceCode) { ); if (output.errors) { - output.errors.forEach((err) => console.error(err)); + for (const err of output.errors) { + console.error(err); + } } const contractFile = output.contracts[`${contractName}.sol`][`${contractName}`]; diff --git a/packages/plugin-nft-generation/src/utils/verifyEVMContract.ts b/packages/plugin-nft-generation/src/utils/verifyEVMContract.ts index 91d264af5da..091b92c872f 100644 --- a/packages/plugin-nft-generation/src/utils/verifyEVMContract.ts +++ b/packages/plugin-nft-generation/src/utils/verifyEVMContract.ts @@ -3,6 +3,12 @@ import { loadOpenZeppelinFile, } from "./generateERC721ContractCode.ts"; +interface VerificationStatus { + result: string; + status?: string; + message?: string; +} + function getSources(metadata, sourceCode) { const fileName = Object.keys(metadata.settings.compilationTarget)[0] const obj = { @@ -69,7 +75,7 @@ export async function verifyEVMContract({ }; // Poll for completion - let status; + let status: VerificationStatus; do { await new Promise((resolve) => setTimeout(resolve, 3000)); status = await checkStatus(); diff --git a/packages/plugin-node/package.json b/packages/plugin-node/package.json index 36ef9f393d2..6370afac2ca 100644 --- a/packages/plugin-node/package.json +++ b/packages/plugin-node/package.json @@ -1,98 +1,99 @@ { - "name": "@elizaos/plugin-node", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist", - "scripts", - "package.json", - "LICENSE", - "tsup.config.ts" - ], - "dependencies": { - "@aws-sdk/client-s3": "^3.705.0", - "@aws-sdk/s3-request-presigner": "^3.705.0", - "@cliqz/adblocker-playwright": "1.34.0", - "@echogarden/espeak-ng-emscripten": "0.3.3", - "@echogarden/kissfft-wasm": "0.2.0", - "@echogarden/speex-resampler-wasm": "0.2.1", - "@elizaos/core": "workspace:*", - "@huggingface/transformers": "3.0.2", - "@opendocsg/pdf2md": "0.1.32", - "@types/uuid": "10.0.0", - "alawmulaw": "6.0.0", - "bignumber.js": "9.1.2", - "capsolver-npm": "2.0.2", - "cldr-segmentation": "2.2.1", - "command-exists": "1.2.9", - "csv-writer": "1.6.0", - "echogarden": "2.0.7", - "espeak-ng": "1.0.2", - "ffmpeg-static": "5.2.0", - "fluent-ffmpeg": "2.1.3", - "formdata-node": "6.0.3", - "fs-extra": "11.2.0", - "gaxios": "6.7.1", - "glob": "11.0.0", - "graceful-fs": "4.2.11", - "html-escaper": "3.0.3", - "html-to-text": "9.0.5", - "import-meta-resolve": "4.1.0", - "jieba-wasm": "2.2.0", - "json5": "2.2.3", - "kuromoji": "0.1.2", - "libsodium-wrappers": "0.7.15", - "multer": "1.4.5-lts.1", - "node-cache": "5.1.2", - "node-llama-cpp": "3.1.1", - "nodejs-whisper": "0.1.18", - "onnxruntime-node": "1.20.1", - "pdfjs-dist": "4.7.76", - "playwright": "1.48.2", - "pm2": "5.4.3", - "puppeteer-extra": "3.3.6", - "puppeteer-extra-plugin-capsolver": "2.0.1", - "sharp": "0.33.5", - "srt": "0.0.3", - "systeminformation": "5.23.8", - "tar": "7.4.3", - "tinyld": "1.3.4", - "uuid": "11.0.3", - "wav": "1.0.2", - "wav-encoder": "1.3.0", - "wavefile": "11.0.0", - "yargs": "17.7.2", - "youtube-dl-exec": "3.0.10", - "cookie": "0.7.0" - }, - "devDependencies": { - "@types/node": "22.8.4", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "postinstall": "node scripts/postinstall.js" - }, - "peerDependencies": { - "onnxruntime-node": "1.20.1", - "whatwg-url": "7.1.0" - }, - "trustedDependencies": { - "onnxruntime-node": "1.20.1", - "sharp": "0.33.5" - } + "name": "@elizaos/plugin-node", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist", + "scripts", + "package.json", + "LICENSE", + "tsup.config.ts" + ], + "dependencies": { + "@aws-sdk/client-s3": "^3.705.0", + "@aws-sdk/s3-request-presigner": "^3.705.0", + "@cliqz/adblocker-playwright": "1.34.0", + "@echogarden/espeak-ng-emscripten": "0.3.3", + "@echogarden/kissfft-wasm": "0.2.0", + "@echogarden/speex-resampler-wasm": "0.2.1", + "@elizaos/core": "workspace:*", + "@elizaos/core": "workspace:*", + "@huggingface/transformers": "3.0.2", + "@opendocsg/pdf2md": "0.1.32", + "@types/uuid": "10.0.0", + "alawmulaw": "6.0.0", + "bignumber.js": "9.1.2", + "capsolver-npm": "2.0.2", + "cldr-segmentation": "2.2.1", + "command-exists": "1.2.9", + "csv-writer": "1.6.0", + "echogarden": "2.0.7", + "espeak-ng": "1.0.2", + "ffmpeg-static": "5.2.0", + "fluent-ffmpeg": "2.1.3", + "formdata-node": "6.0.3", + "fs-extra": "11.2.0", + "gaxios": "6.7.1", + "glob": "11.0.0", + "graceful-fs": "4.2.11", + "html-escaper": "3.0.3", + "html-to-text": "9.0.5", + "import-meta-resolve": "4.1.0", + "jieba-wasm": "2.2.0", + "json5": "2.2.3", + "kuromoji": "0.1.2", + "libsodium-wrappers": "0.7.15", + "multer": "1.4.5-lts.1", + "node-cache": "5.1.2", + "node-llama-cpp": "3.1.1", + "nodejs-whisper": "0.1.18", + "onnxruntime-node": "1.20.1", + "pdfjs-dist": "4.7.76", + "playwright": "1.48.2", + "pm2": "5.4.3", + "puppeteer-extra": "3.3.6", + "puppeteer-extra-plugin-capsolver": "2.0.1", + "sharp": "0.33.5", + "srt": "0.0.3", + "systeminformation": "5.23.8", + "tar": "7.4.3", + "tinyld": "1.3.4", + "uuid": "11.0.3", + "wav": "1.0.2", + "wav-encoder": "1.3.0", + "wavefile": "11.0.0", + "yargs": "17.7.2", + "youtube-dl-exec": "3.0.10", + "cookie": "0.7.0" + }, + "devDependencies": { + "@types/node": "22.8.4", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "postinstall": "node scripts/postinstall.js" + }, + "peerDependencies": { + "onnxruntime-node": "1.20.1", + "whatwg-url": "7.1.0" + }, + "trustedDependencies": { + "onnxruntime-node": "1.20.1", + "sharp": "0.33.5" + } } diff --git a/packages/plugin-obsidian/package.json b/packages/plugin-obsidian/package.json index 35f458d64e7..fd28b35e077 100644 --- a/packages/plugin-obsidian/package.json +++ b/packages/plugin-obsidian/package.json @@ -1,22 +1,22 @@ { - "name": "@elizaos/plugin-obsidian", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "file-type-checker": "^1.1.2", - "mrmime": "^2.0.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-obsidian", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "file-type-checker": "^1.1.2", + "mrmime": "^2.0.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-obsidian/src/actions/activeNote.ts b/packages/plugin-obsidian/src/actions/activeNote.ts index 7b15f49bef9..a78475a7baa 100644 --- a/packages/plugin-obsidian/src/actions/activeNote.ts +++ b/packages/plugin-obsidian/src/actions/activeNote.ts @@ -39,9 +39,9 @@ export const getActiveNoteAction: Action = { }, handler: async ( runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, + _message: Memory, + _state: State, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting get active note handler"); @@ -134,7 +134,7 @@ export const summarizeActiveNoteAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting summarize active note handler"); @@ -176,7 +176,7 @@ export const summarizeActiveNoteAction: Action = { modelClass: ModelClass.MEDIUM, }); - currentSummary = currentSummary + "\n" + summary; + currentSummary = `${currentSummary}\n${summary}`; } if (!currentSummary) { elizaLogger.error("Error: No summary found"); diff --git a/packages/plugin-obsidian/src/actions/createKnowledge.ts b/packages/plugin-obsidian/src/actions/createKnowledge.ts index db3756850ac..3e03fd51b07 100644 --- a/packages/plugin-obsidian/src/actions/createKnowledge.ts +++ b/packages/plugin-obsidian/src/actions/createKnowledge.ts @@ -32,9 +32,9 @@ export const createKnowledgeAction: Action = { }, handler: async ( runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, + _message: Memory, + _state: State, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting create knowledge handler"); diff --git a/packages/plugin-obsidian/src/actions/file.ts b/packages/plugin-obsidian/src/actions/file.ts index 6f52f8e0d95..974cfccf1b0 100644 --- a/packages/plugin-obsidian/src/actions/file.ts +++ b/packages/plugin-obsidian/src/actions/file.ts @@ -45,7 +45,7 @@ export const readFileAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting read file handler"); diff --git a/packages/plugin-obsidian/src/actions/listNotes.ts b/packages/plugin-obsidian/src/actions/listNotes.ts index f12724d5d99..46c0d5a6b54 100644 --- a/packages/plugin-obsidian/src/actions/listNotes.ts +++ b/packages/plugin-obsidian/src/actions/listNotes.ts @@ -35,9 +35,9 @@ export const listNotesAction: Action = { }, handler: async ( runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, + _message: Memory, + _state: State, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting list notes handler"); diff --git a/packages/plugin-obsidian/src/actions/note.ts b/packages/plugin-obsidian/src/actions/note.ts index 68100407624..cd80061cacd 100644 --- a/packages/plugin-obsidian/src/actions/note.ts +++ b/packages/plugin-obsidian/src/actions/note.ts @@ -12,6 +12,7 @@ import { import { type NoteContent, noteSchema, isValidNote } from "../types"; import { getObsidian } from "../helper"; import { noteTemplate } from "../templates/note"; +import { fileTemplate } from "../templates/file"; export const getNoteAction: Action = { name: "GET_NOTE", @@ -45,7 +46,7 @@ export const getNoteAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting get note handler"); @@ -54,15 +55,22 @@ export const getNoteAction: Action = { try { let path = ""; // Initialize or update state for context generation + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } const context = composeContext({ - state, - template: noteTemplate(message.content.text), + state: currentState, + template: fileTemplate(message.content.text), }); const noteContext = await generateObject({ diff --git a/packages/plugin-obsidian/src/actions/noteTraversal.ts b/packages/plugin-obsidian/src/actions/noteTraversal.ts index 3e8d369a744..13e8ac9efc7 100644 --- a/packages/plugin-obsidian/src/actions/noteTraversal.ts +++ b/packages/plugin-obsidian/src/actions/noteTraversal.ts @@ -12,6 +12,7 @@ import { import { type NoteContent, type NoteHierarchy, isValidNoteHierarchy, noteHierarchySchema } from "../types"; import { getObsidian, extractLinks, storeHierarchyInMemory, retrieveHierarchyFromMemory } from "../helper"; import { traversalTemplate } from "../templates/traversal"; +import { fileTemplate } from "../templates/file"; export const noteTraversalAction: Action = { name: "TRAVERSE_NOTE", @@ -44,7 +45,7 @@ export const noteTraversalAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting note traversal handler"); @@ -63,15 +64,22 @@ export const noteTraversalAction: Action = { }*/ // Initialize or update state for context generation + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } const context = composeContext({ - state, - template: traversalTemplate(message.content.text), + state: currentState, + template: fileTemplate(message.content.text), }); const noteContext = await generateObject({ diff --git a/packages/plugin-obsidian/src/actions/openFile.ts b/packages/plugin-obsidian/src/actions/openFile.ts index 7f4994bfb1e..148f2d06f9c 100644 --- a/packages/plugin-obsidian/src/actions/openFile.ts +++ b/packages/plugin-obsidian/src/actions/openFile.ts @@ -40,7 +40,7 @@ export const openFileAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting open file handler"); @@ -48,17 +48,24 @@ export const openFileAction: Action = { try { // Initialize or update state for context generation + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } const context = composeContext({ - state, + state: currentState, template: fileTemplate(message.content.text), }); + const fileContext = await generateObject({ runtime, context, diff --git a/packages/plugin-obsidian/src/actions/saveFile.ts b/packages/plugin-obsidian/src/actions/saveFile.ts index a898ff86cf1..4935a5fa622 100644 --- a/packages/plugin-obsidian/src/actions/saveFile.ts +++ b/packages/plugin-obsidian/src/actions/saveFile.ts @@ -42,7 +42,7 @@ export const saveFileAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting save file handler"); @@ -50,17 +50,24 @@ export const saveFileAction: Action = { try { // Initialize or update state for context generation + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } const context = composeContext({ - state, + state: currentState, template: fileTemplate(message.content.text), }); + const fileContext = await generateObject({ runtime, context, diff --git a/packages/plugin-obsidian/src/actions/search.ts b/packages/plugin-obsidian/src/actions/search.ts index ea161508d14..728a31a8988 100644 --- a/packages/plugin-obsidian/src/actions/search.ts +++ b/packages/plugin-obsidian/src/actions/search.ts @@ -61,7 +61,7 @@ export const searchAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting search handler"); diff --git a/packages/plugin-obsidian/src/actions/updateFile.ts b/packages/plugin-obsidian/src/actions/updateFile.ts index d6a93b3db4d..b17ab1a45d4 100644 --- a/packages/plugin-obsidian/src/actions/updateFile.ts +++ b/packages/plugin-obsidian/src/actions/updateFile.ts @@ -13,6 +13,14 @@ import { fileSchema, isValidFile } from "../types"; import { getObsidian } from "../helper"; import { fileTemplate } from "../templates/file"; + +// Add at the top with other imports +interface UpdateFileOptions { + path?: string; + content?: string; + createIfNotExists?: boolean; +} + export const updateFileAction: Action = { name: "UPDATE_FILE", similes: [ @@ -41,7 +49,7 @@ export const updateFileAction: Action = { runtime: IAgentRuntime, message: Memory, state: State, - options: any, + _options: UpdateFileOptions, callback?: HandlerCallback ) => { elizaLogger.info("Starting update file handler"); @@ -49,14 +57,22 @@ export const updateFileAction: Action = { try { // Initialize or update state for context generation + // if (!state) { + // state = (await runtime.composeState(message)) as State; + // } else { + // state = await runtime.updateRecentMessageState(state); + // } + + // Initialize or update state for context generation + let currentState: State; if (!state) { - state = (await runtime.composeState(message)) as State; + currentState = (await runtime.composeState(message)) as State; } else { - state = await runtime.updateRecentMessageState(state); + currentState = await runtime.updateRecentMessageState(state); } const context = composeContext({ - state, + state: currentState, template: fileTemplate(message.content.text), }); diff --git a/packages/plugin-obsidian/src/actions/vault.ts b/packages/plugin-obsidian/src/actions/vault.ts index 80da8c3f855..666cdbfff04 100644 --- a/packages/plugin-obsidian/src/actions/vault.ts +++ b/packages/plugin-obsidian/src/actions/vault.ts @@ -39,9 +39,9 @@ export const listAllFilesAction: Action = { }, handler: async ( runtime: IAgentRuntime, - message: Memory, - state: State, - options: any, + _message: Memory, + _state: State, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting list all files handler"); diff --git a/packages/plugin-obsidian/src/actions/vaultDirectory.ts b/packages/plugin-obsidian/src/actions/vaultDirectory.ts index d9ab16decb3..f6729f6b9ff 100644 --- a/packages/plugin-obsidian/src/actions/vaultDirectory.ts +++ b/packages/plugin-obsidian/src/actions/vaultDirectory.ts @@ -38,8 +38,8 @@ export const listDirectoryAction: Action = { handler: async ( runtime: IAgentRuntime, message: Memory, - state: State, - options: any, + _state: State, + _options: any, callback?: HandlerCallback ) => { elizaLogger.info("Starting list directory handler"); diff --git a/packages/plugin-obsidian/src/helper.ts b/packages/plugin-obsidian/src/helper.ts index bf24f7011ba..cbef6c9529e 100644 --- a/packages/plugin-obsidian/src/helper.ts +++ b/packages/plugin-obsidian/src/helper.ts @@ -1,4 +1,4 @@ -import { type IAgentRuntime, type AgentRuntime, ModelClass, type Memory, MemoryManager } from "@elizaos/core"; +import { type IAgentRuntime, type AgentRuntime, ModelClass, type Memory, MemoryManager, type State } from "@elizaos/core"; import { elizaLogger, composeContext, generateObject, stringToUuid } from "@elizaos/core"; //import fileTypeChecker from "file-type-checker"; import { lookup } from 'mrmime'; @@ -6,6 +6,45 @@ import { ObsidianProvider } from "./providers/obsidianClient"; import { validateObsidianConfig } from "./enviroment"; import { searchQuerySchema, type NoteHierarchy, type NoteContent } from "./types"; + +// Update SearchState interface to make properties optional +interface SearchState extends State { + bio: string; // Required from State + lore: string; // Required from State + messageDirections: string; // Required from State + postDirections: string; // Required from State + // Search-specific properties + query?: string | SearchQuery; + options?: SearchOptions; +} + +interface SearchOptions { + contextLength?: number; + searchIn?: string[]; +} + +interface SearchQuery { + options?: { + searchIn?: string[]; + contextLength?: number; + ignoreCase?: boolean; + }; + query?: string | Record; + queryFormat?: "plaintext" | "jsonlogic" | "dataview"; + and?: Array; + or?: Array; +} + +interface SearchContextResponse { + object: SearchQuery; +} + +interface SearchCondition { + in?: [string, { var: string }]; + regexp?: [string, { var: string }]; +} + + let obsidianInstance: ObsidianProvider | undefined; export async function getObsidian(runtime: IAgentRuntime): Promise { @@ -28,7 +67,10 @@ export function extractLinks(noteContent: NoteContent): string[] { const linkRegex = /\[\[(.*?)\]\]/g; const links: string[] = []; let match: RegExpExecArray | null; - while ((match = linkRegex.exec(noteContent.content)) !== null) { + while (true) { + match = linkRegex.exec(noteContent.content); + if (match === null) break; + if (match[1] && !lookup(match[1])) { links.push(`${noteContent.path.split("/")[0]}/${match[1]}.md`); } else { @@ -148,7 +190,7 @@ export function markdownToPlaintext(markdown: string): string { text = text.replace(/^\s*\d+\.\s+/gm, ''); // Ordered lists // Clean up excessive whitespace - text = text.replace(/\n\s*\n\s*\n/g, '\n\n'); // Multiple blank lines to double + text = text.replace(/\n\s*\n\n/g, '\n\n'); // Multiple blank lines to double text = text.trim(); return text; @@ -311,61 +353,112 @@ Respond ONLY with a JSON block containing only the extracted values.`; * @param prompt - The formatted prompt string * @returns A Promise resolving to the JSON string response */ -async function genereteSearchParameters(prompt: string, state: any, runtime: IAgentRuntime): Promise { - try { +// Update the generateSearchParameters function +async function genereteSearchParameters( + prompt: string, + state: SearchState, + runtime: IAgentRuntime +): Promise { + try { const context = composeContext({ state, template: prompt, }); - //TODO: temperature: 0.2 - Make this dynamic const searchContext = await generateObject({ runtime, context, modelClass: ModelClass.MEDIUM, schema: searchQuerySchema, stop: ["\n\n"] - }) as any; - - /*if (!isSearchQuery(searchContext.object)) { - elizaLogger.error( - "Invalid search query:", - searchContext.object - ); - return null; - }*/ - - // Attempt to parse the completion as JSON to verify structure - const parsedCompletion = searchContext.object; //JSON.parse(JSON.stringify(searchContext.object, null, 2)); - elizaLogger.info("Parsed completion:", JSON.stringify(parsedCompletion , null, 2)); + }) as SearchContextResponse; + + // Now we can safely access .object + const parsedCompletion = searchContext.object; + elizaLogger.info("Parsed completion:", JSON.stringify(parsedCompletion, null, 2)); return JSON.stringify(parsedCompletion); - } catch (error) { + } catch (error: unknown) { console.error('Error calling LLM API:', error); - // Return a basic fallback response that matches the schema return "**No matching notes found**"; } } +// async function genereteSearchParameters(prompt: string, state: any, runtime: IAgentRuntime): Promise { +// try { + +// const context = composeContext({ +// state, +// template: prompt, +// }); + +// //TODO: temperature: 0.2 - Make this dynamic +// const searchContext = await generateObject({ +// runtime, +// context, +// modelClass: ModelClass.MEDIUM, +// schema: searchQuerySchema, +// stop: ["\n\n"] +// }) as SearchQuery; + +// /*if (!isSearchQuery(searchContext.object)) { +// elizaLogger.error( +// "Invalid search query:", +// searchContext.object +// ); +// return null; +// }*/ + +// // Attempt to parse the completion as JSON to verify structure +// const parsedCompletion = searchContext.object; //JSON.parse(JSON.stringify(searchContext.object, null, 2)); +// elizaLogger.info("Parsed completion:", JSON.stringify(parsedCompletion , null, 2)); +// return JSON.stringify(parsedCompletion); + +// } catch (error) { +// console.error('Error calling LLM API:', error); +// // Return a basic fallback response that matches the schema +// return "**No matching notes found**"; +// } +// } + +// Update processUserInput to use proper types +// export async function processUserInput( +// userInput: string, +// state: SearchState, +// runtime: IAgentRuntime +// ): Promise { +// const prompt = constructSearchPrompt(userInput); +// const llmResponse = await genereteSearchParameters(prompt, state, runtime); + +// try { +// const parsedResponse = JSON.parse(llmResponse) as SearchQuery; +// const validatedResponse = searchQuerySchema.parse(parsedResponse); +// return validatedResponse; +// } catch (error: unknown) { +// console.error('Failed to parse or validate LLM response:', error); +// return null; +// } +// } +export async function processUserInput( + userInput: string, + state: State, // Accept base State type + runtime: IAgentRuntime +): Promise { + // Cast state to SearchState since we'll be adding search-specific properties + const searchState: SearchState = { + ...state, + query: userInput // Add the query from userInput + }; -// Function to process user input -export async function processUserInput(userInput: string, state: any, runtime: IAgentRuntime): Promise { - // Construct the prompt for the LLM const prompt = constructSearchPrompt(userInput); + const llmResponse = await genereteSearchParameters(prompt, searchState, runtime); - // Call the LLM API (this is a placeholder; replace with actual API call) - const llmResponse = await genereteSearchParameters(prompt, state, runtime); - - // Attempt to parse the LLM's response as JSON try { - const parsedResponse = JSON.parse(llmResponse); - - // Validate the parsed response against the schema - const validatedResponse = searchQuerySchema.parse(parsedResponse); - - return validatedResponse; - } catch (error) { - console.error('Failed to parse or validate LLM response:', error); - return null; + const parsedResponse = JSON.parse(llmResponse) as SearchQuery; + const validatedResponse = searchQuerySchema.parse(parsedResponse); + return validatedResponse; + } catch (error: unknown) { + console.error('Failed to parse or validate LLM response:', error); + return null; } - } +} \ No newline at end of file diff --git a/packages/plugin-obsidian/src/providers/obsidianClient.ts b/packages/plugin-obsidian/src/providers/obsidianClient.ts index dec0932bbeb..75fa060b596 100644 --- a/packages/plugin-obsidian/src/providers/obsidianClient.ts +++ b/packages/plugin-obsidian/src/providers/obsidianClient.ts @@ -1,5 +1,5 @@ import type { NoteContent, ResultNoteApi, ResultNoteSearchApi, ServerInfo } from "../types"; -import { createHash } from "crypto"; +import { createHash } from "node:crypto"; import { elizaLogger, type AgentRuntime, @@ -189,6 +189,7 @@ export class ObsidianProvider { } try { + const createDirsString = createDirectories.toString(); const response = await fetch( `${this.host_url}/vault/${encodeURIComponent(path)}`, { @@ -196,7 +197,7 @@ export class ObsidianProvider { headers: { Authorization: `Bearer ${this.token}`, "Content-Type": "text/markdown", - "X-Create-Directories": createDirectories.toString(), + "X-Create-Directories": createDirsString, }, body: content, } @@ -362,6 +363,7 @@ export class ObsidianProvider { } try { + const createDirsString = createDirectories.toString(); const response = await fetch( `${this.host_url}/vault/${encodeURIComponent(path)}`, { @@ -369,7 +371,7 @@ export class ObsidianProvider { headers: { Authorization: `Bearer ${this.token}`, "Content-Type": "text/markdown", - "X-Create-Directories": createDirectories.toString(), + "X-Create-Directories": createDirsString, }, body: content, } @@ -529,7 +531,6 @@ export class ObsidianProvider { } body = JSON.stringify(query); break; - case 'plaintext': default: contentType = 'application/json'; if (typeof query !== 'string') { @@ -547,26 +548,24 @@ export class ObsidianProvider { ); if (queryFormat === 'dataview' || queryFormat === 'jsonlogic') { + const response = await fetch(`${this.host_url}/search`, { + method: 'POST', + headers: { + Authorization: `Bearer ${this.token}`, + 'Content-Type': contentType, + Accept: 'application/json', + }, + body: body, + }); - const response = await fetch(`${this.host_url}/search`, { - method: 'POST', - headers: { - Authorization: `Bearer ${this.token}`, - 'Content-Type': contentType, - Accept: 'application/json', - }, - body: body, - }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); + const results: ResultNoteSearchApi[] = await response.json(); + return results; } - const results: ResultNoteSearchApi[] = await response.json(); - return results; - - } else { - const response = await fetch(`${this.host_url}/search/simple?query=${encodeURIComponent(body)}&contextLength=${contextLength}`, { method: 'POST', headers: { @@ -582,8 +581,6 @@ export class ObsidianProvider { const results: ResultNoteApi[] = await response.json(); return results; - } - } catch (error) { elizaLogger.error('Search failed:', error.message); throw error; @@ -610,7 +607,7 @@ export class ObsidianProvider { const orQueries = query.split(/\s+OR\s+/).map((q) => q.trim()); elizaLogger.log( - `Processing search query with OR operator:`, + 'Processing search query with OR operator:', orQueries ); @@ -666,14 +663,15 @@ export class ObsidianProvider { const processedDirs = new Set(); while (dirsToProcess.length > 0) { - const currentDir = dirsToProcess.shift()!; + const currentDir = dirsToProcess.shift(); + if (currentDir === undefined) continue; if (processedDirs.has(currentDir)) { continue; } try { - elizaLogger.debug(`Scanning directory: ${currentDir}`); + elizaLogger.debug("Scanning directory:", currentDir); const items = await this.listDirectoryFiles(currentDir); for (const item of items) { @@ -729,7 +727,7 @@ export class ObsidianProvider { elizaLogger.info(`Completed scanning. Found ${allFiles.length} files in vault`); // Remove any duplicates - const uniqueFiles = [...new Set(allFiles)]; + const uniqueFiles = Array.from(new Set(allFiles)); return uniqueFiles; } catch (error) { @@ -753,63 +751,59 @@ export class ObsidianProvider { for (const file of allFiles) { try { - // Only process markdown files - if (!file.endsWith('.md')) { - continue; - } - - // Get the file content - const content = await this.getNote(file); - if (!content) { - elizaLogger.warn(`No content found for file: ${file}`); - continue; - } + if (file.endsWith('.md')) { + // Get the file content + const content = await this.getNote(file); + if (!content) { + elizaLogger.warn(`No content found for file: ${file}`); + continue; + } - const contentHash = createHash("sha256") - .update(JSON.stringify(content)) - .digest("hex"); + const contentHash = createHash("sha256") + .update(JSON.stringify(content)) + .digest("hex"); - const knowledgeId = stringToUuid( - `obsidian-${file}` - ); + const knowledgeId = stringToUuid( + `obsidian-${file}` + ); - const existingDocument = - await this.runtime.documentsManager.getMemoryById(knowledgeId); + const existingDocument = + await this.runtime.documentsManager.getMemoryById(knowledgeId); - if ( - existingDocument && - existingDocument.content["hash"] === contentHash - ) { - elizaLogger.debug(`Skipping unchanged file: ${file}`); - continue; - } + if ( + existingDocument && + existingDocument.content.hash === contentHash + ) { + elizaLogger.debug(`Skipping unchanged file: ${file}`); + continue; + } - elizaLogger.info( - `Processing knowledge for ${this.runtime.character.name} - ${file}` - ); - - await knowledge.set(this.runtime, { - id: knowledgeId, - content: { - text: content.content, - hash: contentHash, - source: "obsidian", - attachments: [], - metadata: { - path: file, - tags: content.tags, - frontmatter: content.frontmatter, - stats: content.stat + elizaLogger.info( + `Processing knowledge for ${this.runtime.character.name} - ${file}` + ); + + await knowledge.set(this.runtime, { + id: knowledgeId, + content: { + text: content.content, + hash: contentHash, + source: "obsidian", + attachments: [], + metadata: { + path: file, + tags: content.tags, + frontmatter: content.frontmatter, + stats: content.stat + }, }, - }, - }); - - // delay to avoid throttling - await new Promise(resolve => setTimeout(resolve, 100)); + }); + // delay to avoid throttling + await new Promise(resolve => setTimeout(resolve, 100)); + } } catch (error) { elizaLogger.error(`Error processing file ${file}:`, error); - continue; + // continue; } } diff --git a/packages/plugin-opacity/package.json b/packages/plugin-opacity/package.json index c15b91872ea..beb8465cada 100644 --- a/packages/plugin-opacity/package.json +++ b/packages/plugin-opacity/package.json @@ -1,20 +1,20 @@ { - "name": "@elizaos/plugin-opacity", - "version": "0.1.9", - "description": "Opacity Protocol adapter for ElizaOS", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "scripts": { - "build": "tsup src/index.ts --format esm --dts", - "watch": "tsc --watch", - "dev": "tsup src/index.ts --format esm --dts --watch" - }, - "dependencies": { - "@elizaos/core": "workspace:*", - "dotenv": "^16.4.5" - }, - "devDependencies": { - "tsup": "^8.3.5" - } + "name": "@elizaos/plugin-opacity", + "version": "0.1.9", + "description": "Opacity Protocol adapter for ElizaOS", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsup src/index.ts --format esm --dts", + "watch": "tsc --watch", + "dev": "tsup src/index.ts --format esm --dts --watch" + }, + "dependencies": { + "@elizaos/core": "workspace:*", + "dotenv": "^16.4.5" + }, + "devDependencies": { + "tsup": "^8.3.5" + } } diff --git a/packages/plugin-open-weather/package.json b/packages/plugin-open-weather/package.json index 4cb024cde3e..eaf183dffaf 100644 --- a/packages/plugin-open-weather/package.json +++ b/packages/plugin-open-weather/package.json @@ -1,33 +1,33 @@ { - "name": "@elizaos/plugin-open-weather", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5", - "zod": "^3.22.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-open-weather", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5", + "zod": "^3.22.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-primus/package.json b/packages/plugin-primus/package.json index 108206623bd..0b9cf53cad2 100644 --- a/packages/plugin-primus/package.json +++ b/packages/plugin-primus/package.json @@ -1,33 +1,33 @@ { - "name": "@elizaos/plugin-primus", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "agent-twitter-client": "0.0.18", - "@primuslabs/zktls-core-sdk": "^0.1.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-primus", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@primuslabs/zktls-core-sdk": "^0.1.0", + "agent-twitter-client": "0.0.18", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-quai/package.json b/packages/plugin-quai/package.json index 49d95da1ef1..9ab501f3dfe 100644 --- a/packages/plugin-quai/package.json +++ b/packages/plugin-quai/package.json @@ -1,23 +1,23 @@ { - "name": "@elizaos/plugin-quai", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "quais": "1.0.0-alpha.25", - "tsup": "^8.3.5", - "vitest": "^2.1.4", - "@avnu/avnu-sdk": "^2.1.1", - "@elizaos/plugin-trustdb": "workspace:*" - }, - "scripts": { - "build": "tsup --format esm --dts", - "test": "vitest", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-quai", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@avnu/avnu-sdk": "^2.1.1", + "@elizaos/core": "workspace:*", + "@elizaos/plugin-trustdb": "workspace:*", + "quais": "1.0.0-alpha.25", + "tsup": "^8.3.5", + "vitest": "^2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "test": "vitest", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-rabbi-trader/package.json b/packages/plugin-rabbi-trader/package.json index c1a464ad5a3..89403521913 100644 --- a/packages/plugin-rabbi-trader/package.json +++ b/packages/plugin-rabbi-trader/package.json @@ -5,19 +5,19 @@ "type": "module", "types": "dist/index.d.ts", "dependencies": { - "@elizaos/core": "workspace:*", "@elizaos/client-twitter": "workspace:*", + "@elizaos/core": "workspace:*", "@elizaos/plugin-solana": "workspace:*", "@elizaos/plugin-trustdb": "workspace:*", "@solana/web3.js": "1.95.8", "zod": "3.23.8", "@goat-sdk/core": "0.3.8", + "@goat-sdk/plugin-coingecko": "0.1.4", "@goat-sdk/plugin-erc20": "0.1.7", "@goat-sdk/wallet-viem": "0.1.3", - "node-cache": "^5.1.2", "bignumber": "1.1.0", "bignumber.js": "9.1.2", - "@goat-sdk/plugin-coingecko": "0.1.4", + "node-cache": "^5.1.2", "tsup": "8.3.5", "ws": "^8.0.0" }, diff --git a/packages/plugin-rabbi-trader/src/index.ts b/packages/plugin-rabbi-trader/src/index.ts index 400f5fcc595..635c8528111 100644 --- a/packages/plugin-rabbi-trader/src/index.ts +++ b/packages/plugin-rabbi-trader/src/index.ts @@ -425,7 +425,7 @@ async function getChainBalance( ): Promise { // Use existing Solana balance fetching logic return await getTokenBalance( - connection, + connection as any, // TODO: Resolve type conflict caused by multiple versions of @solana/web3.js walletAddress, new PublicKey(tokenAddress) ); @@ -461,7 +461,8 @@ async function createRabbiTraderPlugin( // Move connection initialization to the top const connection = new Connection( - runtime?.getSetting("SOLANA_RPC_URL") || "https://api.mainnet-beta.solana.com" + runtime?.getSetting("SOLANA_RPC_URL") || + "https://api.mainnet-beta.solana.com" ); const keypair = getWalletKeypair(runtime); @@ -475,7 +476,9 @@ async function createRabbiTraderPlugin( } if (missingSettings.length > 0) { - const errorMsg = `Missing required settings: ${missingSettings.join(", ")}`; + const errorMsg = `Missing required settings: ${missingSettings.join( + ", " + )}`; elizaLogger.error(errorMsg); throw new Error(errorMsg); } @@ -510,7 +513,7 @@ async function createRabbiTraderPlugin( // Existing Solana logic const tokenPublicKey = new PublicKey(tokenAddress); const amount = await getTokenBalance( - connection, + connection as any, // TODO: Resolve type conflict caused by multiple versions of @solana/web3.js keypair.publicKey, tokenPublicKey ); @@ -560,9 +563,9 @@ async function createRabbiTraderPlugin( }, executeTrade: async (_params) => { //try { - return { success: true }; + return { success: true }; //} catch (error) { - //throw error; + //throw error; //} }, getFormattedPortfolio: async () => "", @@ -646,7 +649,9 @@ async function createRabbiTraderPlugin( } catch (error) { elizaLogger.error("Failed to initialize plugin components:", error); throw new Error( - `Plugin initialization failed: ${error instanceof Error ? error.message : String(error)}` + `Plugin initialization failed: ${ + error instanceof Error ? error.message : String(error) + }` ); } } @@ -665,7 +670,9 @@ async function analyzeToken( // Skip if analyzed within last 20 minutes if (cachedData && now - cachedData.lastAnalysis < 1200000) { elizaLogger.log( - `Using cached data for ${tokenAddress}, last analyzed ${Math.floor((now - cachedData.lastAnalysis) / 1000)}s ago` + `Using cached data for ${tokenAddress}, last analyzed ${Math.floor( + (now - cachedData.lastAnalysis) / 1000 + )}s ago` ); return; } @@ -845,7 +852,9 @@ async function analyzeToken( result ); } - } catch (err) { elizaLogger.error('rabbi - trade error', err) } + } catch (err) { + elizaLogger.error("rabbi - trade error", err); + } return []; } ); diff --git a/packages/plugin-router-nitro/src/actions/executeSwap.ts b/packages/plugin-router-nitro/src/actions/executeSwap.ts index 6d94c32ad13..1e14075af7e 100644 --- a/packages/plugin-router-nitro/src/actions/executeSwap.ts +++ b/packages/plugin-router-nitro/src/actions/executeSwap.ts @@ -2,11 +2,11 @@ import { composeContext, elizaLogger, generateObjectDeprecated, - HandlerCallback, - IAgentRuntime, - Memory, + type HandlerCallback, + type IAgentRuntime, + type Memory, ModelClass, - State + type State } from "@elizaos/core"; import { swapTemplate } from "./swapTemplate.ts"; import { ChainUtils, fetchChains, fetchPathfinderQuote, fetchTokenConfig } from "./utils.ts"; @@ -15,13 +15,82 @@ import { checkAndSetAllowance, checkNativeTokenBalance, checkUserBalance, getSwa import { ethers } from "ethers"; import { getBlockExplorerFromChainId, getRpcUrlFromChainId } from "./chains.ts"; -export { swapTemplate }; +// Types +interface PathfinderDestinationAsset { + decimals: number; +} + +interface PathfinderDestination { + tokenAmount: string; + asset: PathfinderDestinationAsset; +} + +interface PathfinderResponse { + destination: PathfinderDestination; + allowanceTo: string; +} + +interface SwapContent { + fromChain: string; + toChain: string; + fromToken: string; + toToken: string; + amount: string; + toAddress: string; +} + +// Helper functions +const validateAddress = (address: string): boolean => + typeof address === "string" && address.startsWith("0x") && address.length === 42; + +const initializeWallet = async (runtime: IAgentRuntime, rpc: string) => { + const privateKey = runtime.getSetting("ROUTER_NITRO_EVM_PRIVATE_KEY"); + if (!privateKey) { + throw new Error("Private key is missing. Please set ROUTER_NITRO_EVM_PRIVATE_KEY in the environment settings."); + } + const provider = new ethers.JsonRpcProvider(rpc); + return new ethers.Wallet(privateKey, provider); +}; + +const checkBalances = async (wallet: ethers.Wallet, tokenConfig: any, amountIn: bigint) => { + const isNativeToken = tokenConfig.address.toLowerCase() === "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; + + if (isNativeToken) { + const nativeBalance = await checkNativeTokenBalance(wallet, tokenConfig.decimals); + if (BigInt(nativeBalance) < amountIn) { + throw new Error("Insufficient native token balance"); + } + } + + const tokenBalance = await checkUserBalance(wallet, tokenConfig.address, tokenConfig.decimals); + if (BigInt(tokenBalance) < amountIn) { + throw new Error("Insufficient token balance"); + } +}; + +const handleTransaction = async ( + wallet: ethers.Wallet, + txResponse: any, + blockExplorer: string, + callback?: HandlerCallback +) => { + const tx = await wallet.sendTransaction(txResponse.txn); + const receipt = await tx.wait(); + + if (!receipt?.status) { + throw new Error("Transaction failed"); + } + + const txExplorerUrl = blockExplorer ? `${blockExplorer}/tx/${tx.hash}` : tx.hash; + const successMessage = `Swap completed successfully! Txn: ${txExplorerUrl}`; + + callback?.({ text: successMessage }); + return true; +}; export const executeSwapAction = { name: "ROUTER_NITRO_SWAP", - description: "Swaps tokens across chains from the agent's wallet to a recipient wallet. \n" + - "By default the senders configured wallets will be used to send the assets to on the destination chains, unless clearly defined otherwise by providing a recipient address.\n" + - "The system supports bridging, cross chain swaps and normal swaps.", + description: "Swaps tokens across chains from the agent's wallet to a recipient wallet.", handler: async ( runtime: IAgentRuntime, message: Memory, @@ -29,136 +98,82 @@ export const executeSwapAction = { _options: { [key: string]: unknown } = {}, callback?: HandlerCallback ): Promise => { - console.log("Starting ROUTER_NITRO_SWAP handler..."); elizaLogger.log("Starting ROUTER_NITRO_SWAP handler..."); - // Initialize or update state - if (!state) { - state = (await runtime.composeState(message)) as State; - } else { - state = await runtime.updateRecentMessageState(state); - } - - const swapContext = composeContext({ - state, - template: swapTemplate, - }); - - const content = await generateObjectDeprecated({ - runtime, - context: swapContext, - modelClass: ModelClass.LARGE, - }); - console.log("content: ", content); - elizaLogger.log("swap content: ", JSON.stringify(content)); - - if (content.toAddress === null || !(typeof content.toAddress === "string" && content.toAddress.startsWith("0x") && content.toAddress.length === 42)) { - content.toAddress = runtime.getSetting("ROUTER_NITRO_EVM_ADDRESS"); - } - - const { fromChain, toChain, fromToken, toToken, amount, toAddress } = content; - try { - const apiResponse = await fetchChains(); - const chainUtils = new ChainUtils(apiResponse); - const swapDetails = chainUtils.processChainSwap(fromChain, toChain); - elizaLogger.log(`Chain Data Details: ${JSON.stringify(swapDetails)}`); + // State initialization + const updatedState = state ? + await runtime.updateRecentMessageState(state) : + await runtime.composeState(message); - let privateKey = runtime.getSetting("ROUTER_NITRO_EVM_PRIVATE_KEY"); - if (!privateKey) { - throw new Error("Private key is missing. Please set ROUTER_NITRO_EVM_PRIVATE_KEY in the environment settings."); + // Generate swap content + const swapContext = composeContext({ state: updatedState, template: swapTemplate }); + const content = await generateObjectDeprecated({ + runtime, + context: swapContext, + modelClass: ModelClass.LARGE, + }) as SwapContent; + + // Validate and set address + if (!validateAddress(content.toAddress)) { + content.toAddress = runtime.getSetting("ROUTER_NITRO_EVM_ADDRESS"); } - let rpc = getRpcUrlFromChainId(swapDetails.fromChainId); - let provider = new ethers.JsonRpcProvider(rpc); - let wallet = new ethers.Wallet(privateKey, provider); - let address = await wallet.getAddress(); + // Initialize chain data + const chainUtils = new ChainUtils(await fetchChains()); + const swapDetails = chainUtils.processChainSwap(content.fromChain, content.toChain); + if (!swapDetails.fromChainId || !swapDetails.toChainId) { - elizaLogger.log("Invalid chain data details"); - return false; + throw new Error("Invalid chain data details"); } - else { - const fromTokenConfig = await fetchTokenConfig(Number(swapDetails.fromChainId), fromToken); - const toTokenConfig = await fetchTokenConfig(Number(swapDetails.toChainId), toToken); - let amountIn = BigInt(Math.floor(Number(amount) * Math.pow(10, fromTokenConfig.decimals))); - console.log(`Amount to swap: ${amountIn}`); - if (fromTokenConfig.address.toLowerCase() == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee") { - const userBalance = await checkNativeTokenBalance(wallet, fromTokenConfig.decimals); - if (BigInt(userBalance) < amountIn) { - elizaLogger.log("Insufficient balance to perform the swap"); - callback?.({ text: `Insufficient balance to perform the swap` }); - return false; - } - } - else { - const userBalance = await checkUserBalance(wallet, fromTokenConfig.address, fromTokenConfig.decimals); - if (BigInt(userBalance) < amountIn) { - elizaLogger.log("Insufficient balance to perform the swap"); - callback?.({ text: `Insufficient balance to perform the swap` }); - return false; - } - } + // Initialize wallet + const rpc = getRpcUrlFromChainId(swapDetails.fromChainId); + const wallet = await initializeWallet(runtime, rpc); + const address = await wallet.getAddress(); - const pathfinderParams = { - fromTokenAddress: fromTokenConfig.address, - toTokenAddress: toTokenConfig.address, - amount: (amountIn).toString(), - fromTokenChainId: Number(swapDetails.fromChainId), - toTokenChainId: Number(swapDetails.toChainId), - partnerId: 127, - }; - // console.log("Pathfinder Params: ", pathfinderParams); - const pathfinderResponse = await fetchPathfinderQuote(pathfinderParams); - if (pathfinderResponse) { - let destinationData = pathfinderResponse.destination; - const amountOut = BigInt(destinationData.tokenAmount); - const decimals = Math.pow(10, destinationData.asset.decimals); - const normalizedAmountOut = Number(amountOut) / decimals; - elizaLogger.log(`Quote: ${normalizedAmountOut}`); + // Fetch token configurations + const [fromTokenConfig, toTokenConfig] = await Promise.all([ + fetchTokenConfig(Number(swapDetails.fromChainId), content.fromToken), + fetchTokenConfig(Number(swapDetails.toChainId), content.toToken) + ]); - await checkAndSetAllowance( - wallet, - fromTokenConfig.address, - pathfinderResponse.allowanceTo, - amountIn - ); - const txResponse = await getSwapTransaction(pathfinderResponse, address, toAddress); + // Calculate amount and check balances + const amountIn = BigInt(Math.floor(Number(content.amount) * 10 ** fromTokenConfig.decimals)); + await checkBalances(wallet, fromTokenConfig, amountIn); - const tx = await wallet.sendTransaction(txResponse.txn) - try { - await tx.wait(); - const blockExplorerUrl = getBlockExplorerFromChainId(swapDetails.fromChainId).url; - if (blockExplorerUrl) { - const txExplorerUrl = `${blockExplorerUrl}/tx/${tx.hash}`; - elizaLogger.log(`Transaction Explorer URL: ${txExplorerUrl}`); - callback?.({ - text: - "Swap completed successfully! Txn: " + - txExplorerUrl, - }); - return true; + // Get pathfinder quote and process swap + const pathfinderResponse = await fetchPathfinderQuote({ + fromTokenAddress: fromTokenConfig.address, + toTokenAddress: toTokenConfig.address, + amount: amountIn.toString(), + fromTokenChainId: Number(swapDetails.fromChainId), + toTokenChainId: Number(swapDetails.toChainId), + partnerId: 127, + }) as PathfinderResponse; - } else { - callback?.({ - text: - "Swap completed successfully! Txn: " + - tx.hash, - }); - } - } - catch (error) { - console.log(`Transaction failed with error: ${error}`) - } - } + if (pathfinderResponse) { + await checkAndSetAllowance( + wallet, + fromTokenConfig.address, + pathfinderResponse.allowanceTo, + amountIn + ); + + const txResponse = await getSwapTransaction(pathfinderResponse, address, content.toAddress); + const blockExplorer = getBlockExplorerFromChainId(swapDetails.fromChainId).url; + + return await handleTransaction(wallet, txResponse, blockExplorer, callback); } + + return false; } catch (error) { elizaLogger.log(`Error during executing swap: ${error.message}`); callback?.({ text: `Error during swap: ${error.message}` }); return false; } - return true; }, + template: swapTemplate, validate: async (runtime: IAgentRuntime) => { await validateRouterNitroConfig(runtime); @@ -273,4 +288,3 @@ export const executeSwapAction = { ], similes: ["CROSS_CHAIN_SWAP", "CROSS_CHAIN_BRIDGE", "NITRO_BRIDGE", "SWAP", "BRIDGE", "TRANSFER"], }; - diff --git a/packages/plugin-router-nitro/src/actions/executeSwap_bk.ts b/packages/plugin-router-nitro/src/actions/executeSwap_bk.ts new file mode 100644 index 00000000000..b0f205ef76e --- /dev/null +++ b/packages/plugin-router-nitro/src/actions/executeSwap_bk.ts @@ -0,0 +1,293 @@ +import { + composeContext, + elizaLogger, + generateObjectDeprecated, + HandlerCallback, + IAgentRuntime, + Memory, + ModelClass, + State +} from "@elizaos/core"; +import { swapTemplate } from "./swapTemplate.ts"; +import { ChainUtils, fetchChains, fetchPathfinderQuote, fetchTokenConfig } from "./utils.ts"; +import { validateRouterNitroConfig } from "../environment.ts"; +import { checkAndSetAllowance, checkNativeTokenBalance, checkUserBalance, getSwapTransaction } from "./txns.ts"; +import { ethers } from "ethers"; +import { getBlockExplorerFromChainId, getRpcUrlFromChainId } from "./chains.ts"; + +export { swapTemplate }; + +// Add these interfaces +interface PathfinderDestinationAsset { + decimals: number; +} + +interface PathfinderDestination { + tokenAmount: string; + asset: PathfinderDestinationAsset; +} + +interface PathfinderResponse { + destination: PathfinderDestination; + allowanceTo: string; +} + +export const executeSwapAction = { + name: "ROUTER_NITRO_SWAP", + description: "Swaps tokens across chains from the agent's wallet to a recipient wallet. \n" + + "By default the senders configured wallets will be used to send the assets to on the destination chains, unless clearly defined otherwise by providing a recipient address.\n" + + "The system supports bridging, cross chain swaps and normal swaps.", + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State | undefined, + _options: { [key: string]: unknown } = {}, + callback?: HandlerCallback + ): Promise => { + console.log("Starting ROUTER_NITRO_SWAP handler..."); + elizaLogger.log("Starting ROUTER_NITRO_SWAP handler..."); + + // Initialize or update state + let updatedState = state; + if (!updatedState) { + updatedState = (await runtime.composeState(message)) as State; + } else { + updatedState = await runtime.updateRecentMessageState(updatedState); + } + + const swapContext = composeContext({ + state: updatedState, // Use the local variable + template: swapTemplate, + }); + + const content = await generateObjectDeprecated({ + runtime, + context: swapContext, + modelClass: ModelClass.LARGE, + }); + console.log("content: ", content); + elizaLogger.log("swap content: ", JSON.stringify(content)); + + if (content.toAddress === null || !(typeof content.toAddress === "string" && content.toAddress.startsWith("0x") && content.toAddress.length === 42)) { + content.toAddress = runtime.getSetting("ROUTER_NITRO_EVM_ADDRESS"); + } + + const { fromChain, toChain, fromToken, toToken, amount, toAddress } = content; + + try { + const apiResponse = await fetchChains(); + const chainUtils = new ChainUtils(apiResponse); + const swapDetails = chainUtils.processChainSwap(fromChain, toChain); + elizaLogger.log(`Chain Data Details: ${JSON.stringify(swapDetails)}`); + + const privateKey = runtime.getSetting("ROUTER_NITRO_EVM_PRIVATE_KEY"); + if (!privateKey) { + throw new Error("Private key is missing. Please set ROUTER_NITRO_EVM_PRIVATE_KEY in the environment settings."); + } + const rpc = getRpcUrlFromChainId(swapDetails.fromChainId); + const provider = new ethers.JsonRpcProvider(rpc); + const wallet = new ethers.Wallet(privateKey, provider); + const address = await wallet.getAddress(); + + if (!swapDetails.fromChainId || !swapDetails.toChainId) { + elizaLogger.log("Invalid chain data details"); + return false; + } + else { + const fromTokenConfig = await fetchTokenConfig(Number(swapDetails.fromChainId), fromToken); + const toTokenConfig = await fetchTokenConfig(Number(swapDetails.toChainId), toToken); + + let amountIn = BigInt(Math.floor(Number(amount) * 10 ** fromTokenConfig.decimals)); + + console.log(`Amount to swap: ${amountIn}`); + + if (fromTokenConfig.address.toLowerCase() === "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee") { + const userBalance = await checkNativeTokenBalance(wallet, fromTokenConfig.decimals); + if (BigInt(userBalance) < amountIn) { + elizaLogger.log("Insufficient balance to perform the swap"); + callback?.({ text: "Insufficient balance to perform the swap" }); + return false; + } + } + else { + const userBalance = await checkUserBalance(wallet, fromTokenConfig.address, fromTokenConfig.decimals); + if (BigInt(userBalance) < amountIn) { + elizaLogger.log("Insufficient balance to perform the swap"); + callback?.({ text: "Insufficient balance to perform the swap" }); + return false; + } + } + + const pathfinderParams = { + fromTokenAddress: fromTokenConfig.address, + toTokenAddress: toTokenConfig.address, + amount: (amountIn).toString(), + fromTokenChainId: Number(swapDetails.fromChainId), + toTokenChainId: Number(swapDetails.toChainId), + partnerId: 127, + }; + // console.log("Pathfinder Params: ", pathfinderParams); + const pathfinderResponse = await fetchPathfinderQuote(pathfinderParams) as PathfinderResponse; + if (pathfinderResponse) { + let destinationData = pathfinderResponse.destination; + const amountOut = BigInt(destinationData.tokenAmount); + const decimals = 10 ** destinationData.asset.decimals; + // const decimals = Math.pow(10, destinationData.asset.decimals); + const normalizedAmountOut = Number(amountOut) / decimals; + elizaLogger.log(`Quote: ${normalizedAmountOut}`); + + await checkAndSetAllowance( + wallet, + fromTokenConfig.address, + pathfinderResponse.allowanceTo, + amountIn + ); + const txResponse = await getSwapTransaction(pathfinderResponse, address, toAddress); + + const tx = await wallet.sendTransaction(txResponse.txn) + try { + await tx.wait(); + const blockExplorerUrl = getBlockExplorerFromChainId(swapDetails.fromChainId).url; + if (blockExplorerUrl) { + const txExplorerUrl = `${blockExplorerUrl}/tx/${tx.hash}`; + elizaLogger.log(`Transaction Explorer URL: ${txExplorerUrl}`); + callback?.({ + text: `Swap completed successfully! Txn: ${txExplorerUrl}`, + }); + return true; + + } else { + callback?.({ + text: `Swap completed successfully! Txn: ${tx.hash}`, + }); + } + } + catch (error) { + console.log(`Transaction failed with error: ${error}`) + } + } + } + } catch (error) { + elizaLogger.log(`Error during executing swap: ${error.message}`); + callback?.({ text: `Error during swap: ${error.message}` }); + return false; + } + return true; + }, + + + template: swapTemplate, + validate: async (runtime: IAgentRuntime) => { + await validateRouterNitroConfig(runtime); + return true; + }, + examples: [ + [ + { + user: "{{user1}}", + content: { + text: "Bridge 1 ETH from Ethereum to Base on address 0xCCa8009f5e09F8C5dB63cb0031052F9CB635Af62", + }, + }, + { + user: "{{agent}}", + content: { + text: "Sure, I'll send 1 ETH from Ethereum to Base", + action: "ROUTER_NITRO_SWAP", + }, + }, + { + user: "{{agent}}", + content: { + text: "Successfully sent 1 ETH to 0xCCa8009f5e09F8C5dB63cb0031052F9CB635Af62 on Base\nTransaction: 0x4fed598033f0added272c3ddefd4d83a521634a738474400b27378db462a76ec", + }, + }, + ], + [ + { + user: "{{user1}}", + content: { + text: "Please swap 1 ETH into USDC from Avalanche to Base on address 0xF43042865f4D3B32A19ECBD1C7d4d924613c41E8", + }, + }, + { + user: "{{agent}}", + content: { + text: "Sure, I'll swap 1 ETH into USDC from Solana to Base on address 0xF43042865f4D3B32A19ECBD1C7d4d924613c41E8", + action: "ROUTER_NITRO_SWAP", + }, + }, + { + user: "{{agent}}", + content: { + text: "Successfully Swapped 1 ETH into USDC and sent to 0xF43042865f4D3B32A19ECBD1C7d4d924613c41E8 on Base\nTransaction: 2sj3ifA5iPdRDfnkyK5LZ4KoyN57AH2QoHFSzuefom11F1rgdiUriYf2CodBbq9LBi77Q5bLHz4CShveisTu954B", + }, + }, + ], + [ + { + user: "{{user1}}", + content: { + text: "Send 100 UNI from Arbitrum to Ethereum on 0xCCa8009f5e09F8C5dB63cb0031052F9CB635Af62 ", + }, + }, + { + user: "{{agent}}", + content: { + text: "Sure, I'll send 100 UNI to Ethereum right away.", + action: "ROUTER_NITRO_SWAP", + }, + }, + { + user: "{{agent}}", + content: { + text: "Successfully sent 100 UNI to 0xCCa8009f5e09F8C5dB63cb0031052F9CB635Af62 on Ethereum\nTransaction: 0x4fed598033f0added272c3ddefd4d83a521634a738474400b27378db462a76ec", + }, + }, + ], + [ + { + "user": "{{user1}}", + "content": { + "text": "Transfer 50 AAVE from Polygon to Optimism on address 0x5C7EDE23cFeBB3A2F60d2D51901A53a276e8F001", + } + }, + { + "user": "{{agent}}", + "content": { + "text": "Sure, I'll transfer 50 AAVE from Polygon to Optimism", + "action": "ROUTER_NITRO_SWAP", + } + }, + { + "user": "{{agent}}", + "content": { + "text": "Successfully transferred 50 AAVE to 0x5C7EDE23cFeBB3A2F60d2D51901A53a276e8F001 on Optimism\nTransaction: 0x720b46c95f7f819f5d7e1e8df6fd7d8be12b8d06312bb9d96ea85a45fc65079a", + } + } + ], + [ + { + "user": "{{user1}}", + "content": { + "text": "Send 1000 USDT from Ethereum to Arbitrum on address 0x456dC2FfE61d8F92A29b9Bd6b32730d345e0638c", + } + }, + { + "user": "{{agent}}", + "content": { + "text": "Sure, I'll send 1000 USDT from Ethereum to Arbitrum", + "action": "ROUTER_NITRO_SWAP", + } + }, + { + "user": "{{agent}}", + "content": { + "text": "Successfully sent 1000 USDT to 0x456dC2FfE61d8F92A29b9Bd6b32730d345e0638c on Arbitrum\nTransaction: 0x3c72a5fe4d0278f2b46dbe765a5f5dbf2f78cbfdce3d0c2b8f11855969e9e173", + } + } + ] + ], + similes: ["CROSS_CHAIN_SWAP", "CROSS_CHAIN_BRIDGE", "NITRO_BRIDGE", "SWAP", "BRIDGE", "TRANSFER"], +}; + diff --git a/packages/plugin-router-nitro/src/actions/txns.ts b/packages/plugin-router-nitro/src/actions/txns.ts index 10a79f9cca5..4386b187537 100644 --- a/packages/plugin-router-nitro/src/actions/txns.ts +++ b/packages/plugin-router-nitro/src/actions/txns.ts @@ -2,7 +2,7 @@ import axios from 'axios'; import { ethers } from 'ethers' import { erc20Abi } from 'viem'; -export const checkUserBalance = async (wallet, tokenAddress: string, decimals) => { +export const checkUserBalance = async (wallet, tokenAddress: string, _decimals) => { try { if (!wallet.provider) { throw new Error("Wallet must be connected to a provider."); @@ -11,12 +11,12 @@ export const checkUserBalance = async (wallet, tokenAddress: string, decimals) = const address = await wallet.getAddress(); const balance = await tokenContract.balanceOf(address); return balance.toString(); - } catch (error) { + } catch (_error) { // Changed from 'error' to '_error' to indicate it's intentionally unused throw new Error("Unable to fetch balance"); } }; -export const checkNativeTokenBalance = async (wallet, decimals) => { +export const checkNativeTokenBalance = async (wallet, _decimals) => { try { if (!wallet.provider) { @@ -26,7 +26,7 @@ export const checkNativeTokenBalance = async (wallet, decimals) => { const address = await wallet.getAddress(); const balance = await wallet.provider.getBalance(address); return balance.toString(); - } catch (error) { + } catch (_error) { // Changed from 'error' to '_error' to indicate it's intentionally unused throw new Error("Unable to fetch native token balance"); } }; @@ -62,7 +62,7 @@ export const checkAndSetAllowance = async (wallet, tokenAddress, approvalAddress }; export const getSwapTransaction = async (quoteData, senderAddress, receiverAddress) => { - const txDataUrl = `https://api-beta.pathfinder.routerprotocol.com/api/v2/transaction` + const txDataUrl = "https://api-beta.pathfinder.routerprotocol.com/api/v2/transaction"; const requestData = { ...quoteData, @@ -70,9 +70,9 @@ export const getSwapTransaction = async (quoteData, senderAddress, receiverAddre receiverAddress: receiverAddress }; - let config = { + const config = { method: 'post', - maxBodyLength: Infinity, + maxBodyLength: Number.POSITIVE_INFINITY, url: txDataUrl, headers: { 'content-type': 'application/json' @@ -81,10 +81,10 @@ export const getSwapTransaction = async (quoteData, senderAddress, receiverAddre }; try { - let res = await axios.request(config); + const res = await axios.request(config); return res.data; } catch (e) { - console.error(`Fetching tx data from pathfinder: ${e}`) + console.error(`Fetching tx data from pathfinder: ${e}`); } } diff --git a/packages/plugin-router-nitro/src/actions/txns_bk.ts b/packages/plugin-router-nitro/src/actions/txns_bk.ts new file mode 100644 index 00000000000..b56655549ab --- /dev/null +++ b/packages/plugin-router-nitro/src/actions/txns_bk.ts @@ -0,0 +1,90 @@ +import axios from 'axios'; +import { ethers } from 'ethers' +import { erc20Abi } from 'viem'; + +export const checkUserBalance = async (wallet, tokenAddress: string, decimals) => { + try { + if (!wallet.provider) { + throw new Error("Wallet must be connected to a provider."); + } + const tokenContract = new ethers.Contract(tokenAddress, erc20Abi, wallet.provider); + const address = await wallet.getAddress(); + const balance = await tokenContract.balanceOf(address); + return balance.toString(); + } catch (_error) { // Changed from 'error' to '_error' to indicate it's intentionally unused + throw new Error("Unable to fetch balance"); + } +}; + +export const checkNativeTokenBalance = async (wallet, decimals) => { + + try { + if (!wallet.provider) { + throw new Error("Wallet must be connected to a provider."); + } + + const address = await wallet.getAddress(); + const balance = await wallet.provider.getBalance(address); + return balance.toString(); + } catch (error) { + throw new Error("Unable to fetch native token balance"); + } +}; + +export const checkAndSetAllowance = async (wallet, tokenAddress, approvalAddress, amount) => { + if (tokenAddress === ethers.ZeroAddress || tokenAddress.toLowerCase() === '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee') { + console.log("Native token detected; no approval needed."); + return; + } + + console.log(`Checking allowance for token ${tokenAddress} and approval address ${approvalAddress}`); + + const erc20ReadOnly = new ethers.Contract(tokenAddress, erc20Abi, wallet.provider); + const walletAddress = await wallet.getAddress(); + + try { + const allowance = await erc20ReadOnly.allowance(walletAddress, approvalAddress); + console.log("Current allowance:", allowance.toString()); + + if (allowance < amount) { + const erc20WithSigner = new ethers.Contract(tokenAddress, erc20Abi, wallet); + const approveTx = await erc20WithSigner.approve(approvalAddress, amount); + + console.log(`Approve transaction sent: ${approveTx.hash}`); + await approveTx.wait(); + console.log(`Approved successfully: ${approveTx.hash}`); + } else { + console.log("Sufficient allowance already set."); + } + } catch (error) { + console.error("Error during allowance check or approval:", error); + } +}; + +export const getSwapTransaction = async (quoteData, senderAddress, receiverAddress) => { + const txDataUrl = `https://api-beta.pathfinder.routerprotocol.com/api/v2/transaction` + + const requestData = { + ...quoteData, + senderAddress: senderAddress, + receiverAddress: receiverAddress + }; + + let config = { + method: 'post', + maxBodyLength: Infinity, + url: txDataUrl, + headers: { + 'content-type': 'application/json' + }, + data: requestData + }; + + try { + let res = await axios.request(config); + return res.data; + } catch (e) { + console.error(`Fetching tx data from pathfinder: ${e}`) + } +} + diff --git a/packages/plugin-router-nitro/src/actions/utils.ts b/packages/plugin-router-nitro/src/actions/utils.ts index dc42a3b23ec..b9c1a08ecd4 100644 --- a/packages/plugin-router-nitro/src/actions/utils.ts +++ b/packages/plugin-router-nitro/src/actions/utils.ts @@ -1,7 +1,24 @@ import axios from "axios"; +interface ChainData { + name: string; + chainId: string; + type: string; + isLive: boolean; + gasToken?: { + symbol: string; + address: string; + }; +} + +interface TokenData { + address: string; + name: string; + decimals: number; + chainId: number; +} export class ChainUtils { - private chainData: any[] = []; + private chainData: ChainData[] = []; private chainNameMappings: { [key: string]: string[] } = { 'arbitrum': ['arbitrum', 'arbitrum one', 'arb', 'arbitrum mainnet'], 'ethereum': ['ethereum', 'eth', 'ethereum mainnet', 'ether'], @@ -39,7 +56,7 @@ export class ChainUtils { 'arthera': ['arthera', 'arthera mainnet'] }; - constructor(apiResponse: any) { + constructor(apiResponse: { data: ChainData[] }) { this.chainData = apiResponse.data; } @@ -184,7 +201,7 @@ export class ChainUtils { } } -export async function fetchChains(): Promise { +export async function fetchChains(): Promise<{ data: ChainData[] }> { const url = 'https://api.nitroswap.routernitro.com/chain?page=0&limit=10000'; try { @@ -196,9 +213,9 @@ export async function fetchChains(): Promise { } } -const tokenCache: { [key: string]: any } = {}; +const tokenCache: { [key: string]: TokenData } = {}; -export async function fetchTokenConfig(chainId: number, token: string): Promise { +export async function fetchTokenConfig(chainId: number, token: string): Promise { const cacheKey = `${chainId}-${token.toLowerCase()}`; // Check if the token config is already cached @@ -225,8 +242,11 @@ export async function fetchTokenConfig(chainId: number, token: string): Promise< }; return tokenCache[cacheKey]; } - } catch (error: any) { - console.warn(`Error with token symbol "${tokenSymbol}": ${error.message}`); + } catch (error: unknown) { + const errorMessage = error instanceof Error + ? error.message + : 'Unknown error occurred'; + console.warn(`Error with token symbol "${tokenSymbol}": ${errorMessage}`); } } @@ -242,22 +262,37 @@ interface PathfinderQuoteParams { partnerId: number; } -export async function fetchPathfinderQuote(params: PathfinderQuoteParams): Promise { +export async function fetchPathfinderQuote(params: PathfinderQuoteParams): Promise { const { fromTokenAddress, toTokenAddress, amount, fromTokenChainId, toTokenChainId, partnerId } = params; - const pathfinderUrl = `https://api-beta.pathfinder.routerprotocol.com/api/v2/quote` + - `?fromTokenAddress=${fromTokenAddress}` + - `&toTokenAddress=${toTokenAddress}` + - `&amount=${amount}` + - `&fromTokenChainId=${fromTokenChainId}` + - `&toTokenChainId=${toTokenChainId}` + - `&partnerId=${partnerId}`; + const pathfinderUrl = `https://api-beta.pathfinder.routerprotocol.com/api/v2/quote?fromTokenAddress=${fromTokenAddress}&toTokenAddress=${toTokenAddress}&amount=${amount}&fromTokenChainId=${fromTokenChainId}&toTokenChainId=${toTokenChainId}&partnerId=${partnerId}`; try { const response = await axios.get(pathfinderUrl); return response.data; } catch (error) { - console.error("Error fetching Pathfinder quote:", error.message); - throw new Error(`Pathfinder API call failed: ${error.message}`); + console.error("Error fetching Pathfinder quote:", error instanceof Error ? error.message : String(error)); + throw new Error(`Pathfinder API call failed: ${error instanceof Error ? error.message : String(error)}`); } } + + +// export async function fetchPathfinderQuote(params: PathfinderQuoteParams): Promise { +// const { fromTokenAddress, toTokenAddress, amount, fromTokenChainId, toTokenChainId, partnerId } = params; + +// const pathfinderUrl = `https://api-beta.pathfinder.routerprotocol.com/api/v2/quote` + +// `?fromTokenAddress=${fromTokenAddress}` + +// `&toTokenAddress=${toTokenAddress}` + +// `&amount=${amount}` + +// `&fromTokenChainId=${fromTokenChainId}` + +// `&toTokenChainId=${toTokenChainId}` + +// `&partnerId=${partnerId}`; + +// try { +// const response = await axios.get(pathfinderUrl); +// return response.data; +// } catch (error) { +// console.error("Error fetching Pathfinder quote:", error.message); +// throw new Error(`Pathfinder API call failed: ${error.message}`); +// } +// } diff --git a/packages/plugin-sgx/package.json b/packages/plugin-sgx/package.json index df77362d832..57b521abcd0 100644 --- a/packages/plugin-sgx/package.json +++ b/packages/plugin-sgx/package.json @@ -1,18 +1,18 @@ { - "name": "@elizaos/plugin-sgx", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } + "name": "@elizaos/plugin-sgx", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + } } diff --git a/packages/plugin-solana-agent-kit/package.json b/packages/plugin-solana-agent-kit/package.json index ae64d6e4c90..f1664e4e6cf 100644 --- a/packages/plugin-solana-agent-kit/package.json +++ b/packages/plugin-solana-agent-kit/package.json @@ -1,33 +1,33 @@ { - "name": "@elizaos/plugin-solana-agent-kit", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@coral-xyz/anchor": "0.30.1", - "@elizaos/core": "workspace:*", - "@elizaos/plugin-tee": "workspace:*", - "@elizaos/plugin-trustdb": "workspace:*", - "@solana/spl-token": "0.4.9", - "@solana/web3.js": "npm:@solana/web3.js@1.95.8", - "bignumber": "1.1.0", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "fomo-sdk-solana": "1.3.2", - "node-cache": "5.1.2", - "pumpdotfun-sdk": "1.3.2", - "solana-agent-kit": "^1.2.0", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-solana-agent-kit", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@coral-xyz/anchor": "0.30.1", + "@elizaos/core": "workspace:*", + "@elizaos/plugin-tee": "workspace:*", + "@elizaos/plugin-trustdb": "workspace:*", + "@solana/spl-token": "0.4.9", + "@solana/web3.js": "npm:@solana/web3.js@1.95.8", + "bignumber": "1.1.0", + "bignumber.js": "9.1.2", + "bs58": "6.0.0", + "fomo-sdk-solana": "1.3.2", + "node-cache": "5.1.2", + "pumpdotfun-sdk": "1.3.2", + "solana-agent-kit": "^1.2.0", + "tsup": "8.3.5", + "vitest": "2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-solana/package.json b/packages/plugin-solana/package.json index 6c62070b91d..e316e2f4bb4 100644 --- a/packages/plugin-solana/package.json +++ b/packages/plugin-solana/package.json @@ -1,46 +1,48 @@ { - "name": "@elizaos/plugin-solana", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@coral-xyz/anchor": "0.30.1", - "@elizaos/core": "workspace:*", - "@elizaos/plugin-tee": "workspace:*", - "@elizaos/plugin-trustdb": "workspace:*", - "@solana/spl-token": "0.4.9", - "@solana/web3.js": "npm:@solana/web3.js@1.95.8", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "fomo-sdk-solana": "1.3.2", - "node-cache": "5.1.2", - "pumpdotfun-sdk": "1.3.2", - "solana-agent-kit": "^1.4.0", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-solana", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@coral-xyz/anchor": "0.30.1", + "@coral-xyz/anchor": "0.30.1", + "@elizaos/core": "workspace:*", + "@elizaos/plugin-tee": "workspace:*", + "@elizaos/plugin-tee": "workspace:*", + "@elizaos/plugin-trustdb": "workspace:*", + "@solana/spl-token": "0.4.9", + "@solana/web3.js": "npm:@solana/web3.js@1.95.8", + "bignumber.js": "9.1.2", + "bs58": "6.0.0", + "fomo-sdk-solana": "1.3.2", + "node-cache": "5.1.2", + "pumpdotfun-sdk": "1.3.2", + "solana-agent-kit": "^1.4.0", + "tsup": "8.3.5", + "vitest": "2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-spheron/package.json b/packages/plugin-spheron/package.json index 21c93412835..39dc99f98fd 100644 --- a/packages/plugin-spheron/package.json +++ b/packages/plugin-spheron/package.json @@ -1,20 +1,20 @@ { - "name": "@elizaos/plugin-spheron", - "version": "0.1.9", - "description": "Spheron Protocol Plugin for Eliza", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "scripts": { - "build": "tsup --format esm --dts", - "test": "jest" - }, - "dependencies": { - "@elizaos/core": "workspace:*", - "@spheron/protocol-sdk": "^1.0.0", - "zod": "^3.22.4" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "typescript": "^5.0.0" - } + "name": "@elizaos/plugin-spheron", + "version": "0.1.9", + "description": "Spheron Protocol Plugin for Eliza", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsup --format esm --dts", + "test": "jest" + }, + "dependencies": { + "@elizaos/core": "workspace:*", + "@spheron/protocol-sdk": "^1.0.0", + "zod": "^3.22.4" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "^5.0.0" + } } diff --git a/packages/plugin-stargaze/package.json b/packages/plugin-stargaze/package.json index 589e95d5712..6f852838659 100644 --- a/packages/plugin-stargaze/package.json +++ b/packages/plugin-stargaze/package.json @@ -1,19 +1,19 @@ { - "name": "@elizaos/plugin-stargaze", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "axios": "^1.6.7", - "tsup": "^8.3.5", - "zod": "^3.22.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-stargaze", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "axios": "^1.6.7", + "tsup": "^8.3.5", + "zod": "^3.22.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-starknet/package.json b/packages/plugin-starknet/package.json index 115f1609b1a..6df58f0b6b0 100644 --- a/packages/plugin-starknet/package.json +++ b/packages/plugin-starknet/package.json @@ -1,41 +1,41 @@ { - "name": "@elizaos/plugin-starknet", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-trustdb": "workspace:*", - "@avnu/avnu-sdk": "2.1.1", - "@uniswap/sdk-core": "6.0.0", - "unruggable-sdk": "1.4.0", - "@unruggable_starknet/core": "0.1.0", - "starknet": "6.18.0", - "tsup": "8.3.5", - "vitest": "2.1.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-starknet", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@avnu/avnu-sdk": "2.1.1", + "@elizaos/core": "workspace:*", + "@elizaos/plugin-trustdb": "workspace:*", + "@uniswap/sdk-core": "6.0.0", + "@unruggable_starknet/core": "0.1.0", + "starknet": "6.18.0", + "tsup": "8.3.5", + "unruggable-sdk": "1.4.0", + "vitest": "2.1.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-story/package.json b/packages/plugin-story/package.json index 50dfbf2614e..61c5eb6f4e2 100644 --- a/packages/plugin-story/package.json +++ b/packages/plugin-story/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/plugin-story", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@story-protocol/core-sdk": "1.2.0-rc.3", - "tsup": "8.3.5", - "@pinata/sdk": "^2.1.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - }, - "devDependencies": { - "@types/node": "^22.10.1" - } + "name": "@elizaos/plugin-story", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@pinata/sdk": "^2.1.0", + "@story-protocol/core-sdk": "1.2.0-rc.3", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + }, + "devDependencies": { + "@types/node": "^22.10.1" + } } diff --git a/packages/plugin-sui/package.json b/packages/plugin-sui/package.json index 483576dd682..9d68851cbd0 100644 --- a/packages/plugin-sui/package.json +++ b/packages/plugin-sui/package.json @@ -1,38 +1,38 @@ { - "name": "@elizaos/plugin-sui", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@mysten/sui": "^1.16.0", - "axios": "^1.7.9", - "bignumber.js": "9.1.2", - "node-cache": "5.1.2", - "tsup": "8.3.5", - "vitest": "2.1.4" - }, - "scripts": { - "build": "tsup --format esm --dts", - "test": "vitest run" - }, - "peerDependencies": { - "form-data": "4.0.1", - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-sui", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@mysten/sui": "^1.16.0", + "axios": "^1.7.9", + "bignumber.js": "9.1.2", + "node-cache": "5.1.2", + "tsup": "8.3.5", + "vitest": "2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "test": "vitest run" + }, + "peerDependencies": { + "form-data": "4.0.1", + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-tee-log/package.json b/packages/plugin-tee-log/package.json index 3e470a8648a..9983200713c 100644 --- a/packages/plugin-tee-log/package.json +++ b/packages/plugin-tee-log/package.json @@ -1,22 +1,22 @@ { - "name": "@elizaos/plugin-tee-log", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "@elizaos/plugin-tee": "workspace:*", - "@elizaos/plugin-sgx": "workspace:*", - "better-sqlite3": "11.6.0", - "elliptic": "6.6.1" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - } + "name": "@elizaos/plugin-tee-log", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "@elizaos/plugin-tee": "workspace:*", + "@elizaos/plugin-sgx": "workspace:*", + "better-sqlite3": "11.6.0", + "elliptic": "6.6.1" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + } } diff --git a/packages/plugin-tee-marlin/package.json b/packages/plugin-tee-marlin/package.json index 9eb0deeab8e..f243a0dab4e 100644 --- a/packages/plugin-tee-marlin/package.json +++ b/packages/plugin-tee-marlin/package.json @@ -1,18 +1,18 @@ { - "name": "@elizaos/plugin-tee-marlin", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-tee-marlin", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-tee/package.json b/packages/plugin-tee/package.json index b7defdfab1d..d001fcd664b 100644 --- a/packages/plugin-tee/package.json +++ b/packages/plugin-tee/package.json @@ -1,40 +1,40 @@ { - "name": "@elizaos/plugin-tee", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@phala/dstack-sdk": "0.1.7", - "@solana/spl-token": "0.4.9", - "@solana/web3.js": "1.95.8", - "bignumber.js": "9.1.2", - "bs58": "6.0.0", - "node-cache": "5.1.2", - "pumpdotfun-sdk": "1.3.2", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-tee", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@phala/dstack-sdk": "0.1.7", + "@solana/spl-token": "0.4.9", + "@solana/web3.js": "1.95.8", + "bignumber.js": "9.1.2", + "bs58": "6.0.0", + "node-cache": "5.1.2", + "pumpdotfun-sdk": "1.3.2", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-thirdweb/package.json b/packages/plugin-thirdweb/package.json index 01cc6f26955..fb942ebc0a0 100644 --- a/packages/plugin-thirdweb/package.json +++ b/packages/plugin-thirdweb/package.json @@ -1,19 +1,19 @@ { - "name": "@elizaos/plugin-thirdweb", - "version": "0.1.9", - "main": "dist/index.js", - "type": "module", - "types": "dist/index.d.ts", - "dependencies": { - "@elizaos/core": "workspace:*", - "thirdweb": "^5.80.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-thirdweb", + "version": "0.1.9", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@elizaos/core": "workspace:*", + "thirdweb": "^5.80.0", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-ton/package.json b/packages/plugin-ton/package.json index 34eb5b80150..3cf0f887746 100644 --- a/packages/plugin-ton/package.json +++ b/packages/plugin-ton/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/plugin-ton", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "bignumber.js": "9.1.2", - "node-cache": "5.1.2", - "@ton/ton": "15.1.0", - "@ton/crypto": "3.3.0", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "mnemonic": "tsup --format esm ./scripts/generate-ton-mnemonic.ts && node ./dist/generate-ton-mnemonic.js", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-ton", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@ton/crypto": "3.3.0", + "@ton/ton": "15.1.0", + "bignumber.js": "9.1.2", + "node-cache": "5.1.2", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "mnemonic": "tsup --format esm ./scripts/generate-ton-mnemonic.ts && node ./dist/generate-ton-mnemonic.js", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-trustdb/package.json b/packages/plugin-trustdb/package.json index ba621786b25..a9f2717b9f2 100644 --- a/packages/plugin-trustdb/package.json +++ b/packages/plugin-trustdb/package.json @@ -1,40 +1,40 @@ { - "name": "@elizaos/plugin-trustdb", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "dompurify": "3.2.2", - "tsup": "8.3.5", - "uuid": "11.0.3", - "vitest": "2.1.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest" - }, - "devDependencies": { - "@types/dompurify": "3.2.0" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-trustdb", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "dompurify": "3.2.2", + "tsup": "8.3.5", + "uuid": "11.0.3", + "vitest": "2.1.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest" + }, + "devDependencies": { + "@types/dompurify": "3.2.0" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-tts/package.json b/packages/plugin-tts/package.json index d8e6effda25..dec265b18d7 100644 --- a/packages/plugin-tts/package.json +++ b/packages/plugin-tts/package.json @@ -1,34 +1,34 @@ { - "name": "@elizaos/plugin-tts", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5", - "langdetect": "0.2.1", - "whatwg-url": "7.1.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-tts", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "langdetect": "0.2.1", + "tsup": "8.3.5", + "whatwg-url": "7.1.0" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-twitter/package.json b/packages/plugin-twitter/package.json index 5ae2fd31d23..09cbeb222a7 100644 --- a/packages/plugin-twitter/package.json +++ b/packages/plugin-twitter/package.json @@ -1,36 +1,36 @@ { - "name": "@elizaos/plugin-twitter", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "agent-twitter-client": "0.0.18", - "tsup": "8.3.5" - }, - "devDependencies": { - "vitest": "^1.0.0" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "test:watch": "vitest", - "lint": "eslint --fix --cache ." - } + "name": "@elizaos/plugin-twitter", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "agent-twitter-client": "0.0.18", + "tsup": "8.3.5" + }, + "devDependencies": { + "vitest": "^1.0.0" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "test:watch": "vitest", + "lint": "eslint --fix --cache ." + } } diff --git a/packages/plugin-video-generation/package.json b/packages/plugin-video-generation/package.json index 4922db62975..8656816e84d 100644 --- a/packages/plugin-video-generation/package.json +++ b/packages/plugin-video-generation/package.json @@ -1,32 +1,32 @@ { - "name": "@elizaos/plugin-video-generation", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "8.3.5" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-video-generation", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-web-search/package.json b/packages/plugin-web-search/package.json index ea5d79c4e99..d72a50372b7 100644 --- a/packages/plugin-web-search/package.json +++ b/packages/plugin-web-search/package.json @@ -1,35 +1,35 @@ { - "name": "@elizaos/plugin-web-search", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "@tavily/core": "^0.0.2", - "tsup": "8.3.5", - "js-tiktoken": "1.0.15" - }, - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-web-search", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "@tavily/core": "^0.0.2", + "tsup": "8.3.5", + "js-tiktoken": "1.0.15" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/packages/plugin-whatsapp/package.json b/packages/plugin-whatsapp/package.json index 535f64b8b77..13853dc3c14 100644 --- a/packages/plugin-whatsapp/package.json +++ b/packages/plugin-whatsapp/package.json @@ -1,39 +1,39 @@ { - "name": "@elizaos/plugin-whatsapp", - "version": "0.1.9", - "description": "WhatsApp Cloud API plugin", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "scripts": { - "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch", - "test": "vitest run", - "coverage": "vitest run --coverage" - }, - "dependencies": { - "@elizaos/core": "workspace:*", - "axios": "1.7.8" - }, - "devDependencies": { - "@types/node": "20.17.9", - "@typescript-eslint/eslint-plugin": "8.16.0", - "@typescript-eslint/parser": "8.16.0", - "typescript": "5.6.3", - "vitest": "^1.2.1" - } + "name": "@elizaos/plugin-whatsapp", + "version": "0.1.9", + "description": "WhatsApp Cloud API plugin", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "test": "vitest run", + "coverage": "vitest run --coverage" + }, + "dependencies": { + "@elizaos/core": "workspace:*", + "axios": "1.7.8" + }, + "devDependencies": { + "@types/node": "20.17.9", + "@typescript-eslint/eslint-plugin": "8.16.0", + "@typescript-eslint/parser": "8.16.0", + "typescript": "5.6.3", + "vitest": "^1.2.1" + } } diff --git a/packages/plugin-zksync-era/package.json b/packages/plugin-zksync-era/package.json index bbf0d3f6096..3ef16373690 100644 --- a/packages/plugin-zksync-era/package.json +++ b/packages/plugin-zksync-era/package.json @@ -1,33 +1,33 @@ { - "name": "@elizaos/plugin-zksync-era", - "version": "0.1.9", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "@elizaos/source": "./src/index.ts", - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } - } - }, - "files": [ - "dist" - ], - "dependencies": { - "@elizaos/core": "workspace:*", - "tsup": "^8.3.5", - "viem": "2.22.2" - }, - "scripts": { - "build": "tsup --format esm --dts", - "lint": "eslint --fix --cache ." - }, - "peerDependencies": { - "whatwg-url": "7.1.0" - } + "name": "@elizaos/plugin-zksync-era", + "version": "0.1.9", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "@elizaos/source": "./src/index.ts", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist" + ], + "dependencies": { + "@elizaos/core": "workspace:*", + "tsup": "^8.3.5", + "viem": "2.22.2" + }, + "scripts": { + "build": "tsup --format esm --dts", + "lint": "eslint --fix --cache ." + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eab17d7adf6..45283708cdb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -364,9 +364,9 @@ importers: '@elizaos/plugin-iq6900': specifier: workspace:* version: link:../packages/plugin-iq6900 - '@elizaos/plugin-lensNetwork': + '@elizaos/plugin-lens-network': specifier: workspace:* - version: link:../packages/plugin-lensNetwork + version: link:../packages/plugin-lens-network '@elizaos/plugin-letzai': specifier: workspace:* version: link:../packages/plugin-letzai @@ -790,7 +790,7 @@ importers: version: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) ts-jest: specifier: ^29.1.1 - version: 29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)))(typescript@5.7.3) tsup: specifier: ^8.0.1 version: 8.3.5(@swc/core@1.10.11(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) @@ -1068,13 +1068,13 @@ importers: dependencies: '@discordjs/opus': specifier: github:discordjs/opus - version: https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13) + version: https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13) '@discordjs/rest': specifier: 2.4.0 version: 2.4.0 '@discordjs/voice': specifier: 0.17.0 - version: 0.17.0(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@6.0.5) + version: 0.17.0(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@6.0.5) '@elizaos/core': specifier: workspace:* version: link:../core @@ -1089,7 +1089,7 @@ importers: version: 0.7.15 prism-media: specifier: 1.3.5 - version: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13))(ffmpeg-static@5.2.0) + version: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13))(ffmpeg-static@5.2.0) whatwg-url: specifier: 7.1.0 version: 7.1.0 @@ -1199,7 +1199,7 @@ importers: version: link:../core '@lens-protocol/client': specifier: 2.2.0 - version: 2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5) + version: 2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(react@19.0.0)(utf-8-validate@6.0.5) '@lens-protocol/metadata': specifier: 1.2.0 version: 1.2.0(zod@3.23.8) @@ -1413,7 +1413,7 @@ importers: version: 10.0.0 ai: specifier: 3.4.33 - version: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) + version: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) anthropic-vertex-ai: specifier: 1.0.2 version: 1.0.2(encoding@0.1.13)(zod@3.23.8) @@ -1773,9 +1773,6 @@ importers: node-cache: specifier: 5.1.2 version: 5.1.2 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.11(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) vitest: specifier: 2.1.8 version: 2.1.8(@types/node@22.12.0)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.37.0) @@ -2058,6 +2055,9 @@ importers: tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.11(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + vitest: + specifier: ^1.2.1 + version: 1.2.1(@types/node@22.12.0)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.37.0) packages/plugin-autonome: dependencies: @@ -2357,7 +2357,7 @@ importers: dependencies: '@chain-registry/utils': specifier: ^1.51.41 - version: 1.51.57 + version: 1.51.58 '@cosmjs/cosmwasm-stargate': specifier: ^0.32.4 version: 0.32.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -2381,7 +2381,7 @@ importers: version: 9.1.2 chain-registry: specifier: ^1.69.68 - version: 1.69.107 + version: 1.69.108 interchain: specifier: ^1.10.4 version: 1.10.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -2394,7 +2394,7 @@ importers: devDependencies: '@chain-registry/types': specifier: ^0.50.44 - version: 0.50.57 + version: 0.50.58 packages/plugin-cronos: dependencies: @@ -2580,7 +2580,7 @@ importers: version: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)))(typescript@5.7.3) ts-jest-mock-import-meta: specifier: ^1.2.1 version: 1.2.1(ts-jest@29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0))(typescript@5.7.3)) @@ -2617,7 +2617,7 @@ importers: version: 5.0.10 ts-jest: specifier: ^29.0.0 - version: 29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.7))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)))(typescript@5.7.3) typescript: specifier: ^5.0.0 version: 5.7.3 @@ -2848,7 +2848,7 @@ importers: version: link:../core '@goat-sdk/adapter-vercel-ai': specifier: 0.2.0 - version: 0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.9(react@19.0.0)(zod@3.23.8)) + version: 0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.10(react@19.0.0)(zod@3.23.8)) '@goat-sdk/core': specifier: 0.4.6 version: 0.4.6(zod@3.23.8) @@ -3088,7 +3088,7 @@ importers: dependencies: '@elizaos/adapter-sqlite': specifier: 0.1.7-alpha.2 - version: 0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(whatwg-url@14.1.0)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) + version: 0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(whatwg-url@14.1.0)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) '@elizaos/core': specifier: workspace:* version: link:../core @@ -3192,7 +3192,7 @@ importers: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.11(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) - packages/plugin-lensNetwork: + packages/plugin-lens-network: dependencies: '@elizaos/core': specifier: workspace:* @@ -3939,7 +3939,7 @@ importers: dependencies: '@elizaos/core': specifier: ^0.1.7 - version: 0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + version: 0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@pythnetwork/client': specifier: ^2.22.0 version: 2.22.0(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) @@ -4428,7 +4428,7 @@ importers: version: link:../core '@mysten/sui': specifier: ^1.16.0 - version: 1.21.0(typescript@5.7.3) + version: 1.21.1(typescript@5.7.3) axios: specifier: ^1.7.9 version: 1.7.9 @@ -4455,7 +4455,7 @@ importers: dependencies: '@elizaos/core': specifier: ^0.1.0 - version: 0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + version: 0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) devDependencies: '@types/jest': specifier: ^27.0.0 @@ -4587,7 +4587,7 @@ importers: version: link:../core thirdweb: specifier: ^5.80.0 - version: 5.86.6(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) + version: 5.87.0(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.11(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) @@ -4704,7 +4704,7 @@ importers: dependencies: '@elizaos/core': specifier: ^0.1.0 - version: 0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + version: 0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) devDependencies: '@types/jest': specifier: ^27.0.0 @@ -4794,7 +4794,7 @@ importers: version: link:../core '@goat-sdk/adapter-vercel-ai': specifier: 0.2.7 - version: 0.2.7(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.9(react@19.0.0)(zod@3.23.8))(zod@3.23.8) + version: 0.2.7(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.10(react@19.0.0)(zod@3.23.8))(zod@3.23.8) '@goat-sdk/core': specifier: 0.4.6 version: 0.4.6(zod@3.23.8) @@ -6167,11 +6167,11 @@ packages: '@cfworker/json-schema@4.1.0': resolution: {integrity: sha512-/vYKi/qMxwNsuIJ9WGWwM2rflY40ZenK3Kh4uR5vB9/Nz12Y7IUN/Xf4wDA7vzPfw0VNh3b/jz4+MjcVgARKJg==} - '@chain-registry/types@0.50.57': - resolution: {integrity: sha512-zSVoV9hjtiABnktW9SyS9m3RmGibmVj7DKGuchQUwHBsLEcRBMyBG3RLxiXNnyKmOR0509c0g/7ESQQeU+iyfQ==} + '@chain-registry/types@0.50.58': + resolution: {integrity: sha512-jC3lIZotrq5a4wqCZ/3RKKr6xtUETfV8mP2DKVqx3Z65FJyB9ApSpH5b2YfhrD2hPaIw6WvGsrIYlD1k51UysA==} - '@chain-registry/utils@1.51.57': - resolution: {integrity: sha512-yx3E2STnhUW/rwRotmyQsHDT1Zxo2O5+nXj5Mf/hR3roW530qzA4KwhaUL/bAYIflZ4OgTPMnGEOcT7Z3bsgKQ==} + '@chain-registry/utils@1.51.58': + resolution: {integrity: sha512-31KE7KqpFXz/fSg/hS7wwiwnzvJrq40GiDQhxIR4kMz28Y6bTsX6OOgexw3nlaEdEP24tMbvZd3185s35E0j2Q==} '@changesets/apply-release-plan@7.0.8': resolution: {integrity: sha512-qjMUj4DYQ1Z6qHawsn7S71SujrExJ+nceyKKyI9iB+M5p9lCL55afuEd6uLBPRpLGWQwkwvWegDHtwHJb1UjpA==} @@ -6931,8 +6931,8 @@ packages: resolution: {integrity: sha512-YJOVVZ545x24mHzANfYoy0BJX5PDyeZlpiJjDkUBM/V/Ao7TFX9lcUvCN4nr0tbr5ubeaXxtEBILUrHtTphVeQ==} hasBin: true - '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063': - resolution: {tarball: https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063} + '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2': + resolution: {tarball: https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2} version: 0.10.0 engines: {node: '>=12.0.0'} @@ -9011,8 +9011,8 @@ packages: peerDependencies: '@langchain/core': '>=0.2.21 <0.4.0' - '@langchain/langgraph-checkpoint@0.0.13': - resolution: {integrity: sha512-amdmBcNT8a9xP2VwcEWxqArng4gtRDcnVyVI4DsQIo1Aaz8e8+hH17zSwrUF3pt1pIYztngIfYnBOim31mtKMg==} + '@langchain/langgraph-checkpoint@0.0.14': + resolution: {integrity: sha512-UoJc1IZqtnn+AiRhygo1yjNZiXTwdOY6NSb7yrXrN96CAW3LPu8cFe7VihKg5OBv9qaGz1GCvnrNdNAB48HuKQ==} engines: {node: '>=18'} peerDependencies: '@langchain/core': '>=0.2.31 <0.4.0' @@ -9020,8 +9020,8 @@ packages: '@langchain/langgraph-sdk@0.0.36': resolution: {integrity: sha512-KkAZM0uXBaMcD/dpGTBppOhbvNX6gz+Y1zFAC898OblegFkSvICrkd0oRQ5Ro/GWK/NAoDymnMUDXeZDdUkSuw==} - '@langchain/langgraph@0.2.41': - resolution: {integrity: sha512-NeNizWP4k9voEwJxuFtfopF02Lx1isuEsdZKYCN3ueJpOnkVg0iGx8woPBsQpYcrWcySkIt3zOkgtUsrNHqo3g==} + '@langchain/langgraph@0.2.42': + resolution: {integrity: sha512-VmCXbuq/crFrqLslhgZi1E8cFo4dvtiDuLLtStlnHqsrj5CD6Y9I8Pg82gClN7D8kc3I8YNsWgXKS3FssAnnhg==} engines: {node: '>=18'} peerDependencies: '@langchain/core': '>=0.2.36 <0.3.0 || >=0.3.9 < 0.4.0' @@ -9480,10 +9480,10 @@ packages: '@metaplex-foundation/cusper@0.0.2': resolution: {integrity: sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA==} - '@metaplex-foundation/digital-asset-standard-api@1.0.4': - resolution: {integrity: sha512-YSYyMnIoKNykDZTXsSCeiIOJ7NT5Ke2pzghXDsinRwHvwIZWv+zY5kJQBvTglAzYlt/GaI+noAhUZXXmSbp07A==} + '@metaplex-foundation/digital-asset-standard-api@1.0.5': + resolution: {integrity: sha512-ILZJm5KGZzUYVmR43jwBw3rXkmzYJN08IN2ojJC0hvtaXu8U90b3/yxk2y7nMeIY2O9TS8boQQZ4m5D0yo6Jnw==} peerDependencies: - '@metaplex-foundation/umi': '>= 0.8.2 < 1' + '@metaplex-foundation/umi': '>= 0.8.2 <= 1' '@metaplex-foundation/js@0.20.1': resolution: {integrity: sha512-aqiLoEiToXdfI5pS+17/GN/dIO2D31gLoVQvEKDQi9XcnOPVhfJerXDmwgKbhp79OGoYxtlvVw+b2suacoUzGQ==} @@ -9681,11 +9681,11 @@ packages: '@multiversx/sdk-transaction-decoder@1.0.2': resolution: {integrity: sha512-j43QsKquu8N51WLmVlJ7dV2P3A1448R7/ktvl8r3i6wRMpfdtzDPNofTdHmMRT7DdQdvs4+RNgz8hVKL11Etsw==} - '@mysten/bcs@1.2.1': - resolution: {integrity: sha512-RMSaUsNb8oR0rTRVIOOcyoEVJqQi6DLvMXN+7mvDcki12FJFQ0lF89zQa7AV7cIurWlDQfJ8VIbCuRDyK+955A==} + '@mysten/bcs@1.3.0': + resolution: {integrity: sha512-V3V9GwIXEiUS7y8hkCwH3oseWpxs75YOOtfy7xdfyAdSftlFpTYgj5elclwYx8pgHdzg7pHdy6no77LHYGQCaQ==} - '@mysten/sui@1.21.0': - resolution: {integrity: sha512-A+UXOo2ODhmktV6J6lOIqelRtVvQ0V252T2qaoJ0E92HYjIi3xMNEQrqu4K8TcN3gZCjqK8jQZwmbYZku8rIpw==} + '@mysten/sui@1.21.1': + resolution: {integrity: sha512-HVrcqiUUSPToxbQtEgARFCnLr6FMkDHhhwWdy/urk8dqr8jnNZkU3Ppr6YUgg3vRE3sXPhuIjXOCEL6Wyq6Esw==} engines: {node: '>=18'} '@napi-rs/wasm-runtime@0.2.4': @@ -10412,8 +10412,8 @@ packages: resolution: {integrity: sha512-yFZa3UH11VIxYnnoOYCVoJ3q4ChuSOk2IVBBQ0O3xtKX4x9bmKb/1t+Mxixv2iUhzMdOl1qeWJqEhouXXzB3rQ==} engines: {node: '>= 18'} - '@octokit/webhooks@13.4.2': - resolution: {integrity: sha512-fakbgkCScapQXPxyqx2jZs/Y3jGlyezwUp7ATL7oLAGJ0+SqBKWKstoKZpiQ+REeHutKpYjY9UtxdLSurwl2Tg==} + '@octokit/webhooks@13.4.3': + resolution: {integrity: sha512-Brjp2TJiTvLV8unrGWC46QgsnH641fTvH32Vp88L6Y5GkMcKMp+YLdRz/EP722GxKM0S4vbeNqAc6QeEUr8oWA==} engines: {node: '>= 18'} '@one-ini/wasm@0.1.1': @@ -11111,19 +11111,6 @@ packages: '@types/react': optional: true - '@radix-ui/react-dialog@1.1.4': - resolution: {integrity: sha512-Ur7EV1IwQGCyaAuyDRiOLA5JIUZxELJljF+MbM/2NC0BYwfuRrbpS30BiQBJrVruscgUkieKkqXYDOoByaxIoA==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-dialog@1.1.5': resolution: {integrity: sha512-LaO3e5h/NOEL4OfXjxD43k9Dx+vn+8n+PCFt6uhX/BADFflllyv3WJG6rgvvSVBxpTch938Qq/LGc2MMxipXPw==} peerDependencies: @@ -11146,32 +11133,6 @@ packages: '@types/react': optional: true - '@radix-ui/react-dismissable-layer@1.1.2': - resolution: {integrity: sha512-kEHnlhv7wUggvhuJPkyw4qspXLJOdYoAP4dO2c8ngGuXTq1w/HZp1YeVB+NQ2KbH1iEG+pvOCGYSqh9HZOz6hg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - - '@radix-ui/react-dismissable-layer@1.1.3': - resolution: {integrity: sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-dismissable-layer@1.1.4': resolution: {integrity: sha512-XDUI0IVYVSwjMXxM6P4Dfti7AH+Y4oS/TB+sglZ/EXc7cqLwGAmp1NlMrcUjj7ks6R5WTZuWKv44FBbLpwU3sA==} peerDependencies: @@ -11347,19 +11308,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-tooltip@1.1.5': - resolution: {integrity: sha512-IucoQPcK5nwUuztaxBQvudvYwH58wtRcJlv1qvaMSyIbL9dEBfFN0vRf/D8xDbu6HmAJLlNGty4z8Na+vIqe9Q==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-tooltip@1.1.7': resolution: {integrity: sha512-ss0s80BC0+g0+Zc53MvilcnTYSOi4mSuFWBPYPuTOFGjx+pUU+ZrmamMNwS56t8MTFlniA5ocjd4jYm/CdhbOg==} peerDependencies: @@ -12998,14 +12946,11 @@ packages: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} - '@tanstack/query-core@5.62.16': - resolution: {integrity: sha512-9Sgft7Qavcd+sN0V25xVyo0nfmcZXBuODy3FVG7BMWTg1HMLm8wwG5tNlLlmSic1u7l1v786oavn+STiFaPH2g==} - '@tanstack/query-core@5.65.0': resolution: {integrity: sha512-Bnnq/1axf00r2grRT6gUyIkZRKzhHs+p4DijrCQ3wMlA3D3TTT71gtaSLtqnzGddj73/7X5JDGyjiSLdjvQN4w==} - '@tanstack/react-query@5.62.16': - resolution: {integrity: sha512-XJIZNj65d2IdvU8VBESmrPakfIm6FSdHDzrS1dPrAwmq3ZX+9riMh/ZfbNQHAWnhrgmq7KoXpgZSRyXnqMYT9A==} + '@tanstack/react-query@5.65.0': + resolution: {integrity: sha512-qXdHj3SCT2xkFxgrBIe6y9Lkowlwm+tGcV++PBLFtyvEJR5Q+biTnzm5p0tdVwqA603xlju9mtV2Kd/2brobgA==} peerDependencies: react: ^18 || ^19 @@ -14156,8 +14101,8 @@ packages: resolution: {integrity: sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - '@voltr/vault-sdk@0.1.3': - resolution: {integrity: sha512-NDIBsEyw3LbLUdNSUg1eNwPaWINTcJQeFuZbGnB3seuEKS0moASbxq70NDVnqYL2t1joBSip0lbizKtFBGvs7A==} + '@voltr/vault-sdk@0.1.4': + resolution: {integrity: sha512-QP4GaLmRDAUs1AKt5Vcj++ZXAaSlSwqSnPtGezaZ2JBko/WVBAiRmdMs+L6FgsZq2n1W5jHvT7I94hDtFt1VMw==} '@vue/compiler-core@3.5.13': resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} @@ -14196,10 +14141,6 @@ packages: resolution: {integrity: sha512-hiEivWNztx73s+7iLxsuD1sOJ28xtRix58W7Xnz4XzzA/pF0+aicnWgjOdA10doVDEDZdUuZCIIqG96SFNlDUg==} engines: {node: '>=16'} - '@walletconnect/core@2.17.3': - resolution: {integrity: sha512-57uv0FW4L6H/tmkb1kS2nG41MDguyDgZbGR58nkDUd1TO/HydyiTByVOhFzIxgN331cnY/1G1rMaKqncgdnOFA==} - engines: {node: '>=18'} - '@walletconnect/core@2.17.5': resolution: {integrity: sha512-m4rcW7QbO7pTV1C+UwOlTpUT9sjGxMs3DcFQ/QmayGPh1MYCC2S42ZTRswMWWqoHIhRjfxlNpO14UD3j0ya6sg==} engines: {node: '>=18'} @@ -14210,9 +14151,6 @@ packages: '@walletconnect/environment@1.0.1': resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} - '@walletconnect/ethereum-provider@2.17.3': - resolution: {integrity: sha512-fgoT+dT9M1P6IIUtBl66ddD+4IJYqdhdAYkW+wa6jbctxKlHYSXf9HsgF/Vvv9lMnxHdAIz0W9VN4D/m20MamA==} - '@walletconnect/ethereum-provider@2.17.5': resolution: {integrity: sha512-oypmy5OXyyHaNzsMNIBBzq9xk930PoO6WQ52Kl9e85OBaLYZ8tK4/ZCPfREPEoRQbvKYBV9+ClB2L2Ox7m3Sgw==} @@ -14298,9 +14236,6 @@ packages: '@walletconnect/safe-json@1.0.2': resolution: {integrity: sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==} - '@walletconnect/sign-client@2.17.3': - resolution: {integrity: sha512-OzOWxRTfVGCHU3OOF6ibPkgPfDpivFJjuknfcOUt9PYWpTAv6YKOmT4cyfBPhc7llruyHpV44fYbykMcLIvEcg==} - '@walletconnect/sign-client@2.17.5': resolution: {integrity: sha512-5NJ8/BAOlP3runG0++YqWdiNygd0LtHls0LfBa/I+sYpYDMjQaMc18ISqKK9wlIws7rI+UZIGxZphg2N050V7A==} @@ -14311,27 +14246,18 @@ packages: '@walletconnect/time@1.0.2': resolution: {integrity: sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==} - '@walletconnect/types@2.17.3': - resolution: {integrity: sha512-5eFxnbZGJJx0IQyCS99qz+OvozpLJJYfVG96dEHGgbzZMd+C9V1eitYqVClx26uX6V+WQVqVwjpD2Dyzie++Wg==} - '@walletconnect/types@2.17.5': resolution: {integrity: sha512-fFddisuI7B58bY8GKA2e1jZ/o+kh7aQDFohERA1Rot6s9lRepG2w4eR0UDVSldS9hdJS9l7MzCAvEZeHksMaRg==} '@walletconnect/types@2.9.2': resolution: {integrity: sha512-7Rdn30amnJEEal4hk83cdwHUuxI1SWQ+K7fFFHBMqkuHLGi3tpMY6kpyfDxnUScYEZXqgRps4Jo5qQgnRqVM7A==} - '@walletconnect/universal-provider@2.17.3': - resolution: {integrity: sha512-Aen8h+vWTN57sv792i96vaTpN06WnpFUWhACY5gHrpL2XgRKmoXUgW7793p252QdgyofNAOol7wJEs1gX8FjgQ==} - '@walletconnect/universal-provider@2.17.5': resolution: {integrity: sha512-opxFdJWzOZz6LwKAXk5gxqzPT7kdgNH5fyjQ45Q2cseLr5f9uR1JREAQA2stSNCPY4Yk7bxCxSLN6djzpfykgA==} '@walletconnect/universal-provider@2.9.2': resolution: {integrity: sha512-JmaolkO8D31UdRaQCHwlr8uIFUI5BYhBzqYFt54Mc6gbIa1tijGOmdyr6YhhFO70LPmS6gHIjljwOuEllmlrxw==} - '@walletconnect/utils@2.17.3': - resolution: {integrity: sha512-tG77UpZNeLYgeOwViwWnifpyBatkPlpKSSayhN0gcjY1lZAUNqtYslpm4AdTxlrA3pL61MnyybXgWYT5eZjarw==} - '@walletconnect/utils@2.17.5': resolution: {integrity: sha512-3qBeAuEeYw/xbonhK1wC+j1y5I9Fn5qX3D5jW5SuTd1d4SsRSzgUi7SFCFwU1u4LitkEae16FNmTOk4lrrXY3g==} @@ -14569,9 +14495,6 @@ packages: abortcontroller-polyfill@1.7.8: resolution: {integrity: sha512-9f1iZ2uWh92VcrU9Y8x+LdM4DLj75VE0MJB8zuF1iUnroEptStw+DQ8EQPMUdfe5k+PkB1uUfDQfWbhstH8LrQ==} - abs@1.3.14: - resolution: {integrity: sha512-PrS26IzwKLWwuURpiKl8wRmJ2KdR/azaVrLEBWG/TALwT20Y7qjtYp1qcMLHA4206hBHY5phv3w4pjf9NPv4Vw==} - accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -14681,8 +14604,8 @@ packages: zod: optional: true - ai@4.1.9: - resolution: {integrity: sha512-EUc21jyV/2Fv0hEd4toLxQMxjTXBWjKnw16tpto12Vrg/EvkmfVSEvtwXDa+J70iPDmASxL10VKmJk/wnb6bZA==} + ai@4.1.10: + resolution: {integrity: sha512-1YI/3hnuyOxwSS5yT3SALx9DYUUqtTvjUttahNj3RA5nZuUDCfS54zIWspnX0x2tU3mp7CIoJId5OWLYeTz7SA==} engines: {node: '>=18'} peerDependencies: react: ^18 || ^19 || ^19.0.0-rc @@ -14733,8 +14656,8 @@ packages: resolution: {integrity: sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ==} engines: {node: '>= 10'} - algoliasearch-helper@3.23.1: - resolution: {integrity: sha512-j/dF2ZELJBm4SJTK5ECsMuCDJpBB8ITiWKRjd3S15bK2bqrXKLWqDiA5A96WhVvCpZ2NmgNlUYmFbKOfcqivbg==} + algoliasearch-helper@3.24.1: + resolution: {integrity: sha512-knYRACqLH9UpeR+WRUrBzBFR2ulGuOjI2b525k4PNeqZxeFMHJE7YcL7s6Jh12Qza0rtHqZdgHMfeuaaAkf4wA==} peerDependencies: algoliasearch: '>= 3.1 < 6' @@ -15826,10 +15749,6 @@ packages: capsolver-npm@2.0.2: resolution: {integrity: sha512-PvkAGTuwtKXczJeoiLu2XQ4SzJh0m7Yr3ONJuvdjEAw95LwtfGxZ3Ip/w21kR94R4O260omLGlTcQvPf2ECnLg==} - capture-stack-trace@1.0.2: - resolution: {integrity: sha512-X/WM2UQs6VMHUtjUDnZTRI+i1crWteJySFzr9UpGoQa4WQffXVTTXuekjl7TjZRlcF2XfjgITT0HxZ9RnxeT0w==} - engines: {node: '>=0.10.0'} - cardinal@2.1.1: resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} hasBin: true @@ -15852,8 +15771,8 @@ packages: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} - chain-registry@1.69.107: - resolution: {integrity: sha512-aBGcm0zxnuD8ZC54PTWS+7evZR0s6M/jGoaPVCo14PoYfW58qOJNp2R00DQkOIpKCaPESzCbzOkjB1HtUryFXg==} + chain-registry@1.69.108: + resolution: {integrity: sha512-l6IBTwwXyu7Q5IU9S2FVhVkLRcTvU//pjh+KiM0QHBGvW8T0iLYJmAlp1hmkkZeiTL04K7wIOsIwP6Blpes+iw==} chalk@1.1.3: resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} @@ -16518,10 +16437,6 @@ packages: create-ecdh@4.0.4: resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==} - create-error-class@3.0.2: - resolution: {integrity: sha512-gYTKKexFO3kh200H1Nit76sRwRtOY32vQd3jpAQKpLtZqyNsSQNfI4N7o3eP2wUjV35pTWKRYqFUDBvUha/Pkw==} - engines: {node: '>=0.10.0'} - create-hash@1.2.0: resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} @@ -17137,9 +17052,6 @@ packages: resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} engines: {node: '>=10'} - deffy@2.2.4: - resolution: {integrity: sha512-pLc9lsbsWjr6RxmJ2OLyvm+9l4j1yK69h+TML/gUit/t3vTijpkNGh8LioaJYTGO7F25m6HZndADcUOo2PsiUg==} - define-data-property@1.1.4: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} @@ -17623,9 +17535,6 @@ packages: err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} - err@1.1.1: - resolution: {integrity: sha512-N97Ybd2jJHVQ+Ft3Q5+C2gM3kgygkdeQmEqbN2z15UTVyyEsIwLA1VK39O1DHEJhXbwIFcJLqm6iARNhFANcQA==} - error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -18103,9 +18012,6 @@ packages: evp_bytestokey@1.0.3: resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} - exec-limiter@3.2.13: - resolution: {integrity: sha512-86Ri699bwiHZVBzTzNj8gspqAhCPchg70zPVWIh3qzUOA1pUMcb272Em3LPk8AE0mS95B9yMJhtqF8vFJAn0dA==} - execa@5.0.0: resolution: {integrity: sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==} engines: {node: '>=10'} @@ -18593,9 +18499,6 @@ packages: resolution: {integrity: sha512-939eZS4gJ3htTHAldmyyuzlrD58P03fHG49v2JfFXbV6OhvZKRC9j2yAtdHw/zrp2zXHuv05zMIy40F0ge7spA==} engines: {node: '>=18'} - function.name@1.0.13: - resolution: {integrity: sha512-mVrqdoy5npWZyoXl4DxCeuVF6delDcQjVS9aPdvLYlBxtMTZDR2B5GVEQEoM1jJyspCqg3C0v4ABkLE7tp9xFA==} - function.prototype.name@1.1.8: resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} engines: {node: '>= 0.4'} @@ -18730,9 +18633,6 @@ packages: js-git: optional: true - git-package-json@1.4.10: - resolution: {integrity: sha512-DRAcvbzd2SxGK7w8OgYfvKqhFliT5keX0lmSmVdgScgf1kkl5tbbo7Pam6uYoCa1liOiipKxQZG8quCtGWl/fA==} - git-raw-commits@2.0.11: resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} engines: {node: '>=10'} @@ -18755,21 +18655,12 @@ packages: git-sha1@0.1.2: resolution: {integrity: sha512-2e/nZezdVlyCopOCYHeW0onkbZg7xP1Ad6pndPy1rCygeRykefUS6r7oA5cJRGEFvseiaz5a/qUHFVX1dd6Isg==} - git-source@1.1.10: - resolution: {integrity: sha512-XZZ7ZgnLL35oLgM/xjnLYgtlKlxJG0FohC1kWDvGkU7s1VKGXK0pFF/g1itQEwQ3D+uTQzBnzPi8XbqOv7Wc1Q==} - - git-up@1.2.1: - resolution: {integrity: sha512-SRVN3rOLACva8imc7BFrB6ts5iISWKH1/h/1Z+JZYoUI7UVQM7gQqk4M2yxUENbq2jUUT09NEND5xwP1i7Ktlw==} - git-up@7.0.0: resolution: {integrity: sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==} git-url-parse@14.0.0: resolution: {integrity: sha512-NnLweV+2A4nCvn4U/m2AoYu0pPKlsmhK9cknG7IMwsjFY1S2jxM+mAhsDxyxfCIGfGaD+dozsyX4b6vkYc83yQ==} - git-url-parse@5.0.1: - resolution: {integrity: sha512-4uSiOgrryNEMBX+gTWogenYRUh2j1D+95STTSEF2RCTgLkfJikl8c7BGr0Bn274hwuxTsbS2/FQ5pVS9FoXegQ==} - gitconfiglocal@1.0.0: resolution: {integrity: sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==} @@ -18893,10 +18784,6 @@ packages: resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} engines: {node: '>=14.16'} - got@5.7.1: - resolution: {integrity: sha512-1qd54GLxvVgzuidFmw9ze9umxS3rzhdBH6Wt6BTYrTQUXTN01vGGYXwzLzYLowNx8HBH3/c7kRyvx90fh13i7Q==} - engines: {node: '>=0.10.0 <7'} - gql.tada@1.8.10: resolution: {integrity: sha512-FrvSxgz838FYVPgZHGOSgbpOjhR+yq44rCzww3oOPJYi0OvBJjAgCiP6LEokZIYND2fUTXzQAyLgcvgw1yNP5A==} hasBin: true @@ -18951,9 +18838,6 @@ packages: groq-sdk@0.5.0: resolution: {integrity: sha512-RVmhW7qZ+XZoy5fIuSdx/LGQJONpL8MHgZEW7dFwTdgkzStub2XQx6OKv28CHogijdwH41J+Npj/z2jBPu3vmw==} - gry@5.0.8: - resolution: {integrity: sha512-meq9ZjYVpLzZh3ojhTg7IMad9grGsx6rUUKHLqPnhLXzJkRQvEL2U3tQpS5/WentYTtHtxkT3Ew/mb10D6F6/g==} - gtoken@7.1.0: resolution: {integrity: sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==} engines: {node: '>=14.0.0'} @@ -19806,10 +19690,6 @@ packages: is-property@1.0.2: resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==} - is-redirect@1.0.0: - resolution: {integrity: sha512-cr/SlUEe5zOGmzvj9bUyC4LVvkNVAXu4GytXLNMr1pny+a65MpQ9IJzFHD5vi7FyJgb4qt27+eS3TuQnqB+RQw==} - engines: {node: '>=0.10.0'} - is-reference@1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} @@ -19824,10 +19704,6 @@ packages: resolution: {integrity: sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==} engines: {node: '>=0.10.0'} - is-retry-allowed@1.2.0: - resolution: {integrity: sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==} - engines: {node: '>=0.10.0'} - is-retry-allowed@2.2.0: resolution: {integrity: sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==} engines: {node: '>=10'} @@ -20014,9 +19890,6 @@ packages: resolution: {integrity: sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==} engines: {node: '>=6'} - iterate-object@1.3.4: - resolution: {integrity: sha512-4dG1D1x/7g8PwHS9aK6QV5V94+ZvyP4+d19qDv43EzImmrndysIl4prmJ1hWWIGCqrZHyaHBm6BSEWHOLnpoNw==} - iterator.prototype@1.1.5: resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==} engines: {node: '>= 0.4'} @@ -20644,8 +20517,8 @@ packages: labeled-stream-splicer@2.0.2: resolution: {integrity: sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==} - langchain@0.3.13: - resolution: {integrity: sha512-QIQocx2goCBMgCw+hXjDiCW/5P/Q4HbNjaGEbG2FPHzFl48aw36GJvcyEbg91GqjhyH+lsIlYIWMcdDqn5Z5Lw==} + langchain@0.3.14: + resolution: {integrity: sha512-U6NpGSQP/R/RfZFin6OOxFYgLNAwtfgKEWKxT3whw2LIDUnjXrgbulkS5R5iXIU8V10kAXhDvj+FyEUI8C4U6Q==} engines: {node: '>=18'} peerDependencies: '@langchain/anthropic': '*' @@ -20653,6 +20526,7 @@ packages: '@langchain/cerebras': '*' '@langchain/cohere': '*' '@langchain/core': '>=0.2.21 <0.4.0' + '@langchain/deepseek': '*' '@langchain/google-genai': '*' '@langchain/google-vertexai': '*' '@langchain/google-vertexai-web': '*' @@ -20673,6 +20547,8 @@ packages: optional: true '@langchain/cohere': optional: true + '@langchain/deepseek': + optional: true '@langchain/google-genai': optional: true '@langchain/google-vertexai': @@ -20851,9 +20727,6 @@ packages: resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} - limit-it@3.2.10: - resolution: {integrity: sha512-T0NK99pHnkimldr1WUqvbGV1oWDku/xC9J/OqzJFsV1jeOS6Bwl8W7vkeQIBqwiON9dTALws+rX/XPMQqWerDQ==} - lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -21090,8 +20963,8 @@ packages: loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} - loupe@3.1.2: - resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} + loupe@3.1.3: + resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} lowdb@7.0.1: resolution: {integrity: sha512-neJAj8GwF0e8EpycYIDFqEPcx9Qz4GUho20jWFR7YiFeXzF1YMLdxB36PypcTSPMA+4+LvgyMacYhlr18Zlymw==} @@ -21100,10 +20973,6 @@ packages: lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} - lowercase-keys@1.0.1: - resolution: {integrity: sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==} - engines: {node: '>=0.10.0'} - lowercase-keys@2.0.0: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} engines: {node: '>=8'} @@ -22141,10 +22010,6 @@ packages: node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} - node-status-codes@1.0.0: - resolution: {integrity: sha512-1cBMgRxdMWE8KeWCqk2RIOrvUb0XCwYfEsY5/y2NlXyq4Y/RumnOZvTj4Nbr77+Vb2C+kyBoRTdkNOS8L3d/aQ==} - engines: {node: '>=0.10.0'} - nodejs-whisper@0.1.18: resolution: {integrity: sha512-2FETHL/Ur46jIEh3H4bhJ0WAdPJxWBcaLPcdHCy6oDAXfD7ZGomQAiIL+musqtY1G1IV6/5+zUZJNxdZIsfy6A==} hasBin: true @@ -22161,9 +22026,6 @@ packages: noms@0.0.0: resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} - noop6@1.0.9: - resolution: {integrity: sha512-DB3Hwyd89dPr5HqEPg3YHjzvwh/mCqizC1zZ8vyofqc+TQRyPDnT4wgXXbLGF4z9YAzwwTLi8pNLhGqcbSjgkA==} - nopt@1.0.10: resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==} hasBin: true @@ -22305,15 +22167,9 @@ packages: o3@1.0.3: resolution: {integrity: sha512-f+4n+vC6s4ysy7YO7O2gslWZBUu8Qj2i2OUJOvjRxQva7jVjYjB29jrr9NCjmxZQR0gzrOcv1RnqoYOeMs5VRQ==} - oargv@3.4.10: - resolution: {integrity: sha512-SXaMANv9sr7S/dP0vj0+Ybipa47UE1ntTWQ2rpPRhC6Bsvfl+Jg03Xif7jfL0sWKOYWK8oPjcZ5eJ82t8AP/8g==} - oauth-sign@0.9.0: resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} - obj-def@1.0.9: - resolution: {integrity: sha512-bQ4ya3VYD6FAA1+s6mEhaURRHSmw4+sKaXE6UyXZ1XDYc5D+c7look25dFdydmLd18epUegh398gdDkMUZI9xg==} - object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -22400,9 +22256,6 @@ packages: once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - one-by-one@3.2.8: - resolution: {integrity: sha512-HR/pSzZdm46Xqj58K+Bu64kMbSTw8/u77AwWvV+rprO/OsuR++pPlkUJn+SmwqBGRgHKwSKQ974V3uls7crIeQ==} - onetime@1.1.0: resolution: {integrity: sha512-GZ+g4jayMqzCRMgB2sol7GiCLjKfS1PINkjmx8spcKce1LiVqcbQreXwqs2YAFXC6R03VIG28ZS31t8M866v6A==} engines: {node: '>=0.10.0'} @@ -22520,16 +22373,16 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} - ox@0.4.2: - resolution: {integrity: sha512-X3Ho21mTtJiCU2rWmfaheh2b0CG70Adre7Da/XQ0ECy+QppI6pLqdbGAJHiu/cTjumVXfwDGfv48APqePCU+ow==} + ox@0.4.4: + resolution: {integrity: sha512-oJPEeCDs9iNiPs6J0rTx+Y0KGeCGyCAA3zo94yZhm8G5WpOxrwUtn2Ie/Y8IyARSqqY/j9JTKA3Fc1xs1DvFnw==} peerDependencies: typescript: '>=5.4.0' peerDependenciesMeta: typescript: optional: true - ox@0.4.4: - resolution: {integrity: sha512-oJPEeCDs9iNiPs6J0rTx+Y0KGeCGyCAA3zo94yZhm8G5WpOxrwUtn2Ie/Y8IyARSqqY/j9JTKA3Fc1xs1DvFnw==} + ox@0.6.9: + resolution: {integrity: sha512-wi5ShvzE4eOcTwQVsIPdFr+8ycyX+5le/96iAJutaZAvCes1J0+RvpEPg5QDPDiaR0XQQAvZVl7AwqQcINuUug==} peerDependencies: typescript: '>=5.4.0' peerDependenciesMeta: @@ -22651,13 +22504,6 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - package-json-path@1.0.9: - resolution: {integrity: sha512-uNu7f6Ef7tQHZRnkyVnCtzdSYVN9uBtge/sG7wzcUaawFWkPYUq67iXxRGrQSg/q0tzxIB8jSyIYUKjG2Jn//A==} - - package-json@2.4.0: - resolution: {integrity: sha512-PRg65iXMTt/uK8Rfh5zvzkUbfAPitF17YaCY+IbHsYgksiLvtzWWTUildHth3mVaZ7871OJ7gtP4LBRBlmAdXg==} - engines: {node: '>=0.10.0'} - package-json@8.1.1: resolution: {integrity: sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==} engines: {node: '>=14.16'} @@ -22665,10 +22511,6 @@ packages: package-manager-detector@0.2.8: resolution: {integrity: sha512-ts9KSdroZisdvKMWVAVCXiKqnqNfXz4+IbrBG8/BWx/TR5le+jfenvoBuIZ6UWM9nz47W7AbD9qYfAwfWMIwzA==} - package.json@2.0.1: - resolution: {integrity: sha512-pSxZ6XR5yEawRN2ekxx9IKgPN5uNAYco7MCPxtBEWMKO3UKWa1X2CtQMzMgloeGj2g2o6cue3Sb5iPkByIJqlw==} - deprecated: Use pkg.json instead. - pacote@18.0.6: resolution: {integrity: sha512-+eK3G27SMwsB8kLIuj4h1FUhHtwiEUo21Tw8wNjmvdlpOEr613edv+8FUsTj/4F/VN5ywGE19X18N7CC2EJk6A==} engines: {node: ^16.14.0 || >=18.0.0} @@ -22710,10 +22552,6 @@ packages: parse-headers@2.0.5: resolution: {integrity: sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==} - parse-json@2.2.0: - resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} - engines: {node: '>=0.10.0'} - parse-json@4.0.0: resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} engines: {node: '>=4'} @@ -22740,9 +22578,6 @@ packages: parse-path@7.0.0: resolution: {integrity: sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog==} - parse-url@1.3.11: - resolution: {integrity: sha512-1wj9nkgH/5EboDxLwaTMGJh3oH3f+Gue+aGdh631oCqoSBpokzmMmOldvOeBPtB8GJBYJbaF93KPzlkU+Y1ksg==} - parse-url@8.1.0: resolution: {integrity: sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==} @@ -22986,14 +22821,6 @@ packages: resolution: {integrity: sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==} engines: {node: '>=10'} - pinkie-promise@2.0.1: - resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==} - engines: {node: '>=0.10.0'} - - pinkie@2.0.4: - resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==} - engines: {node: '>=0.10.0'} - pino-abstract-transport@0.5.0: resolution: {integrity: sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==} @@ -23798,10 +23625,6 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prepend-http@1.0.4: - resolution: {integrity: sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==} - engines: {node: '>=0.10.0'} - prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -23966,9 +23789,6 @@ packages: resolution: {integrity: sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==} engines: {node: '>=12.0.0'} - protocols@1.4.8: - resolution: {integrity: sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==} - protocols@2.0.1: resolution: {integrity: sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==} @@ -24128,9 +23948,6 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - queue-tick@1.0.1: - resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==} - queue@6.0.2: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} @@ -24145,12 +23962,6 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} - r-json@1.3.0: - resolution: {integrity: sha512-xesd+RHCpymPCYd9DvDvUr1w1IieSChkqYF1EpuAYrvCfLXji9NP36DvyYZJZZB5soVDvZ0WUtBoZaU1g5Yt9A==} - - r-package-json@1.0.9: - resolution: {integrity: sha512-G4Vpf1KImWmmPFGdtWQTU0L9zk0SjqEC4qs/jE7AQ+Ylmr5kizMzGeC4wnHp5+ijPqNN+2ZPpvyjVNdN1CDVcg==} - radix3@1.1.2: resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} @@ -24342,10 +24153,6 @@ packages: resolution: {integrity: sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==} engines: {node: '>=0.10.0'} - read-all-stream@3.1.0: - resolution: {integrity: sha512-DI1drPHbmBcUDWrJ7ull/F2Qb8HkwBncVx8/RpKYFSIACYaVRQReISYPdZz/mt1y1+qMCOrfReTopERmaxtP6w==} - engines: {node: '>=0.10.0'} - read-cache@1.0.0: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} @@ -24536,17 +24343,10 @@ packages: resolution: {integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==} engines: {node: '>=4'} - registry-auth-token@3.4.0: - resolution: {integrity: sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==} - registry-auth-token@5.0.3: resolution: {integrity: sha512-1bpc9IyC+e+CNFRaWyn77tk4xGG4PPUyfakSmA6F6cvUDjrm58dfyJ3II+9yb10EDkHoy1LaPSmHaWLOH3m6HA==} engines: {node: '>=14'} - registry-url@3.1.0: - resolution: {integrity: sha512-ZbgR5aZEdf4UKZVBPYIgaglBmSF2Hi94s2PcIHhRGFjKYu+chjJdYfHn4rt3hB6eCKLJ8giVIIfgMa1ehDfZKA==} - engines: {node: '>=0.10.0'} - registry-url@6.0.1: resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} engines: {node: '>=12'} @@ -25242,9 +25042,6 @@ packages: resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} engines: {node: '>=18'} - sliced@1.0.1: - resolution: {integrity: sha512-VZBmZP8WU3sMOZm1bdgTadsQbcscK0UM8oKxKVBs4XAhUo2Xxzm/OFMGBkPusxw9xL3Uy8LrzEqGqJhclsr0yA==} - slide@1.1.6: resolution: {integrity: sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==} @@ -25596,8 +25393,8 @@ packages: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} - streamx@2.21.1: - resolution: {integrity: sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==} + streamx@2.22.0: + resolution: {integrity: sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==} strict-event-emitter-types@2.0.0: resolution: {integrity: sha512-Nk/brWYpD85WlOgzw5h173aci0Teyv8YdIAEtV+N88nDB0dLlazZyJMIsN6eo1/AR61l+p6CJTG1JIyFaoNEEA==} @@ -25816,8 +25613,8 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svelte@5.19.3: - resolution: {integrity: sha512-rb/bkYG9jq67OCWikMvaPnfOobyGn0JizVDwHpdeBtLiNXPMcoA9GTFC3BhptP7xGNquUU8J5GiS7PlGlfDAFA==} + svelte@5.19.4: + resolution: {integrity: sha512-pzWvFQdvfEfT4Ll/JriAtcG7qmWjcL+x/NSl9Q+FPje5SXukYNp9kcufZ27ydauLLE/dwYMz9XRC8kiwTZmfDA==} engines: {node: '>=18'} svg-parser@2.0.4: @@ -26001,8 +25798,8 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - thirdweb@5.86.6: - resolution: {integrity: sha512-DmAo61RbIF5PsXFf2Ru+FEvrJ9qiBPwifkU7jCAWEooUts5KSwUO3MowWWHbjjN1At4k/IUoiLvkOtAK8cfheg==} + thirdweb@5.87.0: + resolution: {integrity: sha512-1hDIC+HsQC/VdGf7sjfTrM9z/REvrXbUJgNjijHIqdN0Ucdp/9ytzdyQWXkw3on4LLhEdYrlgxnz0Fjm2hKzhg==} engines: {node: '>=18'} hasBin: true peerDependencies: @@ -26091,10 +25888,6 @@ packages: resolution: {integrity: sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==} engines: {node: '>=12'} - timed-out@3.1.3: - resolution: {integrity: sha512-3RB4qgvPkxF/FGPnrzaWLhW1rxNK2sdH0mFjbhxkfTR6QXvcM3EtYm9L44UrhODZrZ+yhDXeMncLqi8QXn2MJg==} - engines: {node: '>=0.10.0'} - timed-out@4.0.1: resolution: {integrity: sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==} engines: {node: '>=0.10.0'} @@ -26194,10 +25987,6 @@ packages: tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} - tmp@0.0.28: - resolution: {integrity: sha512-c2mmfiBmND6SOVxzogm1oda0OJ1HZVIk/5n26N59dDTh80MUeavpiCls4PGAdkX1PFkKokLpcf7prSjCeXLsJg==} - engines: {node: '>=0.4.0'} - tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -26741,9 +26530,6 @@ packages: engines: {node: '>=14.17'} hasBin: true - typpy@2.3.13: - resolution: {integrity: sha512-vOxIcQz9sxHi+rT09SJ5aDgVgrPppQjwnnayTrMye1ODaU8gIZTDM19t9TxmEElbMihx2Nq/0/b/MtyKfayRqA==} - u3@0.1.1: resolution: {integrity: sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w==} @@ -26780,9 +26566,6 @@ packages: uint8arrays@3.1.1: resolution: {integrity: sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==} - ul@5.2.15: - resolution: {integrity: sha512-svLEUy8xSCip5IWnsRa0UOg+2zP0Wsj4qlbjTmX6GJSmvKMHADBuHOm1dpNkWqWPIGuVSqzUkV3Cris5JrlTRQ==} - ultron@1.1.1: resolution: {integrity: sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==} @@ -27038,10 +26821,6 @@ packages: resolution: {integrity: sha512-eL/8PlhLcMmlMDtNPKhyyz9kEBDS3Uk4yMu/ewlkT2WFbtzScjHWPJLdQLmaGPUKjXzwe9MumOtOgc4Fro96Kg==} hasBin: true - unzip-response@1.0.2: - resolution: {integrity: sha512-pwCcjjhEcpW45JZIySExBHYv5Y9EeL2OIGEfrSKp2dMUFGFv4CpvZkwJbVge8OvGH2BNNtJBx67DuKuJhf+N5Q==} - engines: {node: '>=0.10'} - unzipper@0.12.3: resolution: {integrity: sha512-PZ8hTS+AqcGxsaQntl3IRBw65QrBI6lxzqDEL7IAo/XCEqRTKGfOX56Vea5TH9SZczRVxuzk1re04z/YjuYCJA==} @@ -27078,10 +26857,6 @@ packages: file-loader: optional: true - url-parse-lax@1.0.0: - resolution: {integrity: sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA==} - engines: {node: '>=0.10.0'} - url-parse@1.5.10: resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} @@ -27676,9 +27451,6 @@ packages: typescript: optional: true - w-json@1.3.10: - resolution: {integrity: sha512-XadVyw0xE+oZ5FGApXsdswv96rOhStzKqL53uSe5UaTadABGkWIg1+DTx8kiZ/VqTZTBneoL0l65RcPe4W3ecw==} - w3c-hr-time@1.0.2: resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} deprecated: Use your platform's native performance.now() and performance.timeOrigin. @@ -28738,13 +28510,13 @@ snapshots: transitivePeerDependencies: - zod - '@ai-sdk/svelte@0.0.57(svelte@5.19.3)(zod@3.23.8)': + '@ai-sdk/svelte@0.0.57(svelte@5.19.4)(zod@3.23.8)': dependencies: '@ai-sdk/provider-utils': 2.1.2(zod@3.23.8) '@ai-sdk/ui-utils': 0.0.50(zod@3.23.8) - sswr: 2.1.0(svelte@5.19.3) + sswr: 2.1.0(svelte@5.19.4) optionalDependencies: - svelte: 5.19.3 + svelte: 5.19.4 transitivePeerDependencies: - zod @@ -30725,11 +30497,11 @@ snapshots: '@cfworker/json-schema@4.1.0': {} - '@chain-registry/types@0.50.57': {} + '@chain-registry/types@0.50.58': {} - '@chain-registry/utils@1.51.57': + '@chain-registry/utils@1.51.58': dependencies: - '@chain-registry/types': 0.50.57 + '@chain-registry/types': 0.50.58 bignumber.js: 9.1.2 sha.js: 2.4.11 @@ -31072,7 +30844,7 @@ snapshots: '@coinbase/wallet-sdk@4.2.4': dependencies: - '@noble/hashes': 1.6.1 + '@noble/hashes': 1.7.1 clsx: 1.2.1 eventemitter3: 5.0.1 preact: 10.25.4 @@ -32343,7 +32115,7 @@ snapshots: - encoding - supports-color - '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13)': + '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13)': dependencies: '@discordjs/node-pre-gyp': 0.4.5(encoding@0.1.13) node-addon-api: 8.3.0 @@ -32365,11 +32137,11 @@ snapshots: '@discordjs/util@1.1.1': {} - '@discordjs/voice@0.17.0(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@6.0.5)': + '@discordjs/voice@0.17.0(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@6.0.5)': dependencies: '@types/ws': 8.5.14 discord-api-types: 0.37.83 - prism-media: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13))(ffmpeg-static@5.2.0) + prism-media: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13))(ffmpeg-static@5.2.0) tslib: 2.8.1 ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) transitivePeerDependencies: @@ -33145,7 +32917,7 @@ snapshots: '@docusaurus/utils': 3.7.0(@swc/core@1.10.11(@swc/helpers@0.5.15))(acorn@8.14.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@docusaurus/utils-validation': 3.7.0(@swc/core@1.10.11(@swc/helpers@0.5.15))(acorn@8.14.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) algoliasearch: 5.20.0 - algoliasearch-helper: 3.23.1(algoliasearch@5.20.0) + algoliasearch-helper: 3.24.1(algoliasearch@5.20.0) clsx: 2.1.1 eta: 2.2.0 fs-extra: 11.2.0 @@ -33464,9 +33236,9 @@ snapshots: '@electric-sql/pglite@0.2.16': {} - '@elizaos/adapter-sqlite@0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(whatwg-url@14.1.0)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))': + '@elizaos/adapter-sqlite@0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(whatwg-url@14.1.0)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))': dependencies: - '@elizaos/core': 0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) + '@elizaos/core': 0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) '@types/better-sqlite3': 7.6.12 better-sqlite3: 11.6.0 sqlite-vec: 0.1.6 @@ -33497,7 +33269,7 @@ snapshots: '@elizaos/adapter-sqlite@0.1.8(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(whatwg-url@14.1.0)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: - '@elizaos/core': 0.1.8(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@elizaos/core': 0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@types/better-sqlite3': 7.6.12 better-sqlite3: 11.6.0 sqlite-vec: 0.1.6 @@ -33526,7 +33298,7 @@ snapshots: - vue - ws - '@elizaos/core@0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))': + '@elizaos/core@0.1.7-alpha.2(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))': dependencies: '@ai-sdk/anthropic': 0.0.56(zod@3.23.8) '@ai-sdk/google': 0.0.55(zod@3.23.8) @@ -33536,7 +33308,7 @@ snapshots: '@anthropic-ai/sdk': 0.30.1(encoding@0.1.13) '@fal-ai/client': 1.2.0 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) fastembed: 1.14.1 fastestsmallesttextencoderdecoder: 1.0.22 @@ -33577,7 +33349,7 @@ snapshots: - vue - ws - '@elizaos/core@0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@elizaos/core@0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: '@ai-sdk/anthropic': 0.0.56(zod@3.23.8) '@ai-sdk/google': 0.0.55(zod@3.23.8) @@ -33588,7 +33360,7 @@ snapshots: '@anthropic-ai/sdk': 0.30.1(encoding@0.1.13) '@fal-ai/client': 1.2.0 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) fastembed: 1.14.1 fastestsmallesttextencoderdecoder: 1.0.22 @@ -33629,59 +33401,7 @@ snapshots: - vue - ws - '@elizaos/core@0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': - dependencies: - '@ai-sdk/anthropic': 0.0.56(zod@3.23.8) - '@ai-sdk/google': 0.0.55(zod@3.23.8) - '@ai-sdk/google-vertex': 0.0.43(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(zod@3.23.8) - '@ai-sdk/groq': 0.0.3(zod@3.23.8) - '@ai-sdk/mistral': 1.0.9(zod@3.23.8) - '@ai-sdk/openai': 1.0.5(zod@3.23.8) - '@anthropic-ai/sdk': 0.30.1(encoding@0.1.13) - '@fal-ai/client': 1.2.0 - '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) - anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) - fastembed: 1.14.1 - fastestsmallesttextencoderdecoder: 1.0.22 - gaxios: 6.7.1(encoding@0.1.13) - glob: 11.0.0 - handlebars: 4.7.8 - js-sha1: 0.7.0 - js-tiktoken: 1.0.15 - langchain: 0.3.6(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) - ollama-ai-provider: 0.16.1(zod@3.23.8) - openai: 4.73.0(encoding@0.1.13)(zod@3.23.8) - tinyld: 1.3.4 - together-ai: 0.7.0(encoding@0.1.13) - unique-names-generator: 4.7.1 - uuid: 11.0.3 - zod: 3.23.8 - transitivePeerDependencies: - - '@google-cloud/vertexai' - - '@langchain/anthropic' - - '@langchain/aws' - - '@langchain/cohere' - - '@langchain/core' - - '@langchain/google-genai' - - '@langchain/google-vertexai' - - '@langchain/groq' - - '@langchain/mistralai' - - '@langchain/ollama' - - axios - - cheerio - - encoding - - peggy - - react - - solid-js - - sswr - - supports-color - - svelte - - typeorm - - vue - - ws - - '@elizaos/core@0.1.8(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + '@elizaos/core@0.1.8(@google-cloud/vertexai@1.9.2(encoding@0.1.13))(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))': dependencies: '@ai-sdk/anthropic': 0.0.56(zod@3.23.8) '@ai-sdk/google': 0.0.55(zod@3.23.8) @@ -33692,7 +33412,7 @@ snapshots: '@anthropic-ai/sdk': 0.30.1(encoding@0.1.13) '@fal-ai/client': 1.2.0 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) fastembed: 1.14.1 fastestsmallesttextencoderdecoder: 1.0.22 @@ -33744,7 +33464,7 @@ snapshots: '@anthropic-ai/sdk': 0.30.1(encoding@0.1.13) '@fal-ai/client': 1.2.0 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) fastembed: 1.14.1 fastestsmallesttextencoderdecoder: 1.0.22 @@ -34959,16 +34679,16 @@ snapshots: '@shikijs/types': 1.29.1 '@shikijs/vscode-textmate': 10.0.1 - '@goat-sdk/adapter-vercel-ai@0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.9(react@19.0.0)(zod@3.23.8))': + '@goat-sdk/adapter-vercel-ai@0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.10(react@19.0.0)(zod@3.23.8))': dependencies: '@goat-sdk/core': 0.4.6(zod@3.23.8) - ai: 4.1.9(react@19.0.0)(zod@3.23.8) + ai: 4.1.10(react@19.0.0)(zod@3.23.8) zod: 3.23.8 - '@goat-sdk/adapter-vercel-ai@0.2.7(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.9(react@19.0.0)(zod@3.23.8))(zod@3.23.8)': + '@goat-sdk/adapter-vercel-ai@0.2.7(@goat-sdk/core@0.4.6(zod@3.23.8))(ai@4.1.10(react@19.0.0)(zod@3.23.8))(zod@3.23.8)': dependencies: '@goat-sdk/core': 0.4.6(zod@3.23.8) - ai: 4.1.9(react@19.0.0)(zod@3.23.8) + ai: 4.1.10(react@19.0.0)(zod@3.23.8) zod: 3.23.8 '@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10)': @@ -35283,7 +35003,7 @@ snapshots: '@ledgerhq/hw-transport': 6.31.4 '@ledgerhq/hw-transport-webhid': 6.30.0 '@ledgerhq/hw-transport-webusb': 6.29.4 - '@mysten/bcs': 1.2.1 + '@mysten/bcs': 1.3.0 axios: 1.7.9 bech32: 2.0.0 bignumber.js: 9.1.2 @@ -36445,7 +36165,7 @@ snapshots: - encoding - ws - '@langchain/langgraph-checkpoint@0.0.13(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))': + '@langchain/langgraph-checkpoint@0.0.14(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))': dependencies: '@langchain/core': 0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)) uuid: 10.0.0 @@ -36457,10 +36177,10 @@ snapshots: p-retry: 4.6.2 uuid: 9.0.1 - '@langchain/langgraph@0.2.41(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))': + '@langchain/langgraph@0.2.42(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))': dependencies: '@langchain/core': 0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)) - '@langchain/langgraph-checkpoint': 0.0.13(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))) + '@langchain/langgraph-checkpoint': 0.0.14(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))) '@langchain/langgraph-sdk': 0.0.36 uuid: 10.0.0 zod: 3.23.8 @@ -36623,7 +36343,7 @@ snapshots: - utf-8-validate - wait-for-expect - '@lens-protocol/client@2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5)': + '@lens-protocol/client@2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(react@19.0.0)(utf-8-validate@6.0.5)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/abstract-signer': 5.7.0 @@ -36634,7 +36354,7 @@ snapshots: '@ethersproject/providers': 5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5) '@ethersproject/wallet': 5.7.0 '@lens-protocol/blockchain-bindings': 0.10.2(@jest/globals@29.7.0)(bufferutil@4.0.9)(utf-8-validate@6.0.5) - '@lens-protocol/gated-content': 0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5)(zod@3.23.8) + '@lens-protocol/gated-content': 0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(react@19.0.0)(utf-8-validate@6.0.5)(zod@3.23.8) '@lens-protocol/shared-kernel': 0.12.0 '@lens-protocol/storage': 0.8.1 graphql: 16.10.0 @@ -36683,7 +36403,7 @@ snapshots: optionalDependencies: '@jest/globals': 29.7.0 - '@lens-protocol/gated-content@0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5)(zod@3.23.8)': + '@lens-protocol/gated-content@0.5.1(@ethersproject/abi@5.7.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.7.0)(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5))(react@19.0.0)(utf-8-validate@6.0.5)(zod@3.23.8)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/address': 5.7.0 @@ -36698,7 +36418,7 @@ snapshots: '@lit-protocol/constants': 2.1.62 '@lit-protocol/crypto': 2.1.62(bufferutil@4.0.9)(utf-8-validate@6.0.5) '@lit-protocol/encryption': 2.1.62(bufferutil@4.0.9)(utf-8-validate@6.0.5) - '@lit-protocol/node-client': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5) + '@lit-protocol/node-client': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@6.0.5) '@lit-protocol/types': 2.1.62 siwe: 2.3.2(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@6.0.5)) tslib: 2.8.1 @@ -36980,14 +36700,14 @@ snapshots: dependencies: ajv: 8.17.1 - '@lit-protocol/auth-browser@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5)': + '@lit-protocol/auth-browser@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@6.0.5)': dependencies: '@lit-protocol/constants': 2.1.62 '@lit-protocol/misc': 2.1.62 '@lit-protocol/misc-browser': 2.1.62(bufferutil@4.0.9)(utf-8-validate@6.0.5) '@lit-protocol/types': 2.1.62 '@lit-protocol/uint8arrays': 2.1.62 - '@walletconnect/ethereum-provider': 2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5) + '@walletconnect/ethereum-provider': 2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@6.0.5) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5) lit-connect-modal: 0.1.11 lit-siwe: 1.1.8(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0) @@ -37929,10 +37649,10 @@ snapshots: dependencies: tslib: 1.14.1 - '@lit-protocol/node-client@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5)': + '@lit-protocol/node-client@2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@6.0.5)': dependencies: '@lit-protocol/access-control-conditions': 2.1.62(bufferutil@4.0.9)(utf-8-validate@6.0.5) - '@lit-protocol/auth-browser': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5) + '@lit-protocol/auth-browser': 2.1.62(@ethersproject/contracts@5.7.0)(@ethersproject/hash@5.7.0)(@ethersproject/providers@5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(@ethersproject/wallet@5.7.0)(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@6.0.5) '@lit-protocol/bls-sdk': 2.1.62 '@lit-protocol/constants': 2.1.62 '@lit-protocol/crypto': 2.1.62(bufferutil@4.0.9)(utf-8-validate@6.0.5) @@ -37944,7 +37664,7 @@ snapshots: '@lit-protocol/nacl': 2.1.62 '@lit-protocol/types': 2.1.62 '@lit-protocol/uint8arrays': 2.1.62 - '@walletconnect/ethereum-provider': 2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5) + '@walletconnect/ethereum-provider': 2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@6.0.5) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@6.0.5) jszip: 3.10.1 lit-connect-modal: 0.1.11 @@ -38937,10 +38657,9 @@ snapshots: '@metaplex-foundation/cusper@0.0.2': {} - '@metaplex-foundation/digital-asset-standard-api@1.0.4(@metaplex-foundation/umi@0.9.2)': + '@metaplex-foundation/digital-asset-standard-api@1.0.5(@metaplex-foundation/umi@0.9.2)': dependencies: '@metaplex-foundation/umi': 0.9.2 - package.json: 2.0.1 '@metaplex-foundation/js@0.20.1(arweave@1.15.5)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10)': dependencies: @@ -39588,14 +39307,14 @@ snapshots: dependencies: bech32: 2.0.0 - '@mysten/bcs@1.2.1': + '@mysten/bcs@1.3.0': dependencies: bs58: 5.0.0 - '@mysten/sui@1.21.0(typescript@5.7.3)': + '@mysten/sui@1.21.1(typescript@5.7.3)': dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.10.0) - '@mysten/bcs': 1.2.1 + '@mysten/bcs': 1.3.0 '@noble/curves': 1.8.1 '@noble/hashes': 1.7.1 '@scure/bip32': 1.6.2 @@ -40248,7 +39967,7 @@ snapshots: '@octokit/oauth-app': 7.1.5 '@octokit/plugin-paginate-rest': 11.4.0(@octokit/core@6.1.3) '@octokit/types': 13.7.0 - '@octokit/webhooks': 13.4.2 + '@octokit/webhooks': 13.4.3 '@octokit/auth-app@7.1.4': dependencies: @@ -40527,7 +40246,7 @@ snapshots: '@octokit/webhooks-methods@5.1.0': {} - '@octokit/webhooks@13.4.2': + '@octokit/webhooks@13.4.3': dependencies: '@octokit/openapi-webhooks-types': 8.5.1 '@octokit/request-error': 6.1.6 @@ -41901,28 +41620,6 @@ snapshots: optionalDependencies: '@types/react': 19.0.8 - '@radix-ui/react-dialog@1.1.4(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.3(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-focus-guards': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-portal': 1.1.3(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.8)(react@19.0.0) - aria-hidden: 1.2.4 - react: 19.0.0 - react-dom: 19.0.0(react@19.0.0) - react-remove-scroll: 2.6.3(@types/react@19.0.8)(react@19.0.0) - optionalDependencies: - '@types/react': 19.0.8 - '@types/react-dom': 19.0.3(@types/react@19.0.8) - '@radix-ui/react-dialog@1.1.5(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: '@radix-ui/primitive': 1.1.1 @@ -41951,32 +41648,6 @@ snapshots: optionalDependencies: '@types/react': 19.0.8 - '@radix-ui/react-dismissable-layer@1.1.2(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@19.0.8)(react@19.0.0) - react: 19.0.0 - react-dom: 19.0.0(react@19.0.0) - optionalDependencies: - '@types/react': 19.0.8 - '@types/react-dom': 19.0.3(@types/react@19.0.8) - - '@radix-ui/react-dismissable-layer@1.1.3(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-primitive': 2.0.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@19.0.8)(react@19.0.0) - react: 19.0.0 - react-dom: 19.0.0(react@19.0.0) - optionalDependencies: - '@types/react': 19.0.8 - '@types/react-dom': 19.0.3(@types/react@19.0.8) - '@radix-ui/react-dismissable-layer@1.1.4(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: '@radix-ui/primitive': 1.1.1 @@ -42143,26 +41814,6 @@ snapshots: '@types/react': 19.0.8 '@types/react-dom': 19.0.3(@types/react@19.0.8) - '@radix-ui/react-tooltip@1.1.5(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': - dependencies: - '@radix-ui/primitive': 1.1.1 - '@radix-ui/react-compose-refs': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-context': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-dismissable-layer': 1.1.2(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-id': 1.1.0(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-popper': 1.2.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-portal': 1.1.3(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-presence': 1.1.2(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-primitive': 2.0.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@radix-ui/react-slot': 1.1.1(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.8)(react@19.0.0) - '@radix-ui/react-visually-hidden': 1.1.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - react: 19.0.0 - react-dom: 19.0.0(react@19.0.0) - optionalDependencies: - '@types/react': 19.0.8 - '@types/react-dom': 19.0.3(@types/react@19.0.8) - '@radix-ui/react-tooltip@1.1.7(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: '@radix-ui/primitive': 1.1.1 @@ -45329,13 +44980,11 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tanstack/query-core@5.62.16': {} - '@tanstack/query-core@5.65.0': {} - '@tanstack/react-query@5.62.16(react@19.0.0)': + '@tanstack/react-query@5.65.0(react@19.0.0)': dependencies: - '@tanstack/query-core': 5.62.16 + '@tanstack/query-core': 5.65.0 react: 19.0.0 '@tanstack/react-query@5.65.1(react@19.0.0)': @@ -47116,30 +46765,30 @@ snapshots: '@vitest/utils@2.1.4': dependencies: '@vitest/pretty-format': 2.1.4 - loupe: 3.1.2 + loupe: 3.1.3 tinyrainbow: 1.2.0 '@vitest/utils@2.1.5': dependencies: '@vitest/pretty-format': 2.1.5 - loupe: 3.1.2 + loupe: 3.1.3 tinyrainbow: 1.2.0 '@vitest/utils@2.1.8': dependencies: '@vitest/pretty-format': 2.1.8 - loupe: 3.1.2 + loupe: 3.1.3 tinyrainbow: 1.2.0 '@vitest/utils@3.0.2': dependencies: '@vitest/pretty-format': 3.0.2 - loupe: 3.1.2 + loupe: 3.1.3 tinyrainbow: 2.0.0 '@vladfrangu/async_event_emitter@2.4.6': {} - '@voltr/vault-sdk@0.1.3(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10)': + '@voltr/vault-sdk@0.1.4(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -47151,7 +46800,7 @@ snapshots: - typescript - utf-8-validate - '@voltr/vault-sdk@0.1.3(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10)': + '@voltr/vault-sdk@0.1.4(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) @@ -47223,7 +46872,7 @@ snapshots: dependencies: '@wallet-standard/base': 1.1.0 - '@walletconnect/core@2.17.3(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': + '@walletconnect/core@2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-provider': 1.0.14 @@ -47236,8 +46885,8 @@ snapshots: '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.3(ioredis@5.4.2) - '@walletconnect/utils': 2.17.3(ioredis@5.4.2) + '@walletconnect/types': 2.17.5(ioredis@5.4.2) + '@walletconnect/utils': 2.17.5(ioredis@5.4.2) '@walletconnect/window-getters': 1.0.1 events: 3.3.0 lodash.isequal: 4.5.0 @@ -47305,6 +46954,47 @@ snapshots: - uploadthing - utf-8-validate + '@walletconnect/core@2.17.5(bufferutil@4.0.9)(utf-8-validate@6.0.5)': + dependencies: + '@walletconnect/heartbeat': 1.2.2 + '@walletconnect/jsonrpc-provider': 1.0.14 + '@walletconnect/jsonrpc-types': 1.0.4 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.16(bufferutil@4.0.9)(utf-8-validate@6.0.5) + '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) + '@walletconnect/logger': 2.1.2 + '@walletconnect/relay-api': 1.0.11 + '@walletconnect/relay-auth': 1.0.4 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.17.5(ioredis@5.4.2) + '@walletconnect/utils': 2.17.5(ioredis@5.4.2) + '@walletconnect/window-getters': 1.0.1 + events: 3.3.0 + lodash.isequal: 4.5.0 + uint8arrays: 3.1.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@deno/kv' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/blob' + - '@vercel/kv' + - aws4fetch + - bufferutil + - db0 + - ioredis + - uploadthing + - utf-8-validate + '@walletconnect/core@2.9.2(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/heartbeat': 1.2.1 @@ -47349,7 +47039,7 @@ snapshots: dependencies: tslib: 1.14.1 - '@walletconnect/ethereum-provider@2.17.3(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': + '@walletconnect/ethereum-provider@2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) '@walletconnect/jsonrpc-provider': 1.0.14 @@ -47357,10 +47047,10 @@ snapshots: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) '@walletconnect/modal': 2.7.0(@types/react@19.0.8)(react@19.0.0) - '@walletconnect/sign-client': 2.17.3(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) - '@walletconnect/types': 2.17.3(ioredis@5.4.2) - '@walletconnect/universal-provider': 2.17.3(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@5.0.10) - '@walletconnect/utils': 2.17.3(ioredis@5.4.2) + '@walletconnect/sign-client': 2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.17.5(ioredis@5.4.2) + '@walletconnect/universal-provider': 2.17.5(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/utils': 2.17.5(ioredis@5.4.2) events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -47387,7 +47077,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/ethereum-provider@2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@6.0.5)': + '@walletconnect/ethereum-provider@2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@6.0.5)': dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) '@walletconnect/jsonrpc-provider': 1.0.14 @@ -47395,9 +47085,9 @@ snapshots: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) '@walletconnect/modal': 2.7.0(@types/react@19.0.8)(react@19.0.0) - '@walletconnect/sign-client': 2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5) + '@walletconnect/sign-client': 2.17.5(bufferutil@4.0.9)(utf-8-validate@6.0.5) '@walletconnect/types': 2.17.5(ioredis@5.4.2) - '@walletconnect/universal-provider': 2.17.5(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@6.0.5) + '@walletconnect/universal-provider': 2.17.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) '@walletconnect/utils': 2.17.5(ioredis@5.4.2) events: 3.3.0 transitivePeerDependencies: @@ -47482,7 +47172,7 @@ snapshots: dependencies: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/safe-json': 1.0.2 - cross-fetch: 3.2.0(encoding@0.1.13) + cross-fetch: 3.1.8(encoding@0.1.13) events: 3.3.0 transitivePeerDependencies: - encoding @@ -47647,16 +47337,16 @@ snapshots: dependencies: tslib: 1.14.1 - '@walletconnect/sign-client@2.17.3(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': + '@walletconnect/sign-client@2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': dependencies: - '@walletconnect/core': 2.17.3(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/core': 2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.1.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.3(ioredis@5.4.2) - '@walletconnect/utils': 2.17.3(ioredis@5.4.2) + '@walletconnect/types': 2.17.5(ioredis@5.4.2) + '@walletconnect/utils': 2.17.5(ioredis@5.4.2) events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -47713,16 +47403,16 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/sign-client@2.9.2(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': + '@walletconnect/sign-client@2.17.5(bufferutil@4.0.9)(utf-8-validate@6.0.5)': dependencies: - '@walletconnect/core': 2.9.2(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/core': 2.17.5(bufferutil@4.0.9)(utf-8-validate@6.0.5) '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.1.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.9.2(ioredis@5.4.2) - '@walletconnect/utils': 2.9.2(ioredis@5.4.2) + '@walletconnect/types': 2.17.5(ioredis@5.4.2) + '@walletconnect/utils': 2.17.5(ioredis@5.4.2) events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -47746,17 +47436,16 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/time@1.0.2': - dependencies: - tslib: 1.14.1 - - '@walletconnect/types@2.17.3(ioredis@5.4.2)': + '@walletconnect/sign-client@2.9.2(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': dependencies: + '@walletconnect/core': 2.9.2(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.2 - '@walletconnect/jsonrpc-types': 1.0.4 - '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.1.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.9.2(ioredis@5.4.2) + '@walletconnect/utils': 2.9.2(ioredis@5.4.2) events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -47774,9 +47463,15 @@ snapshots: - '@vercel/blob' - '@vercel/kv' - aws4fetch + - bufferutil - db0 - ioredis - uploadthing + - utf-8-validate + + '@walletconnect/time@1.0.2': + dependencies: + tslib: 1.14.1 '@walletconnect/types@2.17.5(ioredis@5.4.2)': dependencies: @@ -47834,7 +47529,7 @@ snapshots: - ioredis - uploadthing - '@walletconnect/universal-provider@2.17.3(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@5.0.10)': + '@walletconnect/universal-provider@2.17.5(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) @@ -47843,9 +47538,9 @@ snapshots: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) '@walletconnect/logger': 2.1.2 - '@walletconnect/sign-client': 2.17.3(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) - '@walletconnect/types': 2.17.3(ioredis@5.4.2) - '@walletconnect/utils': 2.17.3(ioredis@5.4.2) + '@walletconnect/sign-client': 2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/types': 2.17.5(ioredis@5.4.2) + '@walletconnect/utils': 2.17.5(ioredis@5.4.2) events: 3.3.0 lodash: 4.17.21 transitivePeerDependencies: @@ -47871,7 +47566,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/universal-provider@2.17.5(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@6.0.5)': + '@walletconnect/universal-provider@2.17.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5)': dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) @@ -47880,7 +47575,7 @@ snapshots: '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) '@walletconnect/logger': 2.1.2 - '@walletconnect/sign-client': 2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5) + '@walletconnect/sign-client': 2.17.5(bufferutil@4.0.9)(utf-8-validate@6.0.5) '@walletconnect/types': 2.17.5(ioredis@5.4.2) '@walletconnect/utils': 2.17.5(ioredis@5.4.2) events: 3.3.0 @@ -47942,48 +47637,6 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/utils@2.17.3(ioredis@5.4.2)': - dependencies: - '@ethersproject/hash': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.2) - '@walletconnect/relay-api': 1.0.11 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.3(ioredis@5.4.2) - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - elliptic: 6.6.1 - query-string: 7.1.3 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@deno/kv' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/blob' - - '@vercel/kv' - - aws4fetch - - db0 - - ioredis - - uploadthing - '@walletconnect/utils@2.17.5(ioredis@5.4.2)': dependencies: '@ethersproject/hash': 5.7.0 @@ -48423,16 +48076,17 @@ snapshots: typescript: 5.7.3 zod: 3.23.8 + abitype@1.0.8(typescript@5.7.3)(zod@3.24.1): + optionalDependencies: + typescript: 5.7.3 + zod: 3.24.1 + abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 abortcontroller-polyfill@1.7.8: {} - abs@1.3.14: - dependencies: - ul: 5.2.15 - accepts@1.3.8: dependencies: mime-types: 2.1.35 @@ -48527,13 +48181,13 @@ snapshots: - typescript - utf-8-validate - ai@3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.3))(svelte@5.19.3)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8): + ai@3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.4))(svelte@5.19.4)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8): dependencies: '@ai-sdk/provider': 1.0.6 '@ai-sdk/provider-utils': 2.1.2(zod@3.23.8) '@ai-sdk/react': 0.0.70(react@19.0.0)(zod@3.23.8) '@ai-sdk/solid': 0.0.54(zod@3.23.8) - '@ai-sdk/svelte': 0.0.57(svelte@5.19.3)(zod@3.23.8) + '@ai-sdk/svelte': 0.0.57(svelte@5.19.4)(zod@3.23.8) '@ai-sdk/ui-utils': 0.0.50(zod@3.23.8) '@ai-sdk/vue': 0.0.59(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) '@opentelemetry/api': 1.9.0 @@ -48545,14 +48199,14 @@ snapshots: optionalDependencies: openai: 4.73.0(encoding@0.1.13)(zod@3.23.8) react: 19.0.0 - sswr: 2.1.0(svelte@5.19.3) - svelte: 5.19.3 + sswr: 2.1.0(svelte@5.19.4) + svelte: 5.19.4 zod: 3.23.8 transitivePeerDependencies: - solid-js - vue - ai@4.1.9(react@19.0.0)(zod@3.23.8): + ai@4.1.10(react@19.0.0)(zod@3.23.8): dependencies: '@ai-sdk/provider': 1.0.6 '@ai-sdk/provider-utils': 2.1.2(zod@3.23.8) @@ -48564,7 +48218,7 @@ snapshots: react: 19.0.0 zod: 3.23.8 - ai@4.1.9(react@19.0.0)(zod@3.24.1): + ai@4.1.10(react@19.0.0)(zod@3.24.1): dependencies: '@ai-sdk/provider': 1.0.6 '@ai-sdk/provider-utils': 2.1.2(zod@3.24.1) @@ -48611,7 +48265,7 @@ snapshots: algo-msgpack-with-bigint@2.1.1: {} - algoliasearch-helper@3.23.1(algoliasearch@5.20.0): + algoliasearch-helper@3.24.1(algoliasearch@5.20.0): dependencies: '@algolia/events': 4.0.1 algoliasearch: 5.20.0 @@ -49430,7 +49084,7 @@ snapshots: bare-stream@2.6.4(bare-events@2.5.4): dependencies: - streamx: 2.21.1 + streamx: 2.22.0 optionalDependencies: bare-events: 2.5.4 optional: true @@ -50155,8 +49809,6 @@ snapshots: transitivePeerDependencies: - debug - capture-stack-trace@1.0.2: {} - cardinal@2.1.1: dependencies: ansicolors: 0.3.2 @@ -50183,12 +49835,12 @@ snapshots: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.2 + loupe: 3.1.3 pathval: 2.0.0 - chain-registry@1.69.107: + chain-registry@1.69.108: dependencies: - '@chain-registry/types': 0.50.57 + '@chain-registry/types': 0.50.58 chalk@1.1.3: dependencies: @@ -50935,10 +50587,6 @@ snapshots: bn.js: 4.12.1 elliptic: 6.6.1 - create-error-class@3.0.2: - dependencies: - capture-stack-trace: 1.0.2 - create-hash@1.2.0: dependencies: cipher-base: 1.0.6 @@ -51666,10 +51314,6 @@ snapshots: defer-to-connect@2.0.1: {} - deffy@2.2.4: - dependencies: - typpy: 2.3.13 - define-data-property@1.1.4: dependencies: es-define-property: 1.0.1 @@ -52236,10 +51880,6 @@ snapshots: err-code@2.0.3: {} - err@1.1.1: - dependencies: - typpy: 2.3.13 - error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 @@ -53239,11 +52879,6 @@ snapshots: md5.js: 1.3.5 safe-buffer: 5.2.1 - exec-limiter@3.2.13: - dependencies: - limit-it: 3.2.10 - typpy: 2.3.13 - execa@5.0.0: dependencies: cross-spawn: 7.0.6 @@ -53373,7 +53008,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.4.0(supports-color@8.1.1) + debug: 4.3.4 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -53922,10 +53557,6 @@ snapshots: function-timeout@1.0.2: {} - function.name@1.0.13: - dependencies: - noop6: 1.0.9 - function.prototype.name@1.1.8: dependencies: call-bind: 1.0.8 @@ -54099,18 +53730,6 @@ snapshots: optionalDependencies: js-git: 0.7.8 - git-package-json@1.4.10: - dependencies: - deffy: 2.2.4 - err: 1.1.1 - gry: 5.0.8 - normalize-package-data: 2.5.0 - oargv: 3.4.10 - one-by-one: 3.2.8 - r-json: 1.3.0 - r-package-json: 1.0.9 - tmp: 0.0.28 - git-raw-commits@2.0.11: dependencies: dargs: 7.0.0 @@ -54137,15 +53756,6 @@ snapshots: git-sha1@0.1.2: {} - git-source@1.1.10: - dependencies: - git-url-parse: 5.0.1 - - git-up@1.2.1: - dependencies: - is-ssh: 1.4.0 - parse-url: 1.3.11 - git-up@7.0.0: dependencies: is-ssh: 1.4.0 @@ -54155,10 +53765,6 @@ snapshots: dependencies: git-up: 7.0.0 - git-url-parse@5.0.1: - dependencies: - git-up: 1.2.1 - gitconfiglocal@1.0.0: dependencies: ini: 1.3.8 @@ -54347,26 +53953,6 @@ snapshots: p-cancelable: 3.0.0 responselike: 3.0.0 - got@5.7.1: - dependencies: - '@types/keyv': 3.1.4 - '@types/responselike': 1.0.3 - create-error-class: 3.0.2 - duplexer2: 0.1.4 - is-redirect: 1.0.0 - is-retry-allowed: 1.2.0 - is-stream: 1.1.0 - lowercase-keys: 1.0.1 - node-status-codes: 1.0.0 - object-assign: 4.1.1 - parse-json: 2.2.0 - pinkie-promise: 2.0.1 - read-all-stream: 3.1.0 - readable-stream: 2.3.8 - timed-out: 3.1.3 - unzip-response: 1.0.2 - url-parse-lax: 1.0.0 - gql.tada@1.8.10(graphql@16.10.0)(typescript@5.7.3): dependencies: '@0no-co/graphql.web': 1.0.13(graphql@16.10.0) @@ -54441,13 +54027,6 @@ snapshots: transitivePeerDependencies: - encoding - gry@5.0.8: - dependencies: - abs: 1.3.14 - exec-limiter: 3.2.13 - one-by-one: 3.2.8 - ul: 5.2.15 - gtoken@7.1.0(encoding@0.1.13): dependencies: gaxios: 6.7.1(encoding@0.1.13) @@ -55576,8 +55155,6 @@ snapshots: is-property@1.0.2: {} - is-redirect@1.0.0: {} - is-reference@1.2.1: dependencies: '@types/estree': 1.0.6 @@ -55595,8 +55172,6 @@ snapshots: is-regexp@1.0.0: {} - is-retry-allowed@1.2.0: {} - is-retry-allowed@2.2.0: {} is-root@2.1.0: {} @@ -55782,8 +55357,6 @@ snapshots: iterare@1.2.1: {} - iterate-object@1.3.4: {} - iterator.prototype@1.1.5: dependencies: define-data-property: 1.1.4 @@ -56634,18 +56207,6 @@ snapshots: - ts-node - utf-8-validate - jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - '@jest/types': 29.6.3 - import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): dependencies: '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) @@ -57109,7 +56670,7 @@ snapshots: inherits: 2.0.4 stream-splicer: 2.0.1 - langchain@0.3.13(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)): + langchain@0.3.14(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)): dependencies: '@langchain/core': 0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)) '@langchain/openai': 0.3.17(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) @@ -57478,10 +57039,6 @@ snapshots: lilconfig@3.1.3: {} - limit-it@3.2.10: - dependencies: - typpy: 2.3.13 - lines-and-columns@1.2.4: {} lines-and-columns@2.0.3: {} @@ -57714,7 +57271,7 @@ snapshots: dependencies: get-func-name: 2.0.2 - loupe@3.1.2: {} + loupe@3.1.3: {} lowdb@7.0.1: dependencies: @@ -57724,8 +57281,6 @@ snapshots: dependencies: tslib: 2.8.1 - lowercase-keys@1.0.1: {} - lowercase-keys@2.0.0: {} lowercase-keys@3.0.0: {} @@ -59217,8 +58772,6 @@ snapshots: node-releases@2.0.19: {} - node-status-codes@1.0.0: {} - nodejs-whisper@0.1.18: dependencies: readline-sync: 1.4.10 @@ -59244,8 +58797,6 @@ snapshots: inherits: 2.0.4 readable-stream: 1.0.34 - noop6@1.0.9: {} - nopt@1.0.10: dependencies: abbrev: 1.1.1 @@ -59452,17 +59003,8 @@ snapshots: dependencies: capability: 0.2.5 - oargv@3.4.10: - dependencies: - iterate-object: 1.3.4 - ul: 5.2.15 - oauth-sign@0.9.0: {} - obj-def@1.0.9: - dependencies: - deffy: 2.2.4 - object-assign@4.1.1: {} object-hash@3.0.0: {} @@ -59570,11 +59112,6 @@ snapshots: dependencies: wrappy: 1.0.2 - one-by-one@3.2.8: - dependencies: - obj-def: 1.0.9 - sliced: 1.0.1 - onetime@1.1.0: {} onetime@5.1.2: @@ -59822,20 +59359,6 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 - ox@0.4.2(typescript@5.7.3)(zod@3.24.1): - dependencies: - '@adraffy/ens-normalize': 1.11.0 - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 - '@scure/bip32': 1.6.2 - '@scure/bip39': 1.5.4 - abitype: 1.0.7(typescript@5.7.3)(zod@3.24.1) - eventemitter3: 5.0.1 - optionalDependencies: - typescript: 5.7.3 - transitivePeerDependencies: - - zod - ox@0.4.4(typescript@4.9.5)(zod@3.24.1): dependencies: '@adraffy/ens-normalize': 1.11.0 @@ -59892,6 +59415,20 @@ snapshots: transitivePeerDependencies: - zod + ox@0.6.9(typescript@5.7.3)(zod@3.24.1): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.24.1) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - zod + p-cancelable@2.1.1: {} p-cancelable@3.0.0: {} @@ -59998,17 +59535,6 @@ snapshots: package-json-from-dist@1.0.1: {} - package-json-path@1.0.9: - dependencies: - abs: 1.3.14 - - package-json@2.4.0: - dependencies: - got: 5.7.1 - registry-auth-token: 3.4.0 - registry-url: 3.1.0 - semver: 5.7.2 - package-json@8.1.1: dependencies: got: 12.6.1 @@ -60018,12 +59544,6 @@ snapshots: package-manager-detector@0.2.8: {} - package.json@2.0.1: - dependencies: - git-package-json: 1.4.10 - git-source: 1.1.10 - package-json: 2.4.0 - pacote@18.0.6: dependencies: '@npmcli/git': 5.0.8 @@ -60095,10 +59615,6 @@ snapshots: parse-headers@2.0.5: {} - parse-json@2.2.0: - dependencies: - error-ex: 1.3.2 - parse-json@4.0.0: dependencies: error-ex: 1.3.2 @@ -60123,11 +59639,6 @@ snapshots: dependencies: protocols: 2.0.1 - parse-url@1.3.11: - dependencies: - is-ssh: 1.4.0 - protocols: 1.4.8 - parse-url@8.1.0: dependencies: parse-path: 7.0.0 @@ -60340,12 +59851,6 @@ snapshots: pify@5.0.0: {} - pinkie-promise@2.0.1: - dependencies: - pinkie: 2.0.4 - - pinkie@2.0.4: {} - pino-abstract-transport@0.5.0: dependencies: duplexify: 4.1.3 @@ -61251,8 +60756,6 @@ snapshots: prelude-ls@1.2.1: {} - prepend-http@1.0.4: {} - prettier@2.8.8: {} prettier@3.4.1: {} @@ -61298,9 +60801,9 @@ snapshots: extend-shallow: 2.0.1 js-beautify: 1.15.1 - prism-media@1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13))(ffmpeg-static@5.2.0): + prism-media@1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13))(ffmpeg-static@5.2.0): optionalDependencies: - '@discordjs/opus': https://codeload.github.com/discordjs/opus/tar.gz/8c727579cd81831f6e866f8d82781b4bfa5f4063(encoding@0.1.13) + '@discordjs/opus': https://codeload.github.com/discordjs/opus/tar.gz/679ff3f58e6804b80becc166c7214deb2ca026e2(encoding@0.1.13) ffmpeg-static: 5.2.0 prism-react-renderer@2.3.1(react@18.3.1): @@ -61409,8 +60912,6 @@ snapshots: '@types/node': 20.17.9 long: 5.2.4 - protocols@1.4.8: {} - protocols@2.0.1: {} proxy-addr@2.0.7: @@ -61674,8 +61175,6 @@ snapshots: queue-microtask@1.2.3: {} - queue-tick@1.0.1: {} - queue@6.0.2: dependencies: inherits: 2.0.4 @@ -61686,15 +61185,6 @@ snapshots: quick-lru@5.1.1: {} - r-json@1.3.0: - dependencies: - w-json: 1.3.10 - - r-package-json@1.0.9: - dependencies: - package-json-path: 1.0.9 - r-json: 1.3.0 - radix3@1.1.2: {} ramda@0.30.1: {} @@ -61917,11 +61407,6 @@ snapshots: react@19.0.0: {} - read-all-stream@3.1.0: - dependencies: - pinkie-promise: 2.0.1 - readable-stream: 2.3.8 - read-cache@1.0.0: dependencies: pify: 2.3.0 @@ -62173,19 +61658,10 @@ snapshots: unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.2.0 - registry-auth-token@3.4.0: - dependencies: - rc: 1.2.8 - safe-buffer: 5.2.1 - registry-auth-token@5.0.3: dependencies: '@pnpm/npm-conf': 2.3.1 - registry-url@3.1.0: - dependencies: - rc: 1.2.8 - registry-url@6.0.1: dependencies: rc: 1.2.8 @@ -63095,8 +62571,6 @@ snapshots: ansi-styles: 6.2.1 is-fullwidth-code-point: 5.0.0 - sliced@1.0.1: {} - slide@1.1.6: {} smart-buffer@4.2.0: {} @@ -63196,12 +62670,12 @@ snapshots: '@drift-labs/vaults-sdk': 0.2.68(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(arweave@1.15.5)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(utf-8-validate@5.0.10) '@langchain/core': 0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)) '@langchain/groq': 0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) - '@langchain/langgraph': 0.2.41(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))) + '@langchain/langgraph': 0.2.42(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))) '@langchain/openai': 0.3.17(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@lightprotocol/compressed-token': 0.17.1(@lightprotocol/stateless.js@0.17.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) '@lightprotocol/stateless.js': 0.17.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@mercurial-finance/dynamic-amm-sdk': 1.1.23(@solana/buffer-layout@4.0.1)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) - '@metaplex-foundation/digital-asset-standard-api': 1.0.4(@metaplex-foundation/umi@0.9.2) + '@metaplex-foundation/digital-asset-standard-api': 1.0.5(@metaplex-foundation/umi@0.9.2) '@metaplex-foundation/mpl-core': 1.2.0(@metaplex-foundation/umi@0.9.2)(@noble/hashes@1.7.1) '@metaplex-foundation/mpl-token-metadata': 3.3.0(@metaplex-foundation/umi@0.9.2) '@metaplex-foundation/mpl-toolbox': 0.9.4(@metaplex-foundation/umi@0.9.2) @@ -63220,8 +62694,8 @@ snapshots: '@sqds/multisig': 2.1.3(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) '@tensor-oss/tensorswap-sdk': 4.5.0(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) '@tiplink/api': 0.3.1(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(sodium-native@3.4.1)(utf-8-validate@5.0.10) - '@voltr/vault-sdk': 0.1.3(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) - ai: 4.1.9(react@19.0.0)(zod@3.24.1) + '@voltr/vault-sdk': 0.1.4(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) + ai: 4.1.10(react@19.0.0)(zod@3.24.1) bn.js: 5.2.1 bs58: 5.0.0 chai: 5.1.2 @@ -63229,7 +62703,7 @@ snapshots: dotenv: 16.4.7 flash-sdk: 2.26.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) form-data: 4.0.1 - langchain: 0.3.13(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + langchain: 0.3.14(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) openai: 4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1) typedoc: 0.27.6(typescript@5.6.3) zod: 3.24.1 @@ -63238,6 +62712,7 @@ snapshots: - '@langchain/aws' - '@langchain/cerebras' - '@langchain/cohere' + - '@langchain/deepseek' - '@langchain/google-genai' - '@langchain/google-vertexai' - '@langchain/google-vertexai-web' @@ -63278,12 +62753,12 @@ snapshots: '@drift-labs/vaults-sdk': 0.2.68(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@22.12.0)(arweave@1.15.5)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(utf-8-validate@5.0.10) '@langchain/core': 0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)) '@langchain/groq': 0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) - '@langchain/langgraph': 0.2.41(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))) + '@langchain/langgraph': 0.2.42(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))) '@langchain/openai': 0.3.17(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@lightprotocol/compressed-token': 0.17.1(@lightprotocol/stateless.js@0.17.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) '@lightprotocol/stateless.js': 0.17.1(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@mercurial-finance/dynamic-amm-sdk': 1.1.23(@solana/buffer-layout@4.0.1)(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) - '@metaplex-foundation/digital-asset-standard-api': 1.0.4(@metaplex-foundation/umi@0.9.2) + '@metaplex-foundation/digital-asset-standard-api': 1.0.5(@metaplex-foundation/umi@0.9.2) '@metaplex-foundation/mpl-core': 1.2.0(@metaplex-foundation/umi@0.9.2)(@noble/hashes@1.7.1) '@metaplex-foundation/mpl-token-metadata': 3.3.0(@metaplex-foundation/umi@0.9.2) '@metaplex-foundation/mpl-toolbox': 0.9.4(@metaplex-foundation/umi@0.9.2) @@ -63302,8 +62777,8 @@ snapshots: '@sqds/multisig': 2.1.3(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) '@tensor-oss/tensorswap-sdk': 4.5.0(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) '@tiplink/api': 0.3.1(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(sodium-native@3.4.1)(utf-8-validate@5.0.10) - '@voltr/vault-sdk': 0.1.3(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) - ai: 4.1.9(react@19.0.0)(zod@3.24.1) + '@voltr/vault-sdk': 0.1.4(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) + ai: 4.1.10(react@19.0.0)(zod@3.24.1) bn.js: 5.2.1 bs58: 5.0.0 chai: 5.1.2 @@ -63311,7 +62786,7 @@ snapshots: dotenv: 16.4.7 flash-sdk: 2.26.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) form-data: 4.0.1 - langchain: 0.3.13(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + langchain: 0.3.14(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(@langchain/groq@0.1.3(@langchain/core@0.3.36(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1)))(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)))(axios@1.7.9)(encoding@0.1.13)(handlebars@4.7.8)(openai@4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1))(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) openai: 4.80.1(encoding@0.1.13)(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.24.1) typedoc: 0.27.6(typescript@5.7.3) zod: 3.24.1 @@ -63320,6 +62795,7 @@ snapshots: - '@langchain/aws' - '@langchain/cerebras' - '@langchain/cohere' + - '@langchain/deepseek' - '@langchain/google-genai' - '@langchain/google-vertexai' - '@langchain/google-vertexai-web' @@ -63578,9 +63054,9 @@ snapshots: dependencies: minipass: 7.1.2 - sswr@2.1.0(svelte@5.19.3): + sswr@2.1.0(svelte@5.19.4): dependencies: - svelte: 5.19.3 + svelte: 5.19.4 swrev: 4.0.0 stable-hash@0.0.4: {} @@ -63693,10 +63169,9 @@ snapshots: streamsearch@1.1.0: {} - streamx@2.21.1: + streamx@2.22.0: dependencies: fast-fifo: 1.3.2 - queue-tick: 1.0.1 text-decoder: 1.2.3 optionalDependencies: bare-events: 2.5.4 @@ -63935,7 +63410,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte@5.19.3: + svelte@5.19.4: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0 @@ -64113,7 +63588,7 @@ snapshots: dependencies: b4a: 1.6.7 fast-fifo: 1.3.2 - streamx: 2.21.1 + streamx: 2.22.0 tar@4.4.19: dependencies: @@ -64246,28 +63721,28 @@ snapshots: dependencies: any-promise: 1.3.0 - thirdweb@5.86.6(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1): + thirdweb@5.87.0(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.5(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1): dependencies: '@coinbase/wallet-sdk': 4.2.4 '@emotion/react': 11.14.0(@types/react@19.0.8)(react@19.0.0) '@emotion/styled': 11.14.0(@emotion/react@11.14.0(@types/react@19.0.8)(react@19.0.0))(@types/react@19.0.8)(react@19.0.0) '@google/model-viewer': 2.1.1 - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 '@passwordless-id/webauthn': 2.1.2 - '@radix-ui/react-dialog': 1.1.4(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@radix-ui/react-dialog': 1.1.5(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@radix-ui/react-focus-scope': 1.1.1(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@radix-ui/react-icons': 1.3.2(react@19.0.0) - '@radix-ui/react-tooltip': 1.1.5(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) - '@tanstack/react-query': 5.62.16(react@19.0.0) - '@walletconnect/ethereum-provider': 2.17.3(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) - '@walletconnect/sign-client': 2.17.3(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) - abitype: 1.0.7(typescript@5.7.3)(zod@3.24.1) + '@radix-ui/react-tooltip': 1.1.7(@types/react-dom@19.0.3(@types/react@19.0.8))(@types/react@19.0.8)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@tanstack/react-query': 5.65.0(react@19.0.0) + '@walletconnect/ethereum-provider': 2.17.5(@types/react@19.0.8)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) + '@walletconnect/sign-client': 2.17.5(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + abitype: 1.0.8(typescript@5.7.3)(zod@3.24.1) cross-spawn: 7.0.6 fuse.js: 7.0.0 input-otp: 1.4.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0) mipd: 0.0.7(typescript@5.7.3) - ox: 0.4.2(typescript@5.7.3)(zod@3.24.1) + ox: 0.6.9(typescript@5.7.3)(zod@3.24.1) uqr: 0.1.2 viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) optionalDependencies: @@ -64334,8 +63809,6 @@ snapshots: dependencies: convert-hrtime: 5.0.0 - timed-out@3.1.3: {} - timed-out@4.0.1: {} timers-browserify@1.4.2: @@ -64409,10 +63882,6 @@ snapshots: tmp: 0.2.3 optional: true - tmp@0.0.28: - dependencies: - os-tmpdir: 1.0.2 - tmp@0.0.33: dependencies: os-tmpdir: 1.0.2 @@ -64591,7 +64060,7 @@ snapshots: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0) + jest: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.11(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -65211,10 +64680,6 @@ snapshots: typescript@5.7.3: {} - typpy@2.3.13: - dependencies: - function.name: 1.0.13 - u3@0.1.1: {} uc.micro@2.1.0: {} @@ -65241,11 +64706,6 @@ snapshots: dependencies: multiformats: 9.9.0 - ul@5.2.15: - dependencies: - deffy: 2.2.4 - typpy: 2.3.13 - ultron@1.1.1: {} umd@3.0.3: {} @@ -65495,8 +64955,6 @@ snapshots: transitivePeerDependencies: - supports-color - unzip-response@1.0.2: {} - unzipper@0.12.3: dependencies: bluebird: 3.7.2 @@ -65547,10 +65005,6 @@ snapshots: optionalDependencies: file-loader: 6.2.0(webpack@5.97.1(@swc/core@1.10.11(@swc/helpers@0.5.15))) - url-parse-lax@1.0.0: - dependencies: - prepend-http: 1.0.4 - url-parse@1.5.10: dependencies: querystringify: 2.2.0 @@ -66865,8 +66319,6 @@ snapshots: optionalDependencies: typescript: 5.6.3 - w-json@1.3.10: {} - w3c-hr-time@1.0.2: dependencies: browser-process-hrtime: 1.0.0 diff --git a/scripts/update-package-access.js b/scripts/update-package-access.js new file mode 100644 index 00000000000..7f52847da0c --- /dev/null +++ b/scripts/update-package-access.js @@ -0,0 +1,25 @@ +const fs = require('fs'); +const path = require('path'); +const glob = require('glob'); +const { execSync } = require('child_process'); + +const packages = glob.sync('packages/*/package.json'); + +packages.forEach((packageJsonPath) => { + const packageJson = require(path.resolve(packageJsonPath)); + + if (packageJson.name.startsWith('@elizaos/') && !packageJson.private && !packageJson.publishConfig) { + packageJson.publishConfig = { access: 'public' }; + + fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); + console.log(`Updated: ${packageJson.name}`); + + // Format the file using npx Prettier + try { + execSync(`npx prettier --write ${packageJsonPath}`, { stdio: 'inherit' }); + console.log(`Formatted: ${packageJsonPath}`); + } catch (error) { + console.error(`Error formatting file: ${packageJsonPath}`, error.message); + } + } +});