zot/internal/agent/tools
patriceckhart 71933343de feat(tui,bash): shell-log style bash results
Bash tool results now render in the TUI like a terminal log:

    ──────────────────────────────────────────────
        $ npm run build
            (accent color)

        > example@1.0.0 build
        > webpack --mode production
        built in 2340ms

        [exit 0]  Took 2.4s
            (muted color)
    ──────────────────────────────────────────────

bash.go: prefixes every result with `$ <command>\n`, adds a
trailing `Took X.Ys` after the `[exit N]` marker, stores the
elapsed duration in Details.duration_ms for programmatic use.
New humanDuration helper formats the duration as "0.1s" for
sub-minute runs, "2m3s" / "1h5m" above that.

view.go: renderBashResult styles three zones:
  - first line (starts with "$ ") in accent
  - the "[exit N]  Took X.Ys" footer line in muted
  - everything in between on the default tool-output color
Detected automatically by looking for "$ " at the top of a
tool_result block, so no plumbing changes needed.

Result text stays plain-text so the model sees the same shell-log
format when it reasons about the command's outcome. That matches
how a human would see it in their own terminal and doesn't need
any special escape-code stripping on the model's side.
2026-04-20 09:03:24 +02:00
..
bash.go feat(tui,bash): shell-log style bash results 2026-04-20 09:03:24 +02:00
edit.go perf(prompt): cut system prompt to the bone (410 -> 54 tokens) 2026-04-19 17:39:38 +02:00
read.go rename: /lock -> /jail, /unlock -> /unjail 2026-04-20 08:57:40 +02:00
sandbox.go rename: /lock -> /jail, /unlock -> /unjail 2026-04-20 08:57:40 +02:00
sandbox_test.go initial commit 2026-04-17 20:36:38 +02:00
tools_test.go perf(read): drop line numbers from model-facing output 2026-04-19 17:33:05 +02:00
write.go feat(tui): live-stream file body during write/edit tool calls 2026-04-20 08:37:14 +02:00