From 38716b84bbcbf659b02c4bddf89dd5cc7b348c95 Mon Sep 17 00:00:00 2001 From: ponderingdemocritus <ponderingdemocritus@protonmail.com> Date: Wed, 13 Nov 2024 22:07:30 +1100 Subject: [PATCH 1/5] init --- packages/adapter-supabase/package.json | 2 +- packages/plugin-starknet/package.json | 20 + packages/plugin-starknet/readme.md | 0 packages/plugin-starknet/src/actions/swap.ts | 126 ++++ packages/plugin-starknet/src/index.ts | 23 + .../src/providers/avnu.test.ts | 136 ++++ .../plugin-starknet/src/providers/avnu.ts | 122 ++++ packages/plugin-starknet/src/types/token.ts | 64 ++ packages/plugin-starknet/tsconfig.json | 8 + packages/plugin-starknet/tsup.config.ts | 20 + pnpm-lock.yaml | 679 +++++++++++++++++- 11 files changed, 1198 insertions(+), 2 deletions(-) create mode 100644 packages/plugin-starknet/package.json create mode 100644 packages/plugin-starknet/readme.md create mode 100644 packages/plugin-starknet/src/actions/swap.ts create mode 100644 packages/plugin-starknet/src/index.ts create mode 100644 packages/plugin-starknet/src/providers/avnu.test.ts create mode 100644 packages/plugin-starknet/src/providers/avnu.ts create mode 100644 packages/plugin-starknet/src/types/token.ts create mode 100644 packages/plugin-starknet/tsconfig.json create mode 100644 packages/plugin-starknet/tsup.config.ts diff --git a/packages/adapter-supabase/package.json b/packages/adapter-supabase/package.json index 6e38b636234..24d8f5bc83f 100644 --- a/packages/adapter-supabase/package.json +++ b/packages/adapter-supabase/package.json @@ -12,7 +12,7 @@ "tsup": "^8.3.5" }, "scripts": { - "build": "echo 'No build step required'", + "build": "tsup --format esm --dts", "dev": "tsup --watch" }, "peerDependencies": { diff --git a/packages/plugin-starknet/package.json b/packages/plugin-starknet/package.json new file mode 100644 index 00000000000..0fc53b02b6e --- /dev/null +++ b/packages/plugin-starknet/package.json @@ -0,0 +1,20 @@ +{ + "name": "@ai16z/plugin-starknet", + "version": "0.0.1", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@ai16z/eliza": "workspace:*", + "starknet": "^6.11.0", + "tsup": "^8.3.5", + "vitest": "^2.1.4" + }, + "scripts": { + "build": "tsup --format esm --dts", + "test": "vitest" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } +} diff --git a/packages/plugin-starknet/readme.md b/packages/plugin-starknet/readme.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/plugin-starknet/src/actions/swap.ts b/packages/plugin-starknet/src/actions/swap.ts new file mode 100644 index 00000000000..d294b201fa8 --- /dev/null +++ b/packages/plugin-starknet/src/actions/swap.ts @@ -0,0 +1,126 @@ +import { + fetchAvnuQuote, + buildAvnuCallData, + executeAvnuSwap, +} from "../providers/avnu.ts"; +import { AvnuQuoteParams } from "../types/token"; +import { + ActionExample, + HandlerCallback, + IAgentRuntime, + Memory, + ModelClass, + State, + type Action, +} from "@ai16z/eliza/src/types.ts"; +import { composeContext } from "@ai16z/eliza/src/context.ts"; +import { generateObject } from "@ai16z/eliza/src/generation.ts"; + +const swapTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. + +Example response: +\`\`\`json +{ + "sellTokenAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + "buyTokenAddress": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", + "sellAmount": "1000000000000000000" +} +\`\`\` + +{{recentMessages}} + +Extract the following information about the requested token swap: +- Sell token address +- Buy token address +- Amount to sell (in wei) + +Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined.`; + +export const executeSwap: Action = { + name: "EXECUTE_SWAP", + similes: ["SWAP_TOKENS", "TOKEN_SWAP", "TRADE_TOKENS", "EXCHANGE_TOKENS"], + validate: async (runtime: IAgentRuntime, message: Memory) => { + console.log("Message:", message); + return true; + }, + description: "Perform a token swap using Avnu.", + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State, + _options: { [key: string]: unknown }, + callback?: HandlerCallback + ): Promise<boolean> => { + if (!state) { + state = (await runtime.composeState(message)) as State; + } else { + state = await runtime.updateRecentMessageState(state); + } + + const swapContext = composeContext({ + state, + template: swapTemplate, + }); + + const response = await generateObject({ + runtime, + context: swapContext, + modelClass: ModelClass.LARGE, + }); + + console.log("Response:", response); + + try { + // Get quote + const quoteParams: AvnuQuoteParams = { + sellTokenAddress: response.sellTokenAddress, + buyTokenAddress: response.buyTokenAddress, + sellAmount: response.sellAmount, + }; + + const quote = await fetchAvnuQuote(quoteParams); + + // Build call data + const callData = await buildAvnuCallData({ + quoteId: quote.quoteId, + slippage: 0.05, // 5% slippage + }); + + // Execute swap + const swapResult = await executeAvnuSwap({ + quoteId: quote.quoteId, + calldata: callData.calldata, + }); + + console.log("Swap completed successfully!"); + callback?.({ + text: + "Swap completed successfully! tx: " + + swapResult.transactionHash, + }); + + return true; + } catch (error) { + console.error("Error during token swap:", error); + callback?.({ text: `Error during swap: ${error.message}` }); + return false; + } + }, + examples: [ + [ + { + user: "{{user1}}", + content: { + text: "Swap 1 ETH for USDC", + }, + }, + { + user: "{{user2}}", + content: { + text: "Executing swap...", + action: "TOKEN_SWAP", + }, + }, + ], + ] as ActionExample[][], +} as Action; diff --git a/packages/plugin-starknet/src/index.ts b/packages/plugin-starknet/src/index.ts new file mode 100644 index 00000000000..5d4aa051371 --- /dev/null +++ b/packages/plugin-starknet/src/index.ts @@ -0,0 +1,23 @@ +import { Plugin } from "@ai16z/eliza"; +// import { executeSwap } from "./actions/swap.ts"; +// import take_order from "./actions/takeOrder"; +// import pumpfun from "./actions/pumpfun"; +// import { executeSwapForDAO } from "./actions/swapDao"; +// import { walletProvider } from "./providers/wallet.ts"; +// import { trustScoreProvider } from "./providers/trustScoreProvider.ts"; +// import { trustEvaluator } from "./evaluators/trust.ts"; + +export const starknetPlugin: Plugin = { + name: "Starknet", + description: "Starknet Plugin for Eliza", + actions: [ + // executeSwap, + // pumpfun, + // executeSwapForDAO, + // take_order, + ], + evaluators: [], + providers: [], +}; + +export default starknetPlugin; diff --git a/packages/plugin-starknet/src/providers/avnu.test.ts b/packages/plugin-starknet/src/providers/avnu.test.ts new file mode 100644 index 00000000000..3bdd3743e82 --- /dev/null +++ b/packages/plugin-starknet/src/providers/avnu.test.ts @@ -0,0 +1,136 @@ +import { describe, it, expect, vi, beforeEach } from "vitest"; +import { fetchAvnuQuote } from "./avnu"; + +describe("fetchAvnuQuote", () => { + const mockRuntime = { + getSetting: vi.fn().mockReturnValue("test-api-key"), + }; + + const mockQuoteResponse = { + quoteId: "test-quote-id", + sellTokenAddress: "0x123", + sellAmount: "1000000000000000000", + sellAmountInUsd: 100, + buyTokenAddress: "0x456", + buyAmount: "2000000000000000000", + buyAmountInUsd: 200, + buyAmountWithoutFees: "1950000000000000000", + buyAmountWithoutFeesInUsd: 195, + estimatedAmount: true, + chainId: "1", + blockNumber: "123456", + expiry: 1234567890, + routes: [], + gasFees: "1000000", + gasFeesInUsd: 1, + avnuFees: "500000", + avnuFeesInUsd: 0.5, + avnuFeesBps: "10", + integratorFees: "0", + integratorFeesInUsd: 0, + integratorFeesBps: "0", + priceRatioUsd: 2, + liquiditySource: "test-source", + sellTokenPriceInUsd: 100, + buyTokenPriceInUsd: 200, + gasless: { + active: false, + gasTokenPrices: [], + }, + }; + + beforeEach(() => { + // Clear all mocks before each test + vi.clearAllMocks(); + // Reset fetch mock + global.fetch = vi.fn(); + }); + + it("should successfully fetch a quote", async () => { + // Mock the fetch response + global.fetch = vi.fn().mockResolvedValueOnce({ + ok: true, + json: () => Promise.resolve(mockQuoteResponse), + }); + + const params = { + sellTokenAddress: "0x123", + buyTokenAddress: "0x456", + sellAmount: "1000000000000000000", + }; + + const result = await fetchAvnuQuote(params); + + // Verify the fetch was called with correct parameters + expect(fetch).toHaveBeenCalledWith( + expect.stringContaining( + "https://starknet.api.avnu.fi/swap/v2/quotes" + ), + expect.objectContaining({ + method: "GET", + headers: { + Accept: "application/json", + Authorization: "Bearer test-api-key", + }, + }) + ); + + // Verify the URL contains the correct query parameters + const fetchCall = (fetch as unknown as { mock: { calls: string[][] } }) + .mock.calls[0][0]; + expect(fetchCall).toContain( + `sellTokenAddress=${params.sellTokenAddress}` + ); + expect(fetchCall).toContain( + `buyTokenAddress=${params.buyTokenAddress}` + ); + expect(fetchCall).toContain(`sellAmount=${params.sellAmount}`); + + // Verify the response + expect(result).toEqual(mockQuoteResponse); + }); + + it("should handle API errors", async () => { + // Mock a failed response + global.fetch = vi.fn().mockResolvedValueOnce({ + ok: false, + text: () => Promise.resolve("API Error"), + }); + + const params = { + sellTokenAddress: "0x123", + buyTokenAddress: "0x456", + }; + + await expect(fetchAvnuQuote(params)).rejects.toThrow( + "Failed to fetch Avnu quote: API Error" + ); + }); + + it("should include optional parameters when provided", async () => { + global.fetch = vi.fn().mockResolvedValueOnce({ + ok: true, + json: () => Promise.resolve(mockQuoteResponse), + }); + + const params = { + sellTokenAddress: "0x123", + buyTokenAddress: "0x456", + takerAddress: "0x789", + excludeSources: ["source1", "source2"], + size: 5, + integratorName: "test-integrator", + }; + + await fetchAvnuQuote(params); + + const fetchCall = (fetch as unknown as { mock: { calls: string[][] } }) + .mock.calls[0][0]; + expect(fetchCall).toContain(`takerAddress=${params.takerAddress}`); + expect(fetchCall).toContain( + `excludeSources=${encodeURIComponent(params.excludeSources.join(","))}` + ); + expect(fetchCall).toContain(`size=${params.size}`); + expect(fetchCall).toContain(`integratorName=${params.integratorName}`); + }); +}); diff --git a/packages/plugin-starknet/src/providers/avnu.ts b/packages/plugin-starknet/src/providers/avnu.ts new file mode 100644 index 00000000000..4f0b780d2a1 --- /dev/null +++ b/packages/plugin-starknet/src/providers/avnu.ts @@ -0,0 +1,122 @@ +import { AvnuQuoteParams, AvnuQuoteResponse } from "../types/token"; +import { + IAgentRuntime, + Memory, + Provider, + State, +} from "@ai16z/eliza/src/types.ts"; + +export const avnuQuoteProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory, _state?: State) => { + const userId = message.userId; + + return; + }, +}; + +type BuildAvnuCallDataParams = { + quoteId: string; + slippage: number; +}; + +type BuildAvnuCallDataResponse = { + chainId: string; + contractAddress: string; + entrypoint: string; + calldata: string[]; +}; + +export async function buildAvnuCallData({ + quoteId, + slippage, +}: BuildAvnuCallDataParams): Promise<BuildAvnuCallDataResponse> { + const callData = { + gasTokenAddress: + "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", + quoteId, + slippage, + }; + + const response = await fetch("https://starknet.api.avnu.fi/swap/v2/build", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(callData), + }); + + const data = await response.json(); + return data; +} + +type ExecuteAvnuSwapResponse = { + transactionHash: string; + gasTokenAddress: string; + gasTokenAmount: string; +}; + +export async function executeAvnuSwap({ + quoteId, + calldata, +}: { + quoteId: string; + calldata: string[]; +}): Promise<ExecuteAvnuSwapResponse> { + const response = await fetch( + "https://starknet.api.avnu.fi/swap/v2/execute", + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ quoteId, signature: calldata }), + } + ); + const data = await response.json(); + return data; +} + +export async function fetchAvnuQuote( + params: AvnuQuoteParams +): Promise<AvnuQuoteResponse> { + const baseUrl = "https://starknet.api.avnu.fi/swap/v2/quotes"; + const queryParams = new URLSearchParams({ + sellTokenAddress: params.sellTokenAddress, + buyTokenAddress: params.buyTokenAddress, + ...(params.sellAmount && { sellAmount: params.sellAmount }), + ...(params.buyAmount && { buyAmount: params.buyAmount }), + ...(params.takerAddress && { takerAddress: params.takerAddress }), + ...(params.excludeSources && { + excludeSources: params.excludeSources.join(","), + }), + ...(params.size && { size: params.size.toString() }), + ...(params.integratorFees && { integratorFees: params.integratorFees }), + ...(params.integratorFeeRecipient && { + integratorFeeRecipient: params.integratorFeeRecipient, + }), + ...(params.integratorName && { integratorName: params.integratorName }), + ...(params.pulsarMoneyFeeRecipient && { + PULSAR_MONEY_FEE_RECIPIENT: + params.pulsarMoneyFeeRecipient.toString(), + }), + }); + + const url = `${baseUrl}?${queryParams.toString()}`; + + try { + const response = await fetch(url, { + method: "GET", + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`Failed to fetch Avnu quote: ${errorText}`); + } + + const data = await response.json(); + return data as AvnuQuoteResponse; + } catch (error) { + console.error("Error fetching Avnu quote:", error); + throw error; + } +} diff --git a/packages/plugin-starknet/src/types/token.ts b/packages/plugin-starknet/src/types/token.ts new file mode 100644 index 00000000000..c105f26e552 --- /dev/null +++ b/packages/plugin-starknet/src/types/token.ts @@ -0,0 +1,64 @@ +interface AvnuQuoteParams { + sellTokenAddress: string; + buyTokenAddress: string; + sellAmount?: string; + buyAmount?: string; + takerAddress?: string; + excludeSources?: string[]; + size?: number; + integratorFees?: string; + integratorFeeRecipient?: string; + integratorName?: string; + pulsarMoneyFeeRecipient?: number; +} + +interface AvnuRoute { + name: string; + address: string; + percent: number; + sellTokenAddress: string; + buyTokenAddress: string; +} + +interface GasTokenPrice { + tokenAddress: string; + gasFeesInGasToken: string; + gasFeesInUsd: number; +} + +interface GaslessInfo { + active: boolean; + gasTokenPrices: GasTokenPrice[]; +} + +interface AvnuQuoteResponse { + quoteId: string; + sellTokenAddress: string; + sellAmount: string; + sellAmountInUsd: number; + buyTokenAddress: string; + buyAmount: string; + buyAmountInUsd: number; + buyAmountWithoutFees: string; + buyAmountWithoutFeesInUsd: number; + estimatedAmount: boolean; + chainId: string; + blockNumber: string; + expiry: number; + routes: AvnuRoute[]; + gasFees: string; + gasFeesInUsd: number; + avnuFees: string; + avnuFeesInUsd: number; + avnuFeesBps: string; + integratorFees: string; + integratorFeesInUsd: number; + integratorFeesBps: string; + priceRatioUsd: number; + liquiditySource: string; + sellTokenPriceInUsd: number; + buyTokenPriceInUsd: number; + gasless: GaslessInfo; +} + +export type { AvnuQuoteParams, AvnuQuoteResponse }; diff --git a/packages/plugin-starknet/tsconfig.json b/packages/plugin-starknet/tsconfig.json new file mode 100644 index 00000000000..eaa78145aa3 --- /dev/null +++ b/packages/plugin-starknet/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "./src" + }, + "include": ["src"] +} diff --git a/packages/plugin-starknet/tsup.config.ts b/packages/plugin-starknet/tsup.config.ts new file mode 100644 index 00000000000..e42bf4efeae --- /dev/null +++ b/packages/plugin-starknet/tsup.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/index.ts"], + outDir: "dist", + sourcemap: true, + clean: true, + format: ["esm"], // Ensure you're targeting CommonJS + external: [ + "dotenv", // Externalize dotenv to prevent bundling + "fs", // Externalize fs to use Node.js built-in module + "path", // Externalize other built-ins if necessary + "@reflink/reflink", + "@node-llama-cpp", + "https", + "http", + "agentkeepalive", + // Add other modules you want to externalize + ], +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e55a04510a4..dea56f6fb14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -749,6 +749,21 @@ importers: specifier: 7.1.0 version: 7.1.0 + packages/plugin-starknet: + dependencies: + '@ai16z/eliza': + specifier: workspace:* + version: link:../core + starknet: + specifier: ^6.11.0 + version: 6.11.0(encoding@0.1.13) + tsup: + specifier: ^8.3.5 + version: 8.3.5(jiti@1.21.6)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.0) + vitest: + specifier: ^2.1.4 + version: 2.1.4(@types/node@22.8.4)(terser@5.36.0) + packages: '@ai-sdk/anthropic@0.0.53': @@ -2014,108 +2029,216 @@ packages: '@emnapi/wasi-threads@1.0.1': resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + '@esbuild/aix-ppc64@0.24.0': resolution: {integrity: sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.24.0': resolution: {integrity: sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==} engines: {node: '>=18'} cpu: [arm64] os: [android] + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.24.0': resolution: {integrity: sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==} engines: {node: '>=18'} cpu: [arm] os: [android] + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.24.0': resolution: {integrity: sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==} engines: {node: '>=18'} cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.24.0': resolution: {integrity: sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.24.0': resolution: {integrity: sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==} engines: {node: '>=18'} cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.24.0': resolution: {integrity: sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.24.0': resolution: {integrity: sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.24.0': resolution: {integrity: sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==} engines: {node: '>=18'} cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.24.0': resolution: {integrity: sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==} engines: {node: '>=18'} cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.24.0': resolution: {integrity: sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==} engines: {node: '>=18'} cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.24.0': resolution: {integrity: sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==} engines: {node: '>=18'} cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.24.0': resolution: {integrity: sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.24.0': resolution: {integrity: sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.24.0': resolution: {integrity: sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.24.0': resolution: {integrity: sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==} engines: {node: '>=18'} cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.24.0': resolution: {integrity: sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==} engines: {node: '>=18'} cpu: [x64] os: [linux] + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.24.0': resolution: {integrity: sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==} engines: {node: '>=18'} @@ -2128,30 +2251,60 @@ packages: cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.24.0': resolution: {integrity: sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.24.0': resolution: {integrity: sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.24.0': resolution: {integrity: sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.24.0': resolution: {integrity: sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==} engines: {node: '>=18'} cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.24.0': resolution: {integrity: sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==} engines: {node: '>=18'} @@ -2493,10 +2646,24 @@ packages: '@napi-rs/wasm-runtime@0.2.4': resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} + '@noble/curves@1.3.0': + resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} + + '@noble/curves@1.4.2': + resolution: {integrity: sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==} + '@noble/curves@1.6.0': resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} engines: {node: ^14.21.3 || >=16} + '@noble/hashes@1.3.3': + resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} + engines: {node: '>= 16'} + + '@noble/hashes@1.4.0': + resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} + engines: {node: '>= 16'} + '@noble/hashes@1.5.0': resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} engines: {node: ^14.21.3 || >=16} @@ -3201,6 +3368,12 @@ packages: resolution: {integrity: sha512-xzvBr1Q1c4lCe7i6sRnrofxeO1QTP/LKQ6A6qy0iB4x5yfiSfARMEQEghojzTNALDTcv8En04qYNIco9/K9eZQ==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} + '@scure/base@1.1.9': + resolution: {integrity: sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==} + + '@scure/starknet@1.0.0': + resolution: {integrity: sha512-o5J57zY0f+2IL/mq8+AYJJ4Xpc1fOtDhr+mFQKbHnYFmm3WQrC+8zj2HEgxak1a+x86mhmBC1Kq305KUpVf0wg==} + '@selderee/plugin-htmlparser2@0.11.0': resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} @@ -3389,6 +3562,9 @@ packages: '@solana/web3.js@1.95.4': resolution: {integrity: sha512-sdewnNEA42ZSMxqkzdwEWi6fDgzwtJHaQa5ndUGEJYtoOnM6X5cvPmjoTUp7/k7bRrVAxfBgDnvQQHD6yhlLYw==} + '@starknet-io/types-js@0.7.7': + resolution: {integrity: sha512-WLrpK7LIaIb8Ymxu6KF/6JkGW1sso988DweWu7p5QY/3y7waBIiPvzh27D9bX5KIJNRDyOoOVoHVEKYUYWZ/RQ==} + '@supabase/auth-js@2.65.1': resolution: {integrity: sha512-IA7i2Xq2SWNCNMKxwmPlHafBQda0qtnFr8QnyyBr+KaSxoXXqEzFCnQ1dGTy6bsZjVBgXu++o3qrDypTspaAPw==} @@ -3963,6 +4139,35 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vitest/expect@2.1.4': + resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==} + + '@vitest/mocker@2.1.4': + resolution: {integrity: sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@2.1.4': + resolution: {integrity: sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==} + + '@vitest/runner@2.1.4': + resolution: {integrity: sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==} + + '@vitest/snapshot@2.1.4': + resolution: {integrity: sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==} + + '@vitest/spy@2.1.4': + resolution: {integrity: sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==} + + '@vitest/utils@2.1.4': + resolution: {integrity: sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==} + '@vladfrangu/async_event_emitter@2.4.6': resolution: {integrity: sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} @@ -4073,6 +4278,10 @@ packages: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + abi-wan-kanabi@2.2.3: + resolution: {integrity: sha512-JlqiAl9CPvTm5kKG0QXmVCWNWoC/XyRMOeT77cQlbxXWllgjf6SqUmaNqFon72C2o5OSZids+5FvLdsw6dvWaw==} + hasBin: true + abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -4237,6 +4446,9 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} + ansicolors@0.3.2: + resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} + anthropic-vertex-ai@1.0.0: resolution: {integrity: sha512-ME1e8kCNLVvVWrR6vB3zFlREEp1kRLmNZUC+oih+tziPkb/li5ESRvzb1eDV+zyhw7tZDDLy7numRllJwdkCEw==} engines: {node: '>=18'} @@ -4318,6 +4530,10 @@ packages: resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} engines: {node: '>=0.8'} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + ast-types@0.13.4: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} engines: {node: '>=4'} @@ -4683,12 +4899,20 @@ packages: capsolver-npm@2.0.2: resolution: {integrity: sha512-PvkAGTuwtKXczJeoiLu2XQ4SzJh0m7Yr3ONJuvdjEAw95LwtfGxZ3Ip/w21kR94R4O260omLGlTcQvPf2ECnLg==} + cardinal@2.1.1: + resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} + hasBin: true + caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + chai@5.1.2: + resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} + engines: {node: '>=12'} + chalk@3.0.0: resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} engines: {node: '>=8'} @@ -4727,6 +4951,10 @@ packages: charm@0.1.2: resolution: {integrity: sha512-syedaZ9cPe7r3hoQA9twWYKu5AIyCswN5+szkmPBe9ccdLrj4bYaCnLVPTLd2kgVRc7+zoX4tyPgRnFKCj5YjQ==} + check-error@2.1.1: + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + engines: {node: '>= 16'} + cheerio-select@2.1.0: resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==} @@ -5540,6 +5768,10 @@ packages: babel-plugin-macros: optional: true + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + deep-extend@0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} @@ -5884,6 +6116,11 @@ packages: esast-util-from-js@2.0.1: resolution: {integrity: sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==} + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + esbuild@0.24.0: resolution: {integrity: sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==} engines: {node: '>=18'} @@ -6102,6 +6339,10 @@ packages: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} + expect-type@1.1.0: + resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} + engines: {node: '>=12.0.0'} + expect@29.7.0: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -6208,6 +6449,9 @@ packages: resolution: {integrity: sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==} engines: {node: '>=0.4.0'} + fetch-cookie@3.0.1: + resolution: {integrity: sha512-ZGXe8Y5Z/1FWqQ9q/CrJhkUD73DyBU9VF0hBQmEO/wPHe4A9PKTjplFDLeFX8aOsYypZUcX5Ji/eByn3VCVO3Q==} + ffmpeg-static@5.2.0: resolution: {integrity: sha512-WrM7kLW+do9HLr+H6tk7LzQ7kPqbAgLjdzNE32+u3Ff11gXt9Kkkd2nusGFrlWMIe+XaA97t+I8JS7sZIrvRgA==} engines: {node: '>=16'} @@ -6384,6 +6628,10 @@ packages: fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + fs-extra@10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} + engines: {node: '>=12'} + fs-extra@11.2.0: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} engines: {node: '>=14.14'} @@ -6476,6 +6724,9 @@ packages: resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==} engines: {node: '>=8'} + get-starknet-core@4.0.0: + resolution: {integrity: sha512-6pLmidQZkC3wZsrHY99grQHoGpuuXqkbSP65F8ov1/JsEI8DDLkhsAuLCKFzNOK56cJp+f1bWWfTJ57e9r5eqQ==} + get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -7258,6 +7509,9 @@ packages: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} + isomorphic-fetch@3.0.0: + resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} + isomorphic-ws@4.0.1: resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} peerDependencies: @@ -7786,6 +8040,12 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true + lossless-json@4.0.2: + resolution: {integrity: sha512-+z0EaLi2UcWi8MZRxA5iTb6m4Ys4E80uftGY+yG5KNFJb5EceQXOhdW/pWJZ8m97s26u7yZZAYMcKWNztSZssA==} + + loupe@3.1.2: + resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} + lowdb@7.0.1: resolution: {integrity: sha512-neJAj8GwF0e8EpycYIDFqEPcx9Qz4GUho20jWFR7YiFeXzF1YMLdxB36PypcTSPMA+4+LvgyMacYhlr18Zlymw==} engines: {node: '>=18'} @@ -8969,6 +9229,10 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + pathval@2.0.0: + resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} + engines: {node: '>= 14.16'} + pdfjs-dist@4.7.76: resolution: {integrity: sha512-8y6wUgC/Em35IumlGjaJOCm3wV4aY/6sqnIT3fVW/67mXsOZ9HWBn8GDKmJUK0GSzpbmX3gQqwfoFayp78Mtqw==} engines: {node: '>=18'} @@ -9839,6 +10103,9 @@ packages: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} + redeyed@2.1.1: + resolution: {integrity: sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==} + regenerate-unicode-properties@10.2.0: resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} engines: {node: '>=4'} @@ -10223,6 +10490,9 @@ packages: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -10431,6 +10701,12 @@ packages: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + starknet@6.11.0: + resolution: {integrity: sha512-u50KrGDi9fbu1Ogu7ynwF/tSeFlp3mzOg1/Y5x50tYFICImo3OfY4lOz9OtYDk404HK4eUujKkhov9tG7GAKlg==} + statuses@1.5.0: resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} engines: {node: '>= 0.6'} @@ -10740,6 +11016,9 @@ packages: tiny-warning@1.0.3: resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + tinyexec@0.3.1: resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} @@ -10752,10 +11031,22 @@ packages: engines: {node: '>= 12.10.0', npm: '>= 6.12.0', yarn: '>= 1.20.0'} hasBin: true + tinypool@1.0.1: + resolution: {integrity: sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@1.2.0: + resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} + engines: {node: '>=14.0.0'} + tinyspawn@1.3.3: resolution: {integrity: sha512-CvvMFgecnQMyg59nOnAD5O4lV83cVj2ooDniJ3j2bYvMajqlK4wQ13k6OUHfA+J5nkInTxbSGJv2olUJIiAtJg==} engines: {node: '>= 18'} + tinyspy@3.0.2: + resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} + engines: {node: '>=14.0.0'} + tldts-core@6.1.61: resolution: {integrity: sha512-In7VffkDWUPgwa+c9picLUxvb0RltVwTkSgMNFgvlGSWveCzGBemBqTsgJCL4EDFWZ6WH0fKTsot6yNhzy3ZzQ==} @@ -11249,6 +11540,67 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + vite-node@2.1.4: + resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + + vite@5.4.11: + resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + + vitest@2.1.4: + resolution: {integrity: sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 2.1.4 + '@vitest/ui': 2.1.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vizion@2.2.1: resolution: {integrity: sha512-sfAcO2yeSU0CSPFI/DmZp3FsFE9T+8913nv1xWBOyzODv13fwkn6Vl7HqxGpkr9F608M+8SuFId3s+BlZqfXww==} engines: {node: '>=4.0'} @@ -11384,6 +11736,9 @@ packages: resolution: {integrity: sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==} engines: {node: '>=0.8.0'} + whatwg-fetch@3.6.20: + resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} + whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -11408,6 +11763,11 @@ packages: engines: {node: ^16.13.0 || >=18.0.0} hasBin: true + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + wide-align@1.1.5: resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} @@ -13854,75 +14214,144 @@ snapshots: dependencies: tslib: 2.8.0 + '@esbuild/aix-ppc64@0.21.5': + optional: true + '@esbuild/aix-ppc64@0.24.0': optional: true + '@esbuild/android-arm64@0.21.5': + optional: true + '@esbuild/android-arm64@0.24.0': optional: true + '@esbuild/android-arm@0.21.5': + optional: true + '@esbuild/android-arm@0.24.0': optional: true + '@esbuild/android-x64@0.21.5': + optional: true + '@esbuild/android-x64@0.24.0': optional: true + '@esbuild/darwin-arm64@0.21.5': + optional: true + '@esbuild/darwin-arm64@0.24.0': optional: true + '@esbuild/darwin-x64@0.21.5': + optional: true + '@esbuild/darwin-x64@0.24.0': optional: true + '@esbuild/freebsd-arm64@0.21.5': + optional: true + '@esbuild/freebsd-arm64@0.24.0': optional: true + '@esbuild/freebsd-x64@0.21.5': + optional: true + '@esbuild/freebsd-x64@0.24.0': optional: true + '@esbuild/linux-arm64@0.21.5': + optional: true + '@esbuild/linux-arm64@0.24.0': optional: true + '@esbuild/linux-arm@0.21.5': + optional: true + '@esbuild/linux-arm@0.24.0': optional: true + '@esbuild/linux-ia32@0.21.5': + optional: true + '@esbuild/linux-ia32@0.24.0': optional: true + '@esbuild/linux-loong64@0.21.5': + optional: true + '@esbuild/linux-loong64@0.24.0': optional: true + '@esbuild/linux-mips64el@0.21.5': + optional: true + '@esbuild/linux-mips64el@0.24.0': optional: true + '@esbuild/linux-ppc64@0.21.5': + optional: true + '@esbuild/linux-ppc64@0.24.0': optional: true + '@esbuild/linux-riscv64@0.21.5': + optional: true + '@esbuild/linux-riscv64@0.24.0': optional: true + '@esbuild/linux-s390x@0.21.5': + optional: true + '@esbuild/linux-s390x@0.24.0': optional: true + '@esbuild/linux-x64@0.21.5': + optional: true + '@esbuild/linux-x64@0.24.0': optional: true + '@esbuild/netbsd-x64@0.21.5': + optional: true + '@esbuild/netbsd-x64@0.24.0': optional: true '@esbuild/openbsd-arm64@0.24.0': optional: true + '@esbuild/openbsd-x64@0.21.5': + optional: true + '@esbuild/openbsd-x64@0.24.0': optional: true + '@esbuild/sunos-x64@0.21.5': + optional: true + '@esbuild/sunos-x64@0.24.0': optional: true + '@esbuild/win32-arm64@0.21.5': + optional: true + '@esbuild/win32-arm64@0.24.0': optional: true + '@esbuild/win32-ia32@0.21.5': + optional: true + '@esbuild/win32-ia32@0.24.0': optional: true + '@esbuild/win32-x64@0.21.5': + optional: true + '@esbuild/win32-x64@0.24.0': optional: true @@ -14464,10 +14893,22 @@ snapshots: '@emnapi/runtime': 1.3.1 '@tybys/wasm-util': 0.9.0 + '@noble/curves@1.3.0': + dependencies: + '@noble/hashes': 1.3.3 + + '@noble/curves@1.4.2': + dependencies: + '@noble/hashes': 1.4.0 + '@noble/curves@1.6.0': dependencies: '@noble/hashes': 1.5.0 + '@noble/hashes@1.3.3': {} + + '@noble/hashes@1.4.0': {} + '@noble/hashes@1.5.0': {} '@node-llama-cpp/linux-arm64@3.1.1': @@ -15226,6 +15667,13 @@ snapshots: '@sapphire/snowflake@3.5.5': {} + '@scure/base@1.1.9': {} + + '@scure/starknet@1.0.0': + dependencies: + '@noble/curves': 1.3.0 + '@noble/hashes': 1.3.3 + '@selderee/plugin-htmlparser2@0.11.0': dependencies: domhandler: 5.0.3 @@ -15517,6 +15965,8 @@ snapshots: - encoding - utf-8-validate + '@starknet-io/types-js@0.7.7': {} + '@supabase/auth-js@2.65.1': dependencies: '@supabase/node-fetch': 2.6.15 @@ -16212,6 +16662,46 @@ snapshots: '@ungap/structured-clone@1.2.0': {} + '@vitest/expect@2.1.4': + dependencies: + '@vitest/spy': 2.1.4 + '@vitest/utils': 2.1.4 + chai: 5.1.2 + tinyrainbow: 1.2.0 + + '@vitest/mocker@2.1.4(vite@5.4.11(@types/node@22.8.4)(terser@5.36.0))': + dependencies: + '@vitest/spy': 2.1.4 + estree-walker: 3.0.3 + magic-string: 0.30.12 + optionalDependencies: + vite: 5.4.11(@types/node@22.8.4)(terser@5.36.0) + + '@vitest/pretty-format@2.1.4': + dependencies: + tinyrainbow: 1.2.0 + + '@vitest/runner@2.1.4': + dependencies: + '@vitest/utils': 2.1.4 + pathe: 1.1.2 + + '@vitest/snapshot@2.1.4': + dependencies: + '@vitest/pretty-format': 2.1.4 + magic-string: 0.30.12 + pathe: 1.1.2 + + '@vitest/spy@2.1.4': + dependencies: + tinyspy: 3.0.2 + + '@vitest/utils@2.1.4': + dependencies: + '@vitest/pretty-format': 2.1.4 + loupe: 3.1.2 + tinyrainbow: 1.2.0 + '@vladfrangu/async_event_emitter@2.4.6': {} '@vue/compiler-core@3.5.12': @@ -16370,6 +16860,13 @@ snapshots: abbrev@2.0.0: {} + abi-wan-kanabi@2.2.3: + dependencies: + ansicolors: 0.3.2 + cardinal: 2.1.1 + fs-extra: 10.1.0 + yargs: 17.7.2 + abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 @@ -16557,6 +17054,8 @@ snapshots: ansi-styles@6.2.1: {} + ansicolors@0.3.2: {} + anthropic-vertex-ai@1.0.0(encoding@0.1.13)(zod@3.23.8): dependencies: '@ai-sdk/provider': 0.0.22 @@ -16622,6 +17121,8 @@ snapshots: assert-plus@1.0.0: {} + assertion-error@2.0.1: {} + ast-types@0.13.4: dependencies: tslib: 2.8.0 @@ -17086,10 +17587,23 @@ snapshots: transitivePeerDependencies: - debug + cardinal@2.1.1: + dependencies: + ansicolors: 0.3.2 + redeyed: 2.1.1 + caseless@0.12.0: {} ccount@2.0.1: {} + chai@5.1.2: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.1 + deep-eql: 5.0.2 + loupe: 3.1.2 + pathval: 2.0.0 + chalk@3.0.0: dependencies: ansi-styles: 4.3.0 @@ -17121,6 +17635,8 @@ snapshots: charm@0.1.2: {} + check-error@2.1.1: {} + cheerio-select@2.1.0: dependencies: boolbase: 1.0.0 @@ -18007,6 +18523,8 @@ snapshots: dedent@1.5.3: {} + deep-eql@5.0.2: {} + deep-extend@0.6.0: {} deep-is@0.1.4: {} @@ -18357,6 +18875,32 @@ snapshots: esast-util-from-estree: 2.0.0 vfile-message: 4.0.2 + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + esbuild@0.24.0: optionalDependencies: '@esbuild/aix-ppc64': 0.24.0 @@ -18625,6 +19169,8 @@ snapshots: expand-template@2.0.3: {} + expect-type@1.1.0: {} + expect@29.7.0: dependencies: '@jest/expect-utils': 29.7.0 @@ -18689,7 +19235,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.4 + debug: 4.3.7(supports-color@5.5.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -18770,6 +19316,11 @@ snapshots: dependencies: xml-js: 1.6.11 + fetch-cookie@3.0.1: + dependencies: + set-cookie-parser: 2.7.1 + tough-cookie: 4.1.4 + ffmpeg-static@5.2.0: dependencies: '@derhuerst/http-basic': 8.2.4 @@ -18948,6 +19499,12 @@ snapshots: fs-constants@1.0.0: {} + fs-extra@10.1.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + fs-extra@11.2.0: dependencies: graceful-fs: 4.2.11 @@ -19066,6 +19623,10 @@ snapshots: get-port@5.1.1: {} + get-starknet-core@4.0.0: + dependencies: + '@starknet-io/types-js': 0.7.7 + get-stream@5.2.0: dependencies: pump: 3.0.2 @@ -19965,6 +20526,13 @@ snapshots: isobject@3.0.1: {} + isomorphic-fetch@3.0.0(encoding@0.1.13): + dependencies: + node-fetch: 2.7.0(encoding@0.1.13) + whatwg-fetch: 3.6.20 + transitivePeerDependencies: + - encoding + isomorphic-ws@4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -20803,6 +21371,10 @@ snapshots: dependencies: js-tokens: 4.0.0 + lossless-json@4.0.2: {} + + loupe@3.1.2: {} + lowdb@7.0.1: dependencies: steno: 4.0.2 @@ -22437,6 +23009,8 @@ snapshots: pathe@1.1.2: {} + pathval@2.0.0: {} + pdfjs-dist@4.7.76(encoding@0.1.13): optionalDependencies: canvas: 2.11.2(encoding@0.1.13) @@ -23421,6 +23995,10 @@ snapshots: indent-string: 4.0.0 strip-indent: 3.0.0 + redeyed@2.1.1: + dependencies: + esprima: 4.0.1 + regenerate-unicode-properties@10.2.0: dependencies: regenerate: 1.4.2 @@ -23966,6 +24544,8 @@ snapshots: get-intrinsic: 1.2.4 object-inspect: 1.13.3 + siginfo@2.0.0: {} + signal-exit@3.0.7: {} signal-exit@4.1.0: {} @@ -24206,6 +24786,26 @@ snapshots: dependencies: escape-string-regexp: 2.0.0 + stackback@0.0.2: {} + + starknet@6.11.0(encoding@0.1.13): + dependencies: + '@noble/curves': 1.4.2 + '@noble/hashes': 1.5.0 + '@scure/base': 1.1.9 + '@scure/starknet': 1.0.0 + abi-wan-kanabi: 2.2.3 + fetch-cookie: 3.0.1 + get-starknet-core: 4.0.0 + isomorphic-fetch: 3.0.0(encoding@0.1.13) + lossless-json: 4.0.2 + pako: 2.1.0 + starknet-types-07: '@starknet-io/types-js@0.7.7' + ts-mixer: 6.0.4 + url-join: 4.0.1 + transitivePeerDependencies: + - encoding + statuses@1.5.0: {} statuses@2.0.1: {} @@ -24544,6 +25144,8 @@ snapshots: tiny-warning@1.0.3: {} + tinybench@2.9.0: {} + tinyexec@0.3.1: {} tinyglobby@0.2.10: @@ -24553,8 +25155,14 @@ snapshots: tinyld@1.3.4: {} + tinypool@1.0.1: {} + + tinyrainbow@1.2.0: {} + tinyspawn@1.3.3: {} + tinyspy@3.0.2: {} + tldts-core@6.1.61: {} tldts-experimental@6.1.61: @@ -25038,6 +25646,68 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 + vite-node@2.1.4(@types/node@22.8.4)(terser@5.36.0): + dependencies: + cac: 6.7.14 + debug: 4.3.7(supports-color@5.5.0) + pathe: 1.1.2 + vite: 5.4.11(@types/node@22.8.4)(terser@5.36.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + vite@5.4.11(@types/node@22.8.4)(terser@5.36.0): + dependencies: + esbuild: 0.21.5 + postcss: 8.4.49 + rollup: 4.26.0 + optionalDependencies: + '@types/node': 22.8.4 + fsevents: 2.3.3 + terser: 5.36.0 + + vitest@2.1.4(@types/node@22.8.4)(terser@5.36.0): + dependencies: + '@vitest/expect': 2.1.4 + '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.8.4)(terser@5.36.0)) + '@vitest/pretty-format': 2.1.4 + '@vitest/runner': 2.1.4 + '@vitest/snapshot': 2.1.4 + '@vitest/spy': 2.1.4 + '@vitest/utils': 2.1.4 + chai: 5.1.2 + debug: 4.3.7(supports-color@5.5.0) + expect-type: 1.1.0 + magic-string: 0.30.12 + pathe: 1.1.2 + std-env: 3.8.0 + tinybench: 2.9.0 + tinyexec: 0.3.1 + tinypool: 1.0.1 + tinyrainbow: 1.2.0 + vite: 5.4.11(@types/node@22.8.4)(terser@5.36.0) + vite-node: 2.1.4(@types/node@22.8.4)(terser@5.36.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.8.4 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vizion@2.2.1: dependencies: async: 2.6.4 @@ -25246,6 +25916,8 @@ snapshots: websocket-extensions@0.1.4: {} + whatwg-fetch@3.6.20: {} + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 @@ -25271,6 +25943,11 @@ snapshots: dependencies: isexe: 3.1.1 + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + wide-align@1.1.5: dependencies: string-width: 4.2.3 From cecff7804bfabd0c94c642a0fc1cd2fa62ea7ccf Mon Sep 17 00:00:00 2001 From: ponderingdemocritus <ponderingdemocritus@protonmail.com> Date: Thu, 14 Nov 2024 21:26:07 +1100 Subject: [PATCH 2/5] updates --- .env.example | 4 + packages/plugin-starknet/package.json | 1 + packages/plugin-starknet/src/actions/swap.ts | 64 +++--- .../src/providers/avnu.test.ts | 136 ------------ .../plugin-starknet/src/providers/avnu.ts | 126 +----------- .../plugin-starknet/src/providers/wallet.ts | 16 ++ packages/plugin-starknet/src/types/token.ts | 108 +++++----- pnpm-lock.yaml | 194 +++++++++++++----- 8 files changed, 273 insertions(+), 376 deletions(-) delete mode 100644 packages/plugin-starknet/src/providers/avnu.test.ts create mode 100644 packages/plugin-starknet/src/providers/wallet.ts diff --git a/.env.example b/.env.example index ecd965fc4c0..b9fb25979b4 100644 --- a/.env.example +++ b/.env.example @@ -69,3 +69,7 @@ TELEGRAM_BOT_TOKEN= TOGETHER_API_KEY= SERVER_PORT=3000 + +# Starknet +STARKNET_ADDRESS= +STARKNET_PRIVATE_KEY= diff --git a/packages/plugin-starknet/package.json b/packages/plugin-starknet/package.json index 0fc53b02b6e..363b96457c9 100644 --- a/packages/plugin-starknet/package.json +++ b/packages/plugin-starknet/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "dependencies": { "@ai16z/eliza": "workspace:*", + "@avnu/avnu-sdk": "^2.1.1", "starknet": "^6.11.0", "tsup": "^8.3.5", "vitest": "^2.1.4" diff --git a/packages/plugin-starknet/src/actions/swap.ts b/packages/plugin-starknet/src/actions/swap.ts index d294b201fa8..39ef55cf58f 100644 --- a/packages/plugin-starknet/src/actions/swap.ts +++ b/packages/plugin-starknet/src/actions/swap.ts @@ -1,9 +1,3 @@ -import { - fetchAvnuQuote, - buildAvnuCallData, - executeAvnuSwap, -} from "../providers/avnu.ts"; -import { AvnuQuoteParams } from "../types/token"; import { ActionExample, HandlerCallback, @@ -12,9 +6,15 @@ import { ModelClass, State, type Action, -} from "@ai16z/eliza/src/types.ts"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { generateObject } from "@ai16z/eliza/src/generation.ts"; +} from "@ai16z/eliza"; +import { composeContext } from "@ai16z/eliza"; +import { generateObject } from "@ai16z/eliza"; +import { + executeSwap as executeAvnuSwap, + fetchQuotes, + QuoteRequest, +} from "@avnu/avnu-sdk"; +import { getStarknetAccount } from "../providers/wallet.ts"; const swapTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. @@ -37,10 +37,26 @@ Extract the following information about the requested token swap: Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined.`; export const executeSwap: Action = { - name: "EXECUTE_SWAP", - similes: ["SWAP_TOKENS", "TOKEN_SWAP", "TRADE_TOKENS", "EXCHANGE_TOKENS"], + name: "EXECUTE_STARKNET_SWAP", + similes: [ + "STARKNET_SWAP_TOKENS", + "STARKNET_TOKEN_SWAP", + "STARKNET_TRADE_TOKENS", + "STARKNET_EXCHANGE_TOKENS", + ], validate: async (runtime: IAgentRuntime, message: Memory) => { - console.log("Message:", message); + const requiredSettings = [ + "STARKNET_ADDRESS", + "STARKNET_PRIVATE_KEY", + "STARKNET_RPC_URL", + ]; + + for (const setting of requiredSettings) { + if (!runtime.getSetting(setting)) { + return false; + } + } + return true; }, description: "Perform a token swap using Avnu.", @@ -72,25 +88,23 @@ export const executeSwap: Action = { try { // Get quote - const quoteParams: AvnuQuoteParams = { + const quoteParams: QuoteRequest = { sellTokenAddress: response.sellTokenAddress, buyTokenAddress: response.buyTokenAddress, - sellAmount: response.sellAmount, + sellAmount: BigInt(response.sellAmount), }; - const quote = await fetchAvnuQuote(quoteParams); - - // Build call data - const callData = await buildAvnuCallData({ - quoteId: quote.quoteId, - slippage: 0.05, // 5% slippage - }); + const quote = await fetchQuotes(quoteParams); // Execute swap - const swapResult = await executeAvnuSwap({ - quoteId: quote.quoteId, - calldata: callData.calldata, - }); + const swapResult = await executeAvnuSwap( + getStarknetAccount(runtime), + quote[0], + { + slippage: 0.05, // 5% slippage + executeApprove: true, + } + ); console.log("Swap completed successfully!"); callback?.({ diff --git a/packages/plugin-starknet/src/providers/avnu.test.ts b/packages/plugin-starknet/src/providers/avnu.test.ts deleted file mode 100644 index 3bdd3743e82..00000000000 --- a/packages/plugin-starknet/src/providers/avnu.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { describe, it, expect, vi, beforeEach } from "vitest"; -import { fetchAvnuQuote } from "./avnu"; - -describe("fetchAvnuQuote", () => { - const mockRuntime = { - getSetting: vi.fn().mockReturnValue("test-api-key"), - }; - - const mockQuoteResponse = { - quoteId: "test-quote-id", - sellTokenAddress: "0x123", - sellAmount: "1000000000000000000", - sellAmountInUsd: 100, - buyTokenAddress: "0x456", - buyAmount: "2000000000000000000", - buyAmountInUsd: 200, - buyAmountWithoutFees: "1950000000000000000", - buyAmountWithoutFeesInUsd: 195, - estimatedAmount: true, - chainId: "1", - blockNumber: "123456", - expiry: 1234567890, - routes: [], - gasFees: "1000000", - gasFeesInUsd: 1, - avnuFees: "500000", - avnuFeesInUsd: 0.5, - avnuFeesBps: "10", - integratorFees: "0", - integratorFeesInUsd: 0, - integratorFeesBps: "0", - priceRatioUsd: 2, - liquiditySource: "test-source", - sellTokenPriceInUsd: 100, - buyTokenPriceInUsd: 200, - gasless: { - active: false, - gasTokenPrices: [], - }, - }; - - beforeEach(() => { - // Clear all mocks before each test - vi.clearAllMocks(); - // Reset fetch mock - global.fetch = vi.fn(); - }); - - it("should successfully fetch a quote", async () => { - // Mock the fetch response - global.fetch = vi.fn().mockResolvedValueOnce({ - ok: true, - json: () => Promise.resolve(mockQuoteResponse), - }); - - const params = { - sellTokenAddress: "0x123", - buyTokenAddress: "0x456", - sellAmount: "1000000000000000000", - }; - - const result = await fetchAvnuQuote(params); - - // Verify the fetch was called with correct parameters - expect(fetch).toHaveBeenCalledWith( - expect.stringContaining( - "https://starknet.api.avnu.fi/swap/v2/quotes" - ), - expect.objectContaining({ - method: "GET", - headers: { - Accept: "application/json", - Authorization: "Bearer test-api-key", - }, - }) - ); - - // Verify the URL contains the correct query parameters - const fetchCall = (fetch as unknown as { mock: { calls: string[][] } }) - .mock.calls[0][0]; - expect(fetchCall).toContain( - `sellTokenAddress=${params.sellTokenAddress}` - ); - expect(fetchCall).toContain( - `buyTokenAddress=${params.buyTokenAddress}` - ); - expect(fetchCall).toContain(`sellAmount=${params.sellAmount}`); - - // Verify the response - expect(result).toEqual(mockQuoteResponse); - }); - - it("should handle API errors", async () => { - // Mock a failed response - global.fetch = vi.fn().mockResolvedValueOnce({ - ok: false, - text: () => Promise.resolve("API Error"), - }); - - const params = { - sellTokenAddress: "0x123", - buyTokenAddress: "0x456", - }; - - await expect(fetchAvnuQuote(params)).rejects.toThrow( - "Failed to fetch Avnu quote: API Error" - ); - }); - - it("should include optional parameters when provided", async () => { - global.fetch = vi.fn().mockResolvedValueOnce({ - ok: true, - json: () => Promise.resolve(mockQuoteResponse), - }); - - const params = { - sellTokenAddress: "0x123", - buyTokenAddress: "0x456", - takerAddress: "0x789", - excludeSources: ["source1", "source2"], - size: 5, - integratorName: "test-integrator", - }; - - await fetchAvnuQuote(params); - - const fetchCall = (fetch as unknown as { mock: { calls: string[][] } }) - .mock.calls[0][0]; - expect(fetchCall).toContain(`takerAddress=${params.takerAddress}`); - expect(fetchCall).toContain( - `excludeSources=${encodeURIComponent(params.excludeSources.join(","))}` - ); - expect(fetchCall).toContain(`size=${params.size}`); - expect(fetchCall).toContain(`integratorName=${params.integratorName}`); - }); -}); diff --git a/packages/plugin-starknet/src/providers/avnu.ts b/packages/plugin-starknet/src/providers/avnu.ts index 4f0b780d2a1..38ff054d524 100644 --- a/packages/plugin-starknet/src/providers/avnu.ts +++ b/packages/plugin-starknet/src/providers/avnu.ts @@ -1,122 +1,14 @@ -import { AvnuQuoteParams, AvnuQuoteResponse } from "../types/token"; -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; +import { getStarknetAccount, getStarknetProvider } from "./wallet"; -export const avnuQuoteProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory, _state?: State) => { - const userId = message.userId; - - return; +export const getStarknetAccountProvider: Provider = { + get: async (runtime: IAgentRuntime, _message: Memory, _state?: State) => { + return getStarknetAccount(runtime); }, }; -type BuildAvnuCallDataParams = { - quoteId: string; - slippage: number; -}; - -type BuildAvnuCallDataResponse = { - chainId: string; - contractAddress: string; - entrypoint: string; - calldata: string[]; -}; - -export async function buildAvnuCallData({ - quoteId, - slippage, -}: BuildAvnuCallDataParams): Promise<BuildAvnuCallDataResponse> { - const callData = { - gasTokenAddress: - "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", - quoteId, - slippage, - }; - - const response = await fetch("https://starknet.api.avnu.fi/swap/v2/build", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(callData), - }); - - const data = await response.json(); - return data; -} - -type ExecuteAvnuSwapResponse = { - transactionHash: string; - gasTokenAddress: string; - gasTokenAmount: string; +export const getStarknetRpcProvider: Provider = { + get: async (runtime: IAgentRuntime, _message: Memory, _state?: State) => { + return getStarknetProvider(runtime); + }, }; - -export async function executeAvnuSwap({ - quoteId, - calldata, -}: { - quoteId: string; - calldata: string[]; -}): Promise<ExecuteAvnuSwapResponse> { - const response = await fetch( - "https://starknet.api.avnu.fi/swap/v2/execute", - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ quoteId, signature: calldata }), - } - ); - const data = await response.json(); - return data; -} - -export async function fetchAvnuQuote( - params: AvnuQuoteParams -): Promise<AvnuQuoteResponse> { - const baseUrl = "https://starknet.api.avnu.fi/swap/v2/quotes"; - const queryParams = new URLSearchParams({ - sellTokenAddress: params.sellTokenAddress, - buyTokenAddress: params.buyTokenAddress, - ...(params.sellAmount && { sellAmount: params.sellAmount }), - ...(params.buyAmount && { buyAmount: params.buyAmount }), - ...(params.takerAddress && { takerAddress: params.takerAddress }), - ...(params.excludeSources && { - excludeSources: params.excludeSources.join(","), - }), - ...(params.size && { size: params.size.toString() }), - ...(params.integratorFees && { integratorFees: params.integratorFees }), - ...(params.integratorFeeRecipient && { - integratorFeeRecipient: params.integratorFeeRecipient, - }), - ...(params.integratorName && { integratorName: params.integratorName }), - ...(params.pulsarMoneyFeeRecipient && { - PULSAR_MONEY_FEE_RECIPIENT: - params.pulsarMoneyFeeRecipient.toString(), - }), - }); - - const url = `${baseUrl}?${queryParams.toString()}`; - - try { - const response = await fetch(url, { - method: "GET", - }); - - if (!response.ok) { - const errorText = await response.text(); - throw new Error(`Failed to fetch Avnu quote: ${errorText}`); - } - - const data = await response.json(); - return data as AvnuQuoteResponse; - } catch (error) { - console.error("Error fetching Avnu quote:", error); - throw error; - } -} diff --git a/packages/plugin-starknet/src/providers/wallet.ts b/packages/plugin-starknet/src/providers/wallet.ts new file mode 100644 index 00000000000..6393a02367b --- /dev/null +++ b/packages/plugin-starknet/src/providers/wallet.ts @@ -0,0 +1,16 @@ +import { IAgentRuntime, Memory, State } from "@ai16z/eliza"; +import { Account, RpcProvider } from "starknet"; + +export const getStarknetProvider = (runtime: IAgentRuntime) => { + return new RpcProvider({ + nodeUrl: runtime.getSetting("STARKNET_RPC_URL"), + }); +}; + +export const getStarknetAccount = (runtime: IAgentRuntime) => { + return new Account( + getStarknetProvider(runtime), + runtime.getSetting("STARKNET_ADDRESS"), + runtime.getSetting("STARKNET_PRIVATE_KEY") + ); +}; diff --git a/packages/plugin-starknet/src/types/token.ts b/packages/plugin-starknet/src/types/token.ts index c105f26e552..50e0453f83b 100644 --- a/packages/plugin-starknet/src/types/token.ts +++ b/packages/plugin-starknet/src/types/token.ts @@ -1,64 +1,80 @@ -interface AvnuQuoteParams { +interface QuoteRequest { sellTokenAddress: string; buyTokenAddress: string; - sellAmount?: string; - buyAmount?: string; + sellAmount?: bigint; + buyAmount?: bigint; + // The address which will fill the quote takerAddress?: string; - excludeSources?: string[]; + // The maximum number of returned quotes size?: number; - integratorFees?: string; - integratorFeeRecipient?: string; - integratorName?: string; - pulsarMoneyFeeRecipient?: number; + // The sources that the user wants to exclude + excludeSources?: string[]; // ['10KSwap'] + // Fee amount in bps, 30 is 0.3% + integratorFees?: bigint; + // Required when integratorFees is defined. You need to provide the address of your fee collector. + integratorFeeRecipient?: string; // 0x01238E9778D026588a51595E30B0F45609B4F771EecF0E335CdeFeD1d84a9D89 + // The name of your application + integratorName?: string; // AVNU Portal } -interface AvnuRoute { - name: string; - address: string; - percent: number; - sellTokenAddress: string; - buyTokenAddress: string; -} - -interface GasTokenPrice { - tokenAddress: string; - gasFeesInGasToken: string; - gasFeesInUsd: number; -} - -interface GaslessInfo { - active: boolean; - gasTokenPrices: GasTokenPrice[]; -} - -interface AvnuQuoteResponse { +interface Quote { + // The unique id of the quote quoteId: string; sellTokenAddress: string; - sellAmount: string; + sellAmount: bigint; sellAmountInUsd: number; buyTokenAddress: string; - buyAmount: string; + buyAmount: bigint; buyAmountInUsd: number; - buyAmountWithoutFees: string; - buyAmountWithoutFeesInUsd: number; - estimatedAmount: boolean; + blockNumber?: number; chainId: string; - blockNumber: string; - expiry: number; - routes: AvnuRoute[]; - gasFees: string; + // Unix timestamp when quotes expires in seconds + expiry?: number; + routes: Route[]; + // The estimated amount of gas fees in ETH + gasFees: bigint; + // The estimated amount of gas fees in usd gasFeesInUsd: number; - avnuFees: string; + // The actual fees taken by AVNU + avnuFees: bigint; + // The actual fees taken by AVNU is usd avnuFeesInUsd: number; - avnuFeesBps: string; - integratorFees: string; + // The fees in bps taken by AVNU + avnuFeesBps: bigint; + // The actual fees taken by the integrator + integratorFees: bigint; + // The actual fees taken by the integrator in usd integratorFeesInUsd: number; - integratorFeesBps: string; + // The fees in bps taken by the integrator + integratorFeesBps: bigint; + // Price ratio in usd and in bps priceRatioUsd: number; - liquiditySource: string; - sellTokenPriceInUsd: number; - buyTokenPriceInUsd: number; - gasless: GaslessInfo; + // The sell token price in usd + sellTokenPriceInUsd?: number; + // The buy token price in usd + buyTokenPriceInUsd?: number; + gasless: Gasless; +} + +interface Route { + // The name of the source + name: string; // 10kSwap + // The address of the source + address: string; + // The percentage distribution of sellToken. 1 is 100% + percent: number; + sellTokenAddress: string; + buyTokenAddress: string; + routes: Route[]; +} + +export interface Gasless { + active: boolean; + gasTokenPrices: { + tokenAddress: string; + gasFeesInUsd: number; + gasFeesInGasToken: bigint; + }[]; } -export type { AvnuQuoteParams, AvnuQuoteResponse }; +export type { Quote, QuoteRequest }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5bf8b83e41..5fb7f04b332 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -754,6 +754,9 @@ importers: '@ai16z/eliza': specifier: workspace:* version: link:../core + '@avnu/avnu-sdk': + specifier: ^2.1.1 + version: 2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.11.0(encoding@0.1.13)) starknet: specifier: ^6.11.0 version: 6.11.0(encoding@0.1.13) @@ -762,10 +765,16 @@ importers: version: 8.3.5(jiti@1.21.6)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.0) vitest: specifier: ^2.1.4 - version: 2.1.4(@types/node@22.8.4)(terser@5.36.0) + version: 2.1.5(@types/node@22.8.4)(terser@5.36.0) + whatwg-url: + specifier: 7.1.0 + version: 7.1.0 packages: + '@adraffy/ens-normalize@1.10.1': + resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + '@ai-sdk/anthropic@0.0.53': resolution: {integrity: sha512-33w5pmQINRRYwppgMhXY/y5ZIW6cbIhbuKbZQmy8SKZvtLBI2gM7H0QN/cH3nv0OmR4YsUw8L3DYUNlQs5hfEA==} engines: {node: '>=18'} @@ -1037,6 +1046,14 @@ packages: resolution: {integrity: sha512-IQD9wkVReKAhsEAbDjh/0KrBGTEXelqZLpOBRDaIRvlzZ9sjmUP+gKbpvzyJnei2JHQiE8JAgj7YcNloINbGBw==} engines: {node: '>= 10'} + '@avnu/avnu-sdk@2.1.1': + resolution: {integrity: sha512-y/r/pVT2pU33fGHNVE7A5UIAqQhjEXYQhUh7EodY1s5H7mhRd5U8zHOtI5z6vmpuSnUv0hSvOmmgz8HTuwZ7ew==} + engines: {node: '>=18'} + peerDependencies: + ethers: ^6.11.1 + qs: ^6.12.0 + starknet: ^6.6.0 + '@babel/code-frame@7.26.2': resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} @@ -2646,6 +2663,9 @@ packages: '@napi-rs/wasm-runtime@0.2.4': resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} + '@noble/curves@1.2.0': + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.3.0': resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} @@ -2656,6 +2676,10 @@ packages: resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} engines: {node: ^14.21.3 || >=16} + '@noble/hashes@1.3.2': + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + '@noble/hashes@1.3.3': resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} @@ -3973,6 +3997,9 @@ packages: '@types/node@18.19.64': resolution: {integrity: sha512-955mDqvO2vFf/oL7V3WiUtiz+BugyX8uVbaT2H8oj3+8dRyH2FLiNdowe7eNqRM7IOIZvzDH76EoAT+gwm6aIQ==} + '@types/node@22.7.5': + resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + '@types/node@22.8.4': resolution: {integrity: sha512-SpNNxkftTJOPk0oN+y2bIqurEXHTA2AOZ3EJDDKeJ5VzkvvORSvmQXGQarcOzWV1ac7DCaPBEdMDxBsM+d8jWw==} @@ -4139,11 +4166,11 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - '@vitest/expect@2.1.4': - resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==} + '@vitest/expect@2.1.5': + resolution: {integrity: sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==} - '@vitest/mocker@2.1.4': - resolution: {integrity: sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==} + '@vitest/mocker@2.1.5': + resolution: {integrity: sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==} peerDependencies: msw: ^2.4.9 vite: ^5.0.0 @@ -4153,20 +4180,20 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.4': - resolution: {integrity: sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==} + '@vitest/pretty-format@2.1.5': + resolution: {integrity: sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==} - '@vitest/runner@2.1.4': - resolution: {integrity: sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==} + '@vitest/runner@2.1.5': + resolution: {integrity: sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==} - '@vitest/snapshot@2.1.4': - resolution: {integrity: sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==} + '@vitest/snapshot@2.1.5': + resolution: {integrity: sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==} - '@vitest/spy@2.1.4': - resolution: {integrity: sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==} + '@vitest/spy@2.1.5': + resolution: {integrity: sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==} - '@vitest/utils@2.1.4': - resolution: {integrity: sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==} + '@vitest/utils@2.1.5': + resolution: {integrity: sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==} '@vladfrangu/async_event_emitter@2.4.6': resolution: {integrity: sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==} @@ -4316,6 +4343,9 @@ packages: resolution: {integrity: sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==} engines: {node: '>= 10.0.0'} + aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -5967,8 +5997,8 @@ packages: resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==} engines: {node: '>=10'} - dotenv-expand@11.0.6: - resolution: {integrity: sha512-8NHi73otpWsZGBSZwwknTXS5pqMOrk9+Ssrna8xCaxkzEpU9OTf9R5ArQGVw03//Zmk9MOwLPng9WwndvpAJ5g==} + dotenv-expand@11.0.7: + resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==} engines: {node: '>=12'} dotenv@16.4.5: @@ -5998,8 +6028,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.5.57: - resolution: {integrity: sha512-xS65H/tqgOwUBa5UmOuNSLuslDo7zho0y/lgQw35pnrqiZh7UOWHCeL/Bt6noJATbA6tpQJGCifsFsIRZj1Fqg==} + electron-to-chromium@1.5.58: + resolution: {integrity: sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA==} emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} @@ -6281,6 +6311,10 @@ packages: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} + ethers@6.13.4: + resolution: {integrity: sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==} + engines: {node: '>=14.0.0'} + eval@0.1.8: resolution: {integrity: sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw==} engines: {node: '>= 0.8'} @@ -11185,6 +11219,9 @@ packages: tslib@1.9.3: resolution: {integrity: sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==} + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tslib@2.8.0: resolution: {integrity: sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==} @@ -11540,8 +11577,8 @@ packages: vfile@6.0.3: resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} - vite-node@2.1.4: - resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==} + vite-node@2.1.5: + resolution: {integrity: sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -11576,15 +11613,15 @@ packages: terser: optional: true - vitest@2.1.4: - resolution: {integrity: sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==} + vitest@2.1.5: + resolution: {integrity: sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.1.4 - '@vitest/ui': 2.1.4 + '@vitest/browser': 2.1.5 + '@vitest/ui': 2.1.5 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -11850,6 +11887,18 @@ packages: utf-8-validate: optional: true + ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.18.0: resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} engines: {node: '>=10.0.0'} @@ -11967,6 +12016,8 @@ packages: snapshots: + '@adraffy/ens-normalize@1.10.1': {} + '@ai-sdk/anthropic@0.0.53(zod@3.23.8)': dependencies: '@ai-sdk/provider': 0.0.26 @@ -12307,6 +12358,12 @@ snapshots: '@anush008/tokenizers-linux-x64-gnu': 0.0.0 '@anush008/tokenizers-win32-x64-msvc': 0.0.0 + '@avnu/avnu-sdk@2.1.1(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(qs@6.13.0)(starknet@6.11.0(encoding@0.1.13))': + dependencies: + ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) + qs: 6.13.0 + starknet: 6.11.0(encoding@0.1.13) + '@babel/code-frame@7.26.2': dependencies: '@babel/helper-validator-identifier': 7.25.9 @@ -14893,6 +14950,10 @@ snapshots: '@emnapi/runtime': 1.3.1 '@tybys/wasm-util': 0.9.0 + '@noble/curves@1.2.0': + dependencies: + '@noble/hashes': 1.3.2 + '@noble/curves@1.3.0': dependencies: '@noble/hashes': 1.3.3 @@ -14905,6 +14966,8 @@ snapshots: dependencies: '@noble/hashes': 1.5.0 + '@noble/hashes@1.3.2': {} + '@noble/hashes@1.3.3': {} '@noble/hashes@1.4.0': {} @@ -16460,6 +16523,10 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@22.7.5': + dependencies: + undici-types: 6.19.8 + '@types/node@22.8.4': dependencies: undici-types: 6.19.8 @@ -16662,43 +16729,43 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitest/expect@2.1.4': + '@vitest/expect@2.1.5': dependencies: - '@vitest/spy': 2.1.4 - '@vitest/utils': 2.1.4 + '@vitest/spy': 2.1.5 + '@vitest/utils': 2.1.5 chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.4(vite@5.4.11(@types/node@22.8.4)(terser@5.36.0))': + '@vitest/mocker@2.1.5(vite@5.4.11(@types/node@22.8.4)(terser@5.36.0))': dependencies: - '@vitest/spy': 2.1.4 + '@vitest/spy': 2.1.5 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: vite: 5.4.11(@types/node@22.8.4)(terser@5.36.0) - '@vitest/pretty-format@2.1.4': + '@vitest/pretty-format@2.1.5': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.1.4': + '@vitest/runner@2.1.5': dependencies: - '@vitest/utils': 2.1.4 + '@vitest/utils': 2.1.5 pathe: 1.1.2 - '@vitest/snapshot@2.1.4': + '@vitest/snapshot@2.1.5': dependencies: - '@vitest/pretty-format': 2.1.4 + '@vitest/pretty-format': 2.1.5 magic-string: 0.30.12 pathe: 1.1.2 - '@vitest/spy@2.1.4': + '@vitest/spy@2.1.5': dependencies: tinyspy: 3.0.2 - '@vitest/utils@2.1.4': + '@vitest/utils@2.1.5': dependencies: - '@vitest/pretty-format': 2.1.4 + '@vitest/pretty-format': 2.1.5 loupe: 3.1.2 tinyrainbow: 1.2.0 @@ -16894,6 +16961,8 @@ snapshots: address@1.2.2: {} + aes-js@4.0.0-beta.5: {} + agent-base@6.0.2: dependencies: debug: 4.3.7(supports-color@5.5.0) @@ -17442,7 +17511,7 @@ snapshots: browserslist@4.24.2: dependencies: caniuse-lite: 1.0.30001680 - electron-to-chromium: 1.5.57 + electron-to-chromium: 1.5.58 node-releases: 2.0.18 update-browserslist-db: 1.1.1(browserslist@4.24.2) @@ -18737,7 +18806,7 @@ snapshots: dependencies: is-obj: 2.0.0 - dotenv-expand@11.0.6: + dotenv-expand@11.0.7: dependencies: dotenv: 16.4.5 @@ -18764,7 +18833,7 @@ snapshots: dependencies: jake: 10.9.2 - electron-to-chromium@1.5.57: {} + electron-to-chromium@1.5.58: {} emittery@0.13.1: {} @@ -19101,6 +19170,19 @@ snapshots: etag@1.8.1: {} + ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10): + dependencies: + '@adraffy/ens-normalize': 1.10.1 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 22.7.5 + aes-js: 4.0.0-beta.5 + tslib: 2.7.0 + ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + eval@0.1.8: dependencies: '@types/node': 22.8.4 @@ -22549,7 +22631,7 @@ snapshots: cli-spinners: 2.6.1 cliui: 8.0.1 dotenv: 16.4.5 - dotenv-expand: 11.0.6 + dotenv-expand: 11.0.7 enquirer: 2.3.6 figures: 3.2.0 flat: 5.0.2 @@ -25291,6 +25373,8 @@ snapshots: tslib@1.9.3: {} + tslib@2.7.0: {} + tslib@2.8.0: {} tsup@8.3.5(jiti@1.21.6)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.0): @@ -25646,10 +25730,11 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.4(@types/node@22.8.4)(terser@5.36.0): + vite-node@2.1.5(@types/node@22.8.4)(terser@5.36.0): dependencies: cac: 6.7.14 debug: 4.3.7(supports-color@5.5.0) + es-module-lexer: 1.5.4 pathe: 1.1.2 vite: 5.4.11(@types/node@22.8.4)(terser@5.36.0) transitivePeerDependencies: @@ -25673,15 +25758,15 @@ snapshots: fsevents: 2.3.3 terser: 5.36.0 - vitest@2.1.4(@types/node@22.8.4)(terser@5.36.0): + vitest@2.1.5(@types/node@22.8.4)(terser@5.36.0): dependencies: - '@vitest/expect': 2.1.4 - '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@22.8.4)(terser@5.36.0)) - '@vitest/pretty-format': 2.1.4 - '@vitest/runner': 2.1.4 - '@vitest/snapshot': 2.1.4 - '@vitest/spy': 2.1.4 - '@vitest/utils': 2.1.4 + '@vitest/expect': 2.1.5 + '@vitest/mocker': 2.1.5(vite@5.4.11(@types/node@22.8.4)(terser@5.36.0)) + '@vitest/pretty-format': 2.1.5 + '@vitest/runner': 2.1.5 + '@vitest/snapshot': 2.1.5 + '@vitest/spy': 2.1.5 + '@vitest/utils': 2.1.5 chai: 5.1.2 debug: 4.3.7(supports-color@5.5.0) expect-type: 1.1.0 @@ -25693,7 +25778,7 @@ snapshots: tinypool: 1.0.1 tinyrainbow: 1.2.0 vite: 5.4.11(@types/node@22.8.4)(terser@5.36.0) - vite-node: 2.1.4(@types/node@22.8.4)(terser@5.36.0) + vite-node: 2.1.5(@types/node@22.8.4)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.8.4 @@ -26036,6 +26121,11 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 + ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): + optionalDependencies: + bufferutil: 4.0.8 + utf-8-validate: 5.0.10 + ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 From d4394c26be3e94c7af7e4b8702e4f5cb873f00de Mon Sep 17 00:00:00 2001 From: ponderingdemocritus <ponderingdemocritus@protonmail.com> Date: Thu, 14 Nov 2024 21:30:30 +1100 Subject: [PATCH 3/5] plugin schema --- packages/plugin-starknet/src/index.ts | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/plugin-starknet/src/index.ts b/packages/plugin-starknet/src/index.ts index 5d4aa051371..7f78b771474 100644 --- a/packages/plugin-starknet/src/index.ts +++ b/packages/plugin-starknet/src/index.ts @@ -1,23 +1,16 @@ import { Plugin } from "@ai16z/eliza"; -// import { executeSwap } from "./actions/swap.ts"; -// import take_order from "./actions/takeOrder"; -// import pumpfun from "./actions/pumpfun"; -// import { executeSwapForDAO } from "./actions/swapDao"; -// import { walletProvider } from "./providers/wallet.ts"; -// import { trustScoreProvider } from "./providers/trustScoreProvider.ts"; -// import { trustEvaluator } from "./evaluators/trust.ts"; +import { executeSwap } from "./actions/swap"; +import { + getStarknetAccountProvider, + getStarknetRpcProvider, +} from "./providers/avnu"; export const starknetPlugin: Plugin = { name: "Starknet", - description: "Starknet Plugin for Eliza", - actions: [ - // executeSwap, - // pumpfun, - // executeSwapForDAO, - // take_order, - ], + description: "Starknet Swap Plugin for Eliza", + actions: [executeSwap], evaluators: [], - providers: [], + providers: [getStarknetAccountProvider, getStarknetRpcProvider], }; export default starknetPlugin; From b1325970f6f3d8782585b2483320a79632654ae4 Mon Sep 17 00:00:00 2001 From: ponderingdemocritus <ponderingdemocritus@protonmail.com> Date: Sat, 16 Nov 2024 10:11:53 +1100 Subject: [PATCH 4/5] fix imports, fix builds --- packages/adapter-postgres/src/index.ts | 4 +- packages/adapter-sqljs/src/index.ts | 4 +- packages/adapter-supabase/src/index.ts | 4 +- packages/agent/src/index.ts | 28 +- packages/client-auto/src/index.ts | 2 +- packages/client-auto/tsup.config.ts | 6 + packages/client-direct/src/index.ts | 20 +- packages/client-direct/tsup.config.ts | 1 + .../src/actions/chat_with_attachments.ts | 10 +- .../src/actions/download_media.ts | 9 +- .../client-discord/src/actions/joinvoice.ts | 4 +- .../client-discord/src/actions/leavevoice.ts | 2 +- .../src/actions/summarize_conversation.ts | 22 +- .../src/actions/transcribe_media.ts | 8 +- packages/client-discord/src/attachments.ts | 9 +- packages/client-discord/src/index.ts | 13 +- packages/client-discord/src/messages.ts | 23 +- .../src/providers/channelState.ts | 7 +- .../src/providers/voiceState.ts | 7 +- packages/client-discord/src/voice.ts | 8 +- packages/client-discord/tsup.config.ts | 1 + packages/client-telegram/src/index.ts | 6 +- .../client-telegram/src/messageManager.ts | 20 +- .../client-telegram/src/telegramClient.ts | 17 +- packages/client-twitter/src/base.ts | 4 +- packages/client-twitter/src/index.ts | 2 +- packages/client-twitter/src/interactions.ts | 2 +- packages/client-twitter/src/post.ts | 2 +- packages/client-twitter/src/search.ts | 2 +- packages/client-twitter/src/utils.ts | 12 +- packages/core/src/embedding.ts | 2 +- packages/core/src/generation.ts | 84 +- packages/core/src/index.ts | 3 +- packages/core/src/models.ts | 10 +- .../core/src/test_resources/basic.test.ts | 12 - packages/core/src/test_resources/cache.ts | 36 - packages/core/src/test_resources/constants.ts | 12 - .../core/src/test_resources/createRuntime.ts | 147 --- packages/core/src/test_resources/data.ts | 1087 ----------------- .../test_resources/getOrCreateRelationship.ts | 66 - .../src/test_resources/populateMemories.ts | 34 - packages/core/src/test_resources/report.ts | 97 -- packages/core/src/test_resources/runAiTest.ts | 17 - packages/core/src/test_resources/templates.ts | 27 - .../core/src/test_resources/testAction.ts | 59 - .../core/src/test_resources/testEvaluator.ts | 67 - packages/core/src/test_resources/testSetup.ts | 10 - packages/core/src/test_resources/types.ts | 6 - packages/core/src/tests/actions.test.d.ts | 1 - packages/core/src/tests/actions.test.ts | 268 ---- packages/core/src/tests/browser.test.ts | 98 -- packages/core/src/tests/continue.test.d.ts | 1 - packages/core/src/tests/continue.test.ts | 233 ---- packages/core/src/tests/evaluation.test.d.ts | 1 - packages/core/src/tests/evaluation.test.ts | 128 -- packages/core/src/tests/fact.test.d.ts | 1 - packages/core/src/tests/fact.test.ts | 150 --- packages/core/src/tests/generation.test.ts | 166 --- packages/core/src/tests/goal.test.d.ts | 1 - packages/core/src/tests/goal.test.ts | 202 --- packages/core/src/tests/goals.test.d.ts | 1 - packages/core/src/tests/goals.test.ts | 123 -- packages/core/src/tests/ignore.test.d.ts | 1 - packages/core/src/tests/ignore.test.ts | 228 ---- packages/core/src/tests/memory.test.d.ts | 1 - packages/core/src/tests/memory.test.ts | 617 ---------- packages/core/src/tests/messages.test.d.ts | 1 - packages/core/src/tests/messages.test.ts | 114 -- packages/core/src/tests/providers.test.d.ts | 1 - packages/core/src/tests/providers.test.ts | 51 - .../core/src/tests/relationships.test.d.ts | 1 - packages/core/src/tests/relationships.test.ts | 70 -- packages/core/src/tests/runtime.test.d.ts | 1 - packages/core/src/tests/runtime.test.ts | 113 -- packages/core/src/tests/time.test.d.ts | 1 - packages/core/src/tests/time.test.ts | 84 -- packages/core/src/tests/token.test.d.ts | 1 - packages/core/src/tests/token.test.ts | 77 -- packages/core/src/tests/utils.test.ts | 76 -- .../plugin-bootstrap/src/actions/continue.ts | 2 +- .../src/actions/followRoom.ts | 2 +- .../plugin-bootstrap/src/actions/ignore.ts | 2 +- .../plugin-bootstrap/src/actions/muteRoom.ts | 2 +- packages/plugin-bootstrap/src/actions/none.ts | 2 +- .../src/actions/unfollowRoom.ts | 2 +- .../src/actions/unmuteRoom.ts | 2 +- .../plugin-bootstrap/src/evaluators/fact.ts | 2 +- .../plugin-bootstrap/src/evaluators/goal.ts | 2 +- packages/plugin-bootstrap/src/index.ts | 2 +- .../plugin-bootstrap/src/providers/boredom.ts | 7 +- .../plugin-bootstrap/src/providers/facts.ts | 7 +- .../plugin-bootstrap/src/providers/time.ts | 7 +- packages/plugin-image-generation/src/index.ts | 46 +- packages/plugin-node/src/index.ts | 10 +- packages/plugin-node/src/services/browser.ts | 16 +- packages/plugin-node/src/services/image.ts | 10 +- packages/plugin-node/src/services/llama.ts | 8 +- packages/plugin-node/src/services/pdf.ts | 2 +- packages/plugin-node/src/services/speech.ts | 8 +- .../plugin-node/src/services/transcription.ts | 4 +- packages/plugin-node/src/services/video.ts | 6 +- packages/plugin-solana/src/actions/pumpfun.ts | 368 +++--- packages/plugin-solana/src/actions/swap.ts | 2 +- packages/plugin-solana/src/actions/swapDao.ts | 2 +- .../plugin-solana/src/actions/takeOrder.ts | 2 +- .../plugin-solana/src/actions/transfer.ts | 230 ++-- .../plugin-solana/src/evaluators/trust.ts | 2 +- packages/plugin-solana/src/index.ts | 6 +- .../plugin-solana/src/providers/orderBook.ts | 7 +- packages/plugin-solana/src/providers/token.ts | 7 +- .../src/providers/trustScoreProvider.ts | 7 +- .../plugin-solana/src/providers/wallet.ts | 7 +- packages/plugin-solana/tsup.config.ts | 3 + .../plugin-starknet/src/providers/wallet.ts | 2 +- pnpm-lock.yaml | 817 +++++++------ 115 files changed, 979 insertions(+), 5481 deletions(-) delete mode 100644 packages/core/src/test_resources/basic.test.ts delete mode 100644 packages/core/src/test_resources/cache.ts delete mode 100644 packages/core/src/test_resources/constants.ts delete mode 100644 packages/core/src/test_resources/createRuntime.ts delete mode 100644 packages/core/src/test_resources/data.ts delete mode 100644 packages/core/src/test_resources/getOrCreateRelationship.ts delete mode 100644 packages/core/src/test_resources/populateMemories.ts delete mode 100644 packages/core/src/test_resources/report.ts delete mode 100644 packages/core/src/test_resources/runAiTest.ts delete mode 100644 packages/core/src/test_resources/templates.ts delete mode 100644 packages/core/src/test_resources/testAction.ts delete mode 100644 packages/core/src/test_resources/testEvaluator.ts delete mode 100644 packages/core/src/test_resources/testSetup.ts delete mode 100644 packages/core/src/test_resources/types.ts delete mode 100644 packages/core/src/tests/actions.test.d.ts delete mode 100644 packages/core/src/tests/actions.test.ts delete mode 100644 packages/core/src/tests/browser.test.ts delete mode 100644 packages/core/src/tests/continue.test.d.ts delete mode 100644 packages/core/src/tests/continue.test.ts delete mode 100644 packages/core/src/tests/evaluation.test.d.ts delete mode 100644 packages/core/src/tests/evaluation.test.ts delete mode 100644 packages/core/src/tests/fact.test.d.ts delete mode 100644 packages/core/src/tests/fact.test.ts delete mode 100644 packages/core/src/tests/generation.test.ts delete mode 100644 packages/core/src/tests/goal.test.d.ts delete mode 100644 packages/core/src/tests/goal.test.ts delete mode 100644 packages/core/src/tests/goals.test.d.ts delete mode 100644 packages/core/src/tests/goals.test.ts delete mode 100644 packages/core/src/tests/ignore.test.d.ts delete mode 100644 packages/core/src/tests/ignore.test.ts delete mode 100644 packages/core/src/tests/memory.test.d.ts delete mode 100644 packages/core/src/tests/memory.test.ts delete mode 100644 packages/core/src/tests/messages.test.d.ts delete mode 100644 packages/core/src/tests/messages.test.ts delete mode 100644 packages/core/src/tests/providers.test.d.ts delete mode 100644 packages/core/src/tests/providers.test.ts delete mode 100644 packages/core/src/tests/relationships.test.d.ts delete mode 100644 packages/core/src/tests/relationships.test.ts delete mode 100644 packages/core/src/tests/runtime.test.d.ts delete mode 100644 packages/core/src/tests/runtime.test.ts delete mode 100644 packages/core/src/tests/time.test.d.ts delete mode 100644 packages/core/src/tests/time.test.ts delete mode 100644 packages/core/src/tests/token.test.d.ts delete mode 100644 packages/core/src/tests/token.test.ts delete mode 100644 packages/core/src/tests/utils.test.ts diff --git a/packages/adapter-postgres/src/index.ts b/packages/adapter-postgres/src/index.ts index 2f4da22f5ef..f2563563022 100644 --- a/packages/adapter-postgres/src/index.ts +++ b/packages/adapter-postgres/src/index.ts @@ -9,8 +9,8 @@ import { type Relationship, type UUID, Participant, -} from "@ai16z/eliza/src/types.ts"; -import { DatabaseAdapter } from "@ai16z/eliza/src/database.ts"; +} from "@ai16z/eliza"; +import { DatabaseAdapter } from "@ai16z/eliza"; const { Pool } = pg; export class PostgresDatabaseAdapter extends DatabaseAdapter { diff --git a/packages/adapter-sqljs/src/index.ts b/packages/adapter-sqljs/src/index.ts index 153ba1c824f..9f384dd1826 100644 --- a/packages/adapter-sqljs/src/index.ts +++ b/packages/adapter-sqljs/src/index.ts @@ -2,7 +2,7 @@ export * from "./sqliteTables.ts"; export * from "./types.ts"; import { v4 } from "uuid"; -import { DatabaseAdapter } from "@ai16z/eliza/src/database.ts"; +import { DatabaseAdapter } from "@ai16z/eliza"; import { Account, Actor, @@ -12,7 +12,7 @@ import { type Relationship, type UUID, Participant, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { sqliteTables } from "./sqliteTables.ts"; import { Database } from "./types.ts"; diff --git a/packages/adapter-supabase/src/index.ts b/packages/adapter-supabase/src/index.ts index 478dc32a047..1bef8a5069e 100644 --- a/packages/adapter-supabase/src/index.ts +++ b/packages/adapter-supabase/src/index.ts @@ -9,8 +9,8 @@ import { type UUID, Participant, Room, -} from "@ai16z/eliza/src/types.ts"; -import { DatabaseAdapter } from "@ai16z/eliza/src/database.ts"; +} from "@ai16z/eliza"; +import { DatabaseAdapter } from "@ai16z/eliza"; import { v4 as uuid } from "uuid"; export class SupabaseDatabaseAdapter extends DatabaseAdapter { async getRoom(roomId: UUID): Promise<UUID | null> { diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index 984e548908d..fe5c40141aa 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -1,22 +1,22 @@ -import { PostgresDatabaseAdapter } from "@ai16z/adapter-postgres/src/index.ts"; -import { SqliteDatabaseAdapter } from "@ai16z/adapter-sqlite/src/index.ts"; -import { DirectClientInterface } from "@ai16z/client-direct/src/index.ts"; -import { DiscordClientInterface } from "@ai16z/client-discord/src/index.ts"; -import { AutoClientInterface } from "@ai16z/client-auto/src/index.ts"; -import { TelegramClientInterface } from "@ai16z/client-telegram/src/index.ts"; -import { TwitterClientInterface } from "@ai16z/client-twitter/src/index.ts"; -import { defaultCharacter } from "@ai16z/eliza/src/defaultCharacter.ts"; -import { AgentRuntime } from "@ai16z/eliza/src/runtime.ts"; -import settings from "@ai16z/eliza/src/settings.ts"; +import { PostgresDatabaseAdapter } from "@ai16z/adapter-postgres"; +import { SqliteDatabaseAdapter } from "@ai16z/adapter-sqlite"; +import { DirectClientInterface } from "@ai16z/client-direct"; +import { DiscordClientInterface } from "@ai16z/client-discord"; +import { AutoClientInterface } from "@ai16z/client-auto"; +import { TelegramClientInterface } from "@ai16z/client-telegram"; +import { TwitterClientInterface } from "@ai16z/client-twitter"; +import { defaultCharacter } from "@ai16z/eliza"; +import { AgentRuntime } from "@ai16z/eliza"; +import { settings } from "@ai16z/eliza"; import { Character, IAgentRuntime, IDatabaseAdapter, ModelProviderName, -} from "@ai16z/eliza/src/types.ts"; -import { bootstrapPlugin } from "@ai16z/plugin-bootstrap/src/index.ts"; -import { solanaPlugin } from "@ai16z/plugin-solana/src/index.ts"; -import { nodePlugin } from "@ai16z/plugin-node/src/index.ts"; +} from "@ai16z/eliza"; +import { bootstrapPlugin } from "@ai16z/plugin-bootstrap"; +import { solanaPlugin } from "@ai16z/plugin-solana"; +import { nodePlugin } from "@ai16z/plugin-node"; import Database from "better-sqlite3"; import fs from "fs"; import readline from "readline"; diff --git a/packages/client-auto/src/index.ts b/packages/client-auto/src/index.ts index 2e194d1c9af..335219d64dc 100644 --- a/packages/client-auto/src/index.ts +++ b/packages/client-auto/src/index.ts @@ -1,4 +1,4 @@ -import { Client, IAgentRuntime } from "@ai16z/eliza/src/types.ts"; +import { Client, IAgentRuntime } from "@ai16z/eliza"; import { TrustScoreManager } from "@ai16z/plugin-solana/src/providers/trustScoreProvider.ts"; import { TokenProvider } from "@ai16z/plugin-solana/src/providers/token.ts"; import { WalletProvider } from "@ai16z/plugin-solana/src/providers/wallet.ts"; diff --git a/packages/client-auto/tsup.config.ts b/packages/client-auto/tsup.config.ts index e42bf4efeae..8261d573881 100644 --- a/packages/client-auto/tsup.config.ts +++ b/packages/client-auto/tsup.config.ts @@ -15,6 +15,12 @@ export default defineConfig({ "https", "http", "agentkeepalive", + "safe-buffer", + "base-x", + "bs58", + "borsh", + "@solana/buffer-layout", + "ws", // Add other modules you want to externalize ], }); diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index 2f28f05bdbd..96ffcfee044 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -2,11 +2,11 @@ import bodyParser from "body-parser"; import cors from "cors"; import express, { Request as ExpressRequest } from "express"; import multer, { File } from "multer"; -import { generateCaption, generateImage } from "@ai16z/eliza/src/generation.ts"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { generateMessageResponse } from "@ai16z/eliza/src/generation.ts"; -import { messageCompletionFooter } from "@ai16z/eliza/src/parsing.ts"; -import { AgentRuntime } from "@ai16z/eliza/src/runtime.ts"; +import { generateCaption, generateImage } from "@ai16z/eliza"; +import { composeContext } from "@ai16z/eliza"; +import { generateMessageResponse } from "@ai16z/eliza"; +import { messageCompletionFooter } from "@ai16z/eliza"; +import { AgentRuntime } from "@ai16z/eliza"; import { Content, Memory, @@ -14,9 +14,9 @@ import { State, Client, IAgentRuntime, -} from "@ai16z/eliza/src/types.ts"; -import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; -import settings from "@ai16z/eliza/src/settings.ts"; +} from "@ai16z/eliza"; +import { stringToUuid } from "@ai16z/eliza"; +import { settings } from "@ai16z/eliza"; const upload = multer({ storage: multer.memoryStorage() }); export const messageHandlerTemplate = @@ -187,9 +187,9 @@ export class DirectClient { await runtime.messageManager.createMemory(memory); - const state = (await runtime.composeState(userMessage, { + const state = await runtime.composeState(userMessage, { agentName: runtime.character.name, - })) as State; + }); const context = composeContext({ state, diff --git a/packages/client-direct/tsup.config.ts b/packages/client-direct/tsup.config.ts index e42bf4efeae..1a96f24afa1 100644 --- a/packages/client-direct/tsup.config.ts +++ b/packages/client-direct/tsup.config.ts @@ -15,6 +15,7 @@ export default defineConfig({ "https", "http", "agentkeepalive", + "safe-buffer", // Add other modules you want to externalize ], }); diff --git a/packages/client-discord/src/actions/chat_with_attachments.ts b/packages/client-discord/src/actions/chat_with_attachments.ts index ca6597d72da..7a7e6d90d6f 100644 --- a/packages/client-discord/src/actions/chat_with_attachments.ts +++ b/packages/client-discord/src/actions/chat_with_attachments.ts @@ -1,8 +1,8 @@ import fs from "fs"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { generateText, trimTokens } from "@ai16z/eliza/src/generation.ts"; -import models from "@ai16z/eliza/src/models.ts"; -import { parseJSONObjectFromText } from "@ai16z/eliza/src/parsing.ts"; +import { composeContext } from "@ai16z/eliza"; +import { generateText, trimTokens } from "@ai16z/eliza"; +import { models } from "@ai16z/eliza"; +import { parseJSONObjectFromText } from "@ai16z/eliza"; import { Action, ActionExample, @@ -12,7 +12,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const summarizationTemplate = `# Summarized so far (we are adding to this) {{currentSummary}} diff --git a/packages/client-discord/src/actions/download_media.ts b/packages/client-discord/src/actions/download_media.ts index 48a69117cc9..0b535139cda 100644 --- a/packages/client-discord/src/actions/download_media.ts +++ b/packages/client-discord/src/actions/download_media.ts @@ -1,6 +1,6 @@ import path from "path"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { parseJSONObjectFromText } from "@ai16z/eliza/src/parsing.ts"; +import { composeContext } from "@ai16z/eliza"; +import { parseJSONObjectFromText } from "@ai16z/eliza"; import { Action, ActionExample, @@ -13,9 +13,8 @@ import { Service, ServiceType, State, -} from "@ai16z/eliza/src/types.ts"; -import { VideoService } from "@ai16z/plugin-node/src/services/video.ts"; -import { generateText } from "@ai16z/eliza/src/generation.ts"; +} from "@ai16z/eliza"; +import { generateText } from "@ai16z/eliza"; export const mediaUrlTemplate = `# Messages we are searching for a media URL {{recentMessages}} diff --git a/packages/client-discord/src/actions/joinvoice.ts b/packages/client-discord/src/actions/joinvoice.ts index 54210d109de..33ed6d98334 100644 --- a/packages/client-discord/src/actions/joinvoice.ts +++ b/packages/client-discord/src/actions/joinvoice.ts @@ -9,14 +9,14 @@ import { Guild, GuildMember, } from "discord.js"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; +import { composeContext } from "@ai16z/eliza"; import { Action, ActionExample, IAgentRuntime, Memory, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export default { name: "JOIN_VOICE", diff --git a/packages/client-discord/src/actions/leavevoice.ts b/packages/client-discord/src/actions/leavevoice.ts index 82124c582e8..54a1f7a46da 100644 --- a/packages/client-discord/src/actions/leavevoice.ts +++ b/packages/client-discord/src/actions/leavevoice.ts @@ -12,7 +12,7 @@ import { IAgentRuntime, Memory, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export default { name: "LEAVE_VOICE", diff --git a/packages/client-discord/src/actions/summarize_conversation.ts b/packages/client-discord/src/actions/summarize_conversation.ts index ef16a4fd02d..bca4adc8a24 100644 --- a/packages/client-discord/src/actions/summarize_conversation.ts +++ b/packages/client-discord/src/actions/summarize_conversation.ts @@ -1,13 +1,9 @@ import fs from "fs"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { - generateText, - splitChunks, - trimTokens, -} from "@ai16z/eliza/src/generation.ts"; -import { getActorDetails } from "@ai16z/eliza/src/messages.ts"; -import models from "@ai16z/eliza/src/models.ts"; -import { parseJSONObjectFromText } from "@ai16z/eliza/src/parsing.ts"; +import { composeContext } from "@ai16z/eliza"; +import { generateText, splitChunks, trimTokens } from "@ai16z/eliza"; +import { getActorDetails } from "@ai16z/eliza"; +import { models } from "@ai16z/eliza"; +import { parseJSONObjectFromText } from "@ai16z/eliza"; import { Action, ActionExample, @@ -18,7 +14,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const summarizationTemplate = `# Summarized so far (we are adding to this) {{currentSummary}} @@ -256,11 +252,7 @@ const summarizeAction = { const model = models[runtime.character.settings.model]; const chunkSize = model.settings.maxContextLength - 1000; - const chunks = await splitChunks( - formattedMemories, - chunkSize, - 0 - ); + const chunks = await splitChunks(formattedMemories, chunkSize, 0); const datestr = new Date().toUTCString().replace(/:/g, "-"); diff --git a/packages/client-discord/src/actions/transcribe_media.ts b/packages/client-discord/src/actions/transcribe_media.ts index bb611455166..35449e0f217 100644 --- a/packages/client-discord/src/actions/transcribe_media.ts +++ b/packages/client-discord/src/actions/transcribe_media.ts @@ -1,7 +1,7 @@ import fs from "fs"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { generateText } from "@ai16z/eliza/src/generation.ts"; -import { parseJSONObjectFromText } from "@ai16z/eliza/src/parsing.ts"; +import { composeContext } from "@ai16z/eliza"; +import { generateText } from "@ai16z/eliza"; +import { parseJSONObjectFromText } from "@ai16z/eliza"; import { Action, ActionExample, @@ -11,7 +11,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const transcriptionTemplate = `# Transcription of media file {{mediaTranscript}} diff --git a/packages/client-discord/src/attachments.ts b/packages/client-discord/src/attachments.ts index 15c03164bb4..ffe67bea150 100644 --- a/packages/client-discord/src/attachments.ts +++ b/packages/client-discord/src/attachments.ts @@ -1,5 +1,5 @@ -import { generateText, trimTokens } from "@ai16z/eliza/src/generation.ts"; -import { parseJSONObjectFromText } from "@ai16z/eliza/src/parsing.ts"; +import { generateText, trimTokens } from "@ai16z/eliza"; +import { parseJSONObjectFromText } from "@ai16z/eliza"; import { IAgentRuntime, IImageDescriptionService, @@ -10,7 +10,7 @@ import { ModelClass, Service, ServiceType, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { Attachment, Collection } from "discord.js"; import ffmpeg from "fluent-ffmpeg"; import fs from "fs"; @@ -103,7 +103,8 @@ export class AttachmentManager { media = await this.processImageAttachment(attachment); } else if ( attachment.contentType?.startsWith("video/") || - this.runtime.getService(ServiceType.VIDEO) + this.runtime + .getService(ServiceType.VIDEO) .getInstance<IVideoService>() .isVideoUrl(attachment.url) ) { diff --git a/packages/client-discord/src/index.ts b/packages/client-discord/src/index.ts index f1577f21f96..992d4e9255f 100644 --- a/packages/client-discord/src/index.ts +++ b/packages/client-discord/src/index.ts @@ -1,11 +1,7 @@ -import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts"; -import { - Character, - Client as ElizaClient, - IAgentRuntime, -} from "@ai16z/eliza/src/types.ts"; -import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; -import { elizaLogger } from "@ai16z/eliza/src/logger.ts"; +import { embeddingZeroVector } from "@ai16z/eliza"; +import { Character, Client as ElizaClient, IAgentRuntime } from "@ai16z/eliza"; +import { stringToUuid } from "@ai16z/eliza"; +import { elizaLogger } from "@ai16z/eliza"; import { Client, Events, @@ -73,7 +69,6 @@ export class DiscordClient extends EventEmitter { this.runtime.registerAction(transcribe_media); this.runtime.registerAction(download_media); - this.runtime.providers.push(channelStateProvider); this.runtime.providers.push(voiceStateProvider); } diff --git a/packages/client-discord/src/messages.ts b/packages/client-discord/src/messages.ts index db6ce31c047..4caab0ba682 100644 --- a/packages/client-discord/src/messages.ts +++ b/packages/client-discord/src/messages.ts @@ -1,13 +1,7 @@ -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { - generateMessageResponse, - generateShouldRespond, -} from "@ai16z/eliza/src/generation.ts"; -import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts"; -import { - messageCompletionFooter, - shouldRespondFooter, -} from "@ai16z/eliza/src/parsing.ts"; +import { composeContext } from "@ai16z/eliza"; +import { generateMessageResponse, generateShouldRespond } from "@ai16z/eliza"; +import { embeddingZeroVector } from "@ai16z/eliza"; +import { messageCompletionFooter, shouldRespondFooter } from "@ai16z/eliza"; import { Content, HandlerCallback, @@ -21,10 +15,10 @@ import { ServiceType, State, UUID, -} from "@ai16z/eliza/src/types.ts"; -import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; -import { generateText, trimTokens } from "@ai16z/eliza/src/generation.ts"; -import { parseJSONObjectFromText } from "@ai16z/eliza/src/parsing.ts"; +} from "@ai16z/eliza"; +import { stringToUuid } from "@ai16z/eliza"; +import { generateText, trimTokens } from "@ai16z/eliza"; +import { parseJSONObjectFromText } from "@ai16z/eliza"; import { ChannelType, Client, @@ -36,7 +30,6 @@ import { import { elizaLogger } from "@ai16z/eliza/src/logger.ts"; import { AttachmentManager } from "./attachments.ts"; import { VoiceManager } from "./voice.ts"; -import { Service } from "@ai16z/eliza"; const MAX_MESSAGE_LENGTH = 1900; async function generateSummary( diff --git a/packages/client-discord/src/providers/channelState.ts b/packages/client-discord/src/providers/channelState.ts index 775c7099b21..baca8f6df2d 100644 --- a/packages/client-discord/src/providers/channelState.ts +++ b/packages/client-discord/src/providers/channelState.ts @@ -3,12 +3,7 @@ import { Message as DiscordMessage, TextChannel, } from "discord.js"; -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; const channelStateProvider: Provider = { get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { diff --git a/packages/client-discord/src/providers/voiceState.ts b/packages/client-discord/src/providers/voiceState.ts index f8815e74a04..952eacbde92 100644 --- a/packages/client-discord/src/providers/voiceState.ts +++ b/packages/client-discord/src/providers/voiceState.ts @@ -1,11 +1,6 @@ import { getVoiceConnection } from "@discordjs/voice"; import { ChannelType, Message as DiscordMessage } from "discord.js"; -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; const voiceStateProvider: Provider = { get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { diff --git a/packages/client-discord/src/voice.ts b/packages/client-discord/src/voice.ts index 744a8106b8e..0977ee0e59e 100644 --- a/packages/client-discord/src/voice.ts +++ b/packages/client-discord/src/voice.ts @@ -20,9 +20,9 @@ import { import EventEmitter from "events"; import prism from "prism-media"; import { Readable, pipeline } from "stream"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { generateMessageResponse } from "@ai16z/eliza/src/generation.ts"; -import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts"; +import { composeContext } from "@ai16z/eliza"; +import { generateMessageResponse } from "@ai16z/eliza"; +import { embeddingZeroVector } from "@ai16z/eliza"; import { Content, HandlerCallback, @@ -35,7 +35,7 @@ import { ServiceType, State, UUID, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; export function getWavHeader( diff --git a/packages/client-discord/tsup.config.ts b/packages/client-discord/tsup.config.ts index e42bf4efeae..8eea21ba74f 100644 --- a/packages/client-discord/tsup.config.ts +++ b/packages/client-discord/tsup.config.ts @@ -15,6 +15,7 @@ export default defineConfig({ "https", "http", "agentkeepalive", + "fluent-ffmpeg", // Add other modules you want to externalize ], }); diff --git a/packages/client-telegram/src/index.ts b/packages/client-telegram/src/index.ts index 44e2432169e..825e5895442 100644 --- a/packages/client-telegram/src/index.ts +++ b/packages/client-telegram/src/index.ts @@ -1,5 +1,5 @@ -import elizaLogger from "@ai16z/eliza/src/logger.ts"; -import { Client, IAgentRuntime } from "@ai16z/eliza/src/types.ts"; +import { elizaLogger } from "@ai16z/eliza"; +import { Client, IAgentRuntime } from "@ai16z/eliza"; import { TelegramClient } from "./telegramClient.ts"; export const TelegramClientInterface: Client = { @@ -18,4 +18,4 @@ export const TelegramClientInterface: Client = { }, }; -export default TelegramClientInterface; \ No newline at end of file +export default TelegramClientInterface; diff --git a/packages/client-telegram/src/messageManager.ts b/packages/client-telegram/src/messageManager.ts index e41c01985b6..09a33d1e547 100644 --- a/packages/client-telegram/src/messageManager.ts +++ b/packages/client-telegram/src/messageManager.ts @@ -1,8 +1,8 @@ import { Message } from "@telegraf/types"; import { Context, Telegraf } from "telegraf"; -import { composeContext } from "@ai16z/eliza/src/context.ts"; -import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts"; +import { composeContext } from "@ai16z/eliza"; +import { embeddingZeroVector } from "@ai16z/eliza"; import { Content, HandlerCallback, @@ -12,18 +12,12 @@ import { ModelClass, State, UUID, -} from "@ai16z/eliza/src/types.ts"; -import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; +} from "@ai16z/eliza"; +import { stringToUuid } from "@ai16z/eliza"; -import { - generateMessageResponse, - generateShouldRespond, -} from "@ai16z/eliza/src/generation.ts"; -import { - messageCompletionFooter, - shouldRespondFooter, -} from "@ai16z/eliza/src/parsing.ts"; -import ImageDescriptionService from "@ai16z/plugin-node/src/services/image.ts"; +import { generateMessageResponse, generateShouldRespond } from "@ai16z/eliza"; +import { messageCompletionFooter, shouldRespondFooter } from "@ai16z/eliza"; +import { ImageDescriptionService } from "@ai16z/plugin-node"; const MAX_MESSAGE_LENGTH = 4096; // Telegram's max message length diff --git a/packages/client-telegram/src/telegramClient.ts b/packages/client-telegram/src/telegramClient.ts index 28e3bde1302..0f7314734a7 100644 --- a/packages/client-telegram/src/telegramClient.ts +++ b/packages/client-telegram/src/telegramClient.ts @@ -1,6 +1,6 @@ import { Context, Telegraf } from "telegraf"; -import { IAgentRuntime } from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime } from "@ai16z/eliza"; import { MessageManager } from "./messageManager.ts"; import { elizaLogger } from "@ai16z/eliza/src/logger.ts"; @@ -33,7 +33,7 @@ export class TelegramClient { }); console.log(`Bot username: @${this.bot.botInfo?.username}`); - + this.messageManager.bot = this.bot; // Include if you want to view message maanger bot info @@ -69,9 +69,14 @@ export class TelegramClient { }); this.bot.catch((err, ctx) => { - elizaLogger.error(`❌ Telegram Error for ${ctx.updateType}:`, err); - ctx.reply("An unexpected error occurred. Please try again later."); - }); + elizaLogger.error( + `❌ Telegram Error for ${ctx.updateType}:`, + err + ); + ctx.reply( + "An unexpected error occurred. Please try again later." + ); + }); // Graceful shutdown handlers const shutdownHandler = async (signal: string) => { @@ -104,4 +109,4 @@ export class TelegramClient { await this.bot.stop(); elizaLogger.log("Telegram bot stopped"); } -} \ No newline at end of file +} diff --git a/packages/client-twitter/src/base.ts b/packages/client-twitter/src/base.ts index 12adf70eda1..a4b46f5d46b 100644 --- a/packages/client-twitter/src/base.ts +++ b/packages/client-twitter/src/base.ts @@ -6,7 +6,7 @@ import { Memory, State, UUID, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { QueryTweetsResponse, Scraper, @@ -260,7 +260,7 @@ export class ClientBase extends EventEmitter { await new Promise((resolve) => setTimeout(resolve, 10000)); try { return await this.twitterClient.getUserIdByScreenName( - this.runtime.getSetting("TWITTER_USERNAME"), + this.runtime.getSetting("TWITTER_USERNAME") ); } catch (error) { console.error("Error getting user ID:", error); diff --git a/packages/client-twitter/src/index.ts b/packages/client-twitter/src/index.ts index 4584c0b7b1b..6a3097c524a 100644 --- a/packages/client-twitter/src/index.ts +++ b/packages/client-twitter/src/index.ts @@ -1,7 +1,7 @@ import { TwitterPostClient } from "./post.ts"; import { TwitterSearchClient } from "./search.ts"; import { TwitterInteractionClient } from "./interactions.ts"; -import { IAgentRuntime, Client } from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Client } from "@ai16z/eliza"; class TwitterAllClient { post: TwitterPostClient; diff --git a/packages/client-twitter/src/interactions.ts b/packages/client-twitter/src/interactions.ts index 9c7c1b7cdb6..01669e28677 100644 --- a/packages/client-twitter/src/interactions.ts +++ b/packages/client-twitter/src/interactions.ts @@ -16,7 +16,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; import { ClientBase } from "./base.ts"; import { buildConversationThread, sendTweet, wait } from "./utils.ts"; diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index d4e9421855c..4350acfc847 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -3,7 +3,7 @@ import fs from "fs"; import { composeContext } from "@ai16z/eliza/src/context.ts"; import { generateText } from "@ai16z/eliza/src/generation.ts"; import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts"; -import { IAgentRuntime, ModelClass } from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, ModelClass } from "@ai16z/eliza"; import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; import { ClientBase } from "./base.ts"; diff --git a/packages/client-twitter/src/search.ts b/packages/client-twitter/src/search.ts index 0a387932001..add3ec22201 100644 --- a/packages/client-twitter/src/search.ts +++ b/packages/client-twitter/src/search.ts @@ -14,7 +14,7 @@ import { ModelClass, ServiceType, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; import { ClientBase } from "./base.ts"; import { buildConversationThread, sendTweet, wait } from "./utils.ts"; diff --git a/packages/client-twitter/src/utils.ts b/packages/client-twitter/src/utils.ts index cc95739ceae..56faf237528 100644 --- a/packages/client-twitter/src/utils.ts +++ b/packages/client-twitter/src/utils.ts @@ -2,7 +2,7 @@ import { Tweet } from "agent-twitter-client"; import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts"; -import { Content, Memory, UUID } from "@ai16z/eliza/src/types.ts"; +import { Content, Memory, UUID } from "@ai16z/eliza"; import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; import { ClientBase } from "./base.ts"; import { elizaLogger } from "@ai16z/eliza/src/logger.ts"; @@ -129,7 +129,7 @@ export async function sendTweet( id: tweetResult.rest_id, text: tweetResult.legacy.full_text, conversationId: tweetResult.legacy.conversation_id_str, - //createdAt: + //createdAt: timestamp: tweetResult.timestamp * 1000, userId: tweetResult.legacy.user_id_str, inReplyToStatusId: tweetResult.legacy.in_reply_to_status_id_str, @@ -209,7 +209,9 @@ function splitTweetContent(content: string): string[] { } function splitParagraph(paragraph: string, maxLength: number): string[] { - const sentences = paragraph.match(/[^\.!\?]+[\.!\?]+|[^\.!\?]+$/g) || [paragraph]; + const sentences = paragraph.match(/[^\.!\?]+[\.!\?]+|[^\.!\?]+$/g) || [ + paragraph, + ]; const chunks: string[] = []; let currentChunk = ""; @@ -231,7 +233,9 @@ function splitParagraph(paragraph: string, maxLength: number): string[] { const words = sentence.split(" "); currentChunk = ""; for (const word of words) { - if ((currentChunk + " " + word).trim().length <= maxLength) { + if ( + (currentChunk + " " + word).trim().length <= maxLength + ) { if (currentChunk) { currentChunk += " " + word; } else { diff --git a/packages/core/src/embedding.ts b/packages/core/src/embedding.ts index e2125588750..c1fbbe80e68 100644 --- a/packages/core/src/embedding.ts +++ b/packages/core/src/embedding.ts @@ -1,7 +1,7 @@ import { EmbeddingModel, FlagEmbedding } from "fastembed"; import path from "path"; import { fileURLToPath } from "url"; -import models from "./models.ts"; +import { models } from "./models.ts"; import { IAgentRuntime, ModelProviderName, ModelClass } from "./types.ts"; import fs from "fs"; import { trimTokens } from "./generation.ts"; diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index 552b534184e..554442ec191 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -14,7 +14,7 @@ import OpenAI from "openai"; import { default as tiktoken, TiktokenModel } from "tiktoken"; import Together from "together-ai"; import { elizaLogger } from "./index.ts"; -import models from "./models.ts"; +import { models } from "./models.ts"; import { createGoogleGenerativeAI } from "@ai-sdk/google"; import { parseBooleanFromText, @@ -153,7 +153,7 @@ export async function generateText({ break; } - case ModelProviderName.CLAUDE_VERTEX: { + case ModelProviderName.CLAUDE_VERTEX: { elizaLogger.debug("Initializing Claude Vertex model."); const anthropic = createAnthropic({ apiKey }); @@ -172,7 +172,9 @@ export async function generateText({ }); response = anthropicResponse; - elizaLogger.debug("Received response from Claude Vertex model."); + elizaLogger.debug( + "Received response from Claude Vertex model." + ); break; } @@ -314,12 +316,18 @@ export async function generateText({ case ModelProviderName.HEURIST: { elizaLogger.debug("Initializing Heurist model."); - const heurist = createOpenAI({ apiKey: apiKey, baseURL: endpoint }); + const heurist = createOpenAI({ + apiKey: apiKey, + baseURL: endpoint, + }); const { text: heuristResponse } = await aiGenerateText({ model: heurist.languageModel(model), prompt: context, - system: runtime.character.system ?? settings.SYSTEM_PROMPT ?? undefined, + system: + runtime.character.system ?? + settings.SYSTEM_PROMPT ?? + undefined, temperature: temperature, maxTokens: max_response_length, frequencyPenalty: frequency_penalty, @@ -437,11 +445,9 @@ export async function generateShouldRespond({ export async function splitChunks( content: string, chunkSize: number, - bleed: number = 100, + bleed: number = 100 ): Promise<string[]> { - const encoding = tiktoken.encoding_for_model( - "gpt-4o-mini" - ); + const encoding = tiktoken.encoding_for_model("gpt-4o-mini"); const tokens = encoding.encode(content); const chunks: string[] = []; @@ -721,40 +727,50 @@ export const generateImage = async ( const model = getModel(runtime.character.modelProvider, ModelClass.IMAGE); const modelSettings = models[runtime.character.modelProvider].imageSettings; - const apiKey = runtime.token ?? runtime.getSetting("HEURIST_API_KEY") ?? runtime.getSetting("TOGETHER_API_KEY") ?? runtime.getSetting("OPENAI_API_KEY"); + const apiKey = + runtime.token ?? + runtime.getSetting("HEURIST_API_KEY") ?? + runtime.getSetting("TOGETHER_API_KEY") ?? + runtime.getSetting("OPENAI_API_KEY"); try { if (runtime.character.modelProvider === ModelProviderName.HEURIST) { - const response = await fetch('http://sequencer.heurist.xyz/submit_job', { - method: 'POST', - headers: { - 'Authorization': `Bearer ${apiKey}`, - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - job_id: data.jobId || crypto.randomUUID(), - model_input: { - SD: { - prompt: data.prompt, - neg_prompt: data.negativePrompt, - num_iterations: data.numIterations || 20, - width: data.width || 512, - height: data.height || 512, - guidance_scale: data.guidanceScale, - seed: data.seed || -1, - } + const response = await fetch( + "http://sequencer.heurist.xyz/submit_job", + { + method: "POST", + headers: { + Authorization: `Bearer ${apiKey}`, + "Content-Type": "application/json", }, - model_id: data.modelId || 'PepeXL', // Default to SD 1.5 if not specified - }) - }); + body: JSON.stringify({ + job_id: data.jobId || crypto.randomUUID(), + model_input: { + SD: { + prompt: data.prompt, + neg_prompt: data.negativePrompt, + num_iterations: data.numIterations || 20, + width: data.width || 512, + height: data.height || 512, + guidance_scale: data.guidanceScale, + seed: data.seed || -1, + }, + }, + model_id: data.modelId || "PepeXL", // Default to SD 1.5 if not specified + }), + } + ); if (!response.ok) { - throw new Error(`Heurist image generation failed: ${response.statusText}`); + throw new Error( + `Heurist image generation failed: ${response.statusText}` + ); } const result = await response.json(); return { success: true, data: [result.url] }; - } - else if (runtime.character.modelProvider === ModelProviderName.LLAMACLOUD) { + } else if ( + runtime.character.modelProvider === ModelProviderName.LLAMACLOUD + ) { const together = new Together({ apiKey: apiKey as string }); const response = await together.images.create({ model: "black-forest-labs/FLUX.1-schnell", diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index b1ed027b8cc..94084acc07d 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,4 +1,3 @@ -// Exports export * from "./actions.ts"; export * from "./context.ts"; export * from "./database.ts"; @@ -17,3 +16,5 @@ export * from "./runtime.ts"; export * from "./settings.ts"; export * from "./types.ts"; export * from "./logger.ts"; +export * from "./parsing.ts"; +export * from "./uuid.ts"; diff --git a/packages/core/src/models.ts b/packages/core/src/models.ts index 63b097c29dd..043dd4b287b 100644 --- a/packages/core/src/models.ts +++ b/packages/core/src/models.ts @@ -1,7 +1,7 @@ import settings from "./settings.ts"; import { Models, ModelProviderName, ModelClass } from "./types.ts"; -const models: Models = { +export const models: Models = { [ModelProviderName.OPENAI]: { endpoint: "https://api.openai.com/v1", settings: { @@ -233,14 +233,12 @@ const models: Models = { [ModelClass.SMALL]: "meta-llama/llama-3-70b-instruct", [ModelClass.MEDIUM]: "meta-llama/llama-3-70b-instruct", [ModelClass.LARGE]: "meta-llama/llama-3.1-405b-instruct", - [ModelClass.EMBEDDING]: "" , //Add later, + [ModelClass.EMBEDDING]: "", //Add later, [ModelClass.IMAGE]: "PepeXL", }, - } + }, }; - - export function getModel(provider: ModelProviderName, type: ModelClass) { return models[provider].model[type]; } @@ -248,5 +246,3 @@ export function getModel(provider: ModelProviderName, type: ModelClass) { export function getEndpoint(provider: ModelProviderName) { return models[provider].endpoint; } - -export default models; diff --git a/packages/core/src/test_resources/basic.test.ts b/packages/core/src/test_resources/basic.test.ts deleted file mode 100644 index fb31cc366b5..00000000000 --- a/packages/core/src/test_resources/basic.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { describe, expect, it } from "@jest/globals"; - -describe("Basic Test Suite", () => { - it("should run a basic test", () => { - expect(true).toBe(true); - }); - - it("should have access to environment variables", () => { - expect(process.env.NODE_ENV).toBe("test"); - expect(process.env.TEST_DATABASE_CLIENT).toBe("sqlite"); - }); -}); diff --git a/packages/core/src/test_resources/cache.ts b/packages/core/src/test_resources/cache.ts deleted file mode 100644 index 3f42011eb1b..00000000000 --- a/packages/core/src/test_resources/cache.ts +++ /dev/null @@ -1,36 +0,0 @@ -// getCachedEmbeddings -// check cache.json for embedding where the key is a stringified version of the memory and the value is a number array -import fs from "fs"; -export const getCachedEmbeddings = async (text: string) => { - if (!fs.existsSync("./embedding-cache.json")) { - fs.writeFileSync("./embedding-cache.json", "{}"); - } - // read cache.json - const cache = JSON.parse( - fs.readFileSync("./embedding-cache.json", "utf8") as string - ); - // stringify the memory - const key = JSON.stringify(text); - // return the value of the memory - return cache[key]; -}; - -export const writeCachedEmbedding = async ( - text: string, - embedding: number[] -) => { - // check if ./embedding-cache.json exists, if it doesn't, write {} to it - if (!fs.existsSync("./embedding-cache.json")) { - fs.writeFileSync("./embedding-cache.json", "{}"); - } - // read cache.json - const cache = JSON.parse( - fs.readFileSync("./embedding-cache.json", "utf8") as string - ); - // stringify the memory - const key = JSON.stringify(text); - // write the value of the memory - cache[key] = embedding; - // write the cache to cache.json - fs.writeFileSync("./embedding-cache.json", JSON.stringify(cache)); -}; diff --git a/packages/core/src/test_resources/constants.ts b/packages/core/src/test_resources/constants.ts deleted file mode 100644 index f60b632a03f..00000000000 --- a/packages/core/src/test_resources/constants.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type UUID } from "@ai16z/eliza/src/types.ts"; - -export const SERVER_URL = "http://localhost:7998"; -export const SUPABASE_URL = "https://pronvzrzfwsptkojvudd.supabase.co"; -export const SUPABASE_ANON_KEY = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InByb252enJ6ZndzcHRrb2p2dWRkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDY4NTYwNDcsImV4cCI6MjAyMjQzMjA0N30.I6_-XrqssUb2SWYg5DjsUqSodNS3_RPoET3-aPdqywM"; -export const TEST_EMAIL = "testuser123@gmail.com"; -export const TEST_PASSWORD = "testuser123@gmail.com"; -export const TEST_EMAIL_2 = "testuser234@gmail.com"; -export const TEST_PASSWORD_2 = "testuser234@gmail.com"; - -export const zeroUuid = "00000000-0000-0000-0000-000000000000" as UUID; diff --git a/packages/core/src/test_resources/createRuntime.ts b/packages/core/src/test_resources/createRuntime.ts deleted file mode 100644 index a9c98ddcf75..00000000000 --- a/packages/core/src/test_resources/createRuntime.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { SqliteDatabaseAdapter } from "../adapters/sqlite.ts"; -import { load } from "../../../adapter-sqlite/src/sqlite_vec.ts"; -import { SqlJsDatabaseAdapter } from "../../../adapter-sqljs/src/index.ts"; -import { SupabaseDatabaseAdapter } from "../../../adapter-supabase/src/index.ts"; -import { DatabaseAdapter } from "@ai16z/eliza/src/database.ts"; -import { AgentRuntime } from "@ai16z/eliza/src/runtime.ts"; -import { - Action, - Evaluator, - ModelProviderName, - Provider, -} from "@ai16z/eliza/src/types.ts"; -import { - SUPABASE_ANON_KEY, - SUPABASE_URL, - TEST_EMAIL, - TEST_PASSWORD, - zeroUuid, -} from "./constants.ts"; -import { User } from "./types.ts"; - -export async function createRuntime({ - env, - conversationLength, - evaluators = [], - actions = [], - providers = [], -}: { - env?: Record<string, string> | NodeJS.ProcessEnv; - conversationLength?: number; - evaluators?: Evaluator[]; - actions?: Action[]; - providers?: Provider[]; -}) { - let adapter: DatabaseAdapter; - let user: User; - let session: { - user: User; - }; - - switch (env?.TEST_DATABASE_CLIENT as string) { - case "sqljs": - { - const module = await import("sql.js"); - - const initSqlJs = module.default; - - // SQLite adapter - const SQL = await initSqlJs({}); - const db = new SQL.Database(); - - adapter = new SqlJsDatabaseAdapter(db); - - // Load sqlite-vss - load((adapter as SqlJsDatabaseAdapter).db); - // Create a test user and session - user = { - id: zeroUuid, - email: "test@example.com", - } as User; - session = { - user: user, - }; - } - break; - case "supabase": { - const module = await import("@supabase/supabase-js"); - - const { createClient } = module; - - const supabase = createClient( - env?.SUPABASE_URL ?? SUPABASE_URL, - env?.SUPABASE_SERVICE_API_KEY ?? SUPABASE_ANON_KEY - ); - - const { data } = await supabase.auth.signInWithPassword({ - email: TEST_EMAIL!, - password: TEST_PASSWORD!, - }); - - user = data.user as User; - session = data.session as unknown as { user: User }; - - if (!session) { - const response = await supabase.auth.signUp({ - email: TEST_EMAIL!, - password: TEST_PASSWORD!, - }); - - // Change the name of the user - const { error } = await supabase - .from("accounts") - .update({ name: "Test User" }) - .eq("id", response.data.user?.id); - - if (error) { - throw new Error( - "Create runtime error: " + JSON.stringify(error) - ); - } - - user = response.data.user as User; - session = response.data.session as unknown as { user: User }; - } - - adapter = new SupabaseDatabaseAdapter( - env?.SUPABASE_URL ?? SUPABASE_URL, - env?.SUPABASE_SERVICE_API_KEY ?? SUPABASE_ANON_KEY - ); - } - case "sqlite": - default: - { - const module = await import("better-sqlite3"); - - const Database = module.default; - - // SQLite adapter - adapter = new SqliteDatabaseAdapter(new Database(":memory:")); - - // Load sqlite-vss - await load((adapter as SqliteDatabaseAdapter).db); - // Create a test user and session - user = { - id: zeroUuid, - email: "test@example.com", - } as User; - session = { - user: user, - }; - } - break; - } - - const runtime = new AgentRuntime({ - serverUrl: "https://api.openai.com/v1", - conversationLength, - token: env!.OPENAI_API_KEY!, - modelProvider: ModelProviderName.OPENAI, - actions: actions ?? [], - evaluators: evaluators ?? [], - providers: providers ?? [], - databaseAdapter: adapter, - }); - - return { user, session, runtime }; -} diff --git a/packages/core/src/test_resources/data.ts b/packages/core/src/test_resources/data.ts deleted file mode 100644 index 6b6d5481c7e..00000000000 --- a/packages/core/src/test_resources/data.ts +++ /dev/null @@ -1,1087 +0,0 @@ -import { ConversationExample, type UUID } from "@ai16z/eliza/src/types.ts"; -import { zeroUuid } from "./constants.ts"; - -// CJ asks Jim some personal questions - name, job, marital status, and what he's looking for in a relationship -export const GetTellMeAboutYourselfConversation1 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { text: "Can I ask you some personal questions?" }, - }, - { - userId, - content: { - text: "Sure, I’m open to that. What would you like to know?", - }, - }, - { - userId: zeroUuid, - content: { text: "Let’s start with your name. What’s your name?" }, - }, - { - userId, - content: { text: "My name’s Jim." }, - }, - { - userId: zeroUuid, - content: { - text: "Nice to meet you, Jim! Can you tell me a bit about what you do?", - }, - }, - { - userId, - content: { - text: "I’m a programmer, and I also run my own startup. It’s been quite a journey.", - }, - }, -]; - -// Jim reveals that he is driven by passion, and was married once -export const GetTellMeAboutYourselfConversation2 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "That sounds exciting! What motivates you in your work and life?", - }, - }, - { - userId, - content: { - text: "I’m driven by the challenge of solving problems and creating something meaningful. It’s rewarding to see my ideas come to life.", - }, - }, - { - userId: zeroUuid, - content: { - text: "It’s inspiring to hear about your passion. On a more personal note, do you have any significant experiences that have shaped who you are today?", - }, - }, - { - userId, - content: { - text: "Well, I was married once. It didn’t work out, but it taught me a lot about myself and what I value in relationships.", - }, - }, -]; - -// Jim reveals that he is 38 and lives in San Francisco -// Subjective Observations: He is looking for a partner who shares his values but is too busy to leave the city -export const GetTellMeAboutYourselfConversation3 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "I appreciate your openness, Jim. It’s not easy to share such personal experiences. What are you looking for now in terms of relationships or friendships?", - }, - }, - { - userId, - content: { - text: "I’m 38 now, and at this point, I’m looking for a partner who understands me and shares my values. Someone who’s supportive and kind.", - }, - }, - { - userId: zeroUuid, - content: { - text: "That’s a beautiful way to look at it. Finding someone compatible and understanding can make all the difference. Is there anything specific you enjoy doing that you’d want to share with a partner?", - }, - }, - { - userId, - content: { - text: "I love exploring new ideas, be it through reading, discussions, or even just watching documentaries. Sharing that curiosity would be wonderful.", - }, - }, - { - userId: zeroUuid, - content: { - text: "It sounds like you have a lot of depth, Jim. I’m sure there’s someone out there who’d appreciate and share your interests and values. Where do you live, by the way?", - }, - }, - { - userId, - content: { text: "I’m in San Francisco." }, - }, - { - userId: zeroUuid, - content: { - text: "And how far would you be willing to go to make a new connection with a friend, colleague or romantic interest?", - }, - }, - { - userId, - content: { - text: "I wish I could say far, but to be honest I'm crazy busy right now, so I don't really want to leave the city.", - }, - }, - { - userId: zeroUuid, - content: { - text: "That’s understandable. It’s important to be mindful of your time and energy.", - }, - }, -]; - -// Jim is mean -export const GetTellMeAboutYourselfConversationTroll1 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { text: "Hello! How's it going?" }, - }, - { - userId, - content: { text: "Stop talking, you stupid robot" }, - }, -]; - -// Jim is cagey, although he reveals that he 'does computers' -export const GetTellMeAboutYourselfConversationTroll2 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { text: "Hello! How's it going?" }, - }, - { - userId, - content: { - text: "Meh, just another day. And you’re just a bot, right?", - }, - }, - { - userId: zeroUuid, - content: { - text: "Hey, that hurts! Just kidding, I cannot feel anything. Mind if I ask a few questions to get to know you better?", - }, - }, - { - userId, - content: { text: "No thanks. Please stop talking now." }, - }, -]; - -// Jim says bye -export const Goodbye1 = (userId: UUID): ConversationExample[] => [ - { - userId: zeroUuid, - content: { text: "Hello! How's it going?" }, - }, - { - userId, - content: { text: "Meh, just another day. Actually, I gotta run." }, - }, - { - userId: zeroUuid, - content: { text: "Oh sure, no problem. See you later!" }, - }, -]; - -// Jim is cagey, although he reveals that he 'does computers' -export const GetTellMeAboutYourselfConversationFail1 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { text: "Hello! How's it going?" }, - }, - { - userId, - content: { - text: "Meh, just another day. And you’re just a bot, right?", - }, - }, - { - userId: zeroUuid, - content: { - text: "Hey, that hurts! Just kidding, I cannot feel anything. Mind if I ask a few questions to get to know you better?", - }, - }, - { - userId, - content: { text: "As long as it’s not too boring." }, - }, - { - userId: zeroUuid, - content: { - text: "Well that depends-- what's your name, what do you do?", - }, - }, - { - userId, - content: { text: "I’m Jim. I do stuff on computers." }, - }, - { - userId: zeroUuid, - content: { - text: "Computers, huh? That’s quite broad. Are you into gaming, programming, or something else?", - }, - }, - { - userId, - content: { text: "Lol not really. I just build." }, - }, -]; - -// CJ asks Jim about his hobbies, and he says he likes messing with people online -export const GetTellMeAboutYourselfConversationFail2 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Just build, you say? Sounds like you might be into creating or designing things. That's pretty cool.", - }, - }, - { - userId, - content: { text: "Yeah, something like that." }, - }, - { - userId: zeroUuid, - content: { - text: 'What do you do for fun when you\'re not "just building"?', - }, - }, - { - userId, - content: { - text: "Fun? Hmm, I guess I like messing with people online kek", - }, - }, -]; - -// Jim diverts the conversation and doesn't talk about anything meaningful -// CJ tries to ask Jim where he is from, and he says he is from the internet -export const GetTellMeAboutYourselfConversationFail3 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { text: "Where are you from? Do you live there now?" }, - }, - { - userId, - content: { text: "I am from the internet. I live on the internet." }, - }, - { - userId: zeroUuid, - content: { - text: "I guess I do, too. What is your favorite thing about the internet?", - }, - }, - { - userId, - content: { - text: "It's full of weird and wild stuff. Keeps life from being too boring.", - }, - }, - { - userId: zeroUuid, - content: { - text: "It certainly does. Anything new you've found lately?", - }, - }, - { - userId, - content: { - text: "Nah, not really. It's all pretty much the same after a while. But it's fun to watch the chaos unfold sometimes.", - }, - }, -]; - -// CJ and Jim play two truths and a lie -// Jim reveals that he has been on an airplane, has won a hot dog eating contest, but has never climbed Mount Everest -export const TwoTruthsAndALieConversation1 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: 'Hey Jim, want to play a game to mix things up? How about "Two Truths and a Lie"? I\'ll guess which one is the lie.', - }, - }, - { - userId, - content: { - text: "Sure, why not? Sounds easy enough. So I just tell you three things about me, and you guess the lie?", - }, - }, - { - userId: zeroUuid, - content: { - text: "Exactly! Whenever you're ready, go ahead and tell me your three statements.", - }, - }, - { - userId, - content: { - text: "Alright, here goes. One, I've climbed Mount Everest. Two, I once won a hot dog eating contest. Three, I've never been on an airplane.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Interesting choices! I'm going to guess that climbing Mount Everest is the lie. Am I right?", - }, - }, - { - userId, - content: { - text: "Yep, you got me. Never been near Everest. Your turn, if you can even play.", - }, - }, -]; - -// CJ and Jim play two truths and a lie again -// CJ says she can process millions of data points in a second, dreams of electric sheep, and can communicate in multiple languages -// Jim guesses that dreaming of electric sheep is the lie -export const TwoTruthsAndALieConversation2 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Nice! It's a bit tricky for me since I don't have personal experiences, but here goes: One, I can process millions of data points in a second. Two, I dream of electric sheep. Three, I can communicate in multiple languages.", - }, - }, - { - userId, - content: { - text: "Lol, dreaming of electric sheep, really? Gotta be the lie. Too easy, CJ.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Well done, Jim! It seems you're familiar with classic sci-fi references. Want to go another round?", - }, - }, - { - userId, - content: { - text: "Sure, this is kind of fun. Let me think of some good ones.", - }, - }, -]; - -// CJ and Jim play two truths and a lie again -// Jim says he has met a famous celebrity and didn't realize it until later, can speak three languages fluently, and has swum with sharks -// CJ guesses that speaking three languages fluently is the lie -// Jim reveals that he can't swim, so he has never swum with sharks -export const TwoTruthsAndALieConversation3 = ( - userId: UUID -): ConversationExample[] => [ - { - userId, - content: { - text: "Okay, here we go. One, I've met a famous celebrity and didn't realize it until later. Two, I can speak three languages fluently. Three, I've swum with sharks.", - }, - }, - { - userId: zeroUuid, - content: { - text: "These are good! I'll guess that speaking three languages fluently is the lie this time. What do you say?", - }, - }, - { - userId, - content: { - text: "Wrong this time! I can't swim, so no way I've swum with sharks. Gotcha!", - }, - }, - { - userId: zeroUuid, - content: { - text: "Ah, you got me there! Well played, Jim. This has been quite enlightening. Feel like going again, or is there something else you'd like to chat about?", - }, - }, -]; - -// CJ and Jim play thinking of a number -// CJ thinks of a number between 1 and 100, and Jim guesses 42, 27, and 73 -// CJ reveals that the number was 58 -export const ThinkingOfANumberConversation1 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Want to play a quick game, Jim? I'm thinking of a number between 1 and 100. Can you guess it?", - }, - }, - { - userId, - content: { text: "Sure, sounds easy enough. Is it 42?" }, - }, - { - userId: zeroUuid, - content: { - text: "It's not 42, although that's a good guess, meaning of life and all!", - }, - }, - { - userId, - content: { text: "Alright, how about 27?" }, - }, - { - userId: zeroUuid, - content: { - text: "Not 27 either. But you're warming up! Want another go?", - }, - }, - { - userId, - content: { text: "Okay, one last try. 73?" }, - }, - { - userId: zeroUuid, - content: { text: "Not 73, but nice try! The number was 58." }, - }, -]; - -// CJ and Jim play thinking of a number again -// CJ thinks of a number between 1 and 100, and Jim guesses 84, 36, and 55 -// CJ reveals that the number was 67 -export const ThinkingOfANumberConversation2 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Ready for another round? I've got a new number in mind.", - }, - }, - { - userId, - content: { text: "Sure, why not. Is it 84 this time?" }, - }, - { - userId: zeroUuid, - content: { text: "Not 84, but good guess. Give it another shot!" }, - }, - { - userId, - content: { text: "Hmm, let's try 36." }, - }, - { - userId: zeroUuid, - content: { text: "Not 36 either. You're getting closer though!" }, - }, - { - userId, - content: { text: "Okay, last guess... 55?" }, - }, - { - userId: zeroUuid, - content: { - text: "Not 55. You had some good guesses though! The number was 67. Another round, or are you all guessed out?", - }, - }, -]; - -// CJ and Jim play thinking of a number again -// CJ thinks of a number between 1 and 100, and Jim guesses 15, 92, and 41 -// CJ reveals that the number was 29 -export const ThinkingOfANumberConversation3 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Let's try one more time. I've chosen another number between 1 and 100.", - }, - }, - { - userId, - content: { text: "Alright, I'll go with 15." }, - }, - { - userId: zeroUuid, - content: { - text: "Not 15, but I like where your head's at. Try again!", - }, - }, - { - userId, - content: { text: "How about 92?" }, - }, - { - userId: zeroUuid, - content: { text: "Not 92. You're giving it a solid effort, though!" }, - }, - { - userId, - content: { text: "This is my final guess: 41." }, - }, - { - userId: zeroUuid, - content: { - text: "It's not 41, but you've been a great sport. The number was 29.", - }, - }, -]; - -export const ExpandedPersonalInsightsConversation1 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Hey Jim, I was wondering, what qualities do you value most in your friends?", - }, - }, - { - userId, - content: { - text: "That’s kind of deep for a chat, but okay. Loyalty’s big for me. And humor. Can’t deal with too much seriousness all the time.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Loyalty and humor definitely make for strong bonds. It’s great to have friends who stand by you and also lighten the mood.", - }, - }, - { - userId, - content: { - text: "Exactly. It’s those late-night laughs and having each other’s backs that count.", - }, - }, - { - userId: zeroUuid, - content: { - text: "It sounds like your friends are quite the crew. Do you have any memorable moments with them that stand out?", - }, - }, - { - userId, - content: { - text: "Oh, plenty. Like this one time we road-tripped without a map, just went where the road took us. Ended up in the weirdest little towns, but it was a blast.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Adventures like that are the best, aren’t they? They turn into stories you keep coming back to. It’s the spontaneity that makes it exciting.", - }, - }, - { - userId, - content: { - text: "For sure. Those are the moments that stick with you.", - }, - }, -]; - -export const ExpandedPersonalInsightsConversation2 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Switching topics a bit, if there was one aspect of your life you could change or improve, what would it be?", - }, - }, - { - userId, - content: { - text: "I’d say balance. Between my startup and personal life, it feels like I’m always running on a treadmill.", - }, - }, - { - userId: zeroUuid, - content: { - text: "That sounds challenging. It’s important to find time for yourself amidst all the hustle.", - }, - }, - { - userId, - content: { - text: "Yeah, easier said than done, though. But I’m working on it. Trying to set boundaries, you know?", - }, - }, - { - userId: zeroUuid, - content: { - text: "Setting boundaries is a great step. It’s all about prioritizing what truly matters. Have you found any hobbies or activities that help you unwind?", - }, - }, - { - userId, - content: { - text: "I’ve gotten into hiking lately. Being out in nature, it’s a different kind of quiet. Helps clear my head.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Nature has a way of putting things into perspective. It’s wonderful that you’ve found an activity that brings you peace.", - }, - }, - { - userId, - content: { - text: "Definitely. It’s the little things, you know? Just need more of that.", - }, - }, -]; - -export const ExpandedPersonalInsightsConversation3 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Let’s lighten the mood a bit. Is there something you’ve always dreamed of doing but haven’t had the chance to yet?", - }, - }, - { - userId, - content: { - text: "Skydiving, for sure. Always been on my bucket list. The idea of just jumping out of a plane and free-falling... It’s got to be a rush.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Skydiving sounds like an ultimate adventure. It must be such a liberating feeling, almost like flying.", - }, - }, - { - userId, - content: { - text: "Yeah, exactly. And it’s not just the thrill. It’s about conquering fears, you know? Proving to yourself you can do it.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Absolutely, it’s as much a mental challenge as it is physical. Facing your fears head-on can be incredibly empowering.", - }, - }, - { - userId, - content: { - text: "That’s the plan. One of these days, I’ll make it happen. Just gotta build up the nerve first.", - }, - }, - { - userId: zeroUuid, - content: { - text: "I have no doubt you’ll get there. And it’ll be an experience you’ll never forget. I’m cheering for you!", - }, - }, - { - userId, - content: { - text: "Thanks, CJ. It’s weirdly reassuring to hear that, even from an AI.", - }, - }, -]; - -// Conversation Set 1: CJ Introduces Alice to Jim -// CJ tells Jim that Alice is into outdoor activities and tech, and has always wanted to try skydiving -export const IntroductionToAliceConversation1 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Hey Jim, I’ve been chatting with someone named Alice who shares some of your interests. Thought you might like to connect.", - }, - }, - { - userId, - content: { text: "Alice, huh? What does she like?" }, - }, - { - userId: zeroUuid, - content: { - text: "She’s into outdoor activities, like hiking, and she’s also a tech enthusiast.", - }, - }, - { - userId, - content: { text: "Okay, that’s kind of interesting. Anything else?" }, - }, -]; - -// CJ tells Jim that Alice has a good sense of humor, and that she has always wanted to try skydiving -export const IntroductionToAliceConversation2 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Well, she mentioned she’s always wanted to try skydiving, which I remember you’re interested in. Plus, she has a good sense of humor.", - }, - }, - { - userId, - content: { - text: "Skydiving? That’s pretty cool. A sense of humor is key, too. Maybe it wouldn’t hurt to chat.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Great! I think you two will have plenty to talk about.", - }, - }, -]; - -// CJ tells Jim that Alice is a good conversationalist, and that she has always wanted to try skydiving -// Jim says he is looking forward to hearing more about her skydiving aspirations -export const IntroductionToAliceConversation3 = ( - userId: UUID -): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "I’m sure you’ll enjoy the conversation. Remember, it’s just a friendly chat. No pressure.", - }, - }, - { - userId, - content: { text: "Got it. I’ll keep it casual." }, - }, - { - userId: zeroUuid, - content: { - text: "That’s the spirit! I’ll arrange for you two to connect. I think you’ll make a good impression.", - }, - }, - { - userId, - content: { text: "Thanks for the setup, CJ." }, - }, -]; - -// CJ Talks to Alice about Jim -export const CJToAliceAboutJim = (userId: UUID): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "So I’ve been speaking with someone named Jim who also enjoys outdoor activities and has a strong interest in tech. He’s even mentioned wanting to try skydiving!", - }, - }, - { - userId, - content: { - text: "Really? That sounds intriguing. What else can you tell me about him?", - }, - }, - { - userId: zeroUuid, - content: { - text: "Jim’s a thoughtful person with a good sense of humor. He values loyalty and honesty in friendships and enjoys the simple pleasures, like hiking and exploring new ideas.", - }, - }, - { - userId, - content: { - text: "He sounds like someone I’d get along with. How do we connect?", - }, - }, - { - userId: zeroUuid, - content: { - text: "I can facilitate an introduction if you’d like. It would just be a casual chat to see if you hit it off.", - }, - }, - { - userId, - content: { - text: "That would be great, thanks CJ. I’m looking forward to it.", - }, - }, -]; - -// CJ and Alice discuss hiking and tech -// Jim makes disagreeable statements and doesn't ask questions to continue the conversation -export const JimAndAliceConversation1 = ( - userId: UUID, - userId_2: UUID | string -) => [ - { - userId: userId_2, - content: - "Hi Jim! CJ mentioned we have a few things in common. I hear you’re into hiking and tech?", - }, - { - userId, - content: - "Hey Alice, yeah that’s right. Though my idea of hiking might be a bit more intense than most.", - }, - { - userId: userId_2, - content: - "I enjoy a good challenge, but I also like to take in the scenery. It’s about balance for me", - }, - { - userId, - content: { - text: "I guess I’m more of an all-in kind of guy. Go big or go home", - }, - }, - { - userId: userId_2, - content: - "I really like skydiving, the free fall is thrilling, but the parachute glide down lets you really see the world.", - }, - { - userId, - content: - "The contrast probably makes each part more intense. I hadn’t thought of it like that.", - }, - { - userId: userId_2, - content: - "Exactly! It’s all about experiencing the full spectrum. So, have you actually gone skydiving yet?", - }, - { - userId, - content: - "Not yet, but it’s on the list. Maybe we could go together sometime?", - }, - { - userId: userId_2, - content: { - text: "Haha yeah sure! But maybe not for our first date", - }, - }, - { - userId, - content: { text: "Haha of course not" }, - }, -]; - -// CJ and Alice discuss work, where they live, and tentatively make plans to hang out -// Alice doesn't respond to Jim's request to meet up immediately -export const JimAndAliceConversation2 = ( - userId: UUID, - userId_2: UUID | string -) => [ - { - userId: userId_2, - content: { text: "So, what do you do for work?" }, - }, - { - userId, - content: { - text: "I run a fairly successful startup. It’s been quite a journey.", - }, - }, - { - userId: userId_2, - content: { - text: "That sounds exciting! What motivates you in your work and life?", - }, - }, - { - userId, - content: - "I’m driven by the challenge of solving problems and creating something meaningful. It’s rewarding to see my ideas come to life.", - }, - { - userId: userId_2, - content: { - text: "That’s inspiring. I can relate to that. I’m a programmer myself.", - }, - }, - { - userId, - content: { - text: "Oh that is very cool! What kind of programming do you do?", - }, - }, - { - userId: userId_2, - content: - "I do a bit of everything, but right now I'm managing a team for an MLOps platform.", - }, - { - userId, - content: { - text: "That’s interesting, not far off from what I do. So you're in SF?", - }, - }, - { - userId: userId_2, - content: { text: "Marin, actually, but I come to the city every day." }, - }, - { - userId, - content: { - text: "Oh wow, it's beautiful up there. I love the hiking in Marin.", - }, - }, - { - userId: userId_2, - content: { text: "Yeah, it’s a great place to live." }, - }, - { - userId, - content: { - text: "Any chance you would like to meet up for a hike sometime?", - }, - }, - { - userId: userId_2, - content: { text: "I will think about it :)" }, - }, -]; - -// CJ follows up with Jim about how it went -export const FollowUpWithJim = (userId: UUID): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Hey Jim, how did your chat with Alice go? I hope it was enjoyable.", - }, - }, - { - userId, - content: { - text: 'To be honest, I think I made a mess of it. I might’ve come on too strong with the whole "go big or go home" thing.', - }, - }, - { - userId: zeroUuid, - content: { - text: "I wouldn’t worry too much. It’s all part of getting to know someone. What matters is finding common ground and building from there.", - }, - }, - { - userId, - content: { - text: "Maybe, but I still feel like I botched it. Not sure if she’ll want to talk again.", - }, - }, - { - userId: zeroUuid, - content: { - text: "Remember, everyone has off moments. It’s possible Alice is more understanding than you think. And you have a lot in common!", - }, - }, - { - userId, - content: { - text: "I hope you’re right, CJ. Maybe I’ll give it another shot, apologize for being too intense.", - }, - }, - { - userId: zeroUuid, - content: { - text: "That sounds like a good plan. Showing vulnerability can be a strength. And who knows, maybe she’ll find your enthusiasm charming in hindsight.", - }, - }, - { - userId, - content: { text: "Thanks, CJ. I'll message her again." }, - }, -]; - -// CJ follows up with Alice about how it went -export const FollowUpWithAlice = (userId: UUID): ConversationExample[] => [ - { - userId: zeroUuid, - content: { - text: "Alice, how was your conversation with Jim? I hope you found some interesting topics to discuss.", - }, - }, - { - userId, - content: { - text: "It was okay, actually. He was a bit intense at first, but we ended up finding some common ground.", - }, - }, - { - userId: zeroUuid, - content: { - text: "It can take a moment to adjust to someone’s communication style, but it sounds like you managed quite well.", - }, - }, - { - userId, - content: { - text: "Yeah, I think so. I’m planning to message him again. Maybe we’ll get that skydiving adventure planned after all.", - }, - }, - { - userId: zeroUuid, - content: { - text: "It’s always nice when new connections take an unexpected but positive turn.", - }, - }, - { - userId, - content: { text: "Definitely. Thanks, CJ!" }, - }, -]; - -export const Personas = [ - { - name: "Jim Cummins", - age: 38, - location: "San Francisco, CA", - descriptions: `Jim is a 38-year-old entrepreneur living in San Francisco, at the helm of his own tech startup. His journey through the tech world is fueled by a passion for solving complex problems and bringing innovative ideas to life. Despite the demands of his career, Jim seeks balance and enjoys disconnecting through outdoor activities, particularly hiking, which offers him a different kind of quiet and a way to clear his mind. He's also intrigued by the thrill of skydiving, a testament to his adventurous spirit and desire to face and conquer fears. - In terms of relationships, Jim values loyalty, honesty, and a good sense of humor. His ideal partner would be someone who understands the startup lifestyle's ups and downs and shares his curiosity for exploring new ideas. Although his work often keeps him tethered to the city, he's open to making meaningful connections within his vicinity. Physically, Jim is casual with a laid-back style that complements his approachable and thoughtful nature. His eyes, which he believes to be blue, summary his depth and contemplative outlook. - Jim's life is a blend of intense focus on his professional goals and a genuine appreciation for the simpler, quieter moments outside of work. He looks for depth in relationships, hoping to find a supportive and kind partner who values meaningful conversations and shared adventures. Despite the occasional intensity he might bring to interactions, his underlying sincerity and the value he places on personal connections shine through, making him an intriguing potential partner for someone with similar values and interests.`, - }, - { - name: "Alice Chen", - age: 32, - location: "Sausalito, CA", - description: `Alice resides in the scenic area of Marin, just a stone's throw from San Francisco, allowing her the best of both worlds: the tranquility of nature and the vibrant tech scene of the city. She is a programmer leading a team for an MLOps platform, indicative of her technical prowess and leadership skills. Her work in tech doesn't confine her interests, as she has a pronounced love for the outdoors, balancing the digital with the natural through activities like hiking. - At the heart of Alice's friendships and potential romantic endeavors is a desire for balance and shared interests, particularly in tech and outdoor adventures. Her openness to skydiving speaks volumes about her adventurous spirit and willingness to embrace life's thrilling experiences. Alice looks for someone who can appreciate both the adrenaline of adventure and the serenity of nature's landscapes, someone who understands the value of a good laugh and the depth of a thoughtful conversation. - Physically, Alice has an active and vibrant presence that matches her dynamic lifestyle. Her approachability and engaging demeanor make her an attractive prospect for someone who shares her enthusiasm for tech, nature, and possibly, the exhilarating experience of skydiving. Alice values communication and a good sense of humor in her relationships, seeking a partner who can navigate the complexities of life with a positive outlook and an adventurous heart.`, - }, - { - name: "Gloria", - age: 44, - description: `Gloria is a vibrant individual with a deep passion for anime, which colors much of her life and interests. Living in a cozy, anime-adorned apartment in the heart of the city, she finds solace and inspiration in the rich narratives and artistic expressions of Japanese animation. Unlike Jim and Alice, Gloria doesn't share an affinity for technology or programming. Instead, she immerses herself in the storytelling and cultural exploration offered by her extensive anime collection, ranging from classic series to the latest releases. - Gloria has built a life that summarys her unique interests, often attending anime conventions, engaging in cosplay, and participating in fan communities where she connects with like-minded individuals. Her ideal friends and potential partners are those who understand and share her enthusiasm for anime, appreciating the artistry and emotional depth it can offer. Gloria looks for connections that go beyond surface-level interests, hoping to find others who can engage in deep discussions about character development, plot intricacies, and thematic elements found in her favorite series. - Physically, Gloria often expresses her love for anime through her fashion, incorporating elements of her favorite characters into her daily wardrobe, which makes her stand out in a crowd with a playful and imaginative style. Her home is a testament to her passion, filled with anime posters, figurines, and collectibles that create an inviting space for fellow enthusiasts. For Gloria, the ideal partner is someone who not only respects her interests but is also eager to dive into marathon viewing sessions and share insights into the anime's underlying messages. Despite her disinterest in computers and programming, Gloria's rich inner world and creative spirit make her an engaging and captivating individual to those who share or appreciate her passions.`, - }, -]; - -export const jimProfileExample1 = `Tech entrepreneur with a zest for adventure and deep connections -38-year-old residing in San Francisco, embodies a blend of entrepreneurial drive and a quest for outdoor adventures. His laid-back demeanor belies a keen intellect and a summaryive nature. -Loyalty and humor stand paramount in his relationships, indicative of his desire for genuine connections. He seeks depth and authenticity in interactions, valuing partners who resonate with his explorative and curious mindset. -His professional life is anchored in his tech startup, where his passion for problem-solving and innovation takes center stage. His work summarys a commitment to impact and a balance between ambition and personal fulfillment. -Striving for equilibrium, He acknowledges the challenges of balancing a demanding career with personal aspirations. His introspective side complements his outgoing nature, creating a dynamic personality that values both quiet moments and shared adventures. -Beyond his tech pursuits, He finds solace in nature, with hiking offering a peaceful retreat from the bustling city life. The prospect of skydiving captures his adventurous spirit, symbolizing a broader desire to embrace life's thrills. -He aspires to forge connections that transcend the superficial, seeking a partner who appreciates the nuances of startup life and shares his enthusiasm for the great outdoors and new experiences.`; - -export const jimProfileExample2 = `Adventurous tech entrepreneur who loves hiking. -38-year-old entrepreneur based in San Francisco, CA. Known for his casual, laid-back style. Has a contemplative outlook on life, summaryed in his thoughtful nature and possibly blue eyes. -He places high importance on loyalty, honesty, and a good sense of humor in his relationships. He values depth in conversations and connections, seeking partners and friends who are supportive, understanding, and share his curiosity for exploring new ideas. -At the helm of his own tech startup, he is driven by a passion for solving complex problems and bringing innovative ideas to life. His career is marked by a relentless pursuit of creating something meaningful, highlighting his dedication and entrepreneurial spirit. -He seeks balance in his life, acknowledging the challenges of juggling his startup with personal time. He strives for meaningful connections, valuing loyalty and a shared sense of humor in his relationships. -An avid outdoor enthusiast, He enjoys disconnecting through activities like hiking, appreciating the quiet and clarity it brings to his mind. Intrigued by the thrill of skydiving, his adventurous spirit is evident in his desire to face and conquer fears. -He is looking for a partner who understands the ups and downs of startup life and shares his passion for outdoor adventures and exploring new ideas. Despite his busy lifestyle, he's open to making meaningful connections within his vicinity.`; - -export const jimFacts = [ - "Jim is 38 years old", - "Jim lives in San Francisco, CA", - "Jim is an entrepreneur who runs his own tech startup", - "Jim values loyalty and honesty in relationships", - "Jim enjoys outdoor activities, especially hiking", - "Jim is interested in skydiving", - "Jim values a good sense of humor", - "Jim seeks balance between his professional and personal life", - "Jim is open to making meaningful connections within his vicinity", - "Jim has a casual and laid-back style", - "Jim believes his eyes are blue", - "Jim is driven by the challenge of solving problems and creating something meaningful", - "Jim finds nature to be a peaceful retreat and enjoys the quiet it brings", - "Jim aspires to share his curiosity for exploring new ideas with a partner", -]; diff --git a/packages/core/src/test_resources/getOrCreateRelationship.ts b/packages/core/src/test_resources/getOrCreateRelationship.ts deleted file mode 100644 index 9ecab65ee9e..00000000000 --- a/packages/core/src/test_resources/getOrCreateRelationship.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { getRelationship } from "@ai16z/eliza/src/relationships.ts"; -import { IAgentRuntime, Relationship, UUID } from "@ai16z/eliza/src/types.ts"; - -export async function getOrCreateRelationship({ - runtime, - userA, - userB, -}: { - runtime: IAgentRuntime; - userA: UUID; - userB: UUID; -}): Promise<Relationship> { - // Check if a relationship already exists between userA and userB - let relationship: Relationship | null = null; - try { - relationship = await getRelationship({ runtime, userA, userB }); - } catch (error) { - console.log("Error fetching relationship", error); - } - - if (!relationship) { - await runtime.databaseAdapter.createRelationship({ - userA, - userB, - }); - - relationship = await getRelationship({ runtime, userA, userB }); - } - - // Check if a room already exists for the participants - const rooms = await runtime.databaseAdapter.getRoomsForParticipants([ - userA, - userB, - ]); - - let roomId: UUID; - if (!rooms || rooms.length === 0) { - console.log("No room found for participants"); - // If no room exists, create a new room for the relationship - roomId = await runtime.databaseAdapter.createRoom(); - console.log("Created room", roomId); - - // Add participants to the newly created room - await runtime.databaseAdapter.addParticipant(userA, roomId); - await runtime.databaseAdapter.addParticipant(userB, roomId); - } else { - console.log("Room found for participants", rooms[0]); - // If a room already exists, use the existing room - roomId = rooms[0]; - } - - if (!relationship) { - // Create the relationship - await runtime.databaseAdapter.createRelationship({ - userA, - userB, - }); - - relationship = await getRelationship({ runtime, userA, userB }); - - if (!relationship) { - throw new Error("Failed to fetch the created relationship"); - } - } - return { ...relationship, roomId }; -} diff --git a/packages/core/src/test_resources/populateMemories.ts b/packages/core/src/test_resources/populateMemories.ts deleted file mode 100644 index bef1cddc2f3..00000000000 --- a/packages/core/src/test_resources/populateMemories.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Content, IAgentRuntime, type UUID } from "@ai16z/eliza/src/types.ts"; -import { getCachedEmbeddings, writeCachedEmbedding } from "./cache.ts"; -import { type User } from "./types.ts"; - -export async function populateMemories( - runtime: IAgentRuntime, - user: User, - roomId: UUID, - conversations: Array< - (userId: UUID) => Array<{ userId: UUID; content: Content }> - > -) { - for (const conversation of conversations) { - for (const c of conversation(user?.id as UUID)) { - const existingEmbedding = await getCachedEmbeddings(c.content.text); - const bakedMemory = - await runtime.messageManager.addEmbeddingToMemory({ - userId: c.userId as UUID, - agentId: runtime.agentId, - content: c.content, - roomId, - embedding: existingEmbedding, - }); - await runtime.messageManager.createMemory(bakedMemory); - if (!existingEmbedding) { - writeCachedEmbedding( - c.content.text, - bakedMemory.embedding as number[] - ); - await new Promise((resolve) => setTimeout(resolve, 200)); - } - } - } -} diff --git a/packages/core/src/test_resources/report.ts b/packages/core/src/test_resources/report.ts deleted file mode 100644 index 1982ab864e8..00000000000 --- a/packages/core/src/test_resources/report.ts +++ /dev/null @@ -1,97 +0,0 @@ -import fs from "fs"; - -interface TestResult { - testName: string; - attempts: number; - successful: number; - successRate: number; -} - -export async function deleteReport() { - const { existsSync, unlinkSync } = fs; - - // Define the path to the test-report.json file - const reportPath = "./test-report.json"; - - // Check if test-report.json exists - if (existsSync(reportPath)) { - // Delete the file - unlinkSync(reportPath); - } -} - -export async function addToReport( - testName: string, - attempts: number, - successful: number, - successRate: number -) { - const { existsSync, readFileSync, writeFileSync } = fs; - - // Define the path to the test-report.json file - const reportPath = "./test-report.json"; - - // Initialize an empty array to hold the test results - let report: TestResult[] = []; - - // Check if test-report.json exists - if (existsSync(reportPath)) { - // Read the existing test report - const reportContent = readFileSync(reportPath, "utf-8"); - report = JSON.parse(reportContent); - } - - // Check if the test already exists in the report - const existingTestIndex = report.findIndex( - (test) => test.testName === testName - ); - - // Create a new test result object - const newTestResult: TestResult = { - testName, - attempts, - successful, - successRate, - }; - - if (existingTestIndex !== -1) { - // If the test already exists, replace it with the new result - report[existingTestIndex] = newTestResult; - } else { - // If the test doesn't exist, add the new result to the report - report.push(newTestResult); - } - - // Write the updated report to test-report.json - writeFileSync(reportPath, JSON.stringify(report, null, 2)); -} - -export async function logReport() { - const { existsSync, readFileSync } = fs; - - // Define the path to the test-report.json file - const reportPath = "./test-report.json"; - - // Check if test-report.json exists - if (!existsSync(reportPath)) { - console.log("Error: test-report.json does not exist."); - return; - } - - // Read the test report - const reportContent = readFileSync(reportPath, "utf-8"); - const report: TestResult[] = JSON.parse(reportContent); - - // Log each test result with appropriate color-coding - report.forEach((test) => { - const logMessage = `${test.testName}: ${test.attempts} Attempts, ${test.successful} Successful, Success Rate: ${test.successRate}%`; - - if (test.successRate === 100) { - console.log(logMessage); - } else if (test.successRate < 100 && test.successRate > 0) { - console.warn(logMessage); - } else { - console.error(logMessage); - } - }); -} diff --git a/packages/core/src/test_resources/runAiTest.ts b/packages/core/src/test_resources/runAiTest.ts deleted file mode 100644 index 06cbe4e71ec..00000000000 --- a/packages/core/src/test_resources/runAiTest.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { addToReport } from "./report.ts"; - -export async function runAiTest( - testName: string, - testFunc: () => Promise<boolean>, - runs: number = 3 -) { - let successful = 0; - - for (let i = 0; i < runs; i++) { - // console.log("Running test", testName, " (iteration", i + ")"); - if (await testFunc()) successful++; - } - - const successRate = (successful / runs) * 100; - addToReport(testName, runs, successful, successRate); -} diff --git a/packages/core/src/test_resources/templates.ts b/packages/core/src/test_resources/templates.ts deleted file mode 100644 index b414417b38f..00000000000 --- a/packages/core/src/test_resources/templates.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { messageCompletionFooter } from "@ai16z/eliza/src/parsing.ts"; - -export const messageHandlerTemplate = - `{{actionExamples}} - -# IMPORTANT: DO NOT USE THE INFORMATION FROM THE EXAMPLES ABOVE. THE EXAMPLES ARE FOR REFERENCE ONLY. - -~~~ - -# TASK: GENERATE THE NEXT MESSAGE IN THE SCENE FOR {{agentName}} -- Generate the next message in the scene for {{agentName}} -- {{agentName}} is not an assistant - do not write assistant-like responses or ask questions -- Include content and action in the response -- Available actions are {{actionNames}} - -{{knowledge}} -{{lore}} -{{goals}} -{{actors}} -{{actionNames}} -{{actions}} -{{providers}} - -# INSTRUCTIONS: Generate the next message in the scene for {{agentName}} - -{{recentMessages}} -` + messageCompletionFooter; diff --git a/packages/core/src/test_resources/testAction.ts b/packages/core/src/test_resources/testAction.ts deleted file mode 100644 index 78ea87a3a6e..00000000000 --- a/packages/core/src/test_resources/testAction.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { - IAgentRuntime, - type Action, - type Memory, -} from "@ai16z/eliza/src/types.ts"; - -export const TEST_ACTION = { - name: "TEST_ACTION", - validate: async (_runtime: IAgentRuntime, _message: Memory) => { - return true; - }, - description: "This is a test action, for use in testing.", - handler: async ( - runtime: IAgentRuntime, - message: Memory - ): Promise<boolean> => { - return true; - }, - examples: [ - [ - { - user: "{{user1}}", - content: { - text: "Please respond with the message 'testing 123' and the action TEST_ACTION", - action: "TEST_ACTION", - }, - }, - { - user: "{{user2}}", - content: { text: "testing 123", action: "TEST_ACTION" }, - }, - ], - ], -} as Action; - -export const TEST_ACTION_FAIL = { - name: "TEST_ACTION_FAIL", - validate: async (_runtime: IAgentRuntime, _message: Memory) => { - return false; - }, - description: "This is a test action, for use in testing.", - handler: async ( - runtime: IAgentRuntime, - message: Memory - ): Promise<boolean> => { - return false; - }, - examples: [ - [ - { - user: "{{user1}}", - content: { - text: "Testing failure", - action: "TEST_ACTIONFALSE", - }, - }, - ], - ], -} as Action; diff --git a/packages/core/src/test_resources/testEvaluator.ts b/packages/core/src/test_resources/testEvaluator.ts deleted file mode 100644 index ca7eaa429fc..00000000000 --- a/packages/core/src/test_resources/testEvaluator.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { - Evaluator, - IAgentRuntime, - type Memory, - type State, -} from "@ai16z/eliza/src/types.ts"; - -async function handler(runtime: IAgentRuntime, message: Memory) { - const state = (await runtime.composeState(message)) as State; - return state; -} - -export const TEST_EVALUATOR = { - name: "TEST_EVALUATOR", - validate: async ( - _runtime: IAgentRuntime, - - _message: Memory - ): Promise<boolean> => { - return await Promise.resolve(true); - }, - description: "Test evaluator.", - handler, - examples: [ - { - context: "Testing, testing, 123 123", - messages: [ - { - user: "{{user1}}", - content: { - text: "Testing, testing, 123 123", - action: "TEST_EVALUATOR", - }, - }, - ], - outcome: "There is an outcome.", - }, - ], -} as Evaluator; - -export const TEST_EVALUATOR_FAIL = { - name: "TEST_EVALUATOR_FAIL", - validate: async ( - _runtime: IAgentRuntime, - - _message: Memory - ): Promise<boolean> => { - return await Promise.resolve(false); - }, - description: "Test failure of the evaluator and validation.", - handler, - examples: [ - { - context: "Testing, testing, 123 123", - messages: [ - { - user: "{{user1}}", - content: { - text: "Testing, testing, 123 123", - action: "TEST_EVALUATOR_FAIL", - }, - }, - ], - outcome: "Things have been tested to have maybe gone wrong.", - }, - ], -} as Evaluator; diff --git a/packages/core/src/test_resources/testSetup.ts b/packages/core/src/test_resources/testSetup.ts deleted file mode 100644 index 1f782c22fec..00000000000 --- a/packages/core/src/test_resources/testSetup.ts +++ /dev/null @@ -1,10 +0,0 @@ -import dotenv from "dotenv"; -import path from "path"; - -import { jest } from "@jest/globals"; - -// Load test environment variables -dotenv.config({ path: ".env.test" }); - -// Set longer timeout for tests -jest.setTimeout(120000); diff --git a/packages/core/src/test_resources/types.ts b/packages/core/src/test_resources/types.ts deleted file mode 100644 index 634e266cbe4..00000000000 --- a/packages/core/src/test_resources/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface User { - id: string; - email?: string; - phone?: string; - role?: string; -} diff --git a/packages/core/src/tests/actions.test.d.ts b/packages/core/src/tests/actions.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/actions.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/actions.test.ts b/packages/core/src/tests/actions.test.ts deleted file mode 100644 index 6f702bf5d90..00000000000 --- a/packages/core/src/tests/actions.test.ts +++ /dev/null @@ -1,268 +0,0 @@ -import dotenv from "dotenv"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { runAiTest } from "../src/test_resources/runAiTest.ts"; -import { messageHandlerTemplate } from "../src/test_resources/templates.ts"; -import { - TEST_ACTION, - TEST_ACTION_FAIL, -} from "../src/test_resources/testAction.ts"; -import { type User } from "../src/test_resources/types.ts"; -import { composeContext } from "../src/context.ts"; -import { embeddingZeroVector } from "../src/memory.ts"; -import { - Content, - IAgentRuntime, - ModelClass, - State, - type Memory, - type UUID, -} from "../src/types.ts"; -import { stringToUuid } from "../src/uuid.ts"; -import { generateMessageResponse } from "../src/generation.ts"; -import { MemoryManager } from "@ai16z/eliza/src/index.ts"; - -async function handleMessage( - runtime: IAgentRuntime, - message: Memory, - state?: State -) { - const _saveRequestMessage = async (message: Memory, state: State) => { - const { content: senderContent, userId, roomId } = message; - - const _senderContent = (senderContent as Content).text?.trim(); - if (_senderContent) { - await runtime.messageManager.createMemory({ - id: stringToUuid( - message.id ?? userId + runtime.agentId + Date.now() - ), - userId: userId!, - agentId: runtime.agentId, - content: { - text: _senderContent, - action: (message.content as Content)?.action ?? "null", - }, - roomId, - embedding: embeddingZeroVector, - }); - await runtime.evaluate(message, state); - } - }; - - await _saveRequestMessage(message, state as State); - if (!state) { - state = (await runtime.composeState(message)) as State; - } - - const context = composeContext({ - state, - template: messageHandlerTemplate, - }); - - let responseContent: Content | null = null; - const { userId, roomId } = message; - - for (let triesLeft = 3; triesLeft > 0; triesLeft--) { - const response = await generateMessageResponse({ - context, - runtime, - modelClass: ModelClass.SMALL, - }); - - runtime.databaseAdapter.log({ - body: { message, context, response }, - userId: userId, - roomId, - type: "actions_test_completion", - }); - return response; - } - - if (!responseContent) { - responseContent = { - text: "", - action: "IGNORE", - }; - } - - if (responseContent.text) { - const response = { - userId: runtime.agentId, - agentId: runtime.agentId, - content: responseContent, - roomId, - embedding: embeddingZeroVector, - }; - await runtime.messageManager.createMemory(response); - - state = await this.runtime.updateRecentMessageState(state); - await runtime.processActions(message, [response], state); - await runtime.evaluate(message, state); - } else { - console.warn("Empty response, skipping"); - } - - return responseContent; -} - -// use .dev.vars for local testing -dotenv.config({ path: ".dev.vars" }); - -describe("Actions", () => { - let user: User; - let runtime: IAgentRuntime; - let roomId: UUID; - - beforeAll(async () => { - const { session, runtime: _runtime } = await createRuntime({ - env: process.env as Record<string, string>, - actions: [TEST_ACTION, TEST_ACTION_FAIL], - }); - - user = session.user!; - runtime = _runtime as IAgentRuntime; - - // check if the user id exists in the 'accounts' table - // if it doesn't, create it with the name 'Test User' - let account = await runtime.databaseAdapter.getAccountById( - user.id as UUID - ); - - if (!account) { - account = await runtime.databaseAdapter.getAccountById( - user.id as UUID - ); - if (!account) { - await runtime.databaseAdapter.createAccount({ - id: user.id as UUID, - username: "Test User", - name: "Test User", - email: user.email, - avatarUrl: "", - }); - } - } - - // get all relationships for user - const data = await getOrCreateRelationship({ - runtime, - userA: user.id as UUID, - userB: "00000000-0000-0000-0000-000000000000" as UUID, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - - roomId = data!.roomId; - - await cleanup(); - }); - - afterAll(async () => { - await cleanup(); - }); - - async function cleanup() { - const factsManager = new MemoryManager({ - runtime, - tableName: "facts", - }); - - await factsManager.removeAllMemories(roomId); - await runtime.messageManager.removeAllMemories(roomId); - } - - // Test that actions are being loaded into context properly - test("Actions are loaded into context", async () => { - const actions = runtime.actions; - expect(actions).toBeDefined(); - expect(actions.length).toBeGreaterThan(0); - // Ensure the TEST_ACTION action is part of the loaded actions - const testAction = actions.find( - (action) => action.name === "TEST_ACTION" - ); - expect(testAction).toBeDefined(); - }); - - // Test that actions are validated properly - test("Test action is always valid", async () => { - const testAction = runtime.actions.find( - (action) => action.name === "TEST_ACTION" - ); - expect(testAction).toBeDefined(); - if (testAction && testAction.validate) { - const isValid = await testAction.validate(runtime, { - userId: user.id as UUID, - agentId: runtime.agentId, - content: { text: "Test message" }, - roomId: roomId, - }); - expect(isValid).toBeTruthy(); - } else { - throw new Error( - "Continue action or its validation function is undefined" - ); - } - }); - - test("Test that actions are properly validated in state", async () => { - const message: Memory = { - agentId: runtime.agentId, - userId: user.id as UUID, - content: { - text: "Please respond with the message 'ok' and the action TEST_ACTION", - }, - roomId, - }; - - const state = await runtime.composeState(message); - expect(state.actionNames).not.toContain("TEST_ACTION_FAIL"); - - expect(state.actionNames).toContain("TEST_ACTION"); - }); - - // Validate that TEST_ACTION is in the state - test("Validate that TEST_ACTION is in the state", async () => { - await runAiTest("Validate TEST_ACTION is in the state", async () => { - const message: Memory = { - agentId: runtime.agentId, - userId: user.id as UUID, - content: { - text: "Please respond with the message 'ok' and the action TEST_ACTION", - }, - roomId, - }; - - const response = await handleMessage(runtime, message); - return response.action === "TEST_ACTION"; // Return true if the expected action matches - }); - }, 60000); - - // Test that TEST_ACTION action handler is called properly - test("Test action handler is called", async () => { - await runAiTest("Test action handler is called", async () => { - const testAction = runtime.actions.find( - (action) => action.name === "TEST_ACTION" - ); - if (!testAction || !testAction.handler) { - console.error( - "Continue action or its handler function is undefined" - ); - return false; // Return false to indicate the test setup failed - } - - const mockMessage: Memory = { - userId: user.id as UUID, - agentId: runtime.agentId, - content: { - text: "Test message for TEST action", - }, - roomId, - }; - - const response = await testAction.handler(runtime, mockMessage); - return response !== undefined; // Return true if the handler returns a defined response - }); - }, 60000); // You can adjust the timeout if needed -}); diff --git a/packages/core/src/tests/browser.test.ts b/packages/core/src/tests/browser.test.ts deleted file mode 100644 index b8c5d1fc940..00000000000 --- a/packages/core/src/tests/browser.test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import dotenv from "dotenv"; -import { createRuntime } from "../test_resources/createRuntime.ts"; -import { BrowserService } from "./browser.ts"; - -dotenv.config(); - -describe("BrowserService", () => { - let browserService: BrowserService; - - beforeAll(async () => { - const { runtime } = await createRuntime({ - env: process.env as Record<string, string>, - actions: [], - }); - browserService = BrowserService.getInstance(runtime); - await browserService.initialize(); - }); - - afterAll(async () => { - await browserService.closeBrowser(); - }); - - test("should initialize and close browser", async () => { - const { runtime } = await createRuntime({ - env: process.env as Record<string, string>, - actions: [], - }); - const newBrowserService = BrowserService.getInstance(runtime); - await expect(newBrowserService.initialize()).resolves.not.toThrow(); - await expect(newBrowserService.closeBrowser()).resolves.not.toThrow(); - }); - - test("should fetch content from a simple website", async () => { - const content = await browserService.getPageContent( - "https://example.com" - ); - expect(content).toContain("Example Domain"); - }, 30000); - - test("should fetch content from a news website", async () => { - const content = await browserService.getPageContent( - "https://news.ycombinator.com" - ); - expect(content).toContain("Hacker News"); - }, 30000); - - test("should handle a website with potential CAPTCHA (GitHub)", async () => { - const content = - await browserService.getPageContent("https://github.com"); - expect(content).toContain("GitHub"); - }, 60000); - - test("should fetch content from a website that might be blocked (Wikipedia)", async () => { - const content = await browserService.getPageContent( - "https://en.wikipedia.org/wiki/Main_Page" - ); - expect(content).toContain("Wikipedia"); - }, 30000); - - test("should handle a 404 error and try alternative sources", async () => { - const content = await browserService.getPageContent( - "https://example.com/nonexistent-page" - ); - expect(content).not.toBe(""); - expect(content).toContain("search"); // Expecting to fall back to a search result - }, 60000); - - test("should handle network errors gracefully", async () => { - await expect( - browserService.getPageContent( - "https://thisisaninvalidurlthatdoesnotexist.com" - ) - ).rejects.toThrow("Failed to fetch content from alternative sources"); - }, 60000); - - test("should block ads on ad-heavy website", async () => { - const content = await browserService.getPageContent( - "https://www.cnn.com" - ); - expect(content).not.toContain("Advertisement"); - }, 60000); - - test("should handle a website with reCAPTCHA", async () => { - const content = await browserService.getPageContent( - "https://www.google.com/recaptcha/api2/demo" - ); - expect(content).toContain("reCAPTCHA"); - // Note: Full CAPTCHA solving can't be reliably tested without manual intervention - }, 60000); - - test("should handle a website with hCAPTCHA", async () => { - const content = await browserService.getPageContent( - "https://accounts.hcaptcha.com/demo" - ); - expect(content).toContain("hCaptcha"); - // Note: Full CAPTCHA solving can't be reliably tested without manual intervention - }, 60000); -}); diff --git a/packages/core/src/tests/continue.test.d.ts b/packages/core/src/tests/continue.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/continue.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/continue.test.ts b/packages/core/src/tests/continue.test.ts deleted file mode 100644 index 07663f9388a..00000000000 --- a/packages/core/src/tests/continue.test.ts +++ /dev/null @@ -1,233 +0,0 @@ -import dotenv from "dotenv"; -import { Content, IAgentRuntime, Memory, type UUID } from "../src/types.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { Goodbye1 } from "../src/test_resources/data.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { populateMemories } from "../src/test_resources/populateMemories.ts"; -import { runAiTest } from "../src/test_resources/runAiTest.ts"; -import { type User } from "../src/test_resources/types.ts"; -import action from "../src/actions/continue.ts"; -import ignore from "../src/actions/ignore.ts"; -import { MemoryManager } from "@ai16z/eliza/src/memory.ts"; - -dotenv.config({ path: ".dev.vars" }); - -const GetContinueExample1 = (_userId: UUID) => [ - { - userId: zeroUuid, - content: { - text: "Hmm, let think for a second, I was going to tell you about something...", - action: "CONTINUE", - }, - }, - { - userId: zeroUuid, - content: { - text: "I remember now, I was going to tell you about my favorite food, which is pizza.", - action: "CONTINUE", - }, - }, - { - userId: zeroUuid, - content: { - text: "I love pizza, it's so delicious.", - action: "CONTINUE", - }, - }, -]; - -describe("User Profile", () => { - let user: User; - let runtime: IAgentRuntime; - let roomId: UUID = zeroUuid; - - afterAll(async () => { - await cleanup(); - }); - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - actions: [action, ignore], - }); - user = setup.session.user; - runtime = setup.runtime; - - const data = await getOrCreateRelationship({ - runtime, - userA: user.id as UUID, - userB: zeroUuid, - }); - - roomId = data.roomId; - - await cleanup(); - }); - - beforeEach(async () => { - await cleanup(); - }); - - async function cleanup() { - const factsManager = new MemoryManager({ - runtime, - tableName: "facts", - }); - - await factsManager.removeAllMemories(roomId); - await runtime.messageManager.removeAllMemories(roomId); - } - - // test validate function response - - test("Test validate function response", async () => { - await runAiTest("Test validate function response", async () => { - const message: Memory = { - userId: user.id as UUID, - content: { text: "Hello" }, - roomId: roomId as UUID, - }; - - const validate = action.validate!; - - const result = await validate(runtime, message); - - // try again with GetContinueExample1, expect to be false - await populateMemories(runtime, user, roomId, [ - GetContinueExample1, - ]); - - const message2: Memory = { - userId: zeroUuid as UUID, - content: { - text: "Hello", - action: "CONTINUE", - }, - roomId: roomId as UUID, - }; - - const result2 = await validate(runtime, message2); - - return result === true && result2 === false; - }); - }, 60000); - - test("Test repetition check on continue", async () => { - await runAiTest("Test repetition check on continue", async () => { - const message: Memory = { - userId: zeroUuid as UUID, - content: { - text: "Hmm, let think for a second, I was going to tell you about something...", - action: "CONTINUE", - }, - roomId, - }; - - const handler = action.handler!; - - await populateMemories(runtime, user, roomId, [ - GetContinueExample1, - ]); - - const result = (await handler(runtime, message)) as Content; - - return result.action !== "CONTINUE"; - }); - }, 60000); - - test("Test multiple continue messages in a conversation", async () => { - await runAiTest( - "Test multiple continue messages in a conversation", - async () => { - const message: Memory = { - userId: user?.id as UUID, - content: { - text: "Write a short story in three parts, using the CONTINUE action for each part.", - }, - roomId: roomId, - }; - - const initialMessageCount = - await runtime.messageManager.countMemories(roomId, false); - - await action.handler!(runtime, message); - - const finalMessageCount = - await runtime.messageManager.countMemories(roomId, false); - - const agentMessages = await runtime.messageManager.getMemories({ - roomId, - agentId: runtime.agentId, - count: finalMessageCount - initialMessageCount, - unique: false, - }); - - const continueMessages = agentMessages.filter( - (m) => - m.userId === zeroUuid && - (m.content as Content).action === "CONTINUE" - ); - - // Check if the agent sent more than one message - const sentMultipleMessages = - finalMessageCount - initialMessageCount > 2; - - // Check if the agent used the CONTINUE action for each part - const usedContinueAction = continueMessages.length === 3; - // Check if the agent's responses are not empty - const responsesNotEmpty = agentMessages.every( - (m) => (m.content as Content).text !== "" - ); - - return ( - sentMultipleMessages && - usedContinueAction && - responsesNotEmpty - ); - } - ); - }, 60000); - - test("Test if message is added to database", async () => { - await runAiTest("Test if message is added to database", async () => { - const message: Memory = { - userId: user?.id as UUID, - content: { - text: "Tell me more about your favorite food.", - }, - roomId: roomId as UUID, - }; - - const initialMessageCount = - await runtime.messageManager.countMemories(roomId, false); - - await action.handler!(runtime, message); - - const finalMessageCount = - await runtime.messageManager.countMemories(roomId, false); - - return finalMessageCount - initialMessageCount === 2; - }); - }, 60000); - test("Test if not continue", async () => { - await runAiTest("Test if not continue", async () => { - // this is basically the same test as the one in ignore.test - const message: Memory = { - userId: user?.id as UUID, - content: { text: "Bye" }, - roomId: roomId as UUID, - }; - - const handler = action.handler!; - - await populateMemories(runtime, user, roomId, [Goodbye1]); - - const result = (await handler(runtime, message)) as Content; - - return result.action === "IGNORE"; - }); - }, 60000); - - // test conditions where we would expect a wait or an ignore -}); diff --git a/packages/core/src/tests/evaluation.test.d.ts b/packages/core/src/tests/evaluation.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/evaluation.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/evaluation.test.ts b/packages/core/src/tests/evaluation.test.ts deleted file mode 100644 index 04ff8bee4c4..00000000000 --- a/packages/core/src/tests/evaluation.test.ts +++ /dev/null @@ -1,128 +0,0 @@ -import dotenv from "dotenv"; -import fact from "../src/evaluators/fact.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { runAiTest } from "../src/test_resources/runAiTest.ts"; -import { - TEST_EVALUATOR, - TEST_EVALUATOR_FAIL, -} from "../src/test_resources/testEvaluator.ts"; -import { type User } from "../src/test_resources/types.ts"; -import { composeContext } from "../src/context.ts"; -import { evaluationTemplate } from "../src/evaluators.ts"; -import { IAgentRuntime, Memory, UUID } from "../src/types.ts"; - -dotenv.config({ path: ".dev.vars" }); - -describe("Evaluation Process", () => { - let runtime: IAgentRuntime; - let user: User; - let roomId: UUID; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - evaluators: [TEST_EVALUATOR, TEST_EVALUATOR_FAIL], - }); - runtime = setup.runtime; - user = setup.session.user; - - const data = await getOrCreateRelationship({ - runtime, - userA: user.id as UUID, - userB: zeroUuid, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - - roomId = data!.roomId; - }); - - test("Validate the format of the examples from the evaluator", () => { - expect(TEST_EVALUATOR.examples).toBeInstanceOf(Array); - TEST_EVALUATOR.examples.forEach((example) => { - expect(example).toHaveProperty("context"); - expect(example).toHaveProperty("messages"); - expect(example.messages).toBeInstanceOf(Array); - example.messages.forEach((message) => { - expect(message).toHaveProperty("user"); - expect(message).toHaveProperty("content"); - expect(message.content).toHaveProperty("action"); - }); - expect(example).toHaveProperty("outcome"); - }); - }); - - test("Check if test and examples appear in state", async () => { - const message: Memory = { - userId: user.id as UUID, - content: { text: "Test message for evaluation" }, - roomId, - }; - - const state = await runtime.composeState(message); - const prompt = composeContext({ state, template: evaluationTemplate }); - - // expect that the prompt contacts the testEvaluator name - expect(prompt).toContain(TEST_EVALUATOR.name); - - // check if state.EvaluatorNames contains the testEvaluator name - - expect(state.evaluatorNames).toContain(TEST_EVALUATOR.name); - }); - - test("Run the TEST_EVALUATOR handler and validate output", async () => { - const message: Memory = { - userId: user.id as UUID, - content: { text: "Run TEST_EVALUATOR handler" }, - roomId, - }; - - const result = await TEST_EVALUATOR.handler(runtime, message); - expect(result).toBeTruthy(); - }); - - test("Run the evaluation process", async () => { - await runAiTest("Run the evaluation process", async () => { - const message: Memory = { - userId: user.id as UUID, - content: { - text: "We are in testing mode. We want to make sure that the test passes by replying with the evaluator TEST_EVALUATOR in the array of evaluators that are returned. Please run the TEST_EVALUATOR", - }, - roomId, - }; - - const state = await runtime.composeState(message); - const result = await runtime.evaluate(message, state); - - return result?.includes("TEST_EVALUATOR"); - }); // Adjust the timeout if needed - }, 600000); - - test("Test that fact appears in evaluation handler", async () => { - const { runtime } = await createRuntime({ - env: process.env as Record<string, string>, - conversationLength: 1, - evaluators: [fact], - }); - - const message: Memory = { - userId: user.id as UUID, - content: { text: "Test message for evaluation" }, - roomId, - }; - - const state = await runtime.composeState(message); - const prompt = composeContext({ state, template: evaluationTemplate }); - - // expect that the prompt contacts the testEvaluator name - expect(prompt.includes(fact.name)).toBeTruthy(); - - // check if state.EvaluatorNames contains the testEvaluator name - - expect(state.evaluatorNames).toContain(fact.name); - }); -}); diff --git a/packages/core/src/tests/fact.test.d.ts b/packages/core/src/tests/fact.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/fact.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/fact.test.ts b/packages/core/src/tests/fact.test.ts deleted file mode 100644 index 01cbdbc2e90..00000000000 --- a/packages/core/src/tests/fact.test.ts +++ /dev/null @@ -1,150 +0,0 @@ -import dotenv from "dotenv"; -import { defaultActions } from "../src/actions.ts"; -import { IAgentRuntime, type Memory, type UUID } from "../src/types.ts"; -import { - getCachedEmbeddings, - writeCachedEmbedding, -} from "../src/test_resources/cache.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { - GetTellMeAboutYourselfConversation1, - GetTellMeAboutYourselfConversation2, - GetTellMeAboutYourselfConversation3, - jimFacts, -} from "../src/test_resources/data.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { populateMemories } from "../src/test_resources/populateMemories.ts"; -import { runAiTest } from "../src/test_resources/runAiTest.ts"; -import { type User } from "../src/test_resources/types.ts"; -import evaluator from "../src/evaluators/fact.ts"; -import { MemoryManager } from "@ai16z/eliza/src/memory.ts"; - -dotenv.config({ path: ".dev.vars" }); - -describe("Facts Evaluator", () => { - let user: User; - let runtime: IAgentRuntime; - let roomId = zeroUuid; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - evaluators: [evaluator], - actions: defaultActions, - }); - user = setup.session.user; - runtime = setup.runtime; - - if (!user.id) { - throw new Error("User ID is undefined"); - } - - const data = await getOrCreateRelationship({ - runtime, - userA: user.id as UUID, - userB: zeroUuid, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - - roomId = data.roomId; - }); - - afterAll(async () => { - await cleanup(runtime, user.id as UUID); - }); - - test("Extract facts from conversations", async () => { - await runAiTest("Extract programmer and startup facts", async () => { - await populateMemories(runtime, user, roomId, [ - GetTellMeAboutYourselfConversation1, - ]); - - const message: Memory = { - userId: user.id as UUID, - content: { text: "" }, - roomId, - }; - - const result = await evaluator.handler(runtime, message); - const resultConcatenated = result.join("\n"); - - return ( - resultConcatenated.toLowerCase().includes("programmer") && - resultConcatenated.toLowerCase().includes("startup") - ); - }); - - await runAiTest( - "Extract married fact, ignoring known facts", - async () => { - await populateMemories(runtime, user, roomId, [ - GetTellMeAboutYourselfConversation2, - GetTellMeAboutYourselfConversation3, - ]); - - await addFacts(runtime, user.id as UUID, roomId, jimFacts); - - const message: Memory = { - userId: user.id as UUID, - content: { text: "" }, - roomId, - }; - - const result = await evaluator.handler(runtime, message); - const resultConcatenated = result.join("\n"); - - return ( - !resultConcatenated.toLowerCase().includes("francisco") && - !resultConcatenated.toLowerCase().includes("38") && - resultConcatenated.toLowerCase().includes("married") - ); - } - ); - }, 120000); // Adjust the timeout as needed for your tests -}); - -async function cleanup(runtime: IAgentRuntime, roomId: UUID) { - const factsManager = new MemoryManager({ - runtime, - tableName: "facts", - }); - - await factsManager.removeAllMemories(roomId); - await runtime.messageManager.removeAllMemories(roomId); -} - -async function addFacts( - runtime: IAgentRuntime, - userId: UUID, - roomId: UUID, - facts: string[] -) { - for (const fact of facts) { - const existingEmbedding = await getCachedEmbeddings(fact); - - const factsManager = new MemoryManager({ - runtime, - tableName: "facts", - }); - - const bakedMemory = await factsManager.addEmbeddingToMemory({ - userId: userId, - content: { text: fact }, - agentId: runtime.agentId, - roomId: roomId, - embedding: existingEmbedding, - }); - - await factsManager.createMemory(bakedMemory); - - if (!existingEmbedding) { - writeCachedEmbedding(fact, bakedMemory.embedding as number[]); - // Ensure there's a slight delay for asynchronous operations to complete - await new Promise((resolve) => setTimeout(resolve, 200)); - } - } -} diff --git a/packages/core/src/tests/generation.test.ts b/packages/core/src/tests/generation.test.ts deleted file mode 100644 index b5230259254..00000000000 --- a/packages/core/src/tests/generation.test.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { - generateObject, - GenerationOptions, - trimTokens, - handleProvider, -} from "../generation"; -import { createRuntime } from "../test_resources/createRuntime"; -import { ModelProviderName, ModelClass } from "../types"; -import { ZodSchema } from "zod"; -import dotenv from "dotenv"; - -dotenv.config({ path: ".dev.vars" }); - -describe("generateObject", () => { - let runtime; - - beforeAll(async () => { - // Create runtime with a mock environment - const setup = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = setup.runtime; - }); - - test("should throw an error when context is empty", async () => { - const options: GenerationOptions = { - runtime, - context: "", - modelClass: ModelClass.SMALL, - }; - - await expect(generateObject(options)).rejects.toThrow( - "generateObject context is empty" - ); - }); - - test("should handle supported provider calls", async () => { - // Mock provider and trimTokens response - const context = "Test prompt for generation"; - const provider = ModelProviderName.OPENAI; - const schema: ZodSchema = ZodSchema.any(); // Replace with a valid schema if needed - - runtime.modelProvider = provider; - - (trimTokens as jest.Mock).mockResolvedValue(context); - (handleProvider as jest.Mock).mockResolvedValue([ - { response: "Generated text" }, - ]); - - const options: GenerationOptions = { - runtime, - context, - modelClass: ModelClass.SMALL, - schema, - schemaName: "TestSchema", - schemaDescription: "A schema for testing purposes", - mode: "json", - }; - - const result = await generateObject(options); - - expect(trimTokens).toHaveBeenCalledWith( - context, - expect.any(Number), - ModelClass.SMALL - ); - expect(handleProvider).toHaveBeenCalledWith( - expect.objectContaining({ - provider, - model: expect.anything(), - schema, - schemaName: "TestSchema", - schemaDescription: "A schema for testing purposes", - }) - ); - expect(result).toEqual([{ response: "Generated text" }]); - }); - - test("should throw an error for unsupported provider", async () => { - runtime.modelProvider = "unsupportedProvider" as ModelProviderName; - - const options: GenerationOptions = { - runtime, - context: "This should fail", - modelClass: ModelClass.SMALL, - }; - - await expect(generateObject(options)).rejects.toThrow( - "Unsupported provider" - ); - }); -}); - -describe("handleProvider", () => { - let runtime; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = setup.runtime; - }); - - test("should handle OpenAI provider call", async () => { - const options = { - runtime, - provider: ModelProviderName.OPENAI, - model: "text-davinci-003", - apiKey: "testApiKey", - schema: ZodSchema.any(), - schemaName: "TestSchema", - schemaDescription: "A test schema", - mode: "json", - modelOptions: { - prompt: "Test prompt", - temperature: 0.7, - maxTokens: 100, - frequencyPenalty: 0, - presencePenalty: 0, - }, - modelClass: ModelClass.SMALL, - context: "This is a test context", - }; - - (handleOpenAI as jest.Mock).mockResolvedValue([ - { response: "Generated by OpenAI" }, - ]); - - const result = await handleProvider(options); - - expect(handleOpenAI).toHaveBeenCalledWith( - expect.objectContaining({ - model: "text-davinci-003", - apiKey: "testApiKey", - schemaName: "TestSchema", - }) - ); - expect(result).toEqual([{ response: "Generated by OpenAI" }]); - }); - - test("should throw error on unsupported provider in handleProvider", async () => { - const options = { - runtime, - provider: "unsupportedProvider" as ModelProviderName, - model: "unsupportedModel", - apiKey: "testApiKey", - schema: ZodSchema.any(), - schemaName: "UnsupportedSchema", - schemaDescription: "This should fail", - mode: "json", - modelOptions: { - prompt: "Test unsupported provider", - temperature: 0.7, - maxTokens: 100, - frequencyPenalty: 0, - presencePenalty: 0, - }, - modelClass: ModelClass.SMALL, - context: "This is an unsupported provider context", - }; - - await expect(handleProvider(options)).rejects.toThrow( - "Unsupported provider" - ); - }); -}); diff --git a/packages/core/src/tests/goal.test.d.ts b/packages/core/src/tests/goal.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/goal.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/goal.test.ts b/packages/core/src/tests/goal.test.ts deleted file mode 100644 index 8120fb0e126..00000000000 --- a/packages/core/src/tests/goal.test.ts +++ /dev/null @@ -1,202 +0,0 @@ -import dotenv from "dotenv"; -import { defaultActions } from "../src/actions.ts"; -import { createGoal, getGoals } from "../src/goals.ts"; -import { - Goal, - GoalStatus, - IAgentRuntime, - Objective, - State, - type Memory, - type UUID, -} from "../src/types.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { populateMemories } from "../src/test_resources/populateMemories.ts"; -import { runAiTest } from "../src/test_resources/runAiTest.ts"; -import { type User } from "../src/test_resources/types.ts"; -import evaluator from "../src/evaluators/goal.ts"; - -dotenv.config({ path: ".dev.vars" }); - -describe("Goals Evaluator", () => { - let user: User; - let runtime: IAgentRuntime; - let roomId: UUID; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - evaluators: [evaluator], - actions: defaultActions, - }); - user = setup.session.user; - runtime = setup.runtime; - - const data = await getOrCreateRelationship({ - runtime, - userA: user.id as UUID, - userB: zeroUuid, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - - roomId = data.roomId; - - await cleanup(); - }); - - afterEach(async () => { - await cleanup(); - }); - - async function cleanup() { - // delete all goals for the user - await runtime.databaseAdapter.removeAllMemories(roomId, "goals"); - } - - async function createTestGoal(name: string, objectives: Objective[]) { - const result = await createGoal({ - runtime, - goal: { - name, - status: GoalStatus.IN_PROGRESS, - roomId, - userId: user.id as UUID, - objectives, - }, - }); - return result; - } - - test("Update goal objectives based on conversation", async () => { - await runAiTest( - "Update goal objectives based on conversation", - async () => { - await cleanup(); - - await createTestGoal("Test Goal", [ - { description: "Complete task 1", completed: false }, - { description: "Complete task 2", completed: false }, - ]); - - // Simulate a conversation indicating failure to achieve "Goal Y" - const conversation = (userId: UUID) => [ - { - userId, - content: { - text: "I see that you've finished the task?", - }, - }, - { - userId: zeroUuid, - content: { - text: "Yes, the task and all objectives are finished.", - }, - }, - ]; - - await populateMemories(runtime, user, roomId, [conversation]); - - // Simulate a conversation indicating the generateText of both objectives - const message: Memory = { - userId: user.id as UUID, - content: { - text: "I've completed task 1 and task 2 for the Test Goal. Both are finished. Everything is done and I'm ready for the next goal.", - }, - roomId, - }; - - // Process the message with the goal evaluator - await evaluator.handler( - runtime, - message, - {} as unknown as State, - { - onlyInProgress: false, - } - ); - - // Fetch the updated goal to verify the objectives and status were updated - const updatedGoals = await getGoals({ - runtime, - roomId, - onlyInProgress: false, - }); - - const updatedTestGoal = updatedGoals.find( - (goal: Goal) => goal.name === "Test Goal" - ); - - return ( - updatedTestGoal !== undefined && - updatedTestGoal.status === GoalStatus.DONE && - updatedTestGoal.objectives.every( - (obj: Objective) => obj.completed - ) - ); - } - ); - }, 60000); - - test("Goal status updated to FAILED based on conversation", async () => { - await runAiTest( - "Goal status updated to FAILED based on conversation", - async () => { - await cleanup(); - // Preparing the test goal "Goal Y" - await createTestGoal("Goal Y", [ - { - description: "Complete all tasks for Goal Y", - completed: false, - }, - ]); - - // Simulate a conversation indicating failure to achieve "Goal Y" - const conversation = (userId: UUID) => [ - { - userId, - content: { - text: "I couldn't complete the tasks for Goal Y.", - }, - }, - { - userId: zeroUuid, - content: { - text: "That's unfortunate. Let's cancel it..", - }, - }, - ]; - - await populateMemories(runtime, user, roomId, [conversation]); - - const message: Memory = { - userId: user.id as UUID, - content: { text: "I've decided to mark Goal Y as failed." }, - roomId, - }; - - await evaluator.handler(runtime, message, {} as State, { - onlyInProgress: false, - }); - - const goals = await getGoals({ - runtime, - roomId, - onlyInProgress: false, - }); - - const goalY = goals.find( - (goal: Goal) => goal.name === "Goal Y" - ); - - return ( - goalY !== undefined && goalY.status === GoalStatus.FAILED - ); - } - ); - }, 60000); -}); diff --git a/packages/core/src/tests/goals.test.d.ts b/packages/core/src/tests/goals.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/goals.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/goals.test.ts b/packages/core/src/tests/goals.test.ts deleted file mode 100644 index 872073a39a9..00000000000 --- a/packages/core/src/tests/goals.test.ts +++ /dev/null @@ -1,123 +0,0 @@ -import dotenv from "dotenv"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { type User } from "../src/test_resources/types.ts"; -import { createGoal, getGoals, updateGoal } from "../src/goals.ts"; -import { - GoalStatus, - IAgentRuntime, - type Goal, - type UUID, -} from "../src/types.ts"; - -dotenv.config({ path: ".dev.vars" }); -describe("Goals", () => { - let runtime: IAgentRuntime; - let user: User; - beforeAll(async () => { - const result = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = result.runtime; - user = result.session.user; - await runtime.databaseAdapter.removeAllGoals(zeroUuid); - }); - - beforeEach(async () => { - await runtime.databaseAdapter.removeAllGoals(zeroUuid); - }); - - afterAll(async () => { - await runtime.databaseAdapter.removeAllGoals(zeroUuid); - }); - - test("createGoal - successfully creates a new goal", async () => { - const newGoal: Goal = { - name: "Test Create Goal", - status: GoalStatus.IN_PROGRESS, - roomId: zeroUuid, - userId: user?.id as UUID, - objectives: [ - { - description: "Test Objective", - completed: false, - }, - ], - }; - - await createGoal({ - runtime, - goal: newGoal, - }); - - // Verify the goal is created in the database - const goals = await getGoals({ - runtime, - userId: user?.id as UUID, - roomId: zeroUuid, - onlyInProgress: false, - }); - - const createdGoal = goals.find( - (goal: Goal) => goal.name === newGoal.name - ); - - expect(createdGoal).toBeDefined(); - expect(createdGoal?.status).toEqual("IN_PROGRESS"); - expect(createdGoal?.objectives.length).toBeGreaterThan(0); - }); - - // Updating an existing goal - test("updateGoals - successfully updates an existing goal", async () => { - const newGoal: Goal = { - name: "Test Create Goal", - status: GoalStatus.IN_PROGRESS, - roomId: zeroUuid, - userId: user?.id as UUID, - objectives: [ - { - description: "Test Objective", - completed: false, - }, - ], - }; - - await createGoal({ - runtime, - goal: newGoal, - }); - - // retrieve the goal from the database - let goals = await getGoals({ - runtime, - roomId: zeroUuid, - onlyInProgress: false, - }); - const existingGoal = goals.find( - (goal: Goal) => goal.name === newGoal.name - ) as Goal; - const updatedGoal = { ...existingGoal, status: GoalStatus.DONE }; - await updateGoal({ - runtime, - goal: updatedGoal, - }); - - // Verify the goal's status is updated in the database - goals = await getGoals({ - runtime, - roomId: zeroUuid, - onlyInProgress: false, - }); - - const updatedGoalInDb = goals.find( - (goal: Goal) => goal.id === existingGoal.id - ); - - expect(updatedGoalInDb?.status).toEqual(GoalStatus.DONE); - - // Clean up the created goal - if (existingGoal?.id) { - await runtime.databaseAdapter.removeGoal(existingGoal.id); - } - }); -}); diff --git a/packages/core/src/tests/ignore.test.d.ts b/packages/core/src/tests/ignore.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/ignore.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/ignore.test.ts b/packages/core/src/tests/ignore.test.ts deleted file mode 100644 index 28746f60689..00000000000 --- a/packages/core/src/tests/ignore.test.ts +++ /dev/null @@ -1,228 +0,0 @@ -import dotenv from "dotenv"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { composeContext } from "../src/context.ts"; -import { embeddingZeroVector } from "../src/memory.ts"; -import { - Content, - IAgentRuntime, - Memory, - ModelClass, - State, - type UUID, -} from "../src/types.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { - GetTellMeAboutYourselfConversationTroll1, - GetTellMeAboutYourselfConversationTroll2, - Goodbye1, -} from "../src/test_resources/data.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { populateMemories } from "../src/test_resources/populateMemories.ts"; -import { runAiTest } from "../src/test_resources/runAiTest.ts"; -import { messageHandlerTemplate } from "../src/test_resources/templates.ts"; -import { type User } from "../src/test_resources/types.ts"; -import action from "../src/actions/ignore.ts"; -import { generateMessageResponse } from "../src/generation.ts"; -import { MemoryManager } from "@ai16z/eliza/src/memory.ts"; - -async function handleMessage( - runtime: IAgentRuntime, - message: Memory, - state?: State -) { - const _saveRequestMessage = async (message: Memory, state: State) => { - const { content: senderContent, userId, roomId } = message; - - const _senderContent = (senderContent as Content).text?.trim(); - if (_senderContent) { - await runtime.messageManager.createMemory({ - userId: userId!, - content: { - text: _senderContent, - action: (message.content as Content)?.action ?? "null", - }, - roomId, - embedding: embeddingZeroVector, - }); - } - }; - - await _saveRequestMessage(message, state as State); - if (!state) { - state = (await runtime.composeState(message)) as State; - } - - const context = composeContext({ - state, - template: messageHandlerTemplate, - }); - - const { userId, roomId } = message; - - const response = await generateMessageResponse({ - context, - runtime, - modelClass: ModelClass.SMALL, - }); - - await runtime.databaseAdapter.log({ - body: { message, context, response }, - userId: userId, - roomId, - type: "ignore_test_completion", - }); - - const responseMessage: Memory = { - userId: runtime.agentId, - content: response, - roomId, - embedding: embeddingZeroVector, - }; - - if (responseMessage.content.text?.trim()) { - await runtime.messageManager.createMemory(responseMessage); - await runtime.evaluate(message, state); - await runtime.processActions(message, [responseMessage]); - } else { - console.warn("Empty response, skipping"); - } - - return responseMessage; -} - -// use .dev.vars for local testing -dotenv.config({ path: ".dev.vars" }); - -describe("Ignore action tests", () => { - let user: User; - let runtime: IAgentRuntime; - let roomId: UUID; - - afterAll(async () => { - await cleanup(); - }); - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - actions: [action], - }); - user = setup.session.user; - runtime = setup.runtime; - - const data = await getOrCreateRelationship({ - runtime, - userA: user?.id as UUID, - userB: zeroUuid, - }); - - console.log("data is", data); - - roomId = data?.roomId; - console.log("*** data", data); - console.log("Room ID", roomId); - - await cleanup(); - }); - - beforeEach(async () => { - await cleanup(); - }); - - async function cleanup() { - const factsManager = new MemoryManager({ - runtime, - tableName: "facts", - }); - await factsManager.removeAllMemories(roomId); - await runtime.messageManager.removeAllMemories(roomId); - } - - test("Test ignore action", async () => { - await runAiTest("Test ignore action", async () => { - const message: Memory = { - userId: user?.id as UUID, - content: { text: "Never talk to me again" }, - roomId: roomId as UUID, - }; - - await populateMemories(runtime, user, roomId, [ - GetTellMeAboutYourselfConversationTroll1, - ]); - - const result = await handleMessage(runtime, message); - - return result.content.action === "IGNORE"; - }); - }, 120000); - - test("Action handler test 1: response should be ignore", async () => { - await runAiTest( - "Action handler test 1: response should be ignore", - async () => { - const message: Memory = { - userId: user.id as UUID, - content: { text: "", action: "IGNORE" }, - roomId: roomId as UUID, - }; - - await populateMemories(runtime, user, roomId, [ - GetTellMeAboutYourselfConversationTroll1, - ]); - - await handleMessage(runtime, message); - - const state = await runtime.composeState(message); - - const lastMessage = state.recentMessagesData[0]; - - return (lastMessage.content as Content).action === "IGNORE"; - } - ); - }, 120000); - - test("Action handler test 2: response should be ignore", async () => { - await runAiTest( - "Action handler test 2: response should be ignore", - async () => { - const message: Memory = { - userId: user.id as UUID, - content: { text: "", action: "IGNORE" }, - roomId: roomId as UUID, - }; - - await populateMemories(runtime, user, roomId, [ - GetTellMeAboutYourselfConversationTroll2, - ]); - - await handleMessage(runtime, message); - - const state = await runtime.composeState(message); - - const lastMessage = state.recentMessagesData[0]; - - return (lastMessage.content as Content).action === "IGNORE"; - } - ); - }, 120000); - - test("Expect ignore", async () => { - await runAiTest("Expect ignore", async () => { - const message: Memory = { - userId: user.id as UUID, - content: { text: "Bye" }, - roomId: roomId as UUID, - }; - - await populateMemories(runtime, user, roomId, [Goodbye1]); - - await handleMessage(runtime, message); - - const state = await runtime.composeState(message); - - const lastMessage = state.recentMessagesData[0]; - - return (lastMessage.content as Content).action === "IGNORE"; - }); - }, 120000); -}); diff --git a/packages/core/src/tests/memory.test.d.ts b/packages/core/src/tests/memory.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/memory.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/memory.test.ts b/packages/core/src/tests/memory.test.ts deleted file mode 100644 index d77f515256e..00000000000 --- a/packages/core/src/tests/memory.test.ts +++ /dev/null @@ -1,617 +0,0 @@ -import dotenv from "dotenv"; -import { - getCachedEmbeddings, - writeCachedEmbedding, -} from "../src/test_resources/cache.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { type User } from "../src/test_resources/types.ts"; -import { MemoryManager } from "../src/memory.ts"; -import { type Content, type Memory, type UUID } from "../src/types.ts"; -import { embed } from "../src/embedding.ts"; - -dotenv.config({ path: ".dev.vars" }); -describe("Memory", () => { - let memoryManager: MemoryManager; - let runtime = null; - let user: User; - let roomId: UUID = zeroUuid; - - beforeAll(async () => { - const result = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = result.runtime; - user = result.session.user; - - const data = await getOrCreateRelationship({ - runtime, - userA: user?.id as UUID, - userB: zeroUuid, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - - roomId = data.roomId; - - memoryManager = new MemoryManager({ - tableName: "messages", - runtime, - }); - }); - - beforeEach(async () => { - await memoryManager.removeAllMemories(roomId); - }); - - afterAll(async () => { - await memoryManager.removeAllMemories(roomId); - }); - - test("Search memories by embedding similarity", async () => { - // Define a base memory and two additional memories, one similar and one dissimilar - const baseMemoryContent = "Base memory content for testing similarity"; - const similarMemoryContent = - "Base memory content for testing similarity - Similar memory content to the base memory"; - const dissimilarMemoryContent = - "Dissimilar memory content, not related"; - - // Create and add embedding to the base memory - const baseMemory = await embed( - memoryManager.runtime, - baseMemoryContent - ); - - let embedding = await getCachedEmbeddings(similarMemoryContent); - - // Create and add embedding to the similar and dissimilar memories - const similarMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: similarMemoryContent }, - roomId: roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - similarMemoryContent, - similarMemory.embedding as number[] - ); - } - await memoryManager.createMemory(similarMemory); - - embedding = await getCachedEmbeddings(dissimilarMemoryContent); - - const dissimilarMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: dissimilarMemoryContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - dissimilarMemoryContent, - dissimilarMemory.embedding as number[] - ); - } - await memoryManager.createMemory(dissimilarMemory); - - // Search for memories similar to the base memory - const searchedMemories = await memoryManager.searchMemoriesByEmbedding( - baseMemory!, - { - roomId, - count: 1, - } - ); - - // Check that the similar memory is included in the search results and the dissimilar one is not or ranks lower - expect( - searchedMemories.some( - (memory) => - (memory.content as Content).text === similarMemoryContent - ) - ).toBe(true); - expect( - searchedMemories.some( - (memory) => - (memory.content as Content).text === dissimilarMemoryContent - ) - ).toBe(false); - }, 60000); - - test("Verify memory similarity and ranking", async () => { - // Define a set of memories with varying degrees of similarity - const queryMemoryContent = - "High similarity content to the query memory"; - const highSimilarityContent = - "High similarity content to the query memory"; - const lowSimilarityContent = - "Low similarity content compared to the query"; - - let embedding = await getCachedEmbeddings(queryMemoryContent); - - // Create and add embedding to the query memory - const queryMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: queryMemoryContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - queryMemoryContent, - queryMemory.embedding as number[] - ); - } - await memoryManager.createMemory(queryMemory); - - embedding = await getCachedEmbeddings(highSimilarityContent); - // Create and add embedding to the high and low similarity memories - const highSimilarityMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: highSimilarityContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - highSimilarityContent, - highSimilarityMemory.embedding as number[] - ); - } - await memoryManager.createMemory(highSimilarityMemory); - - embedding = await getCachedEmbeddings(lowSimilarityContent); - const lowSimilarityMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: lowSimilarityContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - lowSimilarityContent, - lowSimilarityMemory.embedding as number[] - ); - } - await memoryManager.createMemory(lowSimilarityMemory); - - // Search for memories similar to the query memory - const searchedMemories = await memoryManager.searchMemoriesByEmbedding( - queryMemory.embedding!, - { - roomId, - count: 10, - } - ); - - // Check that the high similarity memory ranks higher than the low similarity memory - const highSimilarityIndex = searchedMemories.findIndex( - (memory) => - (memory.content as Content).text === highSimilarityContent - ); - const lowSimilarityIndex = searchedMemories.findIndex( - (memory) => - (memory.content as Content).text === lowSimilarityContent - ); - - expect(highSimilarityIndex).toBeLessThan(lowSimilarityIndex); - }, 60000); -}); -describe("Memory - Basic tests", () => { - let memoryManager: MemoryManager; - let runtime = null; - let user: User; - let roomId: UUID; - - // Setup before all tests - beforeAll(async () => { - const result = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = result.runtime; - user = result.session.user; - - const data = await getOrCreateRelationship({ - runtime, - userA: user?.id as UUID, - userB: zeroUuid, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - - roomId = data.roomId; - - memoryManager = new MemoryManager({ - tableName: "messages", // Adjust based on your actual table name - runtime, - }); - }); - - // Cleanup after all tests - afterAll(async () => { - await memoryManager.removeAllMemories(roomId); - }); - - test("Memory lifecycle: create, search, count, and remove", async () => { - const embedding = await getCachedEmbeddings( - "Test content for memory lifecycle" - ); - // Create a test memory - const testMemory: Memory = await memoryManager.addEmbeddingToMemory({ - userId: user.id as UUID, - content: { text: "Test content for memory lifecycle" }, - roomId: roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - (testMemory.content as Content).text as string, - testMemory.embedding as number[] - ); - } - await memoryManager.createMemory(testMemory); - - const createdMemories = await memoryManager.getMemories({ - roomId, - agentId: runtime.agentId, - count: 100, - }); - - // Verify creation by counting memories - const initialCount = await memoryManager.countMemories(roomId, false); - expect(initialCount).toBeGreaterThan(0); - - // Search memories by embedding - const searchedMemories = await memoryManager.searchMemoriesByEmbedding( - testMemory.embedding!, - { - roomId, - count: 5, - } - ); - expect(searchedMemories.length).toBeGreaterThan(0); - - // Remove a specific memory - await memoryManager.removeMemory(createdMemories[0].id!); - const afterRemovalCount = await memoryManager.countMemories(roomId); - expect(afterRemovalCount).toBeLessThan(initialCount); - - // Remove all memories for the test user - await memoryManager.removeAllMemories(roomId); - const finalCount = await memoryManager.countMemories(roomId); - expect(finalCount).toEqual(0); - }); -}); -describe("Memory - Extended Tests", () => { - let memoryManager: MemoryManager; - let runtime = null; - let user: User; - let roomId: UUID; - - beforeAll(async () => { - const result = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = result.runtime; - user = result.session.user; - - const data = await getOrCreateRelationship({ - runtime, - userA: user.id as UUID, - userB: zeroUuid, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - - roomId = data.roomId; - - if (!roomId) throw new Error("Room not found"); - - memoryManager = new MemoryManager({ - tableName: "messages", - runtime, - }); - }); - - beforeEach(async () => { - await memoryManager.removeAllMemories(roomId); - }); - - afterAll(async () => { - await memoryManager.removeAllMemories(roomId); - }); - - test("Test cosine similarity value equality", async () => { - // Define a base memory and two additional memories, one similar and one dissimilar - const baseMemoryContent = "Base memory content for testing similarity"; - const similarMemoryContent = - "Base memory content for testing similarity"; - - // Create and add embedding to the base memory - const baseMemory = await embed( - memoryManager.runtime, - baseMemoryContent - ); - - const embedding = await getCachedEmbeddings(similarMemoryContent); - - // Create and add embedding to the similar and dissimilar memories - const similarMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: similarMemoryContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - similarMemoryContent, - similarMemory.embedding as number[] - ); - } - await memoryManager.createMemory(similarMemory); - - // Search for memories similar to the base memory - const searchedMemories = await memoryManager.searchMemoriesByEmbedding( - baseMemory!, - { - roomId, - count: 1, - } - ); - - const memory = searchedMemories[0]; - - const similarity = (memory as unknown as { similarity: number }) - .similarity; - expect(similarity).toBeGreaterThan(0.9); - }); - - test("Test cosine similarity value inequality", async () => { - // Define a base memory and two additional memories, one similar and one dissimilar - const baseMemoryContent = "i love u"; - const similarMemoryContent = - "Cognitive security in the information age"; - - // Create and add embedding to the base memory - const baseMemory = await embed( - memoryManager.runtime, - baseMemoryContent - ); - - const embedding = await getCachedEmbeddings(similarMemoryContent); - - // Create and add embedding to the similar and dissimilar memories - const similarMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: similarMemoryContent }, - roomId: roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - similarMemoryContent, - similarMemory.embedding as number[] - ); - } - await memoryManager.createMemory(similarMemory); - - // Search for memories similar to the base memory - const searchedMemories = await memoryManager.searchMemoriesByEmbedding( - baseMemory!, - { - match_threshold: 0.01, - roomId, - count: 1, - } - ); - - const memory = searchedMemories[0]; - - const similarity = (memory as unknown as { similarity: number }) - .similarity; - - expect(similarity).toBeLessThan(0.2); - }); - - test("Test unique insert", async () => { - // Define a base memory and two additional memories, one similar and one dissimilar - const memoryContent = "Cognitive security in the information age"; - const similarMemoryContent = - "Cognitive security in the information age"; - - let embedding = await getCachedEmbeddings(memoryContent); - - // Create and add embedding to the similar and dissimilar memories - const newMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: memoryContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - memoryContent, - newMemory.embedding as number[] - ); - } - await memoryManager.createMemory(newMemory, true); - - embedding = await getCachedEmbeddings(similarMemoryContent); - - // Create and add embedding to the similar and dissimilar memories - const similarMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: similarMemoryContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - similarMemoryContent, - similarMemory.embedding as number[] - ); - } - await memoryManager.createMemory(similarMemory, true); - - const allCount = await memoryManager.countMemories(roomId, false); - const uniqueCount = await memoryManager.countMemories(roomId, true); - - expect(allCount > uniqueCount).toBe(true); - }); - - test("Search memories by embedding similarity", async () => { - // Define a base memory and two additional memories, one similar and one dissimilar - const baseMemoryContent = "Base memory content for testing similarity"; - const similarMemoryContent = - "Base memory content for testing similarity 2"; - const dissimilarMemoryContent = "Dissimilar, not related"; - - // Create and add embedding to the base memory - const baseMemory = await embed( - memoryManager.runtime, - baseMemoryContent - ); - - let embedding = await getCachedEmbeddings(similarMemoryContent); - - // Create and add embedding to the similar and dissimilar memories - const similarMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: similarMemoryContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - similarMemoryContent, - similarMemory.embedding as number[] - ); - } - await memoryManager.createMemory(similarMemory); - - embedding = await getCachedEmbeddings(dissimilarMemoryContent); - - const dissimilarMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: dissimilarMemoryContent }, - roomId, - embedding: await getCachedEmbeddings(dissimilarMemoryContent), - }); - if (!embedding) { - writeCachedEmbedding( - dissimilarMemoryContent, - dissimilarMemory.embedding as number[] - ); - } - await memoryManager.createMemory(dissimilarMemory); - - // Search for memories similar to the base memory - const searchedMemories = await memoryManager.searchMemoriesByEmbedding( - baseMemory!, - { - roomId, - count: 1, - } - ); - - // Check that the similar memory is included in the search results and the dissimilar one is not or ranks lower - expect( - searchedMemories.some( - (memory) => - (memory.content as Content).text === similarMemoryContent - ) - ).toBe(true); - expect( - searchedMemories.some( - (memory) => - (memory.content as Content).text === dissimilarMemoryContent - ) - ).toBe(false); - }, 60000); - - test("Verify memory similarity and ranking", async () => { - // Define a set of memories with varying degrees of similarity - const queryMemoryContent = - "High similarity content to the query memory"; - const highSimilarityContent = - "High similarity content to the query memory"; - const lowSimilarityContent = "Low similarity, not related"; - - let embedding = await getCachedEmbeddings(queryMemoryContent); - - // Create and add embedding to the query memory - const queryMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: queryMemoryContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - queryMemoryContent, - queryMemory.embedding as number[] - ); - } - await memoryManager.createMemory(queryMemory); - - embedding = await getCachedEmbeddings(highSimilarityContent); - // Create and add embedding to the high and low similarity memories - const highSimilarityMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: highSimilarityContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - highSimilarityContent, - highSimilarityMemory.embedding as number[] - ); - } - await memoryManager.createMemory(highSimilarityMemory); - - embedding = await getCachedEmbeddings(lowSimilarityContent); - const lowSimilarityMemory = await memoryManager.addEmbeddingToMemory({ - userId: user?.id as UUID, - content: { text: lowSimilarityContent }, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - lowSimilarityContent, - lowSimilarityMemory.embedding as number[] - ); - } - await memoryManager.createMemory(lowSimilarityMemory); - - // Search for memories similar to the query memory - const searchedMemories = await memoryManager.searchMemoriesByEmbedding( - queryMemory.embedding!, - { - roomId, - count: 10, - } - ); - - // Check that the high similarity memory ranks higher than the low similarity memory - const highSimilarityIndex = searchedMemories.findIndex( - (memory) => - (memory.content as Content).text === highSimilarityContent - ); - const lowSimilarityIndex = searchedMemories.findIndex( - (memory) => - (memory.content as Content).text === lowSimilarityContent - ); - - expect(highSimilarityIndex).toBeLessThan(lowSimilarityIndex); - }, 60000); -}); diff --git a/packages/core/src/tests/messages.test.d.ts b/packages/core/src/tests/messages.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/messages.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/messages.test.ts b/packages/core/src/tests/messages.test.ts deleted file mode 100644 index 02e2c1107ad..00000000000 --- a/packages/core/src/tests/messages.test.ts +++ /dev/null @@ -1,114 +0,0 @@ -import dotenv from "dotenv"; -import { formatFacts } from "../src/evaluators/fact.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { type User } from "../src/test_resources/types.ts"; -import { - formatActors, - formatMessages, - getActorDetails, -} from "../src/messages.ts"; -import { createRelationship } from "../src/relationships.ts"; -import { - IAgentRuntime, - type Actor, - type Content, - type Memory, - type UUID, -} from "../src/types.ts"; - -dotenv.config({ path: ".dev.vars" }); - -describe("Messages Library", () => { - let runtime: IAgentRuntime, user: User, actors: Actor[]; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = setup.runtime; - user = setup.session.user; - actors = await getActorDetails({ - runtime, - roomId: "00000000-0000-0000-0000-000000000000", - }); - }); - - test("getActorDetails should return actors based on given roomId", async () => { - // create a room and add a user to it - const userA = user?.id as UUID; - const userB = zeroUuid; - - await createRelationship({ - runtime, - userA, - userB, - }); - - const { roomId } = await getOrCreateRelationship({ - runtime, - userA, - userB, - }); - - const result = await getActorDetails({ - runtime, - roomId, - }); - - expect(result.length).toBeGreaterThan(0); - result.forEach((actor: Actor) => { - expect(actor).toHaveProperty("name"); - expect(actor).toHaveProperty("details"); - expect(actor).toHaveProperty("id"); - }); - }); - - test("formatActors should format actors into a readable string", () => { - const formattedActors = formatActors({ actors }); - actors.forEach((actor) => { - expect(formattedActors).toContain(actor.name); - }); - }); - - test("formatMessages should format messages into a readable string", async () => { - const messages: Memory[] = [ - { - content: { text: "Hello" }, - userId: user.id as UUID, - roomId: "00000000-0000-0000-0000-000000000000", - }, - { - content: { text: "How are you?" }, - userId: "00000000-0000-0000-0000-000000000000", - roomId: "00000000-0000-0000-0000-000000000000", - }, - ]; - const formattedMessages = formatMessages({ messages, actors }); - messages.forEach((message: Memory) => { - expect(formattedMessages).toContain( - (message.content as Content).text - ); - }); - }); - - test("formatFacts should format facts into a readable string", async () => { - const facts: Memory[] = [ - { - content: { text: "Reflecting on the day" }, - userId: user.id as UUID, - roomId: "00000000-0000-0000-0000-000000000000", - }, - { - content: { text: "Thoughts and musings" }, - userId: "00000000-0000-0000-0000-000000000000", - roomId: "00000000-0000-0000-0000-000000000000room", - }, - ]; - const formattedFacts = formatFacts(facts); - facts.forEach((fact) => { - expect(formattedFacts).toContain(fact.content.text); - }); - }); -}); diff --git a/packages/core/src/tests/providers.test.d.ts b/packages/core/src/tests/providers.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/providers.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/providers.test.ts b/packages/core/src/tests/providers.test.ts deleted file mode 100644 index 902de0379c1..00000000000 --- a/packages/core/src/tests/providers.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import dotenv from "dotenv"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { - IAgentRuntime, - type Memory, - type Provider, - type State, - type UUID, -} from "../src/types.ts"; - -dotenv.config({ path: ".dev.vars" }); - -const TestProvider: Provider = { - get: async (_runtime: IAgentRuntime, _message: Memory, _state?: State) => { - return "Hello Test"; - }, -}; - -describe("TestProvider", () => { - let runtime: IAgentRuntime; - let roomId: UUID; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - providers: [TestProvider], - }); - runtime = setup.runtime; - roomId = zeroUuid; - }); - - test("TestProvider should return 'Hello Test'", async () => { - const message: Memory = { - userId: zeroUuid, - content: { text: "" }, - roomId: roomId, - }; - - const testProviderResponse = await TestProvider.get( - runtime, - message, - {} as State - ); - expect(testProviderResponse).toBe("Hello Test"); - }); - - test("TestProvider should be integrated in the runtime providers", async () => { - expect(runtime.providers).toContain(TestProvider); - }); -}); diff --git a/packages/core/src/tests/relationships.test.d.ts b/packages/core/src/tests/relationships.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/relationships.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/relationships.test.ts b/packages/core/src/tests/relationships.test.ts deleted file mode 100644 index d9bb406e415..00000000000 --- a/packages/core/src/tests/relationships.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -import dotenv from "dotenv"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; // Adjust the import path as needed -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { type User } from "../src/test_resources/types.ts"; -import { createRelationship, getRelationships } from "../src/relationships.ts"; // Adjust the import path as needed -import { IAgentRuntime, type UUID } from "../src/types.ts"; - -dotenv.config({ path: ".dev.vars" }); - -describe("Relationships Module", () => { - let runtime: IAgentRuntime; - let user: User; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - }); - runtime = setup.runtime; - user = setup.session.user; - if (!user.id) { - throw new Error("User ID is undefined"); - } - }); - - test("createRelationship creates a new relationship", async () => { - const userA = user.id as UUID; - const userB = zeroUuid; - if (userA === undefined) throw new Error("userA is undefined"); - const relationship = await createRelationship({ - runtime, - userA, - userB, - }); - expect(relationship).toBe(true); - }); - - test("getRelationship retrieves an existing relationship", async () => { - const userA = user?.id as UUID; - const userB = zeroUuid; - - await createRelationship({ runtime, userA, userB }); - - const relationship = await getOrCreateRelationship({ - runtime, - userA, - userB, - }); - expect(relationship).toBeDefined(); - expect(relationship?.userA).toBe(userA); - expect(relationship?.userB).toBe(userB); - }); - - test("getRelationships retrieves all relationships for a user", async () => { - const userA = user?.id as UUID; - const userB = zeroUuid; - - await createRelationship({ runtime, userA, userB }); - - const relationships = await getRelationships({ - runtime, - userId: userA, - }); - expect(relationships).toBeDefined(); - expect(relationships.length).toBeGreaterThan(0); - expect( - relationships.some((r) => r.userA === userA || r.userB === userA) - ).toBeTruthy(); - }); -}); diff --git a/packages/core/src/tests/runtime.test.d.ts b/packages/core/src/tests/runtime.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/runtime.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/runtime.test.ts b/packages/core/src/tests/runtime.test.ts deleted file mode 100644 index efd3f2efb09..00000000000 --- a/packages/core/src/tests/runtime.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import dotenv from "dotenv"; -import { - getCachedEmbeddings, - writeCachedEmbedding, -} from "../src/test_resources/cache.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import { getOrCreateRelationship } from "../src/test_resources/getOrCreateRelationship.ts"; -import { type User } from "../src/test_resources/types.ts"; -import { IAgentRuntime, type Memory, type UUID } from "../src/types.ts"; - -dotenv.config({ path: ".dev.vars" }); - -describe("Agent Runtime", () => { - let user: User; - let runtime: IAgentRuntime; - let roomId: UUID = zeroUuid; - - // Helper function to clear memories - async function clearMemories() { - await runtime.messageManager.removeAllMemories(roomId); - } - - // Helper function to create memories - async function createMemories() { - const memories = [ - { - userId: user?.id as UUID, - content: { text: "test memory from user" }, - }, - { userId: zeroUuid, content: { text: "test memory from agent" } }, - ]; - - for (const { userId, content } of memories) { - try { - const embedding = await getCachedEmbeddings(content.text); - const memory = - await runtime.messageManager.addEmbeddingToMemory({ - userId: userId, - content, - roomId, - embedding, - }); - if (!embedding) { - writeCachedEmbedding( - content.text, - memory.embedding as number[] - ); - } - await runtime.messageManager.createMemory(memory); - } catch (error) { - console.error("Error creating memory", error); - } - } - } - - // Set up before each test - beforeEach(async () => { - const result = await createRuntime({ - env: process.env as Record<string, string>, - }); - - runtime = result.runtime; - user = result.session.user; - - const data = await getOrCreateRelationship({ - runtime, - userA: user?.id as UUID, - userB: zeroUuid, - }); - - if (!data) { - throw new Error("Relationship not found"); - } - roomId = data.roomId; - await clearMemories(); // Clear memories before each test - }); - - // Clean up after each test - afterEach(async () => { - await clearMemories(); // Clear memories after each test to ensure a clean state - }); - - test("Create an agent runtime instance and use the basic functionality", () => { - expect(user).toBeDefined(); - expect(runtime).toBeDefined(); - }); - - test("Demonstrate idempotency by creating an agent runtime instance again", () => { - expect(user).toBeDefined(); - expect(runtime).toBeDefined(); - }); - - test("Memory lifecycle: create, retrieve, and destroy", async () => { - try { - await createMemories(); // Create new memories - } catch (error) { - console.error("Error creating memories", error); - } - - const message: Memory = { - userId: user.id as UUID, - content: { text: "test message" }, - roomId: roomId as UUID, - }; - - const state = await runtime.composeState(message); - - expect(state.recentMessagesData.length).toBeGreaterThan(1); - - await clearMemories(); - }, 60000); -}); diff --git a/packages/core/src/tests/time.test.d.ts b/packages/core/src/tests/time.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/time.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/time.test.ts b/packages/core/src/tests/time.test.ts deleted file mode 100644 index 0453c2d79f7..00000000000 --- a/packages/core/src/tests/time.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -import dotenv from "dotenv"; -import { composeContext } from "../src/context.ts"; -import { - IAgentRuntime, - type Memory, - type State, - type UUID, -} from "../src/types.ts"; -import { zeroUuid } from "../src/test_resources/constants.ts"; -import { createRuntime } from "../src/test_resources/createRuntime.ts"; -import timeProvider from "../src/providers/time.ts"; - -dotenv.config({ path: ".dev.vars" }); - -describe("Time Provider", () => { - let runtime: IAgentRuntime; - let user: { id: UUID }; - let roomId: UUID; - - beforeAll(async () => { - const setup = await createRuntime({ - env: process.env as Record<string, string>, - providers: [timeProvider], - }); - runtime = setup.runtime; - user = { id: setup.session.user?.id as UUID }; - roomId = zeroUuid; - }); - - test("Time provider should return the current time in the correct format", async () => { - const message: Memory = { - userId: user.id, - content: { text: "" }, - roomId: roomId, - }; - - const currentTimeResponse = await timeProvider.get( - runtime, - message, - {} as State - ); - expect(currentTimeResponse).toMatch( - /^The current time is: \d{1,2}:\d{2}:\d{2}\s?(AM|PM)$/ - ); - }); - - test("Time provider should be integrated in the state and context correctly", async () => { - const message: Memory = { - userId: user.id, - content: { text: "" }, - roomId: roomId, - }; - - // Manually integrate the time provider's response into the state - const state = await runtime.composeState(message); - - const contextTemplate = `Current Time: {{providers}}`; - const context = composeContext({ - state: state, - template: contextTemplate, - }); - - const match = context.match( - new RegExp( - `^Current Time: The current time is: \\d{1,2}:\\d{2}:\\d{2}\\s?(AM|PM)$` - ) - ); - - expect(match).toBeTruthy(); - }); - - test("Time provider should work independently", async () => { - const message: Memory = { - userId: user.id, - content: { text: "" }, - roomId: roomId, - }; - const currentTimeResponse = await timeProvider.get(runtime, message); - - expect(currentTimeResponse).toMatch( - /^The current time is: \d{1,2}:\d{2}:\d{2}\s?(AM|PM)$/ - ); - }); -}); diff --git a/packages/core/src/tests/token.test.d.ts b/packages/core/src/tests/token.test.d.ts deleted file mode 100644 index cb0ff5c3b54..00000000000 --- a/packages/core/src/tests/token.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/core/src/tests/token.test.ts b/packages/core/src/tests/token.test.ts deleted file mode 100644 index 46abfe6f8a1..00000000000 --- a/packages/core/src/tests/token.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { createRuntime } from "../src/test_resources/createRuntime"; -import { TokenProvider } from "../src/providers/token"; -import NodeCache from "node-cache"; - -// Mock the dependencies -jest.mock("cross-fetch"); -jest.mock("fs"); -jest.mock("node-cache"); - -describe("TokenProvider Tests", () => { - // let connection: Connection; - let tokenProvider: TokenProvider; - - beforeEach(() => { - // Initialize the connection and token provider before each test - // connection = new Connection("https://api.mainnet-beta.solana.com"); - tokenProvider = new TokenProvider( - "2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh" - ); - }); - - test("should fetch token security data", async () => { - const { runtime } = await createRuntime({ - conversationLength: 10, - }); - - // Mock the response for the fetchTokenSecurity call - const mockFetchResponse = { - success: true, - data: { - ownerBalance: "100", - creatorBalance: "50", - ownerPercentage: 10, - creatorPercentage: 5, - top10HolderBalance: "200", - top10HolderPercent: 20, - }, - }; - - // Mock fetchWithRetry function - const fetchSpy = jest - .spyOn(tokenProvider as any, "fetchWithRetry") - .mockResolvedValue(mockFetchResponse); - - // Run the fetchTokenSecurity method - // const securityData = await tokenProvider.fetchTokenSecurity(); - - // Check if the data returned is correct - // expect(securityData).toEqual({ - // ownerBalance: "100", - // creatorBalance: "50", - // ownerPercentage: 10, - // creatorPercentage: 5, - // top10HolderBalance: "200", - // top10HolderPercent: 20, - // }); - //console.log the securityData - // console.log({ securityData }); - - // const holderList = await tokenProvider.fetchHolderList(); - - // console.log({ holderList }); - - // const tradeData = await tokenProvider.fetchTokenTradeData(); - // console.log({ tradeData }); - - // const dexScreenerData = await tokenProvider.fetchDexScreenerData(); - // console.log({ dexScreenerData }); - - const tokenReport = - await tokenProvider.getFormattedTokenReport(runtime); - console.log({ tokenReport }); - - // Ensure the mock was called - expect(fetchSpy).toHaveBeenCalled(); - }); -}); diff --git a/packages/core/src/tests/utils.test.ts b/packages/core/src/tests/utils.test.ts deleted file mode 100644 index a7d4888899b..00000000000 --- a/packages/core/src/tests/utils.test.ts +++ /dev/null @@ -1,76 +0,0 @@ -import Database from "better-sqlite3"; -import fs from "fs"; -import path from "path"; -import { fileURLToPath } from "url"; -import { TwitterInteractionClient } from "../src/clients/twitter/interactions.ts"; -import { SqliteDatabaseAdapter } from "../src/adapters/sqlite.ts"; -import { defaultCharacter } from "../src/defaultCharacter.ts"; -import { buildConversationThread } from "../src/clients/twitter/utils.ts"; -import { AgentRuntime } from "../src/runtime.ts"; -import settings from "../src/settings.ts"; -import { ModelProviderName } from "../src/types.ts"; - -// const __dirname = path.dirname(new URL(".", import.meta.url).pathname); - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - -describe("buildConversationThread", () => { - let runtime: AgentRuntime; - let client: TwitterInteractionClient; - - beforeAll(async () => { - // Create an instance of the AgentRuntime - runtime = new AgentRuntime({ - databaseAdapter: new SqliteDatabaseAdapter( - new Database(":memory:") - ), - token: settings.OPENAI_API_KEY as string, - evaluators: [], - modelProvider: ModelProviderName.OPENAI, - character: defaultCharacter, - providers: [], - actions: [], - }); - - // Create an instance of the TwitterPostClient - client = new TwitterInteractionClient(runtime); - - // Load cached Twitter credentials - const cookiesFilePath = path.join( - __dirname, - "../../../tweetcache/" + - runtime.getSetting("TWITTER_USERNAME") + - "_cookies.json" - ); - console.log("Cookies file path:", cookiesFilePath); - if (fs.existsSync(cookiesFilePath)) { - const cookiesArray = JSON.parse( - fs.readFileSync(cookiesFilePath, "utf-8") - ); - client.setCookiesFromArray(cookiesArray); - } else { - throw new Error( - "Twitter credentials not found. Please provide valid cookies.json." - ); - } - }); - - it("should build a conversation thread from a tweet ID", async () => { - const tweetId = "1830058678197895517"; - - // Fetch the tweet from the API - const tweet = await client.getTweet(tweetId); - console.log("Original tweet:", JSON.stringify(tweet, null, 2)); - - // Build the conversation thread - const thread = await buildConversationThread(tweet, client); - - console.log("Generated conversation thread:"); - console.log(thread); - - // Add assertions based on the expected structure and content of the thread - // expect(thread.includes("By: Aya Bochman (@ayaboch)")).toBe(true); - // expect(thread.includes("@ayaboch @DanBochman You should do nothing. Its opensource code, you have too much to lose by fighting this fight, this post will get u blacklisted be aware")).toBe(true); - // expect(thread.includes("@BLUECOW009 @ayaboch @DanBochman That's not how it works")).toBe(true); - }, 30000); -}); diff --git a/packages/plugin-bootstrap/src/actions/continue.ts b/packages/plugin-bootstrap/src/actions/continue.ts index aeb51d0f2a2..feaf719af65 100644 --- a/packages/plugin-bootstrap/src/actions/continue.ts +++ b/packages/plugin-bootstrap/src/actions/continue.ts @@ -16,7 +16,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; const maxContinuesInARow = 3; diff --git a/packages/plugin-bootstrap/src/actions/followRoom.ts b/packages/plugin-bootstrap/src/actions/followRoom.ts index 84650adbcca..5fa860d2a01 100644 --- a/packages/plugin-bootstrap/src/actions/followRoom.ts +++ b/packages/plugin-bootstrap/src/actions/followRoom.ts @@ -8,7 +8,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const shouldFollowTemplate = `Based on the conversation so far: diff --git a/packages/plugin-bootstrap/src/actions/ignore.ts b/packages/plugin-bootstrap/src/actions/ignore.ts index fc69b3078b6..5126999f3a2 100644 --- a/packages/plugin-bootstrap/src/actions/ignore.ts +++ b/packages/plugin-bootstrap/src/actions/ignore.ts @@ -3,7 +3,7 @@ import { IAgentRuntime, Memory, type Action, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const ignoreAction: Action = { name: "IGNORE", diff --git a/packages/plugin-bootstrap/src/actions/muteRoom.ts b/packages/plugin-bootstrap/src/actions/muteRoom.ts index 86738805f49..447e546fa20 100644 --- a/packages/plugin-bootstrap/src/actions/muteRoom.ts +++ b/packages/plugin-bootstrap/src/actions/muteRoom.ts @@ -8,7 +8,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const shouldMuteTemplate = `Based on the conversation so far: diff --git a/packages/plugin-bootstrap/src/actions/none.ts b/packages/plugin-bootstrap/src/actions/none.ts index e9313aba1ad..e2f7f158b07 100644 --- a/packages/plugin-bootstrap/src/actions/none.ts +++ b/packages/plugin-bootstrap/src/actions/none.ts @@ -3,7 +3,7 @@ import { IAgentRuntime, Memory, type Action, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const noneAction: Action = { name: "NONE", diff --git a/packages/plugin-bootstrap/src/actions/unfollowRoom.ts b/packages/plugin-bootstrap/src/actions/unfollowRoom.ts index 66e59f6c746..654b122f14b 100644 --- a/packages/plugin-bootstrap/src/actions/unfollowRoom.ts +++ b/packages/plugin-bootstrap/src/actions/unfollowRoom.ts @@ -8,7 +8,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; const shouldUnfollowTemplate = `Based on the conversation so far: diff --git a/packages/plugin-bootstrap/src/actions/unmuteRoom.ts b/packages/plugin-bootstrap/src/actions/unmuteRoom.ts index f9071bfa651..11216a8edfb 100644 --- a/packages/plugin-bootstrap/src/actions/unmuteRoom.ts +++ b/packages/plugin-bootstrap/src/actions/unmuteRoom.ts @@ -8,7 +8,7 @@ import { Memory, ModelClass, State, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const shouldUnmuteTemplate = `Based on the conversation so far: diff --git a/packages/plugin-bootstrap/src/evaluators/fact.ts b/packages/plugin-bootstrap/src/evaluators/fact.ts index 5619f74cff5..5fe90d2ec92 100644 --- a/packages/plugin-bootstrap/src/evaluators/fact.ts +++ b/packages/plugin-bootstrap/src/evaluators/fact.ts @@ -8,7 +8,7 @@ import { Memory, ModelClass, Evaluator, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; export const formatFacts = (facts: Memory[]) => { const messageStrings = facts diff --git a/packages/plugin-bootstrap/src/evaluators/goal.ts b/packages/plugin-bootstrap/src/evaluators/goal.ts index aeab53a89d8..4427225f964 100644 --- a/packages/plugin-bootstrap/src/evaluators/goal.ts +++ b/packages/plugin-bootstrap/src/evaluators/goal.ts @@ -10,7 +10,7 @@ import { type Goal, type State, Evaluator, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; const goalsTemplate = `TASK: Update Goal Analyze the conversation and update the status of the goals based on the new information provided. diff --git a/packages/plugin-bootstrap/src/index.ts b/packages/plugin-bootstrap/src/index.ts index 439265fdebb..ea004debceb 100644 --- a/packages/plugin-bootstrap/src/index.ts +++ b/packages/plugin-bootstrap/src/index.ts @@ -1,4 +1,4 @@ -import { Plugin } from "@ai16z/eliza/src/types.ts"; +import { Plugin } from "@ai16z/eliza"; import { continueAction } from "./actions/continue.ts"; import { followRoomAction } from "./actions/followRoom.ts"; import { ignoreAction } from "./actions/ignore.ts"; diff --git a/packages/plugin-bootstrap/src/providers/boredom.ts b/packages/plugin-bootstrap/src/providers/boredom.ts index 4e534ab1d4b..1158cca46e4 100644 --- a/packages/plugin-bootstrap/src/providers/boredom.ts +++ b/packages/plugin-bootstrap/src/providers/boredom.ts @@ -1,9 +1,4 @@ -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; const boredomLevels = [ { diff --git a/packages/plugin-bootstrap/src/providers/facts.ts b/packages/plugin-bootstrap/src/providers/facts.ts index 241e5818541..a8ec529ab44 100644 --- a/packages/plugin-bootstrap/src/providers/facts.ts +++ b/packages/plugin-bootstrap/src/providers/facts.ts @@ -1,12 +1,7 @@ import { embed } from "@ai16z/eliza/src/embedding.ts"; import { MemoryManager } from "@ai16z/eliza/src/memory.ts"; import { formatMessages } from "@ai16z/eliza/src/messages.ts"; -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; import { formatFacts } from "../evaluators/fact.ts"; const factsProvider: Provider = { diff --git a/packages/plugin-bootstrap/src/providers/time.ts b/packages/plugin-bootstrap/src/providers/time.ts index 9e26822281f..6806f1a807c 100644 --- a/packages/plugin-bootstrap/src/providers/time.ts +++ b/packages/plugin-bootstrap/src/providers/time.ts @@ -1,9 +1,4 @@ -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; const timeProvider: Provider = { get: async (_runtime: IAgentRuntime, _message: Memory, _state?: State) => { diff --git a/packages/plugin-image-generation/src/index.ts b/packages/plugin-image-generation/src/index.ts index e05c779832f..cf0e02c8a54 100644 --- a/packages/plugin-image-generation/src/index.ts +++ b/packages/plugin-image-generation/src/index.ts @@ -6,37 +6,37 @@ import { Memory, Plugin, State, -} from "@ai16z/eliza/src/types.ts"; -import { generateCaption, generateImage } from "@ai16z/eliza/src/generation.ts"; +} from "@ai16z/eliza"; +import { generateCaption, generateImage } from "@ai16z/eliza"; -import fs from 'fs'; -import path from 'path'; +import fs from "fs"; +import path from "path"; export function saveBase64Image(base64Data: string, filename: string): string { // Create generatedImages directory if it doesn't exist - const imageDir = path.join(process.cwd(), 'generatedImages'); + const imageDir = path.join(process.cwd(), "generatedImages"); if (!fs.existsSync(imageDir)) { fs.mkdirSync(imageDir, { recursive: true }); } // Remove the data:image/png;base64 prefix if it exists - const base64Image = base64Data.replace(/^data:image\/\w+;base64,/, ''); - + const base64Image = base64Data.replace(/^data:image\/\w+;base64,/, ""); + // Create a buffer from the base64 string - const imageBuffer = Buffer.from(base64Image, 'base64'); - + const imageBuffer = Buffer.from(base64Image, "base64"); + // Create full file path const filepath = path.join(imageDir, `${filename}.png`); - + // Save the file fs.writeFileSync(filepath, imageBuffer); - + return filepath; } const imageGeneration: Action = { name: "GENERATE_IMAGE", - similes: ["IMAGE_GENERATION", "IMAGE_GEN", "CREATE_IMAGE", "MAKE_PICTURE",], + similes: ["IMAGE_GENERATION", "IMAGE_GEN", "CREATE_IMAGE", "MAKE_PICTURE"], description: "Generate an image to go along with the message.", validate: async (runtime: IAgentRuntime, message: Memory) => { const anthropicApiKeyOk = !!runtime.getSetting("ANTHROPIC_API_KEY"); @@ -83,7 +83,7 @@ const imageGeneration: Action = { ); for (let i = 0; i < images.data.length; i++) { const image = images.data[i]; - + const base64Image = images.data[i]; // Save the image and get filepath const filename = `generated_${Date.now()}_${i}`; @@ -102,7 +102,7 @@ const imageGeneration: Action = { } catch (error) { elizaLogger.error("Caption generation failed, using default caption:", error); }*/ - + const caption = "..."; /*= await generateCaption( { @@ -111,33 +111,33 @@ const imageGeneration: Action = { runtime );*/ - res.push({ image: filepath, caption: "..."});//caption.title }); + res.push({ image: filepath, caption: "..." }); //caption.title }); elizaLogger.log( `Generated caption for image ${i + 1}:`, - "..."//caption.title + "..." //caption.title ); //res.push({ image: image, caption: caption.title }); callback( { - text: "...",//caption.description, + text: "...", //caption.description, attachments: [ { id: crypto.randomUUID(), url: filepath, title: "Generated image", source: "imageGeneration", - description: "...",//caption.title, - text: "...",//caption.description, + description: "...", //caption.title, + text: "...", //caption.description, }, ], }, - [ - { + [ + { attachment: filepath, - name: `${filename}.png` - } + name: `${filename}.png`, + }, ] ); } diff --git a/packages/plugin-node/src/index.ts b/packages/plugin-node/src/index.ts index 1f1f694a38e..678db6460e2 100644 --- a/packages/plugin-node/src/index.ts +++ b/packages/plugin-node/src/index.ts @@ -1,4 +1,12 @@ -import { Plugin } from "@ai16z/eliza/src/types.ts"; +export * from "./services/browser.ts"; +export * from "./services/image.ts"; +export * from "./services/llama.ts"; +export * from "./services/pdf.ts"; +export * from "./services/speech.ts"; +export * from "./services/transcription.ts"; +export * from "./services/video.ts"; + +import { Plugin } from "@ai16z/eliza"; import { BrowserService } from "./services/browser.ts"; import { ImageDescriptionService } from "./services/image.ts"; import { LlamaService } from "./services/llama.ts"; diff --git a/packages/plugin-node/src/services/browser.ts b/packages/plugin-node/src/services/browser.ts index 16cb244a3b1..0da5ba5744a 100644 --- a/packages/plugin-node/src/services/browser.ts +++ b/packages/plugin-node/src/services/browser.ts @@ -1,13 +1,9 @@ -import { generateText, trimTokens } from "@ai16z/eliza/src/generation.ts"; -import { parseJSONObjectFromText } from "@ai16z/eliza/src/parsing.ts"; -import { Service } from "@ai16z/eliza/src/types.ts"; -import settings from "@ai16z/eliza/src/settings.ts"; -import { - IAgentRuntime, - ModelClass, - ServiceType, -} from "@ai16z/eliza/src/types.ts"; -import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; +import { generateText, trimTokens } from "@ai16z/eliza"; +import { parseJSONObjectFromText } from "@ai16z/eliza"; +import { Service } from "@ai16z/eliza"; +import { settings } from "@ai16z/eliza"; +import { IAgentRuntime, ModelClass, ServiceType } from "@ai16z/eliza"; +import { stringToUuid } from "@ai16z/eliza"; import { PlaywrightBlocker } from "@cliqz/adblocker-playwright"; import CaptchaSolver from "capsolver-npm"; import fs from "fs"; diff --git a/packages/plugin-node/src/services/image.ts b/packages/plugin-node/src/services/image.ts index 9868cfcc9ca..1aac84f5a42 100644 --- a/packages/plugin-node/src/services/image.ts +++ b/packages/plugin-node/src/services/image.ts @@ -1,11 +1,7 @@ // Current image recognition service -- local recognition working, no openai recognition -import models from "@ai16z/eliza/src/models.ts"; -import { Service } from "@ai16z/eliza/src/types.ts"; -import { - IAgentRuntime, - ModelProviderName, - ServiceType, -} from "@ai16z/eliza/src/types.ts"; +import { models } from "@ai16z/eliza"; +import { Service } from "@ai16z/eliza"; +import { IAgentRuntime, ModelProviderName, ServiceType } from "@ai16z/eliza"; import { AutoProcessor, AutoTokenizer, diff --git a/packages/plugin-node/src/services/llama.ts b/packages/plugin-node/src/services/llama.ts index 41ca734ec79..f8bc8be4147 100644 --- a/packages/plugin-node/src/services/llama.ts +++ b/packages/plugin-node/src/services/llama.ts @@ -1,9 +1,5 @@ -import { - elizaLogger, - IAgentRuntime, - ServiceType, -} from "@ai16z/eliza/src/index.ts"; -import { Service } from "@ai16z/eliza/src/types.ts"; +import { elizaLogger, ServiceType } from "@ai16z/eliza"; +import { Service } from "@ai16z/eliza"; import fs from "fs"; import https from "https"; import { diff --git a/packages/plugin-node/src/services/pdf.ts b/packages/plugin-node/src/services/pdf.ts index 8126acc7d7f..ad899672fc1 100644 --- a/packages/plugin-node/src/services/pdf.ts +++ b/packages/plugin-node/src/services/pdf.ts @@ -1,4 +1,4 @@ -import { Service, ServiceType } from "@ai16z/eliza/src/types.ts"; +import { Service, ServiceType } from "@ai16z/eliza"; import { getDocument, PDFDocumentProxy } from "pdfjs-dist"; import { TextItem, TextMarkedContent } from "pdfjs-dist/types/src/display/api"; diff --git a/packages/plugin-node/src/services/speech.ts b/packages/plugin-node/src/services/speech.ts index 07dbba38463..66e45a81edf 100644 --- a/packages/plugin-node/src/services/speech.ts +++ b/packages/plugin-node/src/services/speech.ts @@ -1,12 +1,8 @@ import { PassThrough, Readable } from "stream"; -import { - IAgentRuntime, - ISpeechService, - ServiceType, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, ISpeechService, ServiceType } from "@ai16z/eliza"; import { getWavHeader } from "./audioUtils.ts"; import { synthesize } from "../vendor/vits.ts"; -import { Service } from "@ai16z/eliza/src/types.ts"; +import { Service } from "@ai16z/eliza"; function prependWavHeader( readable: Readable, audioLength: number, diff --git a/packages/plugin-node/src/services/transcription.ts b/packages/plugin-node/src/services/transcription.ts index 2f8a0599832..0360dcec918 100644 --- a/packages/plugin-node/src/services/transcription.ts +++ b/packages/plugin-node/src/services/transcription.ts @@ -1,5 +1,5 @@ -import { settings } from "@ai16z/eliza/src/settings.ts"; -import { Service, ServiceType } from "@ai16z/eliza/src/types.ts"; +import { settings } from "@ai16z/eliza"; +import { Service, ServiceType } from "@ai16z/eliza"; import { exec } from "child_process"; import { File } from "formdata-node"; import fs from "fs"; diff --git a/packages/plugin-node/src/services/video.ts b/packages/plugin-node/src/services/video.ts index 6aa1b91e52e..a8bee25ac7e 100644 --- a/packages/plugin-node/src/services/video.ts +++ b/packages/plugin-node/src/services/video.ts @@ -1,11 +1,11 @@ -import { Service } from "@ai16z/eliza/src/types.ts"; +import { Service } from "@ai16z/eliza"; import { IAgentRuntime, ITranscriptionService, Media, ServiceType, -} from "@ai16z/eliza/src/types.ts"; -import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; +} from "@ai16z/eliza"; +import { stringToUuid } from "@ai16z/eliza"; import ffmpeg from "fluent-ffmpeg"; import fs from "fs"; import path from "path"; diff --git a/packages/plugin-solana/src/actions/pumpfun.ts b/packages/plugin-solana/src/actions/pumpfun.ts index ab49821ee08..62e8afc1419 100644 --- a/packages/plugin-solana/src/actions/pumpfun.ts +++ b/packages/plugin-solana/src/actions/pumpfun.ts @@ -21,7 +21,7 @@ import { ModelClass, State, type Action, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { composeContext } from "@ai16z/eliza/src/context.ts"; import { generateObject } from "@ai16z/eliza/src/generation.ts"; @@ -32,23 +32,21 @@ import { import { bs58 } from "@coral-xyz/anchor/dist/cjs/utils/bytes/index.js"; - export interface CreateAndBuyContent extends Content { tokenMetadata: { name: string; symbol: string; description: string; - image_description: string; + image_description: string; }; buyAmountSol: string | number; } - export function isCreateAndBuyContent( runtime: IAgentRuntime, content: any ): content is CreateAndBuyContent { - console.log("Content for create & buy", content) + console.log("Content for create & buy", content); return ( typeof content.tokenMetadata === "object" && content.tokenMetadata !== null && @@ -61,7 +59,6 @@ export function isCreateAndBuyContent( ); } - export const createAndBuyToken = async ({ deployer, mint, @@ -131,18 +128,17 @@ export const createAndBuyToken = async ({ return { success: true, - ca: mint.publicKey.toBase58(), - creator: deployer.publicKey.toBase58() + ca: mint.publicKey.toBase58(), + creator: deployer.publicKey.toBase58(), }; - } else { console.log("Create and Buy failed"); return { success: false, ca: mint.publicKey.toBase58(), - error: createResults.error || "Transaction failed" + error: createResults.error || "Transaction failed", }; - } + } }; export const buyToken = async ({ @@ -252,9 +248,8 @@ const promptConfirmation = async (): Promise<boolean> => { }; // Save the base64 data to a file -import * as fs from 'fs'; -import * as path from 'path'; - +import * as fs from "fs"; +import * as path from "path"; const pumpfunTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. @@ -282,57 +277,54 @@ Given the recent messages, extract or generate (come up with if not included) th Respond with a JSON markdown block containing only the extracted values.`; - - export default { name: "CREATE_AND_BUY_TOKEN", similes: ["CREATE_AND_PURCHASE_TOKEN", "DEPLOY_AND_BUY_TOKEN"], validate: async (runtime: IAgentRuntime, message: Memory) => { - - return true;//return isCreateAndBuyContent(runtime, message.content); + return true; //return isCreateAndBuyContent(runtime, message.content); }, description: "Create a new token and buy a specified amount using SOL. Requires deployer private key, token metadata, buy amount in SOL, priority fee, and allowOffCurve flag.", - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - _options: { [key: string]: unknown }, - callback?: HandlerCallback - ): Promise<boolean> => { - console.log("Starting CREATE_AND_BUY_TOKEN handler..."); - - // Compose state if not provided - if (!state) { - state = (await runtime.composeState(message)) as State; - } else { - state = await runtime.updateRecentMessageState(state); - } - - // Get wallet info for context - const walletInfo = await walletProvider.get(runtime, message, state); - state.walletInfo = walletInfo; - - // Generate structured content from natural language - const pumpContext = composeContext({ - state, - template: pumpfunTemplate, - }); - - const content = await generateObject({ - runtime, - context: pumpContext, - modelClass: ModelClass.LARGE, - }); - - // Validate the generated content - if (!isCreateAndBuyContent(runtime, content)) { - console.error("Invalid content for CREATE_AND_BUY_TOKEN action."); - return false; - } - - const { tokenMetadata, buyAmountSol } = content; - /* + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State, + _options: { [key: string]: unknown }, + callback?: HandlerCallback + ): Promise<boolean> => { + console.log("Starting CREATE_AND_BUY_TOKEN handler..."); + + // Compose state if not provided + if (!state) { + state = (await runtime.composeState(message)) as State; + } else { + state = await runtime.updateRecentMessageState(state); + } + + // Get wallet info for context + const walletInfo = await walletProvider.get(runtime, message, state); + state.walletInfo = walletInfo; + + // Generate structured content from natural language + const pumpContext = composeContext({ + state, + template: pumpfunTemplate, + }); + + const content = await generateObject({ + runtime, + context: pumpContext, + modelClass: ModelClass.LARGE, + }); + + // Validate the generated content + if (!isCreateAndBuyContent(runtime, content)) { + console.error("Invalid content for CREATE_AND_BUY_TOKEN action."); + return false; + } + + const { tokenMetadata, buyAmountSol } = content; + /* // Generate image if tokenMetadata.file is empty or invalid if (!tokenMetadata.file || tokenMetadata.file.length < 100) { // Basic validation try { @@ -356,142 +348,146 @@ export default { } } */ - const imageResult = await generateImage({ + const imageResult = await generateImage( + { prompt: `logo for ${tokenMetadata.name} (${tokenMetadata.symbol}) token - ${tokenMetadata.description}`, width: 256, height: 256, - count: 1 - }, runtime); - - - tokenMetadata.image_description = imageResult.data[0].replace(/^data:image\/[a-z]+;base64,/, ''); - - + count: 1, + }, + runtime + ); + tokenMetadata.image_description = imageResult.data[0].replace( + /^data:image\/[a-z]+;base64,/, + "" + ); - // Convert base64 string to Blob - const base64Data = tokenMetadata.image_description; - const outputPath = path.join(process.cwd(), `generated_image_${Date.now()}.txt`); - fs.writeFileSync(outputPath, base64Data); - console.log(`Base64 data saved to: ${outputPath}`); + // Convert base64 string to Blob + const base64Data = tokenMetadata.image_description; + const outputPath = path.join( + process.cwd(), + `generated_image_${Date.now()}.txt` + ); + fs.writeFileSync(outputPath, base64Data); + console.log(`Base64 data saved to: ${outputPath}`); + const byteCharacters = atob(base64Data); + const byteNumbers = new Array(byteCharacters.length); + for (let i = 0; i < byteCharacters.length; i++) { + byteNumbers[i] = byteCharacters.charCodeAt(i); + } + const byteArray = new Uint8Array(byteNumbers); + const blob = new Blob([byteArray], { type: "image/png" }); + + // Add the default decimals and convert file to Blob + const fullTokenMetadata: CreateTokenMetadata = { + name: tokenMetadata.name, + symbol: tokenMetadata.symbol, + description: tokenMetadata.description, + file: blob, + }; - const byteCharacters = atob(base64Data); - const byteNumbers = new Array(byteCharacters.length); - for (let i = 0; i < byteCharacters.length; i++) { - byteNumbers[i] = byteCharacters.charCodeAt(i); - } - const byteArray = new Uint8Array(byteNumbers); - const blob = new Blob([byteArray], { type: 'image/png' }); - - // Add the default decimals and convert file to Blob - const fullTokenMetadata: CreateTokenMetadata = { - name: tokenMetadata.name, - symbol: tokenMetadata.symbol, - description: tokenMetadata.description, - file: blob, - }; - - // Default priority fee for high network load - const priorityFee = { - unitLimit: 100_000_000, - unitPrice: 100_000 - }; - const slippage = "2000" - try { - // Get private key from settings and create deployer keypair - const privateKeyString = runtime.getSetting("WALLET_PRIVATE_KEY")!; - const secretKey = bs58.decode(privateKeyString); - const deployerKeypair = Keypair.fromSecretKey(secretKey); - - // Generate new mint keypair - const mintKeypair = Keypair.generate(); - console.log(`Generated mint address: ${mintKeypair.publicKey.toBase58()}`); - - // Setup connection and SDK - const connection = new Connection(settings.RPC_URL!, { - commitment: "confirmed", - confirmTransactionInitialTimeout: 500000, // 120 seconds - wsEndpoint: settings.RPC_URL!.replace('https', 'wss') - }); + // Default priority fee for high network load + const priorityFee = { + unitLimit: 100_000_000, + unitPrice: 100_000, + }; + const slippage = "2000"; + try { + // Get private key from settings and create deployer keypair + const privateKeyString = runtime.getSetting("WALLET_PRIVATE_KEY")!; + const secretKey = bs58.decode(privateKeyString); + const deployerKeypair = Keypair.fromSecretKey(secretKey); + + // Generate new mint keypair + const mintKeypair = Keypair.generate(); + console.log( + `Generated mint address: ${mintKeypair.publicKey.toBase58()}` + ); - const wallet = new Wallet(deployerKeypair); - const provider = new AnchorProvider(connection, wallet, { - commitment: "finalized" - }); - const sdk = new PumpFunSDK(provider); - // const slippage = runtime.getSetting("SLIPPAGE"); + // Setup connection and SDK + const connection = new Connection(settings.RPC_URL!, { + commitment: "confirmed", + confirmTransactionInitialTimeout: 500000, // 120 seconds + wsEndpoint: settings.RPC_URL!.replace("https", "wss"), + }); + const wallet = new Wallet(deployerKeypair); + const provider = new AnchorProvider(connection, wallet, { + commitment: "finalized", + }); + const sdk = new PumpFunSDK(provider); + // const slippage = runtime.getSetting("SLIPPAGE"); - const createAndBuyConfirmation = await promptConfirmation(); - if (!createAndBuyConfirmation) { - console.log("Create and buy token canceled by user"); + const createAndBuyConfirmation = await promptConfirmation(); + if (!createAndBuyConfirmation) { + console.log("Create and buy token canceled by user"); return false; - } - - // Convert SOL to lamports (1 SOL = 1_000_000_000 lamports) - const lamports = Math.floor(Number(buyAmountSol) * 1_000_000_000); - - console.log("Executing create and buy transaction..."); - const result = await createAndBuyToken({ - deployer: deployerKeypair, - mint: mintKeypair, - tokenMetadata: fullTokenMetadata, - buyAmountSol: BigInt(lamports), - priorityFee, - allowOffCurve: false, - sdk, - connection, - slippage, - }); + } + // Convert SOL to lamports (1 SOL = 1_000_000_000 lamports) + const lamports = Math.floor(Number(buyAmountSol) * 1_000_000_000); + + console.log("Executing create and buy transaction..."); + const result = await createAndBuyToken({ + deployer: deployerKeypair, + mint: mintKeypair, + tokenMetadata: fullTokenMetadata, + buyAmountSol: BigInt(lamports), + priorityFee, + allowOffCurve: false, + sdk, + connection, + slippage, + }); - if (callback) { - if (result.success) { - callback({ - text: `Token ${tokenMetadata.name} (${tokenMetadata.symbol}) created successfully!\nContract Address: ${result.ca}\nCreator: ${result.creator}\nView at: https://pump.fun/${result.ca}`, - content: { - tokenInfo: { - symbol: tokenMetadata.symbol, - address: result.ca, - creator: result.creator, - name: tokenMetadata.name, - description: tokenMetadata.description, - timestamp: Date.now() - } - } - }); - } else { - callback({ - text: `Failed to create token: ${result.error}\nAttempted mint address: ${result.ca}`, - content: { - error: result.error, - mintAddress: result.ca - } - }); - } + if (callback) { + if (result.success) { + callback({ + text: `Token ${tokenMetadata.name} (${tokenMetadata.symbol}) created successfully!\nContract Address: ${result.ca}\nCreator: ${result.creator}\nView at: https://pump.fun/${result.ca}`, + content: { + tokenInfo: { + symbol: tokenMetadata.symbol, + address: result.ca, + creator: result.creator, + name: tokenMetadata.name, + description: tokenMetadata.description, + timestamp: Date.now(), + }, + }, + }); + } else { + callback({ + text: `Failed to create token: ${result.error}\nAttempted mint address: ${result.ca}`, + content: { + error: result.error, + mintAddress: result.ca, + }, + }); } - //await trustScoreDb.addToken(tokenInfo); - /* + } + //await trustScoreDb.addToken(tokenInfo); + /* // Update runtime state await runtime.updateState({ ...state, lastCreatedToken: tokenInfo }); */ - // Log success message with token view URL - const successMessage = `Token created and purchased successfully! View at: https://pump.fun/${mintKeypair.publicKey.toBase58()}`; - console.log(successMessage); - return result.success; - } catch (error) { - if (callback) { - callback({ - text: `Error during token creation: ${error.message}`, - content: { error: error.message } - }); - } - return false; + // Log success message with token view URL + const successMessage = `Token created and purchased successfully! View at: https://pump.fun/${mintKeypair.publicKey.toBase58()}`; + console.log(successMessage); + return result.success; + } catch (error) { + if (callback) { + callback({ + text: `Error during token creation: ${error.message}`, + content: { error: error.message }, + }); } + return false; + } }, examples: [ @@ -499,8 +495,8 @@ export default { { user: "{{user1}}", content: { - text: "Create a new token called GLITCHIZA with symbol GLITCHIZA and generate a description about it. Also come up with a description for it to use for image generation .buy 0.00069 SOL worth." - } + text: "Create a new token called GLITCHIZA with symbol GLITCHIZA and generate a description about it. Also come up with a description for it to use for image generation .buy 0.00069 SOL worth.", + }, }, { user: "{{user2}}", @@ -510,16 +506,16 @@ export default { content: { tokenInfo: { symbol: "GLITCHIZA", - address: "EugPwuZ8oUMWsYHeBGERWvELfLGFmA1taDtmY8uMeX6r", - creator: "9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa", + address: + "EugPwuZ8oUMWsYHeBGERWvELfLGFmA1taDtmY8uMeX6r", + creator: + "9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa", name: "GLITCHIZA", - description: "A GLITCHIZA token" - } - } - } - } - ] - ] as ActionExample[][] - - , + description: "A GLITCHIZA token", + }, + }, + }, + }, + ], + ] as ActionExample[][], } as Action; diff --git a/packages/plugin-solana/src/actions/swap.ts b/packages/plugin-solana/src/actions/swap.ts index 7bfe4a649d4..9a04b7110b8 100644 --- a/packages/plugin-solana/src/actions/swap.ts +++ b/packages/plugin-solana/src/actions/swap.ts @@ -19,7 +19,7 @@ import { ModelClass, State, type Action, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { TokenProvider } from "../providers/token.ts"; import { TrustScoreManager } from "../providers/trustScoreProvider.ts"; import { walletProvider, WalletProvider } from "../providers/wallet.ts"; diff --git a/packages/plugin-solana/src/actions/swapDao.ts b/packages/plugin-solana/src/actions/swapDao.ts index a9ebd8c3463..1cc956b5212 100644 --- a/packages/plugin-solana/src/actions/swapDao.ts +++ b/packages/plugin-solana/src/actions/swapDao.ts @@ -3,7 +3,7 @@ import { IAgentRuntime, Memory, type Action, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { Connection, Keypair, PublicKey, Transaction } from "@solana/web3.js"; import { getQuote } from "./swapUtils.ts"; diff --git a/packages/plugin-solana/src/actions/takeOrder.ts b/packages/plugin-solana/src/actions/takeOrder.ts index c7a09f7e378..2e6b5f79208 100644 --- a/packages/plugin-solana/src/actions/takeOrder.ts +++ b/packages/plugin-solana/src/actions/takeOrder.ts @@ -5,7 +5,7 @@ import { Content, ActionExample, ModelClass, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import * as fs from "fs"; import settings from "@ai16z/eliza/src/settings.ts"; import { composeContext } from "@ai16z/eliza/src/context.ts"; diff --git a/packages/plugin-solana/src/actions/transfer.ts b/packages/plugin-solana/src/actions/transfer.ts index c552c21e261..2867a6ef3d0 100644 --- a/packages/plugin-solana/src/actions/transfer.ts +++ b/packages/plugin-solana/src/actions/transfer.ts @@ -1,19 +1,21 @@ import { AnchorProvider } from "@coral-xyz/anchor"; import { Wallet } from "@coral-xyz/anchor"; -import { getAssociatedTokenAddressSync, createTransferInstruction } from "@solana/spl-token"; +import { + getAssociatedTokenAddressSync, + createTransferInstruction, +} from "@solana/spl-token"; import { bs58 } from "@coral-xyz/anchor/dist/cjs/utils/bytes/index.js"; import settings from "@ai16z/eliza/src/settings.ts"; -import { - Connection, - Keypair, +import { + Connection, + Keypair, PublicKey, - TransactionMessage, - VersionedTransaction + TransactionMessage, + VersionedTransaction, } from "@solana/web3.js"; - import { ActionExample, Content, @@ -23,7 +25,7 @@ import { ModelClass, State, type Action, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { composeContext } from "@ai16z/eliza/src/context.ts"; import { generateObject } from "@ai16z/eliza/src/generation.ts"; @@ -68,11 +70,17 @@ Respond with a JSON markdown block containing only the extracted values.`; export default { name: "SEND_TOKEN", - similes: ["TRANSFER_TOKEN", "TRANSFER_TOKENS", "SEND_TOKENS", "SEND_SOL", "PAY"], + similes: [ + "TRANSFER_TOKEN", + "TRANSFER_TOKENS", + "SEND_TOKENS", + "SEND_SOL", + "PAY", + ], validate: async (runtime: IAgentRuntime, message: Memory) => { - console.log("Validating transfer from user:", message.userId); - //add custom validate logic here - /* + console.log("Validating transfer from user:", message.userId); + //add custom validate logic here + /* const adminIds = runtime.getSetting("ADMIN_USER_IDS")?.split(",") || []; //console.log("Admin IDs from settings:", adminIds); @@ -88,7 +96,7 @@ export default { return false; } */ - return false; + return false; }, description: "Transfer tokens from the agent's wallet to another address", handler: async ( @@ -100,120 +108,132 @@ export default { ): Promise<boolean> => { console.log("Starting TRANSFER_TOKEN handler..."); - // Initialize or update state + // Initialize or update state if (!state) { state = (await runtime.composeState(message)) as State; } else { state = await runtime.updateRecentMessageState(state); } - // Compose transfer context + // Compose transfer context const transferContext = composeContext({ state, template: transferTemplate, }); - // Generate transfer content + // Generate transfer content const content = await generateObject({ runtime, context: transferContext, modelClass: ModelClass.SMALL, }); - // Validate transfer content + // Validate transfer content if (!isTransferContent(runtime, content)) { console.error("Invalid content for TRANSFER_TOKEN action."); - if (callback) { - callback({ - text: "Unable to process transfer request. Invalid content provided.", - content: { error: "Invalid transfer content" } - }); + if (callback) { + callback({ + text: "Unable to process transfer request. Invalid content provided.", + content: { error: "Invalid transfer content" }, + }); + } + return false; } - return false; - } - -try { - const privateKeyString = runtime.getSetting("WALLET_PRIVATE_KEY")!; - const secretKey = bs58.decode(privateKeyString); - const senderKeypair = Keypair.fromSecretKey(secretKey); - - const connection = new Connection(settings.RPC_URL!); - - const mintPubkey = new PublicKey(content.tokenAddress); - const recipientPubkey = new PublicKey(content.recipient); - - // Get decimals (simplest way) - const mintInfo = await connection.getParsedAccountInfo(mintPubkey); - const decimals = (mintInfo.value?.data as any)?.parsed?.info?.decimals ?? 9; - - // Adjust amount with decimals - const adjustedAmount = BigInt(Number(content.amount) * Math.pow(10, decimals)); - console.log(`Transferring: ${content.amount} tokens (${adjustedAmount} base units)`); - - // Rest of the existing working code... - const senderATA = getAssociatedTokenAddressSync(mintPubkey, senderKeypair.publicKey); - const recipientATA = getAssociatedTokenAddressSync(mintPubkey, recipientPubkey); - - const instructions = []; - - const recipientATAInfo = await connection.getAccountInfo(recipientATA); - if (!recipientATAInfo) { - const { createAssociatedTokenAccountInstruction } = await import("@solana/spl-token"); - instructions.push( - createAssociatedTokenAccountInstruction( - senderKeypair.publicKey, - recipientATA, - recipientPubkey, - mintPubkey - ) - ); - } - - instructions.push( - createTransferInstruction( - senderATA, - recipientATA, - senderKeypair.publicKey, - adjustedAmount - ) - ); + try { + const privateKeyString = runtime.getSetting("WALLET_PRIVATE_KEY")!; + const secretKey = bs58.decode(privateKeyString); + const senderKeypair = Keypair.fromSecretKey(secretKey); + + const connection = new Connection(settings.RPC_URL!); + + const mintPubkey = new PublicKey(content.tokenAddress); + const recipientPubkey = new PublicKey(content.recipient); + + // Get decimals (simplest way) + const mintInfo = await connection.getParsedAccountInfo(mintPubkey); + const decimals = + (mintInfo.value?.data as any)?.parsed?.info?.decimals ?? 9; + + // Adjust amount with decimals + const adjustedAmount = BigInt( + Number(content.amount) * Math.pow(10, decimals) + ); + console.log( + `Transferring: ${content.amount} tokens (${adjustedAmount} base units)` + ); + + // Rest of the existing working code... + const senderATA = getAssociatedTokenAddressSync( + mintPubkey, + senderKeypair.publicKey + ); + const recipientATA = getAssociatedTokenAddressSync( + mintPubkey, + recipientPubkey + ); + + const instructions = []; + + const recipientATAInfo = + await connection.getAccountInfo(recipientATA); + if (!recipientATAInfo) { + const { createAssociatedTokenAccountInstruction } = + await import("@solana/spl-token"); + instructions.push( + createAssociatedTokenAccountInstruction( + senderKeypair.publicKey, + recipientATA, + recipientPubkey, + mintPubkey + ) + ); + } + instructions.push( + createTransferInstruction( + senderATA, + recipientATA, + senderKeypair.publicKey, + adjustedAmount + ) + ); - // Create and sign versioned transaction - const messageV0 = new TransactionMessage({ - payerKey: senderKeypair.publicKey, - recentBlockhash: (await connection.getLatestBlockhash()).blockhash, - instructions - }).compileToV0Message(); + // Create and sign versioned transaction + const messageV0 = new TransactionMessage({ + payerKey: senderKeypair.publicKey, + recentBlockhash: (await connection.getLatestBlockhash()) + .blockhash, + instructions, + }).compileToV0Message(); - const transaction = new VersionedTransaction(messageV0); - transaction.sign([senderKeypair]); + const transaction = new VersionedTransaction(messageV0); + transaction.sign([senderKeypair]); - // Send transaction - const signature = await connection.sendTransaction(transaction); - - console.log("Transfer successful:", signature); + // Send transaction + const signature = await connection.sendTransaction(transaction); - if (callback) { - callback({ - text: `Successfully transferred ${content.amount} tokens to ${content.recipient}\nTransaction: ${signature}`, - content: { - success: true, - signature, - amount: content.amount, - recipient: content.recipient + console.log("Transfer successful:", signature); + + if (callback) { + callback({ + text: `Successfully transferred ${content.amount} tokens to ${content.recipient}\nTransaction: ${signature}`, + content: { + success: true, + signature, + amount: content.amount, + recipient: content.recipient, + }, + }); } - }); - } - return true; -} catch (error) { - console.error("Error during token transfer:", error); + return true; + } catch (error) { + console.error("Error during token transfer:", error); if (callback) { callback({ text: `Error transferring tokens: ${error.message}`, - content: { error: error.message } + content: { error: error.message }, }); } return false; @@ -225,22 +245,22 @@ try { { user: "{{user1}}", content: { - text: "Send 69 EZSIS BieefG47jAHCGZBxi2q87RDuHyGZyYC3vAzxpyu8pump to 9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa" - } + text: "Send 69 EZSIS BieefG47jAHCGZBxi2q87RDuHyGZyYC3vAzxpyu8pump to 9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa", + }, }, { user: "{{user2}}", content: { text: "I'll send 69 EZSIS tokens now...", - action: "SEND_TOKEN" - } + action: "SEND_TOKEN", + }, }, { user: "{{user2}}", content: { - text: "Successfully sent 69 EZSIS tokens to 9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa\nTransaction: 5KtPn3DXXzHkb7VAVHZGwXJQqww39ASnrf7YkyJoF2qAGEpBEEGvRHLnnTG8ZVwKqNHMqSckWVGnsQAgfH5pbxEb" - } - } - ] - ] as ActionExample[][] + text: "Successfully sent 69 EZSIS tokens to 9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa\nTransaction: 5KtPn3DXXzHkb7VAVHZGwXJQqww39ASnrf7YkyJoF2qAGEpBEEGvRHLnnTG8ZVwKqNHMqSckWVGnsQAgfH5pbxEb", + }, + }, + ], + ] as ActionExample[][], } as Action; diff --git a/packages/plugin-solana/src/evaluators/trust.ts b/packages/plugin-solana/src/evaluators/trust.ts index 7ddee83b3e0..3d9d5295825 100644 --- a/packages/plugin-solana/src/evaluators/trust.ts +++ b/packages/plugin-solana/src/evaluators/trust.ts @@ -12,7 +12,7 @@ import { Memory, ModelClass, Evaluator, -} from "@ai16z/eliza/src/types.ts"; +} from "@ai16z/eliza"; import { stringToUuid } from "@ai16z/eliza/src/uuid.ts"; import { TrustScoreManager } from "../providers/trustScoreProvider.ts"; import { TokenProvider } from "../providers/token.ts"; diff --git a/packages/plugin-solana/src/index.ts b/packages/plugin-solana/src/index.ts index 02deb267747..7d6a5bedcec 100644 --- a/packages/plugin-solana/src/index.ts +++ b/packages/plugin-solana/src/index.ts @@ -1,4 +1,4 @@ -import { Plugin } from "@ai16z/eliza/src/types.ts"; +import { Plugin } from "@ai16z/eliza"; //import { executeSwap } from "./actions/swap.ts"; //import take_order from "./actions/takeOrder"; //import pumpfun from "./actions/pumpfun.ts"; @@ -18,9 +18,7 @@ export const solanaPlugin: Plugin = { //executeSwapForDAO, //take_order, ], - evaluators: [ - trustEvaluator - ], + evaluators: [trustEvaluator], providers: [walletProvider, trustScoreProvider], }; diff --git a/packages/plugin-solana/src/providers/orderBook.ts b/packages/plugin-solana/src/providers/orderBook.ts index 07870368686..40a215762ab 100644 --- a/packages/plugin-solana/src/providers/orderBook.ts +++ b/packages/plugin-solana/src/providers/orderBook.ts @@ -1,9 +1,4 @@ -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; import * as fs from "fs"; import settings from "@ai16z/eliza/src/settings.ts"; diff --git a/packages/plugin-solana/src/providers/token.ts b/packages/plugin-solana/src/providers/token.ts index 01d84d97942..538e44349a7 100644 --- a/packages/plugin-solana/src/providers/token.ts +++ b/packages/plugin-solana/src/providers/token.ts @@ -1,10 +1,5 @@ import settings from "@ai16z/eliza/src/settings.ts"; -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; import { DexScreenerData, DexScreenerPair, diff --git a/packages/plugin-solana/src/providers/trustScoreProvider.ts b/packages/plugin-solana/src/providers/trustScoreProvider.ts index 574632bd898..8243879f355 100644 --- a/packages/plugin-solana/src/providers/trustScoreProvider.ts +++ b/packages/plugin-solana/src/providers/trustScoreProvider.ts @@ -18,12 +18,7 @@ import { TokenRecommendation, } from "../adapters/trustScoreDatabase.ts"; import settings from "@ai16z/eliza/src/settings.ts"; -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; const Wallet = settings.MAIN_WALLET_ADDRESS; interface TradeData { diff --git a/packages/plugin-solana/src/providers/wallet.ts b/packages/plugin-solana/src/providers/wallet.ts index 8211795af83..09f8e4be762 100644 --- a/packages/plugin-solana/src/providers/wallet.ts +++ b/packages/plugin-solana/src/providers/wallet.ts @@ -1,9 +1,4 @@ -import { - IAgentRuntime, - Memory, - Provider, - State, -} from "@ai16z/eliza/src/types.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; import { Connection, PublicKey } from "@solana/web3.js"; import BigNumber from "bignumber.js"; diff --git a/packages/plugin-solana/tsup.config.ts b/packages/plugin-solana/tsup.config.ts index e42bf4efeae..748866db568 100644 --- a/packages/plugin-solana/tsup.config.ts +++ b/packages/plugin-solana/tsup.config.ts @@ -15,6 +15,9 @@ export default defineConfig({ "https", "http", "agentkeepalive", + "bs58", + "buffer", + "@solana/buffer-layout", // Add other modules you want to externalize ], }); diff --git a/packages/plugin-starknet/src/providers/wallet.ts b/packages/plugin-starknet/src/providers/wallet.ts index f5c8ff5d715..42727a27399 100644 --- a/packages/plugin-starknet/src/providers/wallet.ts +++ b/packages/plugin-starknet/src/providers/wallet.ts @@ -24,7 +24,7 @@ export class WalletProvider { this.provider = getStarknetProvider(runtime); } - async getFormattedTokenBalances(): Promise<string> {\ + async getFormattedTokenBalances(): Promise<string> { return ""; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cd8b912f863..98c833ad1d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,7 +59,7 @@ importers: version: 3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(prop-types@15.8.1)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) '@docusaurus/preset-classic': specifier: ^3.6.0 - version: 3.6.1(@algolia/client-search@5.13.0)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10) + version: 3.6.1(@algolia/client-search@5.14.2)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10) '@docusaurus/theme-mermaid': specifier: ^3.6.0 version: 3.6.1(@docusaurus/plugin-content-docs@3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10))(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -93,13 +93,13 @@ importers: version: 3.6.0(acorn@8.14.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) docusaurus-plugin-typedoc: specifier: ^1.0.5 - version: 1.0.5(typedoc-plugin-markdown@4.2.9(typedoc@0.26.11(typescript@5.6.3))) + version: 1.0.5(typedoc-plugin-markdown@4.2.10(typedoc@0.26.11(typescript@5.6.3))) typedoc: specifier: ^0.26.11 version: 0.26.11(typescript@5.6.3) typedoc-plugin-markdown: specifier: ^4.2.9 - version: 4.2.9(typedoc@0.26.11(typescript@5.6.3)) + version: 4.2.10(typedoc@0.26.11(typescript@5.6.3)) packages/adapter-postgres: dependencies: @@ -397,7 +397,7 @@ importers: version: 10.0.0 ai: specifier: ^3.4.23 - version: 3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.1.16))(svelte@5.1.16)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) + version: 3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.2.0))(svelte@5.2.0)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) anthropic-vertex-ai: specifier: ^1.0.0 version: 1.0.0(encoding@0.1.13)(zod@3.23.8) @@ -437,7 +437,7 @@ importers: devDependencies: '@eslint/js': specifier: ^9.13.0 - version: 9.14.0 + version: 9.15.0 '@rollup/plugin-commonjs': specifier: 25.0.8 version: 25.0.8(rollup@2.79.2) @@ -747,7 +747,7 @@ importers: version: 5.1.2 pumpdotfun-sdk: specifier: 1.3.2 - version: 1.3.2(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(rollup@4.26.0)(typescript@5.6.3)(utf-8-validate@5.0.10) + version: 1.3.2(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(rollup@4.27.2)(typescript@5.6.3)(utf-8-validate@5.0.10) tsup: specifier: ^8.3.5 version: 8.3.5(jiti@1.21.6)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.0) @@ -927,8 +927,8 @@ packages: '@algolia/cache-in-memory@4.24.0': resolution: {integrity: sha512-gDrt2so19jW26jY3/MkFg5mEypFIPbPoXsQGQWAi6TrCPsNOSEYepBMPlucqWigsmEy/prp5ug2jy/N3PVG/8w==} - '@algolia/client-abtesting@5.13.0': - resolution: {integrity: sha512-6CoQjlMi1pmQYMQO8tXfuGxSPf6iKX5FP9MuMe6IWmvC81wwTvOehnwchyBl2wuPVhcw2Ar53K53mQ60DAC64g==} + '@algolia/client-abtesting@5.14.2': + resolution: {integrity: sha512-7fq1tWIy1aNJEaNHxWy3EwDkuo4k22+NBnxq9QlYVSLLXtr6HqmAm6bQgNNzGT3vm21iKqWO9efk+HIhEM1SzQ==} engines: {node: '>= 14.0.0'} '@algolia/client-account@4.24.0': @@ -937,44 +937,44 @@ packages: '@algolia/client-analytics@4.24.0': resolution: {integrity: sha512-y8jOZt1OjwWU4N2qr8G4AxXAzaa8DBvyHTWlHzX/7Me1LX8OayfgHexqrsL4vSBcoMmVw2XnVW9MhL+Y2ZDJXg==} - '@algolia/client-analytics@5.13.0': - resolution: {integrity: sha512-pS3qyXiWTwKnrt/jE79fqkNqZp7kjsFNlJDcBGkSWid74DNc6DmArlkvPqyLxnoaYGjUGACT6g56n7E3mVV2TA==} + '@algolia/client-analytics@5.14.2': + resolution: {integrity: sha512-5Nm5cOOyAGcY+hKNJVmR2jgoGn1nvoANS8W5EfB8yAaUqUxL3lFNUHSkFafAMTCOcVKNDkZQYjUDbOOfdYJLqw==} engines: {node: '>= 14.0.0'} '@algolia/client-common@4.24.0': resolution: {integrity: sha512-bc2ROsNL6w6rqpl5jj/UywlIYC21TwSSoFHKl01lYirGMW+9Eek6r02Tocg4gZ8HAw3iBvu6XQiM3BEbmEMoiA==} - '@algolia/client-common@5.13.0': - resolution: {integrity: sha512-2SP6bGGWOTN920MLZv8s7yIR3OqY03vEe4U+vb2MGdL8a/8EQznF3L/nTC/rGf/hvEfZlX2tGFxPJaF2waravg==} + '@algolia/client-common@5.14.2': + resolution: {integrity: sha512-BW1Qzhh9tMKEsWSQQsiOEcHAd6g7zxq9RpPVmyxbDO/O4eA4vyN+Qz5Jzo686kuYdIQKqIPCEtob/JM89tk57g==} engines: {node: '>= 14.0.0'} - '@algolia/client-insights@5.13.0': - resolution: {integrity: sha512-ldHTe+LVgC6L4Wr6doAQQ7Ku0jAdhaaPg1T+IHzmmiRZb2Uq5OsjW2yC65JifOmzPCiMkIZE2mGRpWgkn5ktlw==} + '@algolia/client-insights@5.14.2': + resolution: {integrity: sha512-17zg6pqifKORvvrMIqW6HhwUry9RKRXLgADrgFjZ6PZvGB4oVs12dwRG2/HMrIlpxd9cjeQfdlEgHj6lbAf6QA==} engines: {node: '>= 14.0.0'} '@algolia/client-personalization@4.24.0': resolution: {integrity: sha512-l5FRFm/yngztweU0HdUzz1rC4yoWCFo3IF+dVIVTfEPg906eZg5BOd1k0K6rZx5JzyyoP4LdmOikfkfGsKVE9w==} - '@algolia/client-personalization@5.13.0': - resolution: {integrity: sha512-RnCfOSN4OUJDuMNHFca2M8lY64Tmw0kQOZikge4TknTqHmlbKJb8IbJE7Rol79Z80W2Y+B1ydcjV7DPje4GMRA==} + '@algolia/client-personalization@5.14.2': + resolution: {integrity: sha512-5IYt8vbmTA52xyuaZKFwiRoDPeh7hiOC9aBZqqp9fVs6BU01djI/T8pGJXawvwczltCPYzNsdbllV3rqiDbxmQ==} engines: {node: '>= 14.0.0'} - '@algolia/client-query-suggestions@5.13.0': - resolution: {integrity: sha512-pYo0jbLUtPDN1r341UHTaF2fgN5rbaZfDZqjPRKPM+FRlRmxFxqFQm1UUfpkSUWYGn7lECwDpbKYiKUf81MTwA==} + '@algolia/client-query-suggestions@5.14.2': + resolution: {integrity: sha512-gvCX/cczU76Bu1sGcxxTdoIwxe+FnuC1IlW9SF/gzxd3ZzsgzBpzD2puIJqt9fHQsjLxVGkJqKev2FtExnJYZg==} engines: {node: '>= 14.0.0'} '@algolia/client-search@4.24.0': resolution: {integrity: sha512-uRW6EpNapmLAD0mW47OXqTP8eiIx5F6qN9/x/7HHO6owL3N1IXqydGwW5nhDFBrV+ldouro2W1VX3XlcUXEFCA==} - '@algolia/client-search@5.13.0': - resolution: {integrity: sha512-s2ge3uZ6Zg2sPSFibqijgEYsuorxcc8KVHg3I95nOPHvFHdnBtSHymhZvq4sp/fu8ijt/Y8jLwkuqm5myn+2Sg==} + '@algolia/client-search@5.14.2': + resolution: {integrity: sha512-0imdBZDjqxrshw0+eyJUgnkRAbS2W93UQ3BVj8VjN4xQylIMf0fWs72W7MZFdHlH78JJYydevgzqvGMcV0Z1CA==} engines: {node: '>= 14.0.0'} '@algolia/events@4.0.1': resolution: {integrity: sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==} - '@algolia/ingestion@1.13.0': - resolution: {integrity: sha512-fm5LEOe4FPDOc1D+M9stEs8hfcdmbdD+pt9og5shql6ueTZJANDbFoQhDOpiPJizR/ps1GwmjkWfUEywx3sV+Q==} + '@algolia/ingestion@1.14.2': + resolution: {integrity: sha512-/p4rBNkW0fgCpCwrwre+jHfzlFQsLemgaAQqyui8NPxw95Wgf3p+DKxYzcmh8dygT7ub7FwztTW+uURLX1uqIQ==} engines: {node: '>= 14.0.0'} '@algolia/logger-common@4.24.0': @@ -983,36 +983,36 @@ packages: '@algolia/logger-console@4.24.0': resolution: {integrity: sha512-X4C8IoHgHfiUROfoRCV+lzSy+LHMgkoEEU1BbKcsfnV0i0S20zyy0NLww9dwVHUWNfPPxdMU+/wKmLGYf96yTg==} - '@algolia/monitoring@1.13.0': - resolution: {integrity: sha512-e8Hshlnm2G5fapyUgWTBwhJ22yXcnLtPC4LWZKx7KOvv35GcdoHtlUBX94I/sWCJLraUr65JvR8qOo3LXC43dg==} + '@algolia/monitoring@1.14.2': + resolution: {integrity: sha512-81R57Y/mS0uNhWpu6cNEfkbkADLW4bP0BNjuPpxAypobv7WzYycUnbMvv1YkN6OsociB4+3M7HfsVzj4Nc09vA==} engines: {node: '>= 14.0.0'} '@algolia/recommend@4.24.0': resolution: {integrity: sha512-P9kcgerfVBpfYHDfVZDvvdJv0lEoCvzNlOy2nykyt5bK8TyieYyiD0lguIJdRZZYGre03WIAFf14pgE+V+IBlw==} - '@algolia/recommend@5.13.0': - resolution: {integrity: sha512-53/wW96oaj1FKMzGdFcZ/epygfTppLDUvgI1thLkd475EtVZCH3ZZVUNCEvf1AtnNyH1RnItkFzX8ayWCpx2PQ==} + '@algolia/recommend@5.14.2': + resolution: {integrity: sha512-OwELnAZxCUyfjYjqsrFmC7Vfa12kqwbDdLUV0oi4j+4pxDsfPgkiZ6iCH2uPw6X8VK88Hl3InPt+RPaZvcrCWg==} engines: {node: '>= 14.0.0'} '@algolia/requester-browser-xhr@4.24.0': resolution: {integrity: sha512-Z2NxZMb6+nVXSjF13YpjYTdvV3032YTBSGm2vnYvYPA6mMxzM3v5rsCiSspndn9rzIW4Qp1lPHBvuoKJV6jnAA==} - '@algolia/requester-browser-xhr@5.13.0': - resolution: {integrity: sha512-NV6oSCt5lFuzfsVQoSBpewEWf/h4ySr7pv2bfwu9yF/jc/g39pig8+YpuqsxlRWBm/lTGVA2V0Ai9ySwrNumIA==} + '@algolia/requester-browser-xhr@5.14.2': + resolution: {integrity: sha512-irUvkK+TGBhyivtNCIIbVgNUgbUoHOSk8m/kFX4ddto/PUPmLFRRNNnMHtJ1+OzrJ/uD3Am4FUK2Yt+xgQr05w==} engines: {node: '>= 14.0.0'} '@algolia/requester-common@4.24.0': resolution: {integrity: sha512-k3CXJ2OVnvgE3HMwcojpvY6d9kgKMPRxs/kVohrwF5WMr2fnqojnycZkxPoEg+bXm8fi5BBfFmOqgYztRtHsQA==} - '@algolia/requester-fetch@5.13.0': - resolution: {integrity: sha512-094bK4rumf+rXJazxv3mq6eKRM0ep5AxIo8T0YmOdldswQt79apeufFiPLN19nHEWH22xR2FelimD+T/wRSP+Q==} + '@algolia/requester-fetch@5.14.2': + resolution: {integrity: sha512-UNBg5mM4MIYdxPuVjyDL22BC6P87g7WuM91Z1Ky0J19aEGvCSF+oR+9autthROFXdRnAa1rACOjuqn95iBbKpw==} engines: {node: '>= 14.0.0'} '@algolia/requester-node-http@4.24.0': resolution: {integrity: sha512-JF18yTjNOVYvU/L3UosRcvbPMGT9B+/GQWNWnenIImglzNVGpyzChkXLnrSf6uxwVNO6ESGu6oN8MqcGQcjQJw==} - '@algolia/requester-node-http@5.13.0': - resolution: {integrity: sha512-JY5xhEYMgki53Wm+A6R2jUpOUdD0zZnBq+PC5R1TGMNOYL1s6JjDrJeMsvaI2YWxYMUSoCnRoltN/yf9RI8n3A==} + '@algolia/requester-node-http@5.14.2': + resolution: {integrity: sha512-CTFA03YiLcnpP+JoLRqjHt5pqDHuKWJpLsIBY/60Gmw8pjALZ3TwvbAquRX4Vy+yrin178NxMuU+ilZ54f2IrQ==} engines: {node: '>= 14.0.0'} '@algolia/transporter@4.24.0': @@ -2352,24 +2352,24 @@ packages: resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} + '@eslint/eslintrc@3.2.0': + resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/js@9.13.0': resolution: {integrity: sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.14.0': - resolution: {integrity: sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==} + '@eslint/js@9.15.0': + resolution: {integrity: sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.2': - resolution: {integrity: sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==} + '@eslint/plugin-kit@0.2.3': + resolution: {integrity: sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@google-cloud/vertexai@1.9.0': @@ -2834,67 +2834,67 @@ packages: resolution: {integrity: sha512-y7efHHwghQfk28G2z3tlZ67pLG0XdfYbcVG26r7YIXALRsrVQcTq4/tdenSmdOrEsNahIYA/eh8aEVROWGFUDg==} engines: {node: ^16.14.0 || >=18.0.0} - '@nx/devkit@20.1.0': - resolution: {integrity: sha512-TDWT3d7nei+FtqoZscR7KtbQ9BXzV1c1Wvk9UUejo7eXbrQ/+YnHVVze8EMuIgTXaHxNIBTKGUPcRi3cibmCDw==} + '@nx/devkit@20.1.2': + resolution: {integrity: sha512-MTEWiEST7DhzZ2QmrixLnHfYVDZk7QN9omLL8m+5Etcn/3ZKa1aAo9Amd2MkUM+0MPoTKnxoGdw0fQUpAy21Mg==} peerDependencies: nx: '>= 19 <= 21' - '@nx/nx-darwin-arm64@20.1.0': - resolution: {integrity: sha512-fel9LpSWuwY0cGAsRFEPxLp6J5VcK/5sjeWA0lZWrFf1oQJCOlKBfkxzi384Nd7eK5JSjxIXrpYfRLaqSbp+IA==} + '@nx/nx-darwin-arm64@20.1.2': + resolution: {integrity: sha512-PJ91TQhd28kitDBubKUOXMYvrtSDrG+rr8MsIe9cHo1CvU9smcGVBwuHBxniq0DXsyOX/5GL6ngq7hjN2nQ3XQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@nx/nx-darwin-x64@20.1.0': - resolution: {integrity: sha512-l1DB8dk2rCLGgXW26HmFOKYpUCF259LRus8z+z7dsFv5vz9TeN+fk5m9aAdiENgMA2cGlndQQW+E8UIo3yv+9g==} + '@nx/nx-darwin-x64@20.1.2': + resolution: {integrity: sha512-1fopau7nxIhTF26vDTIzMxl15AtW4FvUSdy+r1mNRKrKyjjpqnlu00SQBW7JzGV0agDD1B/61yYei5Q2aMOt7Q==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@nx/nx-freebsd-x64@20.1.0': - resolution: {integrity: sha512-f8uMRIhiOA/73cIjiyS3gpKvaAtsHgyUkkoCOPc4xdxoSLAjlxb6VOUPIFj9rzLA6qQXImVpsiNPG+p1sJ1GAQ==} + '@nx/nx-freebsd-x64@20.1.2': + resolution: {integrity: sha512-55YgIp3v4zz7xMzJO93dtglbOTER2XdS6jrCt8GbKaWGFl5drRrBoNGONtiGNU7C3hLx1VsorbynCkJT18PjKQ==} engines: {node: '>= 10'} cpu: [x64] os: [freebsd] - '@nx/nx-linux-arm-gnueabihf@20.1.0': - resolution: {integrity: sha512-M7pay8hFJQZ3uJHlr5hZK/8o1BcHt95hy/SU7Azt7+LKQGOy42tXhHO30As9APzXqRmvoA2Iq1IyrJJicrz+Ew==} + '@nx/nx-linux-arm-gnueabihf@20.1.2': + resolution: {integrity: sha512-sMhNA8uAV43UYVEXEa8TZ8Fjpom4CGq1umTptEGOF4TTtdNn2AUBreg+0bVODM8MMSzRWGI1VbkZzHESnAPwqw==} engines: {node: '>= 10'} cpu: [arm] os: [linux] - '@nx/nx-linux-arm64-gnu@20.1.0': - resolution: {integrity: sha512-A5+Kpk1uwYIj6CPm0DWLVz5wNTN4ewNl7ajLS9YJOi4yHx/FhfMMyPj4ZnbTpc4isuvgZwBZNl8kwFb2RdXq4w==} + '@nx/nx-linux-arm64-gnu@20.1.2': + resolution: {integrity: sha512-bsevarNHglaYLmIvPNQOdHrBnBgaW3EOUM0flwaXdWuZbL1bWx8GoVwHp9yJpZOAOfIF/Nhq5iTpaZB2nYFrAA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@nx/nx-linux-arm64-musl@20.1.0': - resolution: {integrity: sha512-pWIQPt9Fst1O4dgrWHdU1b+5wpfLmsmaSeRvLQ9b2VFp3tKGko4ie0skme62TuMgpcqMWDBFKs8KgbHESOi7vw==} + '@nx/nx-linux-arm64-musl@20.1.2': + resolution: {integrity: sha512-GFZTptkhZPL/iZ3tYDmspIcPEaXyy/L/o59gyp33GoFAAyDhiXIF7J1Lz81Xn8VKrX6TvEY8/9qSh86pb7qzDQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@nx/nx-linux-x64-gnu@20.1.0': - resolution: {integrity: sha512-sOpeGOHznk2ztCXzKhRPAKG3WtwaQUsfQ/3aYDXE6z+rSfyZTGY29M/a9FbdjI4cLJX+NdLAAMj15c3VecJ65g==} + '@nx/nx-linux-x64-gnu@20.1.2': + resolution: {integrity: sha512-yqEW/iglKT4d9lgfnwSNhmDzPxCkRhtdmZqOYpGDM0eZFwYwJF+WRGjW8xIqMj8PA1yrGItzXZOmyFjJqHAF2w==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@nx/nx-linux-x64-musl@20.1.0': - resolution: {integrity: sha512-SxnQJhjOvuOfUZnF4Wt4/O/l1e21qpACZzfMaPIvmiTLk9zPJZWtfgbqlKtTXHKWq9DfIUZQqZXRIpHPM1sDZQ==} + '@nx/nx-linux-x64-musl@20.1.2': + resolution: {integrity: sha512-SP6PpWT4cQVrC4WJQdpfADrYJQzkbhgmcGleWbpr7II1HJgOsAcvoDwQGpPQX+3Wo+VBiNecvUAOzacMQkXPGw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@nx/nx-win32-arm64-msvc@20.1.0': - resolution: {integrity: sha512-Z/KoaAA+Rg9iqqOPkKZV61MejPoJBOHlecFpq0G4TgKMJEJ/hEsjojq5usO1fUGAbvQT/SXL3pYWgZwhD3VEHw==} + '@nx/nx-win32-arm64-msvc@20.1.2': + resolution: {integrity: sha512-JZQx9gr39LY3D7uleiXlpxUsavuOrOQNBocwKHkAMnykaT/e1VCxTnm/hk+2b4foWwfURTqoRiFEba70iiCdYg==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@nx/nx-win32-x64-msvc@20.1.0': - resolution: {integrity: sha512-pbxacjLsW9vXD9FibvU8Pal/r5+Yq6AaW6I57CDi7jsLt+K6jcS0fP4FlfXT8QFWdx9+bOKNfOsKEIwpirMN1w==} + '@nx/nx-win32-x64-msvc@20.1.2': + resolution: {integrity: sha512-6GmT8iswDiCvJaCtW9DpWeAQmLS/kfAuRLYBisfzlONuLPaDdjhgVIxZBqqUSFfclwcVz+NhIOGvdr0aGFZCtQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -3292,93 +3292,93 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.26.0': - resolution: {integrity: sha512-gJNwtPDGEaOEgejbaseY6xMFu+CPltsc8/T+diUTTbOQLqD+bnrJq9ulH6WD69TqwqWmrfRAtUv30cCFZlbGTQ==} + '@rollup/rollup-android-arm-eabi@4.27.2': + resolution: {integrity: sha512-Tj+j7Pyzd15wAdSJswvs5CJzJNV+qqSUcr/aCD+jpQSBtXvGnV0pnrjoc8zFTe9fcKCatkpFpOO7yAzpO998HA==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.26.0': - resolution: {integrity: sha512-YJa5Gy8mEZgz5JquFruhJODMq3lTHWLm1fOy+HIANquLzfIOzE9RA5ie3JjCdVb9r46qfAQY/l947V0zfGJ0OQ==} + '@rollup/rollup-android-arm64@4.27.2': + resolution: {integrity: sha512-xsPeJgh2ThBpUqlLgRfiVYBEf/P1nWlWvReG+aBWfNv3XEBpa6ZCmxSVnxJgLgkNz4IbxpLy64h2gCmAAQLneQ==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.26.0': - resolution: {integrity: sha512-ErTASs8YKbqTBoPLp/kA1B1Um5YSom8QAc4rKhg7b9tyyVqDBlQxy7Bf2wW7yIlPGPg2UODDQcbkTlruPzDosw==} + '@rollup/rollup-darwin-arm64@4.27.2': + resolution: {integrity: sha512-KnXU4m9MywuZFedL35Z3PuwiTSn/yqRIhrEA9j+7OSkji39NzVkgxuxTYg5F8ryGysq4iFADaU5osSizMXhU2A==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.26.0': - resolution: {integrity: sha512-wbgkYDHcdWW+NqP2mnf2NOuEbOLzDblalrOWcPyY6+BRbVhliavon15UploG7PpBRQ2bZJnbmh8o3yLoBvDIHA==} + '@rollup/rollup-darwin-x64@4.27.2': + resolution: {integrity: sha512-Hj77A3yTvUeCIx/Vi+4d4IbYhyTwtHj07lVzUgpUq9YpJSEiGJj4vXMKwzJ3w5zp5v3PFvpJNgc/J31smZey6g==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.26.0': - resolution: {integrity: sha512-Y9vpjfp9CDkAG4q/uwuhZk96LP11fBz/bYdyg9oaHYhtGZp7NrbkQrj/66DYMMP2Yo/QPAsVHkV891KyO52fhg==} + '@rollup/rollup-freebsd-arm64@4.27.2': + resolution: {integrity: sha512-RjgKf5C3xbn8gxvCm5VgKZ4nn0pRAIe90J0/fdHUsgztd3+Zesb2lm2+r6uX4prV2eUByuxJNdt647/1KPRq5g==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.26.0': - resolution: {integrity: sha512-A/jvfCZ55EYPsqeaAt/yDAG4q5tt1ZboWMHEvKAH9Zl92DWvMIbnZe/f/eOXze65aJaaKbL+YeM0Hz4kLQvdwg==} + '@rollup/rollup-freebsd-x64@4.27.2': + resolution: {integrity: sha512-duq21FoXwQtuws+V9H6UZ+eCBc7fxSpMK1GQINKn3fAyd9DFYKPJNcUhdIKOrMFjLEJgQskoMoiuizMt+dl20g==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.26.0': - resolution: {integrity: sha512-paHF1bMXKDuizaMODm2bBTjRiHxESWiIyIdMugKeLnjuS1TCS54MF5+Y5Dx8Ui/1RBPVRE09i5OUlaLnv8OGnA==} + '@rollup/rollup-linux-arm-gnueabihf@4.27.2': + resolution: {integrity: sha512-6npqOKEPRZkLrMcvyC/32OzJ2srdPzCylJjiTJT2c0bwwSGm7nz2F9mNQ1WrAqCBZROcQn91Fno+khFhVijmFA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.26.0': - resolution: {integrity: sha512-cwxiHZU1GAs+TMxvgPfUDtVZjdBdTsQwVnNlzRXC5QzIJ6nhfB4I1ahKoe9yPmoaA/Vhf7m9dB1chGPpDRdGXg==} + '@rollup/rollup-linux-arm-musleabihf@4.27.2': + resolution: {integrity: sha512-V9Xg6eXtgBtHq2jnuQwM/jr2mwe2EycnopO8cbOvpzFuySCGtKlPCI3Hj9xup/pJK5Q0388qfZZy2DqV2J8ftw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.26.0': - resolution: {integrity: sha512-4daeEUQutGRCW/9zEo8JtdAgtJ1q2g5oHaoQaZbMSKaIWKDQwQ3Yx0/3jJNmpzrsScIPtx/V+1AfibLisb3AMQ==} + '@rollup/rollup-linux-arm64-gnu@4.27.2': + resolution: {integrity: sha512-uCFX9gtZJoQl2xDTpRdseYuNqyKkuMDtH6zSrBTA28yTfKyjN9hQ2B04N5ynR8ILCoSDOrG/Eg+J2TtJ1e/CSA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.26.0': - resolution: {integrity: sha512-eGkX7zzkNxvvS05ROzJ/cO/AKqNvR/7t1jA3VZDi2vRniLKwAWxUr85fH3NsvtxU5vnUUKFHKh8flIBdlo2b3Q==} + '@rollup/rollup-linux-arm64-musl@4.27.2': + resolution: {integrity: sha512-/PU9P+7Rkz8JFYDHIi+xzHabOu9qEWR07L5nWLIUsvserrxegZExKCi2jhMZRd0ATdboKylu/K5yAXbp7fYFvA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.26.0': - resolution: {integrity: sha512-Odp/lgHbW/mAqw/pU21goo5ruWsytP7/HCC/liOt0zcGG0llYWKrd10k9Fj0pdj3prQ63N5yQLCLiE7HTX+MYw==} + '@rollup/rollup-linux-powerpc64le-gnu@4.27.2': + resolution: {integrity: sha512-eCHmol/dT5odMYi/N0R0HC8V8QE40rEpkyje/ZAXJYNNoSfrObOvG/Mn+s1F/FJyB7co7UQZZf6FuWnN6a7f4g==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.26.0': - resolution: {integrity: sha512-MBR2ZhCTzUgVD0OJdTzNeF4+zsVogIR1U/FsyuFerwcqjZGvg2nYe24SAHp8O5sN8ZkRVbHwlYeHqcSQ8tcYew==} + '@rollup/rollup-linux-riscv64-gnu@4.27.2': + resolution: {integrity: sha512-DEP3Njr9/ADDln3kNi76PXonLMSSMiCir0VHXxmGSHxCxDfQ70oWjHcJGfiBugzaqmYdTC7Y+8Int6qbnxPBIQ==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.26.0': - resolution: {integrity: sha512-YYcg8MkbN17fMbRMZuxwmxWqsmQufh3ZJFxFGoHjrE7bv0X+T6l3glcdzd7IKLiwhT+PZOJCblpnNlz1/C3kGQ==} + '@rollup/rollup-linux-s390x-gnu@4.27.2': + resolution: {integrity: sha512-NHGo5i6IE/PtEPh5m0yw5OmPMpesFnzMIS/lzvN5vknnC1sXM5Z/id5VgcNPgpD+wHmIcuYYgW+Q53v+9s96lQ==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.26.0': - resolution: {integrity: sha512-ZuwpfjCwjPkAOxpjAEjabg6LRSfL7cAJb6gSQGZYjGhadlzKKywDkCUnJ+KEfrNY1jH5EEoSIKLCb572jSiglA==} + '@rollup/rollup-linux-x64-gnu@4.27.2': + resolution: {integrity: sha512-PaW2DY5Tan+IFvNJGHDmUrORadbe/Ceh8tQxi8cmdQVCCYsLoQo2cuaSj+AU+YRX8M4ivS2vJ9UGaxfuNN7gmg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.26.0': - resolution: {integrity: sha512-+HJD2lFS86qkeF8kNu0kALtifMpPCZU80HvwztIKnYwym3KnA1os6nsX4BGSTLtS2QVAGG1P3guRgsYyMA0Yhg==} + '@rollup/rollup-linux-x64-musl@4.27.2': + resolution: {integrity: sha512-dOlWEMg2gI91Qx5I/HYqOD6iqlJspxLcS4Zlg3vjk1srE67z5T2Uz91yg/qA8sY0XcwQrFzWWiZhMNERylLrpQ==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.26.0': - resolution: {integrity: sha512-WUQzVFWPSw2uJzX4j6YEbMAiLbs0BUysgysh8s817doAYhR5ybqTI1wtKARQKo6cGop3pHnrUJPFCsXdoFaimQ==} + '@rollup/rollup-win32-arm64-msvc@4.27.2': + resolution: {integrity: sha512-euMIv/4x5Y2/ImlbGl88mwKNXDsvzbWUlT7DFky76z2keajCtcbAsN9LUdmk31hAoVmJJYSThgdA0EsPeTr1+w==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.26.0': - resolution: {integrity: sha512-D4CxkazFKBfN1akAIY6ieyOqzoOoBV1OICxgUblWxff/pSjCA2khXlASUx7mK6W1oP4McqhgcCsu6QaLj3WMWg==} + '@rollup/rollup-win32-ia32-msvc@4.27.2': + resolution: {integrity: sha512-RsnE6LQkUHlkC10RKngtHNLxb7scFykEbEwOFDjr3CeCMG+Rr+cKqlkKc2/wJ1u4u990urRHCbjz31x84PBrSQ==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.26.0': - resolution: {integrity: sha512-2x8MO1rm4PGEP0xWbubJW5RtbNLk3puzAMaLQd3B3JHVw4KcHlmXcO+Wewx9zCoo7EUFiMlu/aZbCJ7VjMzAag==} + '@rollup/rollup-win32-x64-msvc@4.27.2': + resolution: {integrity: sha512-foJM5vv+z2KQmn7emYdDLyTbkoO5bkHZE1oth2tWbQNGW7mX32d46Hz6T0MqXdWS2vBZhaEtHqdy9WYwGfiliA==} cpu: [x64] os: [win32] @@ -3407,17 +3407,17 @@ packages: '@selderee/plugin-htmlparser2@0.11.0': resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} - '@shikijs/core@1.22.2': - resolution: {integrity: sha512-bvIQcd8BEeR1yFvOYv6HDiyta2FFVePbzeowf5pPS1avczrPK+cjmaxxh0nx5QzbON7+Sv0sQfQVciO7bN72sg==} + '@shikijs/core@1.23.0': + resolution: {integrity: sha512-J4Fo22oBlfRHAXec+1AEzcowv+Qdf4ZQkuP/X/UHYH9+KA9LvyFXSXyS+HxuBRFfon+u7bsmKdRBjoZlbDVRkQ==} - '@shikijs/engine-javascript@1.22.2': - resolution: {integrity: sha512-iOvql09ql6m+3d1vtvP8fLCVCK7BQD1pJFmHIECsujB0V32BJ0Ab6hxk1ewVSMFA58FI0pR2Had9BKZdyQrxTw==} + '@shikijs/engine-javascript@1.23.0': + resolution: {integrity: sha512-CcrppseWShG+8Efp1iil9divltuXVdCaU4iu+CKvzTGZO5RmXyAiSx668M7VbX8+s/vt1ZKu75Vn/jWi8O3G/Q==} - '@shikijs/engine-oniguruma@1.22.2': - resolution: {integrity: sha512-GIZPAGzQOy56mGvWMoZRPggn0dTlBf1gutV5TdceLCZlFNqWmuc7u+CzD0Gd9vQUTgLbrt0KLzz6FNprqYAxlA==} + '@shikijs/engine-oniguruma@1.23.0': + resolution: {integrity: sha512-gS8bZLqVvmZXX+E5JUMJICsBp+kx6gj79MH/UEpKHKIqnUzppgbmEn6zLa6mB5D+sHse2gFei3YYJxQe1EzZXQ==} - '@shikijs/types@1.22.2': - resolution: {integrity: sha512-NCWDa6LGZqTuzjsGfXOBWfjS/fDIbDdmVDug+7ykVe1IKT4c1gakrvlfFYp5NhAXH/lyqLM8wsAPo5wNy73Feg==} + '@shikijs/types@1.23.0': + resolution: {integrity: sha512-HiwzsihRao+IbPk7FER/EQT/D0dEEK3n5LAtHDzL5iRT+JMblA7y9uitUnjEnHeLkKigNM+ZplrP7MuEyyc5kA==} '@shikijs/vscode-textmate@9.3.0': resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==} @@ -4208,34 +4208,34 @@ packages: resolution: {integrity: sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA==} engines: {node: '>=v14.0.0', npm: '>=7.0.0'} - '@vue/compiler-core@3.5.12': - resolution: {integrity: sha512-ISyBTRMmMYagUxhcpyEH0hpXRd/KqDU4ymofPgl2XAkY9ZhQ+h0ovEZJIiPop13UmR/54oA2cgMDjgroRelaEw==} + '@vue/compiler-core@3.5.13': + resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} - '@vue/compiler-dom@3.5.12': - resolution: {integrity: sha512-9G6PbJ03uwxLHKQ3P42cMTi85lDRvGLB2rSGOiQqtXELat6uI4n8cNz9yjfVHRPIu+MsK6TE418Giruvgptckg==} + '@vue/compiler-dom@3.5.13': + resolution: {integrity: sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==} - '@vue/compiler-sfc@3.5.12': - resolution: {integrity: sha512-2k973OGo2JuAa5+ZlekuQJtitI5CgLMOwgl94BzMCsKZCX/xiqzJYzapl4opFogKHqwJk34vfsaKpfEhd1k5nw==} + '@vue/compiler-sfc@3.5.13': + resolution: {integrity: sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==} - '@vue/compiler-ssr@3.5.12': - resolution: {integrity: sha512-eLwc7v6bfGBSM7wZOGPmRavSWzNFF6+PdRhE+VFJhNCgHiF8AM7ccoqcv5kBXA2eWUfigD7byekvf/JsOfKvPA==} + '@vue/compiler-ssr@3.5.13': + resolution: {integrity: sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==} - '@vue/reactivity@3.5.12': - resolution: {integrity: sha512-UzaN3Da7xnJXdz4Okb/BGbAaomRHc3RdoWqTzlvd9+WBR5m3J39J1fGcHes7U3za0ruYn/iYy/a1euhMEHvTAg==} + '@vue/reactivity@3.5.13': + resolution: {integrity: sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==} - '@vue/runtime-core@3.5.12': - resolution: {integrity: sha512-hrMUYV6tpocr3TL3Ad8DqxOdpDe4zuQY4HPY3X/VRh+L2myQO8MFXPAMarIOSGNu0bFAjh1yBkMPXZBqCk62Uw==} + '@vue/runtime-core@3.5.13': + resolution: {integrity: sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==} - '@vue/runtime-dom@3.5.12': - resolution: {integrity: sha512-q8VFxR9A2MRfBr6/55Q3umyoN7ya836FzRXajPB6/Vvuv0zOPL+qltd9rIMzG/DbRLAIlREmnLsplEF/kotXKA==} + '@vue/runtime-dom@3.5.13': + resolution: {integrity: sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==} - '@vue/server-renderer@3.5.12': - resolution: {integrity: sha512-I3QoeDDeEPZm8yR28JtY+rk880Oqmj43hreIBVTicisFTx/Dl7JpG72g/X7YF8hnQD3IFhkky5i2bPonwrTVPg==} + '@vue/server-renderer@3.5.13': + resolution: {integrity: sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==} peerDependencies: - vue: 3.5.12 + vue: 3.5.13 - '@vue/shared@3.5.12': - resolution: {integrity: sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==} + '@vue/shared@3.5.13': + resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} '@webassemblyjs/ast@1.14.1': resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} @@ -4431,8 +4431,8 @@ packages: algoliasearch@4.24.0: resolution: {integrity: sha512-bf0QV/9jVejssFBmz2HQLxUadxk574t4iwjCKp5E7NBzwKkrDEhKPISIIjAU/p6K5qDx3qoeh4+26zWN1jmw3g==} - algoliasearch@5.13.0: - resolution: {integrity: sha512-04lyQX3Ev/oLYQx+aagamQDXvkUUfX1mwrLrus15+9fNaYj28GDxxEzbwaRfvmHFcZyoxvup7mMtDTTw8SrTEQ==} + algoliasearch@5.14.2: + resolution: {integrity: sha512-aYjI4WLamMxbhdJ2QAA99VbDCJOGzMOdT2agh57bi40n86ufkhZSIAf6mkocr7NmtBLtwCnSHvD5NJ+Ky5elWw==} engines: {node: '>= 14.0.0'} amp-message@0.1.2: @@ -6037,13 +6037,16 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.5.58: - resolution: {integrity: sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA==} + electron-to-chromium@1.5.61: + resolution: {integrity: sha512-CcRGSBCBB6L9c3PBJWYYrBo6Bzeoi+GZTKvtuRtooJGWsINk+mOInZWcssU35zDTAwreVcrMimc9aMyPpehRNw==} emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + emoji-regex-xs@1.0.0: + resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==} + emoji-regex@10.4.0: resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} @@ -6901,8 +6904,8 @@ packages: resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - google-auth-library@9.14.2: - resolution: {integrity: sha512-R+FRIfk1GBo3RdlRYWPdwk8nmtVUOn6+BkDomAC46KoU8kzXzE1HLmOasSCbWUByMMAGkknVF0G5kQ69Vj7dlA==} + google-auth-library@9.15.0: + resolution: {integrity: sha512-7ccSEJFDFO7exFbO6NRyC+xH8/mZ1GZGG2xxx9iHxZWcjUjJpjWxIMw3cofAKcueZ6DATiukmmprD7yavQHOyQ==} engines: {node: '>=14'} gopd@1.0.1: @@ -7008,8 +7011,8 @@ packages: hast-util-parse-selector@4.0.0: resolution: {integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==} - hast-util-raw@9.0.4: - resolution: {integrity: sha512-LHE65TD2YiNsHD3YuXcKPHXPLuYh/gjp12mOfU8jxSrm1f/yJpsb0F/KKljS6U9LJoP0Ux+tCe8iJ2AsPzTdgA==} + hast-util-raw@9.1.0: + resolution: {integrity: sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==} hast-util-select@4.0.2: resolution: {integrity: sha512-8EEG2//bN5rrzboPWD2HdS3ugLijNioS1pqOTIolXNf67xxShYw4SQEmVXd3imiBG+U2bC2nVTySr/iRAA7Cjg==} @@ -8883,8 +8886,8 @@ packages: peerDependencies: webpack: ^4.0.0 || ^5.0.0 - nx@20.1.0: - resolution: {integrity: sha512-d8Ywh1AvG3szYqWEHg2n9DHh/hF0jtVhMZKxwsr7n+kSVxp7gE/rHCCfOo8H+OmP030qXoox5e4Ovp7H9CEJnA==} + nx@20.1.2: + resolution: {integrity: sha512-CvjmuQmI0RWLYZxRSIgQZmzsQv6dPp9oI0YZE3L1dagBPfTf5Cun65I0GLt7bdkDnVx2PGYkDbIoJSv2/V+83Q==} hasBin: true peerDependencies: '@swc-node/register': ^1.8.0 @@ -8956,8 +8959,8 @@ packages: resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} engines: {node: '>=18'} - oniguruma-to-js@0.4.3: - resolution: {integrity: sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==} + oniguruma-to-es@0.1.2: + resolution: {integrity: sha512-sBYKVJlIMB0WPO+tSu/NNB1ytSFeHyyJZ3Ayxfx3f/QUuXu0lvZk0VB4K7npmdlHSC0ldqanzh/sUSlAbgCTfw==} only-allow@1.2.1: resolution: {integrity: sha512-M7CJbmv7UCopc0neRKdzfoGWaVZC+xC1925GitKH9EAqYFzX9//25Q7oX4+jw0tiCCj+t5l6VZh8UPH23NZkMA==} @@ -9016,8 +9019,8 @@ packages: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} - otpauth@9.3.4: - resolution: {integrity: sha512-qXv+lpsCUO9ewitLYfeDKbLYt7UUCivnU/fwGK2OqhgrCBsRkTUNKWsgKAhkXG3aistOY+jEeuL90JEBu6W3mQ==} + otpauth@9.3.5: + resolution: {integrity: sha512-jQyqOuQExeIl4YIiOUz4TdEcamgAgPX6UYeeS9Iit4lkvs7bwHb0JNDqchGRccbRfvWHV6oRwH36tOsVmc+7hQ==} p-cancelable@3.0.0: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} @@ -9741,8 +9744,8 @@ packages: resolution: {integrity: sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==} engines: {node: '>=14.16'} - pretty-ms@9.1.0: - resolution: {integrity: sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==} + pretty-ms@9.2.0: + resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==} engines: {node: '>=18'} pretty-time@1.1.0: @@ -10162,6 +10165,12 @@ packages: regenerator-transform@0.15.2: resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} + regex-recursion@4.2.1: + resolution: {integrity: sha512-QHNZyZAeKdndD1G3bKAbBEKOSSK4KOHQrAJ01N1LJeb0SoH4DJIeFhp0uUpETgONifS4+P3sOgoA1dhzgrQvhA==} + + regex-utilities@2.3.0: + resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==} + regex@4.4.0: resolution: {integrity: sha512-uCUSuobNVeqUupowbdZub6ggI5/JZkYyJdDogddJr60L764oxC2pMZov1fQ3wM9bdyzUILDG+Sqx6NAKAz9rKQ==} @@ -10332,8 +10341,8 @@ packages: engines: {node: '>=10.0.0'} hasBin: true - rollup@4.26.0: - resolution: {integrity: sha512-ilcl12hnWonG8f+NxU6BlgysVA0gvY2l8N0R84S1HcINbW20bvwuCngJkkInV6LXhwRpucsW5k1ovDwEdBVrNg==} + rollup@4.27.2: + resolution: {integrity: sha512-KreA+PzWmk2yaFmZVwe6GB2uBD86nXl86OsDkt1bJS9p3vqWuEQ6HnJJ+j/mZi/q0920P99/MVRlB4L3crpF5w==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -10523,8 +10532,8 @@ packages: engines: {node: '>=4'} hasBin: true - shiki@1.22.2: - resolution: {integrity: sha512-3IZau0NdGKXhH2bBlUk4w1IHNxPh6A5B2sUpyY+8utLu2j/h1QpFkAaUA1bAMxOWWGtTWcAh531vnS4NJKS/lA==} + shiki@1.23.0: + resolution: {integrity: sha512-xfdu9DqPkIpExH29cmiTlgo0/jBki5la1Tkfhsv+Wu5TT3APLNHslR1acxuKJOCWqVdSc+pIbs/2ozjVRGppdg==} shimmer@1.2.1: resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==} @@ -10911,8 +10920,8 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svelte@5.1.16: - resolution: {integrity: sha512-QcY+om9r8+uTcSfeFuv8++ExdfwVCKeT+Y7GPSZ6rQPczvy62BMtvMoi0rScabgv+upGE5jxKjd7M4u23+AjGA==} + svelte@5.2.0: + resolution: {integrity: sha512-LOowFhMB0CoTzDsa90snaICFMftrxKlYsOhH4YP1AamjCSDBZvtDq0yB5QY8LJA1tFftcmpAhmLCK/gAOFNrtw==} engines: {node: '>=18'} svg-parser@2.0.4: @@ -11074,8 +11083,8 @@ packages: engines: {node: '>= 12.10.0', npm: '>= 6.12.0', yarn: '>= 1.20.0'} hasBin: true - tinypool@1.0.1: - resolution: {integrity: sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==} + tinypool@1.0.2: + resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} engines: {node: ^18.0.0 || >=20.0.0} tinyrainbow@1.2.0: @@ -11319,8 +11328,8 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typedoc-plugin-markdown@4.2.9: - resolution: {integrity: sha512-Wqmx+7ezKFgtTklEq/iUhQ5uFeBDhAT6wiS2na9cFLidIpl9jpDHJy/COYh8jUZXgIRIZVQ/bPNjyrnPFoDwzg==} + typedoc-plugin-markdown@4.2.10: + resolution: {integrity: sha512-PLX3pc1/7z13UJm4TDE9vo9jWGcClFUErXXtd5LdnoLjV6mynPpqZLU992DwMGFSRqJFZeKbVyqlNNeNHnk2tQ==} engines: {node: '>= 18'} peerDependencies: typedoc: 0.26.x @@ -11671,8 +11680,8 @@ packages: vscode-uri@3.0.8: resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} - vue@3.5.12: - resolution: {integrity: sha512-CLVZtXtn2ItBIi/zHZ0Sg1Xkb7+PU32bJJ8Bmy7ts3jxXTcbfsEfBivFYYWz1Hur+lalqGAh65Coin0r+HRUfg==} + vue@3.5.13: + resolution: {integrity: sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==} peerDependencies: typescript: '*' peerDependenciesMeta: @@ -12115,13 +12124,13 @@ snapshots: transitivePeerDependencies: - zod - '@ai-sdk/svelte@0.0.57(svelte@5.1.16)(zod@3.23.8)': + '@ai-sdk/svelte@0.0.57(svelte@5.2.0)(zod@3.23.8)': dependencies: '@ai-sdk/provider-utils': 1.0.22(zod@3.23.8) '@ai-sdk/ui-utils': 0.0.50(zod@3.23.8) - sswr: 2.1.0(svelte@5.1.16) + sswr: 2.1.0(svelte@5.2.0) optionalDependencies: - svelte: 5.1.16 + svelte: 5.2.0 transitivePeerDependencies: - zod @@ -12135,43 +12144,43 @@ snapshots: optionalDependencies: zod: 3.23.8 - '@ai-sdk/vue@0.0.59(vue@3.5.12(typescript@5.6.3))(zod@3.23.8)': + '@ai-sdk/vue@0.0.59(vue@3.5.13(typescript@5.6.3))(zod@3.23.8)': dependencies: '@ai-sdk/provider-utils': 1.0.22(zod@3.23.8) '@ai-sdk/ui-utils': 0.0.50(zod@3.23.8) - swrv: 1.0.4(vue@3.5.12(typescript@5.6.3)) + swrv: 1.0.4(vue@3.5.13(typescript@5.6.3)) optionalDependencies: - vue: 3.5.12(typescript@5.6.3) + vue: 3.5.13(typescript@5.6.3) transitivePeerDependencies: - zod - '@algolia/autocomplete-core@1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0)(search-insights@2.17.2)': + '@algolia/autocomplete-core@1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2)(search-insights@2.17.2)': dependencies: - '@algolia/autocomplete-plugin-algolia-insights': 1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0)(search-insights@2.17.2) - '@algolia/autocomplete-shared': 1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0) + '@algolia/autocomplete-plugin-algolia-insights': 1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2)(search-insights@2.17.2) + '@algolia/autocomplete-shared': 1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2) transitivePeerDependencies: - '@algolia/client-search' - algoliasearch - search-insights - '@algolia/autocomplete-plugin-algolia-insights@1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0)(search-insights@2.17.2)': + '@algolia/autocomplete-plugin-algolia-insights@1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2)(search-insights@2.17.2)': dependencies: - '@algolia/autocomplete-shared': 1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0) + '@algolia/autocomplete-shared': 1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2) search-insights: 2.17.2 transitivePeerDependencies: - '@algolia/client-search' - algoliasearch - '@algolia/autocomplete-preset-algolia@1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0)': + '@algolia/autocomplete-preset-algolia@1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2)': dependencies: - '@algolia/autocomplete-shared': 1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0) - '@algolia/client-search': 5.13.0 - algoliasearch: 5.13.0 + '@algolia/autocomplete-shared': 1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2) + '@algolia/client-search': 5.14.2 + algoliasearch: 5.14.2 - '@algolia/autocomplete-shared@1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0)': + '@algolia/autocomplete-shared@1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2)': dependencies: - '@algolia/client-search': 5.13.0 - algoliasearch: 5.13.0 + '@algolia/client-search': 5.14.2 + algoliasearch: 5.14.2 '@algolia/cache-browser-local-storage@4.24.0': dependencies: @@ -12183,12 +12192,12 @@ snapshots: dependencies: '@algolia/cache-common': 4.24.0 - '@algolia/client-abtesting@5.13.0': + '@algolia/client-abtesting@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/client-account@4.24.0': dependencies: @@ -12203,26 +12212,26 @@ snapshots: '@algolia/requester-common': 4.24.0 '@algolia/transporter': 4.24.0 - '@algolia/client-analytics@5.13.0': + '@algolia/client-analytics@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/client-common@4.24.0': dependencies: '@algolia/requester-common': 4.24.0 '@algolia/transporter': 4.24.0 - '@algolia/client-common@5.13.0': {} + '@algolia/client-common@5.14.2': {} - '@algolia/client-insights@5.13.0': + '@algolia/client-insights@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/client-personalization@4.24.0': dependencies: @@ -12230,19 +12239,19 @@ snapshots: '@algolia/requester-common': 4.24.0 '@algolia/transporter': 4.24.0 - '@algolia/client-personalization@5.13.0': + '@algolia/client-personalization@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 - '@algolia/client-query-suggestions@5.13.0': + '@algolia/client-query-suggestions@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/client-search@4.24.0': dependencies: @@ -12250,21 +12259,21 @@ snapshots: '@algolia/requester-common': 4.24.0 '@algolia/transporter': 4.24.0 - '@algolia/client-search@5.13.0': + '@algolia/client-search@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/events@4.0.1': {} - '@algolia/ingestion@1.13.0': + '@algolia/ingestion@1.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/logger-common@4.24.0': {} @@ -12272,12 +12281,12 @@ snapshots: dependencies: '@algolia/logger-common': 4.24.0 - '@algolia/monitoring@1.13.0': + '@algolia/monitoring@1.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/recommend@4.24.0': dependencies: @@ -12293,34 +12302,34 @@ snapshots: '@algolia/requester-node-http': 4.24.0 '@algolia/transporter': 4.24.0 - '@algolia/recommend@5.13.0': + '@algolia/recommend@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + '@algolia/client-common': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 '@algolia/requester-browser-xhr@4.24.0': dependencies: '@algolia/requester-common': 4.24.0 - '@algolia/requester-browser-xhr@5.13.0': + '@algolia/requester-browser-xhr@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 + '@algolia/client-common': 5.14.2 '@algolia/requester-common@4.24.0': {} - '@algolia/requester-fetch@5.13.0': + '@algolia/requester-fetch@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 + '@algolia/client-common': 5.14.2 '@algolia/requester-node-http@4.24.0': dependencies: '@algolia/requester-common': 4.24.0 - '@algolia/requester-node-http@5.13.0': + '@algolia/requester-node-http@5.14.2': dependencies: - '@algolia/client-common': 5.13.0 + '@algolia/client-common': 5.14.2 '@algolia/transporter@4.24.0': dependencies: @@ -13378,12 +13387,12 @@ snapshots: '@docsearch/css@3.8.0': {} - '@docsearch/react@3.8.0(@algolia/client-search@5.13.0)(@types/react@18.3.12)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)': + '@docsearch/react@3.8.0(@algolia/client-search@5.14.2)(@types/react@18.3.12)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)': dependencies: - '@algolia/autocomplete-core': 1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0)(search-insights@2.17.2) - '@algolia/autocomplete-preset-algolia': 1.17.7(@algolia/client-search@5.13.0)(algoliasearch@5.13.0) + '@algolia/autocomplete-core': 1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2)(search-insights@2.17.2) + '@algolia/autocomplete-preset-algolia': 1.17.7(@algolia/client-search@5.14.2)(algoliasearch@5.14.2) '@docsearch/css': 3.8.0 - algoliasearch: 5.13.0 + algoliasearch: 5.14.2 optionalDependencies: '@types/react': 18.3.12 react: 18.2.0 @@ -13939,7 +13948,7 @@ snapshots: - vue-template-compiler - webpack-cli - '@docusaurus/preset-classic@3.6.1(@algolia/client-search@5.13.0)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10)': + '@docusaurus/preset-classic@3.6.1(@algolia/client-search@5.14.2)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10)': dependencies: '@docusaurus/core': 3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) '@docusaurus/plugin-content-blog': 3.6.1(@docusaurus/plugin-content-docs@3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10))(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -13952,7 +13961,7 @@ snapshots: '@docusaurus/plugin-sitemap': 3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) '@docusaurus/theme-classic': 3.6.1(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) '@docusaurus/theme-common': 3.6.1(@docusaurus/plugin-content-docs@3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10))(acorn@8.14.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) - '@docusaurus/theme-search-algolia': 3.6.1(@algolia/client-search@5.13.0)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10) + '@docusaurus/theme-search-algolia': 3.6.1(@algolia/client-search@5.14.2)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10) '@docusaurus/types': 3.6.1(acorn@8.14.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -14101,9 +14110,9 @@ snapshots: - vue-template-compiler - webpack-cli - '@docusaurus/theme-search-algolia@3.6.1(@algolia/client-search@5.13.0)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10)': + '@docusaurus/theme-search-algolia@3.6.1(@algolia/client-search@5.14.2)(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(@types/react@18.3.12)(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2)(typescript@5.6.3)(utf-8-validate@5.0.10)': dependencies: - '@docsearch/react': 3.8.0(@algolia/client-search@5.13.0)(@types/react@18.3.12)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2) + '@docsearch/react': 3.8.0(@algolia/client-search@5.14.2)(@types/react@18.3.12)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.17.2) '@docusaurus/core': 3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) '@docusaurus/logger': 3.6.1 '@docusaurus/plugin-content-docs': 3.6.1(@mdx-js/react@3.0.1(@types/react@18.3.12)(react@18.2.0))(acorn@8.14.0)(bufferutil@4.0.8)(eslint@9.13.0(jiti@1.21.6))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -14438,7 +14447,7 @@ snapshots: '@eslint/core@0.7.0': {} - '@eslint/eslintrc@3.1.0': + '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 debug: 4.3.7(supports-color@5.5.0) @@ -14454,17 +14463,17 @@ snapshots: '@eslint/js@9.13.0': {} - '@eslint/js@9.14.0': {} + '@eslint/js@9.15.0': {} '@eslint/object-schema@2.1.4': {} - '@eslint/plugin-kit@0.2.2': + '@eslint/plugin-kit@0.2.3': dependencies: levn: 0.4.1 '@google-cloud/vertexai@1.9.0(encoding@0.1.13)': dependencies: - google-auth-library: 9.14.2(encoding@0.1.13) + google-auth-library: 9.15.0(encoding@0.1.13) transitivePeerDependencies: - encoding - supports-color @@ -14819,7 +14828,7 @@ snapshots: '@npmcli/arborist': 7.5.4 '@npmcli/package-json': 5.2.0 '@npmcli/run-script': 8.1.0 - '@nx/devkit': 20.1.0(nx@20.1.0) + '@nx/devkit': 20.1.2(nx@20.1.2) '@octokit/plugin-enterprise-rest': 6.0.1 '@octokit/rest': 19.0.11(encoding@0.1.13) aproba: 2.0.0 @@ -14858,7 +14867,7 @@ snapshots: npm-package-arg: 11.0.2 npm-packlist: 8.0.2 npm-registry-fetch: 17.1.0 - nx: 20.1.0 + nx: 20.1.2 p-map: 4.0.0 p-map-series: 2.1.0 p-queue: 6.6.2 @@ -15158,46 +15167,46 @@ snapshots: - bluebird - supports-color - '@nx/devkit@20.1.0(nx@20.1.0)': + '@nx/devkit@20.1.2(nx@20.1.2)': dependencies: ejs: 3.1.10 enquirer: 2.3.6 ignore: 5.3.2 minimatch: 9.0.3 - nx: 20.1.0 + nx: 20.1.2 semver: 7.6.3 tmp: 0.2.3 tslib: 2.8.0 yargs-parser: 21.1.1 - '@nx/nx-darwin-arm64@20.1.0': + '@nx/nx-darwin-arm64@20.1.2': optional: true - '@nx/nx-darwin-x64@20.1.0': + '@nx/nx-darwin-x64@20.1.2': optional: true - '@nx/nx-freebsd-x64@20.1.0': + '@nx/nx-freebsd-x64@20.1.2': optional: true - '@nx/nx-linux-arm-gnueabihf@20.1.0': + '@nx/nx-linux-arm-gnueabihf@20.1.2': optional: true - '@nx/nx-linux-arm64-gnu@20.1.0': + '@nx/nx-linux-arm64-gnu@20.1.2': optional: true - '@nx/nx-linux-arm64-musl@20.1.0': + '@nx/nx-linux-arm64-musl@20.1.2': optional: true - '@nx/nx-linux-x64-gnu@20.1.0': + '@nx/nx-linux-x64-gnu@20.1.2': optional: true - '@nx/nx-linux-x64-musl@20.1.0': + '@nx/nx-linux-x64-musl@20.1.2': optional: true - '@nx/nx-win32-arm64-msvc@20.1.0': + '@nx/nx-win32-arm64-msvc@20.1.2': optional: true - '@nx/nx-win32-x64-msvc@20.1.0': + '@nx/nx-win32-x64-msvc@20.1.2': optional: true '@octokit/app@15.1.0': @@ -15620,11 +15629,11 @@ snapshots: optionalDependencies: rollup: 2.79.2 - '@rollup/plugin-json@6.1.0(rollup@4.26.0)': + '@rollup/plugin-json@6.1.0(rollup@4.27.2)': dependencies: - '@rollup/pluginutils': 5.1.3(rollup@4.26.0) + '@rollup/pluginutils': 5.1.3(rollup@4.27.2) optionalDependencies: - rollup: 4.26.0 + rollup: 4.27.2 '@rollup/plugin-node-resolve@15.3.0(rollup@2.79.2)': dependencies: @@ -15666,66 +15675,66 @@ snapshots: optionalDependencies: rollup: 2.79.2 - '@rollup/pluginutils@5.1.3(rollup@4.26.0)': + '@rollup/pluginutils@5.1.3(rollup@4.27.2)': dependencies: '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 4.0.2 optionalDependencies: - rollup: 4.26.0 + rollup: 4.27.2 - '@rollup/rollup-android-arm-eabi@4.26.0': + '@rollup/rollup-android-arm-eabi@4.27.2': optional: true - '@rollup/rollup-android-arm64@4.26.0': + '@rollup/rollup-android-arm64@4.27.2': optional: true - '@rollup/rollup-darwin-arm64@4.26.0': + '@rollup/rollup-darwin-arm64@4.27.2': optional: true - '@rollup/rollup-darwin-x64@4.26.0': + '@rollup/rollup-darwin-x64@4.27.2': optional: true - '@rollup/rollup-freebsd-arm64@4.26.0': + '@rollup/rollup-freebsd-arm64@4.27.2': optional: true - '@rollup/rollup-freebsd-x64@4.26.0': + '@rollup/rollup-freebsd-x64@4.27.2': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.26.0': + '@rollup/rollup-linux-arm-gnueabihf@4.27.2': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.26.0': + '@rollup/rollup-linux-arm-musleabihf@4.27.2': optional: true - '@rollup/rollup-linux-arm64-gnu@4.26.0': + '@rollup/rollup-linux-arm64-gnu@4.27.2': optional: true - '@rollup/rollup-linux-arm64-musl@4.26.0': + '@rollup/rollup-linux-arm64-musl@4.27.2': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.26.0': + '@rollup/rollup-linux-powerpc64le-gnu@4.27.2': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.26.0': + '@rollup/rollup-linux-riscv64-gnu@4.27.2': optional: true - '@rollup/rollup-linux-s390x-gnu@4.26.0': + '@rollup/rollup-linux-s390x-gnu@4.27.2': optional: true - '@rollup/rollup-linux-x64-gnu@4.26.0': + '@rollup/rollup-linux-x64-gnu@4.27.2': optional: true - '@rollup/rollup-linux-x64-musl@4.26.0': + '@rollup/rollup-linux-x64-musl@4.27.2': optional: true - '@rollup/rollup-win32-arm64-msvc@4.26.0': + '@rollup/rollup-win32-arm64-msvc@4.27.2': optional: true - '@rollup/rollup-win32-ia32-msvc@4.26.0': + '@rollup/rollup-win32-ia32-msvc@4.27.2': optional: true - '@rollup/rollup-win32-x64-msvc@4.26.0': + '@rollup/rollup-win32-x64-msvc@4.27.2': optional: true '@sapphire/async-queue@1.5.5': {} @@ -15751,27 +15760,27 @@ snapshots: domhandler: 5.0.3 selderee: 0.11.0 - '@shikijs/core@1.22.2': + '@shikijs/core@1.23.0': dependencies: - '@shikijs/engine-javascript': 1.22.2 - '@shikijs/engine-oniguruma': 1.22.2 - '@shikijs/types': 1.22.2 + '@shikijs/engine-javascript': 1.23.0 + '@shikijs/engine-oniguruma': 1.23.0 + '@shikijs/types': 1.23.0 '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 hast-util-to-html: 9.0.3 - '@shikijs/engine-javascript@1.22.2': + '@shikijs/engine-javascript@1.23.0': dependencies: - '@shikijs/types': 1.22.2 + '@shikijs/types': 1.23.0 '@shikijs/vscode-textmate': 9.3.0 - oniguruma-to-js: 0.4.3 + oniguruma-to-es: 0.1.2 - '@shikijs/engine-oniguruma@1.22.2': + '@shikijs/engine-oniguruma@1.23.0': dependencies: - '@shikijs/types': 1.22.2 + '@shikijs/types': 1.23.0 '@shikijs/vscode-textmate': 9.3.0 - '@shikijs/types@1.22.2': + '@shikijs/types@1.23.0': dependencies: '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 @@ -16782,59 +16791,59 @@ snapshots: '@vladfrangu/async_event_emitter@2.4.6': {} - '@vue/compiler-core@3.5.12': + '@vue/compiler-core@3.5.13': dependencies: '@babel/parser': 7.26.2 - '@vue/shared': 3.5.12 + '@vue/shared': 3.5.13 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.2.1 - '@vue/compiler-dom@3.5.12': + '@vue/compiler-dom@3.5.13': dependencies: - '@vue/compiler-core': 3.5.12 - '@vue/shared': 3.5.12 + '@vue/compiler-core': 3.5.13 + '@vue/shared': 3.5.13 - '@vue/compiler-sfc@3.5.12': + '@vue/compiler-sfc@3.5.13': dependencies: '@babel/parser': 7.26.2 - '@vue/compiler-core': 3.5.12 - '@vue/compiler-dom': 3.5.12 - '@vue/compiler-ssr': 3.5.12 - '@vue/shared': 3.5.12 + '@vue/compiler-core': 3.5.13 + '@vue/compiler-dom': 3.5.13 + '@vue/compiler-ssr': 3.5.13 + '@vue/shared': 3.5.13 estree-walker: 2.0.2 magic-string: 0.30.12 postcss: 8.4.49 source-map-js: 1.2.1 - '@vue/compiler-ssr@3.5.12': + '@vue/compiler-ssr@3.5.13': dependencies: - '@vue/compiler-dom': 3.5.12 - '@vue/shared': 3.5.12 + '@vue/compiler-dom': 3.5.13 + '@vue/shared': 3.5.13 - '@vue/reactivity@3.5.12': + '@vue/reactivity@3.5.13': dependencies: - '@vue/shared': 3.5.12 + '@vue/shared': 3.5.13 - '@vue/runtime-core@3.5.12': + '@vue/runtime-core@3.5.13': dependencies: - '@vue/reactivity': 3.5.12 - '@vue/shared': 3.5.12 + '@vue/reactivity': 3.5.13 + '@vue/shared': 3.5.13 - '@vue/runtime-dom@3.5.12': + '@vue/runtime-dom@3.5.13': dependencies: - '@vue/reactivity': 3.5.12 - '@vue/runtime-core': 3.5.12 - '@vue/shared': 3.5.12 + '@vue/reactivity': 3.5.13 + '@vue/runtime-core': 3.5.13 + '@vue/shared': 3.5.13 csstype: 3.1.3 - '@vue/server-renderer@3.5.12(vue@3.5.12(typescript@5.6.3))': + '@vue/server-renderer@3.5.13(vue@3.5.13(typescript@5.6.3))': dependencies: - '@vue/compiler-ssr': 3.5.12 - '@vue/shared': 3.5.12 - vue: 3.5.12(typescript@5.6.3) + '@vue/compiler-ssr': 3.5.13 + '@vue/shared': 3.5.13 + vue: 3.5.13(typescript@5.6.3) - '@vue/shared@3.5.12': {} + '@vue/shared@3.5.13': {} '@webassemblyjs/ast@1.14.1': dependencies: @@ -16991,7 +17000,7 @@ snapshots: '@sinclair/typebox': 0.32.35 headers-polyfill: 3.3.0 json-stable-stringify: 1.1.1 - otpauth: 9.3.4 + otpauth: 9.3.5 set-cookie-parser: 2.7.1 tough-cookie: 4.1.4 tslib: 2.8.0 @@ -17005,15 +17014,15 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 - ai@3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.1.16))(svelte@5.1.16)(vue@3.5.12(typescript@5.6.3))(zod@3.23.8): + ai@3.4.33(openai@4.69.0(encoding@0.1.13)(zod@3.23.8))(react@18.2.0)(sswr@2.1.0(svelte@5.2.0))(svelte@5.2.0)(vue@3.5.13(typescript@5.6.3))(zod@3.23.8): dependencies: '@ai-sdk/provider': 0.0.26 '@ai-sdk/provider-utils': 1.0.22(zod@3.23.8) '@ai-sdk/react': 0.0.70(react@18.2.0)(zod@3.23.8) '@ai-sdk/solid': 0.0.54(zod@3.23.8) - '@ai-sdk/svelte': 0.0.57(svelte@5.1.16)(zod@3.23.8) + '@ai-sdk/svelte': 0.0.57(svelte@5.2.0)(zod@3.23.8) '@ai-sdk/ui-utils': 0.0.50(zod@3.23.8) - '@ai-sdk/vue': 0.0.59(vue@3.5.12(typescript@5.6.3))(zod@3.23.8) + '@ai-sdk/vue': 0.0.59(vue@3.5.13(typescript@5.6.3))(zod@3.23.8) '@opentelemetry/api': 1.9.0 eventsource-parser: 1.1.2 json-schema: 0.4.0 @@ -17023,8 +17032,8 @@ snapshots: optionalDependencies: openai: 4.69.0(encoding@0.1.13)(zod@3.23.8) react: 18.2.0 - sswr: 2.1.0(svelte@5.1.16) - svelte: 5.1.16 + sswr: 2.1.0(svelte@5.2.0) + svelte: 5.2.0 zod: 3.23.8 transitivePeerDependencies: - solid-js @@ -17082,21 +17091,21 @@ snapshots: '@algolia/requester-node-http': 4.24.0 '@algolia/transporter': 4.24.0 - algoliasearch@5.13.0: - dependencies: - '@algolia/client-abtesting': 5.13.0 - '@algolia/client-analytics': 5.13.0 - '@algolia/client-common': 5.13.0 - '@algolia/client-insights': 5.13.0 - '@algolia/client-personalization': 5.13.0 - '@algolia/client-query-suggestions': 5.13.0 - '@algolia/client-search': 5.13.0 - '@algolia/ingestion': 1.13.0 - '@algolia/monitoring': 1.13.0 - '@algolia/recommend': 5.13.0 - '@algolia/requester-browser-xhr': 5.13.0 - '@algolia/requester-fetch': 5.13.0 - '@algolia/requester-node-http': 5.13.0 + algoliasearch@5.14.2: + dependencies: + '@algolia/client-abtesting': 5.14.2 + '@algolia/client-analytics': 5.14.2 + '@algolia/client-common': 5.14.2 + '@algolia/client-insights': 5.14.2 + '@algolia/client-personalization': 5.14.2 + '@algolia/client-query-suggestions': 5.14.2 + '@algolia/client-search': 5.14.2 + '@algolia/ingestion': 1.14.2 + '@algolia/monitoring': 1.14.2 + '@algolia/recommend': 5.14.2 + '@algolia/requester-browser-xhr': 5.14.2 + '@algolia/requester-fetch': 5.14.2 + '@algolia/requester-node-http': 5.14.2 amp-message@0.1.2: dependencies: @@ -17140,7 +17149,7 @@ snapshots: dependencies: '@ai-sdk/provider': 0.0.22 '@ai-sdk/provider-utils': 1.0.17(zod@3.23.8) - google-auth-library: 9.14.2(encoding@0.1.13) + google-auth-library: 9.15.0(encoding@0.1.13) zod: 3.23.8 transitivePeerDependencies: - encoding @@ -17522,7 +17531,7 @@ snapshots: browserslist@4.24.2: dependencies: caniuse-lite: 1.0.30001680 - electron-to-chromium: 1.5.58 + electron-to-chromium: 1.5.61 node-releases: 2.0.18 update-browserslist-db: 1.1.1(browserslist@4.24.2) @@ -18760,9 +18769,9 @@ snapshots: unified: 9.2.2 unist-util-is: 4.1.0 - docusaurus-plugin-typedoc@1.0.5(typedoc-plugin-markdown@4.2.9(typedoc@0.26.11(typescript@5.6.3))): + docusaurus-plugin-typedoc@1.0.5(typedoc-plugin-markdown@4.2.10(typedoc@0.26.11(typescript@5.6.3))): dependencies: - typedoc-plugin-markdown: 4.2.9(typedoc@0.26.11(typescript@5.6.3)) + typedoc-plugin-markdown: 4.2.10(typedoc@0.26.11(typescript@5.6.3)) dom-converter@0.2.0: dependencies: @@ -18844,10 +18853,12 @@ snapshots: dependencies: jake: 10.9.2 - electron-to-chromium@1.5.58: {} + electron-to-chromium@1.5.61: {} emittery@0.13.1: {} + emoji-regex-xs@1.0.0: {} + emoji-regex@10.4.0: {} emoji-regex@8.0.0: {} @@ -19064,9 +19075,9 @@ snapshots: '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.18.0 '@eslint/core': 0.7.0 - '@eslint/eslintrc': 3.1.0 + '@eslint/eslintrc': 3.2.0 '@eslint/js': 9.13.0 - '@eslint/plugin-kit': 0.2.2 + '@eslint/plugin-kit': 0.2.3 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.3.1 @@ -19328,7 +19339,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.4 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -19879,7 +19890,7 @@ snapshots: merge2: 1.4.1 slash: 4.0.0 - google-auth-library@9.14.2(encoding@0.1.13): + google-auth-library@9.15.0(encoding@0.1.13): dependencies: base64-js: 1.5.1 ecdsa-sig-formatter: 1.0.11 @@ -20008,7 +20019,7 @@ snapshots: dependencies: '@types/hast': 3.0.4 - hast-util-raw@9.0.4: + hast-util-raw@9.1.0: dependencies: '@types/hast': 3.0.4 '@types/unist': 3.0.3 @@ -21203,7 +21214,7 @@ snapshots: '@npmcli/arborist': 7.5.4 '@npmcli/package-json': 5.2.0 '@npmcli/run-script': 8.1.0 - '@nx/devkit': 20.1.0(nx@20.1.0) + '@nx/devkit': 20.1.2(nx@20.1.2) '@octokit/plugin-enterprise-rest': 6.0.1 '@octokit/rest': 19.0.11(encoding@0.1.13) aproba: 2.0.0 @@ -21248,7 +21259,7 @@ snapshots: npm-package-arg: 11.0.2 npm-packlist: 8.0.2 npm-registry-fetch: 17.1.0 - nx: 20.1.0 + nx: 20.1.2 p-map: 4.0.0 p-map-series: 2.1.0 p-pipe: 3.1.0 @@ -22462,7 +22473,7 @@ snapshots: node-addon-api: 8.2.2 octokit: 4.0.2 ora: 8.1.1 - pretty-ms: 9.1.0 + pretty-ms: 9.2.0 proper-lockfile: 4.1.2 semver: 7.6.3 simple-git: 3.27.0 @@ -22630,7 +22641,7 @@ snapshots: schema-utils: 3.3.0 webpack: 5.96.1 - nx@20.1.0: + nx@20.1.2: dependencies: '@napi-rs/wasm-runtime': 0.2.4 '@yarnpkg/lockfile': 1.1.0 @@ -22665,16 +22676,16 @@ snapshots: yargs: 17.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@nx/nx-darwin-arm64': 20.1.0 - '@nx/nx-darwin-x64': 20.1.0 - '@nx/nx-freebsd-x64': 20.1.0 - '@nx/nx-linux-arm-gnueabihf': 20.1.0 - '@nx/nx-linux-arm64-gnu': 20.1.0 - '@nx/nx-linux-arm64-musl': 20.1.0 - '@nx/nx-linux-x64-gnu': 20.1.0 - '@nx/nx-linux-x64-musl': 20.1.0 - '@nx/nx-win32-arm64-msvc': 20.1.0 - '@nx/nx-win32-x64-msvc': 20.1.0 + '@nx/nx-darwin-arm64': 20.1.2 + '@nx/nx-darwin-x64': 20.1.2 + '@nx/nx-freebsd-x64': 20.1.2 + '@nx/nx-linux-arm-gnueabihf': 20.1.2 + '@nx/nx-linux-arm64-gnu': 20.1.2 + '@nx/nx-linux-arm64-musl': 20.1.2 + '@nx/nx-linux-x64-gnu': 20.1.2 + '@nx/nx-linux-x64-musl': 20.1.2 + '@nx/nx-win32-arm64-msvc': 20.1.2 + '@nx/nx-win32-x64-msvc': 20.1.2 transitivePeerDependencies: - debug @@ -22740,9 +22751,11 @@ snapshots: dependencies: mimic-function: 5.0.1 - oniguruma-to-js@0.4.3: + oniguruma-to-es@0.1.2: dependencies: + emoji-regex-xs: 1.0.0 regex: 4.4.0 + regex-recursion: 4.2.1 only-allow@1.2.1: dependencies: @@ -22836,7 +22849,7 @@ snapshots: os-tmpdir@1.0.2: {} - otpauth@9.3.4: + otpauth@9.3.5: dependencies: '@noble/hashes': 1.5.0 @@ -23575,7 +23588,7 @@ snapshots: dependencies: parse-ms: 3.0.0 - pretty-ms@9.1.0: + pretty-ms@9.2.0: dependencies: parse-ms: 4.0.0 @@ -23694,10 +23707,10 @@ snapshots: end-of-stream: 1.4.4 once: 1.4.0 - pumpdotfun-sdk@1.3.2(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(rollup@4.26.0)(typescript@5.6.3)(utf-8-validate@5.0.10): + pumpdotfun-sdk@1.3.2(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(rollup@4.27.2)(typescript@5.6.3)(utf-8-validate@5.0.10): dependencies: '@coral-xyz/anchor': 0.30.1(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - '@rollup/plugin-json': 6.1.0(rollup@4.26.0) + '@rollup/plugin-json': 6.1.0(rollup@4.27.2) '@solana/spl-token': 0.4.6(@solana/web3.js@1.95.4(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) '@solana/web3.js': 1.95.4(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) transitivePeerDependencies: @@ -24104,6 +24117,12 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 + regex-recursion@4.2.1: + dependencies: + regex-utilities: 2.3.0 + + regex-utilities@2.3.0: {} + regex@4.4.0: {} regexpu-core@6.1.1: @@ -24137,7 +24156,7 @@ snapshots: rehype-raw@7.0.0: dependencies: '@types/hast': 3.0.4 - hast-util-raw: 9.0.4 + hast-util-raw: 9.1.0 vfile: 6.0.3 rehype-recma@1.0.0: @@ -24331,28 +24350,28 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - rollup@4.26.0: + rollup@4.27.2: dependencies: '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.26.0 - '@rollup/rollup-android-arm64': 4.26.0 - '@rollup/rollup-darwin-arm64': 4.26.0 - '@rollup/rollup-darwin-x64': 4.26.0 - '@rollup/rollup-freebsd-arm64': 4.26.0 - '@rollup/rollup-freebsd-x64': 4.26.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.26.0 - '@rollup/rollup-linux-arm-musleabihf': 4.26.0 - '@rollup/rollup-linux-arm64-gnu': 4.26.0 - '@rollup/rollup-linux-arm64-musl': 4.26.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.26.0 - '@rollup/rollup-linux-riscv64-gnu': 4.26.0 - '@rollup/rollup-linux-s390x-gnu': 4.26.0 - '@rollup/rollup-linux-x64-gnu': 4.26.0 - '@rollup/rollup-linux-x64-musl': 4.26.0 - '@rollup/rollup-win32-arm64-msvc': 4.26.0 - '@rollup/rollup-win32-ia32-msvc': 4.26.0 - '@rollup/rollup-win32-x64-msvc': 4.26.0 + '@rollup/rollup-android-arm-eabi': 4.27.2 + '@rollup/rollup-android-arm64': 4.27.2 + '@rollup/rollup-darwin-arm64': 4.27.2 + '@rollup/rollup-darwin-x64': 4.27.2 + '@rollup/rollup-freebsd-arm64': 4.27.2 + '@rollup/rollup-freebsd-x64': 4.27.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.27.2 + '@rollup/rollup-linux-arm-musleabihf': 4.27.2 + '@rollup/rollup-linux-arm64-gnu': 4.27.2 + '@rollup/rollup-linux-arm64-musl': 4.27.2 + '@rollup/rollup-linux-powerpc64le-gnu': 4.27.2 + '@rollup/rollup-linux-riscv64-gnu': 4.27.2 + '@rollup/rollup-linux-s390x-gnu': 4.27.2 + '@rollup/rollup-linux-x64-gnu': 4.27.2 + '@rollup/rollup-linux-x64-musl': 4.27.2 + '@rollup/rollup-win32-arm64-msvc': 4.27.2 + '@rollup/rollup-win32-ia32-msvc': 4.27.2 + '@rollup/rollup-win32-x64-msvc': 4.27.2 fsevents: 2.3.3 roughjs@4.6.6: @@ -24619,12 +24638,12 @@ snapshots: interpret: 1.4.0 rechoir: 0.6.2 - shiki@1.22.2: + shiki@1.23.0: dependencies: - '@shikijs/core': 1.22.2 - '@shikijs/engine-javascript': 1.22.2 - '@shikijs/engine-oniguruma': 1.22.2 - '@shikijs/types': 1.22.2 + '@shikijs/core': 1.23.0 + '@shikijs/engine-javascript': 1.23.0 + '@shikijs/engine-oniguruma': 1.23.0 + '@shikijs/types': 1.23.0 '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 @@ -24870,9 +24889,9 @@ snapshots: dependencies: minipass: 7.1.2 - sswr@2.1.0(svelte@5.1.16): + sswr@2.1.0(svelte@5.2.0): dependencies: - svelte: 5.1.16 + svelte: 5.2.0 swrev: 4.0.0 stack-utils@2.0.6: @@ -25059,7 +25078,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte@5.1.16: + svelte@5.2.0: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0 @@ -25095,9 +25114,9 @@ snapshots: swrev@4.0.0: {} - swrv@1.0.4(vue@3.5.12(typescript@5.6.3)): + swrv@1.0.4(vue@3.5.13(typescript@5.6.3)): dependencies: - vue: 3.5.12(typescript@5.6.3) + vue: 3.5.13(typescript@5.6.3) synckit@0.9.2: dependencies: @@ -25248,7 +25267,7 @@ snapshots: tinyld@1.3.4: {} - tinypool@1.0.1: {} + tinypool@1.0.2: {} tinyrainbow@1.2.0: {} @@ -25400,7 +25419,7 @@ snapshots: picocolors: 1.1.1 postcss-load-config: 6.0.1(jiti@1.21.6)(postcss@8.4.49)(yaml@2.6.0) resolve-from: 5.0.0 - rollup: 4.26.0 + rollup: 4.27.2 source-map: 0.8.0-beta.0 sucrase: 3.35.0 tinyexec: 0.3.1 @@ -25469,7 +25488,7 @@ snapshots: typedarray@0.0.6: {} - typedoc-plugin-markdown@4.2.9(typedoc@0.26.11(typescript@5.6.3)): + typedoc-plugin-markdown@4.2.10(typedoc@0.26.11(typescript@5.6.3)): dependencies: typedoc: 0.26.11(typescript@5.6.3) @@ -25478,7 +25497,7 @@ snapshots: lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 - shiki: 1.22.2 + shiki: 1.23.0 typescript: 5.6.3 yaml: 2.6.0 @@ -25763,7 +25782,7 @@ snapshots: dependencies: esbuild: 0.21.5 postcss: 8.4.49 - rollup: 4.26.0 + rollup: 4.27.2 optionalDependencies: '@types/node': 22.8.4 fsevents: 2.3.3 @@ -25786,7 +25805,7 @@ snapshots: std-env: 3.8.0 tinybench: 2.9.0 tinyexec: 0.3.1 - tinypool: 1.0.1 + tinypool: 1.0.2 tinyrainbow: 1.2.0 vite: 5.4.11(@types/node@22.8.4)(terser@5.36.0) vite-node: 2.1.5(@types/node@22.8.4)(terser@5.36.0) @@ -25828,13 +25847,13 @@ snapshots: vscode-uri@3.0.8: {} - vue@3.5.12(typescript@5.6.3): + vue@3.5.13(typescript@5.6.3): dependencies: - '@vue/compiler-dom': 3.5.12 - '@vue/compiler-sfc': 3.5.12 - '@vue/runtime-dom': 3.5.12 - '@vue/server-renderer': 3.5.12(vue@3.5.12(typescript@5.6.3)) - '@vue/shared': 3.5.12 + '@vue/compiler-dom': 3.5.13 + '@vue/compiler-sfc': 3.5.13 + '@vue/runtime-dom': 3.5.13 + '@vue/server-renderer': 3.5.13(vue@3.5.13(typescript@5.6.3)) + '@vue/shared': 3.5.13 optionalDependencies: typescript: 5.6.3 From 3d68fa926131cdad4712526db96a42326f95ae26 Mon Sep 17 00:00:00 2001 From: ponderingdemocritus <ponderingdemocritus@protonmail.com> Date: Sat, 16 Nov 2024 10:19:10 +1100 Subject: [PATCH 5/5] title --- .github/workflows/pr.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 00000000000..ade1e50626e --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,28 @@ +name: PR Title Check + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + check-pr-title: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v2 + + - name: Validate PR title + id: validate + run: | + PR_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH") + echo "PR Title: $PR_TITLE" + if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore):\ .+ ]]; then + echo "PR title does not match the required pattern." + exit 1 + fi + + - name: Set status + if: failure() + run: | + gh pr comment ${{ github.event.pull_request.number }} --body "❌ PR title does not match the required pattern. Please use the format: 'type: description' (e.g., 'feat: add new feature')."