import type { ToolDef } from "../types.js"; import { type ManifestInjectAction } from "./manifest.js"; /** * Per-category injection plan derived from one plugin's `inject:` block. * The keys are PREFIXED action names (e.g. `vpp_scatter_on_terrain`), which * is what they look like on the wire and in tool docs. */ export interface InjectionPlan { /** Category name (e.g. `pcg`). */ category: string; /** Plugin's actionPrefix (e.g. `vpp`). */ prefix: string; /** Plugin name for diagnostics. */ pluginName: string; /** Bare action name → manifest spec. */ actions: Record; } /** * Merge plugin-supplied injection plans into a built-in category tool. Returns * a NEW ToolDef with extended actions, rebuilt action enum, merged param * schema, and a "Plugin actions:" block appended to the description. * * Collisions with built-in actions are skipped with a warning and never * overwrite. Inter-plugin collisions are first-wins per the loader's left-to- * right iteration; this function simply skips any action key already present. */ export interface MergeResult { tool: ToolDef; /** Final prefixed action names that were actually added, in insertion order. */ added: string[]; /** Collisions that were rejected: key + reason. */ skipped: Array<{ action: string; reason: string; }>; } export declare function mergeInjectionsIntoTool(orig: ToolDef, plans: InjectionPlan[]): MergeResult;