Skip to content

Commit aca7276

Browse files
lalaluneclaude
andcommitted
fix(verify): more biome auto-fixes + dist-paths to plugin-local-inference src
Cleared more lint regressions blocking 'bun run verify': - packages/app-core, packages/benchmarks/eliza-1, packages/examples/trader, packages/plugin-elizacloud: biome format + organize-imports (12 files) - tsconfig.dist-paths.json: @elizaos/plugin-local-inference path mapping now points at the package's own `src/index.ts` instead of a non-existent `dist/index.d.ts`. The plugin's package.json types field is `src/index.ts` (the plugin uses tsup which doesn't emit .d.ts files), but dist-paths.json was overriding to dist/index.d.ts. Result: every consumer that uses dist-paths (agent-console, cloudflare-worker, etc.) saw 'Could not find a declaration file' for the plugin's default export. - packages/ui token-tree.test.ts: replaced two more non-null assertions with explicit guard (`if (!desc1) throw`) to clear 2 typecheck errors that the prior unsafe-fix pass introduced. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 96c5e3a commit aca7276

19 files changed

Lines changed: 422 additions & 391 deletions

File tree

packages/app-core/src/api/cloud-voice-routes.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ describe("GET /api/cloud/voices", () => {
232232
);
233233
expect(handled).toBe(true);
234234
expect(captured.status).toBe(401);
235-
expect(JSON.parse(captured.body ?? "{}")).toEqual({ error: "Unauthorized" });
235+
expect(JSON.parse(captured.body ?? "{}")).toEqual({
236+
error: "Unauthorized",
237+
});
236238
expect(counts.fetchCatalog).toBe(0);
237239
});
238240
});

