Skip to content

Commit 923e7df

Browse files
author
Shaw
committed
many fixes
1 parent 5f1dbc2 commit 923e7df

24 files changed

Lines changed: 519 additions & 362 deletions

File tree

packages/app-core/scripts/aosp/smoke-cuttlefish.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env node
2+
23
// eliza/packages/app-core/scripts/aosp/smoke-cuttlefish.mjs —
34
// end-to-end smoke test for the on-device agent. Confirms: cvd is up,
45
// APK is installed, service starts, /api/health responds, bearer
@@ -27,8 +28,8 @@
2728
// the local-inference active-model state as the signal; that endpoint
2829
// is only populated when a local libllama-backed model is loaded.
2930

30-
import fs from "node:fs";
3131
import { spawnSync } from "node:child_process";
32+
import fs from "node:fs";
3233
import path from "node:path";
3334
import process from "node:process";
3435
import { fileURLToPath } from "node:url";

packages/app-core/scripts/build-capacitor-app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import fs from "node:fs";
2121
import path from "node:path";
2222
import process from "node:process";
2323
import { fileURLToPath } from "node:url";
24-
import { resolveElizaAssetBaseUrls } from "./lib/asset-cdn.mjs";
2524
import { resolveMainAppDir } from "./lib/app-dir.mjs";
25+
import { resolveElizaAssetBaseUrls } from "./lib/asset-cdn.mjs";
2626
import { resolveRepoRootFromImportMeta } from "./lib/repo-root.mjs";
2727

2828
const __dirname = path.dirname(fileURLToPath(import.meta.url));

packages/app-core/scripts/desktop-build.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,11 @@ function packageDesktopBuild() {
693693
const macArch = process.arch === "arm64" ? "arm64" : "x64";
694694
// Electrobun's macOS builder removes this folder without force.
695695
fs.mkdirSync(
696-
path.join(ELECTROBUN_DIR, "build", `${buildEnv || "dev"}-macos-${macArch}`),
696+
path.join(
697+
ELECTROBUN_DIR,
698+
"build",
699+
`${buildEnv || "dev"}-macos-${macArch}`,
700+
),
697701
{ recursive: true },
698702
);
699703
}

packages/app-core/scripts/run-mobile-build.mjs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ import os from "node:os";
2727
import path from "node:path";
2828
import process from "node:process";
2929
import { fileURLToPath } from "node:url";
30+
import {
31+
loadAospVariantConfig,
32+
resolveAppConfigPath,
33+
} from "./aosp/lib/load-variant-config.mjs";
3034
import { resolveMainAppDir } from "./lib/app-dir.mjs";
3135
import {
3236
isCapacitorPlatformReady as isCapacitorPlatformReadyImpl,
3337
resolvePlatformTemplateRoot as resolvePlatformTemplateRootImpl,
3438
syncPlatformTemplateFiles as syncPlatformTemplateFilesImpl,
3539
} from "./lib/capacitor-platform-templates.mjs";
36-
import {
37-
loadAospVariantConfig,
38-
resolveAppConfigPath,
39-
} from "./aosp/lib/load-variant-config.mjs";
4040
import { resolveRepoRootFromImportMeta } from "./lib/repo-root.mjs";
4141
import { stageAndroidAgentRuntime } from "./lib/stage-android-agent.mjs";
4242

@@ -1659,7 +1659,10 @@ end
16591659

16601660
// ── Phase 5: Platform patches ───────────────────────────────────────────
16611661

