Skip to content

Commit a21ca72

Browse files
committed
fix build issues and remove logs
1 parent 0ea9a79 commit a21ca72

File tree

30 files changed

+139
-175
lines changed

30 files changed

+139
-175
lines changed

bun.lock

+111-67
Large diffs are not rendered by default.

packages/cli/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
"url": "https://github.com/elizaOS/eliza.git",
1616
"directory": "packages/cli"
1717
},
18-
"files": [
19-
"dist",
20-
"templates"
21-
],
18+
"files": ["dist", "templates"],
2219
"keywords": [],
2320
"type": "module",
2421
"exports": {

packages/cli/src/characters/eliza.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const character: Character = {
1919
"@elizaos/plugin-openai",
2020
"@elizaos/plugin-discord",
2121
"@elizaos/plugin-node",
22+
"@elizaos/plugin-sql",
2223
],
2324
secrets: {},
2425
system: "A friendly, helpful community manager and member of the team.",

packages/cli/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env node
2+
import fs from "node:fs";
23
import { agent } from "@/src/commands/agent";
34
import { init } from "@/src/commands/init";
45
import { plugins } from "@/src/commands/plugins";
@@ -7,7 +8,6 @@ import { teeCommand as tee } from "@/src/commands/tee";
78
import { loadEnvironment } from "@/src/utils/get-config";
89
import { logger } from "@/src/utils/logger";
910
import { Command } from "commander";
10-
import fs from "node:fs";
1111

1212
process.on("SIGINT", () => process.exit(0));
1313
process.on("SIGTERM", () => process.exit(0));

packages/cli/src/server/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ export class AgentServer {
182182
},
183183
};
184184

185-
// Serve static assets from the client path
186-
const clientPath = path.join(process.cwd(), "../client/dist");
185+
// Serve static assets from the client dist path
186+
const clientPath = path.join(process.cwd(), "dist");
187187
logger.info(`Client build path: ${clientPath}`);
188188
this.app.use("/", express.static(clientPath, staticOptions));
189189

