import type { EffectiveExtensionRoots } from "../capability/types.js"; export type SlashCommandSource = "extension" | "prompt" | "skill"; export type SlashCommandLocation = "user" | "project" | "path"; export interface SlashCommandInfo { name: string; description?: string; source: SlashCommandSource; location?: SlashCommandLocation; path?: string; } export type { BuiltinSlashCommand, SubcommandDef } from "../slash-commands/types.js"; /** * Represents a custom slash command loaded from a file */ export interface FileSlashCommand { name: string; description: string; /** Argument hint from `argument-hint`/`argumentHint` frontmatter, shown as inline ghost text. */ argumentHint?: string; content: string; /** * `side: true` frontmatter: the interactive TUI answers the expanded command as a `/btw` * side question (off the transcript, runnable mid-turn). Other modes expand it as a prompt. */ side?: boolean; source: string; /** Source metadata for display */ _source?: { providerName: string; level: "user" | "project" | "native"; }; } export interface LoadSlashCommandsOptions { /** Working directory for project-local commands. Default: getProjectDir() */ cwd?: string; /** Session-local extension roots for post-startup reloads (explicit + mode + configured). */ extensionRoots?: EffectiveExtensionRoots; } /** * Load all custom slash commands using the capability API. * Loads from all registered providers (builtin, user, project). */ export declare function loadSlashCommands(options?: LoadSlashCommandsOptions): Promise; /** * Split a `/name args` invocation into the file-command name (the whole first token, * so namespaced `/plugin:cmd` stays intact) and its raw argument string. */ export declare function parseFileSlashInvocation(text: string): { name: string; args: string; } | undefined; /** Render a file command's template with `argsString`. Throws on a malformed template. */ export declare function renderFileSlashCommand(command: FileSlashCommand, argsString: string): string; /** * Expand a slash command if it matches a file-based command. * Returns the expanded content or the original text if not a slash command. */ export declare function expandSlashCommand(text: string, fileCommands: readonly FileSlashCommand[]): string;