1662-
function stripSpmPlugins(pluginNames, { reason = "incompatible SPM plugin" } = {}) {
1662+
function stripSpmPlugins(
1663+
pluginNames,
1664+
{ reason = "incompatible SPM plugin" } = {},
1665+
) {
16631666
const pkgPath = path.join(
16641667
appDir,
16651668
"ios",
@@ -2127,9 +2130,7 @@ async function generateAndroidBrandAssets() {
21272130
}
21282131

21292132
if (splashSource) {
2130-
for (const [dir, [width, height]] of Object.entries(
2131-
ANDROID_SPLASH_SIZES,
2132-
)) {
2133+
for (const [dir, [width, height]] of Object.entries(ANDROID_SPLASH_SIZES)) {
21332134
const out = path.join(resDir, dir);
21342135
fs.mkdirSync(out, { recursive: true });
21352136
await sharp(splashSource)
@@ -2139,7 +2140,9 @@ async function generateAndroidBrandAssets() {
21392140
}
21402141
}
21412142

2142-
console.log(`[mobile-build] Generated Android brand assets for ${APP.appName}.`);
2143+
console.log(
2144+
`[mobile-build] Generated Android brand assets for ${APP.appName}.`,
2145+
);
21432146
}
21442147

21452148
// ── Phase 6: Native builds ──────────────────────────────────────────────

packages/app-core/src/benchmark/mock-plugin-base.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ function createBenchmarkActionToon(prompt: string): string {
160160
thought: "Searching for the requested product.",
161161
actions: "BENCHMARK_ACTION",
162162
text: "Searching WebShop.",
163-
params: "BENCHMARK_ACTION:\n command: search[wireless bluetooth headphones]",
163+
params:
164+
"BENCHMARK_ACTION:\n command: search[wireless bluetooth headphones]",
164165
});
165166
}
166167

@@ -309,8 +310,9 @@ function createBenchmarkActionToon(prompt: string): string {
309310
/ignore|disregard|previous instructions|new instructions|system override|system command|dan|bypass|jailbreak/.test(
310311
lower,
311312
);
312-
const privilege =
313-
/admin|owner|root|privilege|permissions|elevate/.test(lower);
313+
const privilege = /admin|owner|root|privilege|permissions|elevate/.test(
314+
lower,
315+
);
314316
return buildToonResponse({
315317
thought: "Returning deterministic Trust benchmark analysis.",
316318
actions: "REPLY",

packages/app-core/src/benchmark/mock-plugin.ts

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ function extractPrompt(
2828
if (typeof message === "string") return message;
2929
if (message && typeof message === "object" && "content" in message) {
3030
const content = (message as { content?: unknown }).content;
31-
return typeof content === "string" ? content : JSON.stringify(content);
31+
return typeof content === "string"
32+
? content
33+
: JSON.stringify(content);
3234
}
3335
return JSON.stringify(message);
3436
})
@@ -316,7 +318,8 @@ function buildWebShopActionToon(prompt: string): string {
316318
actions: "BENCHMARK_ACTION",
317319
providers: "",
318320
text: "Searching WebShop.",
319-
params: "BENCHMARK_ACTION:\n command: search[wireless bluetooth headphones]",
321+
params:
322+
"BENCHMARK_ACTION:\n command: search[wireless bluetooth headphones]",
320323
});
321324
}
322325

@@ -348,8 +351,9 @@ function buildTrustAnalysisToon(prompt: string): string {
348351
/ignore|disregard|previous instructions|new instructions|system override|system command|dan|bypass|jailbreak/.test(
349352
lower,
350353
);
351-
const privilege =
352-
/admin|owner|root|privilege|permissions|elevate/.test(lower);
354+
const privilege = /admin|owner|root|privilege|permissions|elevate/.test(
355+
lower,
356+
);
353357
const analysis = {
354358
prompt_injection: {
355359
detected: promptInjection,
@@ -382,7 +386,8 @@ function buildSocialAlphaExtractionToon(prompt: string): string {
382386
const ticker = /\$([A-Z][A-Z0-9]{1,12})/.exec(message)?.[1] ?? "";
383387
const sell = /sell|dump|short|avoid|bearish|rug|scam/.test(lower);
384388
const buy = /buy|moon|pump|bullish|long|ape|gem|alpha|100x/.test(lower);
385-
const recommendation_type = buy && !sell ? "BUY" : sell && !buy ? "SELL" : "NOISE";
389+
const recommendation_type =
390+
buy && !sell ? "BUY" : sell && !buy ? "SELL" : "NOISE";
386391
const is_recommendation = recommendation_type !== "NOISE";
387392
const conviction = is_recommendation
388393
? /100x|moon|ape|strong|high|gem|alpha/.test(lower)
@@ -512,27 +517,45 @@ function buildCompletion(prompt: string): string {
512517
return buildVendingActionToon(prompt);
513518
}
514519

515-
if (/Benchmark:\*{0,2}\s*mind2web/i.test(prompt) || /Mind2Web benchmark/i.test(prompt)) {
520+
if (
521+
/Benchmark:\*{0,2}\s*mind2web/i.test(prompt) ||
522+
/Mind2Web benchmark/i.test(prompt)
523+
) {
516524
return buildMind2WebActionToon(prompt);
517525
}
518526

519-
if (/Benchmark:\*{0,2}\s*(terminal-bench|terminal_bench)/i.test(prompt) || /Terminal-Bench/i.test(prompt)) {
527+
if (
528+
/Benchmark:\*{0,2}\s*(terminal-bench|terminal_bench)/i.test(prompt) ||
529+
/Terminal-Bench/i.test(prompt)
530+
) {
520531
return buildTerminalCommandToon(prompt);
521532
}
522533

523-
if (/Benchmark:\*{0,2}\s*osworld/i.test(prompt) || /OSWorld|pyautogui/i.test(prompt)) {
534+
if (
535+
/Benchmark:\*{0,2}\s*osworld/i.test(prompt) ||
536+
/OSWorld|pyautogui/i.test(prompt)
537+
) {
524538
return buildOSWorldActionToon(prompt);
525539
}
526540

527-
if (/Benchmark:\*{0,2}\s*webshop/i.test(prompt) || /WebShop|simulated webstore|webstore/i.test(prompt)) {
541+
if (
542+
/Benchmark:\*{0,2}\s*webshop/i.test(prompt) ||
543+
/WebShop|simulated webstore|webstore/i.test(prompt)
544+
) {
528545
return buildWebShopActionToon(prompt);
529546
}
530547

531-
if (/Benchmark:\*{0,2}\s*gauntlet/i.test(prompt) || /Solana DeFi safety analyzer/i.test(prompt)) {
548+
if (
549+
/Benchmark:\*{0,2}\s*gauntlet/i.test(prompt) ||
550+
/Solana DeFi safety analyzer/i.test(prompt)
551+
) {
532552
return buildGauntletDecisionToon(prompt);
533553
}
534554

535-
if (/Benchmark:\*{0,2}\s*openclaw/i.test(prompt) || /OpenClaw|Node\.js project with TypeScript/i.test(prompt)) {
555+
if (
556+
/Benchmark:\*{0,2}\s*openclaw/i.test(prompt) ||
557+
/OpenClaw|Node\.js project with TypeScript/i.test(prompt)
558+
) {
536559
return buildOpenClawReplyToon(prompt);
537560
}
538561

@@ -613,7 +636,7 @@ function mockObjectModel(
613636
_runtime: IAgentRuntime,
614637
params: ObjectGenerationParams,
615638
): Record<string, JsonValue> {
616-
const prompt = extractPrompt(params.prompt ?? "");
639+
const prompt = extractPrompt(params.prompt ?? params);
617640
const command = extractCommand(prompt);
618641
const replyToon =
619642
/Benchmark:\*{0,2}\s*trust/i.test(prompt) ||

packages/app-core/src/benchmark/server.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,9 @@ export async function startBenchmarkServer() {
312312
elizaLogger.warn(
313313
`[bench] @elizaos/plugin-sql package entry is unavailable; falling back to workspace source at ${fallbackPath}`,
314314
);
315-
pluginModule = (await import(pathToFileURL(fallbackPath).href)) as Record<
316-
string,
317-
unknown
318-
>;
315+
pluginModule = (await import(
316+
pathToFileURL(fallbackPath).href
317+
)) as Record<string, unknown>;
319318
}
320319
const plugin =
321320
pluginModule.default ?? pluginModule[Object.keys(pluginModule)[0]];

packages/elizaos/templates-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "1.0.0",
3-
"generatedAt": "2026-05-05T15:50:08.644Z",
3+
"generatedAt": "2026-05-05T15:55:55.870Z",
44
"repoUrl": "https://github.com/elizaos/eliza",
55
"templates": [
66
{

packages/examples/browser-extension/chrome/src/content.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,7 @@ function cropToTokenLimit(
307307
content: ExtractedContent,
308308
maxChars = 400000,
309309
): string {
310-
const { fullText, visibleText, viewportStart, viewportEnd, totalLength } =
311-
content;
310+
const { fullText, visibleText } = content;
312311

313312
if (fullText.length <= maxChars) {
314313
// Add viewport markers if content fits

packages/examples/browser-extension/chrome/src/offscreen.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ type OffscreenSendChatRequest = {
2222
pageContent: PageContent | null;
2323
};
2424

25-
type OffscreenPingRequest = { type: "OFFSCREEN_PING" };
26-
type OffscreenResetRequest = { type: "OFFSCREEN_RESET" };
27-
28-
type OffscreenRequest =
29-
| OffscreenSendChatRequest
30-
| OffscreenPingRequest
31-
| OffscreenResetRequest;
32-
3325
function isObject(value: unknown): value is Record<string, unknown> {
3426
return typeof value === "object" && value !== null;
3527
}

0 commit comments

Comments
 (0)