Skip to content

Publish configurable 4:3 TUI replay bundles with GIF fallbacks#47

Merged
konard merged 4 commits into
mainfrom
issue-46-4753eee86095
Jul 25, 2026
Merged

Publish configurable 4:3 TUI replay bundles with GIF fallbacks#47
konard merged 4 commits into
mainfrom
issue-46-4753eee86095

Conversation

@konard

@konard konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • forwards aspectRatio and renderer artifactOptions through captureAgentTui;
  • gives all six supported agent TUIs an 80-column, 4:3 default capture geometry (80×30 with the renderer's 2:1 cell ratio);
  • emits SVG and GIF replay artifacts by default and allows callers to select svg, gif, cast, frames, and transcript outputs;
  • documents renderer sizing, padding, theme colors, and explicit borderRadius: 0;
  • patches command-stream@0.17.0's CommonJS/ESM gifenc normalization until the upstream correction tracked in GIF artifact rendering fails on Node 20: GIFEncoder is not a function link-foundation/command-stream#183 is released.

Reproduction

Before this change, capture geometry was forwarded as undefined unless callers hardcoded both dimensions, artifactOptions was discarded, and the replay bundle did not provide a GIF fallback.

The first implementation exposed a second reproducible problem on Node 20 across Ubuntu, macOS, and Windows:

TypeError: GIFEncoder is not a function
    at renderGif (.../command-stream/src/terminal-artifacts.mjs:429:15)

gifenc is CommonJS and Node exposes its API under the dynamic import's default namespace, while Bun exposes named exports. The included dependency patch prefers named exports and falls back to default; clean npm ci installs apply it automatically.

Tests

js/test/tui.test.mjs verifies:

  • every supported agent defaults to an 80×30 initial PTY;
  • explicit dimensions remain unchanged;
  • renderer options reach generated SVG (borderRadius: 0, colors, font, and cell sizing);
  • the default replay bundle contains a non-empty GIF;
  • selective bundles remove formats the caller did not request.

Local validation:

npm ci                    command-stream@0.17.0 patch applied
npm test                  239 passed
bun test                  239 passed
npm run lint              passed (pre-existing warnings only)
npm run format:check      passed
npm run check:duplication passed
npm pack --dry-run        patch included in package

Fixes #46

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #46
@konard konard self-assigned this Jul 25, 2026
@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Implementation and regression coverage are complete locally, but final reproducible Node CI is blocked by an upstream command-stream@0.17.0 GIF interop defect: link-foundation/command-stream#183. The exact fix is a one-line CommonJS/ESM namespace normalization; with that applied only to the local installed dependency, all 239 JavaScript tests pass. Waiting for an upstream release rather than checking a patch into this package.

@konard konard changed the title [WIP] Expose renderer options, default capture geometry to 4:3, and emit GIF in replay bundles [WIP] Publish configurable 4:3 TUI replay bundles with GIF fallbacks Jul 25, 2026
@konard konard changed the title [WIP] Publish configurable 4:3 TUI replay bundles with GIF fallbacks 'Publish configurable 4:3 TUI replay bundles with GIF fallbacks' Jul 25, 2026
@konard
konard marked this pull request as ready for review July 25, 2026 19:31
@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $9.129109

📊 Context and tokens usage:

  • 184.7K / 200K (92%) input tokens, 17.7K / 128K (14%) output tokens

Total: (184.7K + 6.5M cached) input tokens, 17.7K output tokens, $9.129109 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: low (~7999 tokens)
  • Model: GPT 5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (2126KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart triggered (iteration 1)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard konard changed the title 'Publish configurable 4:3 TUI replay bundles with GIF fallbacks' Publish configurable 4:3 TUI replay bundles with GIF fallbacks Jul 25, 2026
@konard
konard force-pushed the issue-46-4753eee86095 branch from 7ac95ce to c36c5c3 Compare July 25, 2026 19:42
@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Fixed and pushed to PR 47.

  • Patched command-stream@0.17.0 GIF import interoperability for Node and Bun.
  • Verified clean npm ci applies the patch.
  • Full Node and Bun suites pass: 239 tests each.
  • Lint, formatting, duplication, and package-content checks pass.
  • All fresh JavaScript and Rust CI runs pass across Ubuntu, macOS, and Windows.
  • PR is ready, mergeable, and has a clean working tree.

Commit: c36c5c3


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Auto-restart-until-mergeable Log (iteration 1)

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $7.309405
  • Token usage: 147,603 input, 12,411 output, 2,646 reasoning, 5,274,880 cache read

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Model: GPT 5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (3961KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit bc98cf6 into main Jul 25, 2026
50 checks passed
@konard

konard commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose renderer options, default capture geometry to 4:3, and emit GIF in replay bundles

1 participant