Skip to content

Commit 44a77be

Browse files
authored
Merge branch 'develop' into solana-plugin
2 parents 8342bcb + beb0bc1 commit 44a77be

File tree

881 files changed

+8813
-4414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

881 files changed

+8813
-4414
lines changed

.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ SUPABASE_ANON_KEY=
1919
REMOTE_CHARACTER_URLS=
2020

2121
# Logging
22-
DEFAULT_LOG_LEVEL=info
23-
LOG_JSON_FORMAT= # Print everything in logger as json; false by default
22+
DEFAULT_LOG_LEVEL=warn
23+
LOG_JSON_FORMAT=false # Print everything in logger as json; false by default
2424

2525
###############################
2626
#### Client Configurations ####

.eslintrc.json

-36
This file was deleted.

.github/workflows/ci.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ jobs:
2222
- name: Install dependencies
2323
run: pnpm install -r --no-frozen-lockfile
2424

25-
- name: Run Prettier
26-
run: pnpm run prettier --check .
25+
- name: Setup Biome CLI
26+
uses: biomejs/setup-biome@v2
27+
with:
28+
version: latest
2729

28-
- name: Run Linter
29-
run: pnpm run lint
30+
- name: Run Biome
31+
run: biome ci
3032

3133
- name: Create test env file
3234
run: |

.github/workflows/smoke-tests.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
container:
1414
image: node:23-bullseye
15+
env:
16+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
1517
steps:
1618
- uses: actions/checkout@v4
1719

agent/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@elizaos/plugin-node": "workspace:*",
6464
"@elizaos/plugin-solana": "workspace:*",
6565
"@elizaos/plugin-injective": "workspace:*",
66-
"@elizaos/plugin-solana-agentkit": "workspace:*",
66+
"@elizaos/plugin-solana-agent-kit": "workspace:*",
6767
"@elizaos/plugin-squid-router": "workspace:*",
6868
"@elizaos/plugin-autonome": "workspace:*",
6969
"@elizaos/plugin-starknet": "workspace:*",

agent/src/__tests__/client-type-identification.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Client, IAgentRuntime } from "@elizaos/core";
1+
import type { Client, IAgentRuntime } from "@elizaos/core";
22
import { describe, it, expect } from "@jest/globals";
33

44
// Helper function to identify client types

