Skip to content

feat: export replays to maestro yaml#751

Merged
thymikee merged 4 commits into
mainfrom
codex/maestro-export
Jun 10, 2026
Merged

feat: export replays to maestro yaml#751
thymikee merged 4 commits into
mainfrom
codex/maestro-export

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Adds a strict replay export <file.ad> --format maestro [--out <path>] path that converts compatible .ad replay actions into Maestro YAML without starting the daemon.

Includes exporter coverage for app launch, taps/selectors, text input, keyboard, assertions, gestures, screenshots, env directives, and explicit failures for unsupported agent-only actions. Docs now describe the export subset and warnings.

Touched 10 files; scope stayed within replay/Maestro export, CLI help, tests, and docs.

Validation

Ran pnpm check:quick successfully.

Ran focused unit coverage with pnpm exec vitest run src/compat/maestro/__tests__/export-flow.test.ts src/__tests__/cli-client-commands.test.ts src/utils/__tests__/args.test.ts successfully.

Manually smoke-tested node --experimental-strip-types src/bin.ts replay export /private/tmp/ad-export-smoke.ad --format maestro and --out /private/tmp/ad-export-smoke.yaml; both produced the expected Maestro YAML.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-10 18:11 UTC

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.2 MB 1.2 MB +11.8 kB
JS gzip 385.4 kB 389.9 kB +4.5 kB
npm tarball 497.3 kB 501.2 kB +3.9 kB
npm unpacked 1.7 MB 1.7 MB +11.9 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.9 ms 29.1 ms +1.2 ms
CLI --help 43.3 ms 45.1 ms +1.9 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/123.js +75.2 kB +24.4 kB
dist/src/2403.js +11.5 kB +4.2 kB
dist/src/cli.js +9.5 kB +3.0 kB
dist/src/session.js -9.9 kB -3.0 kB
dist/src/2415.js -4.3 kB -1.3 kB

@thymikee thymikee force-pushed the codex/maestro-export branch from bb7edcd to fb8c028 Compare June 10, 2026 17:16
@thymikee

Copy link
Copy Markdown
Member Author

Review finding:

[P1] replay export silently drops explicit long-press/hold durations.

src/compat/maestro/export-flow.ts maps both click/press --hold-ms <n> and longpress <target> <durationMs> to longPressOn without preserving or warning about the requested duration. That changes recorded replay behavior: the existing script writer can emit lines like longpress "label=\"Last message\"" 800, but agent-device replay export currently produces:

- longPressOn:
    label: Last message

The explicit 800 is gone, so the exported Maestro flow uses Maestro's default long-press behavior instead of the recorded duration. If Maestro cannot represent duration here, the exporter should at least warn or reject rather than silently changing semantics; if it can represent it, please thread the duration through and add a regression test for both longpress ... <duration> and press/click --hold-ms.

Validation I ran locally on the PR worktree:

  • pnpm exec vitest run src/compat/maestro/__tests__/export-flow.test.ts src/compat/maestro/__tests__/points.test.ts src/__tests__/cli-client-commands.test.ts src/utils/__tests__/args.test.ts passed, 142 tests.
  • pnpm build passed.
  • Built CLI smoke reproduced the dropped-duration output above.

@thymikee

Copy link
Copy Markdown
Member Author

Addressed in 0de157b. Maestro export now warns instead of silently dropping explicit long-press durations for both longpress <target> <durationMs> and click/press --hold-ms. Since this compat layer does not model a Maestro longPressOn duration field, the YAML remains longPressOn, but the CLI surfaces a warning with the requested duration.\n\nAdded regression coverage for recorded longpress, click --hold-ms, and press --hold-ms.\n\nValidation:\n- pnpm exec vitest run src/compat/maestro/__tests__/export-flow.test.ts src/compat/maestro/__tests__/points.test.ts src/__tests__/cli-client-commands.test.ts src/utils/__tests__/args.test.ts\n- pnpm format\n- pnpm check:quick\n- pnpm build\n- pnpm check:fallow --base origin/main\n- built CLI smoke for the reported longpress/hold-ms export case

@thymikee

Copy link
Copy Markdown
Member Author

Handled the optional nits in 278ff8d:\n\n- Plain replay now rejects extra input paths before daemon dispatch, so replay a.ad b.ad no longer gets accepted with the second path ignored.\n- Maestro export now warns when --count / --interval-ms are combined with doubleTapOn or longPressOn exports, instead of silently dropping those repeat/timing options.\n\nValidation:\n- pnpm exec vitest run src/compat/maestro/__tests__/export-flow.test.ts src/compat/maestro/__tests__/points.test.ts src/__tests__/cli-client-commands.test.ts src/utils/__tests__/args.test.ts\n- pnpm format\n- pnpm check:quick\n- pnpm build\n- pnpm check:fallow --base origin/main

@thymikee thymikee merged commit a89d68d into main Jun 10, 2026
20 checks passed
@thymikee thymikee deleted the codex/maestro-export branch June 10, 2026 18:10
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.

1 participant