import json, pathlib, sys
root = pathlib.Path(sys.argv[1]).resolve()
home = root / '.t3'
(home / 'userdata').mkdir(parents=True, exist_ok=True)
settings = {
 'defaultModelSelection': {'instanceId':'devReplay','model':'multi-turn'},
 'textGenerationModelSelection': {'instanceId':'cursor','model':'auto'},
 'providerInstances': {driver:{'driver':driver,'enabled':driver=='cursor'} for driver in ['codex','claudeAgent','cursor','grok','muse','pi','opencode','antigravity']},
 'defaultTheme':'dark',
}
(home / 'userdata/settings.json').write_text(json.dumps(settings, indent=2))
helper = root / 'node_modules/.pnpm/@cursor+sdk-linux-x64@1.2.0/node_modules/@cursor/sdk-linux-x64/bin/cursorsandbox'
if helper.exists(): helper.rename(helper.with_name('cursorsandbox.disabled-for-reproduction'))
workspace = home / 'workspaces' / 'safari-login'
workspace.mkdir(parents=True, exist_ok=True)
(workspace / 'README.md').write_text('# Safari login example\n')
print('Fresh settings and synthetic workspace prepared; bundled sandbox helper unavailable.')
