feat(api): unify line targeting using string specs#5
Conversation
- Replace integer and array line ranges with unified string specifications - Implement RangeSpec and PositionSpec for flexible line targeting - Support hyphenated ranges, hashes, and negative indices for EOF offsets - Update view, batch_edit, and extract_lines to use string-based ranges - Transition view command to support single path strings - Simplify line range parsing logic via new utility functions - Update JSON schemas to improve LLM guidance for range formats - Align test cases with the new string-based specification format BREAKING CHANGE: line_range, from_range, append_line, and view parameters now require strings instead of integers or arrays
- Replace string-based line range specifications with typed start/end fields - Remove multi-file support from view tool in favor of parallel calls - Implement unified Endpoint enum to handle line numbers and hashes - Update JSON schemas for view, batch_edit, and extract_lines tools - Remove redundant multi-file view functions and range parsing logic - Fix potential usize underflow during file start referencing - Standardize endpoint resolution and line index clamping across tools - Update all filesystem tests to align with new parameter schemas BREAKING CHANGE: Line range strings are replaced by numeric start/end fields across all file operations, and the view tool now accepts a single path instead of an array.
Octomind — developer:brief (octohub:glm)📦 Brief: Unify all line-targeting parameters to compact string specs across view, batch_edit, and extract_linesOverall risk: 🔴 HIGH · Cards: 2
Card 1/2: Line-targeting params converted from arrays/integers to string specs · 🔴 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK DIVERGENCE
📎 Source
Card 2/2: `view` parameter renamed `paths` → `path` with backward-compat alias · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK 📎 Source
📂 Files changed (7 files, ~600 lines)
{tokens:411541,cost:0.4396548} |
- Align server.json with latest schema by removing deprecated fields - Replace repositories array with repository object - Update packages structure to include registry information - Remove redundant tools definitions and categories from manifest - Add line counts and estimated token costs to directory listings - Implement parallel processing for file statistics - Add binary file detection to skip metadata calculation - Update tool descriptions to reflect new listing format
a4f4a84 to
94a21f2
Compare
Octomind — developer:brief (octohub:glm)I have everything I need. Let me compose the brief. 📦 Brief: Line targeting API redesigned from string specs to typed scalar endpoints; multi-file view removed; directory listings now show line/token metadata; server.json migrated to MCP 2025-12 schemaOverall risk: 🟡 MEDIUM · Cards: 4
Card 1/4: Line targeting API replaced with typed scalar endpoints · 🔴 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK DIVERGENCE
📎 Source
Card 2/4: Multi-file view removed — single path only · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
Card 3/4: Directory listings now read every file to show line count + token estimate · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK QUESTIONS
📎 Source
Card 4/4: server.json migrated to MCP 2025-12-11 schema · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS
RISK 📎 Source
📂 Files changed (8 files, ~1200 lines)
{tokens:817758,cost:0.8317808} |
- Add delete file functionality with undo support - Implement negative line index resolution and clamped boundaries - Improve batch edit diffs with cumulative offset tracking - Refine line hash parsing and endpoint resolution utilities - Enhance directory listings with size and token estimations - Streamline file viewing and editing logic in MCP tools - Update JSON schemas and documentation for better LLM compatibility - Add comprehensive tests for line-targeting and batch edit operations - Fix error handling for empty files and invalid line indices
Octomind — developer:brief (octohub:glm)Now I have all the evidence I need. Let me compile the brief. 📦 Brief: Delete command, shared line-index resolution, mode-aware schemas, and batch-edit diff offset trackingOverall risk: 🟡 MEDIUM · Cards: 4
Card 1/4: text_editor delete command — file removal with undo · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK 📎 Source
Card 2/4: Line-index resolution consolidated to utils::line_hash with overflow guard · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK 📎 Source
Card 3/4: Mode-aware line endpoint JSON schema · 🟢 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK 📎 Source
Card 4/4: Batch-edit diff tracks cumulative line-count offsets for correct final positions · 🟡 · ●●●INTENT WHAT CHANGED
IMPACT RADIUS RISK QUESTIONS 📎 Source
📂 Files changed (9 files, ~559 insertions / ~227 deletions)
{tokens:489305,cost:0.5002016} |
BREAKING CHANGE: line_range, from_range, append_line, and view parameters now require strings instead of integers or arrays