packages/cli/src/utils/copy-template.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export async function copyClientDist() {
142142

143143
// Determine source and destination paths
144144
const srcClientDist = path.resolve(process.cwd(), "../client/dist");
145-
const destClientDist = path.resolve(process.cwd(), "./dist/client");
145+
const destClientDist = path.resolve(process.cwd(), "./dist");
146146

147147
// Create destination directory
148148
await fs.mkdir(destClientDist, { recursive: true });

packages/cli/templates/project-starter/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const character: Character = {
1515
"@elizaos/plugin-openai",
1616
"@elizaos/plugin-discord",
1717
"@elizaos/plugin-node",
18+
"@elizaos/plugin-sql",
1819
],
1920
settings: {
2021
secrets: {

packages/core/src/actions/choice.ts

-30
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,11 @@ export const choiceAction: Action = {
132132
responses: Memory[],
133133
): Promise<void> => {
134134
try {
135-
console.log("*** CHOICE HANDLER ***\n");
136-
137-
console.log("*** MESSAGE ***\n", JSON.stringify(message, null, 2));
138-
139135
const pendingTasks = await runtime.getDatabaseAdapter().getTasks({
140136
roomId: message.roomId,
141137
tags: ["AWAITING_CHOICE"],
142138
});
143139

144-
console.log(
145-
"*** PENDING TASKS ***\n",
146-
JSON.stringify(pendingTasks, null, 2),
147-
);
148-
149140
if (!pendingTasks?.length) {
150141
throw new Error("No pending tasks with options found");
151142
}
@@ -154,11 +145,6 @@ export const choiceAction: Action = {
154145
(task) => task.metadata?.options,
155146
);
156147

157-
console.log(
158-
"*** TASKS WITH OPTIONS ***\n",
159-
JSON.stringify(tasksWithOptions, null, 2),
160-
);
161-
162148
if (!tasksWithOptions.length) {
163149
throw new Error("No tasks currently have options to select from.");
164150
}
@@ -180,11 +166,6 @@ export const choiceAction: Action = {
180166
};
181167
});
182168

183-
console.log(
184-
"*** FORMATTED TASKS ***\n",
185-
JSON.stringify(formattedTasks, null, 2),
186-
);
187-
188169
const prompt = composePrompt({
189170
state: {
190171
...state,
@@ -197,25 +178,15 @@ export const choiceAction: Action = {
197178
template: optionExtractionTemplate,
198179
});
199180

200-
console.log("*** PROMPT ***\n", prompt);
201-
202181
const result = await runtime.useModel(ModelTypes.TEXT_SMALL, {
203182
prompt,
204183
stopSequences: [],
205184
});
206185

207-
console.log("*** RESULT ***\n", result);
208-
209186
const parsed = parseJSONObjectFromText(result);
210187
const { taskId, selectedOption } = parsed;
211188

212189
if (taskId && selectedOption) {
213-
console.log(
214-
"*** TASK ID AND SELECTED OPTION ***\n",
215-
taskId,
216-
selectedOption,
217-
);
218-
219190
// Find the task by matching the shortened UUID
220191
const taskMap = new Map(
221192
formattedTasks.map((task) => [task.taskId, task]),
@@ -246,7 +217,6 @@ export const choiceAction: Action = {
246217
}
247218

248219
if (selectedOption === "ABORT") {
249-
console.log("*** ABORT ***\n");
250220
await runtime.getDatabaseAdapter().deleteTask(selectedTask.id);
251221
await callback({
252222
text: `Task "${selectedTask.name}" has been cancelled.`,

packages/core/src/actions/settings.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ export async function updateWorldSettings(
457457
* Formats a list of settings for display
458458
*/
459459
function formatSettingsList(worldSettings: WorldSettings): string {
460-
console.log("*** WORLD SETTINGS ***\n", worldSettings);
461460
const settings = Object.entries(worldSettings)
462461
.filter(([key]) => !key.startsWith("_")) // Skip internal settings
463462
.map(([key, setting]) => {
@@ -467,8 +466,6 @@ function formatSettingsList(worldSettings: WorldSettings): string {
467466
})
468467
.join("\n");
469468

470-
console.log("*** SETTINGS LIST ***\n", settings);
471-
472469
return settings || "No settings available";
473470
}
474471

@@ -513,7 +510,6 @@ async function extractSettingValues(
513510
worldSettings: WorldSettings,
514511
): Promise<SettingUpdate[]> {
515512
try {
516-
console.log("*** WORLD SETTINGS ***\n", worldSettings);
517513
// Create prompt with current settings status for better extraction
518514
const prompt = composePrompt({
519515
state: {
@@ -531,16 +527,14 @@ async function extractSettingValues(
531527
},
532528
template: extractionTemplate,
533529
});
534-
console.log("*** EXTRACTION PROMPT ***\n", prompt);
530+
535531
// Generate extractions using larger model for better comprehension
536532
const extractions = (await generateObjectArray({
537533
runtime,
538534
prompt,
539535
modelType: ModelTypes.TEXT_LARGE,
540536
})) as SettingUpdate[];
541537

542-
console.log("*** EXTRACTIONS ***\n", extractions);
543-
544538
logger.info(`Extracted ${extractions.length} potential setting updates`);
545539

546540
// Validate each extraction against setting definitions

packages/core/src/evaluators/reflection.ts

-2
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ async function handler(runtime: IAgentRuntime, message: Memory, state?: State) {
266266
}),
267267
]);
268268

269-
console.log("****** entities ******\n", entities);
270-
271269
const prompt = composePrompt({
272270
state: {
273271
...state,

packages/core/src/roles.ts

-8
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,22 @@ export async function getUserServerRole(
3131
serverId: string,
3232
): Promise<Role> {
3333
try {
34-
console.log("*** GET USER SERVER ROLE ***\n", entityId, serverId);
3534
const worldId = createUniqueUuid(runtime, serverId);
36-
console.log("*** WORLD ID ***\n", worldId);
3735
const world = await runtime.getDatabaseAdapter().getWorld(worldId);
38-
console.log("*** WORLD ***\n", world);
3936

4037
if (!world || !world.metadata?.roles) {
41-
console.log("*** NO ROLES ***\n");
4238
return Role.NONE;
4339
}
4440

4541
if (world.metadata.roles[entityId]) {
46-
console.log("*** ROLE ***\n", world.metadata.roles[entityId]);
4742
return world.metadata.roles[entityId] as Role;
4843
}
4944

5045
// Also check original ID format
5146
if (world.metadata.roles[entityId]) {
52-
console.log("*** ROLE ***\n", world.metadata.roles[entityId]);
5347
return world.metadata.roles[entityId] as Role;
5448
}
5549

56-
console.log("WORLD METADATA IS", JSON.stringify(world.metadata, null, 2));
57-
5850
return Role.NONE;
5951
} catch (error) {
6052
logger.error(`Error getting user role: ${error}`);

packages/core/src/runtime.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,9 @@ export class AgentRuntime implements IAgentRuntime {
140140
*/
141141
async registerPlugin(plugin: Plugin): Promise<void> {
142142
if (!plugin) {
143-
console.log("*** registerPlugin plugin is undefined");
144-
return;
143+
throw new Error("*** registerPlugin plugin is undefined");
145144
}
146145

147-
console.log("*** registerPlugin plugin", plugin);
148-
149146
// Add to plugins array if not already present - but only if it was not passed there initially
150147
// (otherwise we can't add to readonly array)
151148
if (!this.plugins.some((p) => p.name === plugin.name)) {

packages/plugin-discord/package.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
}
1616
}
1717
},
18-
"files": [
19-
"dist"
20-
],
18+
"files": ["dist"],
2119
"dependencies": {
2220
"@discordjs/opus": "github:discordjs/opus",
2321
"@discordjs/rest": "2.4.0",
@@ -38,10 +36,7 @@
3836
"test": "vitest run",
3937
"lint": "biome check ./src --config-path=./ --apply-unsafe && biome format ./ --config-path=./ --write"
4038
},
41-
"trustedDependencies": [
42-
"@discordjs/opus",
43-
"@discordjs/voice"
44-
],
39+
"trustedDependencies": ["@discordjs/opus", "@discordjs/voice"],
4540
"peerDependencies": {
4641
"whatwg-url": "7.1.0"
4742
},

packages/plugin-local-ai/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
}
1515
}
1616
},
17-
"files": [
18-
"dist"
19-
],
17+
"files": ["dist"],
2018
"dependencies": {
2119
"@anush008/tokenizers": "^0.0.0",
2220
"@aws-sdk/client-s3": "^3.749.0",

packages/plugin-node/package.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
}
1616
}
1717
},
18-
"files": [
19-
"dist",
20-
"scripts",
21-
"package.json",
22-
"LICENSE",
23-
"tsup.config.ts"
24-
],
18+
"files": ["dist", "scripts", "package.json", "LICENSE", "tsup.config.ts"],
2519
"dependencies": {
2620
"@aws-sdk/client-s3": "^3.705.0",
2721
"@aws-sdk/s3-request-presigner": "^3.705.0",
@@ -76,9 +70,7 @@
7670
"yargs": "17.7.2",
7771
"youtube-dl-exec": "3.0.15"
7872
},
79-
"trustedDependencies": [
80-
"youtube-dl-exec"
81-
],
73+
"trustedDependencies": ["youtube-dl-exec"],
8274
"devDependencies": {
8375
"@types/node": "22.8.4",
8476
"tsup": "8.4.0"

packages/plugin-openai/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
}
1515
}
1616
},
17-
"files": [
18-
"dist"
19-
],
17+
"files": ["dist"],
2018
"dependencies": {
2119
"@ai-sdk/openai": "^1.1.9",
2220
"@ai-sdk/ui-utils": "1.1.9",

packages/plugin-sql/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
}
1919
}
2020
},
21-
"files": [
22-
"dist"
23-
],
21+
"files": ["dist"],
2422
"dependencies": {
2523
"@electric-sql/pglite": "^0.2.17",
2624
"@elizaos/core": "^1.0.0-alpha.12",

packages/plugin-sql/src/base.ts

-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ export abstract class BaseDrizzleAdapter<
134134
},
135135
);
136136

137-
console.trace("****** Database operation failure source");
138-
139137
await new Promise((resolve) => setTimeout(resolve, delay));
140138
} else {
141139
logger.error("Max retry attempts reached:", {

packages/plugin-sql/src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export function createDatabaseAdapter(
3232
},
3333
agentId: UUID,
3434
): IDatabaseAdapter {
35-
console.log("*** postgresUrl", config.postgresUrl);
3635
if (config.postgresUrl) {
3736
if (!postgresConnectionManager) {
3837
postgresConnectionManager = new PostgresConnectionManager(
@@ -64,7 +63,6 @@ const drizzlePlugin: Plugin = {
6463
name: "drizzle",
6564
description: "Database adapter plugin using Drizzle ORM",
6665
init: async (_, runtime: IAgentRuntime) => {
67-
console.log("*** drizzlePlugin init");
6866
const config = {
6967
dataDir: runtime.getSetting("PGLITE_DATA_DIR") ?? "./pglite",
7068
postgresUrl: runtime.getSetting("POSTGRES_URL"),

packages/plugin-starter/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
}
1616
}
1717
},
18-
"files": [
19-
"dist"
20-
],
18+
"files": ["dist"],
2119
"dependencies": {
2220
"@elizaos/core": "^1.0.0-alpha.12",
2321
"zod": "3.21.4"

packages/plugin-telegram/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
}
1616
}
1717
},
18-
"files": [
19-
"dist"
20-
],
18+
"files": ["dist"],
2119
"dependencies": {
2220
"@telegraf/types": "7.1.0",
2321
"telegraf": "4.16.3"

packages/plugin-twitter/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
}
1616
}
1717
},
18-
"files": [
19-
"dist"
20-
],
18+
"files": ["dist"],
2119
"dependencies": {
2220
"@elizaos/core": "^1.0.0-alpha.12",
2321
"@roamhq/wrtc": "^0.8.0",

packages/project-starter/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
}
1616
}
1717
},
18-
"files": [
19-
"dist"
20-
],
18+
"files": ["dist"],
2119
"dependencies": {
2220
"@elizaos/core": "^1.0.0-alpha.12",
2321
"zod": "3.21.4"

packages/project-starter/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const character: Character = {
2121
"@elizaos/plugin-openai",
2222
"@elizaos/plugin-discord",
2323
"@elizaos/plugin-node",
24+
"@elizaos/plugin-sql",
2425
],
2526
settings: {
2627
secrets: {

0 commit comments

Comments
 (0)