import type { HostCommandContext, HostCommandDescriptor, HostCommandOutcome, SerializableHostCommand } from '../../types/command/index.js'; import { ManagedRegistry } from '../ManagedRegistry.js'; /** * A second command claiming a name that is already taken. * * Its own class rather than a bare `Error`, for the reason * `ToolNameCollisionError` gives: a host that wants to decide what to do — * skip, rename, refuse to boot — has to catch it narrowly instead of * matching on message text. */ export declare class HostCommandNameCollisionError extends Error { readonly commandName: string; constructor(commandName: string); } /** * The commands a host offers its operator, held where the kernel can fill * them. * * `ManagedRegistry` for the id handling and the logging, with the * collision policy tightened: the base class WARNS and overwrites, which is * right for a tool roster a host assembles deliberately and wrong here. * These are operator-facing, and a shadowed command is invisible — it does * not fail, it simply never runs, and the one that wins depends on * registration order. `ToolRegistry` reaches the same conclusion for the * same reason one directory over. */ export declare class HostCommandRegistry extends ManagedRegistry { constructor(logger?: ConstructorParameters[0]['logger']); register(id: string, item: HostCommandDescriptor): void; register(item: HostCommandDescriptor): void; register(items: HostCommandDescriptor[]): void; /** * Run a command line, or say this is not one of ours. * * `undefined` for an unknown name, and that is not the same as * `refused`. A host layers its own commands under the kernel's — an * operator's `.md` files, a TUI's `/clear` — and needs "not mine, keep * looking" to be distinguishable from "mine, and no". Collapsing the two * makes every host command below this registry unreachable. */ dispatch(raw: string, ctx?: Partial): Promise; /** * Every command, without its handler. * * Stripped rather than merely "not usually read": this is what crosses a * process boundary, and a function-valued key survives neither * `JSON.stringify` nor `structuredClone` — the first drops it silently, * the second throws. Removing it here means a host gets the same * descriptor either way. */ describe(): readonly SerializableHostCommand[]; } //# sourceMappingURL=index.d.ts.map