"""Run beside busy-agent.mjs: python3 configure-scenario.py /path/to/main-checkout.
Then copy acp-busy-follow-up.e2e.ts into that checkout's scripts/scenarios/ and run
T3CODE_DEV_SEED=0 vp run scenarios:prove scripts/scenarios/acp-busy-follow-up.e2e.ts --base f03db4fbef59c42113e37c32897bf4d25d31cb2b --head cf62e93a9e705802ef7a3dfd68678d3fe5080d5e --upload-command 'ghdrop upload'
This configures the synthetic ACP agent locally; do not commit the changes.
"""
import json
from pathlib import Path
import sys
p = Path(sys.argv[1]) / 'scripts/scenarios/start-app.ts'
agent = str(Path(__file__).with_name('busy-agent.mjs').resolve())
s = p.read_text().replace('const REPLAY = { instanceId: "devReplay", model: "showcase" };', 'const REPLAY = { instanceId: "acpRegistry", model: "default" };')
s = s.replace('providerInstances: Object.fromEntries(', 'providerInstances: { acpRegistry: { driver: "acpRegistry", enabled: true, config: { source: "local", commandPath: process.execPath, commandArgs: [' + json.dumps(agent) + '] } }, ...Object.fromEntries(')
s = s.replace('      ),\n    }),', '      ) },\n    }),')
p.write_text(s)
