feat(FN-2615): merge fusion/fn-2615 (auto-resolved)
- fix(FN-2615): restore workspace lint and test stability
This commit is contained in:
@@ -25,14 +25,14 @@ import { EventEmitter } from "node:events";
|
||||
import { join, resolve, relative } from "node:path";
|
||||
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
|
||||
type AgentResult = any;
|
||||
// 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;
|
||||
let buildAgentChatPromptFn: any = "buildAgentChatPrompt" in engine ? engine.buildAgentChatPrompt : undefined;
|
||||
|
||||
/**
|
||||
* Diagnostics logger for the chat module.
|
||||
@@ -897,7 +897,7 @@ export function __setBuildAgentChatPrompt(mock: typeof buildAgentChatPromptFn):
|
||||
export function __resetChatState(): void {
|
||||
chatStreamManager.reset();
|
||||
rateLimits.clear();
|
||||
buildAgentChatPromptFn = undefined;
|
||||
buildAgentChatPromptFn = "buildAgentChatPrompt" in engine ? engine.buildAgentChatPrompt : undefined;
|
||||
|
||||
// Reset diagnostics logger to default
|
||||
__setChatDiagnostics(null);
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
resetDiagnosticsSink,
|
||||
nonfatal,
|
||||
} 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
|
||||
type AgentResult = any;
|
||||
@@ -58,7 +58,29 @@ interface PlanningNtfyHelpers {
|
||||
}) => Promise<void>;
|
||||
}
|
||||
|
||||
let planningNtfyHelpers: PlanningNtfyHelpers | undefined;
|
||||
function buildDefaultPlanningNtfyHelpers(): PlanningNtfyHelpers {
|
||||
const isNtfyEventEnabled =
|
||||
"isNtfyEventEnabled" in engine
|
||||
? engine.isNtfyEventEnabled
|
||||
: (events: NtfyNotificationEvent[] | undefined, event: NtfyNotificationEvent) =>
|
||||
Array.isArray(events) ? events.includes(event) : false;
|
||||
|
||||
const buildNtfyClickUrl = "buildNtfyClickUrl" in engine
|
||||
? engine.buildNtfyClickUrl
|
||||
: () => undefined;
|
||||
|
||||
const sendNtfyNotification = "sendNtfyNotification" in engine
|
||||
? engine.sendNtfyNotification
|
||||
: async () => {};
|
||||
|
||||
return {
|
||||
isNtfyEventEnabled,
|
||||
buildNtfyClickUrl,
|
||||
sendNtfyNotification,
|
||||
};
|
||||
}
|
||||
|
||||
let planningNtfyHelpers: PlanningNtfyHelpers | undefined = buildDefaultPlanningNtfyHelpers();
|
||||
|
||||
/**
|
||||
* Shared diagnostics helper for the planning module.
|
||||
@@ -1709,7 +1731,7 @@ export function __resetPlanningState(): void {
|
||||
_aiSessionDeletedListener = undefined;
|
||||
_aiSessionStore = undefined;
|
||||
|
||||
planningNtfyHelpers = undefined;
|
||||
planningNtfyHelpers = buildDefaultPlanningNtfyHelpers();
|
||||
|
||||
// Reset diagnostics sink to default
|
||||
resetDiagnosticsSink();
|
||||
|
||||
Reference in New Issue
Block a user