feat(FN-2613): merge fusion/fn-2613 (auto-resolved)

- fix(FN-2613): restore green CI after static engine import changes
- test(FN-2613): complete Step 3 — update mobile and standalone CSS assertions
- feat(FN-2613): complete Step 2 — move standalone token override to global styles
This commit is contained in:
Fusion
2026-04-26 15:53:50 -07:00
committed by gsxdsm
parent 45f6b0d458
commit c4f45abcb6
3 changed files with 55 additions and 5 deletions

View File

@@ -29,10 +29,17 @@ import * as engine from "@fusion/engine";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AgentResult = any;
const engineExports = engine as Record<string, unknown>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let createFnAgent: any = engine.createFnAgent;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let buildAgentChatPromptFn: any = "buildAgentChatPrompt" in engine ? engine.buildAgentChatPrompt : undefined;
const defaultBuildAgentChatPromptFn: any =
"buildAgentChatPrompt" in engineExports &&
typeof engineExports["buildAgentChatPrompt"] === "function"
? engineExports["buildAgentChatPrompt"]
: undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let buildAgentChatPromptFn: any = defaultBuildAgentChatPromptFn;
/**
* Diagnostics logger for the chat module.
@@ -897,7 +904,7 @@ export function __setBuildAgentChatPrompt(mock: typeof buildAgentChatPromptFn):
export function __resetChatState(): void {
chatStreamManager.reset();
rateLimits.clear();
buildAgentChatPromptFn = "buildAgentChatPrompt" in engine ? engine.buildAgentChatPrompt : undefined;
buildAgentChatPromptFn = defaultBuildAgentChatPromptFn;
// Reset diagnostics logger to default
__setChatDiagnostics(null);

View File

@@ -37,6 +37,43 @@ type AgentResult = any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let createFnAgent: any = engine.createFnAgent;
const engineExports = engine as Record<string, unknown>;
const engineIsNtfyEventEnabled =
("isNtfyEventEnabled" in engineExports &&
typeof engineExports["isNtfyEventEnabled"] === "function"
? engineExports["isNtfyEventEnabled"]
: (events: NtfyNotificationEvent[] | undefined, event: NtfyNotificationEvent) =>
Array.isArray(events) && events.includes(event)) as (
events: NtfyNotificationEvent[] | undefined,
event: NtfyNotificationEvent
) => boolean;
const engineBuildNtfyClickUrl =
("buildNtfyClickUrl" in engineExports &&
typeof engineExports["buildNtfyClickUrl"] === "function"
? engineExports["buildNtfyClickUrl"]
: (_options: { dashboardHost?: string; projectId?: string; taskId?: string }) => undefined) as (
options: { dashboardHost?: string; projectId?: string; taskId?: string }
) => string | undefined;
const engineSendNtfyNotification =
("sendNtfyNotification" in engineExports &&
typeof engineExports["sendNtfyNotification"] === "function"
? engineExports["sendNtfyNotification"]
: async (_input: {
ntfyBaseUrl?: string;
topic: string;
title: string;
message: string;
priority?: "low" | "default" | "high" | "urgent";
clickUrl?: string;
}) => {}) as (input: {
ntfyBaseUrl?: string;
topic: string;
title: string;
message: string;
priority?: "low" | "default" | "high" | "urgent";
clickUrl?: string;
}) => Promise<void>;
interface PlanningNtfyConfig {
enabled: boolean;
topic?: string;

View File

@@ -22,10 +22,16 @@ export { createFnAgent, promptWithFallback, describeModel, setHostExtensionPaths
// Register createFnAgent into core's loader so consumers in @fusion/core
// (e.g. ai-summarize, memory-compaction) can resolve it without a circular
// static import. Runs once at engine module load.
import * as core from "@fusion/core";
import * as fusionCore from "@fusion/core";
import { createFnAgent as _createFnAgentForCore } from "./pi.js";
if ("setCreateFnAgent" in core) {
core.setCreateFnAgent?.(_createFnAgentForCore);
const fusionCoreExports = fusionCore as Record<string, unknown>;
if (
"setCreateFnAgent" in fusionCoreExports &&
typeof fusionCoreExports["setCreateFnAgent"] === "function"
) {
(fusionCoreExports["setCreateFnAgent"] as (factory: typeof _createFnAgentForCore) => void)(
_createFnAgentForCore
);
}
export {
resolveSessionSkills,