7 Commits

Author SHA1 Message Date
Olli Paloviita 0f211bea64 editor: apply deferred (pending) codegen edits on connect
Accept codegen requests queued while no machine was connected: the poll
loop applies them like any other edit and logs "queued by <name>"
attribution. Update the editor docs to describe pending edits and code
sync.
2026-07-13 02:18:41 +03:00
Olli Paloviita 351db23822 WIP: editor branch work in progress (auto-committed before merging fable6) 2026-07-12 16:39:20 +03:00
Olli Paloviita eacc5df17a editor codegen for options and narration, dev source watching
- optionsEdit and narrationEdit records (timeline edits v4): render/record
  option snapshots merge into .renderOptions/.recordOptions builder calls
  (section added when missing), narration cue values merge into the
  video.narration declaration via the new setNarrationValue codemod
  (content-major and language-major forms, conversion to language-major on
  a non-default language edit, names-only declarations stay app-managed)
- applyCodegenRequest wires the new records into planCodeSync
- screenci dev watches the managed videos' test sources and
  screenci.config.ts (src/devWatch.ts): a real content change re-records
  the affected videos as previews through a new machine-local record job
  in the listen loop; codegen self-writes are baseline-suppressed;
  --no-watch disables it
- docs: cli.mdx dev watching, editor.md option/narration codegen coverage
2026-07-12 00:04:38 +03:00
Olli Paloviita 04393fa30e feat: code-as-source-of-truth editing via dev codegen channel
Editor edits now arrive over the dev channel as codegen requests and are
written straight into the .screenci.ts sources; recordings always run purely
from code values.

- Keep data.json across uploads (media-only cleanup, last-data.json rename)
  and stamp a sourceHash of the test file into its metadata.
- screenci dev startup handshake: skip recording when the source hash matches
  and every editable action has an editId; otherwise stamp missing editIds
  and re-record as a preview. New --grep, --force-record and
  --record-kill-window flags.
- Dev loop: records run in a killable background slot while the loop keeps
  polling; codegen requests apply serially via the codemod pipeline and are
  acked over /cli/dev/report-codegen; fast-poll during active editing;
  kill-or-queue policy for superseding record triggers; sync-state reporting
  locks editor timelines during the startup handshake.
- Remove the server-override machinery: editable-actions.json and
  action-params.json snapshots, SCREENCI_TIMELINE_EDITS injection, runtime
  override application, screenci sync / status / reset-web-edits and
  dev --sync.
2026-07-11 21:52:29 +03:00
Olli Paloviita 9ca337359e cli: thread previewOnly through the dev record trigger
A preview-only dev trigger (from the web editor's raw-record button)
records normally but uploads into the video's preview slot without a
render. DevTrigger.previewOnly flows to runTriggeredRecord, which sets
SCREENCI_PREVIEW_ONLY so the upload body carries previewOnly, mirroring
the SCREENCI_SKIP_RENDER pattern.
2026-07-09 17:37:55 +03:00
Olli Paloviita 7f18152cab screenci dev: tolerate empty poll responses instead of warning
An empty 2xx body from the /cli/dev/* proxy (or an idle keep-alive) made
postDev's res.json() throw "Unexpected end of JSON input", which the poll loop
logged as "Connection problem, retrying" and backed off on. Read the body as
text and treat an empty one as an empty result, so an empty poll response is a
no-op instead of a spurious connection error.
2026-07-08 19:28:13 +03:00
Olli Paloviita 9c4cfd284f Add screenci dev: connect this machine to the editor for on-demand records
New long-running command that registers a dev listener with the service,
short-polls for record triggers from the web editor, runs the requested
video and language through the normal record and upload path, and reports
status back. Authenticates with SCREENCI_SECRET plus a personal
SCREENCI_DEV_TOKEN so only the token owner's web session can trigger
records on this machine.

The previously removed dev command name is reintroduced on purpose; the
regression test now asserts the command exists instead.
2026-07-08 14:27:32 +03:00