{"version":3,"file":"git-command.d.ts","sourceRoot":"","sources":["../../src/core/git-command.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,cAAc,CA6B3D,CAAC;AAkBF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ3D","sourcesContent":["export interface GitCommandMode {\n\tname: string;\n\taliases: string[];\n\tdescription: string;\n\tinstructions: string;\n}\n\nexport const GIT_COMMAND_MODES: ReadonlyArray<GitCommandMode> = [\n\t{\n\t\tname: \"worktree\",\n\t\taliases: [\"wt\", \"work-tree\", \"work tree\"],\n\t\tdescription: \"Create, list, switch, or clean up git worktrees\",\n\t\tinstructions:\n\t\t\t\"Focus on git worktrees. Start with `git worktree list` and `git status --short --branch`. Help create, switch to, or clean up worktrees only after confirming the target branch/path.\",\n\t},\n\t{\n\t\tname: \"checkpoint\",\n\t\taliases: [\"cp\", \"checkpoints\", \"save\"],\n\t\tdescription: \"Save or restore small checkpoint commits\",\n\t\tinstructions:\n\t\t\t\"Focus on checkpoints. If saving, inspect the diff, summarize changes, propose a small checkpoint commit message, then wait for confirmation before staging or committing. If restoring, follow the restore flow. Do not push unless asked.\",\n\t},\n\t{\n\t\tname: \"restore\",\n\t\taliases: [\"recover\", \"rollback\"],\n\t\tdescription: \"Restore files from a checkpoint or commit safely\",\n\t\tinstructions:\n\t\t\t\"Focus on safe restore. Start with `git status --short --branch` and identify the checkpoint/ref. If there are local changes, ask the user to choose: stash them first (recommended) or discard them. Do not restore, stash, discard, reset, or checkout until the user explicitly confirms.\",\n\t},\n\t{\n\t\tname: \"push\",\n\t\taliases: [\"commit\", \"publish\", \"sync\"],\n\t\tdescription: \"Commit, push, pull, and related remote actions\",\n\t\tinstructions:\n\t\t\t\"Focus on commit/push workflow. Inspect status, branch, remotes, and recent commits. Propose the minimal commit/push steps, then wait for confirmation before committing, pulling, or pushing.\",\n\t},\n];\n\nfunction parseGitMode(input: string): { mode?: GitCommandMode; rest: string } {\n\tconst trimmed = input.trim();\n\tif (!trimmed) return { rest: \"\" };\n\n\tconst lower = trimmed.toLowerCase();\n\tfor (const mode of GIT_COMMAND_MODES) {\n\t\tconst names = [mode.name, ...mode.aliases].map((name) => name.toLowerCase());\n\t\tconst match = names.find((name) => lower === name || lower.startsWith(`${name} `));\n\t\tif (match) {\n\t\t\treturn { mode, rest: trimmed.slice(match.length).trim() };\n\t\t}\n\t}\n\n\treturn { rest: trimmed };\n}\n\nexport function buildGitCommandPrompt(input: string): string {\n\tconst { mode, rest } = parseGitMode(input);\n\tconst requested = rest ? `\\nUser request: ${rest}` : \"\";\n\tconst modeLine = mode\n\t\t? mode.instructions\n\t\t: \"Start by running `git status --short --branch`. Then help the user choose between worktrees, checkpoints, restore, or commit/push actions.\";\n\n\treturn `Git helper for this repository.\\n${modeLine}\\nSafety: do not discard changes, delete branches/worktrees, reset, force-push, or push anything until the user explicitly confirms.${requested}`;\n}\n"]}