import { type CliProgram } from '@opensip-cli/contracts'; import { type Tool, type ToolCliContext, type ToolProvenance, type ToolRegistry } from '@opensip-cli/core'; import { type RunActionHooks } from './run-plane.js'; import type { CommandActionScopeRunner } from './command-action-scope-runner.js'; /** * Walk the registry and mount each tool's commands onto `program`. This is * **step 8** of the tool lifecycle (launch, §5.4) — see * {@link runToolLifecycle}. * * Public launch: there is ONE command surface — the tool's declared `commandSpecs`, * mounted by `mountCommandSpec`. `register()` and the raw-Commander `program` * handle on the tool context are gone, so the host owns `program` and passes it * in here (the tool never touches Commander). A tool with no `commandSpecs` is a * mis-declaration: it contributes no commands, surfaced loudly via * `cli.tool.no_command_surface`. * * Mount failures are **bundled fail-closed, external best-effort** (R16). A * bundled tool whose spec fails to mount throws `PluginIncompatibleError` so the * composition root aborts startup (exit 5). External provenance (installed / * project-local / user-global) keeps the warn-and-continue posture. * * @param registry The per-invocation tool registry to walk. * @param program The root Commander program (host-owned; the composition root * passes it — it is no longer reachable through the tool context, §8). * @param ctx The per-invocation handler context (render/emit/scope — no program). * @param provenance Admitted-tool provenance from bootstrap (required — no default). * @throws {PluginIncompatibleError} When a bundled tool's command surface fails to mount. */ export declare function mountAllToolCommands(registry: ToolRegistry, program: CliProgram, ctx: ToolCliContext, provenance: readonly ToolProvenance[], runActionHooks: RunActionHooks, actionScopeRunner?: CommandActionScopeRunner): void; /** * Mount ONE tool's commands from its declared `commandSpecs` — the only command * surface (public launch). Extracted so {@link mountAllToolCommands} keeps its * per-tool failure isolation around a single call. A tool with no `commandSpecs` * contributes nothing and is surfaced via `cli.tool.no_command_surface`. * * Nesting (`CommandSpec.parent`, tool-command-surface-taxonomy Task 0.4): a spec * declaring `parent` is mounted as a SUBCOMMAND of the same-tool spec whose name * matches `parent` (the tool's primary verb) — enabling the ` ` * grammar (`graph export`, `fit list`). This is the SAME generic parent+leaf * pattern the host already uses for `sessions`/`plugin`/`tools` * (`host-command-specs.ts:mountHostCommands`): the parent's mounted Commander * command (which also carries its own action) hosts the child via * `mountCommandSpec(primaryCmd, child, ctx)`. No per-tool special case. Specs * with no `parent` mount flat onto the root program exactly as before. */ export declare function mountOneTool(program: CliProgram, tool: Tool, ctx: ToolCliContext, runActionHooks: RunActionHooks, actionScopeRunner?: CommandActionScopeRunner): void; //# sourceMappingURL=register-tools-mount.d.ts.map