{
  "$schema": "https://super-calendar.io/agents/workflows.schema.json",
  "name": "Super Calendar Agent Workflows",
  "version": "1.0.0",
  "global_rules": [
    "Stop on missing required parameters.",
    "Do not invent routes, formats, surfaces, or parameters.",
    "Use user explicit input before runtime defaults.",
    "Use OpenAPI for HTTP execution.",
    "Use I/O API for low-level node reads.",
    "Use i18n manifest for language availability.",
    "Treat private feed URLs as credentials."
  ],
  "state_machines": {
    "create_feed": {
      "description": "Create or explain a calendar feed.",
      "initial": "INIT",
      "terminal": [
        "DONE",
        "REPORT_MISSING_CAPABILITY",
        "ERROR"
      ],
      "states": {
        "INIT": {
          "next": [
            "READ_CONTRACTS"
          ]
        },
        "READ_CONTRACTS": {
          "contracts": [
            "/agents/capabilities.json",
            "/api/docs/json"
          ],
          "next": [
            "DISCOVER_DOMAIN"
          ]
        },
        "DISCOVER_DOMAIN": {
          "next": [
            "VALIDATE_DOMAIN",
            "ASK_DOMAIN"
          ]
        },
        "ASK_DOMAIN": {
          "next": [
            "VALIDATE_DOMAIN"
          ]
        },
        "VALIDATE_DOMAIN": {
          "next": [
            "SELECT_SURFACE",
            "REPORT_MISSING_CAPABILITY"
          ]
        },
        "SELECT_SURFACE": {
          "next": [
            "VALIDATE_PARAMETERS"
          ]
        },
        "VALIDATE_PARAMETERS": {
          "next": [
            "ASK_MISSING_PARAMETERS",
            "BUILD_URL"
          ]
        },
        "ASK_MISSING_PARAMETERS": {
          "next": [
            "VALIDATE_PARAMETERS"
          ]
        },
        "BUILD_URL": {
          "next": [
            "OUTPUT_ACTIONS"
          ]
        },
        "OUTPUT_ACTIONS": {
          "next": [
            "DONE"
          ]
        },
        "REPORT_MISSING_CAPABILITY": {
          "next": []
        },
        "ERROR": {
          "next": []
        },
        "DONE": {
          "next": []
        }
      }
    },
    "developer_integration": {
      "description": "Explain or build a developer integration.",
      "initial": "INIT",
      "terminal": [
        "DONE",
        "REPORT_MISSING_CAPABILITY",
        "ERROR"
      ],
      "states": {
        "INIT": {
          "next": [
            "READ_OPENAPI"
          ]
        },
        "READ_OPENAPI": {
          "contracts": [
            "/api/docs/json"
          ],
          "next": [
            "IDENTIFY_ROUTE"
          ]
        },
        "IDENTIFY_ROUTE": {
          "next": [
            "CONFIRM_PARAMS",
            "REPORT_MISSING_CAPABILITY"
          ]
        },
        "CONFIRM_PARAMS": {
          "next": [
            "CONFIRM_FORMATS"
          ]
        },
        "CONFIRM_FORMATS": {
          "next": [
            "BUILD_MINIMAL_EXAMPLE"
          ]
        },
        "BUILD_MINIMAL_EXAMPLE": {
          "next": [
            "DONE"
          ]
        },
        "REPORT_MISSING_CAPABILITY": {
          "next": []
        },
        "ERROR": {
          "next": []
        },
        "DONE": {
          "next": []
        }
      }
    },
    "low_bandwidth_read": {
      "description": "Read a small deterministic I/O node.",
      "initial": "INIT",
      "terminal": [
        "DONE",
        "REPORT_MISSING_CAPABILITY",
        "ERROR"
      ],
      "states": {
        "INIT": {
          "next": [
            "READ_IOAPI"
          ]
        },
        "READ_IOAPI": {
          "contracts": [
            "/io/ioapi.json"
          ],
          "next": [
            "IDENTIFY_NODE"
          ]
        },
        "IDENTIFY_NODE": {
          "next": [
            "VALIDATE_NODE_PATH",
            "REPORT_MISSING_CAPABILITY"
          ]
        },
        "VALIDATE_NODE_PATH": {
          "next": [
            "READ_NODE"
          ]
        },
        "READ_NODE": {
          "next": [
            "DONE"
          ]
        },
        "REPORT_MISSING_CAPABILITY": {
          "next": []
        },
        "ERROR": {
          "next": []
        },
        "DONE": {
          "next": []
        }
      }
    },
    "runtime_language_resolution": {
      "description": "Resolve anonymous language without identity inference.",
      "initial": "INIT",
      "terminal": [
        "DONE",
        "ERROR"
      ],
      "states": {
        "INIT": {
          "next": [
            "READ_I18N_MANIFEST"
          ]
        },
        "READ_I18N_MANIFEST": {
          "contracts": [
            "/common/i18n/manifest.json"
          ],
          "next": [
            "CHECK_EXPLICIT_INPUT"
          ]
        },
        "CHECK_EXPLICIT_INPUT": {
          "next": [
            "SELECT_EXPLICIT",
            "CHECK_APP_CONFIG"
          ]
        },
        "CHECK_APP_CONFIG": {
          "next": [
            "SELECT_APP_CONFIG",
            "CHECK_BROWSER_PREFERENCE"
          ]
        },
        "CHECK_BROWSER_PREFERENCE": {
          "next": [
            "SELECT_BROWSER",
            "CHECK_DOCUMENT_DEFAULT"
          ]
        },
        "CHECK_DOCUMENT_DEFAULT": {
          "next": [
            "SELECT_DOCUMENT_DEFAULT",
            "SELECT_SYSTEM_FALLBACK"
          ]
        },
        "SELECT_EXPLICIT": {
          "next": [
            "DONE"
          ]
        },
        "SELECT_APP_CONFIG": {
          "next": [
            "DONE"
          ]
        },
        "SELECT_BROWSER": {
          "next": [
            "DONE"
          ]
        },
        "SELECT_DOCUMENT_DEFAULT": {
          "next": [
            "DONE"
          ]
        },
        "SELECT_SYSTEM_FALLBACK": {
          "next": [
            "DONE"
          ]
        },
        "DONE": {
          "next": []
        },
        "ERROR": {
          "next": []
        }
      },
      "forbidden_inputs": [
        "ip_address",
        "network_country",
        "geolocation",
        "fingerprint"
      ]
    }
  }
}

