"""Run from either installed checkout before starting its dev server.
Place claude-fixture.mjs beside this script. No live data is read.
Then run T3CODE_DEV_SEED=0 vp run dev and the CLI commands below.
"""
import json, pathlib, subprocess
root = pathlib.Path.cwd()
fixture = pathlib.Path(__file__).with_name('claude-fixture.mjs').resolve()
home = root / '.t3'
(home / 'userdata').mkdir(parents=True, exist_ok=True)
instances = {d: {'driver': d, 'enabled': False} for d in ['codex', 'cursor', 'grok', 'muse', 'pi', 'opencode', 'antigravity']}
instances['claudeAgent'] = {'driver': 'claudeAgent', 'enabled': True, 'config': {'binaryPath': str(fixture), 'customModels': [{'slug': 'summary-fixture', 'name': 'Summary fixture'}]}}
(home / 'userdata/settings.json').write_text(json.dumps({'defaultModelSelection': {'instanceId': 'claudeAgent', 'model': 'summary-fixture'}, 'providerInstances': instances}))
project = root / 'summary-demo'
project.mkdir(exist_ok=True)
(project / 'math.ts').write_text('export function add(a: number, b: number) {\n  return a + b;\n}\n\nexport function mean(values: number[]) {\n  return values.reduce(add, 0) / values.length;\n}\n\nexport function square(n: number) {\n  return n * n;\n}\n')
for args in [['init', '--quiet', '--initial-branch=main'], ['add', 'math.ts'], ['-c', 'user.name=Evidence', '-c', 'user.email=evidence@example.invalid', 'commit', '-qm', 'Add math functions']]:
    subprocess.run(['git', '-C', str(project), *args], check=True)
# After the server starts:
# node apps/server/src/bin.ts project add summary-demo --title 'Math functions' --base-dir .t3
# node apps/server/src/bin.ts thread start summary-demo 'Use a foreground subagent to list the functions in math.ts with their line numbers.' --title 'Math function summary' --provider claudeAgent --model summary-fixture --wait --json --base-dir .t3
# Open the thread in the web client (1280x800, light), hide sidebars, expand Worked for,
# inspect the row, then click List functions in math.ts to inspect its result.
