Skip to content

Commit 7fb5ec5

Browse files
Shawclaude
andcommitted
fix(os): correct shared scripts path after packages consolidation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4cf976b commit 7fb5ec5

4 files changed

Lines changed: 47 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function normalizeLocaNativeMessages(
569569
normalized.push({
570570
role: "assistant",
571571
content: typeof message.content === "string" ? message.content : "",
572-
...(toolCalls.length > 0 ? { toolCalls } : {}),
572+
...(toolCalls.length > 0 ? { tool_calls: toolCalls } : {}),
573573
});
574574
continue;
575575
}
@@ -591,7 +591,7 @@ function normalizeLocaNativeMessages(
591591
: toolNamesById.get(toolCallId) || "tool";
592592
normalized.push({
593593
role: "tool",
594-
id: toolCallId,
594+
tool_call_id: toolCallId,
595595
name: toolName,
596596
content:
597597
typeof message.content === "string"

packages/core/src/capabilities/index.ts

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,10 +1260,23 @@ export class RuntimeBrokerCapabilityRouter implements ElizaCapabilityRouter {
12601260
});
12611261
const object = requireObject(result, "plugin.asset.get");
12621262
const integrity = optionalString(object, "integrity", "plugin.asset.get");
1263+
const path = requireNonEmptyString(object, "path", "plugin.asset.get");
1264+
validateRemotePluginAssetPath(path, "path", "plugin.asset.get");
1265+
const contentType = requireNonEmptyString(
1266+
object,
1267+
"contentType",
1268+
"plugin.asset.get",
1269+
);
1270+
validateHeaderSafeString(contentType, "contentType", "plugin.asset.get");
1271+
const bodyBase64 = requireString(object, "bodyBase64", "plugin.asset.get");
1272+
validateBase64String(bodyBase64, "bodyBase64", "plugin.asset.get");
1273+
if (integrity !== undefined) {
1274+
validateHeaderSafeString(integrity, "integrity", "plugin.asset.get");
1275+
}
12631276
return {
1264-
path: requireString(object, "path", "plugin.asset.get"),
1265-
contentType: requireString(object, "contentType", "plugin.asset.get"),
1266-
bodyBase64: requireString(object, "bodyBase64", "plugin.asset.get"),
1277+
path,
1278+
contentType,
1279+
bodyBase64,
12671280
...(integrity === undefined ? {} : { integrity }),
12681281
};
12691282
}
@@ -2802,6 +2815,31 @@ function validateRemotePluginAssetPath(
28022815
}
28032816
}
28042817

2818+
function validateHeaderSafeString(
2819+
value: string,
2820+
key: string,
2821+
method: string,
2822+
): void {
2823+
if (/[\r\n\0]/.test(value)) {
2824+
throw decodeError(method, `${key} must not contain control characters.`);
2825+
}
2826+
}
2827+
2828+
function validateBase64String(
2829+
value: string,
2830+
key: string,
2831+
method: string,
2832+
): void {
2833+
if (
2834+
value.length > 0 &&
2835+
!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
2836+
value,
2837+
)
2838+
) {
2839+
throw decodeError(method, `${key} must be valid base64.`);
2840+
}
2841+
}
2842+
28052843
function requirePluginActionResult(
28062844
value: JsonValue | undefined,
28072845
method: string,

packages/os/setup/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"description": "Electrobun desktop app for flashing elizaOS AOSP builds onto Pixel devices via ADB and fastboot.",
66
"type": "module",
77
"scripts": {
8-
"predev": "node ../shared/scripts/sync-to-public.mjs ./public",
8+
"predev": "node ../../shared/scripts/sync-to-public.mjs ./public",
99
"dev": "vite",
10-
"prebuild": "node ../shared/scripts/sync-to-public.mjs ./public",
10+
"prebuild": "node ../../shared/scripts/sync-to-public.mjs ./public",
1111
"build": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.main.json && vite build",
1212
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.main.json",
1313
"test": "vitest run --config ./vitest.config.ts",

packages/os/usb-installer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
}
1515
},
1616
"scripts": {
17-
"predev": "node ../shared/scripts/sync-to-public.mjs ./public --logos --favicons --ogembeds",
17+
"predev": "node ../../shared/scripts/sync-to-public.mjs ./public --logos --favicons --ogembeds",
1818
"dev": "vite",
19-
"prebuild": "node ../shared/scripts/sync-to-public.mjs ./public --logos --favicons --ogembeds",
19+
"prebuild": "node ../../shared/scripts/sync-to-public.mjs ./public --logos --favicons --ogembeds",
2020
"build": "tsc --noEmit -p tsconfig.json && vite build",
2121
"typecheck": "tsc --noEmit -p tsconfig.json",
2222
"test": "vitest run --config ./vitest.config.ts",

0 commit comments

Comments
 (0)