import type { RpcClient } from "../rpc/rpc-client.ts"; import type { RpcSlashCommand } from "../rpc/rpc-types.ts"; export type RemoteCommandsListener = (commands: readonly RpcSlashCommand[]) => void; /** * Tracks the engine child's slash-command catalog (extension commands, prompt * templates, and skills) for the isolated interactive host. * * When {@link isolateInteractiveHost} is on, `main.ts` loads no extensions in * the host session, so `session.extensionRunner.getRegisteredCommands()` is * empty and interactive autocomplete would omit every extension command * (`/workflow`, `/workflows`, `/mcp`, …). The commands still live in the * engine child, which answers the `get_commands` RPC. This catalog fetches that * list asynchronously so it never blocks first paint or input, caches the last * good result, and notifies listeners so autocomplete can rebuild. * * A generation guard ensures a slow in-flight fetch cannot clobber the catalog * after a newer refresh (e.g. an engine restart) has already superseded it. */ export declare class RemoteCommandCatalog { private commands; private readonly listeners; private generation; private readonly client; constructor(client: RpcClient); getCommands(): readonly RpcSlashCommand[]; onChange(listener: RemoteCommandsListener): () => void; /** * Kick off a best-effort catalog fetch. Fire-and-forget by design: the caller * (engine bind, restart, reload, new/resume/fork) must not await it. */ refresh(): void; } //# sourceMappingURL=remote-command-catalog.d.ts.map