#!/usr/bin/env python3
"""Synthetic settings used on both commits. Run before starting an isolated dev server.
Usage: python3 seed.py <fresh-home>
Then start with T3CODE_DEV_SEED=0, T3CODE_ENVIRONMENT_LABEL="Policy demo",
T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD=0 and
T3CODE_DEV_MANAGED_POLICY_PATH=<fresh-home>/policy.json.
Add the project through: node apps/server/src/bin.ts project add <fresh-home>/proj
--title proj --base-dir <fresh-home> (with T3CODE_PORT set to the server port).
Pair a fresh Pixel 9 Android API 36 dev client, open New thread and choose proj.
No model turn or provider login is needed to exercise the saved selection resolver.
"""
import json
import sys
from pathlib import Path
home = Path(sys.argv[1])
(home / "userdata").mkdir(parents=True, exist_ok=True)
(home / "proj").mkdir(exist_ok=True)
settings = {
    "defaultModelSelection": {"instanceId": "antigravity", "model": "gemini-3.8-flash"},
    "providerInstances": {
        "codex": {"driver": "codex", "enabled": True, "config": {}},
        "antigravity": {"driver": "antigravity", "enabled": True,
                        "config": {"authMethod": "gemini-api-key"}}
    }
}
policy = {"schemaVersion": 1, "organization": "Example Corp",
          "limits": {"providers": {"allowedDrivers": ["codex"]}}}
(home / "userdata/settings.json").write_text(json.dumps(settings))
(home / "policy.json").write_text(json.dumps(policy))
