#!/usr/bin/env bash
set -euo pipefail
# Run from each commit's checkout after starting its isolated dev:desktop server
# with T3CODE_DEV_SEED=0. Do not point --base-dir at your real installation.
checkout=$1
base_dir=$2
cd "$checkout"
node apps/server/src/bin.ts project add --base-dir "$base_dir" --title 'T3 Code' "$checkout"
node apps/server/src/bin.ts thread start --base-dir "$base_dir" --provider codex --model gpt-6-luna --title 'Comment timestamp links' --wait --json "$checkout" 'Reply with only these two markdown links: [Issue #42840](https://github.com/pingdotgg/t3code/issues/42840) and [PR #42837](https://github.com/pingdotgg/t3code/pull/42837).'
# Finish onboarding without import; choose Settings > Browser > Open links in > T3 Code.
# Open the seeded thread and collapse the main sidebar and thread details panel.
# Use a 1440x900 light-theme Electron window at screen origin (0,0).
# capture.cjs requires CHECKOUT, EVIDENCE_ROOT, SIDE (base/head), CDP_PORT,
# DISPLAY and XAUTHORITY. Stub xdg-open on PATH before launching Electron:
#   printf '%s\n' "$1" >> "$EVIDENCE_EXTERNAL_LOG"
# EVIDENCE_EXTERNAL_LOG must be EVIDENCE_ROOT/SIDE-external.log.
