{
  "schema_version": "0.1",
  "name": "Sortiri",
  "homepage": "https://sortiri.ai",
  "description": "AI fitness coach for iOS. Prefer POST /beta/apply for beta signup or POST /onboarding/draft for fitness setup; browser fallback at /beta?mode=agent and /setup?mode=agent.",
  "actions": [
    {
      "id": "submit_beta_application",
      "name": "Submit beta application",
      "description": "Apply for the Sortiri beta (20 spots). Returns confirmUrl and statusUrl for the human to confirm email.",
      "method": "POST",
      "endpoint": "https://ideal-dolphin-65.convex.site/beta/apply",
      "parameters": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "minLength": 2 },
          "email": { "type": "string", "format": "email" },
          "answers": {
            "type": "object",
            "required": ["whyJoin", "goal", "experienceLevel", "hasIosDevice", "weeklyAvailability"],
            "properties": {
              "whyJoin": { "type": "string" },
              "goal": { "type": "string", "enum": ["lose_fat", "build_muscle", "recomp", "maintain"] },
              "experienceLevel": { "type": "string", "enum": ["beginner", "intermediate", "advanced"] },
              "hasIosDevice": { "type": "boolean" },
              "weeklyAvailability": { "type": "string", "enum": ["1_2", "3_4", "5_plus"] },
              "xHandle": { "type": "string" }
            },
            "additionalProperties": false
          },
          "agentMeta": {
            "type": "object",
            "properties": {
              "agentName": { "type": "string" },
              "submittedBy": { "type": "string" }
            }
          },
          "utmSource": { "type": "string" }
        },
        "required": ["name", "answers"],
        "additionalProperties": false
      }
    },
    {
      "id": "get_beta_application_status",
      "name": "Get beta application status",
      "description": "Poll application status; returns welcome links when accepted.",
      "method": "GET",
      "endpoint": "https://ideal-dolphin-65.convex.site/beta/status/{applicationToken}",
      "parameters": {
        "type": "object",
        "properties": {
          "applicationToken": { "type": "string" }
        },
        "required": ["applicationToken"],
        "additionalProperties": false
      }
    },
    {
      "id": "create_onboarding_draft",
      "name": "Create onboarding draft",
      "description": "Interview the human for setup answers, then create a fitness plan draft and return a claim URL for email verification.",
      "method": "POST",
      "endpoint": "https://ideal-dolphin-65.convex.site/onboarding/draft",
      "parameters": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Ask the human during intake. Prefills the claim page and routes the OTP to this inbox. Omit only if they prefer to enter email on the claim page."
          },
          "answers": {
            "type": "object",
            "required": [
              "goal",
              "mealsPerDay",
              "workoutsPerWeek",
              "weighInsPerWeek",
              "dob",
              "gender",
              "units",
              "height",
              "currentWeight",
              "activityLevel",
              "notificationsEnabled",
              "aiConsentAccepted",
              "dailyWaterGoalMl",
              "dailyCalorieGoal",
              "macroProtein",
              "macroCarbs",
              "macroFat",
              "pregnancyModeEnabled",
              "cycleTrackingEnabled"
            ],
            "properties": {
              "goal": {
                "type": "string",
                "enum": ["lose_fat", "build_muscle", "recomp", "maintain"]
              },
              "mealsPerDay": { "type": "integer", "minimum": 2, "maximum": 5 },
              "workoutsPerWeek": { "type": "integer", "minimum": 2, "maximum": 5 },
              "weighInsPerWeek": { "type": "integer", "enum": [1, 2, 3, 7] },
              "dob": { "type": "string", "format": "date" },
              "gender": { "type": "string", "enum": ["male", "female", "other"] },
              "units": { "type": "string", "enum": ["metric", "imperial"] },
              "height": { "type": "string" },
              "currentWeight": { "type": "string" },
              "activityLevel": { "type": "integer", "enum": [20, 40, 50, 70, 90] },
              "notificationsEnabled": { "type": "boolean" },
              "aiConsentAccepted": { "type": "boolean" },
              "email": { "type": "string", "format": "email" },
              "dailyWaterGoalMl": { "type": "integer" },
              "dailyCalorieGoal": { "type": "integer" },
              "macroProtein": { "type": "integer" },
              "macroCarbs": { "type": "integer" },
              "macroFat": { "type": "integer" },
              "pregnancyModeEnabled": { "type": "boolean" },
              "pregnancyDueDateStr": { "type": "string", "format": "date" },
              "cycleTrackingEnabled": { "type": "boolean" },
              "lastPeriodStartDateStr": { "type": "string", "format": "date" },
              "averageCycleLengthDays": { "type": "integer", "enum": [26, 28, 30, 32] }
            },
            "additionalProperties": false
          }
        },
        "required": ["answers"],
        "additionalProperties": false
      }
    },
    {
      "id": "read_agent_spec",
      "name": "Read agent specification",
      "description": "Fetch the complete machine-readable onboarding specification.",
      "method": "GET",
      "endpoint": "https://sortiri.ai/agent.txt",
      "parameters": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    }
  ]
}
