58 Commits
Author SHA1 Message Date
Kit Langton 6b48f9dcff feat(screenshots): Export asks where to save, and recordings dim around their target (#2297)
* Screenshots: Export opens a save panel; recordings dim around their target

* Gate the dim windows to macOS

* Screenshot name test: the date is macOS-only
2026-11-21 17:18:56 -08:00
Dax 38f89b6af4 annotate: start capture summaries with [hex-annotate …] (#2230) 2026-11-21 14:34:56 -05:00
Kit Langton 4f3a45e03a feat(screenshots): a recording toolbar, smaller movies with sound, and playback in the editor (#2166)
* Screenshots recordings: quality settings, copy as a file, export size (t1607)

Labs › Screenshots gets a Recording group (Scale Retina to 1x, Max resolution, Frame rate, Quality), each with a hex settings key; defaults 1x, Original, 30 fps, High (HEVC 0.50). The editor copies a recording's movie file, and its export-size pop-up (Original, 1080p, 720p) shows an estimate for the span kept, re-encoding off the UI thread with progress on the pressed button. (t1607)

* Screenshots: ⌘⇧5 recording toolbar with microphone and computer audio mixed into the movie (t1607)

* Screenshots: compact recording toolbar, editor playback and tidier toolbar (t1607)

* Screenshots: simplify the toolbar still, export-size save and playhead tick (t1607)

* docs: the compact recording toolbar and editor playback (t1607)

* Screenshots: filmstrip cells keep the movie's shape; mic-off icon is macOS-only (t1607)

* Screenshots: trim editor goldens for the transport and filmstrip (t1607)

* Screenshots: a trimmed export keeps a whole video track; reencode has a deadline (t1607)

* Screenshots: recording sound isn't silenced; toolbar choices apply at once and save in order (t1607)

* Screenshots: Return and Escape reach an open toolbar menu (t1607)

* Screenshots: a menu-only open of the chosen microphone; no microphone keeps no audio; Annotate may take the record key while the Lab is off (t1607)

* Screenshots: an export lands whole or not at all, and reports only to the recording it came from (t1607)

* Screenshots: keep the exact-device open and partial exports macOS-only (t1607)
2026-11-21 08:26:36 -08:00
Dax 60e753a333 annotate: record the screen under the pointer on wayland (labs), list hex annotate without a shortcuts portal (#2094)
* annotate: follow the pointer on Wayland, and list its command without a portal

Labs › Record the screen under the pointer (labs.annotate_pointer_screen,
Linux, off by default) asks the compositor which output the pointer is on
before each screen capture, using one ext-image-copy-capture pointer cursor
session per wl_output (no surface, no frames, two round trips), and keeps a
ScreenCast restore token per output (screencast-token-<output>) so each
monitor is asked once. After Start the token is saved for the output the
desktop actually recorded: mapping_id, else the xdg-output geometry holding
the stream's position, else the pointer's. Off, on X11, or when the lookup
fails, the one file behaves exactly as before.

Without a GlobalShortcuts portal the Annotate pane now shows the
`hex annotate toggle` command to bind instead of a recorder that can never
register, and General's desktop commands list it while Annotate is on.

docs/features/capture.md and labs.md carry the behavior, checks, and gaps.

* annotate: fix the Wayland pointer follow-ups and the macOS sampler

- macOS: the ScreenCaptureKit sampler's Start destructure includes the new
  portal_token field (E0027).
- portal: a mapping_id only names an output the outputs list knows;
  otherwise the stream's own geometry decides.
- pointer_output: release wl_pointer (v3+) and wl_seat (v5+), prefer a
  session that also reported a position when several entered, and say
  plainly that the lookup is a fixed two round trips, not a time bound.
- policy: the Annotate lock now reports for the new lab too.
- Annotate pane: its own singular no-portal note, translated.
- docs: the website leaves out the labs that only matter once Annotate is
  on (build.rs sets hex_capture on every macOS, Linux and Windows build);
  capture.md marks the wlroots software-cursor limit unverified.
- goldens: commands-dark and linux-labs-light re-blessed for the new
  Annotate command row and lab card.
2026-11-20 15:58:16 -05:00
Dax 8cffd94db7 annotate: count words from transcript text when the model has no word timings (#1918)
* annotate: count words from transcript text when the model has no word timings

A model that requests no timestamps (GigaAM v3) returns its text with an
empty word list, so `transcript.words.len()` read 0: lists and JSON said
"0 words" and the capsule called it "no speech". `transcribe::word_count`
counts the model's own word times, or the words in the text when it has
none, and every capture count goes through it (finished captures, the
iPhone and screen paths, replay, and `hex capture list|show`).

* annotate: spread untimed words over the clip for the editor

A model that gives no word times (GigaAM v3) left a capture's words empty,
so a recording or annotation opened from the Captures pane read "Nothing
was said" and its Send used the placeholder text. The words path now
spreads the text over the clip with estimated times, as `hex` does out of
process, and the pane spreads a bundle already on disk the same way.
`word_count` still counts those bundles when they are listed.

* annotate: spread each untimed piece over its own audio

A model with no word times (GigaAM v3) had a multi-minute capture's whole
text spread over the entire clip, so words landed minutes away from where
they were said. Each `audio.wav` piece now spreads its own untimed text
over its own 30 s, on the same offset base as measured words, and the
estimate reaches `transcript()` so it never spreads the text again; a clip
held in memory still spreads over the whole of it.

Also fix the Captures pane's wording: an annotation's times stay on the
capture's clock, not the movie's.
2026-11-16 16:15:24 -05:00
Dax cdb96f585e capture: keep all audio in long captures (#1795) (#1894)
* capture: stream audio to disk so long captures keep all of it

A capture's timeline now writes 16 kHz mono PCM16 to its bundle's
audio.wav as it records, with the leading offset and gaps as silence, so
memory stays flat and the 20-minute drop is gone. An 8-hour guard bounds
disk use only; past it the rest is one recorded gap.

A finished capture is transcribed from the WAV in 30 s pieces, the
reader hex transcribe already used (lifted to transcription/pieces.rs),
and each piece's words move onto the capture clock. The Parakeet, Apple
(path-based), and GGUF paths keep every word without holding the
session. The pipeline never rewrites a streamed audio.wav from empty
samples, an iPhone narration is read back where it must be re-based,
and a cancelled capture closes and removes its file.

* capture: say where a capture's audio stopped

A streamed capture keeps all of its audio, but the 8-hour disk guard (or
a failed audio write) still stops it early, and only the process log
said so. The timeline now carries the stop point onto RecordedAudio,
the bundle stores it as audioStoppedAtMs (serde default, so old bundles
load unchanged), and three places say it plainly: summary.md, `hex
capture show`, and `hex capture status`.

The guard records its point at a 1 s test limit, and the summary line is
tested at 12:34 and 8:00:00 so both clock shapes are covered.

* capture: fill the replay's stop point from its bundle

The 15 s replay builds Written too, on macOS only, so the new field
broke the macOS clippy job while Linux never compiled that function.

* capture: keep a recording out of recovery until it stops

Review fixes for the streamed timeline.

A capture now streams to `audio.wav.partial` and renames it to `audio.wav`
in `Timeline::finish`, so a bundle with a movie and an in-progress audio
file is never mistaken for a capture whose build never ran (recover's
orphan rule, Scrawl.app's `scrawl recover`) and retention cleans a crashed
one like any other bundle. Cancel and discard remove the partial; a failed
publish reads it back into memory rather than pointing at a missing file.

Also: a write failure's stop point is the last sample that reached the
file, not the end of the failed chunk; a trim failure counts every written
sample; the capture's words keep one running frame total instead of
adding truncated per-piece millis; an iPhone narration's `since` drains the
decoded samples instead of copying them and treats a missing file as no
audio; the phone and replay paths carry the audio stop point into their
bundles; and empty audio answers `source: "none"`, as `transcribe_with`
does.

Tests: a movie plus partial audio is never owed, retention trashes a
crashed bundle's media, a write failure records its stop point, a missing
streamed file shifts to no samples, and the replay shift moves the stop
point with the clock.

* capture: publish audio.wav only once its build journals the capture

Follow-ups from review.

A capture now streams to audio.wav.partial and keeps that name after it
stops: the partial is renamed to audio.wav right after the build writes
unfinished.json, so audio.wav never exists without a journal, and a
stopped capture waiting in the finish queue no longer looks like an
orphan to Scrawl.app's recover. A partial that cannot take the name is
read back and written by the build, and its partial name removed; the
replay removes the unshifted partial once the narration is read for
shifting.

Also: a periodic header flush error is now a write failure (the rest of
the capture is a gap) rather than a log line; the midpoint of a failed
write records where the file stopped; and the words test cuts pieces at
odd sample counts and computes offsets from the running frame total, so
per-piece millisecond drift would fail it.

Tests: a streamed audio takes its final name only when the build settles
it (and falls back when it cannot), a capture that has not been
journaled is never owed a rebuild, a mid-capture write failure stops
where the file stopped, and the word offsets are exact at odd piece
lengths.

* capture: consume a streamed recording's partial when it is read

Follow-ups from review.

`RecordedAudio::since` and `into_memory` now remove the partial once its
samples are read: an iPhone narration (capture.rs's `host_narration`
path) used to leave the whole streamed file in the finished bundle. The
replay relies on the same path instead of removing it by hand, and the
light zip leaves `audio.wav.partial` out defensively. A read that fails
is an error to `into_memory` (so a build keeps the only copy) while
`since` still treats a missing file as no audio for an iPhone.

A failed publish now reads the audio back only when it produced the
samples the recording had; a failed read keeps the partial and removes
any half-copied `audio.wav`. `publish_audio` takes `&mut self` and points
the recording at the published file.

A journaled bundle whose `audio.wav` is missing adopts `audio.wav.partial`
before rebuilding. Docs say the guarantee is a streamed capture's, and
that a crash while recording or queued is retention's job, not
recovery's.

Tests: reading a streamed recording consumes the partial; a finished
iPhone bundle keeps none; a streamed audio is published only when its
build settles it, including the read-back and unreadable-partial cases; a
journaled capture adopts its partial.

* capture: keep a failed audio publish recoverable

Follow-ups from review.

The publish fallback read the partial with `into_memory`, which deletes
it, and then ignored whether its own write landed: a failed write left
the audio nowhere. It now reads through `read_streamed` (no deletion),
writes `audio.wav` and checks the result, and removes the partial only
once that write succeeded. A failed read or write removes any half
`audio.wav` and fails the build, which is the pipeline's existing failed
path: `recover::finished` runs only for an `Ok` build, so `unfinished.json`
stays and the next launch's recovery adopts the partial instead of the
capture quietly finishing without its audio.

`publish_audio` also treats a landed copy as success even when deleting
the partial fails, logging it rather than reporting failure and letting
the fallback overwrite a good `audio.wav`.

Tests: a blocked target keeps the partial and fails the build; a
fallback write that lands consumes the partial and writes `audio.wav`;
an unreadable partial is kept.
2026-11-16 10:28:54 -05:00
Dax 33cb10c244 fix: find scrawl-helper from test binaries under cargo 1.100's build-dir layout (#1745) 2026-11-12 15:14:58 -05:00
Dax ec7b6b283d labs: copy captures as a zip (#1721)
* labs: copy captures as a zip

A finished Annotate capture can go on the clipboard as one light zip
file (Labs > Copy captures as a zip, off by default): the bundle's
manifest, summary, contact sheet, and keyframes, with summary.md's
bundle path written as ".", and without its video, audio, full-size
frames, delivery markers, or an earlier copy.

crates/capture/src/slim_zip.rs writes it with STORED local headers, a
central directory, and an end-of-central-directory record (CRC-32,
UTF-8 flag, DOS timestamp; no dependency). It lands inside the bundle
beside the other files, renamed into place, so retention removes it
with the bundle.

The clipboard holds only the file: a macOS file URL, Windows CF_HDROP,
or Linux text/uri-list (X11 target or wl-copy). A failed zip build or
clipboard write logs and falls back to the normal copy.

Checks: slim_zip unit tests (CRC-32 vector, central-directory read-back,
excludes, summary rewrite, a second copy), linux/paste file_uri, the
labs switch test, and the regenerated Labs goldens. Not verified: a
real paste of the zip into a chat or agent app on any OS.

* labs: leave the light zip out of the agent host copy

The SSH light-files tar copies a bundle wholesale to the agent host, so
a capture's <stem>.scrawl.slim.zip would travel with it. Share the name
pattern as scrawl-router's SLIM_ZIP_SUFFIX/SLIM_ZIP_TEMP_SUFFIX, use it
from slim_zip, and exclude both from light_files_tar. The existing tar
test now puts the zip and its temp file in the fixture and checks they
stay out.

No other path copies a bundle wholesale: phone ingest builds a new
bundle from the movie and timeline, retention shrinks or trashes named
media, and zoom/export write their own files.

* labs: tidy the capture zip copy

Generate the zipped summary with the bundle folder as ".", so only its
header names the copy's location and transcript text is never touched.

Use strict limits before ZIP64 (0xFFFF files, 0xFFFFFFFF bytes), a
Windows path from encode_wide rather than lossy text, and the current
time for an entry whose summary.md is missing. DOS times stay UTC: the
crate has no local-time facility without a new dependency.

Show the lab row only where Annotate itself is available, under the same
Annotate policy lock, with a folder icon and a shorter description that
fits its card. Docs note the terminal paste gets no text and that the
manifest and summary still name media the zip leaves out.

* labs: match the capture zip description

Use the same shortened sentence in the Labs description the card shows.
2026-11-12 09:14:48 -05:00
Dax 9ca6bf8d77 capture: name why a capture has no screen on linux (#1709)
* capture: name why a capture has no screen on linux

A Linux capture with no screen frames was saved with the generic "the
screen recorded no frames" even when the screen source had failed, so the
summary blamed an empty screen instead of naming the real reason.

The failure is now kept when the person stops the capture rather than
dropped, so it survives into the stop. A PipeWire stream that sends no
frames fails with that reason (or says the stream sent no frames), an X11
sampler that grabs nothing fails instead of returning quietly, and the
summary's no-screen reason comes from the reason recorded for the capture.

The PipeWire buffers param also asks for at least two buffers, four
preferred, since `newest_locked` holds the last one until the next frame
arrives and a single buffer would stall.

* capture: keep the generic reason for an early x11 stop, document early stream failure

An X11 sampler only grabs nothing when the person stopped before its first grab, so it returns quietly again and the generic no-frames reason stands. The test now checks the source's failure is kept and, on Linux, that no failure falls back to the platform's literal reason.
2026-11-11 20:56:55 -05:00
Kit Langton 582d87c8aa feat(screenshots): record the screen at full resolution in sharp HEVC (#1609)
* capture: record lab movies as full-quality HEVC

* capture: live HEVC check and microphone refusal test; docs
2026-11-09 11:58:24 -08:00
Kit Langton a65a5e375f feat(screenshots): record the screen, and keep captures until you close them (#1371)
* Talk over a screenshot: dictation words go with the shot

* Regenerate the screenshot editor goldens with the words row

* Cover the card held while someone talks over it

* Add the listening card's goldens

* Record the screen from Screenshots, ending in the corner card and a trim editor

* Move the capture timeline out, add the recording goldens and feature map

* Keep the replay's start on Windows quiet

* Keep the timeline move's imports and the replay start quiet off macOS

* Clear the record shortcut without returning its change

* Fix the macOS lints the recording left

* screenshots: only the open editor takes a dictation

A dictation taken while only the corner card showed used to talk over the
shot: the card held, showed "Listening…", and the words opened the shot in
the editor. That took the shortcut's normal paste away from everyone who
never asked for it.

Now only an open editor takes the words. While the card shows, a dictation
pastes as it did before the Lab, the card keeps its few seconds, and its
listening pill, hold and the narration path that opened the shot are gone.
The card's own card/listen/heard API goes with it, so nothing else can reach
the shot but the editor.

The i18n Screenshots rows move to i18n/labs.rs, where the Labs rows live,
so the main table stays under the source cap after dev's merge.

* screenshots: the editor's pieces come from the kit, and a shot grows in from where it was taken

The editor's toolbar was hand-made: five canvas-drawn tool glyphs in bespoke
hover chips, a bare ✕, a bare microphone, and action buttons stretched past
the kit's own height. The card's ✕ was a filled button beside them. They now
come from the rest of Hex: the tools are line icons beside the theme's own,
drawn by rune-kit icon buttons that fill while a tool is picked, ✕ and the
microphone and clear-words are the kit's ghost icon buttons like a capsule's,
and Copy, Save and Send to… are the kit's buttons at their own size. The
trim handles take the kit's corner.

A shot now grows in from the rectangle it was taken from. The card's overlay
is the whole display, so it can start anywhere on it: an area or window shot
starts at exactly the rectangle captured, at that size and place, and springs
into its corner slot on one spring that never overshoots its size, leaving
the same way. A whole-display shot keeps the slide in from the edge, and
Reduce Motion still only fades.

* screenshots: regenerate the editor and card goldens for the look pass

* docs: the card grows in from the shot's rectangle, and the editor is the kit's

* screenshots: a recording saves itself to the screenshots folder, as a shot does

* screenshots: cards stay until closed, stack in the corner, and take CleanShot's keys

* screenshots: Restore Last Capture in the menu bar brings back the card closed last

* screenshots: a Captures pane lists the last 30 days of shots and recordings

* screenshots: goldens for the card stack and the Captures pane, and its playground paths

* screenshots: the card's Return and the editor's file are macOS-only

* screenshots: pin that cards of any shape share the corner's right edge

* screenshots: keep macos_rune.rs and app_settings.rs under the file cap
2026-11-09 08:18:56 -08:00
Dax ceb07a1a5c annotate: use OpenCode in WSL when the lab is on (#1586)
* annotate: send through OpenCode in WSL when the lab is on

* annotate: address review

* annotate: dropped wsl replies read as no answer
2026-11-09 08:08:57 -05:00
Dax bc996e85a8 linux: open the annotate pen on the recorded output (#1515)
* linux: open the annotate pen on the output the screencast portal records

* linux: leave the pen's display alone when the named output isn't found
2026-11-07 23:14:58 -05:00
Dax b0ecc0a809 Keep capture media safe when Linux retention can't trash it (#1516)
* Keep capture media safe when Linux retention can't trash it

* docs(capture): describe staged media recovery
2026-11-07 23:05:30 -05:00
Dax afb11de5e3 dev green: split capture_host routing session naming, regenerate labs link goldens (#1339)
* split session naming out of capture_host/routing.rs

* regenerate the mac-labs-link goldens for the live auto-scroll lab (#1334)

* capture: Linux frames are pixels too in the capture size test

* fmt
2026-11-04 18:39:40 -05:00
Kit LangtonandKit Langton 3a1de64a8f Capture capsule: name the session, never its ses id (#1327)
A saved rule to a session ID is answered before the session server
answers, so the router had only the id: the pill read
"Sent to ses_e853… · too late" and the bundle's summary did too, while
the routing record had the title.

Every destination now carries a title: the name the router read, else
the capture's own session list, else OpenCode's title for that session,
else "session". The bundle, the delivery and the capsule all read it,
and the capsule's short() refuses a raw ses id from any host.

Co-authored-by: Kit Langton <kit@kitlangton.com>
2026-11-04 12:57:23 -08:00
Ryan Vogel 5d8ff5bb6d feat(capture): record Linux screen captures at 60 fps (#1212)
Raise Linux Annotate screen recording from 30 fps to 60 fps across the
PipeWire/VA-API, PipeWire/x264, and X11/x264 paths (step L1):

- Raise `linux::media::FPS` from 30 to 60 and propagate it to both
  sampler loops, `ffmpeg` mux/encode args, and VA-API H.264 sequence
  and VUI timing (`time_scale = 2 * FPS = 120`), replacing the 30 fps
  cap (`time_scale = 60`).
- Offer `SPA_FORMAT_VIDEO_maxFramerate` 60/1 (range 1/1..60/1) and a
  60/1 default on `SPA_FORMAT_VIDEO_framerate` in PipeWire `enum_format`,
  keeping linear modifier negotiation unchanged for now.
- Compute VA-API H.264 `level_idc` from macroblocks and frame rate per
  Table A-1 (e.g. 4.2 at 1080p60, 5.1 at 1440p60, 5.2 at 4K60, replacing
  hardcoded level 5.1), allocate coded surfaces padded to 16 px
  macroblocks while setting SPS `frame_cropping_flag` and crop offsets
  (replacing `fit(..., 16)` truncation that squashed 1920x1080 to
  1920x1072 and float-truncating 3840x2160 to 2560x1438), and scale the
  `small` candidate surface on demand in `small_rgba` at
  `FRAME_SAMPLE_INTERVAL` instead of on every frame in `load`.
- Switch CPU `Writer::x264` from fixed `veryfast` to `superfast` up to
  1440p and `ultrafast` above, raise the pipe buffer to 1 MiB, and
  timestamp piped frames on the wall clock into `fps=60` inside `ffmpeg`
  instead of duplicating multi-MB raw frames across `pipe:0` when a
  screen is still or a 4K software frame runs past 16.7 ms.
- Borrow the X11 MIT-SHM segment directly into `Writer` instead of
  copying each frame into a `Vec<u8>`, and cache the XFixes cursor image
  across frames using `XFixesSelectCursorInput` (`XFixesCursorNotify`),
  pipelining `QueryPointer` with `shm_get_image` instead of fetching the
  cursor bitmap every frame.
- Update `docs/features/capture.md` (`capture.linux`) with the new
  behaviour, checks, and T4 verification limits.

Verified:
- `cargo clippy --locked -p scrawl-capture --target x86_64-unknown-linux-gnu -- -D warnings`
  and `python3 scripts/code-shape.py --check`.
- FFmpeg `trace_headers` bit-level parse of generated VA-API SPS/PPS/IDR
  headers at 1920x1080@60 (level 42, crop_bottom 4), 2560x1440@60
  (level 51), and 3840x2160@60 (level 52), all `time_scale = 120`.
- On `hex-linux-nvidia` (`g4dn.2xlarge`, Tesla T4, Ubuntu 24.04):
  273/275 `scrawl-capture` unit tests pass (the other 2 fail identically
  on clean `dev`); native Xorg 1080p60 recorded 598 frames in 9.97 s at
  60/1 (`1920x1080`, 597 grabs, 16.5% capture CPU); Xorg 1280x720 Area
  recorded 298 frames in 4.97 s at 60/1 (297 grabs); rootful Xwayland 4K
  recorded `2560x1440` at 60/1 (598 frames in 9.97 s from 282 raw 4K
  grabs); PipeWire 1080p60 SHM -> x264 recorded 598 frames in 9.97 s at
  60/1 (594 delivered). VA-API hardware encoding was not exercised live
  because Tesla T4 has no VA-API encoder.
2026-11-03 18:04:52 -05:00
Luke Parker 3a7a712315 Keep a benchmarked Hex's Annotate folders in its own home on Windows; build strobe.json on any commit (#1214) 2026-11-03 16:58:59 -06:00
DaxandHex issue pipeline c99d6b9f1d Fix #1179: annotate screen capture (VA-API DMA-BUF import) (#1182)
Automated fix from the Hex issue pipeline (run 1179-2026-11-03t19-19-51-347z).

Fixes #1179

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-03 14:38:52 -05:00
DaxandHex issue pipeline a77a191a61 Fix #1127: Annotate transcription speech detection (#1129)
Automated fix from the Hex issue pipeline (run 1127-2026-11-03t13-25-52-405z).

Fixes #1127

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-03 08:29:32 -05:00
DaxandHex issue pipeline f60705106e Fix #1079: Annotate capture bundle recovery (#1081)
Automated fix from the Hex issue pipeline (run 1079-2026-11-03t03-23-25-028z).

Fixes #1079

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-02 22:25:21 -05:00
Dax 7c0b507133 Keep autocrop from panicking on any frame or keyframe size (#945) (#1073)
* Keep autocrop from panicking on any frame or keyframe size (#945)

* Test only well-formed keyframes end to end; format
2026-11-02 18:20:48 -05:00
DaxandHex issue pipeline 00ab1af8e5 Fix #1042: annotate tool voice trigger words / language support (#1044)
Automated fix from the Hex issue pipeline (run 1042-2026-11-02t16-42-11-215z).

Fixes #1042

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-02 11:46:28 -05:00
DaxandHex issue pipeline 687fbb36ba Fix #999: annotate pen overlay on fractional scaling (#1001)
Automated fix from the Hex issue pipeline (run 999-2026-11-02t13-09-43-508z).

Fixes #999

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-02 08:15:33 -05:00
DaxandHex issue pipeline 6c56a40430 Fix #960: Annotate screen recording (VA-API hardware encoding on Intel+NVIDIA) (#962)
Automated fix from the Hex issue pipeline (run 960-2026-11-02t06-35-37-858z).

Fixes #960

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-02 01:40:49 -05:00
DaxandHex issue pipeline 4d09d01e14 Fix #945: Annotate capture finishing (autocrop, capsule and video) (#947)
Automated fix from the Hex issue pipeline (run 945-2026-11-02t02-47-51-230z).

Fixes #945

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-01 21:49:52 -05:00
DaxandHex issue pipeline 859137b681 Fix #853: Annotate screen capture (video encoding) (#854)
Automated fix from the Hex issue pipeline (run 853-2026-11-01t16-47-52-189z).

Fixes #853

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-11-01 11:53:38 -05:00
Kit Langton 53eb9bd080 fix(ci): remove duplicate failure field in ScreenCaptureSession test literal 2026-10-31 15:44:36 -07:00
Dax 4661987182 Annotate on X11: record the screen and areas without a ScreenCast portal (#690) (#694)
On an X11 session (DISPLAY set, WAYLAND_DISPLAY empty; never XWayland) Screen and Area are read from the X server: MIT-SHM GetImage each frame (plain GetImage without it), the pointer blended in from XFixes, 30 fps to x264 through ffmpeg. The screen is the RandR monitor under the pointer; `hex annotate start --area X,Y,W,H` records an area. i3 and other desktops without a ScreenCast backend now get video. A Window still needs the portal's picker and fails saying to record the screen or an area, never widening to the screen. When X11 capture can't start (no display, unusual depth, no ffmpeg/x264) the capture fails at once with why in the capsule instead of writing one with no picture.

Checked in a headless Xvnc + i3 session on apollo with no ScreenCast portal: an 800x500 area recorded 154 frames over 5.1 s, the 1920x1080 screen 153, each with a keyframe and the cursor. Also fixes scrawl-capture's own tests, which no longer compiled (ScreenCaptureSession.failure).

Reported and diagnosed by @nefthy.
2026-10-31 18:19:36 -04:00
DaxandHex issue pipeline 4763501a1d fix(ci): add the missing failure field to a crate test's ScreenCaptureSession literal (#692)
Check macOS failed on dev since eef51da7. Automated CI fix from the Hex pipeline (run ci-41245758514-2026-10-31t22-01-54-308z).

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-10-31 18:05:27 -04:00
DaxandHex issue pipeline ca43a4fec9 fix(ci): ignore the new Sampler failure field in the macOS run_sampler (#688)
Check macOS failed on dev since eef51da7. Automated CI fix from the Hex pipeline (run ci-41244714553-2026-10-31t21-52-01-196z).

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-10-31 17:54:34 -04:00
DaxandHex issue pipeline eef51da7e0 Fix #681: Annotate screen capture and dictation hotkey on GNOME Wayland (#683)
Automated fix from the Hex issue pipeline (run 681-2026-10-31t21-36-18-652z).

Fixes #681

Co-authored-by: Hex issue pipeline <noreply@anoma.ly>
2026-10-31 17:40:50 -04:00
Dax 154b4d402e Talk only to a running OpenCode service; quiet mic meter (#598)
* Talk only to a running OpenCode service; never spawn or probe a CLI

* wip

* wip

* Golden for OpenCode not running

* clippy

* fmt

* General's microphone meter wakes the window only while its bars show a level

* Feature map: the microphone meter rests in a quiet room
2026-10-31 12:33:36 -04:00
Dax 1018aecdbb Linux: ship the desktop entry as anomaly.hex.desktop (#582)
* Linux: ship the desktop entry as anomaly.hex.desktop (#579)

* Linux desktop entries: keep symlinks, tidy fallbacks at startup, address review

* fmt
2026-10-31 09:00:45 -04:00
Kit Langton bed635bf79 Output: the agent card cycles through examples, written the way they ask (#548)
* Output: the agent card cycles through examples, each written the way it asks, and the spark flips smoothly between them (t694)

* Output: the old example waves out before the new one waves in, so wider words never overlap (t694)

* Format crates/capture as dev's fmt check wants (t694)

* Output goldens for the cycling agent card (t694)
2026-10-30 20:49:44 -07:00
Dax df47117bb9 Annotate on Windows: capture host, drawing overlay, and send to OpenCode (#539) 2026-10-30 22:13:11 -04:00
Kit Langton 668e981441 Capture: a permission helper instead of a silent failure, and no fake screen (#519)
* Capture: a permission helper instead of a silent failure, and no fake screen

A capture that starts without Screen Recording, Microphone, or
Accessibility is refused before it records, and the capsule opens a
helper: what's needed and why, Allow (macOS's prompt or System Settings
with the floating guide), Restart Hex when macOS needs one, then Capture.
A real capture never ships a synthetic frame: one written with no frames
goes out with its voice and marks, a 'No screen' note, and no contact
sheet.

* Allow the macOS-only capture needs on Linux
2026-10-30 15:50:16 -07:00
Dax 7949a9610e test(macos): drop the pin tests left behind when #427 removed pins (#436) 2026-10-29 21:56:01 -04:00
Dax 96614b2c00 fix(macos): handle Action::Pen in the playground and drop an unused import (#434) 2026-10-29 21:46:17 -04:00
Dax f1f4c1dc5b Annotate: one key, a pen toolbar, no pins or undo (#427)
- One Annotate key: tap to start and stop; held while recording, the pointer draws with no click (macOS and Linux; Linux reads the portal's Activated/Deactivated). The separate Ctrl+Alt+D draw shortcut is gone. Linux defaults to F9; saved bindings stay.
- The recording capsule is `● 0:07 │ ✎ │ ■ ✕`: icons only, no Area/Window/Screen chips. The pen toggles drawing and lights with the accent fill; ■ stops; ✕ keeps the two-step discard. Tooltips: Draw, Stop, Discard.
- While drawing the ink overlay takes the pointer with a pen cursor; on Linux it leaves a hole over the capsule so the pen can be clicked off. Esc stops drawing, never the recording. Shift still draws on the Mac.
- Pins (Shift-click, click while drawing) and undo (⌘Z, Ctrl+Z, right-click) are removed with their plumbing.
- How it works in Settings › Annotate lists the new steps, in all six languages. Goldens: recording, recording-drawing.
2026-10-29 21:00:20 -04:00
Dax 8b3af3aa29 Annotate: hold to draw on Linux, no send-to list shortcut, inline sends, Paste-first capsule (#406)
- Linux draws while Ctrl+Alt+D is held (portal Activated/Deactivated), as Shift on the Mac; moving draws, a click pins, right-click or Ctrl+Z undoes. `hex annotate draw` stays a toggle.
- The send-to list shortcut (capture.list_hotkey, ⌥⇧L / Ctrl+Alt+Shift+V) is gone; Send to… is a capsule click beside Paste and Inspect.
- Sends attach the contact sheet and up to 8 keyframes inline as data: image parts, with no local path in the prompt, so remote OpenCode servers get everything.
- Dictation and Voice Action start nothing while Annotate records (macOS and Linux).
- Linux Paste pastes the contact sheet, then the summary, as the Mac does; the Linux capsule doesn't open suggestions by itself.
- Settings › Annotate gains How it works.
2026-10-29 16:41:49 -04:00
Dax 72a7e631e6 chore: drop the last kitlangton URLs (#379) 2026-10-29 11:25:32 -04:00
Dax 51263244d7 Captures on Linux: forget a refused screen choice and ask again (#336)
* Capture portal: forget a refused screen choice and ask again

* Fix the macOS test build: mouse_hotkeys sets the capture shortcuts
2026-10-28 23:18:41 -04:00
Dax 2962074bfa Captures on Linux (portal, PipeWire, VA-API); capture compiled into macOS and Linux builds (#320)
* Captures on Linux: portal, PipeWire and VA-API behind the engine's platform seam; capture compiled into macOS and Linux builds

The capture engine's OS adapter gains capture/linux.rs: the screen-cast
portal (zbus) picks the screen (remembered with its restore token) or a
window, libpipewire and libva are loaded at run time, frames are imported
as DMA-BUFs and scaled and H.264-encoded on the GPU, and ffmpeg muxes and
reads movies back. Software x264 is the fallback.

capture_host, the capsule, the pane, routing and the CLI are shared; the
Linux listener feeds a ListenerTimeline, its portal or X11 grabs bind the
capture shortcut, and the summary goes through Hex's Linux clipboard.
The capture feature flag is gone: macOS and Linux always compile the
experiment, off by default.

* Docs: captures on Linux, the experiment in every macOS and Linux build; token path from Hex

* Capture portal: register Hex's app id so the desktop keeps its screen choice

* Fix macOS test build after the capture seam

* Linux: size X11 shortcut state for the capture shortcut; keep macOS-layout capsule tests on macOS

* Windows: the capture word timestamps field is Linux's
2026-10-28 20:58:27 -04:00
Dax 3434eb5f35 Rename voice-control to hex everywhere, without migrations (#293)
* Rename voice-control to hex everywhere, without migrations

The Cargo package and binary are now hex, every OS keeps its data in a
hex folder, and VOICE_CONTROL_* variables are HEX_*. Hex is a fresh
app: the macOS voice-control rename, its symlink, and the Windows and
Linux beta settings imports are gone. The Windows installer gets a new
AppId so it never takes over an old voice-control install's entry.

* Format

* Drop the Windows paste-last default only the beta import used
2026-10-28 13:08:44 -04:00
Kit Langton 7727ce0af3 fix(capture): finish the screen recording before stopping it, via capture-core (#258)
* feat(capture-core): set_exclusions

Recording::set_exclusions changes which windows and apps a live recording leaves out, without stopping it. Display and region streams rebuild their filter; window streams are left alone. A stopped recording ignores it.

* fix(capture): finish the screen recording before stopping its stream

The macOS screen recording now runs on capture-core's Recorder: one source per target, cursor baked in, no audio or input. The core detaches the movie before it stops the stream and finishes it on its own bounded thread, holding the final frame to the stop and writing capture.json beside recording.mp4.

ScreenCaptureSession::stop stays instant and hands back a Movie that may still be finishing. Only the steps that read recording.mp4 wait for it, video_offset_ms comes from the movie's first frame on the host clock, and a discarded capture's bundle is removed only once the movie is done. Frames decoded past the capture's end (the held tail) are dropped. The router keeps capture.json in its first, light copy. Exclusion changes mid-recording go through Recording::set_exclusions.
2026-10-27 21:15:34 -07:00
Kit Langton 6312734370 Show Hex's overlays in screen recordings, optionally
capture.show_overlays_in_recordings (default off), in Experiments › Scrawl
and the menu bar, lets every recorder, Hex's captures included, show the
capture capsule, picker, ink, HUD, and meeting capsules. It flips open
overlays through Rune's new OverlayHandle::set_exclude_from_capture and a
recording capture's SCK filter mid-recording.

Bumps Rune to ea59c496.
2026-10-27 15:39:52 -07:00
Kit Langton 4e5c8d6c74 Capture sends: say why one queued, log it, and retry only this Mac's markers
When OpenCode refuses a send, its message (the JSON body, which opencode2
api prints to stdout) now reaches the error, the capsule, and process.log.
'Unable to read attachment' with no agentHost shows 'OpenCode can't see
this Mac's files' and warns to set capture.routing.agentHost: the server
reads the contact sheet from its own disk. Other reasons show as 'session
not found', 'couldn't reach OpenCode', 'opencode2 not found', or what
OpenCode said, instead of 'couldn't reach SEER'.

The router's deliver: lines log at info, and the capture engine's lines
now use the voice_control target, so the default filter keeps them.

opencode2 is also found where dictation finds it (~/.bun/bin and the rest),
since Hex opened from the Dock has launchd's PATH.

.deliver.json records the Mac that wrote it (hardware UUID); another Mac
leaves it alone, and old markers without one still retry.
2026-10-27 07:57:00 -07:00
Kit Langton 063f5919a4 capture: clicks under the capsule's panel count; Paste never goes into Hex
The capsule is a 640x424 panel that takes clicks only on its pill, but the
engine treated the whole panel as Hex's chrome, so every click, pin and
scroll under it while recording was dropped. Hex now marks the panel
click-through, like the ink overlay, publishes the pill's rect, and drops
presses and scrolls on the pill itself before they reach the engine.

Paste handoff goes back to the last external app whenever Hex is active,
even with its Settings window in front: Hex's windows count as in front
for what a capture is about, never for handing output to an app.
2026-10-26 21:55:14 -07:00
Kit Langton 31cc989c23 capture: Hex's own windows count; only its chrome is left out
Inside Hex the capture engine dropped every window of its own process, so a
capture of Hex's Settings had no front app, title, or window, and routing had
no Hex clue. Leave out only the host's chrome (its named windows and any of its
windows above the normal level) from the window log, clicks, AX hit tests,
targets, and the picker; Hex is the front app when its window is the topmost
normal one. With smart routing the captured app's checkout (…/hex) is then a
Guess, never a send.
2026-10-26 21:55:14 -07:00