From 7187c74c7b2ab91b9ffb3b3c8776e6903201a065 Mon Sep 17 00:00:00 2001 From: Odilitime Date: Fri, 10 Jan 2025 13:25:19 -0800 Subject: [PATCH] fix: update lockfile and fix lint findings (#2128) * typo fix: close object * update lockfile --- .../src/__tests__/vector-extension.test.ts | 34 ++++---- packages/adapter-sqljs/src/index.ts | 2 +- packages/client-direct/src/api.ts | 2 +- packages/client-direct/src/index.ts | 82 +++++++++---------- .../src/actions/chat_with_attachments.ts | 1 - .../src/actions/summarize_conversation.ts | 1 - .../src/plugins/SttTtsSpacesPlugin.ts | 2 +- packages/client-twitter/src/utils.ts | 2 +- packages/core/src/generation.ts | 8 +- packages/core/src/ragknowledge.ts | 4 +- packages/core/src/runtime.ts | 9 +- .../plugin-anyone/src/actions/startAnyone.ts | 3 +- .../src/actions/launchAgent.ts | 2 +- .../plugin-avail/src/actions/submitData.ts | 11 +-- packages/plugin-avail/src/actions/transfer.ts | 5 +- .../src/shared/helpers/cosmos-assets.ts | 31 +++++-- .../plugin-depin/src/actions/sentientai.ts | 2 +- .../plugin-goplus/src/lib/GoPlusManage.ts | 4 +- .../plugin-irys/src/services/irysService.ts | 10 +-- packages/plugin-letzai/src/index.ts | 2 +- .../src/tests/transfer.test.ts | 2 +- .../src/utils/deployEVMContract.ts | 3 - .../src/actions/createToken.ts | 2 +- packages/plugin-spheron/src/actions/escrow.ts | 1 - .../src/actions/remoteAttestation.ts | 2 +- 25 files changed, 113 insertions(+), 114 deletions(-) diff --git a/packages/adapter-postgres/src/__tests__/vector-extension.test.ts b/packages/adapter-postgres/src/__tests__/vector-extension.test.ts index 7ced587371..a22c51c79f 100644 --- a/packages/adapter-postgres/src/__tests__/vector-extension.test.ts +++ b/packages/adapter-postgres/src/__tests__/vector-extension.test.ts @@ -3,7 +3,7 @@ import pg from 'pg'; import fs from 'fs'; import path from 'path'; import { describe, test, expect, beforeEach, afterEach, vi, beforeAll } from 'vitest'; -import { DatabaseAdapter, elizaLogger, type Memory, type Content, EmbeddingProvider } from '@elizaos/core'; +import { elizaLogger, type Memory, type Content } from '@elizaos/core'; // Increase test timeout vi.setConfig({ testTimeout: 15000 }); @@ -41,7 +41,7 @@ vi.mock('@elizaos/core', () => ({ const parseVectorString = (vectorStr: string): number[] => { if (!vectorStr) return []; // Remove brackets and split by comma - return vectorStr.replace(/[\[\]]/g, '').split(',').map(Number); + return vectorStr.replace(/[[\]]/g, '').split(',').map(Number); }; describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { @@ -111,7 +111,7 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { user: 'postgres', password: 'postgres' }); - + const setupClient = await setupPool.connect(); try { await cleanDatabase(setupClient); @@ -133,13 +133,13 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { user: 'postgres', password: 'postgres' }); - + testClient = await testPool.connect(); elizaLogger.debug('Database connection established'); - + await cleanDatabase(testClient); elizaLogger.debug('Database cleaned'); - + adapter = new PostgresDatabaseAdapter({ host: 'localhost', port: 5433, @@ -254,7 +254,7 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { elizaLogger.debug('Attempting initialization with error...'); await expect(adapter.init()).rejects.toThrow('Schema read error'); elizaLogger.success('Error thrown as expected'); - + // Verify no tables were created elizaLogger.debug('Verifying rollback...'); const { rows } = await testClient.query(` @@ -277,19 +277,19 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { describe('Memory Operations with Vector', () => { const TEST_UUID = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'; const TEST_TABLE = 'test_memories'; - + beforeEach(async () => { elizaLogger.info('Setting up memory operations test...'); try { // Ensure clean state and proper initialization await adapter.init(); - + // Verify vector extension and search path await testClient.query(` SET search_path TO public, extensions; SELECT set_config('app.use_openai_embedding', 'true', false); `); - + // Create necessary account and room first await testClient.query('BEGIN'); try { @@ -298,19 +298,19 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { VALUES ($1, 'test@test.com') ON CONFLICT (id) DO NOTHING `, [TEST_UUID]); - + await testClient.query(` INSERT INTO rooms (id) VALUES ($1) ON CONFLICT (id) DO NOTHING `, [TEST_UUID]); - + await testClient.query('COMMIT'); } catch (error) { await testClient.query('ROLLBACK'); throw error; } - + } catch (error) { elizaLogger.error('Memory operations setup failed:', { error: error instanceof Error ? error.message : String(error) @@ -324,7 +324,7 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { const content: Content = { text: 'test content' }; - + const memory: Memory = { id: TEST_UUID, content, @@ -383,7 +383,7 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { await testClient.query('ROLLBACK'); throw error; } - + // Act const results = await adapter.searchMemoriesByEmbedding(embedding, { tableName: TEST_TABLE, @@ -405,7 +405,7 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { const content: Content = { text: 'test content' }; - + const memory: Memory = { id: TEST_UUID, content, @@ -430,4 +430,4 @@ describe('PostgresDatabaseAdapter - Vector Extension Validation', () => { } }, { timeout: 30000 }); // Increased timeout for retry attempts }); -}); \ No newline at end of file +}); \ No newline at end of file diff --git a/packages/adapter-sqljs/src/index.ts b/packages/adapter-sqljs/src/index.ts index db27215e10..6df3c93f03 100644 --- a/packages/adapter-sqljs/src/index.ts +++ b/packages/adapter-sqljs/src/index.ts @@ -859,7 +859,7 @@ export class SqlJsDatabaseAdapter return JSON.parse(cachedResult); } - let sql = ` + const sql = ` WITH vector_scores AS ( SELECT id, 1 / (1 + vec_distance_L2(embedding, ?)) as vector_score diff --git a/packages/client-direct/src/api.ts b/packages/client-direct/src/api.ts index 2780831c24..0a16059233 100644 --- a/packages/client-direct/src/api.ts +++ b/packages/client-direct/src/api.ts @@ -56,7 +56,7 @@ export function createApiRouter( return; } - let character = agent?.character; + const character = agent?.character; if (character?.settings?.secrets) { delete character.settings.secrets; } diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index d98bc6a661..43603d50a7 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -373,14 +373,12 @@ export class DirectClient { // hyperfi specific parameters let nearby = []; - let messages = []; let availableEmotes = []; if (body.nearby) { nearby = body.nearby; } if (body.messages) { - messages = body.messages; // loop on the messages and record the memories // might want to do this in parallel for (const msg of body.messages) { @@ -502,10 +500,17 @@ export class DirectClient { schema: hyperfiOutSchema, }); + if (!response) { + res.status(500).send( + "No response from generateMessageResponse" + ); + return; + } + let hfOut; try { hfOut = hyperfiOutSchema.parse(response.object); - } catch (e) { + } catch { elizaLogger.error( "cant serialize response", response.object @@ -515,7 +520,7 @@ export class DirectClient { } // do this in the background - const rememberThis = new Promise(async (resolve) => { + new Promise((resolve) => { const contentObj: Content = { text: hfOut.say, }; @@ -545,45 +550,38 @@ export class DirectClient { content: contentObj, }; - await runtime.messageManager.createMemory(responseMessage); // 18.2ms - - if (!response) { - res.status(500).send( - "No response from generateMessageResponse" - ); - return; - } - - let message = null as Content | null; - - const messageId = stringToUuid(Date.now().toString()); - const memory: Memory = { - id: messageId, - agentId: runtime.agentId, - userId, - roomId, - content, - createdAt: Date.now(), - }; - - // run evaluators (generally can be done in parallel with processActions) - // can an evaluator modify memory? it could but currently doesn't - await runtime.evaluate(memory, state); // 0.5s - - // only need to call if responseMessage.content.action is set - if (contentObj.action) { - // pass memory (query) to any actions to call - const _result = await runtime.processActions( - memory, - [responseMessage], - state, - async (newMessages) => { - message = newMessages; - return [memory]; + runtime.messageManager.createMemory(responseMessage).then(() => { + const messageId = stringToUuid(Date.now().toString()); + const memory: Memory = { + id: messageId, + agentId: runtime.agentId, + userId, + roomId, + content, + createdAt: Date.now(), + }; + + // run evaluators (generally can be done in parallel with processActions) + // can an evaluator modify memory? it could but currently doesn't + runtime.evaluate(memory, state).then(() => { + // only need to call if responseMessage.content.action is set + if (contentObj.action) { + // pass memory (query) to any actions to call + runtime.processActions( + memory, + [responseMessage], + state, + async (newMessages) => { + // FIXME: this is supposed override what the LLM said/decided + // but the promise doesn't make this possible + //message = newMessages; + return [memory]; + } + ); // 0.674s } - ); // 0.674s - } - resolve(true); + resolve(true); + }); + }); }); res.json({ response: hfOut }); } diff --git a/packages/client-slack/src/actions/chat_with_attachments.ts b/packages/client-slack/src/actions/chat_with_attachments.ts index e059cc47b4..b40353020d 100644 --- a/packages/client-slack/src/actions/chat_with_attachments.ts +++ b/packages/client-slack/src/actions/chat_with_attachments.ts @@ -5,7 +5,6 @@ import { parseJSONObjectFromText, getModelSettings, } from "@elizaos/core"; -import { models } from "@elizaos/core"; import { Action, ActionExample, diff --git a/packages/client-slack/src/actions/summarize_conversation.ts b/packages/client-slack/src/actions/summarize_conversation.ts index b487757cad..1464952122 100644 --- a/packages/client-slack/src/actions/summarize_conversation.ts +++ b/packages/client-slack/src/actions/summarize_conversation.ts @@ -6,7 +6,6 @@ import { parseJSONObjectFromText, getModelSettings, } from "@elizaos/core"; -import { models } from "@elizaos/core"; import { getActorDetails } from "@elizaos/core"; import { Action, diff --git a/packages/client-twitter/src/plugins/SttTtsSpacesPlugin.ts b/packages/client-twitter/src/plugins/SttTtsSpacesPlugin.ts index ade6084eb6..b23a25d79c 100644 --- a/packages/client-twitter/src/plugins/SttTtsSpacesPlugin.ts +++ b/packages/client-twitter/src/plugins/SttTtsSpacesPlugin.ts @@ -67,7 +67,7 @@ export class SttTtsPlugin implements Plugin { private ttsQueue: string[] = []; private isSpeaking = false; - onAttach(space: Space) { + onAttach(_space: Space) { elizaLogger.log("[SttTtsPlugin] onAttach => space was attached"); } diff --git a/packages/client-twitter/src/utils.ts b/packages/client-twitter/src/utils.ts index d11ed5b534..a728694453 100644 --- a/packages/client-twitter/src/utils.ts +++ b/packages/client-twitter/src/utils.ts @@ -345,7 +345,7 @@ function extractUrls(paragraph: string): { function splitSentencesAndWords(text: string, maxLength: number): string[] { // Split by periods, question marks and exclamation marks // Note that URLs in text have been replaced with `<>` and won't be split by dots - const sentences = text.match(/[^\.!\?]+[\.!\?]+|[^\.!\?]+$/g) || [text]; + const sentences = text.match(/[^.!?]+[.!?]+|[^.!?]+$/g) || [text]; const chunks: string[] = []; let currentChunk = ""; diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index c835b993be..799cbeb19d 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -45,7 +45,7 @@ import { IVerifiableInferenceAdapter, VerifiableInferenceOptions, VerifiableInferenceResult, - VerifiableInferenceProvider, + //VerifiableInferenceProvider, TelemetrySettings, TokenizerType, } from "./types.ts"; @@ -1777,9 +1777,9 @@ export async function handleProvider( runtime, context, modelClass, - verifiableInference, - verifiableInferenceAdapter, - verifiableInferenceOptions, + //verifiableInference, + //verifiableInferenceAdapter, + //verifiableInferenceOptions, } = options; switch (provider) { case ModelProviderName.OPENAI: diff --git a/packages/core/src/ragknowledge.ts b/packages/core/src/ragknowledge.ts index 0856cea67a..5c91309703 100644 --- a/packages/core/src/ragknowledge.ts +++ b/packages/core/src/ragknowledge.ts @@ -299,14 +299,14 @@ export class RAGKnowledgeManager implements IRAGKnowledgeManager { }; const startTime = Date.now(); - let content = file.content; + const content = file.content; try { const fileSizeKB = (new TextEncoder().encode(content)).length / 1024; elizaLogger.info(`[File Progress] Starting ${file.path} (${fileSizeKB.toFixed(2)} KB)`); // Step 1: Preprocessing - const preprocessStart = Date.now(); + //const preprocessStart = Date.now(); const processedContent = this.preprocess(content); timeMarker('Preprocessing'); diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index a3f4062a72..1a844d4b8c 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -34,8 +34,8 @@ import { IRAGKnowledgeManager, IMemoryManager, KnowledgeItem, - RAGKnowledgeItem, - Media, + //RAGKnowledgeItem, + //Media, ModelClass, ModelProviderName, Plugin, @@ -546,10 +546,7 @@ export class AgentRuntime implements IAgentRuntime { agentId: this.agentId }); - let content: string; - - content = await readFile(filePath, 'utf8'); - + const content: string = await readFile(filePath, 'utf8'); if (!content) { hasError = true; continue; diff --git a/packages/plugin-anyone/src/actions/startAnyone.ts b/packages/plugin-anyone/src/actions/startAnyone.ts index 9edc260ae7..855837c4f8 100644 --- a/packages/plugin-anyone/src/actions/startAnyone.ts +++ b/packages/plugin-anyone/src/actions/startAnyone.ts @@ -24,7 +24,8 @@ export const startAnyone: Action = { _callback: HandlerCallback ): Promise => { await AnyoneClientService.initialize(); - const anon = AnyoneClientService.getInstance(); + //lint says unused + //const anon = AnyoneClientService.getInstance(); const proxyService = AnyoneProxyService.getInstance(); await proxyService.initialize(); diff --git a/packages/plugin-autonome/src/actions/launchAgent.ts b/packages/plugin-autonome/src/actions/launchAgent.ts index e7ade7c433..f53eaddc5f 100644 --- a/packages/plugin-autonome/src/actions/launchAgent.ts +++ b/packages/plugin-autonome/src/actions/launchAgent.ts @@ -42,7 +42,7 @@ Given the recent messages, extract the following information about the requested export default { name: "LAUNCH_AGENT", similes: ["CREATE_AGENT", "DEPLOY_AGENT", "DEPLOY_ELIZA", "DEPLOY_BOT"], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, _message: Memory) => { return true; }, description: "Launch an Eliza agent", diff --git a/packages/plugin-avail/src/actions/submitData.ts b/packages/plugin-avail/src/actions/submitData.ts index 978ae5a3dc..e90622105a 100644 --- a/packages/plugin-avail/src/actions/submitData.ts +++ b/packages/plugin-avail/src/actions/submitData.ts @@ -9,16 +9,13 @@ import { type Action, elizaLogger, composeContext, - generateObject, generateObjectDeprecated, } from "@elizaos/core"; import { validateAvailConfig } from "../environment"; import { - getDecimals, + //getDecimals, initialize, - formatNumberToBalance, getKeyringFromSeed, - isValidAddress, } from "avail-js-sdk"; import { ISubmittableResult } from "@polkadot/types/types/extrinsic"; import { H256 } from "@polkadot/types/interfaces/runtime"; @@ -67,7 +64,7 @@ export default { "SUBMIT_DATA_ON_AVAIL_NETWORK", "SUBMIT_DATA_TO_AVAIL_NETWORK", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateAvailConfig(runtime); return true; }, @@ -116,14 +113,14 @@ export default { if (content.data != null) { try { const SEED = runtime.getSetting("AVAIL_SEED")!; - const ACCOUNT = runtime.getSetting("AVAIL_ADDRESS")!; + //const ACCOUNT = runtime.getSetting("AVAIL_ADDRESS")!; const ENDPOINT = runtime.getSetting("AVAIL_RPC_URL"); const APP_ID = runtime.getSetting("AVAIL_APP_ID"); const api = await initialize(ENDPOINT); const keyring = getKeyringFromSeed(SEED); const options = { app_id: APP_ID, nonce: -1 }; - const decimals = getDecimals(api); + //const decimals = getDecimals(api); const data = content.data; const submitDataInfo = await api.tx.dataAvailability diff --git a/packages/plugin-avail/src/actions/transfer.ts b/packages/plugin-avail/src/actions/transfer.ts index df3b04cbe8..8745048a96 100644 --- a/packages/plugin-avail/src/actions/transfer.ts +++ b/packages/plugin-avail/src/actions/transfer.ts @@ -9,7 +9,6 @@ import { type Action, elizaLogger, composeContext, - generateObject, generateObjectDeprecated, } from "@elizaos/core"; import { validateAvailConfig } from "../environment"; @@ -77,7 +76,7 @@ export default { "SEND_AVAIL_TOKEN_ON_AVAIL_DA", "PAY_ON_AVAIL", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateAvailConfig(runtime); return true; }, @@ -128,7 +127,7 @@ export default { if (content.amount != null && content.recipient != null) { try { const SEED = runtime.getSetting("AVAIL_SEED")!; - const PUBLIC_KEY = runtime.getSetting("AVAIL_ADDRESS")!; + //const PUBLIC_KEY = runtime.getSetting("AVAIL_ADDRESS")!; const ENDPOINT = runtime.getSetting("AVAIL_RPC_URL"); const api = await initialize(ENDPOINT); diff --git a/packages/plugin-cosmos/src/shared/helpers/cosmos-assets.ts b/packages/plugin-cosmos/src/shared/helpers/cosmos-assets.ts index 44321c8895..ae92d2cb24 100644 --- a/packages/plugin-cosmos/src/shared/helpers/cosmos-assets.ts +++ b/packages/plugin-cosmos/src/shared/helpers/cosmos-assets.ts @@ -3,12 +3,25 @@ import type { AssetList } from "@chain-registry/types"; export const getAvailableAssets = ( assets: AssetList[], customAssets: AssetList[] -) => [ - ...assets?.filter( - (asset) => - !(customAssets ?? []) - ?.map((customAsset) => customAsset.chain_name) - ?.includes(asset.chain_name) - ), - ...(customAssets ?? []), -]; +) => { + const result: AssetList[] = []; + const safeAssets = assets || []; + const safeCustomAssets = customAssets || []; + + // Get custom asset chain names for faster lookup + const customChainNames = new Set( + safeCustomAssets.map(asset => asset.chain_name) + ); + + // Add non-duplicate assets + for (const asset of safeAssets) { + if (!customChainNames.has(asset.chain_name)) { + result.push(asset); + } + } + + // Add all custom assets + result.push(...safeCustomAssets); + + return result; +} \ No newline at end of file diff --git a/packages/plugin-depin/src/actions/sentientai.ts b/packages/plugin-depin/src/actions/sentientai.ts index aee97b0fce..68f2440e0c 100644 --- a/packages/plugin-depin/src/actions/sentientai.ts +++ b/packages/plugin-depin/src/actions/sentientai.ts @@ -61,7 +61,7 @@ export const sentientAI: Action = { }, ], ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, _message: Memory) => { // no extra validation needed return true; }, diff --git a/packages/plugin-goplus/src/lib/GoPlusManage.ts b/packages/plugin-goplus/src/lib/GoPlusManage.ts index 1406e167ff..eee7eabc8a 100644 --- a/packages/plugin-goplus/src/lib/GoPlusManage.ts +++ b/packages/plugin-goplus/src/lib/GoPlusManage.ts @@ -13,9 +13,9 @@ export const GoPlusType = { ACCOUNT_ERC1155_SECURITY_CHECK: "ACCOUNT_ERC1155_SECURITY_CHECK", SIGNATURE_SECURITY_CHECK: "SIGNATURE_SECURITY_CHECK", URL_SECURITY_CHECK: "URL_SECURITY_CHECK", -} +} as const; -export type GoPlusType = (typeof GoPlusType)[keyof typeof GoPlusType] +export type GoPlusTypeType = (typeof GoPlusTypeEnum)[keyof typeof GoPlusType]; export type GoPlusParamType = { "type": GoPlusType, diff --git a/packages/plugin-irys/src/services/irysService.ts b/packages/plugin-irys/src/services/irysService.ts index e97bae6ee8..24f4038e0a 100644 --- a/packages/plugin-irys/src/services/irysService.ts +++ b/packages/plugin-irys/src/services/irysService.ts @@ -116,9 +116,9 @@ export class IrysService extends Service implements IIrysService { } private async orchestrateRequest(requestMessage: string, tags: GraphQLTag[], timestamp: IrysTimestamp = null): Promise { - let serviceCategory = tags.find((tag) => tag.name == "Service-Category")?.values; - let protocol = tags.find((tag) => tag.name == "Protocol")?.values; - let minimumProviders = Number(tags.find((tag) => tag.name == "Minimum-Providers")?.values); + const serviceCategory = tags.find((tag) => tag.name == "Service-Category")?.values; + const protocol = tags.find((tag) => tag.name == "Protocol")?.values; + const minimumProviders = Number(tags.find((tag) => tag.name == "Minimum-Providers")?.values); /* Further implementation of the orchestrator { name: "Validation-Threshold", values: validationThreshold }, @@ -158,7 +158,7 @@ export class IrysService extends Service implements IIrysService { return { success: false, data: null, error: "Error in the orchestrator" }; } } - let responseTags: GraphQLTag[] = [ + const responseTags: GraphQLTag[] = [ { name: "Message-Type", values: [IrysMessageType.REQUEST_RESPONSE] }, { name: "Service-Category", values: [serviceCategory] }, { name: "Protocol", values: [protocol] }, @@ -319,7 +319,7 @@ export class IrysService extends Service implements IIrysService { const responseText = await fetchDataFromTransactionIdResponse.data.text(); try { data = JSON.parse(responseText); - } catch (error) { + } catch { data = responseText; } return { diff --git a/packages/plugin-letzai/src/index.ts b/packages/plugin-letzai/src/index.ts index e240a32217..5bb4dd0db2 100644 --- a/packages/plugin-letzai/src/index.ts +++ b/packages/plugin-letzai/src/index.ts @@ -1,4 +1,4 @@ -import { elizaLogger, generateText, HandlerCallback, IAgentRuntime, ModelClass, Plugin, State } from "@elizaos/core"; +import { elizaLogger, HandlerCallback, IAgentRuntime, Plugin, State } from "@elizaos/core"; import { Memory } from "@elizaos/core"; diff --git a/packages/plugin-movement/src/tests/transfer.test.ts b/packages/plugin-movement/src/tests/transfer.test.ts index e98689a002..0704d231c4 100644 --- a/packages/plugin-movement/src/tests/transfer.test.ts +++ b/packages/plugin-movement/src/tests/transfer.test.ts @@ -1,4 +1,4 @@ -import { describe, it, expect, beforeEach, vi } from "vitest"; +import { describe, it, expect } from "vitest"; import transferAction from "../actions/transfer"; describe("Movement Transfer Action", () => { diff --git a/packages/plugin-nft-generation/src/utils/deployEVMContract.ts b/packages/plugin-nft-generation/src/utils/deployEVMContract.ts index 9413d8663d..99f2d61873 100644 --- a/packages/plugin-nft-generation/src/utils/deployEVMContract.ts +++ b/packages/plugin-nft-generation/src/utils/deployEVMContract.ts @@ -1,8 +1,5 @@ import { encodeAbiParameters } from "viem"; -import { fileURLToPath } from "url"; import { compileWithImports } from "./generateERC721ContractCode.ts"; -import path from "path"; -import fs from "fs"; import CustomERC721 from "../contract/CustomERC721.sol" // 动态生成 ERC-721 合约代码 diff --git a/packages/plugin-solana-agentkit/src/actions/createToken.ts b/packages/plugin-solana-agentkit/src/actions/createToken.ts index 46377f546a..50c0cbdf94 100644 --- a/packages/plugin-solana-agentkit/src/actions/createToken.ts +++ b/packages/plugin-solana-agentkit/src/actions/createToken.ts @@ -60,7 +60,7 @@ Respond with a JSON markdown block containing only the extracted values.`; export default { name: "CREATE_TOKEN", similes: ["DEPLOY_TOKEN"], - validate: async (runtime: IAgentRuntime, message: Memory) => true, + validate: async (_runtime: IAgentRuntime, _message: Memory) => true, description: "Create tokens", handler: async ( runtime: IAgentRuntime, diff --git a/packages/plugin-spheron/src/actions/escrow.ts b/packages/plugin-spheron/src/actions/escrow.ts index 59b10040a0..b29fe8de68 100644 --- a/packages/plugin-spheron/src/actions/escrow.ts +++ b/packages/plugin-spheron/src/actions/escrow.ts @@ -7,7 +7,6 @@ import { HandlerCallback, elizaLogger, composeContext, - generateObject, ModelClass, generateObjectDeprecated, } from "@elizaos/core"; diff --git a/packages/plugin-tee-marlin/src/actions/remoteAttestation.ts b/packages/plugin-tee-marlin/src/actions/remoteAttestation.ts index e04cc422a1..4ead37905e 100644 --- a/packages/plugin-tee-marlin/src/actions/remoteAttestation.ts +++ b/packages/plugin-tee-marlin/src/actions/remoteAttestation.ts @@ -24,7 +24,7 @@ export const remoteAttestationAction = { return false; } }, - validate: async (runtime: IAgentRuntime) => { + validate: async (_runtime: IAgentRuntime) => { return true; }, examples: [