0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
Commit graph

5 commits

Author SHA1 Message Date
Wing
3ef287e270 Tool images: engine only, one file per picture in a chat, the CLI's note exactly
Review follow-ups for #1103:
- crates/ui is back to main (the desktop is apps/zgx now), but for the
  `preview_paths: Vec::new()` its initializers need to compile. The engine
  still names stored copies on the tool part; zgx reads them (#1186).
- A stored picture is named `tool-<chat>-<sha256 of its bytes>`: the same
  picture again in a chat (another Read, another subagent) is one file
  rather than a copy per call, and a chat's pictures share a prefix for
  whatever clears a chat's away. Uploads keep them as before.
- Only the CLI's own image note is bookkeeping: one line, `[Image: source:
  <path>]` or `[Image: original WxH, displayed at WxH…]`. A steer that just
  starts with `[Image: ` and ends with `]` reaches the subagent.
- `is_meta` and `tool_use_result` also read as the live stream spells them.
- docs/image-preview.md says what the engine does and who reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:06:13 -07:00
Daniel Katulevskiy
c17262cffc
fix: preview images embedded in tool results
Tool chips named a scratch path outside the attachment jail, so the
preview read failed and the chip showed Image unavailable. Image
bytes already present on the tool result are now stored in the
profile uploads directory and the chip previews that copy.

A subagent image note about the displayed size was folded as a steer
and the pixels were dropped. That note is ignored, and the same
stored preview is used on the subagent transcript.
2026-10-29 06:15:25 -07:00
Alexandre V.L
5d2b91901b
Agents can show local images in chat: show_image, and Markdown images in replies (#1036)
* Agents can show local images in chat: show_image, and Markdown images in replies

show_image {path} (Zeron MCP) copies a PNG/JPEG/WebP/GIF into uploads and
publishes the image part Codex's generated images use, so every client
already renders it and it outlives the file.

An agent reply's ![alt](path) now draws the image in place, read live by the
chat's host through ReadChatImageChunk: strictly inside that chat's folder,
no link followed, no URL fetched, extension and bytes checked, decoded within
the shared raster limits. Anything refused keeps today's link.

* Chat image folder tests: refuse the filesystem root portably

On Windows `/` isn't absolute, so it was refused as "not an absolute
path" instead of as the root. Test the root of the temp dir's own path
(`/`, or a drive like `C:\`) instead.

* Retrigger CI: cursor_shim frame timeout on the Windows runner

* Reply images: right-click copies the original, and narrow columns scale them whole

Rebased onto main (Origin's new side_chats_only in the show_image test).

- A Markdown image in a reply now opens the shared Copy path / Copy image
  menu, like generated images and tool previews. Copy image reads the
  original through ReadChatImageChunk under that chat's jail, not the wider
  ReadAttachmentChunk, and not the downscaled preview.
- The image row keeps its aspect ratio when the column is narrower than the
  image, instead of keeping its height and letterboxing.
- docs/image-preview.md: the menu, the sizing, and what the cache means for a
  Markdown image whose file changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

---------

Co-authored-by: Wing <44917547+wingleeio@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-10-27 02:55:52 +00:00
fate
e5466c5336
Windows browser, image previews in tool calls, selectable tool output (#813)
* Embed the browser on Windows and preview images in tool calls

- Browser tabs render pages inside Zeron on Windows (WebView2), matching macOS and Linux.
- Expanded tool calls preview the images they touch and free them on collapse.
  Right-click any transcript image to copy its path or the image itself.
- Paths, commands and output in expanded tool calls can be selected and copied.
- Fix: answering an agent question with multiple lines now grows the card instead
  of spilling text below it.

* Address review: repin zui upstream, harden the Windows browser and previews

- Depend on zeronsh/zui dce5c1f (zui#15 merged) and gpui-component
  47ccd07 instead of patching every gpui crate to a personal fork.
- Tool image previews: refuse UNC/device/drive-relative paths in the UI
  and, before any filesystem call, lexically jail requested paths in the
  engine (canonicalizing \\host\share opened an SMB session and leaked
  the user's NTLM hash); read chunks on the blocking pool; bound decodes
  with the shared raster limits; release keys a chip stops showing;
  decode base64 off the UI thread; copy sanitized SVG; cap output lines.
- Windows browser: fail closed on unreadable navigation targets; police
  subframes and cancel external-scheme launches; open tabs only for
  user-initiated popups (handled first); deny permission requests;
  disable web messages and host objects; cancel downloads silently
  unless the page itself is the file; recover from a browser-process
  exit on Reload; give each BrowserData its own InPrivate profile (no
  persistent fallback); sweep only folders of exited processes; never
  remount from an older composition generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Wing <contact@winglee.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 23:06:18 -07:00
José Gurruchaga
f8766271f5
feat(ui): add workspace image previews with pinch and wheel zoom (#333)
* refactor(ui): share bounded image preview resources

* feat(files): preview workspace images safely

* feat(ui): add image pinch and ctrl-wheel zoom

* feat(ui): enable image zoom in the shared lightbox

* test(files): cover remote image previews and zoom lifecycle

* fix(ui): remove image zoom toolbar

* fix(files): keep image previews in the file panel

* fix(ui): protect image preview lifecycle and scope zoom redraws
2026-09-12 16:17:02 -07:00