feat(FN-3155): add createAiSession plugin context API with DI wiring

This merge brings FN-3155's plugin `createAiSession` API (types, DI hooks, engine adapter, context wiring, docs, and tests), FN-3056's task title sanitization, and FN-3129's tokenized footer and mobile initialization for MissionManager. It also adds CentralCore Docker node management, a new AddNodeM

Fusion-Task-Id: FN-3155
This commit is contained in:
Fusion
2026-05-02 13:20:12 -07:00
committed by gsxdsm
parent 2769e4a57b
commit 5ebccc43cc
17 changed files with 540 additions and 122 deletions

View File

@@ -10,12 +10,15 @@
* returns `undefined` and callers degrade gracefully.
*/
import type { CreateAiSessionFactory } from "./plugin-types.js";
// Engine exports a function type we intentionally don't pull in here — importing
// the type would reintroduce the cycle this module is designed to avoid.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type CreateFnAgent = any;
let createFnAgent: CreateFnAgent | undefined;
let createAiSessionFactory: CreateAiSessionFactory | undefined;
/** Shape of a message in an agent session's state. */
export interface AgentMessage {
@@ -38,3 +41,19 @@ export function setCreateFnAgent(fn: CreateFnAgent | undefined): void {
export async function getFnAgent(): Promise<CreateFnAgent> {
return createFnAgent;
}
/**
* Wire engine's plugin-facing AI session factory into core.
* Called by `@fusion/engine` at module load; tests may register stubs.
*/
export function setCreateAiSessionFactory(fn: CreateAiSessionFactory | undefined): void {
createAiSessionFactory = fn;
}
/**
* Returns engine-registered plugin AI session factory, or `undefined` when
* engine hasn't registered it (common in isolated core tests).
*/
export async function getCreateAiSessionFactory(): Promise<CreateAiSessionFactory | undefined> {
return createAiSessionFactory;
}