feat(FN-5203): merge fusion/fn-5203

This commit is contained in:
gsxdsm
2026-05-20 02:48:39 -07:00
parent b1c0a91752
commit c89d68dd2d
11 changed files with 685 additions and 14 deletions

View File

@@ -9,10 +9,24 @@
import type { AgentRuntime, AgentRuntimeOptions, AgentSessionResult } from "./agent-runtime.js";
import type { PluginRunner } from "./plugin-runner.js";
import * as fusionCore from "@fusion/core";
import type { AgentSession } from "@mariozechner/pi-coding-agent";
import { createLogger } from "./logger.js";
import { createFnAgent, promptWithFallback, describeModel } from "./pi.js";
const MOCK_PROVIDER_ID = (() => {
try {
const value = Reflect.get(fusionCore as object, "MOCK_PROVIDER_ID");
return typeof value === "string" && value.trim().length > 0 ? value : "mock";
} catch {
return "mock";
}
})();
export function isMockProviderId(provider: string | undefined): boolean {
return provider?.trim().toLowerCase() === MOCK_PROVIDER_ID;
}
/** Logger for the runtime resolution subsystem */
const runtimeLog = createLogger("runtime-resolver");