mirror of
https://github.com/patriceckhart/zot.git
synced 2026-06-26 21:36:31 +02:00
read calls now render their requested line range next to the
path, so you can see at a glance what slice of the file the
model looked at.
before: ▸ read /Users/pat/Developer/zot/internal/tui/view.go
after : ▸ read /Users/pat/Developer/zot/internal/tui/view.go:723-772
▸ read /Users/pat/Developer/zot/internal/tui/view.go:100-
▸ read /Users/pat/Developer/zot/internal/tui/view.go
The ":START-END" suffix appears when the call had a limit arg;
the ":START-" (open-ended) form appears when only offset was
supplied; no suffix appears for whole-file reads (the common
case). Other tools (write, edit, bash) are unchanged - their
args don't carry a range.
Implementation:
- shortArgs -> ShortArgs (exported), now takes the tool name
as a first arg so it can add shape-specific decorations.
For read, parses offset/limit from the args and appends the
range; for everything else it falls back to the old
path-or-command truncated-at-60 shape.
- The truncation budget shrinks by the length of the suffix
so absurdly long paths still leave the range visible (path
gets the "..." in the middle, range stays intact at the
tail).
- toInt helper coerces float64 (json.Unmarshal's default),
int, and numeric strings so we survive the occasional model
that returns "100" instead of 100.
- Dropped the duplicate unexported shortArgs in interactive.go
(pre-dated the tui package's version). All call sites now
go through tui.ShortArgs(name, args); the json import that
only the local copy needed is gone too.
No format string changes elsewhere; the extension intercept
protocol, rpc wire schema, and session file format don't see
the header string.
|
||
|---|---|---|
| .. | ||
| editor.go | ||
| highlight.go | ||
| image.go | ||
| input.go | ||
| markdown.go | ||
| partialjson.go | ||
| partialjson_test.go | ||
| quote_paste_test.go | ||
| render.go | ||
| resize_unix.go | ||
| resize_windows.go | ||
| statusbar_test.go | ||
| terminal.go | ||
| theme.go | ||
| view.go | ||
| wrap_test.go | ||