{
  "$schema": "http://json-schema.org/schema",
  "id": "NxAdspReactApp",
  "title": "React ADSP Application",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the application.",
      "$default": {
        "$source": "argv",
        "index": 0
      },
      "x-prompt": "What name would you like to use?"
    },
    "env": {
      "type": "string",
      "description": "ADSP environment / access service to target: test = access-uat.alberta.ca (UAT — use for dev and pre-prod), prod = access.alberta.ca, dev = ADSP platform dev (restricted). Defaults to test.",
      "$default": {
        "$source": "argv",
        "index": 1
      },
      "alias": "e",
      "enum": ["test", "prod", "dev"],
      "default": "test"
    },
    "tenant": {
      "type": "string",
      "description": "ADSP tenant name. Looks up the tenant realm and opens a single browser login, avoiding a separate interactive tenant selection.",
      "alias": "t"
    },
    "tenantRealm": {
      "type": "string",
      "description": "Keycloak realm UUID. Optional when --tenant is provided — overrides the realm looked up from the tenant service.",
      "alias": "tr"
    },
    "accessToken": {
      "type": "string",
      "description": "Access token for retrieving configuration from ADSP APIs.",
      "alias": "at"
    },
    "serviceClientId": {
      "type": "string",
      "description": "Client ID of a paired backend service (e.g. urn:ads:my-tenant:my-svc). When provided with --tenant, configures audience mapping and example-role scope on the frontend client.",
      "alias": "sc"
    },
    "proxy": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string"
              },
              "proxyPass": {
                "type": "string"
              }
            },
            "required": ["location", "proxyPass"]
          }
        },
        {
          "type": "object",
          "properties": {
            "location": {
              "type": "string"
            },
            "proxyPass": {
              "type": "string"
            }
          },
          "required": ["location", "proxyPass"]
        }
      ]
    },
    "pairedProject": {
      "type": "string",
      "description": "Name of an existing backend service project (e.g. an express-service) to derive the nginx/dev-server proxy config from automatically, plus the adsp:proxy-service: tag the sandbox executor reads to pre-create its Service. The project must already exist. --proxy is still available for additional entries this doesn't cover, but can't duplicate the location this derives."
    },
    "skipAgent": {
      "type": "boolean",
      "description": "Skip the consultAgent interaction and generate base scaffolding only.",
      "default": false
    }
  },
  "required": ["name", "env"],
  "additionalProperties": false
}
