Skip to content

Commit c801a9a

Browse files
committed
Merge branch 'v2-develop' into init-clean-up
2 parents dc9f881 + a5d7e9b commit c801a9a

File tree

100 files changed

+1415
-806
lines changed

Some content is hidden

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

100 files changed

+1415
-806
lines changed

Diff for: biome.json

-31
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
"rules": {
99
"recommended": true,
1010
"suspicious": {
11-
"noExplicitAny": "warn",
1211
"noArrayIndexKey": "warn",
1312
"noPrototypeBuiltins": "warn",
1413
"noDuplicateObjectKeys": "warn",
1514
"noGlobalIsNan": "warn",
16-
"noDuplicateFontNames": "warn",
1715
"noSelfCompare": "warn",
1816
"noDoubleEquals": "warn",
19-
"noImplicitAnyLet": "warn",
2017
"noAssignInExpressions": "warn",
21-
"noExportsInTest": "warn",
2218
"noConstEnum": "warn",
2319
"noEmptyInterface": "warn"
2420
},
@@ -30,42 +26,15 @@
3026
"noUnnecessaryContinue": "warn",
3127
"noInnerDeclarations": "warn"
3228
},
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-
},
5829
"complexity": {
5930
"noForEach": "warn",
6031
"useOptionalChain": "warn",
6132
"useArrowFunction": "warn",
6233
"useFlatMap": "warn",
63-
"useLiteralKeys": "warn",
6434
"noBannedTypes": "warn",
6535
"noStaticOnlyClass": "warn",
6636
"noThisInStatic": "warn",
6737
"noUselessConstructor": "warn",
68-
"noUselessTernary": "warn",
6938
"noUselessSwitchCase": "warn",
7039
"noUselessCatch": "warn"
7140
},

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"scripts": {
44
"format": "biome format --write .",
55
"cli": "bun --filter=@elizaos/cli cli",
6-
"lint": "biome lint . --write",
6+
"lint": "turbo run lint:fix --filter=./packages/*",
77
"check": "biome check --apply .",
88
"preinstall": "npx only-allow bun",
99
"build": "turbo run build --filter=./packages/core && turbo run build --filter=./packages/*",

Diff for: packages/agent/src/api.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
22
type Character,
33
getEnvVariable,
4-
IAgentRuntime,
5-
ITeeLogService,
4+
type IAgentRuntime,
5+
type ITeeLogService,
66
logger,
77
ServiceType,
8-
TeeLogQuery,
8+
type TeeLogQuery,
99
type UUID,
1010
validateCharacterConfig,
1111
validateUuid

Diff for: packages/agent/src/defaultCharacter.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { type Character } from "@elizaos/core";
1+
import type { Character } from "@elizaos/core";
22

33
export const defaultCharacter: Character = {
44
name: "Eliza",
55
username: "eliza",
66
plugins: [
77
"@elizaos/plugin-anthropic",
88
"@elizaos/plugin-openai",
9+
"@elizaos/plugin-local-ai",
910
"@elizaos/plugin-discord",
1011
"@elizaos/plugin-node",
1112
"@elizaos/plugin-telegram",

Diff for: packages/agent/src/plugins.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
DbCacheAdapter,
99
logger,
1010
stringToUuid,
11-
TestSuite,
11+
type TestSuite,
1212
type IAgentRuntime
1313
} from "@elizaos/core";
1414
import { afterAll, beforeAll, describe, it } from 'vitest';

Diff for: packages/agent/src/reply.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {
2-
type Action,
3-
type ActionExample,
4-
type HandlerCallback,
5-
type IAgentRuntime,
6-
type Memory,
7-
type State,
1+
import type {
2+
Action,
3+
ActionExample,
4+
HandlerCallback,
5+
IAgentRuntime,
6+
Memory,
7+
State,
88
} from "@elizaos/core";
99

1010
const replyAction = {

Diff for: packages/cli/src/commands/agent.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ agent
6262
try {
6363
// If input is a number, get agent ID from index
6464
if (!isNaN(Number(agentIdOrIndex))) {
65-
agentIdOrIndex = await getAgentIdFromIndex(parseInt(agentIdOrIndex))
65+
agentIdOrIndex = await getAgentIdFromIndex(Number.parseInt(agentIdOrIndex))
6666
}
6767

6868
const response = await fetch(`${AGENT_RUNTIME_URL}/agents/${agentIdOrIndex}`)
@@ -122,7 +122,7 @@ agent
122122
.action(async (agentIdOrIndex) => {
123123
try {
124124
if (!isNaN(Number(agentIdOrIndex))) {
125-
agentIdOrIndex = await getAgentIdFromIndex(parseInt(agentIdOrIndex))
125+
agentIdOrIndex = await getAgentIdFromIndex(Number.parseInt(agentIdOrIndex))
126126
}
127127

128128
const response = await fetch(`${AGENT_RUNTIME_URL}/agents/${agentIdOrIndex}/stop`, {
@@ -146,7 +146,7 @@ agent
146146
.action(async (agentIdOrIndex) => {
147147
try {
148148
if (!isNaN(Number(agentIdOrIndex))) {
149-
agentIdOrIndex = await getAgentIdFromIndex(parseInt(agentIdOrIndex))
149+
agentIdOrIndex = await getAgentIdFromIndex(Number.parseInt(agentIdOrIndex))
150150
}
151151

152152
const response = await fetch(`${AGENT_RUNTIME_URL}/agents/${agentIdOrIndex}`, {
@@ -171,7 +171,7 @@ agent
171171
.action(async (agentIdOrIndex, configPath) => {
172172
try {
173173
if (!isNaN(Number(agentIdOrIndex))) {
174-
agentIdOrIndex = await getAgentIdFromIndex(parseInt(agentIdOrIndex))
174+
agentIdOrIndex = await getAgentIdFromIndex(Number.parseInt(agentIdOrIndex))
175175
}
176176

177177
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'))

Diff for: packages/core/__tests__/knowledge.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { beforeEach, describe, expect, it, vi } from "vitest";
22
import knowledge from "../src/knowledge";
33
import type { AgentRuntime } from "../src/runtime";
4-
import { type Memory } from "../src/types";
4+
import type { Memory } from "../src/types";
55

66
vi.mock("../generation", () => ({
77
splitChunks: vi.fn().mockImplementation(async (text) => [text]),

Diff for: packages/core/__tests__/mockCharacter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Character } from "@elizaos/core";
1+
import type { Character } from "@elizaos/core";
22

33
export const mockCharacter: Character = {
44
name: "Eliza",

Diff for: packages/core/__tests__/runtime.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { beforeEach, describe, expect, it, test, vi } from "vitest";
22
import { AgentRuntime } from "../src/runtime";
3-
import {
4-
type Action,
5-
type IDatabaseAdapter,
6-
type IMemoryManager,
7-
type Memory,
8-
type UUID
3+
import type {
4+
Action,
5+
IDatabaseAdapter,
6+
IMemoryManager,
7+
Memory,
8+
UUID
99
} from "../src/types";
1010

1111
// Mock dependencies with minimal implementations

Diff for: packages/core/src/knowledge.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ async function get(
88
runtime: AgentRuntime,
99
message: Memory
1010
): Promise<KnowledgeItem[]> {
11+
console.log("get", message);
1112
// Add validation for message
1213
if (!message?.content?.text) {
1314
logger.warn("Invalid message for knowledge query:", {
@@ -69,6 +70,7 @@ async function set(
6970
chunkSize = 512,
7071
bleed = 20
7172
) {
73+
console.log("set", item);
7274
const embedding = await runtime.useModel(ModelClass.TEXT_EMBEDDING, null);
7375
await runtime.documentsManager.createMemory({
7476
id: item.id,

Diff for: packages/core/src/memory.ts

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export class MemoryManager implements IMemoryManager {
5050
* @throws Error if the memory content is empty
5151
*/
5252
async addEmbeddingToMemory(memory: Memory): Promise<Memory> {
53+
console.log("addEmbeddingToMemory", memory);
5354
// Return early if embedding already exists
5455
if (memory.embedding) {
5556
return memory;
@@ -173,6 +174,7 @@ export class MemoryManager implements IMemoryManager {
173174
*/
174175
async createMemory(memory: Memory, unique = false): Promise<void> {
175176
// TODO: check memory.agentId == this.runtime.agentId
177+
console.log("createMemory", memory);
176178

177179
const existingMessage =
178180
await this.runtime.databaseAdapter.getMemoryById(memory.id);

Diff for: packages/core/src/runtime.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import {
4444
type Provider,
4545
type State,
4646
type UUID,
47-
ServiceType,
48-
Service
47+
type ServiceType,
48+
type Service
4949
} from "./types.ts";
5050
import { stringToUuid } from "./uuid.ts";
5151

Diff for: packages/core/src/test_resources/createRuntime.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SqliteDatabaseAdapter, loadVecExtensions } from "@elizaos-plugins/sqlite";
22
import type { DatabaseAdapter } from "../database.ts";
33
import { AgentRuntime } from "../runtime.ts";
4-
import { type Action, type Evaluator, type Provider } from "../types.ts";
4+
import type { Action, Evaluator, Provider } from "../types.ts";
55
import {
66
zeroUuid
77
} from "./constants.ts";

Diff for: packages/plugin-anthropic/biome.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3+
"extends": ["../../biome.json"],
4+
"organizeImports": {
5+
"enabled": false
6+
},
7+
"formatter": {
8+
"enabled": true,
9+
"indentStyle": "space",
10+
"indentWidth": 4,
11+
"lineWidth": 100
12+
},
13+
"javascript": {
14+
"formatter": {
15+
"quoteStyle": "single"
16+
}
17+
},
18+
"files": {
19+
"ignore": [
20+
"dist/**/*",
21+
"extra/**/*",
22+
"node_modules/**/*"
23+
]
24+
}
25+
}

Diff for: packages/plugin-anthropic/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { anthropic } from "@ai-sdk/anthropic";
22
import type { Plugin } from "@elizaos/core";
33
import {
4-
GenerateTextParams,
4+
type GenerateTextParams,
55
ModelClass
66
} from "@elizaos/core";
77
import { generateText } from "ai";

Diff for: packages/plugin-bootstrap/biome.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3+
"extends": ["../../biome.json"],
4+
"organizeImports": {
5+
"enabled": false
6+
},
7+
"formatter": {
8+
"enabled": true,
9+
"indentStyle": "space",
10+
"indentWidth": 4,
11+
"lineWidth": 100
12+
},
13+
"javascript": {
14+
"formatter": {
15+
"quoteStyle": "single"
16+
}
17+
},
18+
"files": {
19+
"ignore": [
20+
"dist/**/*",
21+
"extra/**/*",
22+
"node_modules/**/*"
23+
]
24+
}
25+
}

Diff for: packages/plugin-bootstrap/src/providers/facts.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Memory, Provider, State } from "@elizaos/core";
22
import {
33
formatMessages,
4-
IAgentRuntime,
4+
type IAgentRuntime,
55
MemoryManager,
66
ModelClass
77
} from "@elizaos/core";
@@ -10,6 +10,8 @@ import { formatFacts } from "../evaluators/fact.ts";
1010
const factsProvider: Provider = {
1111
get: async (runtime: IAgentRuntime, message: Memory, state?: State) => {
1212
const recentMessagesData = state?.recentMessagesData?.slice(-10);
13+
console.log("get", message);
14+
1315

1416
const recentMessages = formatMessages({
1517
messages: recentMessagesData,

Diff for: packages/plugin-discord/biome.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3+
"extends": ["../../biome.json"],
4+
"organizeImports": {
5+
"enabled": false
6+
},
7+
"formatter": {
8+
"enabled": true,
9+
"indentStyle": "space",
10+
"indentWidth": 4,
11+
"lineWidth": 100
12+
},
13+
"javascript": {
14+
"formatter": {
15+
"quoteStyle": "single"
16+
}
17+
},
18+
"files": {
19+
"ignore": [
20+
"dist/**/*",
21+
"extra/**/*",
22+
"node_modules/**/*"
23+
]
24+
}
25+
}

Diff for: packages/plugin-discord/src/actions/reply.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {
2-
type Action,
3-
type HandlerCallback,
4-
type IAgentRuntime,
5-
type Memory,
6-
type State
1+
import type {
2+
Action,
3+
HandlerCallback,
4+
IAgentRuntime,
5+
Memory,
6+
State
77
} from "@elizaos/core";
88

99
const replyAction = {

Diff for: packages/plugin-discord/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
logger,
33
stringToUuid,
4-
TestSuite,
4+
type TestSuite,
55
type Character,
66
type Client as ElizaClient,
77
type IAgentRuntime,
@@ -28,7 +28,7 @@ import { MessageManager } from "./messages.ts";
2828
import channelStateProvider from "./providers/channelState.ts";
2929
import voiceStateProvider from "./providers/voiceState.ts";
3030
import reply from "./actions/reply.ts";
31-
import { IDiscordClient } from "./types.ts";
31+
import type { IDiscordClient } from "./types.ts";
3232
import { VoiceManager } from "./voice.ts";
3333

3434
export class DiscordClient extends EventEmitter implements IDiscordClient {

Diff for: packages/plugin-discord/src/messages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ChannelType,
1010
type Client,
1111
type Message as DiscordMessage,
12-
TextChannel,
12+
type TextChannel,
1313
} from "discord.js";
1414
import { AttachmentManager } from "./attachments.ts";
1515
import {

0 commit comments

Comments
 (0)