{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CA2BrE,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAE1D,CAAC;AAEF,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMpE","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\targumentHint?: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\", argumentHint: \"<provider/model>\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{\n\t\tname: \"export\",\n\t\tdescription: \"Export session (HTML default, or specify path: .html/.jsonl)\",\n\t\targumentHint: \"[path]\",\n\t},\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\", argumentHint: \"<file.jsonl>\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\", argumentHint: \"<name>\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\", argumentHint: \"[instructions]\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, themes, and context files\" },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n\n/**\n * Built-in interactive commands that take NO arguments. `/new please` used to\n * fall through the exact-match ladder and get sent to the model as prose —\n * silent and surprising. matchBareBuiltinWithArgs detects that shape so the\n * TUI can surface a usage warning instead.\n *\n * DERIVED from BUILTIN_SLASH_COMMANDS rather than hand-maintained: a builtin\n * takes arguments exactly when it declares an `argumentHint` (/model, /login,\n * /export, /import, /name, /compact). A hand-written list silently rotted the\n * first time upstream gave an existing command an argument — `/login <provider>`\n * gained one in 0.84 and the stale list turned it into a usage warning.\n *\n * `/debug` is absent by construction: it is not a builtin at all, so an\n * extension (the debug orchestrator) legitimately owns \"/debug <text>\".\n */\nexport const BARE_BUILTIN_COMMAND_NAMES: ReadonlySet<string> = new Set(\n\tBUILTIN_SLASH_COMMANDS.filter((command) => command.argumentHint === undefined).map((command) => command.name),\n);\n\n/** Return the command name when `text` is `/bare-builtin <extra args>`, else null. */\nexport function matchBareBuiltinWithArgs(text: string): string | null {\n\tif (!text.startsWith(\"/\")) return null;\n\tconst spaceIdx = text.indexOf(\" \");\n\tif (spaceIdx === -1) return null;\n\tconst name = text.slice(1, spaceIdx);\n\treturn BARE_BUILTIN_COMMAND_NAMES.has(name) ? name : null;\n}\n"]}