Commit Graph

15 Commits

Author SHA1 Message Date
can1357 d24d11a274 fix: resolved AI/OAuth helper duplication via shared modules
- Standardized missing-file read errors and now return `File not found: <path>` for absent edit targets.
- Centralized AI provider, usage, and OAuth helpers into shared modules to remove duplicated logic.
- Migrated OAuth/API-key login flows to shared factory helpers and removed inline prompt/token-exchange code.
- Reused shared tools and formatter utilities for discovery, stream tails, LSP batching, and source formatting.
- Consolidated repeated test helpers and fixtures into shared modules, replacing inline helper duplicates.
2026-04-23 21:02:14 +02:00
can1357 33f4610917 fix(coding-agent): improved vim tool guidance and step execution behavior
- Updated vim tool prompts to keep file paths separate from commands and to stress bottom-up multi-location edits.
- Added automatic reordering of simple `NGo`/`NGO` insertion steps to execute from highest to lowest line.
- Added command-path validation and Vim parser fixes for counted `i` inserts and clearer `;`/`,` error guidance.
2026-04-14 07:16:27 +02:00
can1357 742cc5c163 feat(vim): added Vim ex :join and :join! support for line joining
- Implemented parsing of `:j`/`:join` and `:j!`/`:join!` ex commands and mapped them to a new `join` command shape with a whitespace-trim flag.
- Added VimEngine handling for `join` to concatenate addressed lines (or the current plus next line by default), optionally normalizing whitespace and reporting line count in the status message.
- Updated vim prompt guidance, changelog notes, and tests to document and verify both normal and `:join!` join behavior.
2026-04-13 23:06:24 +02:00
can1357 755ada38a2 feat(coding-agent/vim): added ex append and insert command support
- Parser now recognizes ex-style :append and :insert commands and extracts text arguments.
- The Vim engine now executes parsed :append and :insert command cases by inserting lines at resolved ranges.
- Prompt docs were updated to clarify line-opening behavior and required ex-command syntax.
2026-04-13 22:53:51 +02:00
can1357 9f9433c5ca feat(coding-agent): added contextual vim ex parsing for .,$,+,- addresses
- Added contextual Vim ex parsing for `.,$`, `+/-` addresses, copy/move destinations, and `del/ya` aliases.
- Added Vim engine handling for clamped ranges, no-op `update`, and register-aware `yank`/`put` command execution.
- Added regression tests for explicit ranges, yank/put, inline-cursor rendering, and `message_update` ordering.
- Updated session event flow by queuing `message_update` events, changed websocket default to `off`, and documented Unreleased notes.
2026-04-13 22:52:26 +02:00
can1357 8bd7310cb4 feat(coding-agent): implemented vim tool-call preview mapping per command
- Added vim tool-call IDs across EventController, UiHelpers, and ToolExecution for per-call preview mapping.
- Extended Vim type and command parsing with update/write, edit, global, yank, and put handling.
- Added Vim engine support for new commands and motions, including gJ, g*, g#, g_, |, and gu/gU/g~.
- Reworked Vim tool flow to cache per-file engine clones, reuse tool details, and stream inserts in chunks.
- Updated vim.md and changelog to document new vim keys, ex aliases, and fixed :global preview behavior.
- Added parser and renderer tests plus a tmp/vim_test.txt fixture for chunked, cursor, and partial-insert cases.
2026-04-13 21:57:33 +02:00
can1357 786d752e48 feat(vim): added VimEngine text-object and insert/visual/normal commands
- Added `C-u` and `C-o` insert-mode commands in `VimEngine.#executeInsert` for line clear and one-shot normal actions.
- Added visual insert operators `J`, `u`, `U`, `p`, and `P` to join or case-transform a selection and replace it with register content.
- Added normal-mode `+`, `-`, `_`, `*`, and `#` commands in `VimEngine` for line-motion and whole-word search navigation.
- Added paragraph text object `p` in `#resolveParagraphTextObject` to support `ip`/`ap` paragraph selections.
- Added `gv`, `gJ`, `ZZ`, and `ZQ` handling in `VimEngine` for reselection, range join, and save/quit shortcuts.
- Changed vim tab breadcrumb rendering in `render.ts` from ` -> ` to `->`.
2026-04-13 21:34:33 +02:00
can1357 014a8b8be9 feat(coding-agent/vim): added Vim ex and motion features for copy, move, and sort
- Added support for :copy, :move, and :sort ex commands with range selection and destination/flag handling.
- Stored last character-find state to enable ; and , repeat motions for f/F/t/T searches.
- Implemented Yank, R-mode, and gg/gU/gu command handling in normal-mode execution paths.
2026-04-13 21:27:47 +02:00
can1357 10ba6bff89 fix(coding-agent): fixed vim command parsing and chunk edit fallback behavior
- Changed chunk edit normalization to prefer write operations, then replace, insert, then delete, with empty write values now treated as clear-content writes.
- Allowed space motions in vim input as `<Space>`, handled them as movement and rendered in error output via token display.
- Adjusted benchmark retry flow to reset files on each retry, reduced per-run call limits, and lowered the default per-turn timeout.
2026-04-13 21:14:35 +02:00
can1357 6224c18239 fix(coding-agent): added warnings for conflicting chunk-edit operations
- Normalized chunk edit parsing now detected and warned on entries with multiple write/replace/insert operations, selected one operation by precedence, and ignored the rest.
- Execution now appended those normalization warnings and included them when a chunk edit produced no content changes.
- Updated chunk-edit and vim tool guidance plus vim rendering to document stricter edit usage and expose the current cursor position in output.
2026-04-13 20:29:05 +02:00
can1357 550efebbcc fix(vim): prevented partial-insert corruption in vim tool execution
- Added rollback handling for pending INSERT-mode changes whenever a non-final kbd sequence leaves insert mode, and updated the resulting VimInputError with guidance for using `insert` and escaping insert transitions.
- Hardened VimTool execution by resetting stale insert state before processing commands and by only applying empty inserts when Vim remains in INSERT mode.
- Adjusted Vim search handling to mimic Vim magic escaping and taught `o`/`O` numeric prefixes to act like `Go`/`GO` line inserts, then updated the expected error message test.
2026-04-13 20:23:43 +02:00
can1357 b3537b0e3d docs(coding-agent/prompts): updated Vim tool prompt docs with strict kbd and insert guidance
- Clarified the Vim tool prompt to require `file` and clearly separate key commands from insert text.
- Added updated usage examples and best-practice guidance for whole-file replacement, line edits, search/replace, and undo.
- Documented key/mode constraints, including insert-entry requirements and required `<Esc>` handling between non-final commands.
2026-04-13 17:02:58 +02:00
can1357 fb59c45439 feat(vim): added escape/CR literal parsing and count-aware G/gg motions
- Fixed `G`/`gg` motions to distinguish "no count" (go to last/first line) from explicit count.
- Added parsing for literal `\x1b`/`\r` bytes and backslash escape sequences (`\r`, `\e`, `\n`, `\t`).
- Updated `#readCount` to return `hasCount` flag propagated through operator and motion resolution.
- Synced vim buffer fingerprint from disk on reuse to handle LSP writethrough reformats.
2026-04-13 17:01:26 +02:00
can1357 779cf2eb4a feat(coding-agent-vim-tooling): added vim tooling special-key aliases
- Added `<escape>` and `<return>` as special-key aliases in `parser.ts`, mapping to `Esc` and `CR`.
- Clarified Vim tool behavior so `open` replaces the active buffer and non-paused `kbd` calls auto-save.
- Updated the Vim prompt contract to treat `insert` as raw text entered only after entering INSERT mode.
- Increased `scripts/vim-edit-benchmark.py` `request_timeout` from 60s to 120s for longer edit runs.
2026-04-13 13:04:07 +02:00
can1357 dd023eb4de feat(coding-agent-vim-tool): added vim editing tool stack with parser, engine, and renderer wiring
- Added `VimTool` in `src/tools/vim.ts` with `open`, `kbd`, `insert`, and `pause` actions.
- Implemented `src/vim/{buffer,engine,parser,commands,render,types}.ts` for interactive Vim modes and operators.
- Updated `src/tools/index.ts` to normalize `edit`/`vim` tool selection and skip the inactive edit variant.
- Added `vim` registration in `BUILTIN_TOOLS` and `toolRenderers` for discoverability and output formatting.
- Added streaming renderer snapshots with viewport, caret focus, and diff output for `vim` calls.
- Added `test/tools/vim.test.ts` and `scripts/vim-edit-benchmark.py` coverage for the new editor stack.
2026-04-13 12:26:59 +02:00