mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(llm-task): load runEmbeddedPiAgent from dist/extensionAPI in installs
This commit is contained in:
@@ -25,11 +25,14 @@ async function loadRunEmbeddedPiAgent(): Promise<RunEmbeddedPiAgentFn> {
|
||||
}
|
||||
|
||||
// Bundled install (built)
|
||||
const mod = await import("../../../src/agents/pi-embedded-runner.js");
|
||||
if (typeof mod.runEmbeddedPiAgent !== "function") {
|
||||
// NOTE: there is no src/ tree in a packaged install. Prefer a stable internal entrypoint.
|
||||
const mod = await import("../../../dist/extensionAPI.js");
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const fn = (mod as any).runEmbeddedPiAgent;
|
||||
if (typeof fn !== "function") {
|
||||
throw new Error("Internal error: runEmbeddedPiAgent not available");
|
||||
}
|
||||
return mod.runEmbeddedPiAgent as RunEmbeddedPiAgentFn;
|
||||
return fn as RunEmbeddedPiAgentFn;
|
||||
}
|
||||
|
||||
function stripCodeFences(s: string): string {
|
||||
|
||||
Reference in New Issue
Block a user