agent/src/index.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ import {
2020
AgentRuntime,
2121
CacheManager,
2222
CacheStore,
23-
Character,
24-
Client,
23+
type Character,
24+
type Client,
2525
Clients,
2626
DbCacheAdapter,
2727
defaultCharacter,
2828
elizaLogger,
2929
FsCacheAdapter,
30-
IAgentRuntime,
31-
ICacheManager,
32-
IDatabaseAdapter,
33-
IDatabaseCacheAdapter,
30+
type IAgentRuntime,
31+
type ICacheManager,
32+
type IDatabaseAdapter,
33+
type IDatabaseCacheAdapter,
3434
ModelProviderName,
3535
parseBooleanFromText,
3636
settings,
@@ -85,7 +85,7 @@ import { openWeatherPlugin } from "@elizaos/plugin-open-weather";
8585
import { quaiPlugin } from "@elizaos/plugin-quai";
8686
import { sgxPlugin } from "@elizaos/plugin-sgx";
8787
import { solanaPlugin } from "@elizaos/plugin-solana";
88-
import { solanaAgentkitPlugin } from "@elizaos/plugin-solana-agentkit";
88+
import { solanaAgentkitPlugin } from "@elizaos/plugin-solana-agent-kit";
8989
import { squidRouterPlugin } from "@elizaos/plugin-squid-router";
9090
import { stargazePlugin } from "@elizaos/plugin-stargaze";
9191
import { storyPlugin } from "@elizaos/plugin-story";
@@ -116,7 +116,7 @@ import yargs from "yargs";
116116
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
117117
const __dirname = path.dirname(__filename); // get the name of the directory
118118

119-
export const wait = (minTime: number = 1000, maxTime: number = 3000) => {
119+
export const wait = (minTime = 1000, maxTime = 3000) => {
120120
const waitTime =
121121
Math.floor(Math.random() * (maxTime - minTime + 1)) + minTime;
122122
return new Promise((resolve) => setTimeout(resolve, waitTime));
@@ -197,7 +197,7 @@ export async function loadCharacterFromOnchain(): Promise<Character[]> {
197197
const jsonText = onchainJson;
198198

199199
console.log("JSON:", jsonText);
200-
if (jsonText == "null") return [];
200+
if (!jsonText) return [];
201201
const loadedCharacters = [];
202202
try {
203203
const character = JSON.parse(jsonText);
@@ -300,7 +300,7 @@ async function loadCharacter(filePath: string): Promise<Character> {
300300
if (!content) {
301301
throw new Error(`Character file not found: ${filePath}`);
302302
}
303-
let character = JSON.parse(content);
303+
const character = JSON.parse(content);
304304
return jsonToCharacter(filePath, character);
305305
}
306306

@@ -311,7 +311,7 @@ function commaSeparatedStringToArray(commaSeparated: string): string[] {
311311
export async function loadCharacters(
312312
charactersArg: string
313313
): Promise<Character[]> {
314-
let characterPaths = commaSeparatedStringToArray(charactersArg);
314+
const characterPaths = commaSeparatedStringToArray(charactersArg);
315315
const loadedCharacters: Character[] = [];
316316

317317
if (characterPaths?.length > 0) {
@@ -385,7 +385,7 @@ export async function loadCharacters(
385385

386386
if (hasValidRemoteUrls()) {
387387
elizaLogger.info("Loading characters from remote URLs");
388-
let characterUrls = commaSeparatedStringToArray(
388+
const characterUrls = commaSeparatedStringToArray(
389389
process.env.REMOTE_CHARACTER_URLS
390390
);
391391
for (const characterUrl of characterUrls) {
@@ -1191,16 +1191,16 @@ const hasValidRemoteUrls = () =>
11911191

11921192
const startAgents = async () => {
11931193
const directClient = new DirectClient();
1194-
let serverPort = parseInt(settings.SERVER_PORT || "3000");
1194+
let serverPort = Number.parseInt(settings.SERVER_PORT || "3000");
11951195
const args = parseArguments();
1196-
let charactersArg = args.characters || args.character;
1196+
const charactersArg = args.characters || args.character;
11971197
let characters = [defaultCharacter];
11981198

11991199
if (process.env.IQ_WALLET_ADDRESS && process.env.IQSOlRPC) {
12001200
characters = await loadCharacterFromOnchain();
12011201
}
12021202

1203-
if ((onchainJson == "null" && charactersArg) || hasValidRemoteUrls()) {
1203+
if ((!onchainJson && charactersArg) || hasValidRemoteUrls()) {
12041204
characters = await loadCharacters(charactersArg);
12051205
}
12061206

@@ -1231,7 +1231,7 @@ const startAgents = async () => {
12311231

12321232
directClient.start(serverPort);
12331233

1234-
if (serverPort !== parseInt(settings.SERVER_PORT || "3000")) {
1234+
if (serverPort !== Number.parseInt(settings.SERVER_PORT || "3000")) {
12351235
elizaLogger.log(`Server started on alternate port ${serverPort}`);
12361236
}
12371237

@@ -1251,12 +1251,12 @@ if (
12511251
parseBooleanFromText(process.env.PREVENT_UNHANDLED_EXIT)
12521252
) {
12531253
// Handle uncaught exceptions to prevent the process from crashing
1254-
process.on("uncaughtException", function (err) {
1254+
process.on("uncaughtException", (err) => {
12551255
console.error("uncaughtException", err);
12561256
});
12571257

12581258
// Handle unhandled rejections to prevent the process from crashing
1259-
process.on("unhandledRejection", function (err) {
1259+
process.on("unhandledRejection", (err) => {
12601260
console.error("unhandledRejection", err);
12611261
});
12621262
}

biome.json

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3+
"organizeImports": {
4+
"enabled": false
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"recommended": true,
10+
"suspicious": {
11+
"noExplicitAny": "warn",
12+
"noArrayIndexKey": "warn",
13+
"noPrototypeBuiltins": "warn",
14+
"noDuplicateObjectKeys": "warn",
15+
"noGlobalIsNan": "warn",
16+
"noDuplicateFontNames": "warn",
17+
"noSelfCompare": "warn",
18+
"noDoubleEquals": "warn",
19+
"noImplicitAnyLet": "warn",
20+
"noAssignInExpressions": "warn",
21+
"noExportsInTest": "warn",
22+
"noConstEnum": "warn",
23+
"noEmptyInterface": "warn"
24+
},
25+
"correctness": {
26+
"noUnusedVariables": "warn",
27+
"noUnreachable": "warn",
28+
"useExhaustiveDependencies": "warn",
29+
"noSwitchDeclarations": "warn",
30+
"noUnnecessaryContinue": "warn",
31+
"noInnerDeclarations": "warn"
32+
},
33+
"style": {
34+
"useConst": "warn",
35+
"useTemplate": "warn",
36+
"useImportType": "warn",
37+
"useNodejsImportProtocol": "warn",
38+
"noUselessElse": "warn",
39+
"useSelfClosingElements": "warn",
40+
"useNumberNamespace": "warn",
41+
"noUnusedTemplateLiteral": "warn",
42+
"noInferrableTypes": "warn",
43+
"noNonNullAssertion": "warn",
44+
"noParameterAssign": "warn",
45+
"useDefaultParameterLast": "warn",
46+
"useExponentiationOperator": "warn",
47+
"noVar": "warn",
48+
"useSingleVarDeclarator": "warn",
49+
"useExportType": "warn"
50+
},
51+
"a11y": {
52+
"useAltText": "warn",
53+
"useFocusableInteractive": "warn",
54+
"useMediaCaption": "warn",
55+
"noSvgWithoutTitle": "warn",
56+
"useKeyWithClickEvents": "warn"
57+
},
58+
"complexity": {
59+
"noForEach": "warn",
60+
"useOptionalChain": "warn",
61+
"useArrowFunction": "warn",
62+
"useFlatMap": "warn",
63+
"useLiteralKeys": "warn",
64+
"noBannedTypes": "warn",
65+
"noStaticOnlyClass": "warn",
66+
"noThisInStatic": "warn",
67+
"noUselessConstructor": "warn",
68+
"noUselessTernary": "warn",
69+
"noUselessSwitchCase": "warn",
70+
"noUselessCatch": "warn"
71+
},
72+
"performance": {
73+
"noDelete": "warn",
74+
"noAccumulatingSpread": "warn"
75+
}
76+
},
77+
"ignore": ["**/dist/**", "**/node_modules/**", "**/coverage/**", "**/*.json"]
78+
},
79+
"formatter": {
80+
"enabled": false
81+
},
82+
"javascript": {
83+
"formatter": {
84+
"quoteStyle": "double",
85+
"semicolons": "always"
86+
}
87+
}
88+
}

client/eslint.config.js

-28
This file was deleted.

client/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"extract-version": "sh version.sh",
88
"dev": "pnpm run extract-version && vite",
99
"build": "pnpm run extract-version && tsc -b && vite build",
10-
"preview": "vite preview",
11-
"lint": "eslint ."
10+
"preview": "vite preview"
1211
},
1312
"dependencies": {
1413
"@elizaos/core": "workspace:*",

client/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import useVersion from "./hooks/use-version";
1313
const queryClient = new QueryClient({
1414
defaultOptions: {
1515
queries: {
16-
staleTime: Infinity,
16+
staleTime: Number.POSITIVE_INFINITY,
1717
},
1818
},
1919
});

client/src/components/app-sidebar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "@/components/ui/sidebar";
1616
import { apiClient } from "@/lib/api";
1717
import { NavLink, useLocation } from "react-router";
18-
import { type UUID } from "@elizaos/core";
18+
import type { UUID } from "@elizaos/core";
1919
import { Book, Cog, User } from "lucide-react";
2020
import ConnectionStatus from "./connection-status";
2121

client/src/components/audio-recorder.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Ellipsis, Mic, Send, Trash } from "lucide-react";
99
import { cn } from "@/lib/utils";
1010
import { useToast } from "@/hooks/use-toast";
1111
import { useMutation } from "@tanstack/react-query";
12-
import { UUID } from "@elizaos/core";
12+
import type { UUID } from "@elizaos/core";
1313
import { apiClient } from "@/lib/api";
1414

1515
type Props = {

0 commit comments

Comments
 (0)