/** * Helper for {@link createTuiCommandHandler}: when the user types an unknown * slash command in the TUI, check whether the name matches a saved workflow * and, if so, rewrite the input into a natural-language prompt that * deterministically triggers the `workflow` tool. * * Why a rewrite and not a direct execution? * Slash commands in xopc are handled by the chat-commands framework whose * handlers return text shown back to the user — there is no hook to "inject * the result as the next user message and start an agent turn". So the * shortest reliable path is to turn `/audit_repo` into the same plain-text * request the model already knows how to handle. * * Why catalog the workflow list at the TUI layer? * The catalog reads `~/.xopc/workflows/` synchronously (single `readdir`), * so the slash dispatch stays sync and the user sees no latency. The lookup * only runs for inputs that started with `/` and didn't match any built-in * or extension command, so the cost is negligible. * * Built-in TUI command names that overlap with a workflow file name keep their * existing TUI behaviour — the slash dispatcher matches the built-in switch * cases before this helper is consulted. */ /** Reset the cache (for tests, or after a `/workflow save`). */ export declare function resetWorkflowSlashCache(): void; /** * Returns a rewritten user message when `name` matches a known workflow, * otherwise `null`. Args after the slash are passed along as a hint to the * model — most workflows expect free-form context, not strict JSON, and the * model can shape the call. */ export declare function rewriteUnknownSlashAsWorkflow(name: string, args: string, resolver?: () => Set): string | null;