fix(dashboard): restore engine namespace import in chat/planning
The auto-resolved FN-2614 merge swapped `import * as engine` for a narrow named import but left dangling `engine.X` references, breaking the dashboard build. Restore the namespace import and drop the now-orphaned engineExports/ntfy helper consts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,11 +25,10 @@ import { EventEmitter } from "node:events";
|
|||||||
import { join, resolve, relative } from "node:path";
|
import { join, resolve, relative } from "node:path";
|
||||||
import { SessionEventBuffer } from "./sse-buffer.js";
|
import { SessionEventBuffer } from "./sse-buffer.js";
|
||||||
|
|
||||||
import { createFnAgent as engineCreateFnAgent } from "@fusion/engine";
|
import * as engine from "@fusion/engine";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
type AgentResult = any;
|
type AgentResult = any;
|
||||||
const engineExports = engine as Record<string, unknown>;
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
let createFnAgent: any = engine.createFnAgent;
|
let createFnAgent: any = engine.createFnAgent;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|||||||
@@ -30,50 +30,13 @@ import {
|
|||||||
resetDiagnosticsSink,
|
resetDiagnosticsSink,
|
||||||
nonfatal,
|
nonfatal,
|
||||||
} from "./ai-session-diagnostics.js";
|
} from "./ai-session-diagnostics.js";
|
||||||
import { createFnAgent as engineCreateFnAgent } from "@fusion/engine";
|
import * as engine from "@fusion/engine";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
type AgentResult = any;
|
type AgentResult = any;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
let createFnAgent: any = engine.createFnAgent;
|
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 {
|
interface PlanningNtfyConfig {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
topic?: string;
|
topic?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user