diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index db3c80556c3..3fda905a7a3 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -251,6 +251,7 @@ export class DirectClient { }); const response = await generateMessageResponse({ + // @ts-expect-error todo runtime: runtime, context, modelClass: ModelClass.LARGE, @@ -323,13 +324,14 @@ export class DirectClient { res.status(404).send("Agent not found"); return; } - + // @ts-expect-error todo const images = await generateImage({ ...req.body }, agent); const imagesRes: { image: string; caption: string }[] = []; if (images.data && images.data.length > 0) { for (let i = 0; i < images.data.length; i++) { const caption = await generateCaption( { imageUrl: images.data[i] }, + // @ts-expect-error todo agent ); imagesRes.push({ @@ -520,6 +522,7 @@ export class DirectClient { }); const response = await generateMessageResponse({ + // @ts-expect-error todo runtime: runtime, context, modelClass: ModelClass.LARGE, diff --git a/packages/client-discord/src/index.ts b/packages/client-discord/src/index.ts index 45b5cc0f652..205bd9797d7 100644 --- a/packages/client-discord/src/index.ts +++ b/packages/client-discord/src/index.ts @@ -320,7 +320,9 @@ export class DiscordClient extends EventEmitter { const messageContent = reaction.message.content; const truncatedContent = + // @ts-expect-error todo messageContent.length > 50 + // @ts-expect-error todo ? messageContent.substring(0, 50) + "..." : messageContent; @@ -336,7 +338,9 @@ export class DiscordClient extends EventEmitter { `${reaction.message.id}-${user.id}-${emoji}-removed-${this.runtime.agentId}` ); + // @ts-expect-error todo const userName = reaction.message.author.username; + // @ts-expect-error todo const name = reaction.message.author.displayName; await this.runtime.ensureConnection( diff --git a/packages/client-slack/src/index.ts b/packages/client-slack/src/index.ts index a3d8ee8199a..c14102f48a2 100644 --- a/packages/client-slack/src/index.ts +++ b/packages/client-slack/src/index.ts @@ -31,6 +31,7 @@ export class SlackClient extends EventEmitter { this.character = runtime.character; const token = runtime.getSetting("SLACK_BOT_TOKEN"); + // @ts-expect-error todo this.signingSecret = runtime.getSetting("SLACK_SIGNING_SECRET"); if (!token) throw new Error("SLACK_BOT_TOKEN is required"); diff --git a/packages/client-telegram/src/index.ts b/packages/client-telegram/src/index.ts index 61e9d091ae1..7c8104c084a 100644 --- a/packages/client-telegram/src/index.ts +++ b/packages/client-telegram/src/index.ts @@ -9,6 +9,7 @@ export const TelegramClientInterface: Client = { const tg = new TelegramClient( runtime, + // @ts-expect-error todo runtime.getSetting("TELEGRAM_BOT_TOKEN") ); diff --git a/packages/core/src/embedding.ts b/packages/core/src/embedding.ts index b1dea7c685f..136d9519823 100644 --- a/packages/core/src/embedding.ts +++ b/packages/core/src/embedding.ts @@ -31,21 +31,28 @@ export type EmbeddingConfig = { }; export const getEmbeddingConfig = (): EmbeddingConfig => ({ + // @ts-expect-error todo dimensions: settings.USE_OPENAI_EMBEDDING?.toLowerCase() === "true" + // @ts-expect-error todo ? getEmbeddingModelSettings(ModelProviderName.OPENAI).dimensions : settings.USE_OLLAMA_EMBEDDING?.toLowerCase() === "true" + // @ts-expect-error todo ? getEmbeddingModelSettings(ModelProviderName.OLLAMA).dimensions : settings.USE_GAIANET_EMBEDDING?.toLowerCase() === "true" + // @ts-expect-error todo ? getEmbeddingModelSettings(ModelProviderName.GAIANET) .dimensions : 384, // BGE model: settings.USE_OPENAI_EMBEDDING?.toLowerCase() === "true" + // @ts-expect-error todo ? getEmbeddingModelSettings(ModelProviderName.OPENAI).name : settings.USE_OLLAMA_EMBEDDING?.toLowerCase() === "true" + // @ts-expect-error todo ? getEmbeddingModelSettings(ModelProviderName.OLLAMA).name : settings.USE_GAIANET_EMBEDDING?.toLowerCase() === "true" + // @ts-expect-error todo ? getEmbeddingModelSettings(ModelProviderName.GAIANET).name : "BGE-small-en-v1.5", provider: @@ -135,14 +142,17 @@ export function getEmbeddingZeroVector(): number[] { let embeddingDimension = 384; // Default BGE dimension if (settings.USE_OPENAI_EMBEDDING?.toLowerCase() === "true") { + // @ts-expect-error todo embeddingDimension = getEmbeddingModelSettings( ModelProviderName.OPENAI ).dimensions; // OpenAI dimension } else if (settings.USE_OLLAMA_EMBEDDING?.toLowerCase() === "true") { + // @ts-expect-error todo embeddingDimension = getEmbeddingModelSettings( ModelProviderName.OLLAMA ).dimensions; // Ollama mxbai-embed-large dimension } else if (settings.USE_GAIANET_EMBEDDING?.toLowerCase() === "true") { + // @ts-expect-error todo embeddingDimension = getEmbeddingModelSettings( ModelProviderName.GAIANET ).dimensions; // GaiaNet dimension @@ -224,6 +234,7 @@ export async function embed(runtime: IAgentRuntime, input: string) { settings.SMALL_GAIANET_SERVER_URL || settings.MEDIUM_GAIANET_SERVER_URL || settings.LARGE_GAIANET_SERVER_URL, + // @ts-expect-error todo apiKey: settings.GAIANET_API_KEY || runtime.token, dimensions: config.dimensions, }); @@ -247,6 +258,7 @@ export async function embed(runtime: IAgentRuntime, input: string) { endpoint: runtime.character.modelEndpointOverride || getEndpoint(runtime.character.modelProvider), + // @ts-expect-error todo apiKey: runtime.token, dimensions: config.dimensions, }); diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index 0f15ff8dbbe..9f3c50e8bdd 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -207,6 +207,7 @@ export async function generateText({ const endpoint = runtime.character.modelEndpointOverride || getEndpoint(provider); const modelSettings = getModelSettings(runtime.modelProvider, modelClass); + // @ts-expect-error todo let model = modelSettings.name; // allow character.json settings => secrets to override models @@ -279,19 +280,25 @@ export async function generateText({ const modelConfiguration = runtime.character?.settings?.modelConfig; const temperature = + // @ts-expect-error todo modelConfiguration?.temperature || modelSettings.temperature; const frequency_penalty = modelConfiguration?.frequency_penalty || + // @ts-expect-error todo modelSettings.frequency_penalty; const presence_penalty = + // @ts-expect-error todo modelConfiguration?.presence_penalty || modelSettings.presence_penalty; const max_context_length = + // @ts-expect-error todo modelConfiguration?.maxInputTokens || modelSettings.maxInputTokens; const max_response_length = modelConfiguration?.max_response_length || + // @ts-expect-error todo modelSettings.maxOutputTokens; const experimental_telemetry = modelConfiguration?.experimental_telemetry || + // @ts-expect-error todo modelSettings.experimental_telemetry; const apiKey = runtime.token; @@ -305,6 +312,7 @@ export async function generateText({ let response: string; + // @ts-expect-error todo const _stop = stop || modelSettings.stop; elizaLogger.debug( `Using provider: ${provider}, model: ${model}, temperature: ${temperature}, max response length: ${max_response_length}` @@ -322,8 +330,10 @@ export async function generateText({ case ModelProviderName.AKASH_CHAT_API: { elizaLogger.debug("Initializing OpenAI model."); const openai = createOpenAI({ + // @ts-expect-error todo apiKey, baseURL: endpoint, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -352,12 +362,15 @@ export async function generateText({ case ModelProviderName.ETERNALAI: { elizaLogger.debug("Initializing EternalAI model."); const openai = createOpenAI({ + // @ts-expect-error todo apiKey, baseURL: endpoint, fetch: async (url: string, options: any) => { + // @ts-expect-error todo const fetching = await runtime.fetch(url, options); if ( parseBooleanFromText( + // @ts-expect-error todo runtime.getSetting("ETERNAL_AI_LOG_REQUEST") ) ) { @@ -397,7 +410,9 @@ export async function generateText({ case ModelProviderName.GOOGLE: { const google = createGoogleGenerativeAI({ + // @ts-expect-error todo apiKey, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -427,7 +442,9 @@ export async function generateText({ elizaLogger.debug("Initializing Anthropic model."); const anthropic = createAnthropic({ + // @ts-expect-error todo apiKey, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -457,7 +474,9 @@ export async function generateText({ elizaLogger.debug("Initializing Claude Vertex model."); const anthropic = createAnthropic({ + // @ts-expect-error todo apiKey, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -488,8 +507,10 @@ export async function generateText({ case ModelProviderName.GROK: { elizaLogger.debug("Initializing Grok model."); const grok = createOpenAI({ + // @ts-expect-error todo apiKey, baseURL: endpoint, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -518,6 +539,7 @@ export async function generateText({ } case ModelProviderName.GROQ: { + // @ts-expect-error todo const groq = createGroq({ apiKey, fetch: runtime.fetch }); const { text: groqResponse } = await aiGenerateText({ @@ -558,6 +580,7 @@ export async function generateText({ context, temperature, _stop, + // @ts-expect-error todo frequency_penalty, presence_penalty, max_response_length @@ -570,8 +593,10 @@ export async function generateText({ elizaLogger.debug("Initializing RedPill model."); const serverUrl = getEndpoint(provider); const openai = createOpenAI({ + // @ts-expect-error todo apiKey, baseURL: serverUrl, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -601,8 +626,10 @@ export async function generateText({ elizaLogger.debug("Initializing OpenRouter model."); const serverUrl = getEndpoint(provider); const openrouter = createOpenAI({ + // @ts-expect-error todo apiKey, baseURL: serverUrl, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -634,6 +661,7 @@ export async function generateText({ const ollamaProvider = createOllama({ baseURL: getEndpoint(provider) + "/api", + // @ts-expect-error todo fetch: runtime.fetch, }); const ollama = ollamaProvider(model); @@ -661,8 +689,10 @@ export async function generateText({ case ModelProviderName.HEURIST: { elizaLogger.debug("Initializing Heurist model."); const heurist = createOpenAI({ + // @ts-expect-error todo apiKey: apiKey, baseURL: endpoint, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -715,8 +745,10 @@ export async function generateText({ elizaLogger.debug("Using GAIANET model with baseURL:", baseURL); const openai = createOpenAI({ + // @ts-expect-error todo apiKey, baseURL: endpoint, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -745,8 +777,10 @@ export async function generateText({ case ModelProviderName.GALADRIEL: { elizaLogger.debug("Initializing Galadriel model."); const galadriel = createOpenAI({ + // @ts-expect-error todo apiKey: apiKey, baseURL: endpoint, + // @ts-expect-error todo fetch: runtime.fetch, }); @@ -775,6 +809,7 @@ export async function generateText({ case ModelProviderName.VENICE: { elizaLogger.debug("Initializing Venice model."); const venice = createOpenAI({ + // @ts-expect-error todo apiKey: apiKey, baseURL: endpoint, }); @@ -921,6 +956,7 @@ export async function generateTrueOrFalse({ let retryDelay = 1000; const modelSettings = getModelSettings(runtime.modelProvider, modelClass); const stop = Array.from( + // @ts-expect-error todo new Set([...(modelSettings.stop || []), ["\n"]]) ) as string[]; @@ -1091,6 +1127,7 @@ export async function generateMessageResponse({ modelClass: ModelClass; }): Promise { const modelSettings = getModelSettings(runtime.modelProvider, modelClass); + // @ts-expect-error todo const max_context_length = modelSettings.maxInputTokens; context = await trimTokens(context, max_context_length, runtime); @@ -1145,6 +1182,7 @@ export const generateImage = async ( error?: any; }> => { const modelSettings = getImageModelSettings(runtime.imageModelProvider); + // @ts-expect-error todo const model = modelSettings.name; elizaLogger.info("Generating image with options:", { imageModelProvider: model, @@ -1488,7 +1526,7 @@ export const generateCaption = async ( export const generateWebSearch = async ( query: string, runtime: IAgentRuntime -): Promise => { +): Promise => { try { const apiKey = runtime.getSetting("TAVILY_API_KEY") as string; if (!apiKey) { @@ -1560,12 +1598,19 @@ export const generateObject = async ({ const provider = runtime.modelProvider; const modelSettings = getModelSettings(runtime.modelProvider, modelClass); + // @ts-expect-error todo const model = modelSettings.name; + // @ts-expect-error todo const temperature = modelSettings.temperature; + // @ts-expect-error todo const frequency_penalty = modelSettings.frequency_penalty; + // @ts-expect-error todo const presence_penalty = modelSettings.presence_penalty; + // @ts-expect-error todo const max_context_length = modelSettings.maxInputTokens; + // @ts-expect-error todo const max_response_length = modelSettings.maxOutputTokens; + // @ts-expect-error todo const experimental_telemetry = modelSettings.experimental_telemetry; const apiKey = runtime.token; @@ -1576,8 +1621,11 @@ export const generateObject = async ({ prompt: context, temperature, maxTokens: max_response_length, + // @ts-expect-error todo frequencyPenalty: frequency_penalty, + // @ts-expect-error todo presencePenalty: presence_penalty, + // @ts-expect-error todo stop: stop || modelSettings.stop, experimental_telemetry: experimental_telemetry, }; @@ -1585,6 +1633,7 @@ export const generateObject = async ({ const response = await handleProvider({ provider, model, + // @ts-expect-error todo apiKey, schema, schemaName, @@ -1691,6 +1740,7 @@ async function handleOpenAI({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); @@ -1717,6 +1767,7 @@ async function handleAnthropic({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); @@ -1743,6 +1794,7 @@ async function handleGrok({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); @@ -1769,6 +1821,7 @@ async function handleGroq({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); @@ -1795,6 +1848,7 @@ async function handleGoogle({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); @@ -1821,6 +1875,7 @@ async function handleRedPill({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); @@ -1850,6 +1905,7 @@ async function handleOpenRouter({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); @@ -1879,6 +1935,7 @@ async function handleOllama({ schema, schemaName, schemaDescription, + // @ts-expect-error todo mode, ...modelOptions, }); diff --git a/packages/core/src/knowledge.ts b/packages/core/src/knowledge.ts index 96a78514c67..536ecb2bd54 100644 --- a/packages/core/src/knowledge.ts +++ b/packages/core/src/knowledge.ts @@ -32,6 +32,7 @@ async function get( return []; } + // @ts-expect-error todo const embedding = await embed(runtime, processed); const fragments = await runtime.knowledgeManager.searchMemoriesByEmbedding( embedding, @@ -59,6 +60,7 @@ async function get( ) ); + // @ts-expect-error todo return knowledgeDocuments .filter((memory) => memory !== null) .map((memory) => ({ id: memory.id, content: memory.content })); @@ -84,6 +86,7 @@ async function set( const fragments = await splitChunks(preprocessed, chunkSize, bleed); for (const fragment of fragments) { + // @ts-expect-error todo const embedding = await embed(runtime, fragment); await runtime.knowledgeManager.createMemory({ // We namespace the knowledge base uuid to avoid id diff --git a/packages/core/src/memory.ts b/packages/core/src/memory.ts index 112352766f1..fe001106dfa 100644 --- a/packages/core/src/memory.ts +++ b/packages/core/src/memory.ts @@ -173,6 +173,7 @@ export class MemoryManager implements IMemoryManager { // TODO: check memory.agentId == this.runtime.agentId const existingMessage = + // @ts-expect-error todo await this.runtime.databaseAdapter.getMemoryById(memory.id); if (existingMessage) { diff --git a/packages/core/src/messages.ts b/packages/core/src/messages.ts index b098198c4f6..724a82debeb 100644 --- a/packages/core/src/messages.ts +++ b/packages/core/src/messages.ts @@ -81,6 +81,7 @@ export const formatMessages = ({ ? ` (Attachments: ${attachments.map((media) => `[${media.id} - ${media.title} (${media.url})]`).join(", ")})` : ""; + // @ts-expect-error todo const timestamp = formatTimestamp(message.createdAt); const shortId = message.userId.slice(-5); diff --git a/packages/core/src/parsing.ts b/packages/core/src/parsing.ts index 107ce8ea0bd..d6dbca3f409 100644 --- a/packages/core/src/parsing.ts +++ b/packages/core/src/parsing.ts @@ -79,7 +79,7 @@ Your response must include the JSON block.`; * @param text - The input text from which to extract and parse the JSON array. * @returns An array parsed from the JSON string if successful; otherwise, null. */ -export function parseJsonArrayFromText(text: string) { +export function parseJsonArrayFromText(text: string): T[] | null { let jsonData = null; // First try to parse with the original JSON format diff --git a/packages/core/src/posts.ts b/packages/core/src/posts.ts index 71f098cd7c0..ac1a5e809b8 100644 --- a/packages/core/src/posts.ts +++ b/packages/core/src/posts.ts @@ -23,13 +23,16 @@ export const formatPosts = ({ // Sort messages within each roomId by createdAt (oldest to newest) Object.values(groupedMessages).forEach((roomMessages) => { + // @ts-expect-error todo roomMessages.sort((a, b) => a.createdAt - b.createdAt); }); // Sort rooms by the newest message's createdAt const sortedRooms = Object.entries(groupedMessages).sort( ([, messagesA], [, messagesB]) => + // @ts-expect-error todo messagesB[messagesB.length - 1].createdAt - + // @ts-expect-error todo messagesA[messagesA.length - 1].createdAt ); @@ -42,10 +45,12 @@ export const formatPosts = ({ ); const userName = actor?.name || "Unknown User"; const displayName = actor?.username || "unknown"; + // @ts-expect-error todo + const timestamp = formatTimestamp(message.createdAt); return `Name: ${userName} (@${displayName}) ID: ${message.id}${message.content.inReplyTo ? `\nIn reply to: ${message.content.inReplyTo}` : ""} -Date: ${formatTimestamp(message.createdAt)} +Date: ${timestamp} Text: ${message.content.text}`; }); diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index 0dad3997008..fc0d67b0604 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -32,6 +32,7 @@ import { IDatabaseAdapter, IMemoryManager, KnowledgeItem, + Media, ModelClass, ModelProviderName, Plugin, @@ -270,26 +271,31 @@ export class AgentRuntime implements IAgentRuntime { this.cacheManager = opts.cacheManager; this.messageManager = new MemoryManager({ + // @ts-expect-error todo runtime: this, tableName: "messages", }); this.descriptionManager = new MemoryManager({ + // @ts-expect-error todo runtime: this, tableName: "descriptions", }); this.loreManager = new MemoryManager({ + // @ts-expect-error todo runtime: this, tableName: "lore", }); this.documentsManager = new MemoryManager({ + // @ts-expect-error todo runtime: this, tableName: "documents", }); this.knowledgeManager = new MemoryManager({ + // @ts-expect-error todo runtime: this, tableName: "fragments", }); @@ -393,6 +399,7 @@ export class AgentRuntime implements IAgentRuntime { async initialize() { for (const [serviceType, service] of this.services.entries()) { try { + // @ts-expect-error todo await service.initialize(this); this.services.set(serviceType, service); elizaLogger.success( @@ -410,6 +417,7 @@ export class AgentRuntime implements IAgentRuntime { for (const plugin of this.plugins) { if (plugin.services) await Promise.all( + // @ts-expect-error todo plugin.services?.map((service) => service.initialize(this)) ); } @@ -603,6 +611,7 @@ export class AgentRuntime implements IAgentRuntime { elizaLogger.info( `Executing handler for action: ${action.name}` ); + // @ts-expect-error todo await action.handler(this, message, state, {}, callback); } catch (error) { elizaLogger.error(error); @@ -618,6 +627,7 @@ export class AgentRuntime implements IAgentRuntime { * @param callback The handler callback * @returns The results of the evaluation. */ + // @ts-expect-error todo async evaluate( message: Memory, state?: State, @@ -633,6 +643,7 @@ export class AgentRuntime implements IAgentRuntime { if (!didRespond && !evaluator.alwaysRun) { return null; } + // @ts-expect-error todo const result = await evaluator.validate(this, message, state); if (result) { return evaluator; @@ -650,9 +661,12 @@ export class AgentRuntime implements IAgentRuntime { } const context = composeContext({ + // @ts-expect-error todo state: { ...state, + // @ts-expect-error todo evaluators: formatEvaluators(evaluatorsData), + // @ts-expect-error todo evaluatorNames: formatEvaluatorNames(evaluatorsData), }, template: @@ -661,19 +675,19 @@ export class AgentRuntime implements IAgentRuntime { }); const result = await generateText({ + // @ts-expect-error todo runtime: this, context, modelClass: ModelClass.SMALL, }); - const evaluators = parseJsonArrayFromText( - result - ) as unknown as string[]; + const evaluators = parseJsonArrayFromText(result); for (const evaluator of this.evaluators) { - if (!evaluators.includes(evaluator.name)) continue; + if (!evaluators?.includes(evaluator.name)) continue; if (evaluator.handler) + // @ts-expect-error todo await evaluator.handler(this, message, state, {}, callback); } @@ -800,6 +814,7 @@ export class AgentRuntime implements IAgentRuntime { Memory[], Goal[], ] = await Promise.all([ + // @ts-expect-error todo getActorDetails({ runtime: this, roomId }), this.messageManager.getMemories({ roomId, @@ -807,6 +822,7 @@ export class AgentRuntime implements IAgentRuntime { unique: false, }), getGoals({ + // @ts-expect-error todo runtime: this, count: 10, onlyInProgress: false, @@ -852,6 +868,7 @@ export class AgentRuntime implements IAgentRuntime { if (lastMessageWithAttachment) { const lastMessageTime = lastMessageWithAttachment.createdAt; const oneHourBeforeLastMessage = + // @ts-expect-error todo lastMessageTime - 60 * 60 * 1000; // 1 hour before last message allAttachments = recentMessagesData @@ -947,6 +964,7 @@ Text: ${attachment.text} }); // Sort messages by timestamp in descending order + // @ts-expect-error todo existingMemories.sort((a, b) => b.createdAt - a.createdAt); // Take the most recent messages @@ -1163,6 +1181,7 @@ Text: ${attachment.text} } as State; const actionPromises = this.actions.map(async (action: Action) => { + // @ts-expect-error todo const result = await action.validate(this, message, initialState); if (result) { return action; @@ -1172,6 +1191,7 @@ Text: ${attachment.text} const evaluatorPromises = this.evaluators.map(async (evaluator) => { const result = await evaluator.validate( + // @ts-expect-error todo this, message, initialState @@ -1186,6 +1206,7 @@ Text: ${attachment.text} await Promise.all([ Promise.all(evaluatorPromises), Promise.all(actionPromises), + // @ts-expect-error todo getProviders(this, message, initialState), ]); @@ -1250,7 +1271,7 @@ Text: ${attachment.text} }), }); - let allAttachments = []; + let allAttachments: Media[] = []; if (recentMessagesData && Array.isArray(recentMessagesData)) { const lastMessageWithAttachment = recentMessagesData.find( @@ -1262,11 +1283,13 @@ Text: ${attachment.text} if (lastMessageWithAttachment) { const lastMessageTime = lastMessageWithAttachment.createdAt; const oneHourBeforeLastMessage = + // @ts-expect-error todo lastMessageTime - 60 * 60 * 1000; // 1 hour before last message allAttachments = recentMessagesData .filter((msg) => { const msgTime = msg.createdAt; + // @ts-expect-error todo return msgTime >= oneHourBeforeLastMessage; }) .flatMap((msg) => msg.content.attachments || []); diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index c6d643e9626..f2db837cccc 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -796,7 +796,9 @@ export type Character = { modelConfig?: ModelConfiguration; embeddingModel?: string; chains?: { + // @ts-expect-error todo evm?: any[]; + // @ts-expect-error todo solana?: any[]; [key: string]: any[]; }; diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index cb33a265893..4a2618f8f98 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -20,7 +20,8 @@ "noEmitOnError": false, "moduleDetection": "force", "allowArbitraryExtensions": true, - "customConditions": ["@elizaos/source"] + "customConditions": ["@elizaos/source"], + "strictNullChecks": true }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "src/**/*.d.ts", "types/**/*.test.ts"] diff --git a/packages/plugin-3d-generation/src/index.ts b/packages/plugin-3d-generation/src/index.ts index 529782daca4..ff0dccc0776 100644 --- a/packages/plugin-3d-generation/src/index.ts +++ b/packages/plugin-3d-generation/src/index.ts @@ -16,6 +16,7 @@ import * as path from "path"; import * as process from "process"; const generate3D = async (prompt: string, runtime: IAgentRuntime) => { + // @ts-expect-error todo process.env["FAL_KEY"] = FAL_CONSTANTS.API_KEY_SETTING || runtime.getSetting("FAL_API_KEY"); diff --git a/packages/plugin-aptos/src/actions/transfer.ts b/packages/plugin-aptos/src/actions/transfer.ts index 2fd4f29b681..8b7976de279 100644 --- a/packages/plugin-aptos/src/actions/transfer.ts +++ b/packages/plugin-aptos/src/actions/transfer.ts @@ -134,6 +134,7 @@ export default { const aptosAccount = Account.fromPrivateKey({ privateKey: new Ed25519PrivateKey( PrivateKey.formatPrivateKey( + // @ts-expect-error todo privateKey, PrivateKeyVariants.Ed25519 ) diff --git a/packages/plugin-aptos/src/providers/wallet.ts b/packages/plugin-aptos/src/providers/wallet.ts index fbb209c3ac4..978b4f4163f 100644 --- a/packages/plugin-aptos/src/providers/wallet.ts +++ b/packages/plugin-aptos/src/providers/wallet.ts @@ -50,6 +50,7 @@ export class WalletProvider { const cached = await this.cacheManager.get( path.join(this.cacheKey, key) ); + // @ts-expect-error todo return cached; } @@ -118,8 +119,10 @@ export class WalletProvider { console.error( "All attempts failed. Throwing the last error:", + // @ts-expect-error todo lastError ); + // @ts-expect-error todo throw lastError; } @@ -227,6 +230,7 @@ const walletProvider: Provider = { const aptosAccount = Account.fromPrivateKey({ privateKey: new Ed25519PrivateKey( PrivateKey.formatPrivateKey( + // @ts-expect-error todo privateKey, PrivateKeyVariants.Ed25519 ) diff --git a/packages/plugin-avail/src/actions/submitData.ts b/packages/plugin-avail/src/actions/submitData.ts index 978ae5a3dcb..c1e1ce49789 100644 --- a/packages/plugin-avail/src/actions/submitData.ts +++ b/packages/plugin-avail/src/actions/submitData.ts @@ -27,6 +27,7 @@ export interface DataContent extends Content { data: string; } +// @ts-expect-error todo export function isDataContent(content: DataContent): content is DataContent { // Validate types const validTypes = typeof content.data === "string"; @@ -78,6 +79,7 @@ export default { state: State, _options: { [key: string]: unknown }, callback?: HandlerCallback + // @ts-expect-error todo ): Promise => { elizaLogger.log("Starting SUBMIT_DATA handler..."); @@ -120,6 +122,7 @@ export default { const ENDPOINT = runtime.getSetting("AVAIL_RPC_URL"); const APP_ID = runtime.getSetting("AVAIL_APP_ID"); + // @ts-expect-error todo const api = await initialize(ENDPOINT); const keyring = getKeyringFromSeed(SEED); const options = { app_id: APP_ID, nonce: -1 }; diff --git a/packages/plugin-avail/src/actions/transfer.ts b/packages/plugin-avail/src/actions/transfer.ts index df3b04cbe8f..86e2cd61cc3 100644 --- a/packages/plugin-avail/src/actions/transfer.ts +++ b/packages/plugin-avail/src/actions/transfer.ts @@ -89,6 +89,7 @@ export default { state: State, _options: { [key: string]: unknown }, callback?: HandlerCallback + // @ts-expect-error todo ): Promise => { elizaLogger.log("Starting SEND_TOKEN handler..."); @@ -131,6 +132,7 @@ export default { const PUBLIC_KEY = runtime.getSetting("AVAIL_ADDRESS")!; const ENDPOINT = runtime.getSetting("AVAIL_RPC_URL"); + // @ts-expect-error todo const api = await initialize(ENDPOINT); const keyring = getKeyringFromSeed(SEED); const options = { app_id: 0, nonce: -1 }; diff --git a/packages/plugin-bootstrap/src/actions/continue.ts b/packages/plugin-bootstrap/src/actions/continue.ts index dbc6b1cc5c7..3daff021c32 100644 --- a/packages/plugin-bootstrap/src/actions/continue.ts +++ b/packages/plugin-bootstrap/src/actions/continue.ts @@ -216,6 +216,7 @@ export const continueAction: Action = { if (continueCount >= maxContinuesInARow - 1) { // -1 because we're about to add another + // @ts-expect-error todo response.action = null; } } diff --git a/packages/plugin-bootstrap/src/evaluators/fact.ts b/packages/plugin-bootstrap/src/evaluators/fact.ts index b2ad61e7d24..cd27f92ad5a 100644 --- a/packages/plugin-bootstrap/src/evaluators/fact.ts +++ b/packages/plugin-bootstrap/src/evaluators/fact.ts @@ -92,6 +92,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) { for (const fact of filteredFacts) { const factMemory = await factsManager.addEmbeddingToMemory({ userId: agentId!, + // @ts-expect-error todo agentId, content: { text: fact }, roomId, diff --git a/packages/plugin-bootstrap/src/evaluators/goal.ts b/packages/plugin-bootstrap/src/evaluators/goal.ts index 90bb35dd41a..58eaf72d2ba 100644 --- a/packages/plugin-bootstrap/src/evaluators/goal.ts +++ b/packages/plugin-bootstrap/src/evaluators/goal.ts @@ -69,7 +69,7 @@ async function handler( }); // Parse the JSON response to extract goal updates - const updates = parseJsonArrayFromText(response); + const updates = parseJsonArrayFromText(response); // get goals const goalsData = await getGoals({ @@ -115,12 +115,16 @@ async function handler( // Update goals in the database for (const goal of updatedGoals) { + // @ts-expect-error todo const id = goal.id; // delete id from goal + // @ts-expect-error todo if (goal.id) delete goal.id; + // @ts-expect-error todo await runtime.databaseAdapter.updateGoal({ ...goal, id }); } + // @ts-expect-error todo return updatedGoals; // Return updated goals for further processing or logging } diff --git a/packages/plugin-bootstrap/src/providers/facts.ts b/packages/plugin-bootstrap/src/providers/facts.ts index 20829d9fed4..875f0a784df 100644 --- a/packages/plugin-bootstrap/src/providers/facts.ts +++ b/packages/plugin-bootstrap/src/providers/facts.ts @@ -8,17 +8,22 @@ import type { Memory, Provider, State } from "@elizaos/core"; import { formatFacts } from "../evaluators/fact.ts"; const factsProvider: Provider = { + // @ts-expect-error todo get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { const recentMessagesData = state?.recentMessagesData?.slice(-10); const recentMessages = formatMessages({ + // @ts-expect-error todo messages: recentMessagesData, + // @ts-expect-error todo actors: state?.actorsData, }); + // @ts-expect-error todo const _embedding = await embed(runtime, recentMessages); const memoryManager = new MemoryManager({ + // @ts-expect-error todo runtime, tableName: "facts", }); diff --git a/packages/plugin-coinbase/src/plugins/commerce.ts b/packages/plugin-coinbase/src/plugins/commerce.ts index 7dacdc0fcb6..76adb3c8480 100644 --- a/packages/plugin-coinbase/src/plugins/commerce.ts +++ b/packages/plugin-coinbase/src/plugins/commerce.ts @@ -182,6 +182,7 @@ export const createCoinbaseChargeAction: Action = { try { // Create a charge const chargeResponse = await createCharge( + // @ts-expect-error todo runtime.getSetting("COINBASE_COMMERCE_KEY"), { local_price: { @@ -343,6 +344,7 @@ export const getAllChargesAction: Action = { state = await runtime.updateRecentMessageState(state); } const charges = await getAllCharges( + // @ts-expect-error todo runtime.getSetting("COINBASE_COMMERCE_KEY") ); @@ -433,6 +435,7 @@ export const getChargeDetailsAction: Action = { try { const chargeDetails = await getChargeDetails( + // @ts-expect-error todo runtime.getSetting("COINBASE_COMMERCE_KEY"), charge.id ); @@ -491,6 +494,7 @@ export const chargeProvider: Provider = { get: async (runtime: IAgentRuntime, _message: Memory) => { elizaLogger.debug("Starting chargeProvider.get function"); const charges = await getAllCharges( + // @ts-expect-error todo runtime.getSetting("COINBASE_COMMERCE_KEY") ); // Ensure API key is available diff --git a/packages/plugin-coinbase/src/plugins/massPayments.ts b/packages/plugin-coinbase/src/plugins/massPayments.ts index 70e65d17fc8..725c3a8b025 100644 --- a/packages/plugin-coinbase/src/plugins/massPayments.ts +++ b/packages/plugin-coinbase/src/plugins/massPayments.ts @@ -44,9 +44,11 @@ export const massPayoutProvider: Provider = { elizaLogger.debug("Starting massPayoutProvider.get function"); try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, @@ -157,9 +159,11 @@ async function executeMassPayout( transactions.push({ address, + // @ts-expect-error todo amount: transfer.getAmount().toNumber(), status: "Success", errorCode: null, + // @ts-expect-error todo transactionUrl: transfer.getTransactionLink(), }); } catch (error) { @@ -196,19 +200,24 @@ async function executeMassPayout( sendingWallet, transferAmount * 0.01, assetId, + // @ts-expect-error todo charityAddress ); transactions.push({ + // @ts-expect-error todo address: charityAddress, + // @ts-expect-error todo amount: charityTransfer.getAmount().toNumber(), status: "Success", errorCode: null, + // @ts-expect-error todo transactionUrl: charityTransfer.getTransactionLink(), }); } catch (error) { elizaLogger.error("Error during charity transfer:", error); transactions.push({ + // @ts-expect-error todo address: charityAddress, amount: transferAmount * 0.01, status: "Failed", @@ -231,10 +240,12 @@ export const sendMassPayoutAction: Action = { elizaLogger.info("Validating runtime and message..."); return ( !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_API_KEY || process.env.COINBASE_API_KEY ) && !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_PRIVATE_KEY || process.env.COINBASE_PRIVATE_KEY ) @@ -250,9 +261,11 @@ export const sendMassPayoutAction: Action = { elizaLogger.debug("Starting SEND_MASS_PAYOUT handler..."); try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, diff --git a/packages/plugin-coinbase/src/plugins/tokenContract.ts b/packages/plugin-coinbase/src/plugins/tokenContract.ts index 861f67ba235..64b0223ec61 100644 --- a/packages/plugin-coinbase/src/plugins/tokenContract.ts +++ b/packages/plugin-coinbase/src/plugins/tokenContract.ts @@ -61,10 +61,12 @@ export const deployTokenContractAction: Action = { elizaLogger.info("Validating runtime for DEPLOY_TOKEN_CONTRACT..."); return ( !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_API_KEY || process.env.COINBASE_API_KEY ) && !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_PRIVATE_KEY || process.env.COINBASE_PRIVATE_KEY ) @@ -81,9 +83,11 @@ export const deployTokenContractAction: Action = { try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, @@ -290,10 +294,12 @@ export const invokeContractAction: Action = { elizaLogger.info("Validating runtime for INVOKE_CONTRACT..."); return ( !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_API_KEY || process.env.COINBASE_API_KEY ) && !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_PRIVATE_KEY || process.env.COINBASE_PRIVATE_KEY ) @@ -310,9 +316,11 @@ export const invokeContractAction: Action = { try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, @@ -357,6 +365,7 @@ export const invokeContractAction: Action = { abi: ABI, args: { ...args, + // @ts-expect-error todo amount: args.amount || amount, // Ensure amount is passed in args }, networkId, @@ -457,10 +466,12 @@ export const readContractAction: Action = { elizaLogger.info("Validating runtime for READ_CONTRACT..."); return ( !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_API_KEY || process.env.COINBASE_API_KEY ) && !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_PRIVATE_KEY || process.env.COINBASE_PRIVATE_KEY ) @@ -477,9 +488,11 @@ export const readContractAction: Action = { try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, diff --git a/packages/plugin-coinbase/src/plugins/trade.ts b/packages/plugin-coinbase/src/plugins/trade.ts index 5858d70f1ad..364c49eb825 100644 --- a/packages/plugin-coinbase/src/plugins/trade.ts +++ b/packages/plugin-coinbase/src/plugins/trade.ts @@ -33,9 +33,11 @@ export const tradeProvider: Provider = { elizaLogger.debug("Starting tradeProvider.get function"); try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, @@ -100,10 +102,12 @@ export const executeTradeAction: Action = { elizaLogger.info("Validating runtime for EXECUTE_TRADE..."); return ( !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_API_KEY || process.env.COINBASE_API_KEY ) && !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_PRIVATE_KEY || process.env.COINBASE_PRIVATE_KEY ) @@ -120,9 +124,11 @@ export const executeTradeAction: Action = { try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, diff --git a/packages/plugin-coinbase/src/plugins/webhooks.ts b/packages/plugin-coinbase/src/plugins/webhooks.ts index 62dd40de223..e377a80d87e 100644 --- a/packages/plugin-coinbase/src/plugins/webhooks.ts +++ b/packages/plugin-coinbase/src/plugins/webhooks.ts @@ -21,9 +21,11 @@ export const webhookProvider: Provider = { elizaLogger.debug("Starting webhookProvider.get function"); try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, @@ -57,14 +59,17 @@ export const createWebhookAction: Action = { elizaLogger.info("Validating runtime for CREATE_WEBHOOK..."); return ( !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_API_KEY || process.env.COINBASE_API_KEY ) && !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_PRIVATE_KEY || process.env.COINBASE_PRIVATE_KEY ) && !!( + // @ts-expect-error todo runtime.character.settings.secrets?.COINBASE_NOTIFICATION_URI || process.env.COINBASE_NOTIFICATION_URI ) @@ -81,9 +86,11 @@ export const createWebhookAction: Action = { try { Coinbase.configure({ + // @ts-expect-error todo apiKeyName: runtime.getSetting("COINBASE_API_KEY") ?? process.env.COINBASE_API_KEY, + // @ts-expect-error todo privateKey: runtime.getSetting("COINBASE_PRIVATE_KEY") ?? process.env.COINBASE_PRIVATE_KEY, diff --git a/packages/plugin-echochambers/src/interactions.ts b/packages/plugin-echochambers/src/interactions.ts index 9c5ea938b01..a5a5dd5bfa4 100644 --- a/packages/plugin-echochambers/src/interactions.ts +++ b/packages/plugin-echochambers/src/interactions.ts @@ -209,6 +209,7 @@ export class InteractionClient { message.content.toLowerCase().includes(room.topic.toLowerCase()); // Always process if mentioned, otherwise check relevance + // @ts-expect-error todo return isMentioned || isRelevantToTopic; } @@ -314,6 +315,7 @@ export class InteractionClient { // Check if we've already processed this message const existing = await this.runtime.messageManager.getMemoryById( + // @ts-expect-error todo memory.id ); if (existing) { diff --git a/packages/plugin-evm/src/actions/bridge.ts b/packages/plugin-evm/src/actions/bridge.ts index d5d8816e25a..52410047656 100644 --- a/packages/plugin-evm/src/actions/bridge.ts +++ b/packages/plugin-evm/src/actions/bridge.ts @@ -40,6 +40,7 @@ export class BridgeAction { chainName: config.name, nativeCurrency: config.nativeCurrency, rpcUrls: [config.rpcUrls.default.http[0]], + // @ts-expect-error todo blockExplorerUrls: [config.blockExplorers.default.url], }, diamondAddress: "0x0000000000000000000000000000000000000000", diff --git a/packages/plugin-evm/src/actions/swap.ts b/packages/plugin-evm/src/actions/swap.ts index a43dca6cbd8..2231a5c7533 100644 --- a/packages/plugin-evm/src/actions/swap.ts +++ b/packages/plugin-evm/src/actions/swap.ts @@ -43,12 +43,14 @@ export class SwapAction { rpcUrls: { public: { http: [config.rpcUrls.default.http[0]] }, }, + // @ts-expect-error todo blockExplorerUrls: [config.blockExplorers.default.url], metamask: { chainId: `0x${config.id.toString(16)}`, chainName: config.name, nativeCurrency: config.nativeCurrency, rpcUrls: [config.rpcUrls.default.http[0]], + // @ts-expect-error todo blockExplorerUrls: [config.blockExplorers.default.url], }, coin: config.nativeCurrency.symbol, diff --git a/packages/plugin-evm/src/actions/transfer.ts b/packages/plugin-evm/src/actions/transfer.ts index 51c3b27eada..7c7823248cf 100644 --- a/packages/plugin-evm/src/actions/transfer.ts +++ b/packages/plugin-evm/src/actions/transfer.ts @@ -35,6 +35,7 @@ export class TransferAction { try { const hash = await walletClient.sendTransaction({ + // @ts-expect-error todo account: walletClient.account, to: params.toAddress, value: parseEther(params.amount), @@ -55,6 +56,7 @@ export class TransferAction { return { hash, + // @ts-expect-error todo from: walletClient.account.address, to: params.toAddress, value: parseEther(params.amount), diff --git a/packages/plugin-evm/src/providers/wallet.ts b/packages/plugin-evm/src/providers/wallet.ts index fa7e712dce2..a5a36294473 100644 --- a/packages/plugin-evm/src/providers/wallet.ts +++ b/packages/plugin-evm/src/providers/wallet.ts @@ -157,6 +157,7 @@ export class WalletProvider { const cached = await this.cacheManager.get( path.join(this.cacheKey, key) ); + // @ts-expect-error todo return cached; } @@ -254,6 +255,7 @@ const genChainsFromRuntime = ( runtime: IAgentRuntime ): Record => { const chainNames = + // @ts-expect-error todo (runtime.character.settings.chains?.evm as SupportedChain[]) || []; const chains = {}; diff --git a/packages/plugin-flow/src/providers/connector.provider.ts b/packages/plugin-flow/src/providers/connector.provider.ts index 1bcafebf788..4df60b32fb9 100644 --- a/packages/plugin-flow/src/providers/connector.provider.ts +++ b/packages/plugin-flow/src/providers/connector.provider.ts @@ -38,6 +38,7 @@ async function _createFlowConnector( ): Promise { const rpcEndpoint = runtime.getSetting("FLOW_ENDPOINT_URL"); const network = runtime.getSetting("FLOW_NETWORK") as NetworkType; + // @ts-expect-error todo const instance = new FlowConnector(flowJSON, network, rpcEndpoint); await instance.onModuleInit(); return instance; @@ -49,6 +50,7 @@ async function _createFlowConnector( */ export async function getFlowConnectorInstance( runtime: IAgentRuntime, + // @ts-expect-error todo inputedFlowJSON: { [key: string]: unknown } = undefined ): Promise { let connector: FlowConnector; diff --git a/packages/plugin-flow/src/providers/utils/flow.connector.ts b/packages/plugin-flow/src/providers/utils/flow.connector.ts index 45cb01fc4e5..b003c722a34 100644 --- a/packages/plugin-flow/src/providers/utils/flow.connector.ts +++ b/packages/plugin-flow/src/providers/utils/flow.connector.ts @@ -15,6 +15,7 @@ export class FlowConnector implements IFlowScriptExecutor { constructor( private readonly flowJSON: object, public readonly network: NetworkType = "mainnet", + // @ts-expect-error todo private readonly defaultRpcEndpoint: string = undefined ) {} @@ -62,6 +63,7 @@ export class FlowConnector implements IFlowScriptExecutor { private async ensureInited() { if (isGloballyInited) return; if (!globallyPromise) { + // @ts-expect-error todo globallyPromise = this.onModuleInit(); } return await globallyPromise; @@ -94,6 +96,7 @@ export class FlowConnector implements IFlowScriptExecutor { authorizations: (extraAuthz?.length ?? 0) === 0 ? [mainAuthz] + // @ts-expect-error todo : [mainAuthz, ...extraAuthz], }); } else { diff --git a/packages/plugin-flow/src/providers/wallet.provider.ts b/packages/plugin-flow/src/providers/wallet.provider.ts index abc3dc58436..9868ad504e3 100644 --- a/packages/plugin-flow/src/providers/wallet.provider.ts +++ b/packages/plugin-flow/src/providers/wallet.provider.ts @@ -125,6 +125,7 @@ export class FlowWalletProvider implements IFlowSigner, IFlowScriptExecutor { * @param message Message to sign */ signMessage(message: string, privateKey = this.privateKeyHex) { + // @ts-expect-error todo return PureSigner.signWithKey(privateKey, message); } diff --git a/packages/plugin-flow/src/queries.ts b/packages/plugin-flow/src/queries.ts index 9bdae7dc01b..fdd706e1233 100644 --- a/packages/plugin-flow/src/queries.ts +++ b/packages/plugin-flow/src/queries.ts @@ -72,9 +72,13 @@ export async function queryAccountBalanceInfo( return undefined; } return { + // @ts-expect-error todo address: ret.address, + // @ts-expect-error todo balance: parseFloat(ret.balance), + // @ts-expect-error todo coaAddress: ret.coaAddress, + // @ts-expect-error todo coaBalance: ret.coaBalance ? parseFloat(ret.coaBalance) : undefined, }; } diff --git a/packages/plugin-goat/src/index.ts b/packages/plugin-goat/src/index.ts index 6321d4c16d9..9dbb0d56aed 100644 --- a/packages/plugin-goat/src/index.ts +++ b/packages/plugin-goat/src/index.ts @@ -6,11 +6,13 @@ async function createGoatPlugin( getSetting: (key: string) => string | undefined ): Promise { const walletClient = getWalletClient(getSetting); + // @ts-expect-error todo const actions = await getOnChainActions(walletClient); return { name: "[GOAT] Onchain Actions", description: "Mode integration plugin", + // @ts-expect-error todo providers: [getWalletProvider(walletClient)], evaluators: [], services: [], diff --git a/packages/plugin-nft-generation/src/api.ts b/packages/plugin-nft-generation/src/api.ts index 1501a5a370e..8693014ae08 100644 --- a/packages/plugin-nft-generation/src/api.ts +++ b/packages/plugin-nft-generation/src/api.ts @@ -22,6 +22,7 @@ export function createNFTApiRouter( } try { const collectionAddressRes = await createCollection({ + // @ts-expect-error todo runtime, collectionName: runtime.character.name, fee, @@ -58,6 +59,7 @@ export function createNFTApiRouter( try { const nftInfo = await createNFTMetadata({ + // @ts-expect-error todo runtime, collectionName, collectionAdminPublicKey, @@ -99,6 +101,7 @@ export function createNFTApiRouter( try { const nftRes = await createNFT({ + // @ts-expect-error todo runtime, collectionName, collectionAddress, @@ -141,6 +144,7 @@ export function createNFTApiRouter( } try { const { success } = await verifyNFT({ + // @ts-expect-error todo runtime, collectionAddress, NFTAddress, diff --git a/packages/plugin-nft-generation/src/index.ts b/packages/plugin-nft-generation/src/index.ts index 07a147ef0d6..b8a6e902c0b 100644 --- a/packages/plugin-nft-generation/src/index.ts +++ b/packages/plugin-nft-generation/src/index.ts @@ -63,6 +63,7 @@ const nftCollectionGeneration: Action = { collectionName: runtime.character.name, }); + // @ts-expect-error todo const collectionInfo = collectionAddressRes.collectionInfo; elizaLogger.log("Collection Address:", collectionAddressRes); @@ -70,7 +71,9 @@ const nftCollectionGeneration: Action = { const nftRes = await createNFT({ runtime, collectionName: collectionInfo.name, + // @ts-expect-error todo collectionAddress: collectionAddressRes.address, + // @ts-expect-error todo collectionAdminPublicKey: collectionInfo.adminPublicKey, collectionFee: collectionInfo.fee, tokenId: 1, @@ -79,13 +82,16 @@ const nftCollectionGeneration: Action = { elizaLogger.log("NFT Address:", nftRes); callback({ + // @ts-expect-error todo text: `Congratulations to you! 🎉🎉🎉 \nCollection : ${collectionAddressRes.link}\n NFT: ${nftRes.link}`, //caption.description, attachments: [], }); await sleep(15000); await verifyNFT({ runtime, + // @ts-expect-error todo collectionAddress: collectionAddressRes.address, + // @ts-expect-error todo NFTAddress: nftRes.address, }); return []; diff --git a/packages/plugin-nft-generation/src/provider/wallet/walletSolana.ts b/packages/plugin-nft-generation/src/provider/wallet/walletSolana.ts index 2bfeb85ca67..9900d1992b7 100644 --- a/packages/plugin-nft-generation/src/provider/wallet/walletSolana.ts +++ b/packages/plugin-nft-generation/src/provider/wallet/walletSolana.ts @@ -46,6 +46,7 @@ export class WalletSolana { commitment: "finalized", }); } + // @ts-expect-error todo const umi = createUmi(this.connection.rpcEndpoint); umi.use(mplTokenMetadata()); const umiUser = umi.eddsa.createKeypairFromSecretKey( @@ -56,6 +57,7 @@ export class WalletSolana { } async getBalance() { + // @ts-expect-error todo const balance = await this.connection.getBalance(this.walletPublicKey); return { value: balance, diff --git a/packages/plugin-node/src/services/awsS3.ts b/packages/plugin-node/src/services/awsS3.ts index 0c038c5ef5d..15f70c12d3c 100644 --- a/packages/plugin-node/src/services/awsS3.ts +++ b/packages/plugin-node/src/services/awsS3.ts @@ -108,6 +108,7 @@ export class AwsS3Service extends Service implements IAwsS3Service { }; // Upload file + // @ts-expect-error todo await this.s3Client.send(new PutObjectCommand(uploadParams)); // Build result object @@ -124,6 +125,7 @@ export class AwsS3Service extends Service implements IAwsS3Service { Key: fileName, }); result.url = await getSignedUrl( + // @ts-expect-error todo this.s3Client, getObjectCommand, { @@ -160,6 +162,7 @@ export class AwsS3Service extends Service implements IAwsS3Service { Key: fileName, }); + // @ts-expect-error todo return await getSignedUrl(this.s3Client, command, { expiresIn }); } @@ -229,6 +232,7 @@ export class AwsS3Service extends Service implements IAwsS3Service { }; // Upload file + // @ts-expect-error todo await this.s3Client.send(new PutObjectCommand(uploadParams)); // Build result @@ -246,6 +250,7 @@ export class AwsS3Service extends Service implements IAwsS3Service { Key: key, }); result.url = await getSignedUrl( + // @ts-expect-error todo this.s3Client, getObjectCommand, { expiresIn } diff --git a/packages/plugin-node/src/services/browser.ts b/packages/plugin-node/src/services/browser.ts index 4a482f295bd..69a1d63a17e 100644 --- a/packages/plugin-node/src/services/browser.ts +++ b/packages/plugin-node/src/services/browser.ts @@ -175,6 +175,7 @@ export class BrowserService extends Service implements IBrowserService { ); } + // @ts-expect-error todo page = await this.context.newPage(); // Enable stealth mode @@ -193,6 +194,7 @@ export class BrowserService extends Service implements IBrowserService { elizaLogger.error("Failed to load the page"); } + // @ts-expect-error todo if (response.status() === 403 || response.status() === 404) { return await this.tryAlternativeSources(url, runtime); } diff --git a/packages/plugin-node/src/services/image.ts b/packages/plugin-node/src/services/image.ts index 55c29db6d14..df0e9ab3863 100644 --- a/packages/plugin-node/src/services/image.ts +++ b/packages/plugin-node/src/services/image.ts @@ -51,7 +51,9 @@ export class ImageDescriptionService env.allowLocalModels = false; env.allowRemoteModels = true; env.backends.onnx.logLevel = "fatal"; + // @ts-expect-error todo env.backends.onnx.wasm.proxy = false; + // @ts-expect-error todo env.backends.onnx.wasm.numThreads = 1; elizaLogger.info("Downloading Florence model..."); @@ -93,6 +95,7 @@ export class ImageDescriptionService imageUrl: string ): Promise<{ title: string; description: string }> { if (!this.initialized) { + // @ts-expect-error todo const model = models[this.runtime?.character?.modelProvider]; if (model === models[ModelProviderName.LLAMALOCAL]) { @@ -190,6 +193,7 @@ export class ImageDescriptionService const shouldUseBase64 = (isGif || isLocalFile) && !( + // @ts-expect-error todo this.runtime.imageModelProvider === ModelProviderName.OPENAI ); @@ -213,13 +217,16 @@ export class ImageDescriptionService ]; // If model provider is openai, use the endpoint, otherwise use the default openai endpoint. const endpoint = + // @ts-expect-error todo this.runtime.imageModelProvider === ModelProviderName.OPENAI + // @ts-expect-error todo ? getEndpoint(this.runtime.imageModelProvider) : "https://api.openai.com/v1"; const response = await fetch(endpoint + "/chat/completions", { method: "POST", headers: { "Content-Type": "application/json", + // @ts-expect-error todo Authorization: `Bearer ${this.runtime.getSetting("OPENAI_API_KEY")}`, }, body: JSON.stringify({ @@ -263,6 +270,7 @@ export class ImageDescriptionService this.processing = true; while (this.queue.length > 0) { const imageUrl = this.queue.shift(); + // @ts-expect-error todo await this.processImage(imageUrl); } this.processing = false; diff --git a/packages/plugin-node/src/services/llama.ts b/packages/plugin-node/src/services/llama.ts index 3f2d62183b0..4fa83f2deae 100644 --- a/packages/plugin-node/src/services/llama.ts +++ b/packages/plugin-node/src/services/llama.ts @@ -287,7 +287,9 @@ export class LlamaService extends Service { https .get(url, (response) => { if ( + // @ts-expect-error todo response.statusCode >= 300 && + // @ts-expect-error todo response.statusCode < 400 && response.headers.location ) { @@ -571,6 +573,7 @@ export class LlamaService extends Service { grammarEvaluationState: useGrammar ? this.grammar : undefined, yieldEogToken: false, })) { + // @ts-expect-error todo const current = this.model.detokenize([...responseTokens, token]); if ([...stop].some((s) => current.includes(s))) { elizaLogger.info("Stop sequence found"); @@ -774,6 +777,7 @@ export class LlamaService extends Service { repeatPenalty: repeatPenalty, yieldEogToken: false, })) { + // @ts-expect-error todo const current = this.model.detokenize([...responseTokens, token]); if (current.includes("\n")) { elizaLogger.info("Stop sequence found"); @@ -803,8 +807,10 @@ export class LlamaService extends Service { throw new Error("Sequence not initialized"); } + // @ts-expect-error todo const embeddingContext = await this.model.createEmbeddingContext(); const embedding = await embeddingContext.getEmbeddingFor(text); + // @ts-expect-error todo return embedding?.vector ? [...embedding.vector] : undefined; } } diff --git a/packages/plugin-node/src/services/speech.ts b/packages/plugin-node/src/services/speech.ts index dcf568967ed..88259acd978 100644 --- a/packages/plugin-node/src/services/speech.ts +++ b/packages/plugin-node/src/services/speech.ts @@ -82,6 +82,7 @@ async function textToSpeech(runtime: IAgentRuntime, text: string) { `https://api.elevenlabs.io/v1/text-to-speech/${elevenlabsVoiceId}/stream?optimize_streaming_latency=${runtime.getSetting("ELEVENLABS_OPTIMIZE_STREAMING_LATENCY")}&output_format=${runtime.getSetting("ELEVENLABS_OUTPUT_FORMAT")}`, { method: "POST", + // @ts-expect-error todo headers: { "Content-Type": "application/json", "xi-api-key": runtime.getSetting("ELEVENLABS_XI_API_KEY"), @@ -145,11 +146,13 @@ async function textToSpeech(runtime: IAgentRuntime, text: string) { }); if ( + // @ts-expect-error todo runtime .getSetting("ELEVENLABS_OUTPUT_FORMAT") .startsWith("pcm_") ) { const sampleRate = parseInt( + // @ts-expect-error todo runtime.getSetting("ELEVENLABS_OUTPUT_FORMAT").substring(4) ); const withHeader = prependWavHeader( diff --git a/packages/plugin-node/src/services/transcription.ts b/packages/plugin-node/src/services/transcription.ts index d8e39ee2dae..fa90cdeba36 100644 --- a/packages/plugin-node/src/services/transcription.ts +++ b/packages/plugin-node/src/services/transcription.ts @@ -334,6 +334,7 @@ export class TranscriptionService audioBuffer: ArrayBuffer ): Promise { const buffer = Buffer.from(audioBuffer); + // @ts-expect-error todo const response = await this.deepgram.listen.prerecorded.transcribeFile( buffer, { @@ -343,6 +344,7 @@ export class TranscriptionService } ); const result = + // @ts-expect-error todo response.result.results.channels[0].alternatives[0].transcript; return result; } diff --git a/packages/plugin-solana/src/evaluators/trust.ts b/packages/plugin-solana/src/evaluators/trust.ts index cc295638f4e..4f6035846ce 100644 --- a/packages/plugin-solana/src/evaluators/trust.ts +++ b/packages/plugin-solana/src/evaluators/trust.ts @@ -161,6 +161,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) { runtime.getSetting("RPC_URL") || "https://api.mainnet-beta.solana.com" ), + // @ts-expect-error todo publicKey ); const tokenProvider = new TokenProvider( @@ -211,6 +212,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) { const user = participants.find(async (actor) => { const user = await runtime.databaseAdapter.getAccountById(actor); return ( + // @ts-expect-error todo user.name.toLowerCase().trim() === rec.recommender.toLowerCase().trim() ); @@ -222,6 +224,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) { } const account = await runtime.databaseAdapter.getAccountById(user); + // @ts-expect-error todo const userId = account.id; const recMemory = { @@ -232,6 +235,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) { createdAt: Date.now(), }; + // @ts-expect-error todo await recommendationsManager.createMemory(recMemory, true); console.log("recommendationsManager", rec); diff --git a/packages/plugin-solana/src/providers/token.ts b/packages/plugin-solana/src/providers/token.ts index b5fcc918a39..c5ae99f0203 100644 --- a/packages/plugin-solana/src/providers/token.ts +++ b/packages/plugin-solana/src/providers/token.ts @@ -54,6 +54,7 @@ export class TokenProvider { const cached = await this.cacheManager.get( path.join(this.cacheKey, key) ); + // @ts-expect-error todo return cached; } @@ -130,8 +131,10 @@ export class TokenProvider { console.error( "All attempts failed. Throwing the last error:", + // @ts-expect-error todo lastError ); + // @ts-expect-error todo throw lastError; } @@ -200,6 +203,7 @@ export class TokenProvider { const response = await fetch(this.GRAPHQL_ENDPOINT, { method: "POST", + // @ts-expect-error todo headers: { "Content-Type": "application/json", Authorization: settings.CODEX_API_KEY, @@ -1105,6 +1109,7 @@ const tokenProvider: Provider = { try { const { publicKey } = await getWalletKey(runtime, false); + // @ts-expect-error todo const walletProvider = new WalletProvider(connection, publicKey); const provider = new TokenProvider( diff --git a/packages/plugin-solana/src/providers/trustScoreProvider.ts b/packages/plugin-solana/src/providers/trustScoreProvider.ts index 3034d641393..7e1e17871bb 100644 --- a/packages/plugin-solana/src/providers/trustScoreProvider.ts +++ b/packages/plugin-solana/src/providers/trustScoreProvider.ts @@ -67,6 +67,7 @@ export class TrustScoreManager { ) { this.tokenProvider = tokenProvider; this.trustScoreDb = trustScoreDb; + // @ts-expect-error todo this.connection = new Connection(runtime.getSetting("RPC_URL")); this.baseMint = new PublicKey( runtime.getSetting("BASE_MINT") || @@ -124,6 +125,7 @@ export class TrustScoreManager { const suspiciousVolume = await this.suspiciousVolume(tokenAddress); const balance = await this.getRecommenederBalance(recommenderWallet); const virtualConfidence = balance / 1000000; // TODO: create formula to calculate virtual confidence based on user balance + // @ts-expect-error todo const lastActive = recommenderMetrics.lastActiveDate; const now = new Date(); const inactiveDays = Math.floor( @@ -133,6 +135,7 @@ export class TrustScoreManager { this.DECAY_RATE, Math.min(inactiveDays, this.MAX_DECAY_DAYS) ); + // @ts-expect-error todo const decayedScore = recommenderMetrics.trustScore * decayFactor; const validationTrustScore = this.trustScoreDb.calculateValidationTrust(tokenAddress); @@ -145,11 +148,13 @@ export class TrustScoreManager { priceChange24h: processedData.tradeData.price_change_24h_percent, volumeChange24h: processedData.tradeData.volume_24h, + // @ts-expect-error todo trade_24h_change: processedData.tradeData.trade_24h_change_percent, liquidity: processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0, liquidityChange24h: 0, + // @ts-expect-error todo holderChange24h: processedData.tradeData.unique_wallet_24h_change_percent, rugPull: false, @@ -167,11 +172,17 @@ export class TrustScoreManager { }, recommenderMetrics: { recommenderId: recommenderId, + // @ts-expect-error todo trustScore: recommenderMetrics.trustScore, + // @ts-expect-error todo totalRecommendations: recommenderMetrics.totalRecommendations, + // @ts-expect-error todo successfulRecs: recommenderMetrics.successfulRecs, + // @ts-expect-error todo avgTokenPerformance: recommenderMetrics.avgTokenPerformance, + // @ts-expect-error todo riskScore: recommenderMetrics.riskScore, + // @ts-expect-error todo consistencyScore: recommenderMetrics.consistencyScore, virtualConfidence: virtualConfidence, lastActiveDate: now, @@ -190,31 +201,40 @@ export class TrustScoreManager { await this.trustScoreDb.getRecommenderMetrics(recommenderId); const totalRecommendations = + // @ts-expect-error todo recommenderMetrics.totalRecommendations + 1; const successfulRecs = tokenPerformance.rugPull + // @ts-expect-error todo ? recommenderMetrics.successfulRecs + // @ts-expect-error todo : recommenderMetrics.successfulRecs + 1; const avgTokenPerformance = + // @ts-expect-error todo (recommenderMetrics.avgTokenPerformance * + // @ts-expect-error todo recommenderMetrics.totalRecommendations + tokenPerformance.priceChange24h) / totalRecommendations; const overallTrustScore = this.calculateTrustScore( tokenPerformance, + // @ts-expect-error todo recommenderMetrics ); const riskScore = this.calculateOverallRiskScore( tokenPerformance, + // @ts-expect-error todo recommenderMetrics ); const consistencyScore = this.calculateConsistencyScore( tokenPerformance, + // @ts-expect-error todo recommenderMetrics ); const balance = await this.getRecommenederBalance(recommenderWallet); const virtualConfidence = balance / 1000000; // TODO: create formula to calculate virtual confidence based on user balance + // @ts-expect-error todo const lastActive = recommenderMetrics.lastActiveDate; const now = new Date(); const inactiveDays = Math.floor( @@ -224,6 +244,7 @@ export class TrustScoreManager { this.DECAY_RATE, Math.min(inactiveDays, this.MAX_DECAY_DAYS) ); + // @ts-expect-error todo const decayedScore = recommenderMetrics.trustScore * decayFactor; const newRecommenderMetrics: RecommenderMetrics = { @@ -311,6 +332,7 @@ export class TrustScoreManager { await this.tokenProvider.getProcessedTokenData(); console.log(`Fetched processed token data for token: ${tokenAddress}`); + // @ts-expect-error todo return processedData.tradeData.volume_24h_change_percent > 50; } @@ -319,6 +341,7 @@ export class TrustScoreManager { await this.tokenProvider.getProcessedTokenData(); console.log(`Fetched processed token data for token: ${tokenAddress}`); + // @ts-expect-error todo return processedData.tradeData.trade_24h_change_percent < -50; } @@ -373,6 +396,7 @@ export class TrustScoreManager { const creationData = { token_address: tokenAddress, + // @ts-expect-error todo recommender_id: recommender.id, buy_price: processedData.tradeData.price, sell_price: 0, @@ -418,10 +442,12 @@ export class TrustScoreManager { symbol: processedData.tokenCodex.symbol, priceChange24h: processedData.tradeData.price_change_24h_percent, volumeChange24h: processedData.tradeData.volume_24h, + // @ts-expect-error todo trade_24h_change: processedData.tradeData.trade_24h_change_percent, liquidity: processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0, liquidityChange24h: 0, + // @ts-expect-error todo holderChange24h: processedData.tradeData.unique_wallet_24h_change_percent, rugPull: false, @@ -542,19 +568,25 @@ export class TrustScoreManager { sellDetails.sell_amount * processedData.tradeData.price; const trade = await this.trustScoreDb.getLatestTradePerformance( tokenAddress, + // @ts-expect-error todo recommender.id, isSimulation ); + // @ts-expect-error todo const buyTimeStamp = trade.buy_timeStamp; const marketCap = processedData.dexScreenerData.pairs[0]?.marketCap || 0; const liquidity = processedData.dexScreenerData.pairs[0]?.liquidity.usd || 0; const sell_price = processedData.tradeData.price; + // @ts-expect-error todo const profit_usd = sell_value_usd - trade.buy_value_usd; + // @ts-expect-error todo const profit_percent = (profit_usd / trade.buy_value_usd) * 100; + // @ts-expect-error todo const market_cap_change = marketCap - trade.buy_market_cap; + // @ts-expect-error todo const liquidity_change = liquidity - trade.buy_liquidity; const isRapidDump = await this.isRapidDump(tokenAddress); @@ -576,6 +608,7 @@ export class TrustScoreManager { }; this.trustScoreDb.updateTradePerformanceOnSell( tokenAddress, + // @ts-expect-error todo recommender.id, buyTimeStamp, sellDetailsData, @@ -646,13 +679,16 @@ export class TrustScoreManager { ); const trustScore = this.calculateTrustScore( + // @ts-expect-error todo tokenPerformance, recommenderMetrics ); const consistencyScore = this.calculateConsistencyScore( + // @ts-expect-error todo tokenPerformance, recommenderMetrics ); + // @ts-expect-error todo const riskScore = this.calculateRiskScore(tokenPerformance); // Accumulate scores for averaging @@ -660,6 +696,7 @@ export class TrustScoreManager { totalRiskScore += riskScore; totalConsistencyScore += consistencyScore; + // @ts-expect-error todo recommenderData.push({ recommenderId: recommendation.recommenderId, trustScore, @@ -736,6 +773,7 @@ export const trustScoreProvider: Provider = { const user = await runtime.databaseAdapter.getAccountById(userId); // Format the trust score string + // @ts-expect-error todo const trustScoreString = `${user.name}'s trust score: ${trustScore.toFixed(2)}`; return trustScoreString; diff --git a/packages/plugin-solana/src/providers/wallet.ts b/packages/plugin-solana/src/providers/wallet.ts index 7e3c55580ba..4c525e19665 100644 --- a/packages/plugin-solana/src/providers/wallet.ts +++ b/packages/plugin-solana/src/providers/wallet.ts @@ -103,8 +103,10 @@ export class WalletProvider { console.error( "All attempts failed. Throwing the last error:", + // @ts-expect-error todo lastError ); + // @ts-expect-error todo throw lastError; } @@ -377,6 +379,7 @@ const walletProvider: Provider = { runtime.getSetting("RPC_URL") || PROVIDER_CONFIG.DEFAULT_RPC ); + // @ts-expect-error todo const provider = new WalletProvider(connection, publicKey); return await provider.getFormattedPortfolio(runtime); diff --git a/packages/plugin-story/src/actions/attachTerms.ts b/packages/plugin-story/src/actions/attachTerms.ts index 3486c6489ad..3b190fab876 100644 --- a/packages/plugin-story/src/actions/attachTerms.ts +++ b/packages/plugin-story/src/actions/attachTerms.ts @@ -66,6 +66,7 @@ export class AttachTermsAction { const attachTermsResponse = await storyClient.license.attachLicenseTerms({ ipId: params.ipId, + // @ts-expect-error todo licenseTermsId: registerPilTermsResponse.licenseTermsId, txOptions: { waitForTransaction: true }, }); diff --git a/packages/plugin-story/src/actions/licenseIP.ts b/packages/plugin-story/src/actions/licenseIP.ts index 1d834136cec..fe072fdf076 100644 --- a/packages/plugin-story/src/actions/licenseIP.ts +++ b/packages/plugin-story/src/actions/licenseIP.ts @@ -80,6 +80,7 @@ export const licenseIPAction = { try { const response = await action.licenseIP(content); callback?.({ + // @ts-expect-error todo text: `Successfully minted license tokens: ${response.licenseTokenIds.join(", ")}. Transaction Hash: ${response.txHash}. View it on the block explorer: https://odyssey.storyscan.xyz/tx/${response.txHash}`, }); return true; diff --git a/packages/plugin-story/src/providers/wallet.ts b/packages/plugin-story/src/providers/wallet.ts index 097cfe16684..bd3fe87b89f 100644 --- a/packages/plugin-story/src/providers/wallet.ts +++ b/packages/plugin-story/src/providers/wallet.ts @@ -65,6 +65,7 @@ export class WalletProvider { chain: storyOdyssey, transport: http(DEFAULT_CHAIN_CONFIGS.odyssey.rpcUrl), } as const; + // @ts-expect-error todo this.publicClient = createPublicClient( baseConfig ) as PublicClient; diff --git a/packages/plugin-sui/src/providers/wallet.ts b/packages/plugin-sui/src/providers/wallet.ts index 01e9c45fc14..186e78b535c 100644 --- a/packages/plugin-sui/src/providers/wallet.ts +++ b/packages/plugin-sui/src/providers/wallet.ts @@ -47,6 +47,7 @@ export class WalletProvider { const cached = await this.cacheManager.get( path.join(this.cacheKey, key) ); + // @ts-expect-error todo return cached; } @@ -115,8 +116,10 @@ export class WalletProvider { console.error( "All attempts failed. Throwing the last error:", + // @ts-expect-error todo lastError ); + // @ts-expect-error todo throw lastError; } diff --git a/packages/plugin-tee/src/providers/deriveKeyProvider.ts b/packages/plugin-tee/src/providers/deriveKeyProvider.ts index 96430f23586..3634d08de29 100644 --- a/packages/plugin-tee/src/providers/deriveKeyProvider.ts +++ b/packages/plugin-tee/src/providers/deriveKeyProvider.ts @@ -169,6 +169,7 @@ class DeriveKeyProvider { const deriveKeyProvider: Provider = { get: async (runtime: IAgentRuntime, _message?: Memory, _state?: State) => { const teeMode = runtime.getSetting("TEE_MODE"); + // @ts-expect-error todo const provider = new DeriveKeyProvider(teeMode); const agentId = runtime.agentId; try { diff --git a/packages/plugin-tee/src/providers/remoteAttestationProvider.ts b/packages/plugin-tee/src/providers/remoteAttestationProvider.ts index 254d89376ea..778d9ff9f14 100644 --- a/packages/plugin-tee/src/providers/remoteAttestationProvider.ts +++ b/packages/plugin-tee/src/providers/remoteAttestationProvider.ts @@ -75,6 +75,7 @@ class RemoteAttestationProvider { const remoteAttestationProvider: Provider = { get: async (runtime: IAgentRuntime, _message: Memory, _state?: State) => { const teeMode = runtime.getSetting("TEE_MODE"); + // @ts-expect-error todo const provider = new RemoteAttestationProvider(teeMode); const agentId = runtime.agentId; diff --git a/packages/plugin-ton/src/providers/wallet.ts b/packages/plugin-ton/src/providers/wallet.ts index a06e986a752..ff5493961e1 100644 --- a/packages/plugin-ton/src/providers/wallet.ts +++ b/packages/plugin-ton/src/providers/wallet.ts @@ -61,6 +61,7 @@ export class WalletProvider { const cached = await this.cacheManager.get( path.join(this.cacheKey, key) ); + // @ts-expect-error todo return cached; } @@ -127,8 +128,10 @@ export class WalletProvider { console.error( "All attempts failed. Throwing the last error:", + // @ts-expect-error todo lastError ); + // @ts-expect-error todo throw lastError; } diff --git a/packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts b/packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts index c1ac5eecb88..6b6b6a2c4c5 100644 --- a/packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts +++ b/packages/plugin-trustdb/src/adapters/trustScoreDatabase.ts @@ -956,6 +956,7 @@ export class TrustScoreDatabase { initial_price: number | null; }>; + // @ts-expect-error todo return rows.map((row) => ({ id: row.id, recommenderId: row.recommender_id, diff --git a/packages/plugin-video-generation/src/index.ts b/packages/plugin-video-generation/src/index.ts index edadaa486f7..13beca00b19 100644 --- a/packages/plugin-video-generation/src/index.ts +++ b/packages/plugin-video-generation/src/index.ts @@ -161,6 +161,7 @@ const videoGeneration: Action = { if (result.success && result.data) { // Download the video file + // @ts-expect-error todo const response = await fetch(result.data); const arrayBuffer = await response.arrayBuffer(); const videoFileName = `content_cache/generated_video_${Date.now()}.mp4`; @@ -174,6 +175,7 @@ const videoGeneration: Action = { attachments: [ { id: crypto.randomUUID(), + // @ts-expect-error todo url: result.data, title: "Generated Video", source: "videoGeneration",