refactor(cli): extract vim prompt logic into kilocode mirror

Move the vim modal editing engine and prompt integration out of shared
upstream files and into src/kilocode/ mirrors per the Fork Isolation Rule:

- src/kilocode/cli/cmd/tui/component/prompt/vim.ts (engine, moved)
- src/kilocode/cli/cmd/tui/component/prompt/index.tsx (new mirror with
  useVim, VimModeIndicator, vimToggleCommand)
- test/kilocode/cli/cmd/tui/prompt/vim.test.ts (moved)

The shared prompt/index.tsx now calls into the mirror behind minimal
kilocode_change markers instead of inlining ~200 lines of vim logic.
This commit is contained in:
Catriel Müller
2026-07-03 17:54:37 -03:00
parent a5df31034d
commit 2be834fbfc
6 changed files with 268 additions and 173 deletions
@@ -9,7 +9,7 @@ import {
clampNormal,
type VimDoc,
type VimKey,
} from "@tui/component/prompt/vim"
} from "@/kilocode/cli/cmd/tui/component/prompt/vim"
/** In-memory document implementing the engine's VimDoc contract. */
class MockDoc implements VimDoc {