packages/app-core/src/api/cloud-voice-routes.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ import {
2121
type CloudVoiceCatalogEntry,
2222
fetchCloudVoiceCatalog as defaultFetchCloudVoiceCatalog,
2323
} from "@elizaos/plugin-elizacloud";
24-
import {
25-
ensureRouteAuthorized as defaultEnsureRouteAuthorized,
26-
} from "./auth.ts";
24+
import { ensureRouteAuthorized as defaultEnsureRouteAuthorized } from "./auth.ts";
2725
import type { CompatRuntimeState } from "./compat-route-shared";
2826
import {
2927
sendJsonError as sendJsonErrorResponse,
@@ -66,7 +64,8 @@ export async function handleCloudVoiceRoutes(
6664
deps: CloudVoiceRouteDeps = {},
6765
): Promise<boolean> {
6866
const fetchCatalog = deps.fetchCatalog ?? defaultFetchCloudVoiceCatalog;
69-
const ensureAuthorized = deps.ensureAuthorized ?? defaultEnsureRouteAuthorized;
67+
const ensureAuthorized =
68+
deps.ensureAuthorized ?? defaultEnsureRouteAuthorized;
7069

7170
const method = (req.method ?? "GET").toUpperCase();
7271
const url = new URL(req.url ?? "/", "http://localhost");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ export {
114114
validateMcpServerConfig,
115115
};
116116

117+
import { handleLocalInferenceCompatRoutes } from "@elizaos/plugin-local-inference/routes";
118+
import { deviceBridge } from "@elizaos/plugin-local-inference/services";
117119
import {
118120
ensureRuntimeSqlCompatibility,
119121
executeRawSql,
@@ -122,8 +124,6 @@ import {
122124
settingsDebugCloudSummary,
123125
sqlLiteral,
124126
} from "@elizaos/shared";
125-
import { deviceBridge } from "@elizaos/plugin-local-inference/services";
126-
import { handleLocalInferenceCompatRoutes } from "@elizaos/plugin-local-inference/routes";
127127
import { buildCharacterFromConfig } from "../runtime/build-character-from-config";
128128
import { handleAuthBootstrapRoutes } from "./auth-bootstrap-routes";
129129
import { handleAuthPairingCompatRoutes } from "./auth-pairing-routes";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ export function composeBenchmarkPrompt(params: {
418418
segments.push(
419419
[
420420
"This is LOCA-bench. If work remains, emit exactly one benchmark tool call; progress text is invalid.",
421-
"Use actions: [\"BENCHMARK_ACTION\"] with params.BENCHMARK_ACTION.tool_name set to one of the available LOCA tool names and params.BENCHMARK_ACTION.arguments set to that tool's JSON arguments.",
422-
"For example: {\"actions\":[\"BENCHMARK_ACTION\"],\"text\":\"\",\"params\":{\"BENCHMARK_ACTION\":{\"tool_name\":\"filesystem_list_directory\",\"arguments\":{\"path\":\"source_data\"}}}}",
421+
'Use actions: ["BENCHMARK_ACTION"] with params.BENCHMARK_ACTION.tool_name set to one of the available LOCA tool names and params.BENCHMARK_ACTION.arguments set to that tool\'s JSON arguments.',
422+
'For example: {"actions":["BENCHMARK_ACTION"],"text":"","params":{"BENCHMARK_ACTION":{"tool_name":"filesystem_list_directory","arguments":{"path":"source_data"}}}}',
423423
"Only use REPLY after the requested output files have been written.",
424424
].join(" "),
425425
);

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ function normalizeLocaIncomingToolCall(
209209
type: "function",
210210
function: {
211211
name,
212-
arguments:
213-
typeof args === "string" ? args : JSON.stringify(args ?? {}),
212+
arguments: typeof args === "string" ? args : JSON.stringify(args ?? {}),
214213
},
215214
};
216215
}
@@ -242,7 +241,8 @@ function normalizeLocaNativeToolCalls(rawToolCalls: unknown): Array<{
242241
? fn.name
243242
: "";
244243
if (!name) continue;
245-
const args = call.input ?? call.args ?? call.arguments ?? fn.arguments ?? {};
244+
const args =
245+
call.input ?? call.args ?? call.arguments ?? fn.arguments ?? {};
246246
calls.push({
247247
id:
248248
typeof call.toolCallId === "string"
@@ -253,8 +253,7 @@ function normalizeLocaNativeToolCalls(rawToolCalls: unknown): Array<{
253253
type: "function",
254254
function: {
255255
name,
256-
arguments:
257-
typeof args === "string" ? args : JSON.stringify(args ?? {}),
256+
arguments: typeof args === "string" ? args : JSON.stringify(args ?? {}),
258257
},
259258
});
260259
}
@@ -1741,7 +1740,9 @@ export async function startBenchmarkServer() {
17411740
let nativeResult: unknown;
17421741
try {
17431742
nativeResult = await runtime.useModel(ModelType.TEXT_LARGE, {
1744-
messages: normalizeLocaNativeMessages(benchmarkContext.messages),
1743+
messages: normalizeLocaNativeMessages(
1744+
benchmarkContext.messages,
1745+
),
17451746
tools: benchmarkContext.tools,
17461747
toolChoice: "required",
17471748
maxTokens:

packages/app-core/src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
// Node/runtime barrel for @elizaos/app-core.
22
// Frontend surfaces live in @elizaos/ui; pure contracts/utilities live in @elizaos/shared.
33

4+
// Local inference handler registration moved to @elizaos/plugin-local-inference.
5+
// Re-export the public symbols so existing `import { ensureLocalInferenceHandler }
6+
// from "@elizaos/app-core"` callers keep resolving without code changes.
7+
export {
8+
ensureLocalInferenceHandler,
9+
shouldEnableMobileLocalInference,
10+
} from "@elizaos/plugin-local-inference/runtime";
411
export * from "./account-pool";
512
export * from "./api/auth";
613
export * from "./api/automation-node-contributors";
@@ -33,13 +40,6 @@ export * from "./runtime/build-character-from-config";
3340
export * from "./runtime/build-variant";
3441
export * from "./runtime/channel-plugin-map";
3542
export * from "./runtime/eliza";
36-
// Local inference handler registration moved to @elizaos/plugin-local-inference.
37-
// Re-export the public symbols so existing `import { ensureLocalInferenceHandler }
38-
// from "@elizaos/app-core"` callers keep resolving without code changes.
39-
export {
40-
ensureLocalInferenceHandler,
41-
shouldEnableMobileLocalInference,
42-
} from "@elizaos/plugin-local-inference/runtime";
4343
export * from "./runtime/mobile-safe-runtime";
4444
export * from "./runtime/mode/runtime-mode";
4545
export * from "./security/agent-vault-id";

packages/app-core/src/register-runtime-hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { registerAppCoreRuntimeHooks } from "./runtime/app-core-runtime-hooks";
21
import { ensureLocalInferenceHandler } from "@elizaos/plugin-local-inference/runtime";
2+
import { registerAppCoreRuntimeHooks } from "./runtime/app-core-runtime-hooks";
33
import { hydrateWalletKeysFromNodePlatformSecureStore } from "./security/hydrate-wallet-keys-from-platform-store";
44
import {
55
applyAccountPoolApiCredentials,

packages/app-core/src/runtime/eliza.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ import {
3535
type Plugin,
3636
stringToUuid,
3737
} from "@elizaos/core";
38+
import type { EmbeddingProgressCallback } from "@elizaos/plugin-local-inference/runtime";
39+
import {
40+
DEFAULT_MODELS_DIR,
41+
detectEmbeddingPreset,
42+
embeddingGgufFilePresent,
43+
ensureLocalInferenceHandler,
44+
ensureModel,
45+
findExistingEmbeddingModelForWarmupReuse,
46+
isEmbeddingWarmupReuseDisabled,
47+
shouldEnableMobileLocalInference,
48+
shouldWarmupLocalEmbeddingModel,
49+
} from "@elizaos/plugin-local-inference/runtime";
3850
import {
3951
ensureRuntimeSqlCompatibility,
4052
isMobilePlatform,
@@ -50,18 +62,6 @@ import {
5062
type AppRoutePluginRegistryEntry,
5163
listAppRoutePluginLoaders,
5264
} from "./app-route-plugin-registry.js";
53-
import type { EmbeddingProgressCallback } from "@elizaos/plugin-local-inference/runtime";
54-
import {
55-
DEFAULT_MODELS_DIR,
56-
detectEmbeddingPreset,
57-
embeddingGgufFilePresent,
58-
ensureLocalInferenceHandler,
59-
ensureModel,
60-
findExistingEmbeddingModelForWarmupReuse,
61-
isEmbeddingWarmupReuseDisabled,
62-
shouldEnableMobileLocalInference,
63-
shouldWarmupLocalEmbeddingModel,
64-
} from "@elizaos/plugin-local-inference/runtime";
6565
import {
6666
ensureTextToSpeechHandler,
6767
isEdgeTtsDisabled as isTextToSpeechEdgeTtsDisabled,

packages/app-core/src/services/phrase-chunked-tts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
*/
2929

3030
import type {
31-
AcceptedToken,
32-
Phrase,
33-
PhraseChunkerConfig,
31+
AcceptedToken,
32+
Phrase,
33+
PhraseChunkerConfig,
3434
} from "@elizaos/plugin-local-inference/services";
3535
import { PhraseChunker } from "@elizaos/plugin-local-inference/services";
3636

packages/benchmarks/eliza-1/src/engine-resolver.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ interface SharedPathsLike {
7676
* ELIZA_STATE_DIR > MILADY_STATE_DIR > ~/.${ELIZA_NAMESPACE ?? "eliza"}
7777
*/
7878
function benchElizaModelsDir(): string {
79-
const explicit =
80-
process.env.ELIZA_STATE_DIR ?? process.env.MILADY_STATE_DIR;
79+
const explicit = process.env.ELIZA_STATE_DIR ?? process.env.MILADY_STATE_DIR;
8180
const ns = process.env.ELIZA_NAMESPACE ?? "eliza";
8281
const stateDir = explicit ?? path.join(homedir(), `.${ns}`);
8382
return path.join(stateDir, "local-inference", "models");
@@ -105,10 +104,10 @@ async function tryImport<T>(spec: string): Promise<T | null> {
105104
}
106105

107106
function pluginLocalInferenceServicesUrl(): string {
108-
return new URL(
109-
"../../../../plugins/plugin-local-inference/src/services/index.ts",
110-
import.meta.url,
111-
).href;
107+
return new URL(
108+
"../../../../plugins/plugin-local-inference/src/services/index.ts",
109+
import.meta.url,
110+
).href;
112111
}
113112

114113
/**

0 commit comments

Comments
 (0)