feat(mcp): 録画中の座標ログ蓄積機能#1
feat(mcp): 録画中の座標ログ蓄積機能#1sinano1107 wants to merge 8 commits intofeat/mcp-coordinate-logging-basefrom
Conversation
RecordingManager now accumulates tap/swipe coordinates with wall-clock timestamps during recording. On stop, ffprobe reads the video duration and timestamps are corrected to video-relative time. stop_recording returns coordinate_log alongside video_path and duration. TapOnTool appends tap coordinates when a recording is active (no-op otherwise). RunFlowTool appends swipe coordinates when CommandResult contains start_point/end_point. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Record wall-clock timestamp before orchestra.runFlow() instead of after, so the coordinate log reflects when the command was dispatched rather than when it completed (which includes settle wait time). appendTapEvent/appendSwipeEvent now accept an explicit timestampMs parameter. captureTimestamp() is exposed for callers to record time before executing commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Capture wall-clock time both before and after orchestra.runFlow(), then use the midpoint as the event timestamp. This splits the error between element resolution (before tap) and settle wait (after tap), giving better accuracy than either extreme alone. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the wall-clock anchor to after the recording process has stopped, so the timestamp correction is not offset by the stop operation duration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
詳細レビュー結果5件の指摘を検出し、スコアリングで評価した。閾値(80)を超える指摘はなし。 1. run_flow内の全swipeが同一タイムスタンプ(スコア: 75)
判定: run_flowの説明が"preferably one at a time"と明記しており、実用上は単一コマンドで使われる。また 2. run_flow経由のtapが座標ログに記録されない(スコア: 65)
判定: PR説明で「CommandResultにstart_point/end_pointがある場合のみswipeとして蓄積」と意図的設計を明記。tap_onが主要なtapインターフェースであり、実用上の影響は限定的。 3. ffprobe失敗時に動画パスが返らない(スコア: 50)
判定: ffprobeは座標ログ機能の必須依存。未インストール時は機能全体が非機能になるため、個別のフォールバックは過剰。tempファイルはシャットダウン時にクリーンアップされる。 4.
|
- start_recording: document that tap_on/run_flow auto-log coordinates - tap_on: document coordinate logging during active recording - run_flow: document swipe coordinate logging and limitations (direction/relative swipes not logged) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
概要
録画中のtap/swipe座標を自動蓄積し、
stop_recording時にffprobeで動画内タイムスタンプに補正してcoordinate_logとして返却する。依存
feat/mcp-recording-tools-upstream(録画ツール本体)feat/mcp-tap-bounds(tap_on/run_flowのbounds/center返却、upstream PR feat(mcp): include resolved element bounds in tap_on and run_flow responses mobile-dev-inc/Maestro#3123)変更内容
RecordingManager
InteractionEvent/CoordinateLogEntryデータクラス追加appendTapEvent()/appendSwipeEvent(): 録画中のみイベントを蓄積(録画なしならno-op)captureTimestamp(): テスタビリティのためのclock wrapperstopRecording()にffprobeによるduration取得とタイムスタンプ補正を追加actual_start = stop_time - durationoffset = (event.wallClock - actual_start) / 1000.0stopWallClockMsはstopScreenRecording()の後に記録(録画停止処理分のズレ防止)TapOnTool
runFlow()の前後でタイムスタンプを記録し、中間値を使用recordingManager.appendTapEvent()を呼び出しRunFlowTool
CommandResultにstart_point/end_pointがある場合のみswipeとして蓄積StopRecordingTool
durationとcoordinate_logを追加center配列、swipe:start_point/end_point配列タイムスタンプ精度
テスト
start_recording→tap_on→swipe→tap_on→stop_recordingのフローを確認済み