import type { ToolDef } from "./types.js"; import type { EditorSession } from "./session.js"; import type { PluginRecord } from "./plugin/loader.js"; /** One editor's fully-built surface. */ export interface SessionSurface { session: EditorSession; /** This session's own graph: cloned, plugin-injected, Epic-enriched. */ tools: ToolDef[]; /** Categories this session's `ue-mcp.yml` disabled. */ disabled: Set; /** Plugin load records, for `plugins(list)` and `get_status`. */ pluginRecords: PluginRecord[]; /** Per-category markdown this session's plugins contribute. */ knowledgeByCategory: Record; } /** Which sessions provide one action, and which of them disabled its category. */ export interface ActionProviders { /** Session names whose graph declares the action. */ providers: string[]; /** Session names that declare it but disabled the category in config. */ disabledIn: string[]; } export interface UnionSurface { /** One ToolDef per category name, carrying the union of every action. */ tools: ToolDef[]; /** `category.action` to the sessions that provide it. */ providers: Map; } /** A fresh, unenriched graph for one session to build on. */ export declare function baseGraphFor(pristine: ToolDef[]): ToolDef[]; /** * Merge every session's graph into the one surface the client sees. * * The first session that declares a category owns its description and schema, * which keeps a single-editor server byte-identical to what it advertised * before sessions existed. Actions only later sessions have are added to that * category, so a toolset present in one project is still addressable there. * * A category a session disabled stays in the union rather than disappearing: * hiding it would take a working tool away from the OTHER editors, which is * not what that user's `disable:` asked for. The refusal happens at dispatch, * for that session only, naming the config. */ export declare function unionSurface(surfaces: SessionSurface[]): UnionSurface; /** * Why a dispatch to one session failed when the action exists elsewhere. * Returns null when the session can serve it. */ export declare function explainMissingAction(union: UnionSurface, taskName: string, sessionName: string, sessionHasTask: boolean): string | null; /** Union of every session's plugin knowledge, first contributor wins per blob. */ export declare function unionKnowledge(surfaces: SessionSurface[]): Record;