From ba09600cdc5def5f2e2de561f6cd43c3c69da850 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 12:57:51 +0800 Subject: [PATCH 01/39] feat: Add @elizaos/plugin-di package with initial implementation - Created a new plugin package `@elizaos/plugin-di` to extend the Eliza platform. - Added essential files including `package.json`, `README.md`, and TypeScript configuration. - Implemented core functionalities such as dependency injection using Inversify, action handling, and content evaluation. - Introduced decorators for content properties and Zod schema integration. - Included sample actions and evaluators to demonstrate plugin capabilities. - Configured build and linting scripts for development workflow. --- packages/plugin-di/.npmignore | 6 + packages/plugin-di/README.md | 39 ++ packages/plugin-di/eslint.config.mjs | 3 + packages/plugin-di/package.json | 40 +++ packages/plugin-di/src/actions/index.ts | 0 .../plugin-di/src/actions/sampleAction.ts | 111 ++++++ .../src/decorators/content.decorators.ts | 62 ++++ packages/plugin-di/src/decorators/index.ts | 1 + packages/plugin-di/src/di.ts | 15 + packages/plugin-di/src/evaluators/index.ts | 0 .../src/evaluators/sampleEvalutor.ts | 53 +++ packages/plugin-di/src/factories/charactor.ts | 46 +++ packages/plugin-di/src/factories/index.ts | 2 + packages/plugin-di/src/factories/plugin.ts | 69 ++++ packages/plugin-di/src/index.ts | 10 + packages/plugin-di/src/providers/index.ts | 0 .../plugin-di/src/providers/sampleProvider.ts | 14 + packages/plugin-di/src/symbols.ts | 6 + packages/plugin-di/src/templates.ts | 90 +++++ packages/plugin-di/src/types.ts | 103 ++++++ packages/plugin-di/tsconfig.json | 13 + packages/plugin-di/tsup.config.ts | 19 + pnpm-lock.yaml | 332 ++++++++++++++---- 23 files changed, 964 insertions(+), 70 deletions(-) create mode 100644 packages/plugin-di/.npmignore create mode 100644 packages/plugin-di/README.md create mode 100644 packages/plugin-di/eslint.config.mjs create mode 100644 packages/plugin-di/package.json create mode 100644 packages/plugin-di/src/actions/index.ts create mode 100644 packages/plugin-di/src/actions/sampleAction.ts create mode 100644 packages/plugin-di/src/decorators/content.decorators.ts create mode 100644 packages/plugin-di/src/decorators/index.ts create mode 100644 packages/plugin-di/src/di.ts create mode 100644 packages/plugin-di/src/evaluators/index.ts create mode 100644 packages/plugin-di/src/evaluators/sampleEvalutor.ts create mode 100644 packages/plugin-di/src/factories/charactor.ts create mode 100644 packages/plugin-di/src/factories/index.ts create mode 100644 packages/plugin-di/src/factories/plugin.ts create mode 100644 packages/plugin-di/src/index.ts create mode 100644 packages/plugin-di/src/providers/index.ts create mode 100644 packages/plugin-di/src/providers/sampleProvider.ts create mode 100644 packages/plugin-di/src/symbols.ts create mode 100644 packages/plugin-di/src/templates.ts create mode 100644 packages/plugin-di/src/types.ts create mode 100644 packages/plugin-di/tsconfig.json create mode 100644 packages/plugin-di/tsup.config.ts diff --git a/packages/plugin-di/.npmignore b/packages/plugin-di/.npmignore new file mode 100644 index 00000000000..078562eceab --- /dev/null +++ b/packages/plugin-di/.npmignore @@ -0,0 +1,6 @@ +* + +!dist/** +!package.json +!readme.md +!tsup.config.ts \ No newline at end of file diff --git a/packages/plugin-di/README.md b/packages/plugin-di/README.md new file mode 100644 index 00000000000..3d396d51a84 --- /dev/null +++ b/packages/plugin-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/plugin-di/eslint.config.mjs b/packages/plugin-di/eslint.config.mjs new file mode 100644 index 00000000000..92fe5bbebef --- /dev/null +++ b/packages/plugin-di/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.config.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-di/package.json b/packages/plugin-di/package.json new file mode 100644 index 00000000000..0058ada02dc --- /dev/null +++ b/packages/plugin-di/package.json @@ -0,0 +1,40 @@ +{ + "name": "@elizaos/plugin-di", + "version": "0.1.7", + "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:*", + "inversify": "^6.2.1", + "reflect-metadata": "^0.2.2", + "uuid": "11.0.3", + "zod": "^3.24.1" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "@types/uuid": "10.0.0", + "tsup": "8.3.5", + "vitest": "2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --format esm --dts --watch", + "lint": "eslint --fix --cache .", + "test": "vitest run" + } +} diff --git a/packages/plugin-di/src/actions/index.ts b/packages/plugin-di/src/actions/index.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/plugin-di/src/actions/sampleAction.ts b/packages/plugin-di/src/actions/sampleAction.ts new file mode 100644 index 00000000000..7f835dac0a5 --- /dev/null +++ b/packages/plugin-di/src/actions/sampleAction.ts @@ -0,0 +1,111 @@ +import { + Action, + IAgentRuntime, + Memory, + HandlerCallback, + State, + composeContext, + generateObject, + ModelClass, + elizaLogger, +} from "@elizaos/core"; + +import { CreateResourceSchema, isCreateResourceContent } from "../types"; + +import { createResourceTemplate } from "../templates"; + +export const createResourceAction: Action = { + name: "CREATE_RESOURCE", + description: "Create a new resource with the specified details", + validate: async (runtime: IAgentRuntime, _message: Memory) => { + return !!runtime.character.settings.secrets?.API_KEY; + }, + handler: async ( + runtime: IAgentRuntime, + _message: Memory, + state: State, + _options: any, + callback: HandlerCallback + ) => { + try { + const context = composeContext({ + state, + template: createResourceTemplate, + }); + + const resourceDetails = await generateObject({ + runtime, + context, + modelClass: ModelClass.SMALL, + schema: CreateResourceSchema, + }); + + if (!isCreateResourceContent(resourceDetails.object)) { + callback({ text: "Invalid resource details provided." }, []); + return; + } + + // persist relevant data if needed to memory/knowledge + // const memory = { + // type: "resource", + // content: resourceDetails.object, + // timestamp: new Date().toISOString() + // }; + + // await runtime.storeMemory(memory); + + callback( + { + text: `Resource created successfully: +- Name: ${resourceDetails.object.name} +- Type: ${resourceDetails.object.type} +- Description: ${resourceDetails.object.description} +- Tags: ${resourceDetails.object.tags.join(", ")} + +Resource has been stored in memory.`, + }, + [] + ); + } catch (error) { + elizaLogger.error("Error creating resource:", error); + callback( + { text: "Failed to create resource. Please check the logs." }, + [] + ); + } + }, + examples: [ + [ + { + user: "{{user1}}", + content: { + text: "Create a new resource with the name 'Resource1' and type 'TypeA'", + }, + }, + { + user: "{{agentName}}", + content: { + text: `Resource created successfully: +- Name: Resource1 +- Type: TypeA`, + }, + }, + ], + [ + { + user: "{{user1}}", + content: { + text: "Create a new resource with the name 'Resource2' and type 'TypeB'", + }, + }, + { + user: "{{agentName}}", + content: { + text: `Resource created successfully: +- Name: Resource2 +- Type: TypeB`, + }, + }, + ], + ], +}; diff --git a/packages/plugin-di/src/decorators/content.decorators.ts b/packages/plugin-di/src/decorators/content.decorators.ts new file mode 100644 index 00000000000..6a3d665258c --- /dev/null +++ b/packages/plugin-di/src/decorators/content.decorators.ts @@ -0,0 +1,62 @@ +import "reflect-metadata"; +import { z } from "zod"; +import { ContentPropertyDescription } from "../types"; + +const CONTENT_METADATA_KEY = "content:properties"; + +export type ContentClass = { + new (...args: any[]): T; + prototype: T; +}; + +interface ContentPropertyConfig extends ContentPropertyDescription { + schema: z.ZodType; +} + +export function property(config: ContentPropertyConfig) { + return function (target: any, propertyKey: string) { + const properties = + Reflect.getMetadata(CONTENT_METADATA_KEY, target) || {}; + properties[propertyKey] = config; + Reflect.defineMetadata(CONTENT_METADATA_KEY, properties, target); + }; +} + +/** + * Create a Zod schema from a class decorated with @property + * + * @param constructor + * @returns + */ +export function createZodSchema(constructor: ContentClass): z.ZodType { + const properties: Record = + Reflect.getMetadata(CONTENT_METADATA_KEY, constructor.prototype) || {}; + const schemaProperties = Object.entries(properties).reduce( + (acc, [key, { schema }]) => { + acc[key] = schema; + return acc; + }, + {} as Record> + ); + return z.object(schemaProperties) as unknown as z.ZodType; +} + +/** + * Load the description of each property from a class decorated with @property + * + * @param constructor + * @returns + */ +export function loadPropertyDescriptions( + constructor: ContentClass +): Record { + const properties: Record = + Reflect.getMetadata(CONTENT_METADATA_KEY, constructor.prototype) || {}; + return Object.entries(properties).reduce( + (acc, [key, { description, examples }]) => { + acc[key] = { description, examples }; + return acc; + }, + {} as Record + ); +} diff --git a/packages/plugin-di/src/decorators/index.ts b/packages/plugin-di/src/decorators/index.ts new file mode 100644 index 00000000000..b292753abd6 --- /dev/null +++ b/packages/plugin-di/src/decorators/index.ts @@ -0,0 +1 @@ +export * from "./content.decorators"; diff --git a/packages/plugin-di/src/di.ts b/packages/plugin-di/src/di.ts new file mode 100644 index 00000000000..66bcfe9d177 --- /dev/null +++ b/packages/plugin-di/src/di.ts @@ -0,0 +1,15 @@ +import { Plugin } from "@elizaos/core"; +import { Container, interfaces } from "inversify"; +import { FACTORIES } from "./symbols"; +import { createPlugin } from "./factories"; +import { PluginOptions } from "./types"; + +const globalContainer = new Container(); + +// ----- Bind to factory functions ----- + +globalContainer + .bind>>(FACTORIES.PluginFactory) + .toFactory, [PluginOptions]>(createPlugin); + +export { globalContainer }; diff --git a/packages/plugin-di/src/evaluators/index.ts b/packages/plugin-di/src/evaluators/index.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/plugin-di/src/evaluators/sampleEvalutor.ts b/packages/plugin-di/src/evaluators/sampleEvalutor.ts new file mode 100644 index 00000000000..c6d48b07153 --- /dev/null +++ b/packages/plugin-di/src/evaluators/sampleEvalutor.ts @@ -0,0 +1,53 @@ +import { + Evaluator, + IAgentRuntime, + Memory, + State, + elizaLogger, +} from "@elizaos/core"; + +export const sampleEvaluator: Evaluator = { + alwaysRun: false, + description: "Sample evaluator for checking important content in memory", + similes: ["content checker", "memory evaluator"], + examples: [ + { + context: "Checking if memory contains important content", + messages: [ + { + action: "evaluate", + input: "This is an important message", + output: { + score: 1, + reason: "Memory contains important content.", + }, + }, + ], + outcome: "Memory should be evaluated as important", + }, + ], + handler: async (runtime: IAgentRuntime, memory: Memory, state: State) => { + // Evaluation logic for the evaluator + elizaLogger.log("Evaluating data in sampleEvaluator..."); + + // Example evaluation logic + if (memory.content && memory.content.includes("important")) { + elizaLogger.log("Important content found in memory."); + return { + score: 1, + reason: "Memory contains important content.", + }; + } else { + elizaLogger.log("No important content found in memory."); + return { + score: 0, + reason: "Memory does not contain important content.", + }; + } + }, + name: "sampleEvaluator", + validate: async (runtime: IAgentRuntime, memory: Memory, state: State) => { + // Validation logic for the evaluator + return true; + }, +}; diff --git a/packages/plugin-di/src/factories/charactor.ts b/packages/plugin-di/src/factories/charactor.ts new file mode 100644 index 00000000000..e14cc817676 --- /dev/null +++ b/packages/plugin-di/src/factories/charactor.ts @@ -0,0 +1,46 @@ +import { Character, elizaLogger, Plugin } from "@elizaos/core"; +import { globalContainer } from "../di"; +import { PluginFactory } from "../types"; +import { FACTORIES } from "../symbols"; + +/** + * Normalize a character by creating all plugins from the character's plugin list using the PluginFactory + * @param character + */ +export async function normalizeCharacter( + character: Character +): Promise { + // Use the PluginFactory to import the plugins within the same request for each character + const createPlugin = globalContainer.get( + FACTORIES.PluginFactory + ); + + const normalizePlugin = async (plugin: any) => { + if ( + typeof plugin.name === "string" && + typeof plugin.description === "string" + ) { + try { + const normalized = await createPlugin(plugin); + elizaLogger.info("Normalized plugin:", normalized.name); + return normalized; + } catch (e) { + elizaLogger.error( + `Error normalizing plugin: ${plugin.name}`, + e.message + ); + return undefined; + } + } else { + return undefined; + } + }; + + let plugins: Plugin[] = []; + if (character.plugins?.length > 0) { + plugins = ( + await Promise.all(character.plugins.map(normalizePlugin)) + ).filter((plugin) => plugin !== undefined) as Plugin[]; + } + return Object.assign({}, character, { plugins }) as Character; +} diff --git a/packages/plugin-di/src/factories/index.ts b/packages/plugin-di/src/factories/index.ts new file mode 100644 index 00000000000..b7bed48db93 --- /dev/null +++ b/packages/plugin-di/src/factories/index.ts @@ -0,0 +1,2 @@ +export * from "./plugin"; +export * from "./charactor"; diff --git a/packages/plugin-di/src/factories/plugin.ts b/packages/plugin-di/src/factories/plugin.ts new file mode 100644 index 00000000000..12ae24515c9 --- /dev/null +++ b/packages/plugin-di/src/factories/plugin.ts @@ -0,0 +1,69 @@ +import { interfaces } from "inversify"; +import type { ExtendedPlugin, PluginFactory, PluginOptions } from "../types"; + +/** + * Create a plugin factory + */ +export function createPlugin(ctx: interfaces.Context): PluginFactory { + return async (opts: PluginOptions): Promise => { + // Create a new plugin object + const plugin: ExtendedPlugin = { + name: opts.name, + description: opts.description, + options: opts, + }; + + // Handle actions - if provided, map through them + // For class constructors (functions), get instance from container + // For regular actions, use as-is + if (typeof opts.actions !== "undefined") { + plugin.actions = await Promise.all( + opts.actions.map( + async (action) => + typeof action === "function" + ? await ctx.container.getAsync(action) // Get instance from DI container + : action // Use action directly + ) + ); + } + + // Handle providers - if provided, map through them + // For class constructors (functions), get instance from container + // For regular providers, use as-is + if (typeof opts.providers !== "undefined") { + plugin.providers = await Promise.all( + opts.providers.map(async (provider) => { + if (typeof provider === "function") { + return await ctx.container.getAsync(provider); // Get instance from DI container + } + return provider; // Use provider directly + }) + ); + } + + // Handle evaluators - if provided, map through them + // For class constructors (functions), get instance from container + // For regular evaluators, use as-is + if (typeof opts.evaluators !== "undefined") { + plugin.evaluators = await Promise.all( + opts.evaluators.map( + async (evaluator) => + typeof evaluator === "function" + ? await ctx.container.getAsync(evaluator) // Get instance from DI container + : evaluator // Use evaluator directly + ) + ); + } + + // Handle services - if provided, assign directly + if (typeof opts.services !== "undefined") { + plugin.services = opts.services; + } + + // Handle clients - if provided, assign directly + if (typeof opts.clients !== "undefined") { + plugin.clients = opts.clients; + } + return plugin; + }; +} diff --git a/packages/plugin-di/src/index.ts b/packages/plugin-di/src/index.ts new file mode 100644 index 00000000000..e94878d8937 --- /dev/null +++ b/packages/plugin-di/src/index.ts @@ -0,0 +1,10 @@ +// Export all files for Eliza on Flow +export * as "symbols" from "./symbols"; +export * from "./decorators"; +export * from "./types"; +export * from "./providers"; +export * from "./factories"; +export * from "./templates"; +export * from "./di"; +export * from "./actions"; +export * from "./evaluators"; diff --git a/packages/plugin-di/src/providers/index.ts b/packages/plugin-di/src/providers/index.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/plugin-di/src/providers/sampleProvider.ts b/packages/plugin-di/src/providers/sampleProvider.ts new file mode 100644 index 00000000000..d16f3ba6ddf --- /dev/null +++ b/packages/plugin-di/src/providers/sampleProvider.ts @@ -0,0 +1,14 @@ +import { + Provider, + IAgentRuntime, + Memory, + State, + elizaLogger, +} from "@elizaos/core"; + +export const sampleProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory, state: State) => { + // Data retrieval logic for the provider + elizaLogger.log("Retrieving data in sampleProvider..."); + }, +}; diff --git a/packages/plugin-di/src/symbols.ts b/packages/plugin-di/src/symbols.ts new file mode 100644 index 00000000000..4db415f2901 --- /dev/null +++ b/packages/plugin-di/src/symbols.ts @@ -0,0 +1,6 @@ +/** + * Factory Symbols used in the library + */ +export const FACTORIES = { + PluginFactory: Symbol.for("PluginFactory"), +}; diff --git a/packages/plugin-di/src/templates.ts b/packages/plugin-di/src/templates.ts new file mode 100644 index 00000000000..16e3870323e --- /dev/null +++ b/packages/plugin-di/src/templates.ts @@ -0,0 +1,90 @@ +import { z } from "zod"; +import { ContentPropertyDescription } from "./types"; + +/** + * build the content output template + * @param properties The properties of the content + * @param schema The Zod schema of the content + */ +export function buildContentOutputTemplate( + actionName: string, + actionDesc: string, + properties: Record, + schema: z.ZodType +): string { + let propDesc = ""; + Object.entries(properties).forEach(([key, { description, examples }]) => { + propDesc += `- Field **"${key}"**: ${description}.`; + if (examples.length > 0) { + propDesc += " Examples or Rules for this field:\n"; + } else { + propDesc += "\n"; + } + examples.forEach((example, index) => { + propDesc += ` ${index + 1}. ${example}\n`; + }); + }); + return `Perform the action: "${actionName}". +Action description is "${actionDesc}". + +### TASK: Extract the following details about the requested action + +${propDesc} + +Use null for any values that cannot be determined. + +Respond with a JSON markdown block containing only the extracted values with this structure: + +\`\`\`json +${zodSchemaToJson(schema)} +\`\`\` + +Here are the recent user messages for context: +{{recentMessages}} +`; +} + +/** + * Convert a Zod schema to JSON + * @param schema Zod schema + * @returns JSON string + */ +export function zodSchemaToJson(schema: z.ZodType): string { + if (schema instanceof z.ZodObject) { + const shape = schema.shape; + const properties = Object.entries(shape).map(([key, value]) => { + return `"${key}": ${zodTypeToJson(value as z.ZodType)}`; + }); + return `{\n${properties.join(",\n")}\n}`; + } + return ""; +} + +/** + * Convert a Zod type to JSON + * @param schema Zod type + */ +function zodTypeToJson(schema: z.ZodType): string { + if (schema instanceof z.ZodNullable || schema instanceof z.ZodOptional) { + return `${zodTypeToJson(schema._def.innerType)} | null`; + } + if (schema instanceof z.ZodUnion) { + return schema._def.options.map(zodTypeToJson).join(" | "); + } + if (schema instanceof z.ZodString) { + return "string"; + } + if (schema instanceof z.ZodNumber) { + return "number"; + } + if (schema instanceof z.ZodBoolean) { + return "boolean"; + } + if (schema instanceof z.ZodArray) { + return `${zodTypeToJson(schema._def.type)}[]`; + } + if (schema instanceof z.ZodObject) { + return zodSchemaToJson(schema); + } + return "any"; +} diff --git a/packages/plugin-di/src/types.ts b/packages/plugin-di/src/types.ts new file mode 100644 index 00000000000..bbef95c37e1 --- /dev/null +++ b/packages/plugin-di/src/types.ts @@ -0,0 +1,103 @@ +import { + Action, + Evaluator, + HandlerCallback, + IAgentRuntime, + Memory, + Plugin, + Provider, + State, +} from "@elizaos/core"; + +// ----------- Interfaces for Injectable Providers and Actions, etc ----------- + +/** + * Interface of Injectable Provider + */ +export interface InjectableProvider extends Provider { + /** + * Get the instance of the provider related to Eliza runtime + * @param runtime The runtime object from Eliza framework + */ + getInstance(runtime: IAgentRuntime): Promise; +} + +/** + * The Class of Injectable Provider + */ +export type InjectableProviderClass = new ( + ...args: Args +) => InjectableProvider; + +/** + * Interface of Injectable Action + */ +export interface InjactableAction extends Action { + /** + * Execute the action + * @param content The content from processMessages + * @param callback The callback function to pass the result to Eliza runtime + */ + execute( + content: T, + runtime: IAgentRuntime, + message: Memory, + state?: State, + callback?: HandlerCallback + ): Promise; +} + +/** + * The Class of Injectable Action + */ +export type InjectableActionClass = new ( + ...args: Args +) => InjactableAction; + +/** + * Interface of Injectable Evaluator + */ +export type InjactableEvaluator = Evaluator; + +/** + * The Class of Injectable Evaluator + */ +export type InjectableEvaluatorClass = new ( + ...args: Args +) => InjactableEvaluator; + +// ----------- Interfaces for Plugin ----------- + +/** + * Plugin options + */ +export type PluginOptions = Pick< + Plugin, + "name" | "description" | "services" | "clients" +> & { + /** Optional actions */ + actions?: (Action | InjectableActionClass)[]; + /** Optional providers */ + providers?: (Provider | InjectableProviderClass)[]; + /** Optional evaluators */ + evaluators?: (Evaluator | InjectableEvaluatorClass)[]; +}; + +/** + * Extended plugin interface + */ +export type ExtendedPlugin = Plugin & { + options: PluginOptions; +}; + +/** + * Factory type for creating a plugin + */ +export type PluginFactory = (opts: PluginOptions) => Promise; + +// ----------- Interfaces for Content Properties or actions ----------- + +export interface ContentPropertyDescription { + description: string; + examples?: string[]; +} diff --git a/packages/plugin-di/tsconfig.json b/packages/plugin-di/tsconfig.json new file mode 100644 index 00000000000..abd2932121e --- /dev/null +++ b/packages/plugin-di/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../core/tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "types": [ + "node" + ] + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/packages/plugin-di/tsup.config.ts b/packages/plugin-di/tsup.config.ts new file mode 100644 index 00000000000..ad6d9fa1e6d --- /dev/null +++ b/packages/plugin-di/tsup.config.ts @@ -0,0 +1,19 @@ +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 + "https", + "http", + "agentkeepalive", + "safe-buffer", + // Add other modules you want to externalize + ], +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 68e62a3585f..5228ed37b8c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,7 +78,7 @@ importers: version: 9.1.7 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) + version: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) lerna: specifier: 8.1.5 version: 8.1.5(@swc/core@1.10.4(@swc/helpers@0.5.15))(babel-plugin-macros@3.1.0)(encoding@0.1.13) @@ -90,7 +90,7 @@ importers: version: 3.4.1 ts-jest: specifier: ^29.1.1 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0))(typescript@5.6.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)))(typescript@5.6.3) turbo: specifier: 2.3.3 version: 2.3.3 @@ -253,9 +253,6 @@ importers: '@elizaos/plugin-node': specifier: workspace:* version: link:../packages/plugin-node - '@elizaos/plugin-sgx': - specifier: workspace:* - version: link:../packages/plugin-sgx '@elizaos/plugin-obsidian': specifier: workspace:* version: link:../packages/plugin-obsidian @@ -265,6 +262,9 @@ importers: '@elizaos/plugin-open-weather': specifier: workspace:* version: link:../packages/plugin-open-weather + '@elizaos/plugin-sgx': + specifier: workspace:* + version: link:../packages/plugin-sgx '@elizaos/plugin-solana': specifier: workspace:* version: link:../packages/plugin-solana @@ -1482,6 +1482,37 @@ importers: specifier: 7.1.0 version: 7.1.0 + packages/plugin-di: + dependencies: + '@elizaos/core': + specifier: workspace:* + version: link:../core + inversify: + specifier: ^6.2.1 + version: 6.2.1(reflect-metadata@0.2.2) + reflect-metadata: + specifier: ^0.2.2 + version: 0.2.2 + uuid: + specifier: 11.0.3 + version: 11.0.3 + zod: + specifier: ^3.24.1 + version: 3.24.1 + devDependencies: + '@types/node': + specifier: ^20.0.0 + version: 20.17.9 + '@types/uuid': + specifier: 10.0.0 + version: 10.0.0 + tsup: + specifier: 8.3.5 + version: 8.3.5(@swc/core@1.10.4(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + vitest: + specifier: 2.1.4 + version: 2.1.4(@types/node@20.17.9)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) + packages/plugin-echochambers: dependencies: '@elizaos/core': @@ -2174,7 +2205,7 @@ importers: version: 20.17.9 tsup: specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1)(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.6.3)(yaml@2.6.1) + version: 8.3.5(@swc/core@1.10.4(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) packages/plugin-solana: dependencies: @@ -2424,6 +2455,31 @@ importers: specifier: 7.1.0 version: 7.1.0 + packages/plugin-tee-log: + dependencies: + '@elizaos/core': + specifier: workspace:* + version: link:../core + '@elizaos/plugin-sgx': + specifier: workspace:* + version: link:../plugin-sgx + '@elizaos/plugin-tee': + specifier: workspace:* + version: link:../plugin-tee + better-sqlite3: + specifier: 11.6.0 + version: 11.6.0 + elliptic: + specifier: 6.6.1 + version: 6.6.1 + devDependencies: + '@types/node': + specifier: ^20.0.0 + version: 20.17.9 + tsup: + specifier: 8.3.5 + version: 8.3.5(@swc/core@1.10.4(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + packages/plugin-tee-marlin: dependencies: '@elizaos/core': @@ -2451,31 +2507,6 @@ importers: specifier: 7.1.0 version: 7.1.0 - packages/plugin-tee-log: - dependencies: - '@elizaos/core': - specifier: workspace:* - version: link:../core - '@elizaos/plugin-sgx': - specifier: workspace:* - version: link:../plugin-sgx - '@elizaos/plugin-tee': - specifier: workspace:* - version: link:../plugin-tee - better-sqlite3: - specifier: 11.6.0 - version: 11.6.0 - elliptic: - specifier: 6.6.1 - version: 6.6.1 - devDependencies: - '@types/node': - specifier: ^20.0.0 - version: 20.17.9 - tsup: - specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.1)(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.6.3)(yaml@2.6.1) - packages/plugin-ton: dependencies: '@elizaos/core': @@ -5856,6 +5887,17 @@ packages: peerDependencies: google-protobuf: ^3.14.0 + '@inversifyjs/common@1.4.0': + resolution: {integrity: sha512-qfRJ/3iOlCL/VfJq8+4o5X4oA14cZSBbpAmHsYj8EsIit1xDndoOl0xKOyglKtQD4u4gdNVxMHx4RWARk/I4QA==} + + '@inversifyjs/core@1.3.5': + resolution: {integrity: sha512-B4MFXabhNTAmrfgB+yeD6wd/GIvmvWC6IQ8Rh/j2C3Ix69kmqwz9pr8Jt3E+Nho9aEHOQCZaGmrALgtqRd+oEQ==} + + '@inversifyjs/reflect-metadata-utils@0.2.4': + resolution: {integrity: sha512-u95rV3lKfG+NT2Uy/5vNzoDujos8vN8O18SSA5UyhxsGYd4GLQn/eUsGXfOsfa7m34eKrDelTKRUX1m/BcNX5w==} + peerDependencies: + reflect-metadata: 0.2.2 + '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} @@ -14227,6 +14269,11 @@ packages: invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} + inversify@6.2.1: + resolution: {integrity: sha512-W6Xi0icXIiC48RWdT681+GlZVgAKmCrNTiP7hj4IVPFbcxHz+Jj8Gxz5qr/Az2cgcZMYdB8tKIr2e68LUi1LYQ==} + peerDependencies: + reflect-metadata: ~0.2.2 + ioredis@5.4.2: resolution: {integrity: sha512-0SZXGNGZ+WzISQ67QDyZ2x0+wVxjjUndtD8oSeik/4ajifeiRufed8fCb8QW8VMyi4MXcS+UO1k/0NGhvq1PAg==} engines: {node: '>=12.22.0'} @@ -21565,7 +21612,7 @@ snapshots: '@acuminous/bitsyntax@0.1.2': dependencies: buffer-more-ints: 1.0.0 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 safe-buffer: 5.1.2 transitivePeerDependencies: - supports-color @@ -22732,7 +22779,7 @@ snapshots: '@babel/traverse': 7.26.4 '@babel/types': 7.26.3 convert-source-map: 2.0.0 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -23512,7 +23559,7 @@ snapshots: '@babel/parser': 7.26.3 '@babel/template': 7.25.9 '@babel/types': 7.26.3 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -23659,7 +23706,7 @@ snapshots: dependencies: '@scure/bip32': 1.6.1 abitype: 1.0.8(typescript@5.6.3)(zod@3.24.1) - axios: 1.7.9(debug@4.4.0) + axios: 1.7.9 axios-mock-adapter: 1.22.0(axios@1.7.9) axios-retry: 4.5.0(axios@1.7.9) bip32: 4.0.0 @@ -25772,7 +25819,7 @@ snapshots: '@eslint/config-array@0.19.1': dependencies: '@eslint/object-schema': 2.1.5 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -25798,7 +25845,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -26585,6 +26632,19 @@ snapshots: browser-headers: 0.4.1 google-protobuf: 3.21.4 + '@inversifyjs/common@1.4.0': {} + + '@inversifyjs/core@1.3.5(reflect-metadata@0.2.2)': + dependencies: + '@inversifyjs/common': 1.4.0 + '@inversifyjs/reflect-metadata-utils': 0.2.4(reflect-metadata@0.2.2) + transitivePeerDependencies: + - reflect-metadata + + '@inversifyjs/reflect-metadata-utils@0.2.4(reflect-metadata@0.2.2)': + dependencies: + reflect-metadata: 0.2.2 + '@ioredis/commands@1.2.0': {} '@isaacs/cliui@8.0.2': @@ -26658,6 +26718,41 @@ snapshots: - supports-color - ts-node + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 22.10.5 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 @@ -32403,7 +32498,7 @@ snapshots: '@typescript-eslint/types': 8.16.0 '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.16.0 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 eslint: 9.16.0(jiti@2.4.2) optionalDependencies: typescript: 5.6.3 @@ -32449,7 +32544,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) '@typescript-eslint/utils': 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.6.3) - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 eslint: 9.16.0(jiti@2.4.2) ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: @@ -32488,7 +32583,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.16.0 '@typescript-eslint/visitor-keys': 8.16.0 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -32503,7 +32598,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.19.1 '@typescript-eslint/visitor-keys': 8.19.1 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -32689,6 +32784,14 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 + '@vitest/mocker@2.1.4(vite@5.4.11(@types/node@20.17.9)(terser@5.37.0))': + dependencies: + '@vitest/spy': 2.1.4 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) + '@vitest/mocker@2.1.4(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0))': dependencies: '@vitest/spy': 2.1.4 @@ -32713,14 +32816,6 @@ snapshots: optionalDependencies: vite: 5.4.11(@types/node@22.10.5)(terser@5.37.0) - '@vitest/mocker@2.1.5(vite@5.4.11(@types/node@22.8.4)(terser@5.37.0))': - dependencies: - '@vitest/spy': 2.1.5 - estree-walker: 3.0.3 - magic-string: 0.30.17 - optionalDependencies: - vite: 5.4.11(@types/node@22.8.4)(terser@5.37.0) - '@vitest/pretty-format@2.1.4': dependencies: tinyrainbow: 1.2.0 @@ -33445,7 +33540,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -33897,7 +33992,7 @@ snapshots: axios-mock-adapter@1.22.0(axios@1.7.9): dependencies: - axios: 1.7.9(debug@4.4.0) + axios: 1.7.9 fast-deep-equal: 3.1.3 is-buffer: 2.0.5 @@ -33908,7 +34003,7 @@ snapshots: axios-retry@4.5.0(axios@1.7.9): dependencies: - axios: 1.7.9(debug@4.4.0) + axios: 1.7.9 is-retry-allowed: 2.2.0 axios@0.21.4: @@ -33919,7 +34014,7 @@ snapshots: axios@0.27.2: dependencies: - follow-redirects: 1.15.9(debug@4.4.0) + follow-redirects: 1.15.9 form-data: 4.0.1 transitivePeerDependencies: - debug @@ -33956,6 +34051,14 @@ snapshots: transitivePeerDependencies: - debug + axios@1.7.9: + dependencies: + follow-redirects: 1.15.9 + form-data: 4.0.1 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + axios@1.7.9(debug@4.4.0): dependencies: follow-redirects: 1.15.9(debug@4.4.0) @@ -35476,6 +35579,21 @@ snapshots: - supports-color - ts-node + create-jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + create-jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)): dependencies: '@jest/types': 29.6.3 @@ -36038,6 +36156,10 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.4.0: + dependencies: + ms: 2.1.3 + debug@4.4.0(supports-color@5.5.0): dependencies: ms: 2.1.3 @@ -37103,7 +37225,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 escape-string-regexp: 4.0.0 eslint-scope: 8.2.0 eslint-visitor-keys: 4.2.0 @@ -37489,7 +37611,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.4 + debug: 4.4.0(supports-color@5.5.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -37744,6 +37866,8 @@ snapshots: async: 0.2.10 which: 1.3.1 + follow-redirects@1.15.9: {} + follow-redirects@1.15.9(debug@4.3.7): optionalDependencies: debug: 4.3.7 @@ -38804,7 +38928,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.3 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -38860,14 +38984,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.3 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -39043,6 +39167,12 @@ snapshots: dependencies: loose-envify: 1.4.0 + inversify@6.2.1(reflect-metadata@0.2.2): + dependencies: + '@inversifyjs/common': 1.4.0 + '@inversifyjs/core': 1.3.5(reflect-metadata@0.2.2) + reflect-metadata: 0.2.2 + ioredis@5.4.2: dependencies: '@ioredis/commands': 1.2.0 @@ -39455,7 +39585,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -39592,6 +39722,25 @@ snapshots: - supports-color - ts-node + jest-cli@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): + dependencies: + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jest-cli@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(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.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) @@ -39722,6 +39871,37 @@ snapshots: - babel-plugin-macros - supports-color + jest-config@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): + dependencies: + '@babel/core': 7.26.0 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.26.0) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0(babel-plugin-macros@3.1.0) + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 22.10.5 + ts-node: 10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + jest-config@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)): dependencies: '@babel/core': 7.26.0 @@ -40060,6 +40240,18 @@ snapshots: - supports-color - ts-node + jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): + dependencies: + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(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.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) @@ -42289,7 +42481,7 @@ snapshots: '@yarnpkg/lockfile': 1.1.0 '@yarnpkg/parsers': 3.0.0-rc.46 '@zkochan/js-yaml': 0.0.7 - axios: 1.7.9(debug@4.4.0) + axios: 1.7.9 chalk: 4.1.0 cli-cursor: 3.1.0 cli-spinners: 2.6.1 @@ -45525,7 +45717,7 @@ snapshots: socks-proxy-agent@8.0.5: dependencies: agent-base: 7.1.3 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -46580,12 +46772,12 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) + jest: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -46786,7 +46978,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.3.3 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -46820,7 +47012,7 @@ snapshots: tuf-js@2.2.1: dependencies: '@tufjs/models': 2.0.1 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 make-fetch-happen: 13.0.1 transitivePeerDependencies: - supports-color @@ -47560,7 +47752,7 @@ snapshots: vite-node@2.1.4(@types/node@20.17.9)(terser@5.37.0): dependencies: cac: 6.7.14 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 pathe: 1.1.2 vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) transitivePeerDependencies: @@ -47594,7 +47786,7 @@ snapshots: vite-node@2.1.5(@types/node@22.10.5)(terser@5.37.0): dependencies: cac: 6.7.14 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 1.1.2 vite: 5.4.11(@types/node@22.10.5)(terser@5.37.0) @@ -47783,14 +47975,14 @@ snapshots: vitest@2.1.4(@types/node@20.17.9)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): dependencies: '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0)) + '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@20.17.9)(terser@5.37.0)) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.4 '@vitest/snapshot': 2.1.4 '@vitest/spy': 2.1.4 '@vitest/utils': 2.1.4 chai: 5.1.2 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 expect-type: 1.1.0 magic-string: 0.30.17 pathe: 1.1.2 @@ -47862,7 +48054,7 @@ snapshots: '@vitest/spy': 2.1.5 '@vitest/utils': 2.1.5 chai: 5.1.2 - debug: 4.4.0(supports-color@5.5.0) + debug: 4.4.0 expect-type: 1.1.0 magic-string: 0.30.17 pathe: 1.1.2 From ea516328cd10d39a4c346b5cd02fba51bc7fb0e0 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 13:01:11 +0800 Subject: [PATCH 02/39] feat: add tests for content decorators in plugin-di - Introduced a new TypeScript configuration file `tsconfig.build.json` for build-specific settings. - Updated `tsconfig.json` to enable experimental decorators and metadata emission. - Added unit tests for content decorators, validating schema creation and property description loading. - Implemented tests for the `property` decorator to ensure metadata storage functionality. --- .../src/tests/content.decorators.test.ts | 65 +++++++++++++++++++ packages/plugin-di/tsconfig.build.json | 8 +++ packages/plugin-di/tsconfig.json | 4 +- 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 packages/plugin-di/src/tests/content.decorators.test.ts create mode 100644 packages/plugin-di/tsconfig.build.json diff --git a/packages/plugin-di/src/tests/content.decorators.test.ts b/packages/plugin-di/src/tests/content.decorators.test.ts new file mode 100644 index 00000000000..e2a963b5dab --- /dev/null +++ b/packages/plugin-di/src/tests/content.decorators.test.ts @@ -0,0 +1,65 @@ +import { describe, it, expect } from "vitest"; +import { z } from "zod"; +import { + property, + createZodSchema, + loadPropertyDescriptions, +} from "../../src/decorators/content.decorators"; + +describe("Content Decorators", () => { + class TestClass { + @property({ + description: "Test description", + examples: ["example1", "example2"], + schema: z.string(), + }) + testProperty!: string; + + @property({ + description: "Number property", + examples: ["example3", "example4"], + schema: z.number().optional(), + }) + numberProperty?: number; + } + + describe("createZodSchema", () => { + it("should create a zod schema from decorated properties", () => { + const schema = createZodSchema(TestClass); + expect( + schema.safeParse({ testProperty: "valid", numberProperty: 123 }) + .success + ).toBe(true); + expect( + schema.safeParse({ + testProperty: 123, + numberProperty: "invalid", + }).success + ).toBe(false); + }); + }); + + describe("loadPropertyDescriptions", () => { + it("should load property descriptions correctly", () => { + const descriptions = loadPropertyDescriptions(TestClass); + expect(descriptions).toEqual({ + testProperty: { + description: "Test description", + examples: ["example1", "example2"], + }, + numberProperty: { + description: "Number property", + examples: ["example3", "example4"], + }, + }); + }); + }); + + describe("property decorator", () => { + it("should store metadata correctly", () => { + const instance = new TestClass(); + expect(instance.testProperty).toBeUndefined(); + expect(instance.numberProperty).toBeUndefined(); + }); + }); +}); diff --git a/packages/plugin-di/tsconfig.build.json b/packages/plugin-di/tsconfig.build.json new file mode 100644 index 00000000000..e3eb058310d --- /dev/null +++ b/packages/plugin-di/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "sourceMap": true, + "inlineSources": true, + "sourceRoot": "/" + } +} diff --git a/packages/plugin-di/tsconfig.json b/packages/plugin-di/tsconfig.json index abd2932121e..2d631d5a0f9 100644 --- a/packages/plugin-di/tsconfig.json +++ b/packages/plugin-di/tsconfig.json @@ -5,7 +5,9 @@ "rootDir": "src", "types": [ "node" - ] + ], + "experimentalDecorators": true, + "emitDecoratorMetadata": true, }, "include": [ "src/**/*.ts" From 4b4e9e7d20f73df0f53f081ec95b666de3e80cda Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 13:18:47 +0800 Subject: [PATCH 03/39] feat: implement base injectable action class in plugin-di - Removed export of providers from index.ts. - Added a new file `baseInjectableAction.ts` that defines the `BaseInjactableAction` class, which serves as an abstract base for creating injectable actions. - Introduced action options and methods for processing messages, validating content, and handling actions within the Eliza framework. - Updated `index.ts` in actions directory to export the new base class. --- .../src/actions/baseInjectableAction.ts | 249 ++++++++++++++++++ packages/plugin-di/src/actions/index.ts | 1 + packages/plugin-di/src/index.ts | 1 - 3 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 packages/plugin-di/src/actions/baseInjectableAction.ts diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts new file mode 100644 index 00000000000..25d192feed3 --- /dev/null +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -0,0 +1,249 @@ +import { injectable, unmanaged } from "inversify"; +import { z } from "zod"; +import { + Action, + ActionExample, + composeContext, + elizaLogger, + generateObject, + HandlerCallback, + IAgentRuntime, + Memory, + ModelClass, + State, +} from "@elizaos/core"; +import { + type ContentClass, + createZodSchema, + loadPropertyDescriptions, +} from "../decorators"; +import { InjactableAction } from "../types"; +import { buildContentOutputTemplate } from "../templates"; + +/** + * Action options + */ +export type ActionOptions = Pick< + Action, + "name" | "similes" | "description" | "examples" | "suppressInitialMessage" +> & { + contentClass: ContentClass; + template?: string; + contentSchema?: z.ZodSchema; +}; + +/** + * Base abstract class for injectable actions + */ +@injectable() +export abstract class BaseInjactableAction implements InjactableAction { + // -------- Properties -------- + public name: string; + public similes: string[]; + public description: string; + public examples: ActionExample[][]; + public suppressInitialMessage: boolean; + + /** + * The content class for the action + */ + private readonly contentClass: ContentClass; + /** + * Optional template for the action, if not provided, it will be generated from the content class + */ + private readonly template: string; + /** + * Optional content schema for the action, if not provided, it will be generated from the content class + */ + private readonly contentSchema: z.ZodSchema; + + /** + * Constructor for the base injectable action + */ + constructor(@unmanaged() opts: ActionOptions) { + // Set the action properties + this.name = opts.name; + this.similes = opts.similes; + this.description = opts.description; + this.examples = opts.examples; + this.suppressInitialMessage = opts.suppressInitialMessage ?? false; // Default to false + // Set the content class, template and content schema + this.contentClass = opts.contentClass; + this.template = opts.template; + this.contentSchema = opts.contentSchema; + + if (this.contentClass !== undefined) { + if (this.contentSchema === undefined) { + this.contentSchema = createZodSchema(this.contentClass); + } + if (this.template === undefined) { + const properties = loadPropertyDescriptions(this.contentClass); + this.template = buildContentOutputTemplate( + this.name, + this.description, + properties, + this.contentSchema + ); + } + } + } + + // -------- Abstract methods to be implemented by the child class -------- + + /** + * Abstract method to execute the action + * @param content The content object + * @param callback The callback function to pass the result to Eliza runtime + */ + abstract execute( + content: T, + runtime: IAgentRuntime, + message: Memory, + state?: State, + callback?: HandlerCallback + ): Promise; + + // -------- Implemented methods for Eliza runtime -------- + + /** + * Default implementation of the validate method + * You can override this method to add custom validation logic + * + * @param runtime The runtime object from Eliza framework + * @param message The message object from Eliza framework + * @param state The state object from Eliza framework + * @returns The validation result + */ + async validate( + _runtime: IAgentRuntime, + _message: Memory, + _state?: State + ): Promise { + // Default implementation is to return true + return true; + } + + /** + * Default implementation of the preparation of action context + * You can override this method to add custom logic + */ + protected async prepareActionContext( + runtime: IAgentRuntime, + message: Memory, + state?: State + ): Promise { + // Initialize or update state + if (!state) { + state = (await runtime.composeState(message)) as State; + } else { + state = await runtime.updateRecentMessageState(state); + } + + // Compose context + return composeContext({ state, template: this.template }); + } + + /** + * Default method for processing messages + * You can override this method to add custom logic + * + * @param runtime The runtime object from Eliza framework + * @param message The message object from Eliza framework + * @param state The state object from Eliza framework + * @returns The generated content from AI based on the message + */ + protected async processMessages( + runtime: IAgentRuntime, + message: Memory, + state: State + ): Promise { + const actionContext = await this.prepareActionContext( + runtime, + message, + state + ); + + if (!actionContext) { + elizaLogger.error("Failed to prepare action context"); + return null; + } + + // Generate transfer content + const resourceDetails = await generateObject({ + runtime, + context: actionContext, + modelClass: ModelClass.SMALL, + schema: this.contentSchema as any, + }); + + elizaLogger.debug("Response: ", resourceDetails.object); + + // Validate content + const parsedObj = await this.contentSchema.safeParseAsync( + resourceDetails.object + ); + if (!parsedObj.success) { + elizaLogger.error( + "Failed to parse content: ", + JSON.stringify(parsedObj.error?.flatten()) + ); + return null; + } else { + return parsedObj.data; + } + } + + /** + * Default Handler function type for processing messages + * You can override this method to add custom logic + * + * @param runtime The runtime object from Eliza framework + * @param message The message object from Eliza framework + * @param state The state object from Eliza framework + * @param options The options object from Eliza framework + * @param callback The callback function to pass the result to Eliza runtime + */ + async handler( + runtime: IAgentRuntime, + message: Memory, + state?: State, + _options?: Record, + callback?: HandlerCallback + ): Promise { + let content: T; + try { + content = await this.processMessages(runtime, message, state); + } catch (err) { + elizaLogger.error("Error in processing messages:", err.message); + + if (callback) { + callback({ + text: + "Unable to process transfer request. Invalid content: " + + err.message, + content: { + error: "Invalid content", + }, + }); + } + return; + } + + if (!content) { + elizaLogger.warn("No content generated"); + return; + } + + try { + return await this.execute( + content, + runtime, + message, + state, + callback + ); + } catch (err) { + elizaLogger.error("Error in executing action:", err.message); + } + } +} diff --git a/packages/plugin-di/src/actions/index.ts b/packages/plugin-di/src/actions/index.ts index e69de29bb2d..d1b24f3c0c3 100644 --- a/packages/plugin-di/src/actions/index.ts +++ b/packages/plugin-di/src/actions/index.ts @@ -0,0 +1 @@ +export * from "./baseInjectableAction"; diff --git a/packages/plugin-di/src/index.ts b/packages/plugin-di/src/index.ts index e94878d8937..f848d357c6d 100644 --- a/packages/plugin-di/src/index.ts +++ b/packages/plugin-di/src/index.ts @@ -2,7 +2,6 @@ export * as "symbols" from "./symbols"; export * from "./decorators"; export * from "./types"; -export * from "./providers"; export * from "./factories"; export * from "./templates"; export * from "./di"; From 4212b246d1b898794330d11a951ca95cb1f67bac Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 13:23:23 +0800 Subject: [PATCH 04/39] fix: correct export typo and refactor evaluators in plugin-di - Fixed a typo in the export statement from `evaluators` to `evalutors` in `index.ts`. - Added a new file `baseInjectableEvalutor.ts` to define the base class for injectable evaluators. - Removed obsolete sample action and evaluator files to streamline the codebase. - Updated `types.ts` to include the `ActionOptions` type definition for better action handling. --- .../src/actions/baseInjectableAction.ts | 15 +-- .../plugin-di/src/actions/sampleAction.ts | 111 ------------------ .../src/evaluators/sampleEvalutor.ts | 53 --------- .../baseInjectableEvalutor.ts} | 0 packages/plugin-di/src/evalutors/index.ts | 1 + packages/plugin-di/src/index.ts | 2 +- packages/plugin-di/src/types.ts | 14 +++ 7 files changed, 17 insertions(+), 179 deletions(-) delete mode 100644 packages/plugin-di/src/actions/sampleAction.ts delete mode 100644 packages/plugin-di/src/evaluators/sampleEvalutor.ts rename packages/plugin-di/src/{evaluators/index.ts => evalutors/baseInjectableEvalutor.ts} (100%) create mode 100644 packages/plugin-di/src/evalutors/index.ts diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 25d192feed3..15cd2dcbf24 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -1,7 +1,6 @@ import { injectable, unmanaged } from "inversify"; import { z } from "zod"; import { - Action, ActionExample, composeContext, elizaLogger, @@ -17,21 +16,9 @@ import { createZodSchema, loadPropertyDescriptions, } from "../decorators"; -import { InjactableAction } from "../types"; +import { ActionOptions, InjactableAction } from "../types"; import { buildContentOutputTemplate } from "../templates"; -/** - * Action options - */ -export type ActionOptions = Pick< - Action, - "name" | "similes" | "description" | "examples" | "suppressInitialMessage" -> & { - contentClass: ContentClass; - template?: string; - contentSchema?: z.ZodSchema; -}; - /** * Base abstract class for injectable actions */ diff --git a/packages/plugin-di/src/actions/sampleAction.ts b/packages/plugin-di/src/actions/sampleAction.ts deleted file mode 100644 index 7f835dac0a5..00000000000 --- a/packages/plugin-di/src/actions/sampleAction.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { - Action, - IAgentRuntime, - Memory, - HandlerCallback, - State, - composeContext, - generateObject, - ModelClass, - elizaLogger, -} from "@elizaos/core"; - -import { CreateResourceSchema, isCreateResourceContent } from "../types"; - -import { createResourceTemplate } from "../templates"; - -export const createResourceAction: Action = { - name: "CREATE_RESOURCE", - description: "Create a new resource with the specified details", - validate: async (runtime: IAgentRuntime, _message: Memory) => { - return !!runtime.character.settings.secrets?.API_KEY; - }, - handler: async ( - runtime: IAgentRuntime, - _message: Memory, - state: State, - _options: any, - callback: HandlerCallback - ) => { - try { - const context = composeContext({ - state, - template: createResourceTemplate, - }); - - const resourceDetails = await generateObject({ - runtime, - context, - modelClass: ModelClass.SMALL, - schema: CreateResourceSchema, - }); - - if (!isCreateResourceContent(resourceDetails.object)) { - callback({ text: "Invalid resource details provided." }, []); - return; - } - - // persist relevant data if needed to memory/knowledge - // const memory = { - // type: "resource", - // content: resourceDetails.object, - // timestamp: new Date().toISOString() - // }; - - // await runtime.storeMemory(memory); - - callback( - { - text: `Resource created successfully: -- Name: ${resourceDetails.object.name} -- Type: ${resourceDetails.object.type} -- Description: ${resourceDetails.object.description} -- Tags: ${resourceDetails.object.tags.join(", ")} - -Resource has been stored in memory.`, - }, - [] - ); - } catch (error) { - elizaLogger.error("Error creating resource:", error); - callback( - { text: "Failed to create resource. Please check the logs." }, - [] - ); - } - }, - examples: [ - [ - { - user: "{{user1}}", - content: { - text: "Create a new resource with the name 'Resource1' and type 'TypeA'", - }, - }, - { - user: "{{agentName}}", - content: { - text: `Resource created successfully: -- Name: Resource1 -- Type: TypeA`, - }, - }, - ], - [ - { - user: "{{user1}}", - content: { - text: "Create a new resource with the name 'Resource2' and type 'TypeB'", - }, - }, - { - user: "{{agentName}}", - content: { - text: `Resource created successfully: -- Name: Resource2 -- Type: TypeB`, - }, - }, - ], - ], -}; diff --git a/packages/plugin-di/src/evaluators/sampleEvalutor.ts b/packages/plugin-di/src/evaluators/sampleEvalutor.ts deleted file mode 100644 index c6d48b07153..00000000000 --- a/packages/plugin-di/src/evaluators/sampleEvalutor.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { - Evaluator, - IAgentRuntime, - Memory, - State, - elizaLogger, -} from "@elizaos/core"; - -export const sampleEvaluator: Evaluator = { - alwaysRun: false, - description: "Sample evaluator for checking important content in memory", - similes: ["content checker", "memory evaluator"], - examples: [ - { - context: "Checking if memory contains important content", - messages: [ - { - action: "evaluate", - input: "This is an important message", - output: { - score: 1, - reason: "Memory contains important content.", - }, - }, - ], - outcome: "Memory should be evaluated as important", - }, - ], - handler: async (runtime: IAgentRuntime, memory: Memory, state: State) => { - // Evaluation logic for the evaluator - elizaLogger.log("Evaluating data in sampleEvaluator..."); - - // Example evaluation logic - if (memory.content && memory.content.includes("important")) { - elizaLogger.log("Important content found in memory."); - return { - score: 1, - reason: "Memory contains important content.", - }; - } else { - elizaLogger.log("No important content found in memory."); - return { - score: 0, - reason: "Memory does not contain important content.", - }; - } - }, - name: "sampleEvaluator", - validate: async (runtime: IAgentRuntime, memory: Memory, state: State) => { - // Validation logic for the evaluator - return true; - }, -}; diff --git a/packages/plugin-di/src/evaluators/index.ts b/packages/plugin-di/src/evalutors/baseInjectableEvalutor.ts similarity index 100% rename from packages/plugin-di/src/evaluators/index.ts rename to packages/plugin-di/src/evalutors/baseInjectableEvalutor.ts diff --git a/packages/plugin-di/src/evalutors/index.ts b/packages/plugin-di/src/evalutors/index.ts new file mode 100644 index 00000000000..3b4367cf929 --- /dev/null +++ b/packages/plugin-di/src/evalutors/index.ts @@ -0,0 +1 @@ +export * from "./baseInjectableEvalutor"; diff --git a/packages/plugin-di/src/index.ts b/packages/plugin-di/src/index.ts index f848d357c6d..5f4cc9cb1e0 100644 --- a/packages/plugin-di/src/index.ts +++ b/packages/plugin-di/src/index.ts @@ -6,4 +6,4 @@ export * from "./factories"; export * from "./templates"; export * from "./di"; export * from "./actions"; -export * from "./evaluators"; +export * from "./evalutors"; diff --git a/packages/plugin-di/src/types.ts b/packages/plugin-di/src/types.ts index bbef95c37e1..f89aad65f53 100644 --- a/packages/plugin-di/src/types.ts +++ b/packages/plugin-di/src/types.ts @@ -8,6 +8,8 @@ import { Provider, State, } from "@elizaos/core"; +import { ContentClass } from "./decorators"; +import { z } from "zod"; // ----------- Interfaces for Injectable Providers and Actions, etc ----------- @@ -29,6 +31,18 @@ export type InjectableProviderClass = new ( ...args: Args ) => InjectableProvider; +/** + * Action options + */ +export type ActionOptions = Pick< + Action, + "name" | "similes" | "description" | "examples" | "suppressInitialMessage" +> & { + contentClass: ContentClass; + template?: string; + contentSchema?: z.ZodSchema; +}; + /** * Interface of Injectable Action */ From 3717882634c7d21732603e4465329682043b901d Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 16:59:14 +0800 Subject: [PATCH 05/39] feat: enhance plugin-di with new evaluators and action examples - Fixed export typo in `index.ts` from `evalutors` to `evaluators`. - Added `EvaluatorOptions` type definition in `types.ts` for better evaluator configuration. - Introduced new sample action and evaluator files to demonstrate usage within the plugin. - Implemented a base abstract class for injectable evaluators in `baseInjactableEvaluator.ts`. - Updated `createPlugin` function to handle actions more effectively. - Removed obsolete `index.ts` from the `evalutors` directory to clean up the codebase. --- .../plugin-di/src/_examples/sampleAction.ts | 111 ++++++++++++++++++ .../plugin-di/src/_examples/sampleEvalutor.ts | 53 +++++++++ .../samplePlugin.ts} | 0 .../sampleProvider.ts | 0 .../src/evaluators/baseInjactableEvaluator.ts | 63 ++++++++++ packages/plugin-di/src/evaluators/index.ts | 1 + packages/plugin-di/src/evalutors/index.ts | 1 - packages/plugin-di/src/factories/plugin.ts | 28 ++--- packages/plugin-di/src/index.ts | 2 +- packages/plugin-di/src/providers/index.ts | 0 packages/plugin-di/src/types.ts | 8 ++ 11 files changed, 251 insertions(+), 16 deletions(-) create mode 100644 packages/plugin-di/src/_examples/sampleAction.ts create mode 100644 packages/plugin-di/src/_examples/sampleEvalutor.ts rename packages/plugin-di/src/{evalutors/baseInjectableEvalutor.ts => _examples/samplePlugin.ts} (100%) rename packages/plugin-di/src/{providers => _examples}/sampleProvider.ts (100%) create mode 100644 packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts create mode 100644 packages/plugin-di/src/evaluators/index.ts delete mode 100644 packages/plugin-di/src/evalutors/index.ts delete mode 100644 packages/plugin-di/src/providers/index.ts diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts new file mode 100644 index 00000000000..7f835dac0a5 --- /dev/null +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -0,0 +1,111 @@ +import { + Action, + IAgentRuntime, + Memory, + HandlerCallback, + State, + composeContext, + generateObject, + ModelClass, + elizaLogger, +} from "@elizaos/core"; + +import { CreateResourceSchema, isCreateResourceContent } from "../types"; + +import { createResourceTemplate } from "../templates"; + +export const createResourceAction: Action = { + name: "CREATE_RESOURCE", + description: "Create a new resource with the specified details", + validate: async (runtime: IAgentRuntime, _message: Memory) => { + return !!runtime.character.settings.secrets?.API_KEY; + }, + handler: async ( + runtime: IAgentRuntime, + _message: Memory, + state: State, + _options: any, + callback: HandlerCallback + ) => { + try { + const context = composeContext({ + state, + template: createResourceTemplate, + }); + + const resourceDetails = await generateObject({ + runtime, + context, + modelClass: ModelClass.SMALL, + schema: CreateResourceSchema, + }); + + if (!isCreateResourceContent(resourceDetails.object)) { + callback({ text: "Invalid resource details provided." }, []); + return; + } + + // persist relevant data if needed to memory/knowledge + // const memory = { + // type: "resource", + // content: resourceDetails.object, + // timestamp: new Date().toISOString() + // }; + + // await runtime.storeMemory(memory); + + callback( + { + text: `Resource created successfully: +- Name: ${resourceDetails.object.name} +- Type: ${resourceDetails.object.type} +- Description: ${resourceDetails.object.description} +- Tags: ${resourceDetails.object.tags.join(", ")} + +Resource has been stored in memory.`, + }, + [] + ); + } catch (error) { + elizaLogger.error("Error creating resource:", error); + callback( + { text: "Failed to create resource. Please check the logs." }, + [] + ); + } + }, + examples: [ + [ + { + user: "{{user1}}", + content: { + text: "Create a new resource with the name 'Resource1' and type 'TypeA'", + }, + }, + { + user: "{{agentName}}", + content: { + text: `Resource created successfully: +- Name: Resource1 +- Type: TypeA`, + }, + }, + ], + [ + { + user: "{{user1}}", + content: { + text: "Create a new resource with the name 'Resource2' and type 'TypeB'", + }, + }, + { + user: "{{agentName}}", + content: { + text: `Resource created successfully: +- Name: Resource2 +- Type: TypeB`, + }, + }, + ], + ], +}; diff --git a/packages/plugin-di/src/_examples/sampleEvalutor.ts b/packages/plugin-di/src/_examples/sampleEvalutor.ts new file mode 100644 index 00000000000..c6d48b07153 --- /dev/null +++ b/packages/plugin-di/src/_examples/sampleEvalutor.ts @@ -0,0 +1,53 @@ +import { + Evaluator, + IAgentRuntime, + Memory, + State, + elizaLogger, +} from "@elizaos/core"; + +export const sampleEvaluator: Evaluator = { + alwaysRun: false, + description: "Sample evaluator for checking important content in memory", + similes: ["content checker", "memory evaluator"], + examples: [ + { + context: "Checking if memory contains important content", + messages: [ + { + action: "evaluate", + input: "This is an important message", + output: { + score: 1, + reason: "Memory contains important content.", + }, + }, + ], + outcome: "Memory should be evaluated as important", + }, + ], + handler: async (runtime: IAgentRuntime, memory: Memory, state: State) => { + // Evaluation logic for the evaluator + elizaLogger.log("Evaluating data in sampleEvaluator..."); + + // Example evaluation logic + if (memory.content && memory.content.includes("important")) { + elizaLogger.log("Important content found in memory."); + return { + score: 1, + reason: "Memory contains important content.", + }; + } else { + elizaLogger.log("No important content found in memory."); + return { + score: 0, + reason: "Memory does not contain important content.", + }; + } + }, + name: "sampleEvaluator", + validate: async (runtime: IAgentRuntime, memory: Memory, state: State) => { + // Validation logic for the evaluator + return true; + }, +}; diff --git a/packages/plugin-di/src/evalutors/baseInjectableEvalutor.ts b/packages/plugin-di/src/_examples/samplePlugin.ts similarity index 100% rename from packages/plugin-di/src/evalutors/baseInjectableEvalutor.ts rename to packages/plugin-di/src/_examples/samplePlugin.ts diff --git a/packages/plugin-di/src/providers/sampleProvider.ts b/packages/plugin-di/src/_examples/sampleProvider.ts similarity index 100% rename from packages/plugin-di/src/providers/sampleProvider.ts rename to packages/plugin-di/src/_examples/sampleProvider.ts diff --git a/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts b/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts new file mode 100644 index 00000000000..3d02b051991 --- /dev/null +++ b/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts @@ -0,0 +1,63 @@ +import { injectable, unmanaged } from "inversify"; +import { + IAgentRuntime, + EvaluationExample, + Memory, + State, + HandlerCallback, +} from "@elizaos/core"; +import { EvaluatorOptions, InjactableEvaluator } from "../types"; + +/** + * Base abstract class for injectable actions + */ +@injectable() +export abstract class BaseInjactableEvaluator implements InjactableEvaluator { + // -------- Properties -------- + public alwaysRun: boolean; + public name: string; + public similes: string[]; + public description: string; + public examples: EvaluationExample[]; + + /** + * Constructor for the base injectable action + */ + constructor(@unmanaged() opts: EvaluatorOptions) { + // Set the action properties + this.name = opts.name; + this.similes = opts.similes; + this.description = opts.description; + this.examples = opts.examples; + this.alwaysRun = opts.alwaysRun ?? false; // Default to false + } + + /** + * Default implementation of the validate method + * You can override this method to add custom validation logic + * + * @param runtime The runtime object from Eliza framework + * @param message The message object from Eliza framework + * @param state The state object from Eliza framework + * @returns The validation result + */ + async validate( + _runtime: IAgentRuntime, + _message: Memory, + _state?: State + ): Promise { + // Default implementation is to return true + return true; + } + + /** + * Handler for the evaluator + */ + abstract handler( + runtime: IAgentRuntime, + message: Memory, + state?: State, + options?: Record, + callback?: HandlerCallback + ): Promise; +} diff --git a/packages/plugin-di/src/evaluators/index.ts b/packages/plugin-di/src/evaluators/index.ts new file mode 100644 index 00000000000..c3a5934c91a --- /dev/null +++ b/packages/plugin-di/src/evaluators/index.ts @@ -0,0 +1 @@ +export * from "./baseInjactableEvaluator"; diff --git a/packages/plugin-di/src/evalutors/index.ts b/packages/plugin-di/src/evalutors/index.ts deleted file mode 100644 index 3b4367cf929..00000000000 --- a/packages/plugin-di/src/evalutors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./baseInjectableEvalutor"; diff --git a/packages/plugin-di/src/factories/plugin.ts b/packages/plugin-di/src/factories/plugin.ts index 12ae24515c9..65e7cdf9122 100644 --- a/packages/plugin-di/src/factories/plugin.ts +++ b/packages/plugin-di/src/factories/plugin.ts @@ -13,20 +13,6 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { options: opts, }; - // Handle actions - if provided, map through them - // For class constructors (functions), get instance from container - // For regular actions, use as-is - if (typeof opts.actions !== "undefined") { - plugin.actions = await Promise.all( - opts.actions.map( - async (action) => - typeof action === "function" - ? await ctx.container.getAsync(action) // Get instance from DI container - : action // Use action directly - ) - ); - } - // Handle providers - if provided, map through them // For class constructors (functions), get instance from container // For regular providers, use as-is @@ -41,6 +27,20 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { ); } + // Handle actions - if provided, map through them + // For class constructors (functions), get instance from container + // For regular actions, use as-is + if (typeof opts.actions !== "undefined") { + plugin.actions = await Promise.all( + opts.actions.map( + async (action) => + typeof action === "function" + ? await ctx.container.getAsync(action) // Get instance from DI container + : action // Use action directly + ) + ); + } + // Handle evaluators - if provided, map through them // For class constructors (functions), get instance from container // For regular evaluators, use as-is diff --git a/packages/plugin-di/src/index.ts b/packages/plugin-di/src/index.ts index 5f4cc9cb1e0..f848d357c6d 100644 --- a/packages/plugin-di/src/index.ts +++ b/packages/plugin-di/src/index.ts @@ -6,4 +6,4 @@ export * from "./factories"; export * from "./templates"; export * from "./di"; export * from "./actions"; -export * from "./evalutors"; +export * from "./evaluators"; diff --git a/packages/plugin-di/src/providers/index.ts b/packages/plugin-di/src/providers/index.ts deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/plugin-di/src/types.ts b/packages/plugin-di/src/types.ts index f89aad65f53..4f7ca72fbb0 100644 --- a/packages/plugin-di/src/types.ts +++ b/packages/plugin-di/src/types.ts @@ -68,6 +68,14 @@ export type InjectableActionClass = new ( ...args: Args ) => InjactableAction; +/** + * Evaluator options + */ +export type EvaluatorOptions = Pick< + Evaluator, + "name" | "similes" | "description" | "examples" | "alwaysRun" +>; + /** * Interface of Injectable Evaluator */ From fb75e8e05182cadb79ee152f3577f52914bc7c25 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 18:43:25 +0800 Subject: [PATCH 06/39] feat: update CreateResource action to handle nullable content and refactor structure - Modified the `execute` method in `BaseInjactableAction` and `CreateResourceAction` to accept nullable content. - Introduced a new `CreateResourceContent` class to define the structure of the content for resource creation. - Refactored the `CreateResourceAction` to utilize the new content class and improved validation logic. - Enhanced the callback responses to handle cases where no content is provided, ensuring better error handling. --- .../plugin-di/src/_examples/sampleAction.ts | 151 ++++++++++-------- .../src/actions/baseInjectableAction.ts | 13 +- packages/plugin-di/src/types.ts | 2 +- 3 files changed, 94 insertions(+), 72 deletions(-) diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index 7f835dac0a5..ea70925d33e 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -1,79 +1,51 @@ import { - Action, IAgentRuntime, Memory, HandlerCallback, State, - composeContext, - generateObject, - ModelClass, elizaLogger, } from "@elizaos/core"; +import { BaseInjactableAction } from "../actions"; +import { ActionOptions } from "../types"; +import { property } from "../decorators"; +import { z } from "zod"; -import { CreateResourceSchema, isCreateResourceContent } from "../types"; +/** + * The content class for the action + */ +export class CreateResourceContent { + @property({ + description: "Name of the resource", + schema: z.string(), + }) + name: string; -import { createResourceTemplate } from "../templates"; + @property({ + description: "Type of resource (document, image, video)", + schema: z.string(), + }) + type: string; -export const createResourceAction: Action = { - name: "CREATE_RESOURCE", - description: "Create a new resource with the specified details", - validate: async (runtime: IAgentRuntime, _message: Memory) => { - return !!runtime.character.settings.secrets?.API_KEY; - }, - handler: async ( - runtime: IAgentRuntime, - _message: Memory, - state: State, - _options: any, - callback: HandlerCallback - ) => { - try { - const context = composeContext({ - state, - template: createResourceTemplate, - }); - - const resourceDetails = await generateObject({ - runtime, - context, - modelClass: ModelClass.SMALL, - schema: CreateResourceSchema, - }); - - if (!isCreateResourceContent(resourceDetails.object)) { - callback({ text: "Invalid resource details provided." }, []); - return; - } - - // persist relevant data if needed to memory/knowledge - // const memory = { - // type: "resource", - // content: resourceDetails.object, - // timestamp: new Date().toISOString() - // }; + @property({ + description: "Description of the resource", + schema: z.string(), + }) + description: string; - // await runtime.storeMemory(memory); + @property({ + description: "Array of tags to categorize the resource", + schema: z.array(z.string()), + }) + tags: string[]; +} - callback( - { - text: `Resource created successfully: -- Name: ${resourceDetails.object.name} -- Type: ${resourceDetails.object.type} -- Description: ${resourceDetails.object.description} -- Tags: ${resourceDetails.object.tags.join(", ")} - -Resource has been stored in memory.`, - }, - [] - ); - } catch (error) { - elizaLogger.error("Error creating resource:", error); - callback( - { text: "Failed to create resource. Please check the logs." }, - [] - ); - } - }, +/** + * Options for the CreateResource action + */ +const options: ActionOptions = { + name: "CREATE_RESOURCE", + similes: [], + description: "Create a new resource with the specified details", examples: [ [ { @@ -108,4 +80,55 @@ Resource has been stored in memory.`, }, ], ], + contentClass: CreateResourceContent, }; + +export class CreateResourceAction extends BaseInjactableAction { + constructor() { + super(options); + } + + async validate( + runtime: IAgentRuntime, + _message: Memory, + _state?: State + ): Promise { + return !!runtime.character.settings.secrets?.API_KEY; + } + + async execute( + content: CreateResourceContent | null, + _runtime: IAgentRuntime, + _message: Memory, + _state: State, + callback?: HandlerCallback + ): Promise { + if (!content) { + elizaLogger.warn("No content provided for the action."); + await callback?.({ text: "Failed to process the content." }, []); + return; + } + + // persist relevant data if needed to memory/knowledge + // const memory = { + // type: "resource", + // content: resourceDetails.object, + // timestamp: new Date().toISOString() + // }; + + // await runtime.storeMemory(memory); + + callback( + { + text: `Resource created successfully: +- Name: ${content.name} +- Type: ${content.type} +- Description: ${content.description} +- Tags: ${content.tags.join(", ")} + +Resource has been stored in memory.`, + }, + [] + ); + } +} diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 15cd2dcbf24..9eca2bea0dc 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -83,7 +83,7 @@ export abstract class BaseInjactableAction implements InjactableAction { * @param callback The callback function to pass the result to Eliza runtime */ abstract execute( - content: T, + content: T | null, runtime: IAgentRuntime, message: Memory, state?: State, @@ -113,6 +113,10 @@ export abstract class BaseInjactableAction implements InjactableAction { /** * Default implementation of the preparation of action context * You can override this method to add custom logic + * + * @param runtime The runtime object from Eliza framework + * @param message The message object from Eliza framework + * @param state The state object from Eliza framework */ protected async prepareActionContext( runtime: IAgentRuntime, @@ -204,7 +208,7 @@ export abstract class BaseInjactableAction implements InjactableAction { elizaLogger.error("Error in processing messages:", err.message); if (callback) { - callback({ + await callback?.({ text: "Unable to process transfer request. Invalid content: " + err.message, @@ -216,11 +220,6 @@ export abstract class BaseInjactableAction implements InjactableAction { return; } - if (!content) { - elizaLogger.warn("No content generated"); - return; - } - try { return await this.execute( content, diff --git a/packages/plugin-di/src/types.ts b/packages/plugin-di/src/types.ts index 4f7ca72fbb0..f823ac54079 100644 --- a/packages/plugin-di/src/types.ts +++ b/packages/plugin-di/src/types.ts @@ -53,7 +53,7 @@ export interface InjactableAction extends Action { * @param callback The callback function to pass the result to Eliza runtime */ execute( - content: T, + content: T | null, runtime: IAgentRuntime, message: Memory, state?: State, From 66e540838da7ab1871e7c89ada4fbb134c627aa0 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 20:03:58 +0800 Subject: [PATCH 07/39] feat: enhance plugin-di with new sample action, evaluator, provider, and plugin integration - Introduced `CreateResourceAction` to manage resource creation with dependency injection. - Added `SampleEvaluator` for evaluating important content in memory, implementing the `BaseInjactableEvaluator`. - Created `SampleProvider` for data retrieval, adhering to the `InjectableProvider` interface. - Registered new components with the global container for dependency injection. - Defined a `samplePlugin` to encapsulate the new action, evaluator, and provider, facilitating resource management. --- .../plugin-di/src/_examples/sampleAction.ts | 26 +++++++-- .../plugin-di/src/_examples/sampleEvalutor.ts | 56 +++++++++++-------- .../plugin-di/src/_examples/samplePlugin.ts | 17 ++++++ .../plugin-di/src/_examples/sampleProvider.ts | 40 +++++++++++-- 4 files changed, 106 insertions(+), 33 deletions(-) diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index ea70925d33e..c1a6d4536eb 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -5,10 +5,13 @@ import { State, elizaLogger, } from "@elizaos/core"; +import { z } from "zod"; +import { inject, injectable } from "inversify"; import { BaseInjactableAction } from "../actions"; import { ActionOptions } from "../types"; import { property } from "../decorators"; -import { z } from "zod"; +import { globalContainer } from "../di"; +import { SampleProvider } from "./sampleProvider"; /** * The content class for the action @@ -83,8 +86,15 @@ const options: ActionOptions = { contentClass: CreateResourceContent, }; +/** + * CreateResourceAction + */ +@injectable() export class CreateResourceAction extends BaseInjactableAction { - constructor() { + constructor( + @inject(SampleProvider) + private readonly sampleProvider: SampleProvider + ) { super(options); } @@ -98,9 +108,9 @@ export class CreateResourceAction extends BaseInjactableAction { if (!content) { @@ -109,6 +119,9 @@ export class CreateResourceAction extends BaseInjactableAction { +}; + +@injectable() +export class SampleEvaluator extends BaseInjactableEvaluator { + constructor() { + super(options); + } + + async handler(runtime: IAgentRuntime, memory: Memory, _state?: State) { // Evaluation logic for the evaluator elizaLogger.log("Evaluating data in sampleEvaluator..."); // Example evaluation logic - if (memory.content && memory.content.includes("important")) { + if (memory.content && memory.content.text.includes("important")) { elizaLogger.log("Important content found in memory."); return { score: 1, @@ -44,10 +56,8 @@ export const sampleEvaluator: Evaluator = { reason: "Memory does not contain important content.", }; } - }, - name: "sampleEvaluator", - validate: async (runtime: IAgentRuntime, memory: Memory, state: State) => { - // Validation logic for the evaluator - return true; - }, -}; + } +} + +// Register the sample evaluator with the global container +globalContainer.bind(SampleEvaluator).toSelf(); diff --git a/packages/plugin-di/src/_examples/samplePlugin.ts b/packages/plugin-di/src/_examples/samplePlugin.ts index e69de29bb2d..77ddcf1bf54 100644 --- a/packages/plugin-di/src/_examples/samplePlugin.ts +++ b/packages/plugin-di/src/_examples/samplePlugin.ts @@ -0,0 +1,17 @@ +import { CreateResourceAction } from "./sampleAction"; +import { SampleProvider } from "./sampleProvider"; +import { SampleEvaluator } from "./sampleEvalutor"; +import { 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/_examples/sampleProvider.ts b/packages/plugin-di/src/_examples/sampleProvider.ts index d16f3ba6ddf..2cc51514b34 100644 --- a/packages/plugin-di/src/_examples/sampleProvider.ts +++ b/packages/plugin-di/src/_examples/sampleProvider.ts @@ -1,3 +1,4 @@ +import { injectable } from "inversify"; import { Provider, IAgentRuntime, @@ -5,10 +6,39 @@ import { State, elizaLogger, } from "@elizaos/core"; +import { InjectableProvider } from "../types"; +import { globalContainer } from "../di"; -export const sampleProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory, state: State) => { - // Data retrieval logic for the provider +/** + * Sample Provider + */ +@injectable() +export class SampleProvider + implements InjectableProvider>, Provider +{ + private _sharedInstance: Record; + + // ---- Implementing the InjectableProvider interface ---- + + async getInstance( + _runtime: IAgentRuntime + ): Promise> { + if (!this._sharedInstance) { + this._sharedInstance = {}; + } + return this._sharedInstance; + } + + // ---- Implementing the Provider interface ---- + + async get( + _runtime: IAgentRuntime, + _message: Memory, + _state: State + ): Promise { elizaLogger.log("Retrieving data in sampleProvider..."); - }, -}; + } +} + +// Register the provider with the global container +globalContainer.bind(SampleProvider).toSelf(); From 218d6443ee4e55abc886dd6da229b13ffc146fbc Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 20:18:04 +0800 Subject: [PATCH 08/39] refactor: update dependency injection for actions and providers - Changed `CreateResourceAction` and `SampleEvaluator` to use `inRequestScope()` for better lifecycle management. - Introduced dynamic data binding in `SampleProvider` with `toDynamicValue()` for asynchronous data retrieval. - Updated `SampleProvider` to inject dynamic data and modified the `get` method to return a string representation of the shared and dynamic data. - Adjusted import statements in `baseInjectableAction.ts` and `baseInjactableEvaluator.ts` to use `import type` for improved type safety. --- .../plugin-di/src/_examples/sampleAction.ts | 2 +- .../plugin-di/src/_examples/sampleEvalutor.ts | 2 +- .../plugin-di/src/_examples/sampleProvider.ts | 24 +++++++++++++++---- .../src/actions/baseInjectableAction.ts | 2 +- .../src/evaluators/baseInjactableEvaluator.ts | 2 +- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index c1a6d4536eb..29f0880eb08 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -147,4 +147,4 @@ Resource has been stored in memory.`, } // Register the action with the global container -globalContainer.bind(CreateResourceAction).toSelf(); +globalContainer.bind(CreateResourceAction).toSelf().inRequestScope(); diff --git a/packages/plugin-di/src/_examples/sampleEvalutor.ts b/packages/plugin-di/src/_examples/sampleEvalutor.ts index 7c0847e5425..91cf8c4eb85 100644 --- a/packages/plugin-di/src/_examples/sampleEvalutor.ts +++ b/packages/plugin-di/src/_examples/sampleEvalutor.ts @@ -60,4 +60,4 @@ export class SampleEvaluator extends BaseInjactableEvaluator { } // Register the sample evaluator with the global container -globalContainer.bind(SampleEvaluator).toSelf(); +globalContainer.bind(SampleEvaluator).toSelf().inRequestScope(); diff --git a/packages/plugin-di/src/_examples/sampleProvider.ts b/packages/plugin-di/src/_examples/sampleProvider.ts index 2cc51514b34..a3344acd055 100644 --- a/packages/plugin-di/src/_examples/sampleProvider.ts +++ b/packages/plugin-di/src/_examples/sampleProvider.ts @@ -1,4 +1,4 @@ -import { injectable } from "inversify"; +import { inject, injectable } from "inversify"; import { Provider, IAgentRuntime, @@ -9,6 +9,14 @@ import { import { InjectableProvider } from "../types"; import { globalContainer } from "../di"; +// Dynamic Data Provider + +globalContainer + .bind>("DYNAMIC_DATA") + .toDynamicValue(async () => { + return Promise.resolve({ key: "value" }); + }); + /** * Sample Provider */ @@ -18,6 +26,11 @@ export class SampleProvider { private _sharedInstance: Record; + constructor( + @inject("DYNAMIC_DATA") + private readonly dynamicData: Record + ) {} + // ---- Implementing the InjectableProvider interface ---- async getInstance( @@ -34,11 +47,14 @@ export class SampleProvider async get( _runtime: IAgentRuntime, _message: Memory, - _state: State - ): Promise { + _state?: State + ): Promise { elizaLogger.log("Retrieving data in sampleProvider..."); + return `Shared instance data: ${JSON.stringify(this._sharedInstance)} +Dynamic data: ${JSON.stringify(this.dynamicData)} +`; } } // Register the provider with the global container -globalContainer.bind(SampleProvider).toSelf(); +globalContainer.bind(SampleProvider).toSelf().inSingletonScope(); diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 9eca2bea0dc..91eba1df6ef 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -16,7 +16,7 @@ import { createZodSchema, loadPropertyDescriptions, } from "../decorators"; -import { ActionOptions, InjactableAction } from "../types"; +import type { ActionOptions, InjactableAction } from "../types"; import { buildContentOutputTemplate } from "../templates"; /** diff --git a/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts b/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts index 3d02b051991..0b580a1870a 100644 --- a/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts +++ b/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts @@ -6,7 +6,7 @@ import { State, HandlerCallback, } from "@elizaos/core"; -import { EvaluatorOptions, InjactableEvaluator } from "../types"; +import type { EvaluatorOptions, InjactableEvaluator } from "../types"; /** * Base abstract class for injectable actions From d3fe6df9c89060b0880b3c7adda8da3d0369fd34 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 20:30:38 +0800 Subject: [PATCH 09/39] fix: improve null safety in normalizeCharacter function - Updated the normalizeCharacter function to use optional chaining for plugin properties, enhancing null safety. - Removed unnecessary return statements to streamline the code flow, ensuring that the function consistently returns the plugin object when valid. --- packages/plugin-di/src/factories/charactor.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/plugin-di/src/factories/charactor.ts b/packages/plugin-di/src/factories/charactor.ts index e14cc817676..cd9d40fcbce 100644 --- a/packages/plugin-di/src/factories/charactor.ts +++ b/packages/plugin-di/src/factories/charactor.ts @@ -17,8 +17,8 @@ export async function normalizeCharacter( const normalizePlugin = async (plugin: any) => { if ( - typeof plugin.name === "string" && - typeof plugin.description === "string" + typeof plugin?.name === "string" && + typeof plugin?.description === "string" ) { try { const normalized = await createPlugin(plugin); @@ -29,11 +29,9 @@ export async function normalizeCharacter( `Error normalizing plugin: ${plugin.name}`, e.message ); - return undefined; } - } else { - return undefined; } + return plugin; }; let plugins: Plugin[] = []; From 057196a463a004ad0df75046beb75e96263b2a73 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 20:33:26 +0800 Subject: [PATCH 10/39] feat: apply di in agent index.ts --- agent/package.json | 1 + agent/src/index.ts | 4 + pnpm-lock.yaml | 221 +++++++++------------------------------------ 3 files changed, 50 insertions(+), 176 deletions(-) diff --git a/agent/package.json b/agent/package.json index 78d771b4e5a..777f865e5b4 100644 --- a/agent/package.json +++ b/agent/package.json @@ -38,6 +38,7 @@ "@elizaos/plugin-binance": "workspace:*", "@elizaos/plugin-avail": "workspace:*", "@elizaos/plugin-bootstrap": "workspace:*", + "@elizaos/plugin-di": "workspace:*", "@elizaos/plugin-cosmos": "workspace:*", "@elizaos/plugin-intiface": "workspace:*", "@elizaos/plugin-coinbase": "workspace:*", diff --git a/agent/src/index.ts b/agent/src/index.ts index 6c33f6a09fb..73fee460f8b 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -33,6 +33,7 @@ import { import { zgPlugin } from "@elizaos/plugin-0g"; import { bootstrapPlugin } from "@elizaos/plugin-bootstrap"; +import { normalizeCharacter } from "@elizaos/plugin-di"; import createGoatPlugin from "@elizaos/plugin-goat"; // import { intifacePlugin } from "@elizaos/plugin-intiface"; import { DirectClient } from "@elizaos/client-direct"; @@ -901,6 +902,9 @@ const startAgents = async () => { characters = await loadCharacters(charactersArg); } + // Normalize characters for injactable plugins + characters = await Promise.all(characters.map(normalizeCharacter)); + try { for (const character of characters) { await startAgent(character, directClient); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5228ed37b8c..dc6a609b8ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,7 +78,7 @@ importers: version: 9.1.7 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + version: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) lerna: specifier: 8.1.5 version: 8.1.5(@swc/core@1.10.4(@swc/helpers@0.5.15))(babel-plugin-macros@3.1.0)(encoding@0.1.13) @@ -90,7 +90,7 @@ importers: version: 3.4.1 ts-jest: specifier: ^29.1.1 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)))(typescript@5.6.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0))(typescript@5.6.3) turbo: specifier: 2.3.3 version: 2.3.3 @@ -202,6 +202,9 @@ importers: '@elizaos/plugin-depin': specifier: workspace:* version: link:../packages/plugin-depin + '@elizaos/plugin-di': + specifier: workspace:* + version: link:../packages/plugin-di '@elizaos/plugin-echochambers': specifier: workspace:* version: link:../packages/plugin-echochambers @@ -749,13 +752,13 @@ importers: dependencies: '@discordjs/opus': specifier: github:discordjs/opus - version: https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13) + version: git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(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/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10) + version: 0.17.0(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10) '@elizaos/core': specifier: workspace:* version: link:../core @@ -770,7 +773,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/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) + version: 1.3.5(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) whatwg-url: specifier: 7.1.0 version: 7.1.0 @@ -4424,8 +4427,8 @@ packages: resolution: {integrity: sha512-YJOVVZ545x24mHzANfYoy0BJX5PDyeZlpiJjDkUBM/V/Ao7TFX9lcUvCN4nr0tbr5ubeaXxtEBILUrHtTphVeQ==} hasBin: true - '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02': - resolution: {tarball: https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02} + '@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02': + resolution: {commit: 31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02, repo: git@github.com:discordjs/opus.git, type: git} version: 0.9.0 engines: {node: '>=12.0.0'} @@ -21612,7 +21615,7 @@ snapshots: '@acuminous/bitsyntax@0.1.2': dependencies: buffer-more-ints: 1.0.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) safe-buffer: 5.1.2 transitivePeerDependencies: - supports-color @@ -22779,7 +22782,7 @@ snapshots: '@babel/traverse': 7.26.4 '@babel/types': 7.26.3 convert-source-map: 2.0.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -23559,7 +23562,7 @@ snapshots: '@babel/parser': 7.26.3 '@babel/template': 7.25.9 '@babel/types': 7.26.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -23706,7 +23709,7 @@ snapshots: dependencies: '@scure/bip32': 1.6.1 abitype: 1.0.8(typescript@5.6.3)(zod@3.24.1) - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) axios-mock-adapter: 1.22.0(axios@1.7.9) axios-retry: 4.5.0(axios@1.7.9) bip32: 4.0.0 @@ -24480,7 +24483,7 @@ snapshots: - encoding - supports-color - '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13)': + '@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13)': dependencies: '@discordjs/node-pre-gyp': 0.4.5(encoding@0.1.13) node-addon-api: 8.3.0 @@ -24502,11 +24505,11 @@ snapshots: '@discordjs/util@1.1.1': {} - '@discordjs/voice@0.17.0(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10)': + '@discordjs/voice@0.17.0(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10)': dependencies: '@types/ws': 8.5.13 discord-api-types: 0.37.83 - prism-media: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) + prism-media: 1.3.5(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) tslib: 2.8.1 ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) transitivePeerDependencies: @@ -25819,7 +25822,7 @@ snapshots: '@eslint/config-array@0.19.1': dependencies: '@eslint/object-schema': 2.1.5 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -25845,7 +25848,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -26718,41 +26721,6 @@ snapshots: - supports-color - ts-node - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3))': - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 22.10.5 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 3.9.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.8 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 @@ -32498,7 +32466,7 @@ snapshots: '@typescript-eslint/types': 8.16.0 '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.16.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) eslint: 9.16.0(jiti@2.4.2) optionalDependencies: typescript: 5.6.3 @@ -32544,7 +32512,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) '@typescript-eslint/utils': 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.6.3) - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) eslint: 9.16.0(jiti@2.4.2) ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: @@ -32583,7 +32551,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.16.0 '@typescript-eslint/visitor-keys': 8.16.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -32598,7 +32566,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.19.1 '@typescript-eslint/visitor-keys': 8.19.1 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -32784,14 +32752,6 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.4(vite@5.4.11(@types/node@20.17.9)(terser@5.37.0))': - dependencies: - '@vitest/spy': 2.1.4 - estree-walker: 3.0.3 - magic-string: 0.30.17 - optionalDependencies: - vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) - '@vitest/mocker@2.1.4(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0))': dependencies: '@vitest/spy': 2.1.4 @@ -33540,7 +33500,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -33992,7 +33952,7 @@ snapshots: axios-mock-adapter@1.22.0(axios@1.7.9): dependencies: - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) fast-deep-equal: 3.1.3 is-buffer: 2.0.5 @@ -34003,7 +33963,7 @@ snapshots: axios-retry@4.5.0(axios@1.7.9): dependencies: - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) is-retry-allowed: 2.2.0 axios@0.21.4: @@ -34014,7 +33974,7 @@ snapshots: axios@0.27.2: dependencies: - follow-redirects: 1.15.9 + follow-redirects: 1.15.9(debug@4.4.0) form-data: 4.0.1 transitivePeerDependencies: - debug @@ -34051,14 +34011,6 @@ snapshots: transitivePeerDependencies: - debug - axios@1.7.9: - dependencies: - follow-redirects: 1.15.9 - form-data: 4.0.1 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - axios@1.7.9(debug@4.4.0): dependencies: follow-redirects: 1.15.9(debug@4.4.0) @@ -35579,21 +35531,6 @@ snapshots: - supports-color - ts-node - create-jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - create-jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)): dependencies: '@jest/types': 29.6.3 @@ -36156,10 +36093,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.4.0: - dependencies: - ms: 2.1.3 - debug@4.4.0(supports-color@5.5.0): dependencies: ms: 2.1.3 @@ -37225,7 +37158,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) escape-string-regexp: 4.0.0 eslint-scope: 8.2.0 eslint-visitor-keys: 4.2.0 @@ -37866,8 +37799,6 @@ snapshots: async: 0.2.10 which: 1.3.1 - follow-redirects@1.15.9: {} - follow-redirects@1.15.9(debug@4.3.7): optionalDependencies: debug: 4.3.7 @@ -38928,7 +38859,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -38984,14 +38915,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -39585,7 +39516,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -39722,25 +39653,6 @@ snapshots: - supports-color - ts-node - jest-cli@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) - exit: 0.1.2 - import-local: 3.2.0 - jest-config: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - jest-cli@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(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.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) @@ -39871,37 +39783,6 @@ snapshots: - babel-plugin-macros - supports-color - jest-config@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): - dependencies: - '@babel/core': 7.26.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0(babel-plugin-macros@3.1.0) - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 22.10.5 - ts-node: 10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - jest-config@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)): dependencies: '@babel/core': 7.26.0 @@ -40240,18 +40121,6 @@ snapshots: - supports-color - ts-node - jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) - '@jest/types': 29.6.3 - import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(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.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) @@ -42481,7 +42350,7 @@ snapshots: '@yarnpkg/lockfile': 1.1.0 '@yarnpkg/parsers': 3.0.0-rc.46 '@zkochan/js-yaml': 0.0.7 - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) chalk: 4.1.0 cli-cursor: 3.1.0 cli-spinners: 2.6.1 @@ -44154,9 +44023,9 @@ snapshots: pretty-time@1.1.0: {} - prism-media@1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0): + prism-media@1.3.5(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0): optionalDependencies: - '@discordjs/opus': https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13) + '@discordjs/opus': git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13) ffmpeg-static: 5.2.0 prism-react-renderer@2.3.1(react@18.3.1): @@ -45717,7 +45586,7 @@ snapshots: socks-proxy-agent@8.0.5: dependencies: agent-base: 7.1.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -46772,12 +46641,12 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.6.3)) + jest: 29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.4(@swc/helpers@0.5.15))(@types/node@22.10.5)(typescript@5.7.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -46978,7 +46847,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.3.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -47012,7 +46881,7 @@ snapshots: tuf-js@2.2.1: dependencies: '@tufjs/models': 2.0.1 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) make-fetch-happen: 13.0.1 transitivePeerDependencies: - supports-color @@ -47752,7 +47621,7 @@ snapshots: vite-node@2.1.4(@types/node@20.17.9)(terser@5.37.0): dependencies: cac: 6.7.14 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) pathe: 1.1.2 vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) transitivePeerDependencies: @@ -47786,7 +47655,7 @@ snapshots: vite-node@2.1.5(@types/node@22.10.5)(terser@5.37.0): dependencies: cac: 6.7.14 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) es-module-lexer: 1.6.0 pathe: 1.1.2 vite: 5.4.11(@types/node@22.10.5)(terser@5.37.0) @@ -47975,14 +47844,14 @@ snapshots: vitest@2.1.4(@types/node@20.17.9)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): dependencies: '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@20.17.9)(terser@5.37.0)) + '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0)) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.4 '@vitest/snapshot': 2.1.4 '@vitest/spy': 2.1.4 '@vitest/utils': 2.1.4 chai: 5.1.2 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) expect-type: 1.1.0 magic-string: 0.30.17 pathe: 1.1.2 @@ -48054,7 +47923,7 @@ snapshots: '@vitest/spy': 2.1.5 '@vitest/utils': 2.1.5 chai: 5.1.2 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) expect-type: 1.1.0 magic-string: 0.30.17 pathe: 1.1.2 From 4ee481213ec137ff2dcdc638c8cb90ee6b666fdd Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 21:13:50 +0800 Subject: [PATCH 11/39] feat: enhance error handling and null safety in plugin-di - Updated the `createPlugin` function to improve error handling for providers, actions, and evaluators by logging errors and filtering out undefined values. - Implemented optional chaining in the `buildContentOutputTemplate` function to enhance null safety when accessing examples. - Added a new test suite for normalizing characters, ensuring the integrity of plugins and their properties. --- packages/plugin-di/src/factories/plugin.ts | 78 ++++++++++++----- packages/plugin-di/src/templates.ts | 4 +- .../src/tests/normalizeCharacter.test.ts | 83 +++++++++++++++++++ 3 files changed, 141 insertions(+), 24 deletions(-) create mode 100644 packages/plugin-di/src/tests/normalizeCharacter.test.ts diff --git a/packages/plugin-di/src/factories/plugin.ts b/packages/plugin-di/src/factories/plugin.ts index 65e7cdf9122..fc35f191cc8 100644 --- a/packages/plugin-di/src/factories/plugin.ts +++ b/packages/plugin-di/src/factories/plugin.ts @@ -1,4 +1,5 @@ import { interfaces } from "inversify"; +import { elizaLogger } from "@elizaos/core"; import type { ExtendedPlugin, PluginFactory, PluginOptions } from "../types"; /** @@ -17,42 +18,75 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { // For class constructors (functions), get instance from container // For regular providers, use as-is if (typeof opts.providers !== "undefined") { - plugin.providers = await Promise.all( - opts.providers.map(async (provider) => { - if (typeof provider === "function") { - return await ctx.container.getAsync(provider); // Get instance from DI container - } - return provider; // Use provider directly - }) - ); + plugin.providers = ( + await Promise.all( + opts.providers.map(async (provider) => { + if (typeof provider === "function") { + try { + return await ctx.container.getAsync(provider); // Get instance from DI container + } catch (e) { + elizaLogger.error( + `Error normalizing provider: ${provider.name}`, + e.message + ); + return undefined; // Return undefined if failed to get instance + } + } + return provider; // Use provider directly + }) + ) + ).filter((provider) => provider !== undefined); // Filter out undefined providers } // Handle actions - if provided, map through them // For class constructors (functions), get instance from container // For regular actions, use as-is if (typeof opts.actions !== "undefined") { - plugin.actions = await Promise.all( - opts.actions.map( - async (action) => - typeof action === "function" - ? await ctx.container.getAsync(action) // Get instance from DI container - : action // Use action directly + plugin.actions = ( + await Promise.all( + opts.actions.map(async (action) => { + if (typeof action === "function") { + try { + return await ctx.container.getAsync(action); // Get instance from DI container + } catch (e) { + elizaLogger.error( + `Error normalizing action: ${action.name}`, + e.message + ); + console.error(e); + return undefined; // Return undefined if failed to get instance + } + } else { + return action; // Use action directly + } + }) ) - ); + ).filter((action) => action !== undefined); // Filter out undefined actions } // Handle evaluators - if provided, map through them // For class constructors (functions), get instance from container // For regular evaluators, use as-is if (typeof opts.evaluators !== "undefined") { - plugin.evaluators = await Promise.all( - opts.evaluators.map( - async (evaluator) => - typeof evaluator === "function" - ? await ctx.container.getAsync(evaluator) // Get instance from DI container - : evaluator // Use evaluator directly + plugin.evaluators = ( + await Promise.all( + opts.evaluators.map(async (evaluator) => { + if (typeof evaluator === "function") { + try { + return await ctx.container.getAsync(evaluator); // Get instance from DI container + } catch (e) { + elizaLogger.error( + `Error normalizing evaluator: ${evaluator.name}`, + e.message + ); + return undefined; // Return undefined if failed to get instance + } + } else { + return evaluator; // Use evaluator directly + } + }) ) - ); + ).filter((evaluator) => evaluator !== undefined); // Filter out undefined evaluators } // Handle services - if provided, assign directly diff --git a/packages/plugin-di/src/templates.ts b/packages/plugin-di/src/templates.ts index 16e3870323e..0b79712a62e 100644 --- a/packages/plugin-di/src/templates.ts +++ b/packages/plugin-di/src/templates.ts @@ -15,12 +15,12 @@ export function buildContentOutputTemplate( let propDesc = ""; Object.entries(properties).forEach(([key, { description, examples }]) => { propDesc += `- Field **"${key}"**: ${description}.`; - if (examples.length > 0) { + if (examples?.length > 0) { propDesc += " Examples or Rules for this field:\n"; } else { propDesc += "\n"; } - examples.forEach((example, index) => { + examples?.forEach((example, index) => { propDesc += ` ${index + 1}. ${example}\n`; }); }); diff --git a/packages/plugin-di/src/tests/normalizeCharacter.test.ts b/packages/plugin-di/src/tests/normalizeCharacter.test.ts new file mode 100644 index 00000000000..84a141d4544 --- /dev/null +++ b/packages/plugin-di/src/tests/normalizeCharacter.test.ts @@ -0,0 +1,83 @@ +import { describe, it, expect, beforeAll } from "vitest"; + +import { type Character, defaultCharacter } from "@elizaos/core"; + +import { normalizeCharacter } from "../../src/index"; +import samplePlugin from "../../src/_examples/samplePlugin"; + +describe("Normalize Character", () => { + let normalizedCharacter: Character; + + beforeAll(async () => { + const sampleCharacter = Object.assign({}, defaultCharacter, { + plugins: [samplePlugin], + }); + normalizedCharacter = await normalizeCharacter(sampleCharacter); + }); + + describe("Elements", () => { + it("should have a valid character", () => { + expect(normalizedCharacter).toBeTypeOf("object"); + expect(normalizedCharacter.name).toBe("Eliza"); + }); + + it("should have a valid plugins array", () => { + expect(Array.isArray(normalizedCharacter.plugins)).toBe(true); + expect(normalizedCharacter.plugins.length).toBe(1); + + const normalizedPlugin = normalizedCharacter.plugins[0]; + expect(normalizedPlugin.name).toBe(samplePlugin.name); + expect(normalizedPlugin.description).toBe(samplePlugin.description); + }); + + it("should have same providers as the sample plugin", () => { + const normalizedPlugin = normalizedCharacter.plugins[0]; + expect(normalizedPlugin.providers?.length).toBe(1); + }); + + it("should have same actions as the sample plugin", () => { + const normalizedPlugin = normalizedCharacter.plugins[0]; + expect(normalizedPlugin.actions?.length).toBe(1); + }); + + it("should have same evaluators as the sample plugin", () => { + const normalizedPlugin = normalizedCharacter.plugins[0]; + expect(normalizedPlugin.evaluators?.length).toBe(1); + }); + }); + + describe("Normalized Plugin", () => { + it("should be a valid plugin with sample provider", () => { + const normalizedPlugin = normalizedCharacter.plugins[0]; + + const normalizedProvider = normalizedPlugin.providers[0]; + expect(normalizedProvider).toBeTypeOf("object"); + expect(normalizedProvider.get).toBeTypeOf("function"); + }); + + it("should have a valid evaluator", () => { + const normalizedPlugin = normalizedCharacter.plugins[0]; + + const normalizedEvaluator = normalizedPlugin.evaluators[0]; + expect(normalizedEvaluator).toBeTypeOf("object"); + expect(normalizedEvaluator.name).toBeTypeOf("string"); + expect(normalizedEvaluator.description).toBeTypeOf("string"); + expect(Array.isArray(normalizedEvaluator.examples)).toBe(true); + expect(normalizedEvaluator.handler).toBeTypeOf("function"); + expect(normalizedEvaluator.validate).toBeTypeOf("function"); + expect(normalizedEvaluator.alwaysRun).toBeTypeOf("boolean"); + }); + + it("should have a valid action", () => { + const normalizedPlugin = normalizedCharacter.plugins[0]; + + const normalizedAction = normalizedPlugin.actions[0]; + expect(normalizedAction).toBeTypeOf("object"); + expect(normalizedAction.name).toBeTypeOf("string"); + expect(normalizedAction.description).toBeTypeOf("string"); + expect(Array.isArray(normalizedAction.examples)).toBe(true); + expect(normalizedAction.handler).toBeTypeOf("function"); + expect(normalizedAction.validate).toBeTypeOf("function"); + }); + }); +}); From a7d67ba3e7a028245322d8e5ae673002e0d3a8f0 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 21:46:49 +0800 Subject: [PATCH 12/39] docs: update README.md for Dependency Injection Plugin --- packages/plugin-di/README.md | 144 +++++++++++++++++++++++++++++------ 1 file changed, 122 insertions(+), 22 deletions(-) diff --git a/packages/plugin-di/README.md b/packages/plugin-di/README.md index 3d396d51a84..a56e5762970 100644 --- a/packages/plugin-di/README.md +++ b/packages/plugin-di/README.md @@ -1,39 +1,139 @@ -# Sample Plugin for Eliza +# Dependency Injection 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. +This plugin provides a dependency injection system for Eliza plugins. -## Description +## What is Dependency Injection? -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. +Dependency Injection is a design pattern that allows you to inject dependencies into a class or function. This pattern is useful for decoupling components and making your code more modular and testable. -## Actions +## Examples of How to build a Plugin using Dependency Injection -- **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. +Check the [example](./src/_examples/) folder for a simple example of how to create a plugin using Dependency Injection. -## Providers +## Decorators for Dependency Injection -- **sampleProvider**: This provider offers a mechanism to supply data or services to the plugin. It can be extended to include additional providers as needed. +This plugin provides a set of decorators that you can use to inject dependencies into your classes or functions. -## Evaluators +### From inversify -- **sampleEvaluator**: This evaluator provides a way to assess or analyze data within the plugin. It can be extended to include additional evaluators as needed. +We use the [inversify](https://inversify.io/) library to provide the dependency injection system. +The following decorators are provided by the [inversify](https://inversify.io/) library. -## Services +#### `@injectable` -- **[ServiceName]**: Description of the service and its functionality. This can be extended to include additional services as needed. +> Category: Class Decorator -## Clients +This decorator marks a class as injectable. This means that you can inject this class into other classes using the `@inject` decorator. -- **[ClientName]**: Description of the client and its functionality. This can be extended to include additional clients as needed. +```typescript +import { injectable } from "inversify"; -## How to Extend +@injectable() +class SampleClass { +} +``` -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. +Remember to register the class with the container before injecting it into other classes. -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. +```typescript +import { globalContainer } from "@elizaos/plugin-di"; -For more detailed information on how to extend the plugin, refer to the documentation provided in the Eliza platform. +// Register the class with the container as a singleton, this means that the class will be instantiated only once. +globalContainer.bind(SingletonClass).toSelf().inSingletonScope(); +// Register the class with the container as a request context, this means that the class will be instantiated for each request(in this case means each Character). +globalContainer.bind(CharactorContextClass).toSelf().inRequestScope(); +``` + +#### `@inject` + +> Category: Parameter Decorator + +This decorator marks a parameter as an injection target. This means that the parameter will be injected with the appropriate dependency when the class is instantiated. + +```typescript +import { injectable, inject } from "inversify"; + +@injectable() +class SampleClass { + constructor( + // Inject the SampleDependency as a public property of the class. + @inject("SampleDependency") public sampleDependency: SampleDependency + ) {} +} +``` + +### From di plugin + +DI plugin provides abstract classes that you can extend to create Injectable actions or evaluators. +And that provides the following decorators to improve the readability of the code. + +#### `@property` + +> Category: Property Decorator + +This decorator is used to define a property in an action content class which will be used to generate the action content object Schema and content description template for LLM object generation. + +```typescript +import { z } from 'zod'; +import { property } from "@elizaos/plugin-di"; + +class SampleActionContent { + @property({ + description: "Sample property description", + schema: z.string(), + }) + sampleProperty: string; +} +``` + +## Abstract Classes for Injaectable Actions and Evaluators + +This plugin provides abstract classes that you can extend to create Injectable actions or evaluators. + +### `BaseInjactableAction` + +This abstract class simplify the creation of injectable actions. +You don't need to think about the template for content generation, it will be generated automatically based on the properties of the content Class. +What you need to implement is the `execute` method. + +```typescript +import { injectable } from "inversify"; +import { BaseInjactableAction } from "@elizaos/plugin-di"; + +class SampleActionContent { + @property({ + description: "Sample property description", + schema: z.string(), + }) + property1: string; +} + +@injectable() +class SampleAction extends BaseInjactableAction { + constructor() { + super({ + /** general action constent options */ + contentClass: SampleActionContent, + }); + } + + /** + * It will be called by `handler` function when the action is triggered. + */ + async execute( + content: SampleActionContent | null, + runtime: IAgentRuntime, + message: Memory, + state: State, + callback?: HandlerCallback + ): Promise { + // Your action logic here + } +} +``` + +### `BaseInjactableEvaluator` + +This abstract class simplify the creation of injectable evaluators. + +Please refer to the [sampleEvalutor](./src/_examples/sampleEvalutor.ts) for an example of how to create an evaluator. From 18451afe825dc0f66a38632c6acaa2ce66be6c03 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 22:07:42 +0800 Subject: [PATCH 13/39] fix: correct typo in comment for character normalization in index.ts --- agent/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/src/index.ts b/agent/src/index.ts index 73fee460f8b..68f801530a0 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -902,7 +902,7 @@ const startAgents = async () => { characters = await loadCharacters(charactersArg); } - // Normalize characters for injactable plugins + // Normalize characters for injectable plugins characters = await Promise.all(characters.map(normalizeCharacter)); try { From 0a5fed5816c4e0b299978bc31c794da4f98eb1aa Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 23:26:08 +0800 Subject: [PATCH 14/39] feat: add external dependencies for plugin-di - Included "inversify", "reflect-metadata", "zod", and "uuid" as external modules in the tsup configuration to enhance functionality and support for dependency injection and validation. --- packages/plugin-di/tsup.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/plugin-di/tsup.config.ts b/packages/plugin-di/tsup.config.ts index ad6d9fa1e6d..056c8021764 100644 --- a/packages/plugin-di/tsup.config.ts +++ b/packages/plugin-di/tsup.config.ts @@ -15,5 +15,9 @@ export default defineConfig({ "agentkeepalive", "safe-buffer", // Add other modules you want to externalize + "inversify", + "reflect-metadata", + "zod", + "uuid", ], }); From 41b9d4110bcd6704ff40eb181b6145f62bafc555 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 23:30:22 +0800 Subject: [PATCH 15/39] fix: pnpm-lock.yaml --- pnpm-lock.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52d23c4a949..4fd97001bea 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -752,13 +752,13 @@ importers: dependencies: '@discordjs/opus': specifier: github:discordjs/opus - version: git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13) + version: https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(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@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10) + version: 0.17.0(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10) '@elizaos/core': specifier: workspace:* version: link:../core @@ -773,7 +773,7 @@ importers: version: 0.7.15 prism-media: specifier: 1.3.5 - version: 1.3.5(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) + version: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) whatwg-url: specifier: 7.1.0 version: 7.1.0 @@ -1495,7 +1495,7 @@ importers: version: 10.0.0 tsup: specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.4(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) vitest: specifier: 2.1.4 version: 2.1.4(@types/node@20.17.9)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) @@ -4411,8 +4411,8 @@ packages: resolution: {integrity: sha512-YJOVVZ545x24mHzANfYoy0BJX5PDyeZlpiJjDkUBM/V/Ao7TFX9lcUvCN4nr0tbr5ubeaXxtEBILUrHtTphVeQ==} hasBin: true - '@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02': - resolution: {commit: 31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02, repo: git@github.com:discordjs/opus.git, type: git} + '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02': + resolution: {tarball: https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02} version: 0.9.0 engines: {node: '>=12.0.0'} @@ -24467,7 +24467,7 @@ snapshots: - encoding - supports-color - '@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13)': + '@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13)': dependencies: '@discordjs/node-pre-gyp': 0.4.5(encoding@0.1.13) node-addon-api: 8.3.0 @@ -24489,11 +24489,11 @@ snapshots: '@discordjs/util@1.1.1': {} - '@discordjs/voice@0.17.0(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10)': + '@discordjs/voice@0.17.0(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(bufferutil@4.0.9)(ffmpeg-static@5.2.0)(utf-8-validate@5.0.10)': dependencies: '@types/ws': 8.5.13 discord-api-types: 0.37.83 - prism-media: 1.3.5(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) + prism-media: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) tslib: 2.8.1 ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) transitivePeerDependencies: @@ -44007,9 +44007,9 @@ snapshots: pretty-time@1.1.0: {} - prism-media@1.3.5(@discordjs/opus@git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0): + prism-media@1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0): optionalDependencies: - '@discordjs/opus': git+https://git@github.com:discordjs/opus.git#31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13) + '@discordjs/opus': https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13) ffmpeg-static: 5.2.0 prism-react-renderer@2.3.1(react@18.3.1): From 96dd1aec93caee13587329c8b556541c8f633b96 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 10 Jan 2025 23:59:03 +0800 Subject: [PATCH 16/39] refactor: remove ExtendedPlugin type and update createPlugin return type - Removed the ExtendedPlugin type definition from types.ts to simplify the type structure. - Updated the createPlugin function in plugin.ts to return a Plugin type instead of ExtendedPlugin, reflecting the changes in the type definitions. --- packages/plugin-di/src/factories/plugin.ts | 9 ++++----- packages/plugin-di/src/types.ts | 7 ------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/plugin-di/src/factories/plugin.ts b/packages/plugin-di/src/factories/plugin.ts index fc35f191cc8..5ab0b2dc39f 100644 --- a/packages/plugin-di/src/factories/plugin.ts +++ b/packages/plugin-di/src/factories/plugin.ts @@ -1,17 +1,16 @@ import { interfaces } from "inversify"; -import { elizaLogger } from "@elizaos/core"; -import type { ExtendedPlugin, PluginFactory, PluginOptions } from "../types"; +import { elizaLogger, Plugin } from "@elizaos/core"; +import type { PluginFactory, PluginOptions } from "../types"; /** * Create a plugin factory */ export function createPlugin(ctx: interfaces.Context): PluginFactory { - return async (opts: PluginOptions): Promise => { + return async (opts: PluginOptions): Promise => { // Create a new plugin object - const plugin: ExtendedPlugin = { + const plugin: Plugin = { name: opts.name, description: opts.description, - options: opts, }; // Handle providers - if provided, map through them diff --git a/packages/plugin-di/src/types.ts b/packages/plugin-di/src/types.ts index f823ac54079..b6b42aee738 100644 --- a/packages/plugin-di/src/types.ts +++ b/packages/plugin-di/src/types.ts @@ -105,13 +105,6 @@ export type PluginOptions = Pick< evaluators?: (Evaluator | InjectableEvaluatorClass)[]; }; -/** - * Extended plugin interface - */ -export type ExtendedPlugin = Plugin & { - options: PluginOptions; -}; - /** * Factory type for creating a plugin */ From 10a530c8ea12f851b1707d9694d41287b68e4767 Mon Sep 17 00:00:00 2001 From: Sayo Date: Sat, 11 Jan 2025 02:58:11 +0530 Subject: [PATCH 17/39] Update packages/plugin-di/src/actions/baseInjectableAction.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- packages/plugin-di/src/actions/baseInjectableAction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 91eba1df6ef..728fbfeae2b 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -23,7 +23,7 @@ import { buildContentOutputTemplate } from "../templates"; * Base abstract class for injectable actions */ @injectable() -export abstract class BaseInjactableAction implements InjactableAction { +export abstract class BaseInjectableAction implements InjectableAction { // -------- Properties -------- public name: string; public similes: string[]; From 534f0a6a400b2a3e0b651266c641c10b0763c8a5 Mon Sep 17 00:00:00 2001 From: Sayo Date: Sat, 11 Jan 2025 02:58:22 +0530 Subject: [PATCH 18/39] Update packages/plugin-di/src/actions/baseInjectableAction.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- packages/plugin-di/src/actions/baseInjectableAction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 728fbfeae2b..947dfb6eae3 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -164,7 +164,7 @@ export abstract class BaseInjectableAction implements InjectableAction { runtime, context: actionContext, modelClass: ModelClass.SMALL, - schema: this.contentSchema as any, + schema: this.contentSchema, }); elizaLogger.debug("Response: ", resourceDetails.object); From 85ed71ce9eb8c612bb727bd29bcd8258c98899c6 Mon Sep 17 00:00:00 2001 From: Sayo Date: Sat, 11 Jan 2025 02:58:31 +0530 Subject: [PATCH 19/39] Update packages/plugin-di/src/actions/baseInjectableAction.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- packages/plugin-di/src/actions/baseInjectableAction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 947dfb6eae3..978fac295df 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -16,7 +16,7 @@ import { createZodSchema, loadPropertyDescriptions, } from "../decorators"; -import type { ActionOptions, InjactableAction } from "../types"; +import type { ActionOptions, InjectableAction } from "../types"; import { buildContentOutputTemplate } from "../templates"; /** From 512d3dedd4853eb1f2ca10986a59e5938578a6a1 Mon Sep 17 00:00:00 2001 From: Sayo Date: Sat, 11 Jan 2025 03:07:55 +0530 Subject: [PATCH 20/39] Update package.json --- packages/plugin-di/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-di/package.json b/packages/plugin-di/package.json index 0058ada02dc..3ed8d2e9507 100644 --- a/packages/plugin-di/package.json +++ b/packages/plugin-di/package.json @@ -18,7 +18,7 @@ "files": [ "dist" ], - "dependencies": { + "dependencies": "dependencies": { "@elizaos/core": "workspace:*", "inversify": "^6.2.1", "reflect-metadata": "^0.2.2", From a29310b730641561d0e447542ae16e5e3f6e28fd Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Sat, 11 Jan 2025 15:53:06 +0800 Subject: [PATCH 21/39] Refactor: fix typo, rename Injactable to Injectable in plugin-di This commit updates the naming convention from `Injactable` to `Injectable` across the plugin-di package, enhancing clarity and consistency. Changes include: - Renaming classes and interfaces in README.md, types.ts, and example files. - Introducing a new `BaseInjectableEvaluator` class to replace the previous `BaseInjactableEvaluator`. - Updating imports and references throughout the codebase to reflect the new naming. These modifications improve the overall readability and maintainability of the code. --- packages/plugin-di/README.md | 8 ++++---- packages/plugin-di/src/_examples/sampleAction.ts | 4 ++-- packages/plugin-di/src/_examples/sampleEvalutor.ts | 4 ++-- ...eInjactableEvaluator.ts => baseInjectableEvaluator.ts} | 4 ++-- packages/plugin-di/src/evaluators/index.ts | 2 +- packages/plugin-di/src/types.ts | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) rename packages/plugin-di/src/evaluators/{baseInjactableEvaluator.ts => baseInjectableEvaluator.ts} (92%) diff --git a/packages/plugin-di/README.md b/packages/plugin-di/README.md index a56e5762970..e669e2c77fa 100644 --- a/packages/plugin-di/README.md +++ b/packages/plugin-di/README.md @@ -90,7 +90,7 @@ class SampleActionContent { This plugin provides abstract classes that you can extend to create Injectable actions or evaluators. -### `BaseInjactableAction` +### `BaseInjectableAction` This abstract class simplify the creation of injectable actions. You don't need to think about the template for content generation, it will be generated automatically based on the properties of the content Class. @@ -98,7 +98,7 @@ What you need to implement is the `execute` method. ```typescript import { injectable } from "inversify"; -import { BaseInjactableAction } from "@elizaos/plugin-di"; +import { BaseInjectableAction } from "@elizaos/plugin-di"; class SampleActionContent { @property({ @@ -109,7 +109,7 @@ class SampleActionContent { } @injectable() -class SampleAction extends BaseInjactableAction { +class SampleAction extends BaseInjectableAction { constructor() { super({ /** general action constent options */ @@ -132,7 +132,7 @@ class SampleAction extends BaseInjactableAction { } ``` -### `BaseInjactableEvaluator` +### `BaseInjectableEvaluator` This abstract class simplify the creation of injectable evaluators. diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index 29f0880eb08..964c00b4ccd 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -7,7 +7,7 @@ import { } from "@elizaos/core"; import { z } from "zod"; import { inject, injectable } from "inversify"; -import { BaseInjactableAction } from "../actions"; +import { BaseInjectableAction } from "../actions"; import { ActionOptions } from "../types"; import { property } from "../decorators"; import { globalContainer } from "../di"; @@ -90,7 +90,7 @@ const options: ActionOptions = { * CreateResourceAction */ @injectable() -export class CreateResourceAction extends BaseInjactableAction { +export class CreateResourceAction extends BaseInjectableAction { constructor( @inject(SampleProvider) private readonly sampleProvider: SampleProvider diff --git a/packages/plugin-di/src/_examples/sampleEvalutor.ts b/packages/plugin-di/src/_examples/sampleEvalutor.ts index 91cf8c4eb85..2245077517f 100644 --- a/packages/plugin-di/src/_examples/sampleEvalutor.ts +++ b/packages/plugin-di/src/_examples/sampleEvalutor.ts @@ -1,6 +1,6 @@ import { IAgentRuntime, Memory, State, elizaLogger } from "@elizaos/core"; import { injectable } from "inversify"; -import { BaseInjactableEvaluator } from "../evaluators"; +import { BaseInjectableEvaluator } from "../evaluators"; import { EvaluatorOptions } from "../types"; import { globalContainer } from "../di"; @@ -33,7 +33,7 @@ const options: EvaluatorOptions = { }; @injectable() -export class SampleEvaluator extends BaseInjactableEvaluator { +export class SampleEvaluator extends BaseInjectableEvaluator { constructor() { super(options); } diff --git a/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts b/packages/plugin-di/src/evaluators/baseInjectableEvaluator.ts similarity index 92% rename from packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts rename to packages/plugin-di/src/evaluators/baseInjectableEvaluator.ts index 0b580a1870a..45cd70a43ca 100644 --- a/packages/plugin-di/src/evaluators/baseInjactableEvaluator.ts +++ b/packages/plugin-di/src/evaluators/baseInjectableEvaluator.ts @@ -6,13 +6,13 @@ import { State, HandlerCallback, } from "@elizaos/core"; -import type { EvaluatorOptions, InjactableEvaluator } from "../types"; +import type { EvaluatorOptions, InjectableEvaluator } from "../types"; /** * Base abstract class for injectable actions */ @injectable() -export abstract class BaseInjactableEvaluator implements InjactableEvaluator { +export abstract class BaseInjectableEvaluator implements InjectableEvaluator { // -------- Properties -------- public alwaysRun: boolean; public name: string; diff --git a/packages/plugin-di/src/evaluators/index.ts b/packages/plugin-di/src/evaluators/index.ts index c3a5934c91a..682ebc23761 100644 --- a/packages/plugin-di/src/evaluators/index.ts +++ b/packages/plugin-di/src/evaluators/index.ts @@ -1 +1 @@ -export * from "./baseInjactableEvaluator"; +export * from "./baseInjectableEvaluator"; diff --git a/packages/plugin-di/src/types.ts b/packages/plugin-di/src/types.ts index b6b42aee738..339e108c46e 100644 --- a/packages/plugin-di/src/types.ts +++ b/packages/plugin-di/src/types.ts @@ -46,7 +46,7 @@ export type ActionOptions = Pick< /** * Interface of Injectable Action */ -export interface InjactableAction extends Action { +export interface InjectableAction extends Action { /** * Execute the action * @param content The content from processMessages @@ -66,7 +66,7 @@ export interface InjactableAction extends Action { */ export type InjectableActionClass = new ( ...args: Args -) => InjactableAction; +) => InjectableAction; /** * Evaluator options @@ -79,14 +79,14 @@ export type EvaluatorOptions = Pick< /** * Interface of Injectable Evaluator */ -export type InjactableEvaluator = Evaluator; +export type InjectableEvaluator = Evaluator; /** * The Class of Injectable Evaluator */ export type InjectableEvaluatorClass = new ( ...args: Args -) => InjactableEvaluator; +) => InjectableEvaluator; // ----------- Interfaces for Plugin ----------- From d2448dc79ec4ae65cf6301e6c45d9be93d6b57bc Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Sat, 11 Jan 2025 16:09:23 +0800 Subject: [PATCH 22/39] chore: update dependencies and fix typos in plugin-di - Removed outdated dependencies from pnpm-lock.yaml. - Updated zod version from ^3.24.1 to 3.23.8 in package.json and pnpm-lock.yaml. - Fixed import typos in samplePlugin.ts and README.md, changing 'sampleEvalutor' to 'sampleEvaluator'. - Added new sampleEvaluator class in sampleEvaluator.ts for improved functionality. - Enhanced test coverage in normalizeCharacter.test.ts to handle edge cases. These changes improve dependency management and code clarity. --- .../plugin/src/plugins/samplePlugin.ts | 2 +- packages/plugin-di/README.md | 2 +- packages/plugin-di/package.json | 4 ++-- .../{sampleEvalutor.ts => sampleEvaluator.ts} | 2 +- .../plugin-di/src/_examples/samplePlugin.ts | 2 +- .../src/actions/baseInjectableAction.ts | 2 +- .../src/tests/normalizeCharacter.test.ts | 7 +++++++ pnpm-lock.yaml | 21 ++++++------------- 8 files changed, 20 insertions(+), 22 deletions(-) rename packages/plugin-di/src/_examples/{sampleEvalutor.ts => sampleEvaluator.ts} (96%) diff --git a/packages/_examples/plugin/src/plugins/samplePlugin.ts b/packages/_examples/plugin/src/plugins/samplePlugin.ts index 90fd2898a16..477dc2697db 100644 --- a/packages/_examples/plugin/src/plugins/samplePlugin.ts +++ b/packages/_examples/plugin/src/plugins/samplePlugin.ts @@ -1,7 +1,7 @@ import { Plugin } from "@elizaos/core"; import { createResourceAction } from "../actions/sampleAction"; import { sampleProvider } from "../providers/sampleProvider"; -import { sampleEvaluator } from "../evaluators/sampleEvalutor"; +import { sampleEvaluator } from "../evaluators/sampleEvaluator"; export const samplePlugin: Plugin = { name: "sample", diff --git a/packages/plugin-di/README.md b/packages/plugin-di/README.md index e669e2c77fa..73bb6e046ff 100644 --- a/packages/plugin-di/README.md +++ b/packages/plugin-di/README.md @@ -136,4 +136,4 @@ class SampleAction extends BaseInjectableAction { This abstract class simplify the creation of injectable evaluators. -Please refer to the [sampleEvalutor](./src/_examples/sampleEvalutor.ts) for an example of how to create an evaluator. +Please refer to the [sampleEvaluator](./src/_examples/sampleEvaluator.ts) for an example of how to create an evaluator. diff --git a/packages/plugin-di/package.json b/packages/plugin-di/package.json index 3ed8d2e9507..0bebf6b37ec 100644 --- a/packages/plugin-di/package.json +++ b/packages/plugin-di/package.json @@ -18,12 +18,12 @@ "files": [ "dist" ], - "dependencies": "dependencies": { + "dependencies": { "@elizaos/core": "workspace:*", "inversify": "^6.2.1", "reflect-metadata": "^0.2.2", "uuid": "11.0.3", - "zod": "^3.24.1" + "zod": "3.23.8" }, "devDependencies": { "@types/node": "^20.0.0", diff --git a/packages/plugin-di/src/_examples/sampleEvalutor.ts b/packages/plugin-di/src/_examples/sampleEvaluator.ts similarity index 96% rename from packages/plugin-di/src/_examples/sampleEvalutor.ts rename to packages/plugin-di/src/_examples/sampleEvaluator.ts index 2245077517f..822e227168d 100644 --- a/packages/plugin-di/src/_examples/sampleEvalutor.ts +++ b/packages/plugin-di/src/_examples/sampleEvaluator.ts @@ -43,7 +43,7 @@ export class SampleEvaluator extends BaseInjectableEvaluator { elizaLogger.log("Evaluating data in sampleEvaluator..."); // Example evaluation logic - if (memory.content && memory.content.text.includes("important")) { + if (memory.content?.text?.includes("important")) { elizaLogger.log("Important content found in memory."); return { score: 1, diff --git a/packages/plugin-di/src/_examples/samplePlugin.ts b/packages/plugin-di/src/_examples/samplePlugin.ts index 77ddcf1bf54..b72ae4fd43a 100644 --- a/packages/plugin-di/src/_examples/samplePlugin.ts +++ b/packages/plugin-di/src/_examples/samplePlugin.ts @@ -1,6 +1,6 @@ import { CreateResourceAction } from "./sampleAction"; import { SampleProvider } from "./sampleProvider"; -import { SampleEvaluator } from "./sampleEvalutor"; +import { SampleEvaluator } from "./sampleEvaluator"; import { PluginOptions } from "../types"; export const samplePlugin: PluginOptions = { diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 978fac295df..78756b10dff 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -164,7 +164,7 @@ export abstract class BaseInjectableAction implements InjectableAction { runtime, context: actionContext, modelClass: ModelClass.SMALL, - schema: this.contentSchema, + schema: this.contentSchema as z.ZodSchema, }); elizaLogger.debug("Response: ", resourceDetails.object); diff --git a/packages/plugin-di/src/tests/normalizeCharacter.test.ts b/packages/plugin-di/src/tests/normalizeCharacter.test.ts index 84a141d4544..3acef684c39 100644 --- a/packages/plugin-di/src/tests/normalizeCharacter.test.ts +++ b/packages/plugin-di/src/tests/normalizeCharacter.test.ts @@ -15,6 +15,13 @@ describe("Normalize Character", () => { normalizedCharacter = await normalizeCharacter(sampleCharacter); }); + // Add these test cases: + it("should handle empty plugins array", async () => { + const emptyPluginsChar = { ...defaultCharacter, plugins: [] }; + const normalized = await normalizeCharacter(emptyPluginsChar); + expect(normalized.plugins).toEqual([]); + }); + describe("Elements", () => { it("should have a valid character", () => { expect(normalizedCharacter).toBeTypeOf("object"); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 191f917e0a9..fc9bbb28b0a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1566,18 +1566,6 @@ importers: specifier: 7.1.0 version: 7.1.0 - packages/plugin-defillama: - dependencies: - '@elizaos/core': - specifier: workspace:* - version: link:../core - axios: - specifier: ^1.6.0 - version: 1.7.9(debug@4.4.0) - tsup: - specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.10.6(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.2)(yaml@2.7.0) - packages/plugin-depin: dependencies: '@elizaos/core': @@ -1608,8 +1596,8 @@ importers: specifier: 11.0.3 version: 11.0.3 zod: - specifier: ^3.24.1 - version: 3.24.1 + specifier: 3.23.8 + version: 3.23.8 devDependencies: '@types/node': specifier: ^20.0.0 @@ -2511,6 +2499,9 @@ importers: '@elizaos/core': specifier: workspace:* version: link:../core + '@elizaos/plugin-trustdb': + specifier: workspace:* + version: link:../plugin-trustdb '@uniswap/sdk-core': specifier: 6.0.0 version: 6.0.0 @@ -39081,7 +39072,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.4 + debug: 4.4.0(supports-color@5.5.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: From ef77a7329412326c293fe81232de25a51b97ec37 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Sat, 11 Jan 2025 16:13:49 +0800 Subject: [PATCH 23/39] fix: improve plugin normalization and export syntax in plugin-di - Updated the export syntax in index.ts for better clarity by removing quotes around "symbols". - Enhanced the normalization process in charactor.ts to log warnings when some plugins fail to normalize, improving error handling and debugging. These changes enhance code readability and robustness in plugin handling. --- packages/plugin-di/src/factories/charactor.ts | 15 ++++++++++++--- packages/plugin-di/src/index.ts | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/plugin-di/src/factories/charactor.ts b/packages/plugin-di/src/factories/charactor.ts index cd9d40fcbce..7cfcff11f1b 100644 --- a/packages/plugin-di/src/factories/charactor.ts +++ b/packages/plugin-di/src/factories/charactor.ts @@ -36,9 +36,18 @@ export async function normalizeCharacter( let plugins: Plugin[] = []; if (character.plugins?.length > 0) { - plugins = ( - await Promise.all(character.plugins.map(normalizePlugin)) - ).filter((plugin) => plugin !== undefined) as Plugin[]; + const normalizedPlugins = await Promise.all( + character.plugins.map(normalizePlugin) + ); + const validPlugins = normalizedPlugins.filter( + (plugin): plugin is Plugin => plugin !== undefined + ); + if (validPlugins.length !== character.plugins.length) { + elizaLogger.warn( + `Some plugins failed to normalize: ${character.plugins.length - validPlugins.length} failed` + ); + } + plugins = validPlugins; } return Object.assign({}, character, { plugins }) as Character; } diff --git a/packages/plugin-di/src/index.ts b/packages/plugin-di/src/index.ts index f848d357c6d..c45defee124 100644 --- a/packages/plugin-di/src/index.ts +++ b/packages/plugin-di/src/index.ts @@ -1,5 +1,5 @@ // Export all files for Eliza on Flow -export * as "symbols" from "./symbols"; +export * as symbols from "./symbols"; export * from "./decorators"; export * from "./types"; export * from "./factories"; From 33edd1e8939e03c98d30673093de3daaf6f1cd31 Mon Sep 17 00:00:00 2001 From: "BT.Wood(Tang Bo Hao)" Date: Sat, 11 Jan 2025 16:23:27 +0800 Subject: [PATCH 24/39] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- packages/plugin-di/src/_examples/sampleAction.ts | 2 +- packages/plugin-di/tsup.config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index 964c00b4ccd..49b7438df10 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -120,7 +120,7 @@ export class CreateResourceAction extends BaseInjectableAction Date: Sat, 11 Jan 2025 16:34:44 +0800 Subject: [PATCH 25/39] refactor: enhance error handling and code clarity in plugin-di - Improved error handling in CreateResourceAction by logging a specific error message when no content is provided. - Refactored plugin factory functions to utilize a new helper function, getInstanceFromContainer, for better readability and maintainability. - Streamlined the normalization process for providers, actions, and evaluators, ensuring consistent error logging and filtering of undefined values. These changes enhance the robustness and clarity of the plugin handling process. --- .../plugin-di/src/_examples/sampleAction.ts | 5 +- packages/plugin-di/src/factories/plugin.ts | 102 +++++++++--------- 2 files changed, 56 insertions(+), 51 deletions(-) diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index 49b7438df10..15fb397346f 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -114,8 +114,9 @@ export class CreateResourceAction extends BaseInjectableAction { if (!content) { - elizaLogger.warn("No content provided for the action."); - await callback?.({ text: "Failed to process the content." }, []); + const error = "No content provided for the action."; + elizaLogger.warn(error); + await callback?.({ text: error }, []); return; } diff --git a/packages/plugin-di/src/factories/plugin.ts b/packages/plugin-di/src/factories/plugin.ts index 5ab0b2dc39f..cecc39f701c 100644 --- a/packages/plugin-di/src/factories/plugin.ts +++ b/packages/plugin-di/src/factories/plugin.ts @@ -1,7 +1,39 @@ import { interfaces } from "inversify"; -import { elizaLogger, Plugin } from "@elizaos/core"; +import { + Action, + elizaLogger, + Evaluator, + Plugin, + Provider, +} from "@elizaos/core"; import type { PluginFactory, PluginOptions } from "../types"; +/** + * Get an instance from the container + * @param ctx + * @param item + * @param type + * @returns + */ +async function getInstanceFromContainer( + ctx: interfaces.Context, + item: T | Function, + type: string +): Promise { + if (typeof item === "function") { + try { + return await ctx.container.getAsync(item); + } catch (e) { + elizaLogger.error( + `Error normalizing ${type}: ${(item as Function).name}`, + e.message + ); + return undefined; + } + } + return item; +} + /** * Create a plugin factory */ @@ -19,22 +51,15 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { if (typeof opts.providers !== "undefined") { plugin.providers = ( await Promise.all( - opts.providers.map(async (provider) => { - if (typeof provider === "function") { - try { - return await ctx.container.getAsync(provider); // Get instance from DI container - } catch (e) { - elizaLogger.error( - `Error normalizing provider: ${provider.name}`, - e.message - ); - return undefined; // Return undefined if failed to get instance - } - } - return provider; // Use provider directly - }) + opts.providers.map((provider) => + getInstanceFromContainer( + ctx, + provider, + "provider" + ) + ) ) - ).filter((provider) => provider !== undefined); // Filter out undefined providers + ).filter(Boolean); // Filter out undefined providers } // Handle actions - if provided, map through them @@ -43,24 +68,11 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { if (typeof opts.actions !== "undefined") { plugin.actions = ( await Promise.all( - opts.actions.map(async (action) => { - if (typeof action === "function") { - try { - return await ctx.container.getAsync(action); // Get instance from DI container - } catch (e) { - elizaLogger.error( - `Error normalizing action: ${action.name}`, - e.message - ); - console.error(e); - return undefined; // Return undefined if failed to get instance - } - } else { - return action; // Use action directly - } - }) + opts.actions.map((action) => + getInstanceFromContainer(ctx, action, "action") + ) ) - ).filter((action) => action !== undefined); // Filter out undefined actions + ).filter(Boolean); // Filter out undefined actions } // Handle evaluators - if provided, map through them @@ -69,23 +81,15 @@ export function createPlugin(ctx: interfaces.Context): PluginFactory { if (typeof opts.evaluators !== "undefined") { plugin.evaluators = ( await Promise.all( - opts.evaluators.map(async (evaluator) => { - if (typeof evaluator === "function") { - try { - return await ctx.container.getAsync(evaluator); // Get instance from DI container - } catch (e) { - elizaLogger.error( - `Error normalizing evaluator: ${evaluator.name}`, - e.message - ); - return undefined; // Return undefined if failed to get instance - } - } else { - return evaluator; // Use evaluator directly - } - }) + opts.evaluators.map((evaluator) => + getInstanceFromContainer( + ctx, + evaluator, + "evaluator" + ) + ) ) - ).filter((evaluator) => evaluator !== undefined); // Filter out undefined evaluators + ).filter(Boolean); // Filter out undefined evaluators } // Handle services - if provided, assign directly From 2ac448fb08cdb54b7c6d635c99e9ba6586b48443 Mon Sep 17 00:00:00 2001 From: "BT.Wood(Tang Bo Hao)" Date: Sun, 12 Jan 2025 00:24:23 +0800 Subject: [PATCH 26/39] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../src/_examples/sampleEvaluator.ts | 38 ++++++++++++------- packages/plugin-di/src/factories/plugin.ts | 2 +- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/packages/plugin-di/src/_examples/sampleEvaluator.ts b/packages/plugin-di/src/_examples/sampleEvaluator.ts index 822e227168d..58a0a1d1c6c 100644 --- a/packages/plugin-di/src/_examples/sampleEvaluator.ts +++ b/packages/plugin-di/src/_examples/sampleEvaluator.ts @@ -38,23 +38,33 @@ export class SampleEvaluator extends BaseInjectableEvaluator { super(options); } - async handler(runtime: IAgentRuntime, memory: Memory, _state?: State) { + async handler(runtime: IAgentRuntime, memory: Memory) { // Evaluation logic for the evaluator elizaLogger.log("Evaluating data in sampleEvaluator..."); + try { + if (!memory.content || typeof memory.content.text !== 'string') { + return { + score: 0, + reason: "Invalid memory content structure", + }; + } - // Example evaluation logic - if (memory.content?.text?.includes("important")) { - elizaLogger.log("Important content found in memory."); - return { - score: 1, - reason: "Memory contains important content.", - }; - } else { - elizaLogger.log("No important content found in memory."); - return { - score: 0, - reason: "Memory does not contain important content.", - }; + if (memory.content.text.includes("important")) { + elizaLogger.log("Important content found in memory."); + return { + score: 1, + reason: "Memory contains important content.", + }; + } else { + elizaLogger.log("No important content found in memory."); + return { + score: 0, + reason: "Memory does not contain important content.", + }; + } + } catch (error) { + elizaLogger.error("Error in sampleEvaluator:", error); + throw error; } } } diff --git a/packages/plugin-di/src/factories/plugin.ts b/packages/plugin-di/src/factories/plugin.ts index cecc39f701c..e81fe6981c5 100644 --- a/packages/plugin-di/src/factories/plugin.ts +++ b/packages/plugin-di/src/factories/plugin.ts @@ -17,7 +17,7 @@ import type { PluginFactory, PluginOptions } from "../types"; */ async function getInstanceFromContainer( ctx: interfaces.Context, - item: T | Function, + item: T | (new (...args: any[]) => T), type: string ): Promise { if (typeof item === "function") { From 9a9d9e3a29cf394e8cbab5f84fa5d53620ea32b7 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Sun, 12 Jan 2025 00:27:14 +0800 Subject: [PATCH 27/39] feat: resolve coderabbitai --- packages/plugin-di/src/_examples/sampleAction.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index 15fb397346f..7527206f35d 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -121,7 +121,21 @@ export class CreateResourceAction extends BaseInjectableAction Date: Sun, 12 Jan 2025 13:37:07 +0800 Subject: [PATCH 28/39] Update packages/plugin-di/src/_examples/sampleAction.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- packages/plugin-di/src/_examples/sampleAction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-di/src/_examples/sampleAction.ts b/packages/plugin-di/src/_examples/sampleAction.ts index 7527206f35d..27658d4669c 100644 --- a/packages/plugin-di/src/_examples/sampleAction.ts +++ b/packages/plugin-di/src/_examples/sampleAction.ts @@ -146,7 +146,7 @@ export class CreateResourceAction extends BaseInjectableAction Date: Mon, 13 Jan 2025 10:02:45 +0800 Subject: [PATCH 29/39] chore: update pnpm-lock.yaml --- pnpm-lock.yaml | 279 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 245 insertions(+), 34 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b295cb02773..7247568216c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,9 @@ importers: csv-parse: specifier: 5.6.0 version: 5.6.0 + langdetect: + specifier: ^0.2.1 + version: 0.2.1 ollama-ai-provider: specifier: 0.16.1 version: 0.16.1(zod@3.24.1) @@ -268,6 +271,9 @@ importers: '@elizaos/plugin-near': specifier: workspace:* version: link:../packages/plugin-near + '@elizaos/plugin-nft-collections': + specifier: workspace:* + version: link:../packages/plugin-nft-collections '@elizaos/plugin-nft-generation': specifier: workspace:* version: link:../packages/plugin-nft-generation @@ -1674,7 +1680,7 @@ importers: version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) vitest: specifier: 2.1.4 - version: 2.1.4(@types/node@20.17.9)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) + version: 2.1.4(@types/node@20.17.9)(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-echochambers: dependencies: @@ -2111,6 +2117,46 @@ importers: specifier: 7.1.0 version: 7.1.0 + packages/plugin-nft-collections: + dependencies: + '@elizaos/core': + specifier: workspace:* + version: link:../core + '@elizaos/plugin-evm': + specifier: workspace:* + version: link:../plugin-evm + axios: + specifier: ^1.6.7 + version: 1.7.9(debug@4.4.0) + rate-limiter-flexible: + specifier: ^5.0.4 + version: 5.0.4 + devDependencies: + '@types/node': + specifier: ^20.11.16 + version: 20.17.9 + '@typescript-eslint/eslint-plugin': + specifier: ^6.21.0 + version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/parser': + specifier: ^6.21.0 + version: 6.21.0(eslint@8.57.1)(typescript@5.6.3) + eslint: + specifier: ^8.56.0 + version: 8.57.1 + prettier: + specifier: ^3.2.5 + version: 3.4.1 + tsup: + specifier: ^8.0.1 + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.6.3)(yaml@2.7.0) + typescript: + specifier: ^5.3.3 + version: 5.6.3 + vitest: + specifier: ^2.1.5 + version: 2.1.8(@types/node@20.17.9)(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-nft-generation: dependencies: '@elizaos/core': @@ -2908,9 +2954,6 @@ importers: specifier: 1.7.8 version: 1.7.8 devDependencies: - '@types/jest': - specifier: 29.5.14 - version: 29.5.14 '@types/node': specifier: 20.17.9 version: 20.17.9 @@ -2920,15 +2963,12 @@ importers: '@typescript-eslint/parser': specifier: 8.16.0 version: 8.16.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3) - jest: - specifier: 29.7.0 - version: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@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.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0))(typescript@5.6.3) typescript: specifier: 5.6.3 version: 5.6.3 + vitest: + specifier: ^1.2.1 + version: 1.2.1(@types/node@20.17.9)(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-zksync-era: dependencies: @@ -19042,6 +19082,9 @@ packages: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} + rate-limiter-flexible@5.0.4: + resolution: {integrity: sha512-ftYHrIfSqWYDIJZ4yPTrgOduByAp+86gUS9iklv0JoXVM8eQCAjTnydCj1hAT4MmhmkSw86NaFEJ28m/LC1pKA==} + raw-body@2.5.2: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} @@ -34015,6 +34058,26 @@ snapshots: '@types/node': 20.17.9 optional: true + '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)': + dependencies: + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.4.0(supports-color@5.5.0) + eslint: 8.57.1 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + semver: 7.6.3 + ts-api-utils: 1.4.3(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3))(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -34088,6 +34151,19 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.3)': + dependencies: + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.3) + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.4.0(supports-color@5.5.0) + eslint: 8.57.1 + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/parser@6.21.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@typescript-eslint/scope-manager': 6.21.0 @@ -34154,6 +34230,18 @@ snapshots: '@typescript-eslint/types': 8.19.1 '@typescript-eslint/visitor-keys': 8.19.1 + '@typescript-eslint/type-utils@6.21.0(eslint@8.57.1)(typescript@5.6.3)': + dependencies: + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.6.3) + debug: 4.4.0(supports-color@5.5.0) + eslint: 8.57.1 + ts-api-utils: 1.4.3(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/type-utils@6.21.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.3) @@ -34251,6 +34339,20 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/utils@6.21.0(eslint@8.57.1)(typescript@5.6.3)': + dependencies: + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.3) + eslint: 8.57.1 + semver: 7.6.3 + transitivePeerDependencies: + - supports-color + - typescript + '@typescript-eslint/utils@6.21.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0(jiti@2.4.2)) @@ -39668,7 +39770,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.4 + debug: 4.4.0(supports-color@5.5.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -42060,7 +42162,7 @@ snapshots: jest-diff@29.7.0: dependencies: - chalk: 4.1.0 + chalk: 4.1.2 diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 @@ -44168,7 +44270,7 @@ snapshots: array-differ: 3.0.0 array-union: 2.1.0 arrify: 2.0.1 - minimatch: 3.0.5 + minimatch: 3.1.2 multistream@4.1.0: dependencies: @@ -44602,7 +44704,7 @@ snapshots: '@yarnpkg/parsers': 3.0.0-rc.46 '@zkochan/js-yaml': 0.0.7 axios: 1.7.9(debug@4.4.0) - chalk: 4.1.0 + chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 cliui: 8.0.1 @@ -44893,7 +44995,7 @@ snapshots: ora@5.3.0: dependencies: bl: 4.1.0 - chalk: 4.1.0 + chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 is-interactive: 1.0.0 @@ -46631,6 +46733,8 @@ snapshots: range-parser@1.2.1: {} + rate-limiter-flexible@5.0.4: {} + raw-body@2.5.2: dependencies: bytes: 3.1.2 @@ -48923,25 +49027,6 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0))(typescript@5.6.3): - dependencies: - 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)(ts-node@10.9.2(@swc/core@1.10.7(@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 - make-error: 1.3.6 - semver: 7.6.3 - typescript: 5.6.3 - yargs-parser: 21.1.1 - optionalDependencies: - '@babel/core': 7.26.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.5)(babel-plugin-macros@3.1.0))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 @@ -50035,6 +50120,24 @@ snapshots: - supports-color - terser + vite-node@2.1.8(@types/node@20.17.9)(terser@5.37.0): + dependencies: + cac: 6.7.14 + debug: 4.4.0(supports-color@5.5.0) + es-module-lexer: 1.6.0 + pathe: 1.1.2 + vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vite-node@2.1.8(@types/node@22.10.5)(terser@5.37.0): dependencies: cac: 6.7.14 @@ -50257,6 +50360,42 @@ snapshots: - supports-color - terser + vitest@1.2.1(@types/node@20.17.9)(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): + dependencies: + '@vitest/expect': 1.2.1 + '@vitest/runner': 1.2.1 + '@vitest/snapshot': 1.2.1 + '@vitest/spy': 1.2.1 + '@vitest/utils': 1.2.1 + acorn-walk: 8.3.4 + cac: 6.7.14 + chai: 4.5.0 + debug: 4.4.0(supports-color@5.5.0) + execa: 8.0.1 + local-pkg: 0.5.1 + magic-string: 0.30.17 + pathe: 1.1.2 + picocolors: 1.1.1 + std-env: 3.8.0 + strip-literal: 1.3.0 + tinybench: 2.9.0 + tinypool: 0.8.4 + vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) + vite-node: 1.2.1(@types/node@20.17.9)(terser@5.37.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.17.9 + jsdom: 25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5) + transitivePeerDependencies: + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@1.2.1(@types/node@22.10.5)(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): dependencies: '@vitest/expect': 1.2.1 @@ -50329,6 +50468,42 @@ snapshots: - supports-color - terser + vitest@2.1.4(@types/node@20.17.9)(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): + dependencies: + '@vitest/expect': 2.1.4 + '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0)) + '@vitest/pretty-format': 2.1.8 + '@vitest/runner': 2.1.4 + '@vitest/snapshot': 2.1.4 + '@vitest/spy': 2.1.4 + '@vitest/utils': 2.1.4 + chai: 5.1.2 + debug: 4.4.0(supports-color@5.5.0) + expect-type: 1.1.0 + magic-string: 0.30.17 + pathe: 1.1.2 + std-env: 3.8.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinypool: 1.0.2 + tinyrainbow: 1.2.0 + vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) + vite-node: 2.1.4(@types/node@20.17.9)(terser@5.37.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.17.9 + jsdom: 25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5) + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@2.1.4(@types/node@22.10.5)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): dependencies: '@vitest/expect': 2.1.4 @@ -50437,6 +50612,42 @@ snapshots: - supports-color - terser + vitest@2.1.8(@types/node@20.17.9)(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): + dependencies: + '@vitest/expect': 2.1.8 + '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0)) + '@vitest/pretty-format': 2.1.8 + '@vitest/runner': 2.1.8 + '@vitest/snapshot': 2.1.8 + '@vitest/spy': 2.1.8 + '@vitest/utils': 2.1.8 + chai: 5.1.2 + debug: 4.4.0(supports-color@5.5.0) + expect-type: 1.1.0 + magic-string: 0.30.17 + pathe: 1.1.2 + std-env: 3.8.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinypool: 1.0.2 + tinyrainbow: 1.2.0 + vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) + vite-node: 2.1.8(@types/node@20.17.9)(terser@5.37.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.17.9 + jsdom: 25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5) + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@2.1.8(@types/node@22.10.5)(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): dependencies: '@vitest/expect': 2.1.8 From ba253c1624aad775fcb298de3564fb9cb88d287a Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Mon, 13 Jan 2025 14:59:07 -0800 Subject: [PATCH 30/39] fix: pnpm lock --- pnpm-lock.yaml | 108 ++----------------------------------------------- 1 file changed, 3 insertions(+), 105 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f04a0512544..4e51e8cda48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1686,7 +1686,7 @@ importers: version: 10.0.0 tsup: specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) vitest: specifier: 2.1.4 version: 2.1.4(@types/node@20.17.9)(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) @@ -34355,18 +34355,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@6.21.0(eslint@8.57.1)(typescript@5.6.3)': - dependencies: - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.3) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.6.3) - debug: 4.4.0(supports-color@5.5.0) - eslint: 8.57.1 - ts-api-utils: 1.4.3(typescript@5.6.3) - optionalDependencies: - typescript: 5.6.3 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/type-utils@6.21.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.6.3)': dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.3) @@ -50314,24 +50302,6 @@ snapshots: - supports-color - terser - vite-node@2.1.8(@types/node@22.10.5)(terser@5.37.0): - dependencies: - cac: 6.7.14 - debug: 4.4.0(supports-color@5.5.0) - es-module-lexer: 1.6.0 - pathe: 1.1.2 - vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - vite-node@2.1.8(@types/node@22.10.6)(terser@5.37.0): dependencies: cac: 6.7.14 @@ -50590,42 +50560,6 @@ snapshots: - supports-color - terser - vitest@1.2.1(@types/node@22.10.5)(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): - dependencies: - '@vitest/expect': 1.2.1 - '@vitest/runner': 1.2.1 - '@vitest/snapshot': 1.2.1 - '@vitest/spy': 1.2.1 - '@vitest/utils': 1.2.1 - acorn-walk: 8.3.4 - cac: 6.7.14 - chai: 4.5.0 - debug: 4.4.0(supports-color@5.5.0) - execa: 8.0.1 - local-pkg: 0.5.1 - magic-string: 0.30.17 - pathe: 1.1.2 - picocolors: 1.1.1 - std-env: 3.8.0 - strip-literal: 1.3.0 - tinybench: 2.9.0 - tinypool: 0.8.4 - vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) - vite-node: 1.2.1(@types/node@20.17.9)(terser@5.37.0) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/node': 20.17.9 - jsdom: 25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5) - transitivePeerDependencies: - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - vitest@1.2.1(@types/node@22.10.6)(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): dependencies: '@vitest/expect': 1.2.1 @@ -50701,7 +50635,7 @@ snapshots: vitest@2.1.4(@types/node@20.17.9)(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): dependencies: '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0)) + '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.6)(terser@5.37.0)) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.4 '@vitest/snapshot': 2.1.4 @@ -50734,7 +50668,7 @@ snapshots: - supports-color - terser - vitest@2.1.4(@types/node@22.10.5)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): + vitest@2.1.4(@types/node@22.10.6)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0): dependencies: '@vitest/expect': 2.1.4 '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.6)(terser@5.37.0)) @@ -50843,42 +50777,6 @@ snapshots: - terser vitest@2.1.8(@types/node@20.17.9)(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): - dependencies: - '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.5)(terser@5.37.0)) - '@vitest/pretty-format': 2.1.8 - '@vitest/runner': 2.1.8 - '@vitest/snapshot': 2.1.8 - '@vitest/spy': 2.1.8 - '@vitest/utils': 2.1.8 - chai: 5.1.2 - debug: 4.4.0(supports-color@5.5.0) - expect-type: 1.1.0 - magic-string: 0.30.17 - pathe: 1.1.2 - std-env: 3.8.0 - tinybench: 2.9.0 - tinyexec: 0.3.2 - tinypool: 1.0.2 - tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@20.17.9)(terser@5.37.0) - vite-node: 2.1.8(@types/node@20.17.9)(terser@5.37.0) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/node': 20.17.9 - jsdom: 25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5) - transitivePeerDependencies: - - less - - lightningcss - - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - vitest@2.1.8(@types/node@22.10.5)(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): dependencies: '@vitest/expect': 2.1.8 '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.6)(terser@5.37.0)) From 8c2cdad5641c758cf9d132a7b6a7d8fe0f2d0e09 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Mon, 13 Jan 2025 18:14:46 -0800 Subject: [PATCH 31/39] fix: update pnpm-lock and revert wrong modifications in default samplePlugin --- .../plugin/src/plugins/samplePlugin.ts | 2 +- pnpm-lock.yaml | 306 +++++++++++++++++- 2 files changed, 303 insertions(+), 5 deletions(-) diff --git a/packages/_examples/plugin/src/plugins/samplePlugin.ts b/packages/_examples/plugin/src/plugins/samplePlugin.ts index 477dc2697db..90fd2898a16 100644 --- a/packages/_examples/plugin/src/plugins/samplePlugin.ts +++ b/packages/_examples/plugin/src/plugins/samplePlugin.ts @@ -1,7 +1,7 @@ import { Plugin } from "@elizaos/core"; import { createResourceAction } from "../actions/sampleAction"; import { sampleProvider } from "../providers/sampleProvider"; -import { sampleEvaluator } from "../evaluators/sampleEvaluator"; +import { sampleEvaluator } from "../evaluators/sampleEvalutor"; export const samplePlugin: Plugin = { name: "sample", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a3ccd74167..5cfd17e0684 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -307,6 +307,9 @@ importers: '@elizaos/plugin-solana-agentkit': specifier: workspace:* version: link:../packages/plugin-solana-agentkit + '@elizaos/plugin-squid-router': + specifier: workspace:* + version: link:../packages/plugin-squid-router '@elizaos/plugin-stargaze': specifier: workspace:* version: link:../packages/plugin-stargaze @@ -2683,6 +2686,33 @@ importers: specifier: ^5.0.0 version: 5.6.3 + packages/plugin-squid-router: + dependencies: + '@0xsquid/sdk': + specifier: 2.8.29 + version: 2.8.29(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@0xsquid/squid-types': + specifier: 0.1.122 + version: 0.1.122(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10) + '@elizaos/core': + specifier: workspace:* + version: link:../core + ethers: + specifier: 6.8.1 + version: 6.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optional: + specifier: 0.1.4 + version: 0.1.4 + sharp: + specifier: 0.33.5 + version: 0.33.5 + tsup: + specifier: 8.3.5 + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + whatwg-url: + specifier: 7.1.0 + version: 7.1.0 + packages/plugin-stargaze: dependencies: '@elizaos/core': @@ -3067,6 +3097,14 @@ packages: graphql: ^15.5.0 || ^16.0.0 || ^17.0.0 typescript: ^5.0.0 + '@0xsquid/sdk@2.8.29': + resolution: {integrity: sha512-u8oJ67sN9rkc1VMoCuTYyNlSUxFrp5SXnium8YASii0NKuK+42uTUn5T+4gFKh529ZzChJTYgTXLVWk4Vja8Kg==} + + '@0xsquid/squid-types@0.1.122': + resolution: {integrity: sha512-rO1/a1l6RwzZrQY3V92spGKYzEk8DLl1KSNRqqytUqBZHPkwUSCP/nU4uahkimCLuvXmiVf/n31Xo9d8ytdjyA==} + peerDependencies: + typescript: ^5.3.3 + '@3land/listings-sdk@0.0.4': resolution: {integrity: sha512-Ljq8R4e7y+wl4m8BGhiInFPCHEzHZZFz1qghnbc8B3bLEKXWM9+2gZOCAa84rdUKuLfzenEdeS2LclTKhdKTFQ==} @@ -3084,6 +3122,9 @@ packages: resolution: {integrity: sha512-29lUK80d1muEQqiUsSo+3A0yP6CdspgC95EnKBMi22Xlwt79i/En4Vr67+cXhU+cZjbti3TgGGC5wy1stIywVQ==} engines: {node: '>=0.8'} + '@adraffy/ens-normalize@1.10.0': + resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==} + '@adraffy/ens-normalize@1.10.1': resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} @@ -3650,6 +3691,20 @@ packages: resolution: {integrity: sha512-5xK2SqGU1mzzsOeemy7cy3fGKxR1sEpUs4pEiIjaT0OIvU+fZaDVUEYWOqsgns6wI90XZEQJlXtI8uAHX/do5Q==} engines: {node: '>=18.0.0'} + '@axelar-network/axelar-cgp-solidity@6.4.0': + resolution: {integrity: sha512-Xnw5xi234B1cmTCzgudV8zq+DDjJ1d1U362CM0vKH1FWmZprKIdqgmOYkiRyu+QiVhnznKiBURiSEHVrNjtYpw==} + engines: {node: '>=18'} + + '@axelar-network/axelar-gmp-sdk-solidity@5.10.0': + resolution: {integrity: sha512-s8SImALvYB+5AeiT3tbfWNBI2Mhqw1x91i/zM3DNpVUCnAR2HKtsB9T84KnUn/OJjOVgb4h0lv7q9smeYniRPw==} + engines: {node: '>=18'} + + '@axelar-network/axelarjs-sdk@0.16.2': + resolution: {integrity: sha512-Fz/fovSzJRDNg9WrAzDffWzROe2Cm/e/f2OmwUossFbwm9xzZvoOHoJAEHd4T3ZK5SELqpcCBDvpe9wWtZDokg==} + + '@axelar-network/axelarjs-types@0.33.0': + resolution: {integrity: sha512-aCbX/5G+tgWPjr9tl3dQfJftWwRMkILz61ytach7dKqxtO9G9jlxpNvELJQ6gKVOodUtSY8qBCO/fWU19v4hdQ==} + '@babel/code-frame@7.26.2': resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} @@ -4534,6 +4589,9 @@ packages: '@cosmjs/encoding@0.32.4': resolution: {integrity: sha512-tjvaEy6ZGxJchiizzTn7HVRiyTg1i4CObRRaTRPknm5EalE13SV+TCHq38gIDfyUeden4fCuaBVEdBR5+ti7Hw==} + '@cosmjs/json-rpc@0.30.1': + resolution: {integrity: sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ==} + '@cosmjs/json-rpc@0.31.3': resolution: {integrity: sha512-7LVYerXjnm69qqYR3uA6LGCrBW2EO5/F7lfJxAmY+iII2C7xO3a0vAjMSt5zBBh29PXrJVS6c2qRP22W1Le2Wg==} @@ -4567,6 +4625,9 @@ packages: '@cosmjs/socket@0.32.4': resolution: {integrity: sha512-davcyYziBhkzfXQTu1l5NrpDYv0K9GekZCC9apBRvL1dvMc9F/ygM7iemHjUA+z8tJkxKxrt/YPjJ6XNHzLrkw==} + '@cosmjs/stargate@0.31.0-alpha.1': + resolution: {integrity: sha512-kCTUT3niB2hvcHjhlxpM8cNw1KOVmgZROdJUQaO8Ts4j22OyRZRFdwRPrOIuAKpqhVW2I1vI2HQL9Bg7pk9Glw==} + '@cosmjs/stargate@0.31.3': resolution: {integrity: sha512-53NxnzmB9FfXpG4KjOUAYAvWLYKdEmZKsutcat/u2BrDXNZ7BN8jim/ENcpwXfs9/Og0K24lEIdvA4gsq3JDQw==} @@ -4576,6 +4637,9 @@ packages: '@cosmjs/stargate@0.32.4': resolution: {integrity: sha512-usj08LxBSsPRq9sbpCeVdyLx2guEcOHfJS9mHGCLCXpdAPEIEQEtWLDpEUc0LEhWOx6+k/ChXTc5NpFkdrtGUQ==} + '@cosmjs/stream@0.30.1': + resolution: {integrity: sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ==} + '@cosmjs/stream@0.31.3': resolution: {integrity: sha512-8keYyI7X0RjsLyVcZuBeNjSv5FA4IHwbFKx7H60NHFXszN8/MvXL6aZbNIvxtcIHHsW7K9QSQos26eoEWlAd+w==} @@ -9144,6 +9208,9 @@ packages: resolution: {integrity: sha512-piUTHyp2Axx3p/kc2CIJkYSv0BAaheBQmbACZgQSSfWUumWNW+R1lL+H9PDBxKJkvOeEX+hKYEFiwO8xagL8AQ==} engines: {node: '>=18.0.0'} + '@socket.io/component-emitter@3.1.2': + resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==} + '@solana-developers/helpers@2.5.6': resolution: {integrity: sha512-NPWZblVMl4LuVVSJOZG0ZF0VYnrMUjCyMNTiGwNUXPK2WWYJCqpuDyzs/PMqwvM4gMTjk4pEToBX8N2UxDvZkQ==} @@ -10033,6 +10100,9 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} + '@types/node@18.15.13': + resolution: {integrity: sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==} + '@types/node@18.19.70': resolution: {integrity: sha512-RE+K0+KZoEpDUbGGctnGdkrLFwi1eYKTlIHNl2Um98mUkGsm1u2Ff6Ltd0e8DktTtC98uy7rSj+hO8t/QuLoVQ==} @@ -13424,6 +13494,13 @@ packages: end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + engine.io-client@6.6.2: + resolution: {integrity: sha512-TAr+NKeoVTjEVW8P3iHguO1LO6RlUz9O5Y8o7EY0fU+gY1NYqas7NN3slpFtbXEsLMHk0h90fJMfKjRkQ0qUIw==} + + engine.io-parser@5.2.3: + resolution: {integrity: sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==} + engines: {node: '>=10.0.0'} + enhanced-resolve@5.18.0: resolution: {integrity: sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==} engines: {node: '>=10.13.0'} @@ -13810,6 +13887,12 @@ packages: resolution: {integrity: sha512-Ij7U9OgVZc4MAui8BttPCEaWUrAXy+eo2IbVfIxZyfzfFxMQrbIWXRUbrsRBqRrIhJ75T8P+KQRKpKTaG0Du8Q==} engines: {node: ^14.21.3 || >=16, npm: '>=9'} + ethers-multicall-provider@5.0.0: + resolution: {integrity: sha512-dsfIwBSbr8yG+F0o87uoMFje1k5w988883MMJvK7R66mYT6NApQhQ7sMH/cxKGXTRf3at+nGt/4QIYHbYhe/8A==} + engines: {node: '>=12.0'} + peerDependencies: + lodash: ^4.17.0 + ethers@5.7.2: resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==} @@ -13817,6 +13900,10 @@ packages: resolution: {integrity: sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==} engines: {node: '>=14.0.0'} + ethers@6.8.1: + resolution: {integrity: sha512-iEKm6zox5h1lDn6scuRWdIdFJUCGg3+/aQWu0F4K0GVyEZiktFkqrJbRjTn1FlYEPz7RKA707D6g5Kdk6j7Ljg==} + engines: {node: '>=14.0.0'} + ethjs-unit@0.1.6: resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} engines: {node: '>=6.5.0', npm: '>=3'} @@ -20127,6 +20214,14 @@ packages: snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} + socket.io-client@4.8.1: + resolution: {integrity: sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==} + engines: {node: '>=10.0.0'} + + socket.io-parser@4.2.4: + resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==} + engines: {node: '>=10.0.0'} + sockjs@0.3.24: resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} @@ -20313,6 +20408,12 @@ packages: standard-as-callback@2.1.0: resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} + standard-error@1.1.0: + resolution: {integrity: sha512-4v7qzU7oLJfMI5EltUSHCaaOd65J6S4BqKRWgzMi4EYaE5fvNabPxmAPGdxpGXqrcWjhDGI/H09CIdEuUOUeXg==} + + standard-http-error@2.0.1: + resolution: {integrity: sha512-DX/xPIoyXQTuY6BMZK4Utyi4l3A4vFoafsfqrU6/dO4Oe/59c7PyqPd2IQj9m+ZieDg2K3RL9xOYJsabcD9IUA==} + starknet@6.18.0: resolution: {integrity: sha512-nlxz7bK/YBY8W8NUevkycxFwphsX27oi+4YCl36TYFdrJpTOMqmJDnZ27ssr7z0eEDQLQscIxt1gXrZzCJua7g==} @@ -20379,6 +20480,9 @@ packages: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} + string-similarity-js@2.1.4: + resolution: {integrity: sha512-uApODZNjCHGYROzDSAdCmAHf60L/pMDHnP/yk6TAbvGg7JSPZlSto/ceCI7hZEqzc53/juU2aOJFkM2yUVTMTA==} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -21074,6 +21178,9 @@ packages: tslib@1.9.3: resolution: {integrity: sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==} + tslib@2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} @@ -22515,6 +22622,18 @@ packages: utf-8-validate: optional: true + ws@8.5.0: + resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + wtf_wikipedia@10.3.2: resolution: {integrity: sha512-8C1eUKDK6NaosrtocTEA4fz5Lm5nO6Hb92zLUqI7S1uVVjwEtI0mvSGSdGd/xR1nfSpDYm1ckBG1aLHEAF1pBg==} engines: {node: '>=12.0.0'} @@ -22535,6 +22654,10 @@ packages: xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + xmlhttprequest-ssl@2.1.2: + resolution: {integrity: sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==} + engines: {node: '>=0.4.0'} + xsalsa20@1.2.0: resolution: {integrity: sha512-FIr/DEeoHfj7ftfylnoFt3rAIRoWXpx2AoDfrT2qD2wtp7Dp+COajvs/Icb7uHqRW9m60f5iXZwdsJJO3kvb7w==} @@ -22690,6 +22813,40 @@ snapshots: graphql: 16.10.0 typescript: 5.7.3 + '@0xsquid/sdk@2.8.29(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@cosmjs/cosmwasm-stargate': 0.32.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@cosmjs/encoding': 0.32.4 + '@cosmjs/stargate': 0.32.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/abstract-signer': 5.7.0 + '@ethersproject/wallet': 5.7.0 + '@project-serum/anchor': 0.26.0(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.95.3(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + axios: 1.7.9(debug@4.4.0) + bs58: 6.0.0 + cosmjs-types: 0.9.0 + ethers: 6.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + ethers-multicall-provider: 5.0.0(bufferutil@4.0.9)(lodash@4.17.21)(utf-8-validate@5.0.10) + lodash: 4.17.21 + long: 5.2.4 + transitivePeerDependencies: + - bufferutil + - debug + - encoding + - utf-8-validate + + '@0xsquid/squid-types@0.1.122(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10)': + dependencies: + '@axelar-network/axelarjs-sdk': 0.16.2(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@ethersproject/providers': 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + typescript: 5.7.3 + transitivePeerDependencies: + - bufferutil + - debug + - encoding + - supports-color + - utf-8-validate + '@3land/listings-sdk@0.0.4(@swc/core@1.10.7(@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)(typescript@5.7.3)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)) @@ -22735,6 +22892,8 @@ snapshots: transitivePeerDependencies: - supports-color + '@adraffy/ens-normalize@1.10.0': {} + '@adraffy/ens-normalize@1.10.1': {} '@adraffy/ens-normalize@1.11.0': {} @@ -23923,6 +24082,43 @@ snapshots: '@smithy/types': 4.1.0 tslib: 2.8.1 + '@axelar-network/axelar-cgp-solidity@6.4.0': + dependencies: + '@axelar-network/axelar-gmp-sdk-solidity': 5.10.0 + + '@axelar-network/axelar-gmp-sdk-solidity@5.10.0': {} + + '@axelar-network/axelarjs-sdk@0.16.2(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@axelar-network/axelar-cgp-solidity': 6.4.0 + '@axelar-network/axelarjs-types': 0.33.0 + '@cosmjs/json-rpc': 0.30.1 + '@cosmjs/stargate': 0.31.0-alpha.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@ethersproject/abstract-provider': 5.7.0 + '@ethersproject/networks': 5.7.1 + '@ethersproject/providers': 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@types/uuid': 8.3.4 + bech32: 2.0.0 + clone-deep: 4.0.1 + cross-fetch: 3.2.0(encoding@0.1.13) + ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + socket.io-client: 4.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + standard-http-error: 2.0.1 + string-similarity-js: 2.1.4 + uuid: 8.3.2 + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - debug + - encoding + - supports-color + - utf-8-validate + + '@axelar-network/axelarjs-types@0.33.0': + dependencies: + long: 5.2.4 + protobufjs: 7.4.0 + '@babel/code-frame@7.26.2': dependencies: '@babel/helper-validator-identifier': 7.25.9 @@ -24897,7 +25093,7 @@ snapshots: '@coinbase/wallet-sdk@4.2.4': dependencies: - '@noble/hashes': 1.6.1 + '@noble/hashes': 1.7.0 clsx: 1.2.1 eventemitter3: 5.0.1 preact: 10.25.4 @@ -25266,6 +25462,11 @@ snapshots: bech32: 1.1.4 readonly-date: 1.0.0 + '@cosmjs/json-rpc@0.30.1': + dependencies: + '@cosmjs/stream': 0.30.1 + xstream: 11.14.0 + '@cosmjs/json-rpc@0.31.3': dependencies: '@cosmjs/stream': 0.31.3 @@ -25348,6 +25549,25 @@ snapshots: - bufferutil - utf-8-validate + '@cosmjs/stargate@0.31.0-alpha.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@confio/ics23': 0.6.8 + '@cosmjs/amino': 0.31.3 + '@cosmjs/encoding': 0.31.3 + '@cosmjs/math': 0.31.3 + '@cosmjs/proto-signing': 0.31.3 + '@cosmjs/stream': 0.31.3 + '@cosmjs/tendermint-rpc': 0.31.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@cosmjs/utils': 0.31.3 + cosmjs-types: 0.8.0 + long: 4.0.0 + protobufjs: 6.11.4 + xstream: 11.14.0 + transitivePeerDependencies: + - bufferutil + - debug + - utf-8-validate + '@cosmjs/stargate@0.31.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: '@confio/ics23': 0.6.8 @@ -25401,6 +25621,10 @@ snapshots: - debug - utf-8-validate + '@cosmjs/stream@0.30.1': + dependencies: + xstream: 11.14.0 + '@cosmjs/stream@0.31.3': dependencies: xstream: 11.14.0 @@ -32522,6 +32746,8 @@ snapshots: '@smithy/types': 4.1.0 tslib: 2.8.1 + '@socket.io/component-emitter@3.1.2': {} + '@solana-developers/helpers@2.5.6(bufferutil@4.0.9)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10)': dependencies: '@solana/spl-token': 0.4.9(@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)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.3)(utf-8-validate@5.0.10) @@ -34018,6 +34244,8 @@ snapshots: '@types/node@17.0.45': {} + '@types/node@18.15.13': {} + '@types/node@18.19.70': dependencies: undici-types: 5.26.5 @@ -38843,6 +39071,20 @@ snapshots: dependencies: once: 1.4.0 + engine.io-client@6.6.2(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.3.7 + engine.io-parser: 5.2.3 + ws: 8.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + xmlhttprequest-ssl: 2.1.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + engine.io-parser@5.2.3: {} + enhanced-resolve@5.18.0: dependencies: graceful-fs: 4.2.11 @@ -39595,6 +39837,14 @@ snapshots: '@scure/bip32': 1.5.0 '@scure/bip39': 1.4.0 + ethers-multicall-provider@5.0.0(bufferutil@4.0.9)(lodash@4.17.21)(utf-8-validate@5.0.10): + dependencies: + ethers: 6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + lodash: 4.17.21 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + ethers@5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10): dependencies: '@ethersproject/abi': 5.7.0 @@ -39693,6 +39943,19 @@ snapshots: - bufferutil - utf-8-validate + ethers@6.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 18.15.13 + aes-js: 4.0.0-beta.5 + tslib: 2.4.0 + ws: 8.5.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + ethjs-unit@0.1.6: dependencies: bn.js: 4.11.6 @@ -45131,8 +45394,8 @@ snapshots: 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 + '@noble/curves': 1.8.0 + '@noble/hashes': 1.7.0 '@scure/bip32': 1.6.1 '@scure/bip39': 1.5.1 abitype: 1.0.7(typescript@5.7.3)(zod@3.24.1) @@ -48052,6 +48315,24 @@ snapshots: dot-case: 3.0.4 tslib: 2.8.1 + socket.io-client@4.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10): + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.3.7 + engine.io-client: 6.6.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + socket.io-parser: 4.2.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + socket.io-parser@4.2.4: + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.3.7 + transitivePeerDependencies: + - supports-color + sockjs@0.3.24: dependencies: faye-websocket: 0.11.4 @@ -48334,6 +48615,12 @@ snapshots: standard-as-callback@2.1.0: {} + standard-error@1.1.0: {} + + standard-http-error@2.0.1: + dependencies: + standard-error: 1.1.0 + starknet@6.18.0(encoding@0.1.13): dependencies: '@noble/curves': 1.3.0 @@ -48420,6 +48707,8 @@ snapshots: char-regex: 1.0.2 strip-ansi: 6.0.1 + string-similarity-js@2.1.4: {} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -49291,6 +49580,8 @@ snapshots: tslib@1.9.3: {} + tslib@2.4.0: {} + tslib@2.7.0: {} tslib@2.8.1: {} @@ -51536,6 +51827,11 @@ snapshots: bufferutil: 4.0.9 utf-8-validate: 6.0.5 + ws@8.5.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.9 + utf-8-validate: 5.0.10 + wtf_wikipedia@10.3.2(encoding@0.1.13): dependencies: isomorphic-unfetch: 3.1.0(encoding@0.1.13) @@ -51553,6 +51849,8 @@ snapshots: xmlchars@2.2.0: {} + xmlhttprequest-ssl@2.1.2: {} + xsalsa20@1.2.0: {} xstream@11.14.0: @@ -51687,4 +51985,4 @@ snapshots: zwitch@1.0.5: {} - zwitch@2.0.4: {} \ No newline at end of file + zwitch@2.0.4: {} From 49f7a0992a32ba7a3ebfa2c5b907621c7d30715a Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Mon, 13 Jan 2025 18:35:34 -0800 Subject: [PATCH 32/39] chore: change version to 0.1.8+build.1 like others --- packages/plugin-di/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-di/package.json b/packages/plugin-di/package.json index 0bebf6b37ec..6df158dfc85 100644 --- a/packages/plugin-di/package.json +++ b/packages/plugin-di/package.json @@ -1,6 +1,6 @@ { "name": "@elizaos/plugin-di", - "version": "0.1.7", + "version": "0.1.8+build.1", "type": "module", "main": "dist/index.js", "module": "dist/index.js", From 638c894a6db08465c34d5d07bdf52de761a794e1 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Wed, 15 Jan 2025 11:18:53 -0800 Subject: [PATCH 33/39] fix: pnpm-lock --- pnpm-lock.yaml | 219 +++++++++---------------------------------------- 1 file changed, 38 insertions(+), 181 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 50ad0208432..adcaadf3a94 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -220,12 +220,12 @@ importers: '@elizaos/plugin-depin': specifier: workspace:* version: link:../packages/plugin-depin - '@elizaos/plugin-di': - specifier: workspace:* - version: link:../packages/plugin-di '@elizaos/plugin-dexscreener': specifier: workspace:* version: link:../packages/plugin-dexscreener + '@elizaos/plugin-di': + specifier: workspace:* + version: link:../packages/plugin-di '@elizaos/plugin-echochambers': specifier: workspace:* version: link:../packages/plugin-echochambers @@ -1118,9 +1118,6 @@ importers: '@solana/web3.js': specifier: 1.95.8 version: 1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@tavily/core': - specifier: ^0.0.2 - version: 0.0.2 '@types/fluent-ffmpeg': specifier: 2.1.27 version: 2.1.27 @@ -1745,6 +1742,18 @@ importers: specifier: 7.1.0 version: 7.1.0 + packages/plugin-dexscreener: + dependencies: + '@elizaos/core': + specifier: workspace:* + version: link:../core + tsup: + specifier: 8.3.5 + version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + whatwg-url: + specifier: 7.1.0 + version: 7.1.0 + packages/plugin-di: dependencies: '@elizaos/core': @@ -1752,6 +1761,7 @@ importers: version: link:../core inversify: specifier: ^6.2.1 + version: 6.2.1(reflect-metadata@0.2.2) reflect-metadata: specifier: ^0.2.2 version: 0.2.2 @@ -1775,14 +1785,8 @@ importers: specifier: 2.1.4 version: 2.1.4(@types/node@20.17.9)(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-dexscreener: - tsup: - specifier: 8.3.5 - whatwg-url: - specifier: 7.1.0 - version: 7.1.0 - packages/plugin-echochambers: + dependencies: '@elizaos/core': specifier: workspace:* version: link:../core @@ -22977,7 +22981,7 @@ snapshots: '@acuminous/bitsyntax@0.1.2': dependencies: buffer-more-ints: 1.0.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) safe-buffer: 5.1.2 transitivePeerDependencies: - supports-color @@ -24230,7 +24234,7 @@ snapshots: '@babel/traverse': 7.26.5 '@babel/types': 7.26.5 convert-source-map: 2.0.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -25010,7 +25014,7 @@ snapshots: '@babel/parser': 7.26.5 '@babel/template': 7.25.9 '@babel/types': 7.26.5 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -25163,7 +25167,7 @@ snapshots: dependencies: '@scure/bip32': 1.6.1 abitype: 1.0.8(typescript@5.6.3)(zod@3.24.1) - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) axios-mock-adapter: 1.22.0(axios@1.7.9) axios-retry: 4.5.0(axios@1.7.9) bip32: 4.0.0 @@ -27472,7 +27476,7 @@ snapshots: '@eslint/config-array@0.19.1': dependencies: '@eslint/object-schema': 2.1.5 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -27502,7 +27506,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -28554,41 +28558,6 @@ snapshots: - supports-color - ts-node - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3))': - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.17.9 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 3.9.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)) - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.8 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 @@ -33847,7 +33816,7 @@ snapshots: '@tavily/core@0.0.2': dependencies: - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) js-tiktoken: 1.0.15 transitivePeerDependencies: - debug @@ -34631,7 +34600,7 @@ snapshots: '@typescript-eslint/types': 8.16.0 '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.16.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) eslint: 9.16.0(jiti@2.4.2) optionalDependencies: typescript: 5.6.3 @@ -34694,7 +34663,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.16.0(typescript@5.6.3) '@typescript-eslint/utils': 8.16.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.6.3) - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) eslint: 9.16.0(jiti@2.4.2) ts-api-utils: 1.4.3(typescript@5.6.3) optionalDependencies: @@ -34750,7 +34719,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.16.0 '@typescript-eslint/visitor-keys': 8.16.0 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -35983,7 +35952,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -36509,7 +36478,7 @@ snapshots: axios-mock-adapter@1.22.0(axios@1.7.9): dependencies: - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) fast-deep-equal: 3.1.3 is-buffer: 2.0.5 @@ -36520,7 +36489,7 @@ snapshots: axios-retry@4.5.0(axios@1.7.9): dependencies: - axios: 1.7.9 + axios: 1.7.9(debug@4.4.0) is-retry-allowed: 2.2.0 axios@0.21.4: @@ -36537,7 +36506,7 @@ snapshots: axios@0.27.2: dependencies: - follow-redirects: 1.15.9 + follow-redirects: 1.15.9(debug@4.4.0) form-data: 4.0.1 transitivePeerDependencies: - debug @@ -36574,14 +36543,6 @@ snapshots: transitivePeerDependencies: - debug - axios@1.7.9: - dependencies: - follow-redirects: 1.15.9 - form-data: 4.0.1 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - axios@1.7.9(debug@4.4.0): dependencies: follow-redirects: 1.15.9(debug@4.4.0) @@ -38110,21 +38071,6 @@ snapshots: - supports-color - ts-node - create-jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - create-jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): dependencies: '@jest/types': 29.6.3 @@ -38719,10 +38665,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.4.0: - dependencies: - ms: 2.1.3 - debug@4.4.0(supports-color@5.5.0): dependencies: ms: 2.1.3 @@ -39804,7 +39746,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) escape-string-regexp: 4.0.0 eslint-scope: 8.2.0 eslint-visitor-keys: 4.2.0 @@ -40527,8 +40469,6 @@ snapshots: async: 0.2.10 which: 1.3.1 - follow-redirects@1.15.9: {} - follow-redirects@1.15.9(debug@4.3.7): optionalDependencies: debug: 4.3.7 @@ -41606,7 +41546,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -41662,14 +41602,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -42286,7 +42226,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -42422,25 +42362,6 @@ snapshots: - supports-color - ts-node - 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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)) - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)) - exit: 0.1.2 - import-local: 3.2.0 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - 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.7(@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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) @@ -42560,37 +42481,6 @@ snapshots: - babel-plugin-macros - supports-color - jest-config@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)): - dependencies: - '@babel/core': 7.26.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0(babel-plugin-macros@3.1.0) - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 20.17.9 - ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - jest-config@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): dependencies: '@babel/core': 7.26.0 @@ -42947,18 +42837,6 @@ snapshots: - 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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3)): - dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.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.7(@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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) @@ -48558,7 +48436,7 @@ snapshots: socks-proxy-agent@8.0.5: dependencies: agent-base: 7.1.3 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -49694,27 +49572,6 @@ snapshots: optionalDependencies: '@swc/core': 1.10.7(@swc/helpers@0.5.15) - ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.6.3): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.17.9 - acorn: 8.14.0 - acorn-walk: 8.3.4 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.6.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - optionalDependencies: - '@swc/core': 1.10.7(@swc/helpers@0.5.15) - optional: true - ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3): dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -49895,7 +49752,7 @@ snapshots: tuf-js@2.2.1: dependencies: '@tufjs/models': 2.0.1 - debug: 4.4.0 + debug: 4.4.0(supports-color@5.5.0) make-fetch-happen: 13.0.1 transitivePeerDependencies: - supports-color From 965c6d05af9f0bd3e8ef57dbf508d60f1cc4fbfb Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Thu, 16 Jan 2025 08:00:10 -0800 Subject: [PATCH 34/39] fix: pnpm-lock.yaml --- pnpm-lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a0d1609c6c6..78a4a13526e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1811,7 +1811,7 @@ importers: version: 10.0.0 tsup: specifier: 8.3.5 - version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.0)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + version: 8.3.5(@swc/core@1.10.7(@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.4 version: 2.1.4(@types/node@20.17.9)(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) @@ -51084,7 +51084,7 @@ snapshots: vitest@2.1.4(@types/node@20.17.9)(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): dependencies: '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.6)(terser@5.37.0)) + '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.10.7)(terser@5.37.0)) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.4 '@vitest/snapshot': 2.1.4 From 3b7e8d063f8320b93f83f2842bb7ebc1f0f2e9a2 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 17 Jan 2025 20:30:13 +0800 Subject: [PATCH 35/39] fix: pnpm-lock.yaml --- pnpm-lock.yaml | 243 ++++++++++++++++++++----------------------------- 1 file changed, 97 insertions(+), 146 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30fa906ed4c..55d4c6ece18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -930,7 +930,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.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10) + version: 2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) '@lens-protocol/metadata': specifier: 1.2.0 version: 1.2.0(zod@3.23.8) @@ -1883,7 +1883,7 @@ importers: version: 1.5.1 '@onflow/fcl': specifier: 1.13.1 - version: 1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5) + version: 1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10) '@onflow/typedefs': specifier: 1.4.0 version: 1.4.0 @@ -1923,7 +1923,7 @@ importers: version: 8.3.5(@swc/core@1.10.7(@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.4 - version: 2.1.4(@types/node@22.10.7)(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) + version: 2.1.4(@types/node@22.10.7)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) packages/plugin-fuel: dependencies: @@ -2152,7 +2152,7 @@ importers: version: 19.0.2 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0))(typescript@5.7.3) typescript: specifier: ^5.7.2 version: 5.7.3 @@ -6797,17 +6797,6 @@ packages: peerDependencies: google-protobuf: ^3.14.0 - '@inversifyjs/common@1.4.0': - resolution: {integrity: sha512-qfRJ/3iOlCL/VfJq8+4o5X4oA14cZSBbpAmHsYj8EsIit1xDndoOl0xKOyglKtQD4u4gdNVxMHx4RWARk/I4QA==} - - '@inversifyjs/core@1.3.5': - resolution: {integrity: sha512-B4MFXabhNTAmrfgB+yeD6wd/GIvmvWC6IQ8Rh/j2C3Ix69kmqwz9pr8Jt3E+Nho9aEHOQCZaGmrALgtqRd+oEQ==} - - '@inversifyjs/reflect-metadata-utils@0.2.4': - resolution: {integrity: sha512-u95rV3lKfG+NT2Uy/5vNzoDujos8vN8O18SSA5UyhxsGYd4GLQn/eUsGXfOsfa7m34eKrDelTKRUX1m/BcNX5w==} - peerDependencies: - reflect-metadata: 0.2.2 - '@injectivelabs/core-proto-ts@1.13.4': resolution: {integrity: sha512-81+bwey0qzNgOzUASsxYghSahcWzH5l6bSceW8FdR7w42+Knp+bAgbg12sSyS1hiOO2kMXx6tBvmYkCmnghM1Q==} @@ -6883,6 +6872,17 @@ packages: '@injectivelabs/utils@1.14.34-beta.5': resolution: {integrity: sha512-x15HVMii1lwOVHUIgvgP0/QoRHNvMXHZSVswiQvcHDiy83IuUCZxc8/W0ELjKKfkIw66zM2pd0UBwJ0IMaJLzw==} + '@inversifyjs/common@1.4.0': + resolution: {integrity: sha512-qfRJ/3iOlCL/VfJq8+4o5X4oA14cZSBbpAmHsYj8EsIit1xDndoOl0xKOyglKtQD4u4gdNVxMHx4RWARk/I4QA==} + + '@inversifyjs/core@1.3.5': + resolution: {integrity: sha512-B4MFXabhNTAmrfgB+yeD6wd/GIvmvWC6IQ8Rh/j2C3Ix69kmqwz9pr8Jt3E+Nho9aEHOQCZaGmrALgtqRd+oEQ==} + + '@inversifyjs/reflect-metadata-utils@0.2.4': + resolution: {integrity: sha512-u95rV3lKfG+NT2Uy/5vNzoDujos8vN8O18SSA5UyhxsGYd4GLQn/eUsGXfOsfa7m34eKrDelTKRUX1m/BcNX5w==} + peerDependencies: + reflect-metadata: 0.2.2 + '@ioredis/commands@1.2.0': resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} @@ -29156,19 +29156,6 @@ snapshots: browser-headers: 0.4.1 google-protobuf: 3.21.4 - '@inversifyjs/common@1.4.0': {} - - '@inversifyjs/core@1.3.5(reflect-metadata@0.2.2)': - dependencies: - '@inversifyjs/common': 1.4.0 - '@inversifyjs/reflect-metadata-utils': 0.2.4(reflect-metadata@0.2.2) - transitivePeerDependencies: - - reflect-metadata - - '@inversifyjs/reflect-metadata-utils@0.2.4(reflect-metadata@0.2.2)': - dependencies: - reflect-metadata: 0.2.2 - '@injectivelabs/core-proto-ts@1.13.4': dependencies: '@injectivelabs/grpc-web': 0.0.1(google-protobuf@3.21.4) @@ -29466,6 +29453,19 @@ snapshots: - debug - google-protobuf + '@inversifyjs/common@1.4.0': {} + + '@inversifyjs/core@1.3.5(reflect-metadata@0.2.2)': + dependencies: + '@inversifyjs/common': 1.4.0 + '@inversifyjs/reflect-metadata-utils': 0.2.4(reflect-metadata@0.2.2) + transitivePeerDependencies: + - reflect-metadata + + '@inversifyjs/reflect-metadata-utils@0.2.4(reflect-metadata@0.2.2)': + dependencies: + reflect-metadata: 0.2.2 + '@ioredis/commands@1.2.0': {} '@irys/arweave@0.0.2': @@ -30020,7 +30020,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.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)': + '@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.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/abstract-signer': 5.7.0 @@ -30031,7 +30031,7 @@ snapshots: '@ethersproject/providers': 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@ethersproject/wallet': 5.7.0 '@lens-protocol/blockchain-bindings': 0.10.2(@jest/globals@29.7.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)(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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)(zod@3.23.8) '@lens-protocol/shared-kernel': 0.12.0 '@lens-protocol/storage': 0.8.1 graphql: 16.10.0 @@ -30080,7 +30080,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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)(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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/address': 5.7.0 @@ -30095,7 +30095,7 @@ snapshots: '@lit-protocol/constants': 2.1.62 '@lit-protocol/crypto': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@lit-protocol/encryption': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) '@lit-protocol/types': 2.1.62 siwe: 2.3.2(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)) tslib: 2.8.1 @@ -30293,14 +30293,14 @@ snapshots: - bufferutil - utf-8-validate - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': 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@5.0.10) '@lit-protocol/types': 2.1.62 '@lit-protocol/uint8arrays': 2.1.62 - '@walletconnect/ethereum-provider': 2.17.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) + '@walletconnect/ethereum-provider': 2.17.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) 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@5.0.10))(@ethersproject/wallet@5.7.0) @@ -30401,10 +30401,10 @@ snapshots: '@lit-protocol/nacl@2.1.62': {} - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@lit-protocol/access-control-conditions': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) '@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@5.0.10) @@ -30416,7 +30416,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.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) + '@walletconnect/ethereum-provider': 2.17.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) jszip: 3.10.1 lit-connect-modal: 0.1.11 @@ -31789,15 +31789,15 @@ snapshots: - '@onflow/util-config' - supports-color - '@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5)': + '@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.26.0 '@improbable-eng/grpc-web': 0.15.0(google-protobuf@3.21.4) '@onflow/config': 1.5.1 '@onflow/interaction': 0.0.11 '@onflow/rlp': 1.2.3 - '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) - '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) + '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@onflow/types': 1.4.1 '@onflow/util-actor': 1.3.4 '@onflow/util-address': 1.2.3 @@ -31816,16 +31816,16 @@ snapshots: - supports-color - utf-8-validate - '@onflow/fcl-wc@5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5)': + '@onflow/fcl-wc@5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.26.0 '@onflow/config': 1.5.1 - '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5) + '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10) '@onflow/util-invariant': 1.2.4 '@onflow/util-logger': 1.3.3 '@walletconnect/modal': 2.7.0(@types/react@19.0.7)(react@19.0.0) '@walletconnect/modal-core': 2.7.0(@types/react@19.0.7)(react@19.0.0) - '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5) + '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) '@walletconnect/types': 2.17.4(ioredis@5.4.2) '@walletconnect/utils': 2.17.4(ioredis@5.4.2) postcss-cli: 11.0.0(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2) @@ -31861,15 +31861,15 @@ snapshots: - uploadthing - utf-8-validate - '@onflow/fcl@1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5)': + '@onflow/fcl@1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.26.0 '@onflow/config': 1.5.1 - '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5) - '@onflow/fcl-wc': 5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5) + '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10) + '@onflow/fcl-wc': 5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10) '@onflow/interaction': 0.0.11 '@onflow/rlp': 1.2.3 - '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) + '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@onflow/types': 1.4.1 '@onflow/util-actor': 1.3.4 '@onflow/util-address': 1.2.3 @@ -31923,12 +31923,12 @@ snapshots: '@babel/runtime': 7.26.0 buffer: 6.0.3 - '@onflow/sdk@1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5)': + '@onflow/sdk@1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.26.0 '@onflow/config': 1.5.1 '@onflow/rlp': 1.2.3 - '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) + '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@onflow/typedefs': 1.4.0 '@onflow/util-actor': 1.3.4 '@onflow/util-address': 1.2.3 @@ -31946,7 +31946,7 @@ snapshots: - supports-color - utf-8-validate - '@onflow/transport-http@1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5)': + '@onflow/transport-http@1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.26.0 '@onflow/util-address': 1.2.3 @@ -31956,8 +31956,8 @@ snapshots: abort-controller: 3.0.0 cross-fetch: 4.1.0(encoding@0.1.13) events: 3.3.0 - isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) - ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) + isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) transitivePeerDependencies: - '@onflow/util-config' - bufferutil @@ -36503,48 +36503,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/core@2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(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.4(ioredis@5.4.2) - '@walletconnect/utils': 2.17.4(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.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + '@walletconnect/core@2.17.4(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 @@ -36627,7 +36586,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/ethereum-provider@2.17.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': + '@walletconnect/ethereum-provider@2.17.4(@types/react@19.0.7)(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 @@ -36635,9 +36594,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.7)(react@19.0.0) - '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) '@walletconnect/types': 2.17.4(ioredis@5.4.2) - '@walletconnect/universal-provider': 2.17.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@walletconnect/universal-provider': 2.17.4(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@5.0.10) '@walletconnect/utils': 2.17.4(ioredis@5.4.2) events: 3.3.0 transitivePeerDependencies: @@ -36712,16 +36671,6 @@ snapshots: - bufferutil - utf-8-validate - '@walletconnect/jsonrpc-ws-connection@1.0.16(bufferutil@4.0.9)(utf-8-validate@6.0.5)': - dependencies: - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/safe-json': 1.0.2 - events: 3.3.0 - ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@6.0.5) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - '@walletconnect/keyvaluestorage@1.1.1(ioredis@5.4.2)': dependencies: '@walletconnect/safe-json': 1.0.2 @@ -36826,42 +36775,9 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/sign-client@2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5)': + '@walletconnect/sign-client@2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': dependencies: - '@walletconnect/core': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5) - '@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.4(ioredis@5.4.2) - '@walletconnect/utils': 2.17.4(ioredis@5.4.2) - events: 3.3.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/sign-client@2.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)': - dependencies: - '@walletconnect/core': 2.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@walletconnect/core': 2.17.4(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 @@ -36989,7 +36905,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/universal-provider@2.17.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@walletconnect/universal-provider@2.17.4(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) @@ -36998,7 +36914,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.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) '@walletconnect/types': 2.17.4(ioredis@5.4.2) '@walletconnect/utils': 2.17.4(ioredis@5.4.2) events: 3.3.0 @@ -41654,7 +41570,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.4 + debug: 4.4.0(supports-color@5.5.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -43652,6 +43568,10 @@ snapshots: dependencies: ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + isomorphic-ws@5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)): + dependencies: + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + isomorphic-ws@5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)): dependencies: ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) @@ -44165,6 +44085,18 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 + jest@29.7.0(@types/node@22.10.7)(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.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(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.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) @@ -50939,7 +50871,7 @@ snapshots: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -50953,6 +50885,25 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0))(typescript@5.7.3): + dependencies: + bs-logger: 0.2.6 + ejs: 3.1.10 + fast-json-stable-stringify: 2.1.0 + jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + jest-util: 29.7.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.6.3 + typescript: 5.7.3 + yargs-parser: 21.1.1 + optionalDependencies: + '@babel/core': 7.26.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.26.0) + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.8.4)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 From 4220924f2cea1d3d0747eb923baabc4547b23e35 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 17 Jan 2025 22:23:06 +0800 Subject: [PATCH 36/39] chore: Update version and README for @elizaos/plugin-di --- packages/plugin-di/README.md | 2 +- packages/plugin-di/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-di/README.md b/packages/plugin-di/README.md index 73bb6e046ff..1dc474e7c12 100644 --- a/packages/plugin-di/README.md +++ b/packages/plugin-di/README.md @@ -1,4 +1,4 @@ -# Dependency Injection Plugin for Eliza +# @elizaos/plugin-di - Dependency Injection Plugin for Eliza This plugin provides a dependency injection system for Eliza plugins. diff --git a/packages/plugin-di/package.json b/packages/plugin-di/package.json index 6df158dfc85..31fd136b98d 100644 --- a/packages/plugin-di/package.json +++ b/packages/plugin-di/package.json @@ -1,6 +1,6 @@ { "name": "@elizaos/plugin-di", - "version": "0.1.8+build.1", + "version": "0.1.9-alpha.1", "type": "module", "main": "dist/index.js", "module": "dist/index.js", From 6b774a48dcbe4c987e28b0b5ddce974062371dfe Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 17 Jan 2025 23:30:27 +0800 Subject: [PATCH 37/39] refactor: update access modifiers in BaseInjectableAction and clean up sampleEvaluator imports - Changed private properties to protected in BaseInjectableAction for better inheritance support. - Cleaned up imports in sampleEvaluator by removing unused State import and standardizing string quotes. --- packages/plugin-di/src/_examples/sampleEvaluator.ts | 4 ++-- packages/plugin-di/src/actions/baseInjectableAction.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/plugin-di/src/_examples/sampleEvaluator.ts b/packages/plugin-di/src/_examples/sampleEvaluator.ts index 58a0a1d1c6c..15de18b5134 100644 --- a/packages/plugin-di/src/_examples/sampleEvaluator.ts +++ b/packages/plugin-di/src/_examples/sampleEvaluator.ts @@ -1,4 +1,4 @@ -import { IAgentRuntime, Memory, State, elizaLogger } from "@elizaos/core"; +import { IAgentRuntime, Memory, elizaLogger } from "@elizaos/core"; import { injectable } from "inversify"; import { BaseInjectableEvaluator } from "../evaluators"; import { EvaluatorOptions } from "../types"; @@ -42,7 +42,7 @@ export class SampleEvaluator extends BaseInjectableEvaluator { // Evaluation logic for the evaluator elizaLogger.log("Evaluating data in sampleEvaluator..."); try { - if (!memory.content || typeof memory.content.text !== 'string') { + if (!memory.content || typeof memory.content.text !== "string") { return { score: 0, reason: "Invalid memory content structure", diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 78756b10dff..836794cd26c 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -34,15 +34,15 @@ export abstract class BaseInjectableAction implements InjectableAction { /** * The content class for the action */ - private readonly contentClass: ContentClass; + protected readonly contentClass: ContentClass; /** * Optional template for the action, if not provided, it will be generated from the content class */ - private readonly template: string; + protected readonly template: string; /** * Optional content schema for the action, if not provided, it will be generated from the content class */ - private readonly contentSchema: z.ZodSchema; + protected readonly contentSchema: z.ZodSchema; /** * Constructor for the base injectable action From b6b3e4b4aba64d20e8bb7715f4c5a8dfcf6f62b0 Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Fri, 17 Jan 2025 23:37:53 +0800 Subject: [PATCH 38/39] refactor: change return type of processMessages callback in BaseInjectableAction to Promise - Updated the return type of the callback in the BaseInjectableAction class to allow for more flexible handling of results, returning null instead of void. --- packages/plugin-di/src/actions/baseInjectableAction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-di/src/actions/baseInjectableAction.ts b/packages/plugin-di/src/actions/baseInjectableAction.ts index 836794cd26c..f28ffc2dc13 100644 --- a/packages/plugin-di/src/actions/baseInjectableAction.ts +++ b/packages/plugin-di/src/actions/baseInjectableAction.ts @@ -200,7 +200,7 @@ export abstract class BaseInjectableAction implements InjectableAction { state?: State, _options?: Record, callback?: HandlerCallback - ): Promise { + ): Promise { let content: T; try { content = await this.processMessages(runtime, message, state); @@ -217,7 +217,7 @@ export abstract class BaseInjectableAction implements InjectableAction { }, }); } - return; + return null; } try { From 3015e58dedcc6186e246e7dcdfb294f8337cb0dc Mon Sep 17 00:00:00 2001 From: Tang Bo Hao Date: Sat, 18 Jan 2025 10:32:27 +0800 Subject: [PATCH 39/39] chore: update pkg --- pnpm-lock.yaml | 272 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 208 insertions(+), 64 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a1934b5b15..42b23abb789 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,7 +84,7 @@ importers: version: 9.1.7 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) lerna: specifier: 8.1.5 version: 8.1.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(babel-plugin-macros@3.1.0)(encoding@0.1.13) @@ -394,13 +394,13 @@ importers: version: 29.5.14 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + version: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@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.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)))(typescript@5.7.3) ts-node: specifier: 10.9.2 - version: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3) + version: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3) tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.7(@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) @@ -951,7 +951,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.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) + version: 2.2.0(@jest/globals@29.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10) '@lens-protocol/metadata': specifier: 1.2.0 version: 1.2.0(zod@3.23.8) @@ -1916,7 +1916,7 @@ importers: version: 1.5.1 '@onflow/fcl': specifier: 1.13.1 - version: 1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10) + version: 1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5) '@onflow/typedefs': specifier: 1.4.0 version: 1.4.0 @@ -1956,7 +1956,7 @@ importers: version: 8.3.5(@swc/core@1.10.7(@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.4 - version: 2.1.4(@types/node@22.10.7)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) + version: 2.1.4(@types/node@22.10.7)(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-fuel: dependencies: @@ -2118,7 +2118,7 @@ importers: version: 29.5.14 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.7(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.6.3)(yaml@2.7.0) @@ -2176,7 +2176,7 @@ importers: version: 9.16.0(jiti@2.4.2) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + version: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) prettier: specifier: 3.4.1 version: 3.4.1 @@ -2185,7 +2185,7 @@ importers: version: 19.0.2 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0))(typescript@5.7.3) typescript: specifier: ^5.7.2 version: 5.7.3 @@ -30811,7 +30811,7 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3))': + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -30825,7 +30825,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -31317,7 +31317,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.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': + '@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.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/abstract-signer': 5.7.0 @@ -31328,7 +31328,7 @@ snapshots: '@ethersproject/providers': 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@ethersproject/wallet': 5.7.0 '@lens-protocol/blockchain-bindings': 0.10.2(@jest/globals@29.7.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)(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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)(zod@3.23.8) '@lens-protocol/shared-kernel': 0.12.0 '@lens-protocol/storage': 0.8.1 graphql: 16.10.0 @@ -31377,7 +31377,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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)(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@5.0.10))(@ethersproject/wallet@5.7.0)(@lens-protocol/metadata@1.2.0(zod@3.23.8))(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10))(react@19.0.0)(utf-8-validate@5.0.10)(zod@3.23.8)': dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/address': 5.7.0 @@ -31392,7 +31392,7 @@ snapshots: '@lit-protocol/constants': 2.1.62 '@lit-protocol/crypto': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@lit-protocol/encryption': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) '@lit-protocol/types': 2.1.62 siwe: 2.3.2(ethers@6.13.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)) tslib: 2.8.1 @@ -31605,14 +31605,14 @@ snapshots: - bufferutil - utf-8-validate - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': 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@5.0.10) '@lit-protocol/types': 2.1.62 '@lit-protocol/uint8arrays': 2.1.62 - '@walletconnect/ethereum-provider': 2.17.4(@types/react@19.0.7)(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.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) 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@5.0.10))(@ethersproject/wallet@5.7.0) @@ -31713,10 +31713,10 @@ snapshots: '@lit-protocol/nacl@2.1.62': {} - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10)': + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10)': dependencies: '@lit-protocol/access-control-conditions': 2.1.62(bufferutil@4.0.9)(utf-8-validate@5.0.10) - '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(react@19.0.0)(utf-8-validate@5.0.10) + '@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@5.0.10))(@ethersproject/wallet@5.7.0)(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) '@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@5.0.10) @@ -31728,7 +31728,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.4(@types/react@19.0.7)(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.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(react@19.0.0)(utf-8-validate@5.0.10) ethers: 5.7.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) jszip: 3.10.1 lit-connect-modal: 0.1.11 @@ -33583,15 +33583,15 @@ snapshots: - '@onflow/util-config' - supports-color - '@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10)': + '@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5)': dependencies: '@babel/runtime': 7.26.0 '@improbable-eng/grpc-web': 0.15.0(google-protobuf@3.21.4) '@onflow/config': 1.5.1 '@onflow/interaction': 0.0.11 '@onflow/rlp': 1.2.3 - '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) + '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) '@onflow/types': 1.4.1 '@onflow/util-actor': 1.3.4 '@onflow/util-address': 1.2.3 @@ -33610,16 +33610,16 @@ snapshots: - supports-color - utf-8-validate - '@onflow/fcl-wc@5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10)': + '@onflow/fcl-wc@5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5)': dependencies: '@babel/runtime': 7.26.0 '@onflow/config': 1.5.1 - '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10) + '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5) '@onflow/util-invariant': 1.2.4 '@onflow/util-logger': 1.3.3 '@walletconnect/modal': 2.7.0(@types/react@19.0.7)(react@19.0.0) '@walletconnect/modal-core': 2.7.0(@types/react@19.0.7)(react@19.0.0) - '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5) '@walletconnect/types': 2.17.4(ioredis@5.4.2) '@walletconnect/utils': 2.17.4(ioredis@5.4.2) postcss-cli: 11.0.0(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2) @@ -33655,15 +33655,15 @@ snapshots: - uploadthing - utf-8-validate - '@onflow/fcl@1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10)': + '@onflow/fcl@1.13.1(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5)': dependencies: '@babel/runtime': 7.26.0 '@onflow/config': 1.5.1 - '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10) - '@onflow/fcl-wc': 5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@5.0.10))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@5.0.10) + '@onflow/fcl-core': 1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5) + '@onflow/fcl-wc': 5.5.1(@onflow/fcl-core@1.13.1(bufferutil@4.0.9)(encoding@0.1.13)(google-protobuf@3.21.4)(utf-8-validate@6.0.5))(@types/react@19.0.7)(bufferutil@4.0.9)(ioredis@5.4.2)(jiti@2.4.2)(postcss@8.5.1)(react@19.0.0)(tsx@4.19.2)(utf-8-validate@6.0.5) '@onflow/interaction': 0.0.11 '@onflow/rlp': 1.2.3 - '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@onflow/sdk': 1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) '@onflow/types': 1.4.1 '@onflow/util-actor': 1.3.4 '@onflow/util-address': 1.2.3 @@ -33717,12 +33717,12 @@ snapshots: '@babel/runtime': 7.26.0 buffer: 6.0.3 - '@onflow/sdk@1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@onflow/sdk@1.5.5(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5)': dependencies: '@babel/runtime': 7.26.0 '@onflow/config': 1.5.1 '@onflow/rlp': 1.2.3 - '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) + '@onflow/transport-http': 1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5) '@onflow/typedefs': 1.4.0 '@onflow/util-actor': 1.3.4 '@onflow/util-address': 1.2.3 @@ -33740,7 +33740,7 @@ snapshots: - supports-color - utf-8-validate - '@onflow/transport-http@1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': + '@onflow/transport-http@1.10.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@6.0.5)': dependencies: '@babel/runtime': 7.26.0 '@onflow/util-address': 1.2.3 @@ -33750,8 +33750,8 @@ snapshots: abort-controller: 3.0.0 cross-fetch: 4.1.0(encoding@0.1.13) events: 3.3.0 - isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) - ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + isomorphic-ws: 5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) transitivePeerDependencies: - '@onflow/util-config' - bufferutil @@ -39164,7 +39164,48 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/core@2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': + '@walletconnect/core@2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(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.4(ioredis@5.4.2) + '@walletconnect/utils': 2.17.4(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.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-provider': 1.0.14 @@ -39247,7 +39288,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/ethereum-provider@2.17.4(@types/react@19.0.7)(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.4(@types/react@19.0.7)(bufferutil@4.0.9)(encoding@0.1.13)(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 @@ -39255,9 +39296,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.7)(react@19.0.0) - '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@walletconnect/types': 2.17.4(ioredis@5.4.2) - '@walletconnect/universal-provider': 2.17.4(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/universal-provider': 2.17.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) '@walletconnect/utils': 2.17.4(ioredis@5.4.2) events: 3.3.0 transitivePeerDependencies: @@ -39332,6 +39373,16 @@ snapshots: - bufferutil - utf-8-validate + '@walletconnect/jsonrpc-ws-connection@1.0.16(bufferutil@4.0.9)(utf-8-validate@6.0.5)': + dependencies: + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/safe-json': 1.0.2 + events: 3.3.0 + ws: 7.5.10(bufferutil@4.0.9)(utf-8-validate@6.0.5) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + '@walletconnect/keyvaluestorage@1.1.1(ioredis@5.4.2)': dependencies: '@walletconnect/safe-json': 1.0.2 @@ -39436,9 +39487,42 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/sign-client@2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10)': + '@walletconnect/sign-client@2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5)': dependencies: - '@walletconnect/core': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/core': 2.17.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@6.0.5) + '@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.4(ioredis@5.4.2) + '@walletconnect/utils': 2.17.4(ioredis@5.4.2) + events: 3.3.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/sign-client@2.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@walletconnect/core': 2.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.2 '@walletconnect/jsonrpc-utils': 1.0.8 @@ -39566,7 +39650,7 @@ snapshots: - uploadthing - utf-8-validate - '@walletconnect/universal-provider@2.17.4(bufferutil@4.0.9)(encoding@0.1.13)(ioredis@5.4.2)(utf-8-validate@5.0.10)': + '@walletconnect/universal-provider@2.17.4(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/jsonrpc-http-connection': 1.0.8(encoding@0.1.13) @@ -39575,7 +39659,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.4(bufferutil@4.0.9)(ioredis@5.4.2)(utf-8-validate@5.0.10) + '@walletconnect/sign-client': 2.17.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@walletconnect/types': 2.17.4(ioredis@5.4.2) '@walletconnect/utils': 2.17.4(ioredis@5.4.2) events: 3.3.0 @@ -42124,13 +42208,28 @@ snapshots: safe-buffer: 5.2.1 sha.js: 2.4.11 - create-jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): + create-jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + create-jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -46383,10 +46482,6 @@ snapshots: dependencies: ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)): - dependencies: - ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - isomorphic-ws@5.0.0(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)): dependencies: ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) @@ -46548,16 +46643,35 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): + 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.7(@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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + jest-cli@29.7.0(@types/node@22.10.7)(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.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + create-jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -46586,7 +46700,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): + jest-config@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)): dependencies: '@babel/core': 7.26.0 '@jest/test-sequencer': 29.7.0 @@ -46612,7 +46726,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 20.17.9 - ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3) + ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -46648,7 +46762,7 @@ snapshots: - babel-plugin-macros - supports-color - jest-config@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): + jest-config@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0): dependencies: '@babel/core': 7.26.0 '@jest/test-sequencer': 29.7.0 @@ -46674,7 +46788,6 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 22.10.7 - ts-node: 10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -46931,12 +47044,24 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)): + jest@29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@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.7(@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.7(@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@22.10.7)(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.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@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@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + jest-cli: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -54045,12 +54170,12 @@ snapshots: dependencies: tslib: 2.8.1 - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)))(typescript@5.7.3): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(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.7(@swc/helpers@0.5.15))(@types/node@20.17.9)(typescript@5.7.3)))(typescript@5.7.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + jest: 29.7.0(@types/node@20.17.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@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 @@ -54070,7 +54195,7 @@ snapshots: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.10.7)(typescript@5.7.3)) + jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -54084,6 +54209,25 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0))(typescript@5.7.3): + dependencies: + bs-logger: 0.2.6 + ejs: 3.1.10 + fast-json-stable-stringify: 2.1.0 + jest: 29.7.0(@types/node@22.10.7)(babel-plugin-macros@3.1.0) + jest-util: 29.7.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.6.3 + typescript: 5.7.3 + yargs-parser: 21.1.1 + optionalDependencies: + '@babel/core': 7.26.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.26.0) + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.8.4)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.10.7(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6